• Home
  • History
  • Annotate
  • only in /frameworks/av/media/mtp/
History log of /frameworks/av/media/mtp/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5410756e75fb7567540f13d3813f42f4ac3838a0 15-May-2017 Jerry Zhang <zhangjerry@google.com> Fix file transfer corner cases.

Fix zero packet read/write in corner cases
with initial read/writes. This affects transfers
of 16372 bytes to the device and transfers of
1012 bytes (or packet size - 12) from the device.

Test: Transfer various length files
Bug: 37175601
Change-Id: Ic1281e8757d1a33d78c66d2c57319b5ee38d6a46
MtpHandle.h
tpDevHandle.cpp
tpFfsHandle.cpp
tpFfsHandle.h
tpServer.cpp
ests/MtpFfsHandle_test.cpp
c9cbf9870c28d5c65e7363db5291a4b89e1a8e8d 15-Apr-2017 Jerry Zhang <zhangjerry@google.com> Fix zero length packet handling

Ensure that a zero length packet is properly sent
/ received when handling data that is a multiple of the
endpoint size.

This fixes an issue where files whose size is a multiple
of the endpoint size would hang during transfer.

Bug: 37175601
Test: check successful file transfer.
Change-Id: Iaf3cea18422234d65b59f5961ef9fb3f3ee2049a
tpFfsHandle.cpp
7063c936e50326883e672837036381f77080c2f3 05-Apr-2017 Jerry Zhang <zhangjerry@google.com> Wait for threads to finish before returning.

Prevents the thread struct from being deallocated
before the thread has finished.

Bug: 35152606
Test: Transfer files in both directions, verify behavior when
interrupted

Change-Id: Ic247072234977709711366636e6a39031fbc125a
syncIO.cpp
syncIO.h
tpFfsHandle.cpp
0475d911fcc1e6e1b4f49626f59a0a07038590fa 03-Apr-2017 Jerry Zhang <zhangjerry@google.com> Add timeout to lock in MtpServer configure

In situations where MtpServer is in a bad state, this will prevent
the configure call from blocking indefinitely, which will prevent
a few visible problems and allow the state to recover on the next
config change.

Bug: 34873000
Test: Connect to AA test sled
Change-Id: I5daf9cfcec69c967bde6bf3f6fd90e1c434e18bb
tpFfsHandle.cpp
tpFfsHandle.h
cde65569ec8bd25a2dd3efd32d35fa0341f2d80a 08-Mar-2017 Jerry Zhang <zhangjerry@google.com> Merge "Add support for MTP_RESET_DEVICE operation." am: 52afe9d2cf am: bf7c90ad04
am: 6bf6de3752

Change-Id: I0f643f12c720ef2c31848fe01704afcd094d7f46
bf7c90ad0445740c77b2ee380f382d937bdd67a8 08-Mar-2017 Jerry Zhang <zhangjerry@google.com> Merge "Add support for MTP_RESET_DEVICE operation."
am: 52afe9d2cf

Change-Id: I36c8e325e2b2dde85cb2a3546508c95e5da77e57
6dafeccb9c82e2b1328f36fbce1b26e7799b1100 24-Feb-2017 Jerry Zhang <zhangjerry@google.com> Add support for MTP_RESET_DEVICE operation.

Since we only support one open session, this
command is the same as CLOSE_SESSION.

Test: mtp-reset
Change-Id: I2e95687a685af239c92473feb7c98419fcd55a1e
tpServer.cpp
9a161f06819e8bc5627a3e4384bf4774e3e4a1e1 01-Mar-2017 Yunlian Jiang <yunlian@google.com> Merge "fix warning: dereference of a null pointer" am: 9a6b9ed394 am: 90b59dbb0d
am: daaea6d2f1

Change-Id: If2eb8cba1df0760fb2c01e65e28d9b3f8ec4912c
90b59dbb0d5e42e85f93e284f2ac47d4e6f7540b 01-Mar-2017 Yunlian Jiang <yunlian@google.com> Merge "fix warning: dereference of a null pointer"
am: 9a6b9ed394

Change-Id: I8f944dd30a2663262baa00a08c1e4204a29242eb
9a6b9ed394c3ece622029ce5c169f19fd55de5b3 01-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "fix warning: dereference of a null pointer"
99c915d334e3810784474900297ee13d7523e61c 23-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Raise MTP max burst values." am: b95db7560e am: 840e2dcbae
am: 01520fce87

Change-Id: Ie378fdc9908d4f6830e3bfedc3884bfbb5a322b4
840e2dcbae8d17bb6f092df32cb12324e18090b9 23-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Raise MTP max burst values."
am: b95db7560e

Change-Id: I56563e74a34598d6e4415f0c2054932f88cd8bd2
2a14168f59bf5ad6e0cddb28c23f3e7fef75ac89 13-Feb-2017 Jerry Zhang <zhangjerry@google.com> Raise MTP max burst values.

Slightly increases transfer speeds on USB 3.0 connections.

Test: Transfer files
Change-Id: I25fb0a37fa92063356c4a2a0e0ba7f011b6b0527
tpFfsHandle.cpp
79a9526b3314fd133355ce7ba68e8465c98137c7 22-Feb-2017 Yunlian Jiang <yunlian@google.com> Merge "fix warning: struct argument contains uninitialized data" am: 4ad8990c14 am: fa4baa3422
am: 1affa6440d

Change-Id: Iaa8594d8fdce768104e77d2df8aa5a0728bb767a
fa4baa3422c095e7c640c5725b5f6bba8b467cca 22-Feb-2017 Yunlian Jiang <yunlian@google.com> Merge "fix warning: struct argument contains uninitialized data"
am: 4ad8990c14

Change-Id: If332f7d2f5be4180f4cf32f92ae86d62711f3b9b
4ad8990c1466fe3a43c9726e96416032be28c709 22-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "fix warning: struct argument contains uninitialized data"
9f84bbbce06b8aa6f59d760d85897c0d0c4d101e 22-Feb-2017 Yunlian Jiang <yunlian@google.com> Merge "fix uninitialized warning." am: 2008d8857c am: ad17ddb376
am: bae27c1095

Change-Id: Ie8814a45544bbe9248d6116336547eb67b675583
ad17ddb376a88792635bb7155a735c56060870f3 22-Feb-2017 Yunlian Jiang <yunlian@google.com> Merge "fix uninitialized warning."
am: 2008d8857c

Change-Id: I867d7b49f827b4817186b0d13a17de62bc143e7c
746f8acd98c474be1c8b32df570667fda219bb10 22-Feb-2017 Yunlian Jiang <yunlian@google.com> fix uninitialized warning.

This fixes warning: The left operand of '%' is a garbage value.

Bug: None.
Test: The warning is gone.
Change-Id: I191e5bfd9d5f5136afcc2b5d8277c44b7d223998
tpFfsHandle.cpp
8ddc352c3159afeb498b741138115e040d596e1d 22-Feb-2017 Yunlian Jiang <yunlian@google.com> fix warning: struct argument contains uninitialized data

This fixes the warning warning: Passed-by-value struct argument contains
uninitialized data (e.g., field: 'command') [clang-analyzer-core.CallAndMessage]

Bug: None
Test: The warning is gone.
Change-Id: I3e06ff484bdec995c5125433acb5c3f14dc29dd9
tpServer.cpp
6bd0c13eaa13b089bbe414a05b0ed834c825d587 10-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Increase EP_ALLOC ioctl number." am: c21b625d06 am: eb93f3b468 am: 95af699869
am: 7a296e9121

Change-Id: Iea5ddcc194449c5e634189a6f88a32f44a81c0b2
7a296e912198e54ea8867b450b9cbdced5b8f7d9 10-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Increase EP_ALLOC ioctl number." am: c21b625d06 am: eb93f3b468
am: 95af699869

Change-Id: Ib62d37947f025920819ae80c9be505aebf6e31d7
52a93bbb3b57d1a730aedaee0b9ec22e4c71551d 10-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Update MtpFfsHandle tests, add new tests for small and partial files" am: ddc029afc7 am: 47c772f677 am: 61c034aa35
am: 79902b1700

Change-Id: I38f9c56c6a0a5b79c38b6ce6ace14ca60bb94237
79902b1700b0a924eb7069f59798a76158cb784f 10-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Update MtpFfsHandle tests, add new tests for small and partial files" am: ddc029afc7 am: 47c772f677
am: 61c034aa35

Change-Id: I4069f3cbc89e3fefdbcec1ae06f83980dadb3d85
94b13227f4c77bb303d7d004d889f6bf6a65f64c 09-Feb-2017 Jerry Zhang <zhangjerry@google.com> Increase EP_ALLOC ioctl number.

This prevents conflict with future upstream ioctls.

Test: Perform a file transfer.
Change-Id: If7313a048f528dfa57ef2fe52932ed664ad6f234
tpFfsHandle.cpp
8542feecf7842746d3a5e3cb113ac7269f7a296f 07-Feb-2017 Jerry Zhang <zhangjerry@google.com> Update MtpFfsHandle tests, add new tests for small and partial files

Test: Build and run 32 and 64 bit tests
Bug: 34822471
Change-Id: I812e4f27464e385c219c42bf7a76fa702f295f41
ests/MtpFfsHandle_test.cpp
dc6ca2d6909f7e567856ca896dd08d994264758a 06-Feb-2017 Jerry Zhang <zhangjerry@google.com> Retry allocations in case of ENODEV am: b4f5426604 am: 75bb252863 am: 5d5a91c008
am: 8e3503051a

Change-Id: Iccb1df80bee19bf032858285f10f6ea5468ddf38
4d2c28c4cff297ad0432cae36601649c43a2462d 06-Feb-2017 Jerry Zhang <zhangjerry@google.com> Fix GetPartialObject on FFS am: 4418030f45 am: 8eff270486 am: e209fd29f7
am: f373f0fa47

Change-Id: Idf4aa73819dff14dbd0c2caf5edc473662faad5b
8e3503051a59bda7323ed16779fac603fb93ff28 06-Feb-2017 Jerry Zhang <zhangjerry@google.com> Retry allocations in case of ENODEV am: b4f5426604 am: 75bb252863
am: 5d5a91c008

Change-Id: I822915dd40e9c999a3412ee74e5272ff04e0c7d4
f373f0fa4799140ab412bd5f68ecaa36c52c948a 06-Feb-2017 Jerry Zhang <zhangjerry@google.com> Fix GetPartialObject on FFS am: 4418030f45 am: 8eff270486
am: e209fd29f7

Change-Id: Iceb76f12ca62c5c800c7f9b9df65fa60c308463a
0269068cb60dd68addfa5699664f04b376a82472 01-Feb-2017 Yunlian Jiang <yunlian@google.com> fix warning: dereference of a null pointer

This fixes a warning: Access to field 'mPlaybackFormats' results
in a dereference of a null pointer (loaded from field 'mDeviceInfo')
[clang-analyzer-core.NullDereference]

Bug: None
Test: Static analyzer no longer complains, bullhead still boots with no
apparent issues.
Change-Id: I71ce486c667441d9b90ef63c2df8d23d70254639
tpDevice.cpp
b4f54266042f0553b41409a3d1f0542b684c2129 03-Feb-2017 Jerry Zhang <zhangjerry@google.com> Retry allocations in case of ENODEV

Unlike the read() and write() calls, the ioctl() call
does not wait for endpoints to be enabled, which is
problematic if ioctls() are the first calls on the
usb connection, since they may be called before the
endpoints are set up. We'll have to retry if this
causes them to fail.

Bug: 34822471
Test: Change configs to mtp and ptp
Change-Id: I89610b9614c33f0b22535cc68cd0c9b502cb55c9
tpFfsHandle.cpp
tpFfsHandle.h
4418030f45cca8cad25051f49b142988fb635037 04-Feb-2017 Jerry Zhang <zhangjerry@google.com> Fix GetPartialObject on FFS

Linux apps use GetPartialObject to access
MTP files directly. Fix file offset handling
as well as lengths shorter than packet size.

