Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit df4b5074 authored by robinz1x's avatar robinz1x Committed by Guobin Zhang
Browse files

Use uint32_t instead of int to support 2~4G file



MtpDevice::sendObject is using int to define object size,
if the object size is bigger than 2GB, the size will be type-cast to
a negative number. And it will cause a endless loop in MtpDataPacket::write
until DUT auto reboot.

And JNI api android_mtp_MtpDevice_send_object requires that object
size must be uint32_t , so MtpDevice::sendObject works well after its
size parameter is changed from int to uint32_t.

Also change the return type of below API from int to int64_5
int64_t MtpDataPacket::write(struct usb_request *request, UrbPacketDivisionMode divisionMode,
        int fd, size_t size)
so that it can return the right size in the case of writing 2~4G file.

Test: manual - connect Android device to Android Automotive
Test: manual - select MTP/File Transfer in android device
Test: manual - copy a file which is bigger than 2GB from automotive to the android device.

bug: 115451170

Change-Id: I65b89f195ef0527a802bccefc90721e536683b87
Signed-off-by: default avatarrobinz1x <robinx.zhang@intel.com>
Signed-off-by: default avatarGuobin Zhang <guobin.zhang@intel.com>
parent d8afe483
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment