"modules/nfc-nci/Android.mk" did not exist on "51704bed795b5b0e5e3c7b792dcdc2bf2d96a9e9"
  • Nick Kralevich's avatar
    Fix USB access control when adb is disabled. · 1469c78b
    Nick Kralevich authored
    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, this change honors the
    unlock state sent to us by the UsbDeviceManager code. We only expose
    user data if explicitly authorized by the user. MTP being enabled
    is decoupled from data being exposed on the USB connection.
    
    Bug: 21429947
    Change-Id: I495011aa4e3e18c5e5e6fe7b9d0e1a3efe747ee7
    1469c78b
MtpReceiver.java 3.12 KB