Fixes buffer overflow when transferring large playlists.
Change-Id: I1b7feaf9e56d849e5b6609f0f68a6aa5a3ae1ea8
Signed-off-by: Mike Lockwood <lockwood@android.com>
Allows host to read partial contents of files on the device
Change-Id: I74927f7394224d674e1d150a4b72a51d9358459b
Signed-off-by: Mike Lockwood <lockwood@android.com>
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>
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>
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>
Fixes file transfer from device to host with libmtp.
Change-Id: Ifb304c1f106e94b2710ee5c11816b83cf5f25478
Signed-off-by: Mike Lockwood <lockwood@google.com>
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>
Children are now recursively deleted from the database and filesystem.
Change-Id: Ifd9b48cbc34b84b8f5073f2493dfe9735fae5492
Signed-off-by: Mike Lockwood <lockwood@android.com>
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>
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>
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>
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>
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>
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>
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>