Also includes a bit of visual updates, options now have summaries
as well.
Code has been refactored a bit, and is more flexible to easily
support any kind of power/data flow combination once its time
to support that.
Currently devices don't have USB-C ports, they can be simulated
with the following commands:
$ adb shell dumpsys usb add-port "matrix" dual
# ?s control whether these can be changed
$ adb shell dumpsys usb connect-port "matrix" ufp? sink? device?
# Do testing here
$ adb shell dumpsys usb disconnect-port "matrix"
$ adb shell dumpsys usb remove-port "matrix"
$ adb shell dumpsys usb reset
# Use the help for more info
$ adb shell dumpsys usb -h
Bug: 21615151
Change-Id: I53ad4de51ff10a197c87bf2741756c1821ee9e74
Rather than hardcoding MTP as the appropriate default when the user
selects "Charger Only", call UsbDeviceManager.setCurrentFunction(null).
Null is intended to restore the default function, which is appropriate
for charging only.
Bug: 21429947
Change-Id: I9ee633bcf2f95f9937861c234ab044873202d41b
When adb is disabled, the default usb mode would be "none", which
would turn off the driver and prevent UsbDeviceManager from receiving
any new USB connect / disconnect messages. This prevents the user
from ever enabling MTP and sharing data when adb is turned off.
As discussed in bug 21429947, we work around this problem by keeping
the USB driver in MTP mode most of the time, so that we continue to
receive USB connect / disconnect messages.
To avoid leaking confidential user photos, we now explicitly unlock
USB data after switching into MTP/PTP mode. Enabling MTP mode is
now decoupled from exposing data on the USB connection.
Bug: 21429947
Change-Id: Id8e9df4ac42fdcf22cc5b75b838bf46f6c225081
Create a new UI for managing USB access control. This UI is implemented
as a transparent popup triggered by a persistent notification.
Delete the old UI for controlling this. It is no longer used.
Bug: 18905620
Change-Id: I54186961414447a9d37f68e946e1c167506170ae