Add comment for readPartialObject's NULL expected length.
BUG=26703522
Change-Id: I584c13e5e5d3f396aa2dfbd351c1c36f7bc0870d
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp
index 48b3739..4dad59b 100644
--- a/media/mtp/MtpDevice.cpp
+++ b/media/mtp/MtpDevice.cpp
@@ -778,6 +778,9 @@
ALOGE("Failed to send a read request.");
return false;
}
+ // The expected size is null because it requires the exact number of bytes to read though
+ // MTP_OPERATION_GET_PARTIAL_OBJECT allows devices to return shorter length of bytes than
+ // requested. Destination's buffer length should be checked in |callback|.
return readData(callback, nullptr /* expected size */, writtenSize, clientData);
}
@@ -798,6 +801,9 @@
ALOGE("Failed to send a read request.");
return false;
}
+ // The expected size is null because it requires the exact number of bytes to read though
+ // MTP_OPERATION_GET_PARTIAL_OBJECT_64 allows devices to return shorter length of bytes than
+ // requested. Destination's buffer length should be checked in |callback|.
return readData(callback, nullptr /* expected size */, writtenSize, clientData);
}