diff options
author | Tom Marshall <tdm@cyngn.com> | 2016-06-09 14:57:22 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-10 12:45:14 -0700 |
commit | d0c49f47b42e77b85752ff5e8ebd40e2b6455e6e (patch) | |
tree | 805fc17e62c66a01cae57890df35def7eb4c293c /services/usb | |
parent | eb7ff1a410cbd8851139fd5ea5088ab03a759157 (diff) | |
download | frameworks_base-d0c49f47b42e77b85752ff5e8ebd40e2b6455e6e.zip frameworks_base-d0c49f47b42e77b85752ff5e8ebd40e2b6455e6e.tar.gz frameworks_base-d0c49f47b42e77b85752ff5e8ebd40e2b6455e6e.tar.bz2 |
UsbDeviceManager: Remove charging from persisted function composition
CM 12.1 supported the function composition "charging" to indicate no
function compositions, only charging. CM 13.0 does not support this.
Instead, mtp is used (see commits to fix b/21429947 for an explanation
why this is done).
When a user upgrades from 12.1 to 13.0 and the persisted function
composition is "charging", modifications to the function composition,
such as to add adb or mtp, will timeout and fail. This introduces a
three second latency on the change. Removing the charging function
when reading the persisted function composition avoids the delay.
Jira: BACON-4912, OPO-765
Change-Id: Ibbf4f7ce12f97aa046fa214383580ef4d191ce25
Diffstat (limited to 'services/usb')
-rw-r--r-- | services/usb/java/com/android/server/usb/UsbDeviceManager.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index 73a2ee6..2886ce6 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -901,6 +901,7 @@ public class UsbDeviceManager { private String getDefaultFunctions() { String func = SystemProperties.get(USB_PERSISTENT_CONFIG_PROPERTY, UsbManager.USB_FUNCTION_NONE); + func = UsbManager.removeFunction(func, "charging"); if (UsbManager.USB_FUNCTION_NONE.equals(func)) { func = UsbManager.USB_FUNCTION_MTP; } |