Commit Graph

6 Commits

Author SHA1 Message Date
Jason Monk
83290eef8c Update USB dialog for USB-C power option
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
2015-08-04 09:18:57 -04:00
Zoltan Szatmary-Ban
ec323a0849 Filter USB options on chooser when DISALLOW_USB_FILE_TRANSFER is on
Bug: 22291579
Change-Id: I32611404ef5f58c7484fe5c4b7a4f7782cc8daa3
2015-07-07 13:24:07 +01:00
Nick Kralevich
2d0f6a9d36 Let UsbDeviceManager choose the appropriate function default
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
2015-06-12 17:18:05 -07:00
Nick Kralevich
5eba30289a Fix USB access control when adb is disabled.
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
2015-06-10 10:24:05 -07:00
Guang Zhu
72aa537980 Monkey should not be allowed to switch USB mode
Change-Id: Ifb4865d234e0d9e6453f88d37c12744b9daefa62
2015-05-19 11:09:40 -07:00
Nick Kralevich
7000d54338 New UI for controlling USB
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
2015-05-13 15:23:52 -07:00