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>
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>
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>
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>
- 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>
Fixes problem reading large thumbnails via PTP
Bug: 4065217
Change-Id: I643672512829c93ab0827091f39103dbb1918071
Signed-off-by: Mike Lockwood <lockwood@android.com>
Previously it was hard coded to "Google, Inc."
BUG: 3405965
Change-Id: I5f962d474814c22e990c39b501c0f01da9e8dc6d
Signed-off-by: Mike Lockwood <lockwood@android.com>
This replaces the previous ContentProvider based interface
Change-Id: I4cea2544854adb9fdcc04345e4d73d8ef05380f3
Signed-off-by: Mike Lockwood <lockwood@android.com>
Also removed an unnecessary parameter to MtpDatabase.endSendobject()
BUG: 3352142
Change-Id: I6fd812dcba4814956bc8bc1cbd6bd5c868197790
Signed-off-by: Mike Lockwood <lockwood@android.com>
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>
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>
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>
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>
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>