Bug 1086712 - Don't drop adb connection unnecessarily at startup. r=jld

This commit is contained in:
Dave Hylands 2014-11-07 18:49:21 -08:00
parent 4835c60371
commit 6b8d165451

View File

@ -573,7 +573,18 @@ SetUsbFunction(const char* aUsbFunc)
}
}
LOG("SetUsbFunction(%s) %s to '%s'", aUsbFunc, SYS_USB_CONFIG, newSysUsbConfig);
// If the persisted function didn't have mass_storage (this happens on
// the nexus 4/5, then we can get to here and have oldSysUsbConfig equal
// to newSysUsbConfig. So we need to check for that.
if (strcmp(oldSysUsbConfig, newSysUsbConfig) == 0) {
DBG("SetUsbFunction('%s') %s is already set to '%s' - nothing to do",
aUsbFunc, SYS_USB_CONFIG, newSysUsbConfig);
return;
}
LOG("SetUsbFunction(%s) %s from '%s' to '%s'", aUsbFunc, SYS_USB_CONFIG,
oldSysUsbConfig, newSysUsbConfig);
property_set(SYS_USB_CONFIG, newSysUsbConfig);
}