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
This commit is contained in:
Tim Kilbourn
2015-09-18 14:57:28 -07:00
parent 680553957e
commit 823e805c1c

View File

@@ -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);
}