Bug: 34822471
Test: Attach photos in Gmail, open directly from device
Change-Id: I9986cd8c70ed261f07e8f96a72e53b87341dd93f
tpFfsHandle.cpp
c5505da9783d88521eb6b7d6ce5f5b908efdd8df 03-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Make Mtp FFS allocations per session rather than per file" am: 3f6419d0e5 am: 57b71e605e am: 8a91cf1510
am: 29e24f2256

Change-Id: Ia166c9d64c3692530fd37d38605d9bd83094fc5d
29e24f225679737229364799e09b5cc19c816f3e 03-Feb-2017 Jerry Zhang <zhangjerry@google.com> Merge "Make Mtp FFS allocations per session rather than per file" am: 3f6419d0e5 am: 57b71e605e
am: 8a91cf1510

Change-Id: I6ea428e9002851843d2b6f86450a0f378f1e92ac
cc9d0fdd302cf997607055e0a8b5559509cba766 27-Jan-2017 Jerry Zhang <zhangjerry@google.com> Make Mtp FFS allocations per session rather than per file

Workloads that send a large number of small files could
repeatedly allocate and free the buffer, causing fragmentation
and eventually running out of allocable memory. Instead
have the allocation be once per MTP session, and retry
with smaller buffers if it fails initially.

Bug: 34741015
Bug: 34822471
Test: Transfer files via MTP
Change-Id: I775376076d3a0c26765b211100830ea0c08450ef
tpFfsHandle.cpp
tpFfsHandle.h
tpServer.cpp
9e26267afc9bd9b80c44b50b4a40c050f79d15cd 19-Jan-2017 Jerry Zhang <zhangjerry@google.com> Merge "Keep ScopedEndpointBufferAlloc in variables" am: 1fba0b75b8 am: 5ffdae08b5 am: 15222d6ddc
am: d2fab7e463

Change-Id: I9218cc1bcd25bd00975413e1c2b6bd75ce49eb36
d2fab7e46357c99991f08c9d0dbc05f5bbb3f6aa 19-Jan-2017 Jerry Zhang <zhangjerry@google.com> Merge "Keep ScopedEndpointBufferAlloc in variables" am: 1fba0b75b8 am: 5ffdae08b5
am: 15222d6ddc

Change-Id: Ib59b24a9958762fee246955c6eb7a0345e574978
e9d94421825dd90f0036d0dbde59b1f00f85f23b 18-Jan-2017 Jerry Zhang <zhangjerry@google.com> Keep ScopedEndpointBufferAlloc in variables

This way they don't immediately destruct. Also
up the logging for an allocation failure and use
posix_madvise to possibly improve memory performance.

Test: Transfer files and verify that allocs are scoped properly
Bug: 30976142
Change-Id: If8d2c03cefcc98a83bbb57618c35337529437f73
tpFfsHandle.cpp
9b52063b9a6cd9921382235149629fd20f828f4e 19-Jan-2017 Daichi Hirono <hirono@google.com> Don't send short URB packet when sending MtpDataPacket.
am: d95d34d49d

Change-Id: Iafc27d47bfd1fe9bd17f6dbf0920572eb66944e9
b03b527afdd20b351b57b71ab2fbff5284435d81 18-Jan-2017 Daichi Hirono <hirono@google.com> Stop sending object handle with sendObject request.
am: 5c66471ad2

Change-Id: I1581a4d9683fffe53549ab9b368a4bbf1ae60d40
3670ef95286d8eb028d30a95448b8f93f8f74007 17-Jan-2017 Jerry Zhang <zhangjerry@google.com> Merge "Re-add MTP interface string" am: 58cdf4a1ac am: b804854648 am: 7e8b1663fc
am: ff9f01d3ba

Change-Id: Ic2ac2f8e176d21e1e70f880af20958550a1c6008
6a7905217bc840eae38125bb9ebced994b21442b 12-Jan-2017 Jerry Zhang <zhangjerry@google.com> Re-add MTP interface string

The string is used in some hosts like Mac to
check for MTP devices.

Test: Connect device
Bug: 30976142
Change-Id: Iac616997dc8afd0bdf03de0d13dee7baa6483904
tpFfsHandle.cpp
d95d34d49d36a2f27212485c79cde769af3873e9 04-Oct-2016 Daichi Hirono <hirono@google.com> Don't send short URB packet when sending MtpDataPacket.

When sending a MtpDataPacket to a MTP device, the kernel driver splits
it into multiple URB packets so that the URB packet size does not exceed
the buffer size at the MTP device.

Previously MtpDataPacket sends its header first, then sends the
payload. It means the first URB packet only contains the header of
MtpDataPacket and the URB packet size is smaller than the maximum URB
packet size (short packet). Some MTP devices regard the short packet as
the end of the sequencail URB packets, thus the devices do not accept
the following URB packets that contain the payload.

The MTP spec says if the responder (MTP device) sends the data in a way
where the first pacekt contains only the header, the initiator (MTP
host) must send data in the same way. Otherwise the initiator must not
send a short packet in the sequencial URB packets.

The CL fixes the MTP host implementation so that it remembers how the
MTP device sends data, and uses the same way when sending data
from the host.

Bug: 31165557
Test: Manually invokes MtpDevice#sendObject
Change-Id: Ic76eb4241ed74957414aef2990be08cd77a9f5a9
(cherry picked from commit d4b4296b401162a7a42f757c96e3652b82255b13)
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tpTypes.h
5c66471ad288640a89188f765fef5b41b4d3daf5 04-Oct-2016 Daichi Hirono <hirono@google.com> Stop sending object handle with sendObject request.

According to the MTP spec, the sendObject request must follow
sendObjectInfo request and we could not send an object handle with
sendObject request. The CL stops sending object handle with a sendObject
request. Instead it checks if the given object handle equals to the
object handle returned by the previous sendObjectInfo request.

Bug: 31918048
Test: manually invoked sendObjectInfo and sendObject.
Change-Id: I0a80bdf67bf2913522821ac705f3dc548d3edead
(cherry picked from commit 8d20945c08dfdd85c252c8ba92d197bf1bd2b208)
tpDevice.cpp
tpDevice.h
c989e07ef09f173cfa4ba61c7bf9d4837bb8d763 11-Jan-2017 Jerry Zhang <zhangjerry@google.com> Merge "Use FUNCTIONFS_ENDPOINT_ALLOC_BUFFER ioctl to improve performance." am: 20adbc0003 am: ba6324e7fe am: 7ceeb44566
am: aff7bd0ca1

Change-Id: I2e8bd53c70f7767c9a9958f10c35e85b58ffa469
5a804b923e2faa4bf9f02b238b94abceb3b6d0fa 16-Dec-2016 Jerry Zhang <zhangjerry@google.com> Use FUNCTIONFS_ENDPOINT_ALLOC_BUFFER ioctl to improve performance.

The ioctl preallocates kernel buffers for the read/write syscalls,
reducing memory fragmentation and allowing for larger buffers,
as well as removing the kmalloc overhead.

Test: Manual
Change-Id: I9f5fef1b1625c1a2cda374541d8042f7e0ba78f5
tpFfsHandle.cpp
2b934d36939c571a47cc972670176bc0356c54be 05-Jan-2017 Jerry Zhang <zhangjerry@google.com> Merge "Fix issue with 32 bit versions of asyncio" am: 71be3d9a6f am: 0500ce7ed2 am: 2347a1f847
am: 8706043acc

Change-Id: I779cf3078e76ee7e4245d41fe935309958829205
8e889ef487c1adb3a5a02ff41712fbca44fd449f 03-Jan-2017 Jerry Zhang <zhangjerry@google.com> Fix issue with 32 bit versions of asyncio

Assuming 64 bit long offsets caused 32 bit tests
to fail

Test: verified async_io_test passes on 32 and 64 bit
Bug: 33846003
Change-Id: I2db126068037f674beeacd5bc30364010c858350
syncIO.cpp
105928c9d30ed4c697cc4cdd9e68d8d47a695133 22-Dec-2016 Alex Klyubin <klyubin@google.com> Merge "Make users of MtpServer provide DeviceInfo fields" am: b5ee680912 am: e6e72a4c40 am: d76a98d5f4
am: 6bc76c8868

Change-Id: Ie812247f6ea929d36c46c4e7ba979881b9fd1eb7
792298f63b1433ddd54ef7ab6283a5aeb3386e16 21-Dec-2016 Alex Klyubin <klyubin@google.com> Make users of MtpServer provide DeviceInfo fields

This is part of weaning apps off accessing system identifiers via
system properties API. Apps should use android.os.Build API instead.

Bug: 33700679
Test: Enable MTP mode then check that mtp-detect output same as before this commit
Change-Id: Ic21da7b8e976aaa1abc606a3cb4a1f2bd8698408
tpServer.cpp
tpServer.h
dee8e1e48982a48b31c2db73a4e6630d70e2bfac 13-Dec-2016 Jerry Zhang <zhangjerry@google.com> Refactored Mtp driver interface into multiple classes. am: 487be61fb0 am: c17a76108b am: 1475041870
am: 28569ba92e

Change-Id: I18b7674cd0c2e05534849c52f78cbcb0e4ad9144
487be61fb0a38873aec1d12da92437fba5e728f2 24-Oct-2016 Jerry Zhang <zhangjerry@google.com> Refactored Mtp driver interface into multiple classes.

Added new interface for FunctionFS. This allows most of
the driver code to exist in userspace. The driver will
automatically use FunctionFS if it is enabled for that
device, otherwise it will default to the kernel driver.

The intention is to eventually deprecate the kernel driver.

Bug: 30976142
Change-Id: I36b8d16ca254fddd995b3ea1bd3d37b0ff4a28f7
Test: New automated tests for MtpFfsHandle, AsyncIO.
Manual testing on each device.
ndroid.mk
syncIO.cpp
syncIO.h
MtpHandle.h
tpDataPacket.cpp
tpDataPacket.h
tpDevHandle.cpp
tpEventPacket.cpp
tpEventPacket.h
tpFfsHandle.cpp
tpFfsHandle.h
tpPacket.h
tpRequestPacket.cpp
tpRequestPacket.h
tpResponsePacket.cpp
tpResponsePacket.h
tpServer.cpp
tpServer.h
ests/Android.mk
ests/AsyncIO_test.cpp
ests/MtpFfsHandle_test.cpp
d7f5b6de42553ec22314dd341f019fb8ebe76bc1 27-Oct-2016 Philip P. Moltmann <moltmann@google.com> Merge "Signature of usb_request_wait changed"
cb8d8af1ad71ca7b800d298376dec7e6b1c1c766 19-Oct-2016 Philip P. Moltmann <moltmann@google.com> Signature of usb_request_wait changed

Test: Compiled
Change-Id: Ib32507811d21205d44be5b4c44a862ae100aba43
tpDataPacket.cpp
tpEventPacket.cpp
6e08d93aa2194b084b90cd4fdd04148180deed77 21-Oct-2016 Vitalii Tomkiv <vitalit@google.com> Add timeout to usb_device_get_string to prevent usb stuck state for bad
behaving devices.

Bug: 31923641
Test: manual run and test with bad devices.
Change-Id: I50e65733fff19f16c7d16bfd805ae930f30171b3
tpDevice.cpp
d4b4296b401162a7a42f757c96e3652b82255b13 04-Oct-2016 Daichi Hirono <hirono@google.com> Don't send short URB packet when sending MtpDataPacket.

When sending a MtpDataPacket to a MTP device, the kernel driver splits
it into multiple URB packets so that the URB packet size does not exceed
the buffer size at the MTP device.

Previously MtpDataPacket sends its header first, then sends the
payload. It means the first URB packet only contains the header of
MtpDataPacket and the URB packet size is smaller than the maximum URB
packet size (short packet). Some MTP devices regard the short packet as
the end of the sequencail URB packets, thus the devices do not accept
the following URB packets that contain the payload.

The MTP spec says if the responder (MTP device) sends the data in a way
where the first pacekt contains only the header, the initiator (MTP
host) must send data in the same way. Otherwise the initiator must not
send a short packet in the sequencial URB packets.

