summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramVertexFixedFunction.java
diff options
context:
space:
mode:
authorJerry Zhang <zhangjerry@google.com>2017-12-06 16:03:57 -0800
committerJerry Zhang <zhangjerry@google.com>2018-03-22 11:35:19 -0700
commit6d319b8aaa961862afac48010d96d03afb11fa1c (patch)
treea90ec1e5d307de422619e6102060df871e222f54 /rs/java/android/renderscript/ProgramVertexFixedFunction.java
parentc7f6eadffc0a243618ce09ee8d6bb8235738135d (diff)
Write descriptors for Mtp in UsbService
The current model for setting up a functionfs function is: UsbDeviceManager#setCurrentFunctions() -> intent is sent to MtpReceiver to write the descriptors -> init/hal waits for descriptors to write, then pulls up gadget -> Gadget is configured, a USB_STATE intent starts MtpServer The main downside of this is a lack of reliability because the Mtp process could be killed at any point. Normally, a gadget is unbound if its control endpoint is closed. no_disconnect works around this, but is still a little janky. In addition, the extra intent delays the startup of the gadget. With the new model, UsbDeviceManager writes the descriptors on initialization. Since it is a system service, it won't be killed. UsbDeviceManager#setCurrentFunctions() -> init/hal pulls up gadget -> Gadget is configured, a USB_STATE intent starts MtpServer MtpServer calls UsbManager#getControlFd to get a dup of the control endpoint. Also modify permissions so system server can access mtp files. Bug: 72877174 Test: Change usb configurations to ptp/mtp Change-Id: Id17d2b5930f4e1f37ec1b4f00add9d594174ad49
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
0 files changed, 0 insertions, 0 deletions