diff options
author | Nick Kralevich <nnk@google.com> | 2015-07-30 16:29:57 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2015-08-04 10:36:37 -0700 |
commit | 1a008c1ca04871386830f511ee4b47299b92b01f (patch) | |
tree | 23b5f1efbc7678b56f97b8c8ecb5ff07d8d09163 /core | |
parent | 7469060e7855ca5b32f66fbad1a0a4f88737c754 (diff) | |
download | frameworks_base-1a008c1ca04871386830f511ee4b47299b92b01f.zip frameworks_base-1a008c1ca04871386830f511ee4b47299b92b01f.tar.gz frameworks_base-1a008c1ca04871386830f511ee4b47299b92b01f.tar.bz2 |
UsbDeviceManager: fix b/21429947 regression (try #2)
As discussed in b/21429947 (commit
674019065bceb4150190bfb1aa63cda9de0a8560), MTP must always be
enabled, even if access to the underlying MTP data is disabled.
Otherwise, Android will not enumerate on the USB bus, and won't
receive notifications from the kernel about USB state changes. This
effectively prevents using MTP functionality on user builds, or
on userdebug/eng builds with adb turned off.
Always ensure that MTP is the default driver mode.
Move the DISALLOW_USB_FILE_TRANSFER filtering of mUsbDataUnlocked from
setting time to the time we post the sticky broadcast.
Remove isUsbDataUnlocked(). It essentially duplicates data in the sticky
broadcast.
Bug: 22447614
Bug: 21429947
Change-Id: I9d0d94cadbf6db6281ebd77bfb7162f9d06520c2
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/hardware/usb/IUsbManager.aidl | 3 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbManager.java | 15 |
2 files changed, 0 insertions, 18 deletions
diff --git a/core/java/android/hardware/usb/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl index 80c7b1a..6e4c9de 100644 --- a/core/java/android/hardware/usb/IUsbManager.aidl +++ b/core/java/android/hardware/usb/IUsbManager.aidl @@ -97,9 +97,6 @@ interface IUsbManager */ void setUsbDataUnlocked(boolean unlock); - /* Returns true iff sensitive user data is exposed on the USB connection. */ - boolean isUsbDataUnlocked(); - /* Allow USB debugging from the attached host. If alwaysAllow is true, add the * the public key to list of host keys that the user has approved. */ diff --git a/core/java/android/hardware/usb/UsbManager.java b/core/java/android/hardware/usb/UsbManager.java index c88f213..3b3ee52 100644 --- a/core/java/android/hardware/usb/UsbManager.java +++ b/core/java/android/hardware/usb/UsbManager.java @@ -520,21 +520,6 @@ public class UsbManager { } /** - * Returns {@code true} iff access to sensitive USB data is currently allowed when - * in device mode. - * - * {@hide} - */ - public boolean isUsbDataUnlocked() { - try { - return mService.isUsbDataUnlocked(); - } catch (RemoteException e) { - Log.e(TAG, "RemoteException in isUsbDataUnlocked", e); - } - return false; - } - - /** * Returns a list of physical USB ports on the device. * <p> * This list is guaranteed to contain all dual-role USB Type C ports but it might |