The CL fixes the MTP host implementation so that it remembers how the
MTP device sends data, and uses the same way when sending data
from the host.

Bug: 31165557
Test: Manually invokes MtpDevice#sendObject
Change-Id: Ic76eb4241ed74957414aef2990be08cd77a9f5a9
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tpTypes.h
14dcfa14ae599e31ffd44b823f8eebd0b951beb7 05-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Stop sending object handle with sendObject request."
8d20945c08dfdd85c252c8ba92d197bf1bd2b208 04-Oct-2016 Daichi Hirono <hirono@google.com> Stop sending object handle with sendObject request.

According to the MTP spec, the sendObject request must follow
sendObjectInfo request and we could not send an object handle with
sendObject request. The CL stops sending object handle with a sendObject
request. Instead it checks if the given object handle equals to the
object handle returned by the previous sendObjectInfo request.

Bug: 31918048
Test: manually invoked sendObjectInfo and sendObject.
Change-Id: I0a80bdf67bf2913522821ac705f3dc548d3edead
tpDevice.cpp
tpDevice.h
5b26fdfdcb4462cb17909c12577da2439d4a9849 29-Sep-2016 Marco Nelissen <marcone@google.com> Don't process objects with empty name am: 7ea72dcdeb am: 0e0ca2a45f
am: ddb2a28a0b

Change-Id: I902fda725304d8dbf9f97f81d1554198d21452c1
ddb2a28a0b8ab4482395e003ee5eaf630eaa6066 29-Sep-2016 Marco Nelissen <marcone@google.com> Don't process objects with empty name am: 7ea72dcdeb
am: 0e0ca2a45f

Change-Id: I2240fc25b0234fde68a9599e317e3cc5c1fe63f2
7ea72dcdeb8efc90701bfcc1f439e591e8938d4c 19-Sep-2016 Marco Nelissen <marcone@google.com> Don't process objects with empty name

as this will result in a bad database entry.

Bug: 31526567
Change-Id: I2e2a88ca98b189300fa2885b082746252f920bb4
tpServer.cpp
d7e0b3bb26b37abae67544d98281e1196b2c386e 15-Aug-2016 Chih-hung Hsieh <chh@google.com> Merge "Fix google-explict-constructor warnings in mtp." am: b480ab9365 am: c3fd10acaa am: de1567cc34
am: 8579011e2a

Change-Id: I1559fc6a005c79408a09600e6d34be5725c4e41f
c3fd10acaa47bc973e31f71f1925b8a2797b731a 15-Aug-2016 Chih-hung Hsieh <chh@google.com> Merge "Fix google-explict-constructor warnings in mtp."
am: b480ab9365

Change-Id: I7285319a159b5d1d42145e6eb9f51849c53df9d3
a039c883c593b2ebbca6d32282cbd855b5bec19f 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explict-constructor warnings in mtp.

* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: I3a84ae7ffa03b2e23562edef95ef6abefe0ff456
tpObjectInfo.h
tpPacket.h
tpStorageInfo.h
tpStringBuffer.h
96a84081d31a1a854f2026fcf507e60c15022db6 07-Jul-2016 Daichi Hirono <hirono@google.com> Handle NULL result of strdup.

The check is needed to satisfy @NonNull annotation in Java API.

BUG=26758882

Change-Id: Ie2a45a05593f2a48e23f3ca90302b78ca78a980e
tpDeviceInfo.cpp
tpObjectInfo.cpp
tpStorageInfo.cpp
7fee6ca025bf4dcac5d658e8dcd8b6cb46b4ddc3 25-Mar-2016 Daichi Hirono <hirono@google.com> Merge "Add getObjectPropValue function to MtpDevice." into nyc-dev am: 15ac558
am: fdb1d07

* commit 'fdb1d0793cd65fd760dfa197728f7971ee13b760':
Add getObjectPropValue function to MtpDevice.
66a9abef47f7c8bd438bb1897617ebad3858c736 24-Mar-2016 Daichi Hirono <hirono@google.com> Add getObjectPropValue function to MtpDevice.

In the MTP spec, the object size is stored in MtpObjectInfo as unsigned
32-bit integer and fetched by the getObjectInfo operation. For the
objects that are more than 4GB, the object size is provided as one of
extra properties, which are fetched by different operation.

The CL adds to getObjectPropValue method to MtpDevice class so that
client code can obtain 4GB+ object size from object property.

BUG=27805369

Change-Id: I0b91facd07cdc19866cb29f7df08bb1698bcf60b
tpDevice.cpp
tpDevice.h
tpProperty.cpp
tpProperty.h
bc2f77ba75162e86a79bf6ea9e1a3997887cb3ff 24-Mar-2016 Daichi Hirono <hirono@google.com> Merge "Remove redundant code to check container type." into nyc-dev am: 29f3b2e
am: a33067c

* commit 'a33067c5dceb424fa71fdc4ee72702988101fe16':
Remove redundant code to check container type.
95faffd31926e2e0b83923c181629d1cea29e88f 23-Mar-2016 Daichi Hirono <hirono@google.com> Remove redundant code to check container type.

The CL removes redundant check for containter type. We have the same
check just after the removed check, but the removed check returns
opposite value for boolean result of the function.

BUG=27805514

Change-Id: Ia8e32c0c38553a9a0ec4d9d726b8cde6281d34e1
tpDevice.cpp
2c9cb62d0160fc4353d89fd9d648725794e7995e 29-Feb-2016 George Burgess IV <gbiv@google.com> Cleanup uses of sprintf so we can deprecate it.

Also removes a seemingly useless branch.

Change-Id: Icd61d4facd64985f4c73e9876569e1ae1a74ee83
tpPacket.cpp
25c61139b4c120ec606d7c6daf42cea4c2806cb4 26-Feb-2016 Daichi Hirono <hirono@google.com> Fix compiler warning in media/mtp. am: b3be006498
am: bb58e5e9dd

* commit 'bb58e5e9dd837a60e344b75d3337d66fd176cb39':
Fix compiler warning in media/mtp.
b3be006498f28f2630264135e88d266b540bcec3 24-Feb-2016 Daichi Hirono <hirono@google.com> Fix compiler warning in media/mtp.

BUG=27152673

Change-Id: I0a5a7f2005bd76acf4d09353305b66af3fd29e4b
ndroid.mk
tpDataPacket.cpp
tpDevice.cpp
tpPacket.cpp
tpProperty.cpp
tpRequestPacket.cpp
tpServer.cpp
6197c9bff627557000cd03ece93c14a12d5c5c8d 18-Feb-2016 Daichi Hirono <hirono@google.com> Merge "Fix the return type of MtpDevice#getStorageID()."
251322bc8ac7ff7690bf706206c8ef251ca059f2 02-Feb-2016 Jaesung Chung <jaesung@google.com> Merge "Retry usb_device_claim_interface when it's connected to the kernel driver"
33d58162896868f387416289c8b33266be0a3360 01-Feb-2016 Jaesung Chung <jaesung@google.com> Retry usb_device_claim_interface when it's connected to the kernel driver

usb_device_claim_interface is called solely for marking that a program
or a driver uses it and it does not trigger any signals over the bus.

usb_device_claim_interface has a possibility to be failed if the kernel
driver already connected to a usb device. When it happens, the function
call returns an error and errno is set to EBUSY. For that case, it is
necessary to disconnect to the kernel driver and retry to claim the
interface again.

Bug: 26845384
Change-Id: I4fae0e66ca1132f8cc16937cc6fb837ec4d5659f
tpDevice.cpp
610d4a125f0144ec4915e5cef9f53e431cb117af 28-Jan-2016 Daichi Hirono <hirono@google.com> Add comment for readPartialObject's NULL expected length.

BUG=26703522

Change-Id: I584c13e5e5d3f396aa2dfbd351c1c36f7bc0870d
tpDevice.cpp
326edd98bbc52d41de6e0943ca8a343228ed87a5 22-Jan-2016 Daichi Hirono <hirono@google.com> Add MtpDevice#getPartialObject64 method.

This is the method similar to getPartialObject but takes uint64_t as
offset.

BUG=26703522

Change-Id: I9b8b5f77225b744b527c4a78fe628e88ae89209f
tpDevice.cpp
tpDevice.h
d7221079292b17a81ec003adef06d58019d9236d 22-Jan-2016 Daichi Hirono <hirono@google.com> Fix the return type of MtpDevice#getStorageID().

Both MtpObjectHandle and MtpStorageID are typedef of uint32_t, but
MtpStorageID is more appropriate semantically.

BUG=None

Change-Id: Ibf5bb2105c54f7b73df559132d8737c272a1cefa
tpDevice.h
e92e6fbf424655fe8b6a15bce68646fcf6b00baa 12-Jan-2016 Jaesung Chung <jaesung@google.com> Merge "Add DNG format in MTP"
fd86bc29d0bd59620e3c115e3b7426a163016a89 23-Dec-2015 Jaesung Chung <jaesung@google.com> Add DNG format in MTP

Bug: 25871812
Change-Id: I141d97cb8866edcaa7cab7fe04721e4386832d2b
tpDebug.cpp
tp.h
59a90609cc340d2933c119aa47045a5c95530b48 11-Jan-2016 Daichi Hirono <hirono@google.com> Reland "Return parameters of event as well as event code."

The CL was previously reviewed at ag/842911.

> The CL makes MtpDevice#reapEvent return event parameters as well as
> event code.
>
> BUG=26480986

Change-Id: Ie750a58248068cd0e804f20b57e7e86eef19d315
tpDevice.cpp
tpDevice.h
2ce504f922bfc43e02b96b63cf5474845b53bdb6 07-Jan-2016 Daichi Hirono <hirono@google.com> Merge "Add getPartialObject method to MtpDevice."
536651e693f74fa60e3173531c153d0576b94d20 06-Jan-2016 Elliott Hughes <enh@google.com> Merge "Clean up time zone handling in MtpUtils::parseDateTime." am: c64c91e4bb
am: 7834290bec

* commit '7834290bec3146dc1f7a9493ebb28eb76eb08f7f':
Clean up time zone handling in MtpUtils::parseDateTime.
d4b473884617987e02155cd1aae9e573e2f79a58 06-Jan-2016 Elliott Hughes <enh@google.com> Clean up time zone handling in MtpUtils::parseDateTime.

The intent here is supposed to be to use local time (which mktime(3) does)
unless the string ends 'Z' in which case we're supposed to use UTC. The UTC
equivalent of mktime(3) is timegm(3).

This code has come to my attention in two ways. Externally it was pointed
out that the localtime_r(3) was accessing uninitialized memory leading to
unpredicatable results. Internally, this is the only caller of the
non-standard mktime_tz --- ironically using it in a way that -- apart from
the flakiness caused by the uninitialized variable -- would make it behave
like the standard mktime(3).

Bug: https://code.google.com/p/android/issues/detail?id=185159
Bug: http://b/15765976
Change-Id: I5f015727c4c08a139ef478fafba5811a9758d5df
tpUtils.cpp
4a7cea889d81bbf8f555df006fe384a405b3ba53 11-Dec-2015 Daichi Hirono <hirono@google.com> Add getPartialObject method to MtpDevice.

The CL adds getPartialObject operation to MtpDevice (host side
implementation).

BUG=26284424

Change-Id: Ia8f41b0ebb7dfb4572729eacb5902f21360c8db1
tpDevice.cpp
tpDevice.h
a04e6fa61391f1ef64266579760f315c6b3e70b9 24-Dec-2015 Daichi Hirono <hirono@google.com> Fix MtpDevice to read 0-byte object correctly.

If a requested object is 0 bytes, the remote MTP device can return
MTP_CONTAINER_TYPE_RESPONSE at the first response package. Previous
implementation does not handle the case.

BUG=26317907

Change-Id: I6ae1138bf1b24aa197575bea0440cc032ffd622a
tpDevice.cpp
d6dabe95eb59c3d95f94825d08a6028bab06cbdc 02-Dec-2015 Daichi Hirono <hirono@google.com> Skip an interface that does not have MTP interface class.

