Skip to content

Commit 8334038

Browse files
committed
MtpServer: Pass 0xFFFFFFFF for file size when receiving files >= 4GB in size
Bug: 5432487 Change-Id: Ie86e72d9d85476941eab6a9d271948b8fdde6926 Signed-off-by: Mike Lockwood <lockwood@android.com>
1 parent 514a6cf commit 8334038

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

media/mtp/MtpServer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,12 @@ MtpResponseCode MtpServer::doSendObject() {
947947

948948
if (mSendObjectFileSize - initialData > 0) {
949949
mfr.offset = initialData;
950-
mfr.length = mSendObjectFileSize - initialData;
950+
if (mSendObjectFileSize == 0xFFFFFFFF) {
951+
// tell driver to read until it receives a short packet
952+
mfr.length = 0xFFFFFFFF;
953+
} else {
954+
mfr.length = mSendObjectFileSize - initialData;
955+
}
951956

952957
LOGV("receiving %s\n", (const char *)mSendObjectFilePath);
953958
// transfer the file

0 commit comments

Comments
 (0)