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>
diff --git a/media/mtp/MtpDataPacket.cpp b/media/mtp/MtpDataPacket.cpp
index 6f9ea24..ebe764a 100644
--- a/media/mtp/MtpDataPacket.cpp
+++ b/media/mtp/MtpDataPacket.cpp
@@ -372,7 +372,7 @@
int MtpDataPacket::read(struct usb_endpoint *ep) {
// first read the header
int length = transfer(ep, mBuffer, mBufferSize);
- if (length > MTP_CONTAINER_HEADER_SIZE) {
+ if (length >= MTP_CONTAINER_HEADER_SIZE) {
// look at the length field to see if the data spans multiple packets
uint32_t totalLength = MtpPacket::getUInt32(MTP_CONTAINER_LENGTH_OFFSET);
while (totalLength > length) {