summaryrefslogtreecommitdiff
path: root/services/usb/java
diff options
context:
space:
mode:
author Badhri Jagan Sridharan <Badhri@google.com> 2017-08-18 17:26:05 -0700
committer Badhri Jagan Sridharan <Badhri@google.com> 2017-08-18 17:26:05 -0700
commit83a0d6fa577fab4d45aba38e3eb52b08b8123c17 (patch)
tree6e4c0e922192f9c54e8e2b4748a6311873b6213b /services/usb/java
parenteb5600a2a034dc9f42895602d44545bef32a041d (diff)
Overcome disconnect during oem override
While bootup, usb gets configured when the property triggers are run. While in oemOverride, the current configuration is persisted in sys.usb.<bootmode>.config. Do not reconfigure the stack if the current configuration is same as the new configuration. Bug: 64225494 Change-Id: Id35d110bf3fa8f58d05e14941716d4ad2b196f8d
Diffstat (limited to 'services/usb/java')
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 774bf438995c..3d0536327259 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -434,6 +434,8 @@ public class UsbDeviceManager {
try {
// Restore default functions.
+ mCurrentOemFunctions = SystemProperties.get(UsbDeviceManager.getPersistProp(false),
+ UsbManager.USB_FUNCTION_NONE);
if (isNormalBoot()) {
mCurrentFunctions = SystemProperties.get(USB_CONFIG_PROPERTY,
UsbManager.USB_FUNCTION_NONE);
@@ -662,8 +664,7 @@ public class UsbDeviceManager {
}
if ((!functions.equals(oemFunctions) &&
- (mCurrentOemFunctions == null ||
- !mCurrentOemFunctions.equals(oemFunctions)))
+ !mCurrentOemFunctions.equals(oemFunctions))
|| !mCurrentFunctions.equals(functions)
|| !mCurrentFunctionsApplied
|| forceRestart) {