summaryrefslogtreecommitdiffstats
path: root/media/mtp/ptptest.cpp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-05-19 15:12:14 -0400
committerMike Lockwood <lockwood@android.com>2010-05-19 15:16:38 -0400
commite13401bf532c7e4bf9ab82c7e9b13642838a927d (patch)
treeae254c1d646e17e42119e2052463dff46e4e0d14 /media/mtp/ptptest.cpp
parent335dd2be955607f2632eabc25045857f2cc8b674 (diff)
downloadframeworks_av-e13401bf532c7e4bf9ab82c7e9b13642838a927d.zip
frameworks_av-e13401bf532c7e4bf9ab82c7e9b13642838a927d.tar.gz
frameworks_av-e13401bf532c7e4bf9ab82c7e9b13642838a927d.tar.bz2
PTP host: Implement getObjectHandles and getObjectInfo commands
Change-Id: I3ff6e52237f400b4e50c534a1f964c80789bfe98 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/ptptest.cpp')
-rw-r--r--media/mtp/ptptest.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/media/mtp/ptptest.cpp b/media/mtp/ptptest.cpp
index 2efa4c9..5da4d45 100644
--- a/media/mtp/ptptest.cpp
+++ b/media/mtp/ptptest.cpp
@@ -23,6 +23,7 @@
#include "MtpClient.h"
#include "MtpDeviceInfo.h"
+#include "MtpObjectInfo.h"
#include "MtpStorageInfo.h"
using namespace android;
@@ -47,11 +48,24 @@ static void start_session(struct usb_endpoint *ep_in, struct usb_endpoint *ep_ou
MtpStorageIDList* storageIDs = sClient->getStorageIDs();
if (storageIDs) {
for (int i = 0; i < storageIDs->size(); i++) {
- MtpStorageInfo* info = sClient->getStorageInfo((*storageIDs)[i]);
+ MtpStorageID storageID = (*storageIDs)[i];
+ MtpStorageInfo* info = sClient->getStorageInfo(storageID);
if (info) {
info->print();
delete info;
}
+ MtpObjectHandleList* objects = sClient->getObjectHandles(storageID, 0, MTP_PARENT_ROOT);
+ if (objects) {
+ for (int j = 0; j < objects->size(); j++) {
+ MtpObjectHandle handle = (*objects)[j];
+ MtpObjectInfo* info = sClient->getObjectInfo(handle);
+ if (info) {
+ info->print();
+ delete info;
+ }
+ }
+ delete objects;
+ }
}
}
}