The comment says it skips the interface that does not have MTP or PTP
interface class, but previously it accepts such interfaces.

BUG=25960704

Change-Id: Idba07d4c6432d73cf45d9a3422af0ad18cd1b280
tpDevice.cpp
8a7ffae09a019de7109b30c505561c453910bde1 20-Aug-2015 Daichi Hirono <hirono@google.com> Add functions to read MTP events from MTP devices.

BUG=23368533

Change-Id: I2003dda961339677caf56e57ae90cf6df7bd7430
tpDevice.cpp
tpDevice.h
tpEventPacket.cpp
tpEventPacket.h
tpPacket.h
532b4f23c7e08fdae9fff189c4b565f6216ffd2a 25-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Fix sendObject upload.

Two issues are resolved:
- sendObject changed to accept raw arguments instead of objectinfo,
as calling getObjectInfo after sentObjectInfo is illegal,
- send buffer decreased to 16K, as this is the maximum size working
per comments in other places.

Change-Id: If71644dcbc508dd92c3fe74a2fdb7c6798059b42
tpDevice.cpp
tpDevice.h
4fd9a8b9865addfedbcd84d5c9efea0f647086a0 20-Aug-2015 Daichi Hirono <hirono@google.com> Use common implementation for getObject and importFile.

Previously the two functions have separate but similar implementation. ag/750097
fixed a bug in importFile, but we have a same bug in getObject. Instead fixing
the bug separately, the CL adds a common function that can be used from both
getObject and importFile.

BUG=23264575

Change-Id: I0bdc876ee9b11301ba4c445cc16556e9c951a8b4
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tp.h
81ca5ade77ea518aa21fdd7434d2db5df088a115 18-Aug-2015 Daichi Hirono <hirono@google.com> Read whole data from MTP device even on writing error.

Once the object bytes is requested on the MTP client device, the device tries to
send whole data of object. We need to read the complete data from the device
even when we have errors at the destination file descriptor. Otherwise the
object data will be received as a response of next request unintentionally.

BUG=23264575

Change-Id: I3369786370022f65aa760dd6b75204a946f712af
tpDevice.cpp
64c948bf5041fdfe391553315c9d028e1ee56382 13-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Fix sending object info in MTP stack.

This CL fixes three bugs:
1. Wrong condition, which caused MtpDevice::sendData always return false.
2. Sending data separately was incompatible with the server side, causing
receiving only partial data on the server side.
3. Sending uninitialized buffers (sic!) from MtpDevice::sendObjectInfo
due to missing call to reset().
4. Sending corrupted packets from MtpDevice::sendObjectInfo (shifted by
4 bytes) due to missing reset().
5. Sending incorrect parent in MtpDevice::sendObjectInfo in case of not
specified parent.

Change-Id: Ia545c66b388ea9a292ba31f6ff034e2467037d92
tpDataPacket.cpp
tpDevice.cpp
025ffd9c17a7b30d862436954aa0db8d08bfaa9f 04-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Add support for reading into a file descriptor on MTP devices.

This will allow to read files on Java side without copying all bytes to
memory first, which is problematic for large files such as movies.

Bug:22908937
Change-Id: I67b116cf01d9e44af69f94c8edc64fd8fbf7b9a3
tpDevice.cpp
tpDevice.h
07a9e548af0ed26d7354f3defaa8f18b2c5125f1 17-Jul-2015 tao.pei <tao.pei@ck-telecom.com> Use errno correctly.

After a failed write() or ioctl(), errno wasn't being checked until
after some other function calls that could also modify errno, thus
checking the wrong errno. Make sure to check it prior to doing anything
else that can modify it.

[Preconditions]
1.PC connects with phone(mtp).

[Procedures]
1.Copy a file from PC to phone.
2.Cancel the copying.
3.Recopy the file.

Change-Id: Id772fca7ccb96d3f43bd4beb210bedd8d3ac17fa
tpServer.cpp
d35c21207762c33c6f8f517e52533d6738d9adf0 23-Jan-2015 Marco Nelissen <marcone@google.com> am 1f7101ee: am 64c496c8: Merge "Fix MTP delete" into lmp-mr1-dev

* commit '1f7101ee7096dc11cd212935d84c0f9a3376b061':
Fix MTP delete
ea9f215a13f1a5e6455be91624a81a024641a26d 23-Jan-2015 Marco Nelissen <marcone@google.com> Fix MTP delete

Bug: 18836972
Change-Id: Ia1caa9bfb0f2084af774745b5c01b260ab1f1b20
tpServer.cpp
93830b75204207addee67705016aab1a34eee5f6 18-Dec-2014 Mike Lockwood <lockwood@google.com> am 562b98ec: am e48cf5b8: Fix bounds checking for GetPartialObject command

* commit '562b98ec7edf9303f4c7d8da7e81171b621d3849':
Fix bounds checking for GetPartialObject command
e48cf5b8f823c30af93577c1e380d752ac69b871 17-Dec-2014 Mike Lockwood <lockwood@google.com> Fix bounds checking for GetPartialObject command

GetPartialObject has only 3 arguments, whereas the 64 bit version takes 4.

Bug: 18786282
Change-Id: I4376962769ed0eae2f4991c2569244db22509204
tpServer.cpp
e1e814c7c640a51511b149985d57f8bfd4a8bf78 13-Nov-2014 Mike Lockwood <lockwood@google.com> am e418cfae: am 869e0798: Merge "MTP: add strict bounds checking for all incoming packets" into lmp-mr1-dev

* commit 'e418cfae0970d1abe60b8cc681aa8c8a828b3769':
MTP: add strict bounds checking for all incoming packets
ab063847e6e893740749029a04cce1f6b7345ed5 12-Nov-2014 Mike Lockwood <lockwood@google.com> MTP: add strict bounds checking for all incoming packets

Previously we did not sanity check incoming MTP packets,
which could result in crashes due to reading off the edge of a packet.
Now all MTP packet getter functions return a boolean result
(true for OK, false for reading off the edge of the packet)
and we now return errors for malformed packets.

Bug: 18113092
Change-Id: Ic7623ee96f00652bdfb4f66acb16a93db5a1c105
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tpDeviceInfo.cpp
tpDeviceInfo.h
tpObjectInfo.cpp
tpObjectInfo.h
tpPacket.cpp
tpPacket.h
tpProperty.cpp
tpProperty.h
tpRequestPacket.cpp
tpRequestPacket.h
tpServer.cpp
tpStorageInfo.cpp
tpStorageInfo.h
tpStringBuffer.cpp
tpStringBuffer.h
841daebc75fbf5e7fb4dd71cab559b8f4d7150ae 29-Oct-2014 Mike Lockwood <lockwood@google.com> am 686a0c4d: Merge "MTP Device: Parse USB3 descriptor for MTP initor;"

* commit '686a0c4db5e90b811b1fbe1dba3638522ef4b7a1':
MTP Device: Parse USB3 descriptor for MTP initor;
8023f3af62795b7816f36a9423f8e0a39e616e49 09-Jun-2013 Bo Huang <bo.b.huang@intel.com> MTP Device: Parse USB3 descriptor for MTP initor;

MTP initor in Android only support MTP responder based on USB2.
Add support for MTP device based on USB3.

Change-Id: I52b7a5ddff8ae3f8c2ce8a802c2cb2865f4e162a
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
tpDevice.cpp
37b216c75ca5e38f1a56a86a95b04ff6b4e71ae7 25-Jul-2014 Elliott Hughes <enh@google.com> Remove last user of <cutils/tztime.h>.

Bug: 15765976

(cherry picked from commit 56687f7cbf0a3d7909830fc1390a98c713a05e6f)

Change-Id: Iacb225584c3acdbb512f46b638a215b75b32cdcb
ndroid.mk
tpUtils.cpp
56687f7cbf0a3d7909830fc1390a98c713a05e6f 25-Jul-2014 Elliott Hughes <enh@google.com> Remove last user of <cutils/tztime.h>.

Bug: 15765976
Change-Id: Ib21abe9349bb1863304cd7618d8fc95ca254e8f6
ndroid.mk
tpUtils.cpp
d239cb6e6898bdf2300e9038111727a9056c58ee 19-Jun-2014 Mark Salyzyn <salyzyn@google.com> mtp: 64-bit compile warnings

Change-Id: I9ebc270c990d2f83311cec8fef8f1d2842ebf291
tpServer.cpp
tpStorageInfo.cpp
dcd89ecad321e2e052322fe2b1907d50d762b311 24-Jun-2014 Marco Nelissen <marcone@google.com> Improve MTP error checking

Change-Id: I1ab02ca0e99a1c284411fb368a773fb481d72ab2
tpServer.cpp
c27f5259cf2c45ea6f0a021fc17578f32f6c2f7d 23-Jun-2014 Marco Nelissen <marcone@google.com> am 620f348f: am da69fdbb: Merge "Fix buffer allocation"

* commit '620f348faf3ce0c39e71338a005f1528765f4d1e':
Fix buffer allocation
ebb1081a624a773a67c49b279c775e18e693c4fc 23-Jun-2014 Marco Nelissen <marcone@google.com> Fix buffer allocation

b/15293123

Change-Id: Icb3ceabf02a55bc931baaf388ce125db6332de0e
tpDataPacket.cpp
1b24cf32e02a1372e57b3a2a432bc0adfe496e6d 16-Apr-2014 Mark Salyzyn <salyzyn@google.com> am e80631aa: am 839d11d1: Merge changes I0a744dc7,Id993a70d

* commit 'e80631aa1992ca50af679cd6a018c0ffda7f9b17':
media: use size_t for integer iterator to Vector::size()
media: 64 bit compile issues
3ab368e0810d894dcbc0971350c095049478a055 15-Apr-2014 Mark Salyzyn <salyzyn@google.com> media: use size_t for integer iterator to Vector::size()

Change-Id: I0a744dc7815a86a993df9b0623440be620ec8903
tpDevice.cpp
tpServer.cpp
db43b34c3428e480f8c4c66e7e88f4001f37f91e 04-Apr-2014 Mark Salyzyn <salyzyn@google.com> media: 64 bit compile issues

- change internal sized types to use stdint.h
- printf & scanf formats
- size_t or unsigned int for iterators

Change-Id: Id993a70d8bf54c667c5d652b34179a2c727ed446
tpDevice.cpp
tpServer.cpp
eb5d7f2f1cc049ea7f95a4f089ce2113d7683dda 25-Mar-2014 Lajos Molnar <lajos@google.com> mtp: avoid silent allocation overflow in MtpProperty

Bug: 13006907
Change-Id: Ice0352394840132c9c2ce6c28366632c792a32c0
tpProperty.cpp
0fa848d780cf990a2860637f40432d28594c85a3 07-Mar-2014 Mike Lockwood <lockwood@google.com> MTP: Add support for device property changed events

Also fixed bug in MtpProperty::write() for device properties

Bug: 7342482
Change-Id: If0099095d101409d131564e55b1939895c69c202
tpProperty.cpp
tpServer.cpp
tpServer.h
377b2ec9a2885f9b6405b07ba900a9e3f4349c38 03-Feb-2014 Kévin PETIT <kevin.petit@arm.com> Make frameworks/av 64-bit compatible

Contains the necessary changes to make frameworks/av build and work
on a 64-bit machine.

Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
tpProperty.cpp
014897f5aece2c6212418934bd4618326979f17a 04-Dec-2012 Yin Liu <yin2.liu@sonymobile.com> Long mp3 metadata displays as corrupted file after transfer

Cut the metadata to 1 Byte and return in function
getObjectPropertyList in order to show it properly on a PC.

Change-Id: Iefacf9fa86c20ece2572e6d95d35877a94066fe7
tpDataPacket.cpp
tpStringBuffer.cpp
tpStringBuffer.h
ecba7488c5cceaacef95836b1b476433451e7761 10-Apr-2013 Ying Wang <wangying@google.com> Add liblog

