diff options
author | Mike Lockwood <lockwood@android.com> | 2011-06-17 20:54:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-17 20:54:53 -0700 |
commit | 31dab950e4ffeaaa33d39c2ca3d0b72fe028265c (patch) | |
tree | b060fa816fd6eafa7f55f12aa4dc8017b59b7712 | |
parent | b5512a1bd218269de30e1d66bac55c81e227dc0c (diff) | |
parent | dc3185e3e27b05e18c4ac34432a25a0c279ff351 (diff) | |
download | frameworks_av-31dab950e4ffeaaa33d39c2ca3d0b72fe028265c.zip frameworks_av-31dab950e4ffeaaa33d39c2ca3d0b72fe028265c.tar.gz frameworks_av-31dab950e4ffeaaa33d39c2ca3d0b72fe028265c.tar.bz2 |
Merge "MTP: Fix some problems with GetObjectHandles and GetNumObjects commands"
-rw-r--r-- | media/mtp/MtpServer.cpp | 8 |
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) { |