summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpDataPacket.cpp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-07-20 12:01:36 -0400
committerMike Lockwood <lockwood@android.com>2010-07-20 12:01:36 -0400
commit437e945013318de54746422c8b44306e6d5319ca (patch)
tree54dfe8463e95cd893ead14a226ed833c7d19e6d4 /media/mtp/MtpDataPacket.cpp
parent941f1132dd76a959f17aaefd1ac2c0c6cc27a444 (diff)
downloadframeworks_av-437e945013318de54746422c8b44306e6d5319ca.zip
frameworks_av-437e945013318de54746422c8b44306e6d5319ca.tar.gz
frameworks_av-437e945013318de54746422c8b44306e6d5319ca.tar.bz2
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>
Diffstat (limited to 'media/mtp/MtpDataPacket.cpp')
-rw-r--r--media/mtp/MtpDataPacket.cpp2
1 files changed, 1 insertions, 1 deletions
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::writeDataHeader(int fd, uint32_t length) {
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) {