Bug: 8580410
Change-Id: If493d87d60d71be664ad75b140c62acadb75b0d0
ndroid.mk
cba6b7dbe6e6d89c00021a0954d8bf60eacefdfa 01-Apr-2013 Mike Lockwood <lockwood@google.com> MTP: Implement date created field in GetObjectInfo

Bug: 8293874
Change-Id: I6b74fe73362bd4fac34ca8a54e127ae91f82aef9
tpServer.cpp
38fb629c46efb74517332696d5d117f4466fa3f0 08-Feb-2013 Mike Lockwoood <lockwood@google.com> MTP: Write initial data to correct file offset in SendPartialObject

Change-Id: I84288aeda3e65e6e6487f11d32a72910cd16cff2
tpServer.cpp
60d6452fe7d04d5723c2d343e61d819832361a1c 11-Sep-2012 Elliott Hughes <enh@google.com> am ed757e97: am 290ac693: Merge "Stop building the unused host libmtp static library."

* commit 'ed757e9729b325f00e70f506ad6e217910563d0a':
Stop building the unused host libmtp static library.
e0e2e98674caa7f6285eda122ebabee40528374b 11-Sep-2012 Elliott Hughes <enh@google.com> Stop building the unused host libmtp static library.

This removes the need to support the bionic mktime_tz and localtime_tz
extensions on glibc, which makes my life easier.

Bug: 7012465
Change-Id: Ibfa187f2857dda7bd1536348e314a80abacb9d1e
ndroid.mk
af8e8aa1ada2948972555592570ec9ad90cbf372 26-Jun-2012 Nick Kralevich <nnk@google.com> Add mode when open(O_CREAT) is used.

When creating a new file using open(..., O_CREAT), it is an error
to fail to specify a creation mode. If a mode is not specified, a
random stack provided value is used as the "mode".

This will become a compile error in a future Android change.

Change-Id: I36a3d67d294a915c1f79632a1b0ba45edd1214b1
tpDevice.cpp
tpServer.cpp
3d51d5cb53cc630709a0ba78d0e60501a675f2d5 13-Jun-2012 James Dong <jdong@google.com> Add NOTICE and MODULE_LICENSE_APACH2 to libs build under /frameworks/av/

Change-Id: I0a3af3e2abdedebd5934f3d941d01c32cfc75e26
related-to-bug: 6647465
ODULE_LICENSE_APACHE2
OTICE
c7a8e2422445030b9312470abca23c966b6367c7 13-Jan-2012 David 'Digit' Turner <digit@google.com> media/mtp: Add missing LOCAL_C_INCLUDES

One of the source files here is including <cutils/tztime.h> which
itself includes <bionic_time.h>, a private C library header used
to define the strftime_tz() extension (which used to be declared
in <time.h> but was moved there instead).

Add a missing C include path to let our code compile as usual.

Change-Id: I6aac2f1d3d15ad182679c81ff3f4febff74eb671
ndroid.mk
29357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
tpDataPacket.cpp
tpDevice.cpp
tpPacket.cpp
tpProperty.cpp
tpServer.cpp
df64d15042bbd5e0e4933ac49bf3c177dd94752c 04-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
tpDevice.cpp
tpProperty.cpp
b8a805261bf0282e992d3608035e47d05a898710 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
tpDevice.cpp
tpObjectInfo.cpp
tpServer.cpp
tpStorageInfo.cpp
a9a46c1f53129be8fe1f3f0a6ea868d7b4c8f8f7 01-Dec-2011 Mike Lockwood <lockwood@google.com> MTP: Add support for restricting PTP to only certain subdirectories of the storage

Bug: 5527220

Change-Id: If68e7481617ecb62abd24e2d89e6b7dfdf95ba2b
Signed-off-by: Mike Lockwood <lockwood@google.com>
tpServer.cpp
44c190826d72589f5c9e13d69e32673bd8bd7c64 02-Dec-2011 Mike Lockwood <lockwood@google.com> MTP: Don't attempt to read more than 16K at a time from the MTP driver

This could happen sometimes if other operations increased the size of the
data packet buffer to > 16K

Change-Id: I4d316c7e2e558d3dd861d39accae6514fd9a62f5
Signed-off-by: Mike Lockwood <lockwood@google.com>
tpDataPacket.cpp
3856b090cd04ba5dd4a59a12430ed724d5995909 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
tpDevice.cpp
tpDeviceInfo.cpp
tpPacket.cpp
tpServer.cpp
tpStorage.cpp
0cc79c66329b9ffa7d7bdfafa5d245a11fd3660d 13-Oct-2011 Mike Lockwood <lockwood@android.com> MtpServer: Pass 0xFFFFFFFF for file size when receiving files >= 4GB in size

Bug: 5432487

Change-Id: Ie86e72d9d85476941eab6a9d271948b8fdde6926
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
ef441d965504dbf31c5db690e5b34fcdcecd92ff 15-Jul-2011 Mike Lockwood <lockwood@android.com> MTP: Use a single packet for the data phase

instead of sending 12 byte header in a separate packet.
PTP on the Mac is much happier with this approach.

Change-Id: I7d1ca498f6346afd88876d24332187b466fc469c
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpServer.cpp
dec7388c3edf09eaaccaaf57f6301e716319a34d 11-Jul-2011 Mike Lockwood <lockwood@android.com> MTP: Clean up MtpServer initialization and threading:

Move thread from native to Java code
Remove the stop() method (the thread will exit on its own)

Change-Id: Ib897c3630162f82669a4ee8c187e8172da50b29d
tpServer.cpp
5e0067b486c3862316aa1f293cf9690c0cf54bda 12-Jul-2011 Jeff Brown <jeffbrown@google.com> Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
ndroid.mk
9b88b72ee2c3fd01fb46e77b7e6d80f3bd52e958 11-Jul-2011 Mike Lockwood <lockwood@android.com> MTP: Return error if user tries to copy a file >= 4GB to a FAT32 file system

Bug: 4561836

Change-Id: I2bffb93b032038f6c220c24c752ccd7ca66c23a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpStorage.cpp
tpStorage.h
3d1d7767afc7c488197ec40a22739159c5110721 21-Jun-2011 Mike Lockwood <lockwood@android.com> MTP: Add support for PTP variant of GetDeviceInfo result.

Change-Id: I09f86fda768b7697665e401adb9516588859bf59
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpServer.h
dc3185e3e27b05e18c4ac34432a25a0c279ff351 17-Jun-2011 Mike Lockwood <lockwood@android.com> MTP: Fix some problems with GetObjectHandles and GetNumObjects commands

These calls did not correctly handle some variants of the arguments,
which showed up when running in PTP mode.

Change-Id: Iedbaefebfa39111c8bcaee7c6cc3820a65d6c98f
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
7efab4282a7179b2f53a3dbccee3e70d7fce6a7f 10-May-2011 Mike Lockwood <lockwood@android.com> MTP: Have GetStorageInfo command return correct storage type for removable storage

Change-Id: I09b548483c12080e7d77970babcae2eef379f2f4
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpStorage.cpp
tpStorage.h
aeb65d45a93878bba361956b3f3280b36cc48e59 25-Apr-2011 Mike Lockwood <lockwood@android.com> DO NOT MERGE MTP: Implement GetThumb command

This allows the PC to access thumbnails in JPEG files over MTP/PTP

Bug: 3219495

Change-Id: Id61f353ba70e896fae9a47338bf7871c0f185d3e
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.h
tpServer.cpp
tpServer.h
c9ee8c2dd7d0860b41a3312bbf7ff390f5d0cf8e 25-Apr-2011 Mike Lockwood <lockwood@android.com> DO NOT MERGE MTP: Fix file descriptor leak in file editing extensions

Change-Id: Ie0b979b5cfd9b5f9e9196c5f8c8ecccef6ed84c3
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpServer.h
4d9da14065fea7bca759f83c419ce10bd1195e83 22-Apr-2011 Mike Lockwood <lockwood@android.com> DO NOT MERGE MTP: Add extended operations to support in-place editing of files

MTP does not support partial writes of files (the entire file must be transferred at once).
This makes it impossible to implement a FUSE file system for MTP
with acceptable performance.
To fix this problem, this change adds extended MTP operations to allow
partial writes to files:

SendPartialObject - allows writing a subset of a file, or appending to the end of a file

TruncateObject - allows changing the size of a file

BeginEditObject - must be called before using SendPartialObject and TruncateObject

EndEditObject - commits changes to a file after it has been edited with SendPartialObject or TruncateObject

We also add GetPartialObject64, which is the same as GetPartialObject
but has a 64 bit offset rather than 32.

Change-Id: Id5365e1c4dc55a2d819c16c9db0a3ac2260f9309
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpDebug.cpp
tpServer.cpp
tpServer.h
tp.h
0241cacb85dbac20b28036bbb8025dfd513e3753 05-Apr-2011 Mike Lockwood <lockwood@android.com> DO NOT MERGE MTP and media provider support for multiple storage devices:

- MTP support for multiple storage units

- Add storage_id column to media database for MTP storage ID

- Add framework resource for defining mount points and user visible descriptions
for multiple volumes

- Clean up locking in MtpServer JNI code

Change-Id: Ide6d47bd9aa1698ed2a13d695613e03f2a9b29e3
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.h
tpStorage.cpp
tpStorage.h
tp.h
3d74457b66533b170606347e60628e55a2af255e 14-Mar-2011 Mike Lockwood <lockwood@android.com> MtpDevice: Handle zero length packets in readResponse()

Bug: 3509060

Change-Id: I291eefeaa667688c9e6e75da74ec3025b84065e9
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
33bde8d8c4fc71fb3cdd8356fd0df70ffb44fcd7 12-Mar-2011 Mike Lockwood <lockwood@android.com> MTP host: Fix problems reading large data packets

Fixes problem reading large thumbnails via PTP

Bug: 4065217

Change-Id: I643672512829c93ab0827091f39103dbb1918071
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
a849440ca96e93f700d62c6e41d48905b4d405b6 18-Feb-2011 Mike Lockwood <lockwood@android.com> MTP: Add support for dynamically adding and removing storage units

BUG: 3402847

Change-Id: I7da266061d949abcb6bb11c6faaa47b5e4a2a977
tpServer.cpp
tpServer.h
tpStorage.cpp
tpStorage.h
tp.h
d4fb52e3031578119ecd53087b1bcb4828c333c5 15-Feb-2011 Mike Lockwood <lockwood@android.com> MTP host: disable some test code

Change-Id: I2237ad88f73b03a2c324f17267c52cc42b8a0d5b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
126ea73dd1919c8a176019c50b1ca96035aef45b 14-Feb-2011 Mike Lockwood <lockwood@android.com> MTP host: Use usb_device_bulk_transfer for synchronous transfers

Change-Id: Icf42ea0e5a848cee1565da49713ee9ad0db9f1a6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpPacket.cpp
31c52e7c8c01e1db6ff9bcf66135c72544b1235a 02-Feb-2011 Kenny Root <kroot@google.com> Fix some memory leaks found in static analysis

Change-Id: Icd630009793c51acfaed45763ef50489ead40024
tpDevice.cpp
8d08c5aeee05425357b6603a22fa73fd6e095a47 31-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: Use ro.product.manufacturer system property value for MTP manufacturer name

Previously it was hard coded to "Google, Inc."

BUG: 3405965

Change-Id: I5f962d474814c22e990c39b501c0f01da9e8dc6d
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
f41ef0ee0da4c497352df42d09c3d89940c25e14 27-Jan-2011 Mike Lockwood <lockwood@android.com> Add support for synchronous bulk USB transfers

Change-Id: Id5de49e4d728a702fa1583ecc24f83f36cc57d21
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
d7376cae7aba269dca143b94c3d6736d0ed02213 27-Jan-2011 Mike Lockwood <lockwood@android.com> am bd65c065: am a13732e1: Merge "MTP: Fix month off by one error in date parsing and formatting code" into honeycomb

