summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daichi Hirono <hirono@google.com> 2016-03-28 08:53:15 +0900
committer Daichi Hirono <hirono@google.com> 2016-03-28 04:37:14 +0000
commit1337deb6eac47b9eeef0999a928caba0cfca7126 (patch)
treee03f88aa764e9d921b597fe0959e9136710785da
parent1c431625b38480a146ae2bbaf118753e912061a8 (diff)
Update the comment of MtpDevice#getObjectSizeLong
BUG=27805369 Change-Id: I63762fedf540e89e9ca811a143cb178881ef1830
-rw-r--r--media/java/android/mtp/MtpDevice.java7
-rw-r--r--media/jni/android_mtp_MtpDevice.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/media/java/android/mtp/MtpDevice.java b/media/java/android/mtp/MtpDevice.java
index aa99248485c8..d0ef37c77055 100644
--- a/media/java/android/mtp/MtpDevice.java
+++ b/media/java/android/mtp/MtpDevice.java
@@ -358,9 +358,10 @@ public final class MtpDevice {
/**
* Returns object size in 64-bit integer.
*
- * The object size stored in MtpObjectInfo is unsigned 32-bit integer.
- * The methods reads 64-bit object size from the object property so that it can fetch 4GB+
- * object size correctly.
+ * Though MtpObjectInfo#getCompressedSize returns the object size in 32-bit unsigned integer,
+ * this method returns the object size in 64-bit integer from the object property. Thus it can
+ * fetch 4GB+ object size correctly. If the device does not support objectSize property, it
+ * throws IOException.
* @hide
*/
public long getObjectSizeLong(int handle, int format) throws IOException {
diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp
index f7c677005489..6e434b2756a5 100644
--- a/media/jni/android_mtp_MtpDevice.cpp
+++ b/media/jni/android_mtp_MtpDevice.cpp
@@ -701,6 +701,8 @@ static void android_mtp_MtpDevice_discard_event_request(JNIEnv *env, jobject thi
device->discardEventRequest(seq);
}
+// Returns object size in 64-bit integer. If the MTP device does not support the property, it
+// throws IOException.
static jlong android_mtp_MtpDevice_get_object_size_long(
JNIEnv *env, jobject thiz, jint handle, jint format) {
MtpDevice* const device = get_device_from_object(env, thiz);