OSDN Git Service

Remove urb request size maximum for P api
authorJerry Zhang <zhangjerry@google.com>
Thu, 8 Feb 2018 00:14:25 +0000 (16:14 -0800)
committerJerry Zhang <zhangjerry@google.com>
Fri, 16 Feb 2018 01:09:42 +0000 (01:09 +0000)
commit910e9b0404088c4c8d4c370a8ec40d539b923a9f
tree56bca594c0609d4eea436fdfc1b4e965f539f074
parent1eb43b98417cc652ed983252f66048c48091ffde
Remove urb request size maximum for P api

The 16kB maximum for transfers was removed from
the kernel in 3.3. Devio has since supported
arbitrary transfer sizes through scatter gather.

See the following kernel patches for context:
"USB: change the memory limits in usbfs URB submission"
"usbdevfs: Use scatter-gather lists for large bulk transfers".

Larger buffer sizes will be allowed for apps targeting
P and greater. For apps targeting previous apis, the
previous behavior of truncating length to 16384 will
be applied here instead of libusbhost, for bulk transfers
and queue(ByteBuffer, int). The previous behavior
of throwing an exception will continue to apply
for queue(ByteBuffer).

Bug: 67683483
Test: Run usb_async_test app with USB3 : 38MB/s -> 300MB/s
Test: CtsVerifier UsbDeviceTests pass
Change-Id: Ia52440cb725561b0f1db1a75aa1b8ab952585826
core/java/android/hardware/usb/UsbDeviceConnection.java
core/java/android/hardware/usb/UsbRequest.java