* commit 'bd65c065b2dcb54dde563a8a21c9f92da947c7dd':
MTP: Fix month off by one error in date parsing and formatting code
ea1db0a716cc937af5371153b959610baa2c6d52 26-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: Fix month off by one error in date parsing and formatting code

BUG: 3379100

Change-Id: Ib386f0def9d611529ce0528b8159cef48df9cd85
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpUtils.cpp
7aa9f73b06525781245b8c2970f09f48050a276d 23-Jan-2011 Mike Lockwood <lockwood@android.com> Merge "New APIs for MTP and PTP host support"
23f1b33c5f88f07510ca5dc01b3afd7af6843d6c 30-Dec-2010 Mike Lockwood <lockwood@android.com> New APIs for MTP and PTP host support

This replaces the previous ContentProvider based interface

Change-Id: I4cea2544854adb9fdcc04345e4d73d8ef05380f3
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpClient.cpp
tpClient.h
tpDevice.cpp
tpDevice.h
59d6ae5e339547fea8a350c1d855b52d5ac4f62c 22-Jan-2011 Mike Lockwood <lockwood@android.com> Remove MTP related log spam

Change-Id: I9de1792cbeec07fa5ab42ff9a10813f0c3d30fc1
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpStorage.cpp
aa95240d9096f97aa2e2022fae8764a4386c8951 18-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: Fix problems with modification dates for folders and non-media files

Also removed an unnecessary parameter to MtpDatabase.endSendobject()

BUG: 3352142

Change-Id: I6fd812dcba4814956bc8bc1cbd6bd5c868197790
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
5de2001a5c3f854b63dbcea284e02f930881ca75 06-Jan-2011 Mike Lockwood <lockwood@android.com> Remove support for obsolete PTP content provider

This will be replaced by a new PTP host API in an upcoming commit.

Change-Id: Ib914194e332b5c090cb8e34ed35bd691bc9f85d1
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpCursor.cpp
tpCursor.h
42d0b79a787814d42e4c6f9dfe14f13cc0f6a758 04-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: changes to use new usb_request support in libusbhost

Change-Id: Ic091eab166a66efcde0395dcebbbc513f2322fca
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tpEventPacket.cpp
tpEventPacket.h
tpPacket.cpp
tpPacket.h
tpRequestPacket.cpp
tpRequestPacket.h
tpResponsePacket.cpp
tpResponsePacket.h
d1b056a099b29e81d65582a8612210967fb71f93 29-Dec-2010 Mike Lockwood <lockwood@android.com> Change libusbhost and libmtp from static to shared libraries

Change-Id: Iccc67db32400cdeb88aa33261c9e0cf73db992ca
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
feafefb1ed8d86100161f521fc7a44b819bd9529 14-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: check for replacing existing files via the database instead of the file system

Change-Id: I283dab48f24d2836e48fab8e49764a9cdf13de55
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
20c3be0e0394e1340c036685eb1edb8f6ef5a2ac 12-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for reserve storage setting to avoid low storage situations.

Set resource config_mtpReserveSpaceMegabytes to number of megabytes to reserve.
If MTP has dedicated storage this value should be zero, but if MTP is
sharing storage with the rest of the system, set this to a positive value
to ensure that MTP activity does not result in the storage being
too close to full.

BUG: 3250924

Change-Id: I881c87240da268bad1ea1b99ad03673ab85ffdbf
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpServer.h
tpStorage.cpp
tpStorage.h
f7454622eaac287d20ab43013d7015fe42b894f8 10-Dec-2010 Mike Lockwood <lockwood@android.com> MTP host: Handle receiving a response packet instead of data packet.

This will happen if the device needs to report an error rather than returning the data.

Change-Id: I477512b3676c2f0518a85a4135832ed4475fbc2d
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
tpPacket.cpp
tpPacket.h
fd34626771a63d3a835863e1b4bf71dcb26e28d8 09-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Improve argument checking in SendObjectInfo

In particular, make sure the parent is a folder and make sure file
does not already exist.

Change-Id: Ifa870faba3285f03a92025d9e82f93fed78a761c
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpProperty.cpp
tpServer.cpp
99e393a39a31bfbdeb435462939519e2d0279433 08-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Support format argument in host GetObjectPropDesc command

Change-Id: Ic14313c0f95bea1d1d475cc6a001b256fccb91c8
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
5da864845e024833c4c7f641acd7c88187a6bc1e 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Read property code before calling isDeviceProperty in MtpProperty::read()

Change-Id: I0b1493f3af5d9caac08327f9ffba91ee255d3d55
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
0c7c7c76a96a82ec728a2d5c091941c4057ffb25 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Improve MtpProperty logging support

Change-Id: I46800b99763edcc5e994d912941f9f5e9b1c94d2
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
tpProperty.cpp
tpProperty.h
98693f674125484de8873d969c209276a6dd604b 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Host support for GetObjectPropsSupported and GetObjectPropDesc

Change-Id: I6fd23587597fc68227dfb61118b097eda3e3e1d5
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
2e09e289b7e136481e9215bb61ed47cee5d9919b 07-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Use correct return type for getSupportedObjectProperties

Change-Id: I6d5bd63fecaa3384dfa1b97dbc0d89ea5668981f
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
ddc4497c17b23d4a9828f977d5ac11ee36059da9 07-Dec-2010 Mike Lockwood <lockwood@android.com> Revert "MTP: Remove static library build for linux host."

This reverts commit d46c683f0e13ad9341ba83453835f6658ae5ad15.

Change-Id: I7e56760c92bad1d66d4a1f2415328a4d2138de84
ndroid.mk
40ce1f262cc4edbc8b7c470830325466263acaec 02-Dec-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for multiple properties in GetObjectPropList command

Change-Id: Ib469a6c8141937aaa3e811345056195117abb4b2
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpProperty.cpp
tpServer.cpp
1d34b4b921cdac91116e456d97b57a1931e9e335 30-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Make sure buffer is big enough before reading the data packet

Fixes buffer overflow when transferring large playlists.

Change-Id: I1b7feaf9e56d849e5b6609f0f68a6aa5a3ae1ea8
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
f05ff073495b0bb3e49859aee5b54d3e25088985 24-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Fix typo in MtpServer::doGetObjectPropList

Change-Id: Ia5fec45a238c49a6797a4ac55457ddb5d6521408
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
d81ce3cf2e6479915658a0829eced062e3655320 23-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Implement GetPartialObject command

Allows host to read partial contents of files on the device

Change-Id: I74927f7394224d674e1d150a4b72a51d9358459b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpPacket.cpp
tpServer.cpp
tpServer.h
b892d0e5556ed6ded3e0548f75ab16fc2e3d92c3 24-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Use DateTime form in GetObjectPropDesc for date/time properties.

Change-Id: I5a3c0b07a9f2958b86947256606e6a824dbe93a6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
tpProperty.h
57151f37d7c91e031e91f67a83ee49cad33b4867 22-Nov-2010 Mike Lockwood <lockwood@android.com> Rename MtpCursor to PtpCursor

Change-Id: I8ce257641388b195f3e17995d323355b19355dc1
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpCursor.cpp
tpCursor.h
tpCursor.cpp
tpCursor.h
8e4d78541aafe9df78db510b3c804222cceb1e40 20-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Remove static library build for linux host.

Change-Id: Iefdd386b91dba0579ca952aca40b7114535e1d4e
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
27afe3a1cc9c07ac4884a7720087a597aea3c76f 19-Nov-2010 Mike Lockwood <lockwood@android.com> PTP: Fix permissions problems with files imported via PTP

Change-Id: I630a89c67e5b3d6d0c29e6c257f84e1909fa4de2
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
b9ff444a7eaf7ffd43970c0477110c6808bd4a7c 19-Nov-2010 Mike Lockwood <lockwood@android.com> PTP: Improve performance and reliability of file importing

Now the file copy is done completely within the media process
rather than pushing data to the client via ContProvider.openFile().

File system writes are now interleaved with USB reads, which allows us
to copy the data faster and prevents the camera from timing out during transfer.

File is automatically inserted in the media provider after a successful import
and a Uri is returned to the client.

BUG: 2994234

Change-Id: Ie75c63da76f623343d3d966c6a707aa1ae871972
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
e1b8cf1cafb75ce1339b67eb1764e224a257c579 16-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Fixes to allow file transfers > 4 gigabytes

BUG: 3198248

Change-Id: I6f11c79a19d7bdd63718a7370939124b1262d221
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
f5b2ff2a636d1a98e959553376ebffa3a2749843 17-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Set correct format for abstract audio playlists

Fixes a bad interaction with the media scanner that could result in
playlists getting duplicated or deleted after rebooting.

BUG: 3175649

Change-Id: I970234e86b24ac17d069aca085683d988abc7881
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
b6da06e9dfb916da4b88e09e8a83e22ddae445b5 15-Oct-2010 Mike Lockwood <lockwood@google.com> MTP: Partial implementation of the GetObjectPropList command

In this initial implementation we only support fetching one property at a time.
Support depth = 0 (single object) or depth = 1 (all objects in a directory)
Reimplemented GetObjectPropValue on top of GetObjectPropList, since the former
is a special case of the latter.

Change-Id: Ia76ee61741d6ee3902b5c5d9fc094cf86dfaf650
Signed-off-by: Mike Lockwood <lockwood@google.com>
tpDatabase.h
tpDebug.cpp
tpProperty.cpp
tpServer.cpp
tpServer.h
tp.h
7ce05cf6009a2fbbceb3d2c0ff639473d0b7d6a9 11-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Add missing call to closedir() in recursive delete code

BUG: 3185660

Change-Id: I3744d2cb193829d20a689af2aea50e8516779631
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
d472e2804190ea6261a88dae546e5908309209f9 10-Nov-2010 Mike Lockwood <lockwood@android.com> MTP: Don't dump data packets twice in debug output.

Change-Id: I49b383d39aea101a58ae6902952ba91b44e7dc3b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDebug.cpp
0181726d0cc2d0fc6f6a53b6479dcf0fc41b9499 10-Nov-2010 Mike Lockwood <lockwood@android.com> Add support for range and enum forms in MTP ObjectPropDescs

Change-Id: I70809401e37a1cfb82f5dbf86947be7d9500ccf1
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
tpProperty.h
23d2071ab44d7b5e3b16e8a81e11884faf01092f 11-Oct-2010 Mike Lockwood <lockwood@google.com> MTP: Include size of 12 byte header in packet size for GetObject data packet

Fixes file transfer from device to host with libmtp.

Change-Id: Ifb304c1f106e94b2710ee5c11816b83cf5f25478
Signed-off-by: Mike Lockwood <lockwood@google.com>
tpServer.cpp
3a2f37f40cfceb181ee61ae53a7d6954ce9717cd 28-Sep-2010 Mike Lockwood <lockwood@android.com> MtpCursor: Fix long to int truncation bug

BUG: 2978335

Change-Id: I2491a2ce3b65afa272540090cabace52067b8534
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
tpCursor.h
be92346b66d396830b30f535bc4b8a545b8c0009 26-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Fix some warnings

Change-Id: I1302cacd1df885c770332cecaaea9f7c8ab97b88
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpObjectInfo.cpp
dde372033b4da75ebde7ea2afdec1c1b86ab5a42 26-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Include current property value in GetDevicePropDesc

Change-Id: I05125c79ad58b6f75734fcedcc8af9b689fa9ff3
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
tpProperty.h
tpStringBuffer.cpp
tpStringBuffer.h
tpTypes.h
7cee5d3c3673d9a325d8096eea0ba48258fc656c 25-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Fix reading and writing device property descriptors

Change-Id: I8d9653ceedfed688addd6c4194c097d7090c3468
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
677f5700c5ea35256079ef14e06b7382e438d860 24-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Reenable GetObjectPropValue and SetObjectPropValue

Windows no longer chokes now that we implement the minimum set of properties

BUG: 2869730

Change-Id: Ie8bd9107610b9b38f060ad8a2f05334a3b4aff9b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
a881b44cc7e18bdfa03251bc65b7d0903a1b1efc 24-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Minor debug output cleanup

