summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpDevice.cpp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-06-10 16:34:20 -0400
committerMike Lockwood <lockwood@android.com>2010-06-10 16:58:03 -0400
commit3e072b354d1e1e3ee62d58492f0739139df8aff1 (patch)
tree5c1d39a97b326b210d148dfefb70832ea87e1dab /media/mtp/MtpDevice.cpp
parentfee87d7b4e60d7541aa2cb0d31f5bdf4ca9e6475 (diff)
downloadframeworks_av-3e072b354d1e1e3ee62d58492f0739139df8aff1.zip
frameworks_av-3e072b354d1e1e3ee62d58492f0739139df8aff1.tar.gz
frameworks_av-3e072b354d1e1e3ee62d58492f0739139df8aff1.tar.bz2
MTP: Add support for retrieving thumbnails to MTP content provider.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/MtpDevice.cpp')
-rw-r--r--media/mtp/MtpDevice.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp
index 5c39628..ee35217 100644
--- a/media/mtp/MtpDevice.cpp
+++ b/media/mtp/MtpDevice.cpp
@@ -194,6 +194,20 @@ MtpObjectInfo* MtpDevice::getObjectInfo(MtpObjectHandle handle) {
return NULL;
}
+void* MtpDevice::getThumbnail(MtpObjectHandle handle, int& outLength) {
+ mRequest.reset();
+ mRequest.setParameter(1, handle);
+ if (sendRequest(MTP_OPERATION_GET_THUMB) && readData()) {
+ MtpResponseCode ret = readResponse();
+ if (ret == MTP_RESPONSE_OK) {
+ return mData.getData(outLength);
+ }
+ }
+ outLength = 0;
+ return NULL;
+
+}
+
MtpProperty* MtpDevice::getDevicePropDesc(MtpDeviceProperty code) {
mRequest.reset();
mRequest.setParameter(1, code);