Don't send short URB packet when sending MtpDataPacket.
When sending a MtpDataPacket to a MTP device, the kernel driver splits it into multiple URB packets so that the URB packet size does not exceed the buffer size at the MTP device. Previously MtpDataPacket sends its header first, then sends the payload. It means the first URB packet only contains the header of MtpDataPacket and the URB packet size is smaller than the maximum URB packet size (short packet). Some MTP devices regard the short packet as the end of the sequencail URB packets, thus the devices do not accept the following URB packets that contain the payload. The MTP spec says if the responder (MTP device) sends the data in a way where the first pacekt contains only the header, the initiator (MTP host) must send data in the same way. Otherwise the initiator must not send a short packet in the sequencial URB packets. The CL fixes the MTP host implementation so that it remembers how the MTP device sends data, and uses the same way when sending data from the host. Bug: 31165557 Test: Manually invokes MtpDevice#sendObject Change-Id: Ic76eb4241ed74957414aef2990be08cd77a9f5a9 (cherry picked from commit d4b4296b)
Loading
Please register or sign in to comment