Change-Id: I1065179aa64f43c7d8067ccda249319a016840ab
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
4620df7b92a85074a2fcdca3fc6f3a3d432bffb8 23-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Fix problems with signed ints in MtpCursor.cpp

BUG: 2978335

Change-Id: Ie9f3dea3b88b00a555e1ca3232f196e83ee7a6da
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
tpCursor.h
32eaa26f6152913b015f855a930cd8f12bd21d4d 21-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Fix typo that resulted in the MTP provider returning thumb format for object format

BUG: 2994234

Change-Id: I99574043d3e0b310b9b7246f89b5b4a1e14fb5a6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
d32114950770a6e9361e0869a41e5a03a7acab42 13-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Delete all files and subdirectories when deleting directories.

Children are now recursively deleted from the database and filesystem.

Change-Id: Ifd9b48cbc34b84b8f5073f2493dfe9735fae5492
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
e3e76c456baee122de6715ae280130abaddc906c 02-Sep-2010 Mike Lockwood <lockwood@android.com> MTP: Implement support for getting/setting device properties

Added support for the "device friendly name" and "synchonization partner"
properties, which are required by Microsoft.

Change-Id: Ic0443333d75f7d98a2d902a790b9d505a56d4eef
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpProperty.cpp
tpProperty.h
tpServer.cpp
6b3a9d15c8a2282c03f1df7d72a55b6800d4ecec 31-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Send an Intent after an MTP session that resulted in media database modifications

Change-Id: Ib2796e9155350c67769502935a73cf98d6ae9c08
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
5959988b63ace3fba2fc78b135a4f5ef25dcf860 26-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Fix build break due to integer constant too large

Change-Id: Ia03ebe171d68bdfb04913abafc11dcb9c9071595
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
8277cec96ffa55082962591bca1c55abbeec8c26 10-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: work in progress on expanded property support

GetObjectPropValue and SetObjectPropValue are disabled until I figure out
why Windows doesn't like what I have done.

Change-Id: I74e945ef3ea031f6d46f4ebaa8df815da0a5c3ed
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.h
tpServer.cpp
tpServer.h
de1e37aad04640ef76f3c017b65adca087c7be0f 18-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Compatibility fixes for transferring strings

Change-Id: Ic06d754ee68b0389439cdc34f73adff0f2b33afa
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpStringBuffer.cpp
bf9b2052d207f8f2a23470f1c4dfe464f430f387 10-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Fix wrong delete operator from previous change.

Change-Id: I64e8fdc610495f21060727b6bed42d1584833405
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
782aef17c9921a3bf401a0432878df5031f2328b 10-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Push queries for supported formats and properties up to Java.

Change-Id: I4f117090340e3916afda3d194521a6092a672ddc
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.h
tpServer.cpp
tpTypes.h
d7943b4cd2fa597581d1e29325adccc62dbf2939 10-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: turn off verbose logging

Change-Id: Ifd449c4e8c4aec6e5623869e86f8cbedd303972c
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDebug.h
2bb8c0e7c4e4093f4161ff5e98cef51c87193859 09-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Fix reading and writing property descriptors

We were missing support for the group code, resulting in an off by 4 bytes problem.

Change-Id: I4a640c67b8d36e1bd658b6185178a71966d4b0b6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpProperty.cpp
tpProperty.h
a1825afa98dcb8fe2e44750072eaa04f7638623f 09-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Add debug code for printing names of MTP format and property codes.

Change-Id: Ia95ff014cec8720d01091fa30764011089076fe8
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDebug.cpp
tpDebug.h
f83caa2ef9574652b5f43c637a7899a3cbf95aa1 09-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Fix some typos

Change-Id: Ib31708c3a925e3c0ab8eea6922ab09e02b740936
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tp.h
438344fba74ddd6b931ac733fa48643f27b63de3 03-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for syncing MTP playlists

MTP playlists now correspond to playlists in the media provider
(like those created by the Music app).

Change-Id: I085cb3cff003037ad62f0e297fb0cfd3047cb3a2
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
tpServer.h
343af4ef512869695456a91519e73ed3c3d82101 02-Aug-2010 Mike Lockwood <lockwood@android.com> MTP: Implement GetNumObjects

Change-Id: Iccc3a445f9a1eab7bb76eddd567c6a3a8f155b2b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
tpServer.h
9c04c4cc038f924d9cb98798e1c07fe6017e85d0 02-Aug-2010 Mike Lockwood <lockwood@android.com> Clean up MtpDatabase API.

Return MTP response codes instead of booleans for success or failure.
Remove some unused code.

Change-Id: I82ce80a4d7779233264e3caf139ebd0cece12f5c
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
da90dff17b6ce79d0a7d8ab2dbe2aa69cd1c11aa 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP host: Reduce buffer size for readObject so we don't clog our pipe.

Change-Id: I24d2b1551af5843e48c0a63b84925b3a6451e36a
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
f43c641bf3f8bcb5748f4ae504d434896edc94f5 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Turn off excessive logging

Change-Id: Ib0dd8cb99efa324d0b4e742bffeb913d6122ace2
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
tpDebug.h
tpDevice.cpp
tpDeviceInfo.cpp
tpProperty.cpp
0cf89f2e622aa53f31fa5762ca4bc805bb509ed3 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP host: Add support for reading files from an MTP device via ParcelFileDescriptor

Also added some support for sending files to the device that hasn't been debugged yet.
Add locking to MtpDevice to prevent it from attempting multiple transactions simultaneously.

Change-Id: I2b995ba0af086cc6920bd6b8c869f540ad78560a
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
2b6c4a26499693ae3638e3df6d4255b13e34ee29 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Don't request thumbnails for folder objects in MtpCursor

Change-Id: I75a0a834ab746bed0a35883539c8dbc104789157
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
tpCursor.h
80a82ea7eb05c0b807a3b0a76e1b7137ea059189 27-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Add hard coded support to recognize a couple MTP music players for testing purposes.

Change-Id: I2d09d78e83d13cfb3edff02372a6fc34b1e4d8b1
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
5d98aaf0027d803fcfd4a1f2c374dfd34fb2cbad 20-Jul-2010 Mike Lockwood <lockwood@android.com> Merge "MTP host fixes:"
437e945013318de54746422c8b44306e6d5319ca 20-Jul-2010 Mike Lockwood <lockwood@android.com> MTP host fixes:

Add support for detecting android MTP devices
Fix problem reading data packet with header sent separately from payload.

Change-Id: I07b34af6783ebe2e63a317796ba0c8223df86edf
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpDataPacket.cpp
59208db843985cb0626a71029ea2a08050702a61 20-Jul-2010 Andy McFadden <fadden@android.com> Fix sim-eng build.

The LOCAL_PATH assignment was not available to the new host library
on simulator builds.

Change-Id: I7727f17ecc8f457f92bd6fa9ec13025dd8a56390
ndroid.mk
941f1132dd76a959f17aaefd1ac2c0c6cc27a444 20-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Remove race condition in initial device enumeration for host mode.

Change-Id: Iee01aaae3f8cca4234daa289bef6631da4d6c2b6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpClient.h
5cdceca217319bf6a22caf1acadc38c8dc259316 20-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Fix problems reading and writing arrays in property values.

Change-Id: Idd53b63fd32698a3ffc90f174d16ae597b4feb36
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.h
tpPacket.h
tpProperty.cpp
be9a95ce176e94c54f08454dc19e500546578154 19-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: add Linux host library for MTP/PTP host support.

Change-Id: Ie2ce60b957ee428a8e8db46a70c5a0ade8445007
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpEventPacket.cpp
73ecd23cc2ebadb8e1fae1cc21ac559524c6b2bb 19-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Only send events to host if we have an open session.

Change-Id: I7b2d0c88c2d2ae0490247703d0fb1b862154db92
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
53fbfed0c81ac82606f27e25bbc61b44dde927a1 15-Jul-2010 Mike Lockwood <lockwood@android.com> Exclude MTP implementation from simulator build

Change-Id: I93364c74c26ba6e2bf6b08f1bd82802b966c8dfb
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
8065e2056073808716db32136d7acfd50eeab924 15-Jul-2010 Mike Lockwood <lockwood@android.com> Remove our copy of the f_mtp.h kernel header, now that it is in bionic.

Change-Id: I2b5e72bf25b3525ace4b919c6e8b6bd6750f6dfa
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpEventPacket.cpp
tpServer.cpp
_mtp.h
873871f3e75831bcda6c3f75bb4d53355ca5c53a 13-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for sending events to the host when objects are added and removed

Change-Id: Ia1d5232b919c644c670ff9ca651eca92b3f9ad42
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpEventPacket.cpp
tpEventPacket.h
tpServer.cpp
tpServer.h
tpTypes.h
_mtp.h
4714b0766ecf48f09f39b4781a5c4deafc092d49 12-Jul-2010 Mike Lockwood <lockwood@android.com> Integrate host to device file transfer with the media provider.

MTP file transfers happen in two stages. The SendObjectInfo command sends
some information about the file and reserves an ObjectHandle for the new file.
The file transfer is then performed using the SendObject command.

To support this in the media provider, MtpDatabase.beginSendObject receives
the information from SendObjectInfo and creates an row for it in the MTP objects
table for the new file. After the file transfer has completed, then
MtpDatabase.endSendObject is called. In endSendObject, we run the media scanner
on the new file, which will add a row to the images, audio, video
or audio playlist table.

To avoid the media scanner creating a second row for the file in the MTP objects
table, we pass the ObjectHandle created in beginSendObject to the media scanner,
which then passes it to the media provider via the content values when it
performs its insert.

Change-Id: I1ebcc63d6bd4404b0d3a93c703a9d3c097381d3a
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.h
tpServer.cpp
tpServer.h
7f53a190463274096155704276f3002c1620a364 09-Jul-2010 Mike Lockwood <lockwood@android.com> Remove some scafolding and test code that is no longer worth maintaining.

Change-Id: I9ee62d2463d8df1246a84774e8ac7e674778279a
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpDatabase.h
tpMediaScanner.cpp
tpMediaScanner.h
tpServer.cpp
tpServer.h
tpSqliteDatabase.cpp
tpSqliteDatabase.h
tpStorage.cpp
tpStorage.h
tpTypes.h
qliteDatabase.cpp
qliteDatabase.h
qliteStatement.cpp
qliteStatement.h
tptest.cpp
cantest.cpp
1865a5ddcfe7b0e8dc211419aea1094b1491a5fd 03-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Use media provider database to implement MTP device support.

Uses a new "MTP objects" table in the media provider to support basic
enumeration of the external storage file system.
Support for accessing audio, video and image metadata in the existing
media provider tables will be added in a later commit.

The C++ MtpDatabase class is now abstract, to support a proxy subclass that
calls through JNI to the Java MtpDatabase class in the media provider.

Change-Id: I90f0db5f3acc5d35ae78c27a8507edff16d14305
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDataPacket.cpp
tpDataPacket.h
tpServer.cpp
tpServer.h
tpSqliteDatabase.cpp
tptest.cpp
dda7e2b7378755637f188cca7c5ae854427a28f7 03-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: remove separate audio table from prototype MTP database

Change-Id: I5e4b49b741a0a3c6ddf5afcbb20a0d7c9515c8ce
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpDatabase.cpp
tpDatabase.h
tpMediaScanner.cpp
tpMediaScanner.h
tpServer.cpp
tpSqliteDatabase.cpp
tpSqliteDatabase.h
tpTypes.h
8e2a280ab7f98bf00ff2651f1f93c8f8bd46c08d 02-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Fix ownership and file permissions for transferred files and folders

All new files and folders are created with group sdcard_rw
Permissions for new files are 0664 and directories 0775

Change-Id: I6d508231150f687e2e529112fd47f10e30fa594f
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpServer.h
tptest.cpp
0250361b110267a139cc0865ff7d2f13b4d63bdf 02-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Make MtpDatabase class abstract so we can have multiple implementations

