summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpDataPacket.cpp
Commit message (Collapse)AuthorAgeFilesLines
* MTP: add strict bounds checking for all incoming packetsMike Lockwood2014-11-121-43/+117
| | | | | | | | | | | 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
* Fix buffer allocationMarco Nelissen2014-06-231-1/+1
| | | | | | b/15293123 Change-Id: Icb3ceabf02a55bc931baaf388ce125db6332de0e
* Long mp3 metadata displays as corrupted file after transferYin Liu2013-12-201-1/+1
| | | | | | | Cut the metadata to 1 Byte and return in function getObjectPropertyList in order to show it properly on a PC. Change-Id: Iefacf9fa86c20ece2572e6d95d35877a94066fe7
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-1/+1
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* MTP: Don't attempt to read more than 16K at a time from the MTP driverMike Lockwood2011-12-011-2/+4
| | | | | | | | 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>
* MTP: Use a single packet for the data phaseMike Lockwood2011-07-171-37/+9
| | | | | | | | 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>
* MTP: Implement GetThumb commandMike Lockwood2011-04-251-0/+10
| | | | | | | | | This allows the PC to access thumbnails in JPEG files over MTP/PTP Bug: 3219495 Change-Id: I4964f8b4826dffb7f0f77464ec91bd2e97a2f007 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP host: Fix problems reading large data packetsMike Lockwood2011-03-121-3/+3
| | | | | | | | | Fixes problem reading large thumbnails via PTP Bug: 4065217 Change-Id: I643672512829c93ab0827091f39103dbb1918071 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: changes to use new usb_request support in libusbhostMike Lockwood2011-01-061-21/+37
| | | | | Change-Id: Ic091eab166a66efcde0395dcebbbc513f2322fca Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Make sure buffer is big enough before reading the data packetMike Lockwood2010-11-301-0/+1
| | | | | | | Fixes buffer overflow when transferring large playlists. Change-Id: I1b7feaf9e56d849e5b6609f0f68a6aa5a3ae1ea8 Signed-off-by: Mike Lockwood <lockwood@android.com>
* PTP: Improve performance and reliability of file importingMike Lockwood2010-11-191-13/+17
| | | | | | | | | | | | | | | | 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>
* MTP: Don't dump data packets twice in debug output.Mike Lockwood2010-11-101-1/+0
| | | | | Change-Id: I49b383d39aea101a58ae6902952ba91b44e7dc3b Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Fix build break due to integer constant too largeMike Lockwood2010-08-251-1/+1
| | | | | Change-Id: Ia03ebe171d68bdfb04913abafc11dcb9c9071595 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: work in progress on expanded property supportMike Lockwood2010-08-251-1/+11
| | | | | | | | 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>
* MTP: Compatibility fixes for transferring stringsMike Lockwood2010-08-181-1/+4
| | | | | Change-Id: Ic06d754ee68b0389439cdc34f73adff0f2b33afa Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Push queries for supported formats and properties up to Java.Mike Lockwood2010-08-101-0/+7
| | | | | Change-Id: I4f117090340e3916afda3d194521a6092a672ddc Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP host: Add support for reading files from an MTP device via ↵Mike Lockwood2010-07-261-0/+44
| | | | | | | | | | 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>
* MTP host fixes:Mike Lockwood2010-07-201-1/+1
| | | | | | | | 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>
* MTP: Use media provider database to implement MTP device support.Mike Lockwood2010-07-081-4/+15
| | | | | | | | | | | | | 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>
* MTP: replace printfs with logcatMike Lockwood2010-06-301-3/+2
| | | | | Change-Id: I2c30921098e2dc049dc5fc1e0a548ead33c363e0 Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: Add support for retrieving thumbnails to MTP content provider.Mike Lockwood2010-06-101-5/+32
| | | | Signed-off-by: Mike Lockwood <lockwood@android.com>
* MTP: host support for retrieving device property descriptorsMike Lockwood2010-06-071-0/+21
| | | | Signed-off-by: Mike Lockwood <lockwood@android.com>
* More work on PTP host support.Mike Lockwood2010-05-191-0/+64
| | | | | Change-Id: Ifbd5bd5efa3cdb750ae1a2aae38181457554d34d Signed-off-by: Mike Lockwood <mike@spruce.(none)>
* Move MTP code to the android namespaceMike Lockwood2010-05-141-0/+4
| | | | | Change-Id: I5da48038fd5e4cdeefaeba42cdc74eb588b3448d Signed-off-by: Mike Lockwood <lockwood@android.com>
* Checkpoint work on MTP and PTP investigation.Mike Lockwood2010-05-131-0/+296
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>