summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-06-17 13:44:24 -0400
committerMike Lockwood <lockwood@android.com>2011-06-17 19:49:05 -0400
commitdc3185e3e27b05e18c4ac34432a25a0c279ff351 (patch)
tree341902c6357c301f74c5b30f50ad6db8af01f299 /media/mtp
parentdaeba2d6b9df5252afacec835a23340e5d9910ec (diff)
downloadframeworks_av-dc3185e3e27b05e18c4ac34432a25a0c279ff351.zip
frameworks_av-dc3185e3e27b05e18c4ac34432a25a0c279ff351.tar.gz
frameworks_av-dc3185e3e27b05e18c4ac34432a25a0c279ff351.tar.bz2
MTP: Fix some problems with GetObjectHandles and GetNumObjects commands
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>
Diffstat (limited to 'media/mtp')
-rw-r--r--media/mtp/MtpServer.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 4a8fd3e..9ec73c4 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -533,12 +533,10 @@ MtpResponseCode MtpServer::doGetObjectHandles() {
MtpStorageID storageID = mRequest.getParameter(1); // 0xFFFFFFFF for all storage
MtpObjectFormat format = mRequest.getParameter(2); // 0 for all formats
MtpObjectHandle parent = mRequest.getParameter(3); // 0xFFFFFFFF for objects with no parent
- // 0x00000000 for all objects?
+ // 0x00000000 for all objects
if (!hasStorage(storageID))
return MTP_RESPONSE_INVALID_STORAGE_ID;
- if (parent == 0xFFFFFFFF)
- parent = 0;
MtpObjectHandleList* handles = mDatabase->getObjectList(storageID, format, parent);
mData.putAUInt32(handles);
@@ -552,11 +550,9 @@ MtpResponseCode MtpServer::doGetNumObjects() {
MtpStorageID storageID = mRequest.getParameter(1); // 0xFFFFFFFF for all storage
MtpObjectFormat format = mRequest.getParameter(2); // 0 for all formats
MtpObjectHandle parent = mRequest.getParameter(3); // 0xFFFFFFFF for objects with no parent
- // 0x00000000 for all objects?
+ // 0x00000000 for all objects
if (!hasStorage(storageID))
return MTP_RESPONSE_INVALID_STORAGE_ID;
- if (parent == 0xFFFFFFFF)
- parent = 0;
int count = mDatabase->getNumObjects(storageID, format, parent);
if (count >= 0) {