Rename existing test database to MtpSqliteDatabase
This is the first step in transitioning to using the media provider database

Change-Id: I5f36c854c6e76a79137c267b000a52ced803776c
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpDatabase.cpp
tpDatabase.h
tpServer.cpp
tpServer.h
tpSqliteDatabase.cpp
tpSqliteDatabase.h
qliteDatabase.h
cantest.cpp
cff0ef94eccba9ce2f72380a238793f1702474b7 01-Jul-2010 Mike Lockwood <lockwood@android.com> MTP: Remove an unnecessary thread from the MtpClient class.

Now a single thread is used for passing USB host events up to MtpClient.

Change-Id: I0e3a277956cb3d1036da122ea10acb03a27844d6
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpClient.h
30cb2dd954f60047987b11020703c3bef1f8749f 01-Jul-2010 Mike Lockwood <lockwood@android.com> Try to fix the simulator build.

Change-Id: I3640e9eba433e711e23af1c6182e38c86c5b60bb
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
21ef7d0e70c5ad599bc2602cb484f8cd647055ca 30-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Implement GetObjectPropDesc

Change-Id: I283651257254fc9cd9d93eab4605c5e33d3db93e
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpProperty.cpp
tpProperty.h
tpServer.cpp
tpServer.h
05a53a389852a9e52b816c087465f4e0c5009613 29-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add MtpServer Java class to wrap MTP device support.

Change-Id: I818c2d3b3f52ad5bb515acc4d3288b2b43e11908
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpTypes.h
b14e588bec4d5e39e61b020b5b575f2ce555d316 30-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: replace printfs with logcat

Change-Id: I2c30921098e2dc049dc5fc1e0a548ead33c363e0
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpCursor.cpp
tpDataPacket.cpp
tpDatabase.cpp
tpDebug.h
tpDevice.cpp
tpDevice.h
tpDeviceInfo.cpp
tpMediaScanner.cpp
tpObjectInfo.cpp
tpPacket.cpp
tpProperty.cpp
tpRequestPacket.cpp
tpResponsePacket.cpp
tpServer.cpp
tpStorage.cpp
tpStorageInfo.cpp
tpStringBuffer.cpp
tpUtils.cpp
qliteDatabase.cpp
qliteStatement.cpp
tptest.cpp
c6588763ddc20541688e426a24b1b070527c051f 22-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Use a fd instead of a file path in file transfer ioctls.

This restricts the driver to the client's permissions when copying files
to avoid potential security problems.

Change-Id: I9b3151168d334fe4374875804d4ba82bef44db3b
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
_mtp.h
78c1e5ecb7a1c6474485c94276fb6c2bffebd2dc 15-Jun-2010 Mike Lockwood <lockwood@android.com> mtptest: Add option to specify storage path at the command line.

Change-Id: Iac8a34ffb8177018a9164b3f2f97b2e84c3d8f1c
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpStorage.cpp
tptest.cpp
6084a2964e346a036b58b1f4565ccbdefd518234 15-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Use stat.st_mode instead of dirent.d_type to determine file type.

dirent.d_type is not implemented on all file systems.

Change-Id: I50a01fd77a9f976f215e7ff98dd04f0f2611bbce
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpMediaScanner.cpp
c42aa12f73edf79bc9cb0dbf6b74a7f1af11c683 15-Jun-2010 Mike Lockwood <lockwood@android.com> MTP device: Read manufacturer name and serial number from system properties.

Change-Id: I8d1ad79f38aaaa50fa8899e6b614096af95fdf39
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpStorage.cpp
a177ae14b8cd9c1172cd166094cbffb2485325c2 14-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Fix uninitialized pointer bug.

Change-Id: Ia07ebd48aeb483e66957f5a174992d200494a744
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDatabase.cpp
6afc41d095ccb159f6c4705bed903b6c048b922a 11-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add host support for deleting objects.

For example, deleting pictures on a digital camera.

Signed-off-by: Mike Lockwood <lockwood@android.com>
tpDevice.cpp
tpDevice.h
3e072b354d1e1e3ee62d58492f0739139df8aff1 10-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for retrieving thumbnails to MTP content provider.

Signed-off-by: Mike Lockwood <lockwood@android.com>
tpCursor.cpp
tpCursor.h
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
0ef2bf5df731114fce7307dc881b69d198b6d933 08-Jun-2010 Mike Lockwood <lockwood@android.com> MTP provider: Add columns for MTP ObjectInfo dataset to the MTP objects table

Signed-off-by: Mike Lockwood <lockwood@android.com>

Change-Id: Ife0563ad1c3b3dbc2461e1a9e784cbb4653b3435
tpCursor.cpp
tpObjectInfo.cpp
6a2736ba7bc19947a6c0bff4dca50595baa78b37 08-Jun-2010 Kenny Root <kroot@google.com> Include stdlib to fix sim build

Change-Id: I7732461a9351f53f9ddadcfb26485f2e553e056b
tp.h
a6c490b8b2d96ebaab632286029463f932ae3b6b 06-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: host support for retrieving device property descriptors

Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpDataPacket.cpp
tpDataPacket.h
tpDevice.cpp
tpDevice.h
tpDeviceInfo.cpp
tpObjectInfo.cpp
tpProperty.cpp
tpProperty.h
tpStorageInfo.cpp
tpTypes.h
ab372f6738b7de287f9a9fa7e3ecb70a46ada359 04-Jun-2010 Mike Lockwood <lockwood@android.com> Merge "MTP: Add support for host cancellation of file transfers."
916076c6d84dac9b104fbdf94af5dcd7bce669fd 04-Jun-2010 Mike Lockwood <lockwood@android.com> MTP: Add support for host cancellation of file transfers.

Change-Id: I72df423f8017286e41adae525e6fbcb6b8440687
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpServer.cpp
tpServer.h
c8ca7dafbeef10218371bdfa13a76525c593343a 04-Jun-2010 Doug Kwan <dougkwan@google.com> Add missing library to linker command line.

Change-Id: Ia9ddf6e6bb5e72c32372a2f460806b6cbb7ec660
ndroid.mk
503f034df11972458cb980d2f4b70894b211b02f 04-Jun-2010 Jing Yu <jingyu@google.com> Add missing libraries, in order for gold to work.

gold is more strict than ld. If building A depends on libB directly,
we must specify -lB at link time.

Change-Id: Iac7cec58cbae5e0cbcfc9adab924db6733192d20
ndroid.mk
5ed68d29a140e14c8d46980fa844548eb33b1e87 26-May-2010 Mike Lockwood <lockwood@android.com> Prototype Content Provider support for MTP/PTP devices.

At this point much of the plumbing is in place, but only a few simple queries
are supported.
This is enough to support a proof of concept sample program that navigates
the file hierarchy of a digital camera connected via USB.

Also removed obsolete ptptest host test program.

Change-Id: I17644344b9f0ce1ecc302bc0478c1f3d44a1647f
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpClient.cpp
tpClient.h
tpCursor.cpp
tpCursor.h
tpDevice.cpp
tpDevice.h
tpTypes.h
tptest.cpp
fb570477389cf6157358df21945f22bc16d169f4 25-May-2010 Mike Lockwood <lockwood@android.com> MTP: adjust ptptest app for changes in libusbhost API.

Change-Id: I775e08c851a55d775b532129be11fb19515fbf6e
Signed-off-by: Mike Lockwood <lockwood@android.com>
tptest.cpp
e13401bf532c7e4bf9ab82c7e9b13642838a927d 19-May-2010 Mike Lockwood <lockwood@android.com> PTP host: Implement getObjectHandles and getObjectInfo commands

Change-Id: I3ff6e52237f400b4e50c534a1f964c80789bfe98
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpClient.cpp
tpClient.h
tpObjectInfo.cpp
tpObjectInfo.h
tpPacket.cpp
tpServer.cpp
tpTypes.h
tp.h
tptest.cpp
335dd2be955607f2632eabc25045857f2cc8b674 19-May-2010 Mike Lockwood <mike@spruce.(none)> More work on PTP host support.

Change-Id: Ifbd5bd5efa3cdb750ae1a2aae38181457554d34d
Signed-off-by: Mike Lockwood <mike@spruce.(none)>
ndroid.mk
tpClient.cpp
tpClient.h
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.cpp
tpDatabase.h
tpDebug.h
tpDeviceInfo.cpp
tpDeviceInfo.h
tpMediaScanner.cpp
tpPacket.cpp
tpPacket.h
tpStorageInfo.cpp
tpStorageInfo.h
tpTypes.h
tpUtils.cpp
tpUtils.h
tp.h
tptest.cpp
fceef46513db3507b413f604cea89e3c7f352663 14-May-2010 Mike Lockwood <lockwood@android.com> MTP: More prototyping work:

New media scanner test program
Media scanner now cleans up after files that no longer exist
Separate database table for audio files
Extract metadata from audio files with libstagefright

Change-Id: I2bd0fe877836c741658e72fcfeb89c11be0d9b41
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpDatabase.cpp
tpDatabase.h
tpMediaScanner.cpp
tpMediaScanner.h
tpServer.cpp
tpStorage.cpp
tpStorage.h
tp.h
cantest.cpp
64a44220725dd05367beb15fd530b6c900f24e1a 16-May-2010 Mike Lockwood <lockwood@android.com> Add -p option to mtptest program to run in PTP mode instead of MTP

Change-Id: Idbd1437756daab8d6141db49b07d4eb0814c9e7e
Signed-off-by: Mike Lockwood <lockwood@android.com>
_mtp.h
tptest.cpp
7850ef999740f214a1990a9c090d3f3865d435aa 14-May-2010 Mike Lockwood <lockwood@android.com> Move MTP code to the android namespace

Change-Id: I5da48038fd5e4cdeefaeba42cdc74eb588b3448d
Signed-off-by: Mike Lockwood <lockwood@android.com>
tpClient.cpp
tpClient.h
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.cpp
tpDatabase.h
tpDebug.cpp
tpDebug.h
tpPacket.cpp
tpPacket.h
tpRequestPacket.cpp
tpRequestPacket.h
tpResponsePacket.cpp
tpResponsePacket.h
tpServer.cpp
tpServer.h
tpStorage.cpp
tpStorage.h
tpStringBuffer.cpp
tpStringBuffer.h
tpUtils.cpp
tpUtils.h
qliteDatabase.cpp
qliteDatabase.h
qliteStatement.cpp
qliteStatement.h
tptest.cpp
tptest.cpp
67589f441aca391c27244cd231c2d770a9fe203d 13-May-2010 Mike Lockwood <lockwood@android.com> Exclude mtptest program from simulator builds.

Change-Id: Ia9751a06d7607363e8c16b71f6f3c524833395a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
16864bae0f51c32c456da2c43adf7a057c0c4882 11-May-2010 Mike Lockwood <lockwood@android.com> Checkpoint work on MTP and PTP investigation.

This change includes work in progress on a C++ library for both host and device
MTP and PTP support.
Currently the makefile builds two test programs:

mtptest - a command line test program that implements a small subset of device side MTP.
Requires a kernel driver that has not been checked in yet.

ptptest - a host tool to test USB host support for detecting and communicating with
digital cameras over PTP. Runs on Linux host.

Later this will be reformulated as a native library that will be used in the media process.

Change-Id: I81aab279975b600b59d99013ab97f9adf0b58da7
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
tpClient.cpp
tpClient.h
tpDataPacket.cpp
tpDataPacket.h
tpDatabase.cpp
tpDatabase.h
tpDebug.cpp
tpDebug.h
tpPacket.cpp
tpPacket.h
tpRequestPacket.cpp
tpRequestPacket.h
tpResponsePacket.cpp
tpResponsePacket.h
tpServer.cpp
tpServer.h
tpStorage.cpp
tpStorage.h
tpStringBuffer.cpp
tpStringBuffer.h
tpUtils.cpp
tpUtils.h
qliteDatabase.cpp
qliteDatabase.h
qliteStatement.cpp
qliteStatement.h
_mtp.h
tp.h
tptest.cpp
tptest.cpp