From 0cc79c66329b9ffa7d7bdfafa5d245a11fd3660d Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 13 Oct 2011 11:38:20 -0400 Subject: MtpServer: Pass 0xFFFFFFFF for file size when receiving files >= 4GB in size Bug: 5432487 Change-Id: Ie86e72d9d85476941eab6a9d271948b8fdde6926 Signed-off-by: Mike Lockwood --- media/mtp/MtpServer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'media/mtp') diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp index a9b539b..dc6c011 100644 --- a/media/mtp/MtpServer.cpp +++ b/media/mtp/MtpServer.cpp @@ -947,7 +947,12 @@ MtpResponseCode MtpServer::doSendObject() { if (mSendObjectFileSize - initialData > 0) { mfr.offset = initialData; - mfr.length = mSendObjectFileSize - initialData; + if (mSendObjectFileSize == 0xFFFFFFFF) { + // tell driver to read until it receives a short packet + mfr.length = 0xFFFFFFFF; + } else { + mfr.length = mSendObjectFileSize - initialData; + } LOGV("receiving %s\n", (const char *)mSendObjectFilePath); // transfer the file -- cgit v1.1