From d0c49f47b42e77b85752ff5e8ebd40e2b6455e6e Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Thu, 9 Jun 2016 14:57:22 -0700 Subject: 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 --- services/usb/java/com/android/server/usb/UsbDeviceManager.java | 1 + 1 file changed, 1 insertion(+) (limited to 'services/usb') 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; } -- cgit v1.1