History log of /packages/providers/MediaProvider/src/com/android/providers/media/MtpReceiver.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1469c78b58e40d0400487e61078b1297899d8956 10-Jun-2015 Nick Kralevich <nnk@google.com> 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, 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
/packages/providers/MediaProvider/src/com/android/providers/media/MtpReceiver.java
8efd65fe64c7978534bb549b2329068a2f8c5075 17-Sep-2012 Jeff Sharkey <jsharkey@android.com> Multi-user MTP, handle secondary user boot.

Watch for BOOT_COMPLETED, and dispatch any current USB state or
mounted volumes which may have already occured. This specifically
handles starting of secondary users.

The current MTP kernel driver at /dev/mtp_usb is exclusive, meaning
only one process can have it open. To solve this, the framework
cycles the USB host stack when switching users, giving the new
user's media process a chance to claim the kernel device. We only
start an MtpServer when we're the active user.

Bug: 6925114
Change-Id: Idfcda09aed88140bb470a110a9e4434f5b79abdd
/packages/providers/MediaProvider/src/com/android/providers/media/MtpReceiver.java