summaryrefslogtreecommitdiffstats
path: root/services/usb
diff options
context:
space:
mode:
authorTim Kilbourn <tkilbourn@google.com>2015-09-18 14:57:28 -0700
committerTim Kilbourn <tkilbourn@google.com>2015-09-18 15:05:57 -0700
commit823e805c1c72b34bed8439e269f96b2f3a5cbe4e (patch)
treef006581cf3c15fadb018092cbd5db342807fd5de /services/usb
parent680553957e4ff47343334881c34de6969b2ed977 (diff)
downloadframeworks_base-823e805c1c72b34bed8439e269f96b2f3a5cbe4e.zip
frameworks_base-823e805c1c72b34bed8439e269f96b2f3a5cbe4e.tar.gz
frameworks_base-823e805c1c72b34bed8439e269f96b2f3a5cbe4e.tar.bz2
Always set the usb config when modifying it.
On some devices, setting system properties takes too long and we end up with races where adbd gets killed and never comes back. With this change we avoid a small optimization that checks the previous value of the config, instead opting to set it every time. Bug: 23631400 Change-Id: I7567cc2efb3d5d15c45334bd66b28877a2af0ac3
Diffstat (limited to 'services/usb')
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index fb9a3a3..769ee46 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -416,10 +416,9 @@ public class UsbDeviceManager {
private boolean setUsbConfig(String config) {
if (DEBUG) Slog.d(TAG, "setUsbConfig(" + config + ")");
// set the new configuration
- String oldConfig = SystemProperties.get(USB_CONFIG_PROPERTY);
- if (!config.equals(oldConfig)) {
- SystemProperties.set(USB_CONFIG_PROPERTY, config);
- }
+ // we always set it due to b/23631400, where adbd was getting killed
+ // and not restarted due to property timeouts on some devices
+ SystemProperties.set(USB_CONFIG_PROPERTY, config);
return waitForState(config);
}