diff options
author | Mike Lockwood <lockwood@google.com> | 2014-03-20 11:14:08 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2014-03-20 12:36:51 -0700 |
commit | d8be49089fbbce0485625bbac906488dac35266d (patch) | |
tree | f4adfbace6a0291b45ea3c512517c986e5957361 | |
parent | 205a3ea0e2c49bc4d0ed534469f3a6920c14c4fe (diff) | |
download | base-d8be49089fbbce0485625bbac906488dac35266d.tar.gz |
UsbDeviceManager: A better fix for race condition when starting USB accessory mode
On some devices, the USB "set configuration" command is propogated to the framework
after the "start accessory" event is received. However, on other devices like
the 2011 ADK board, no "set configuration" command is sent at all until we have
reenumerated in acccessory mode. To fix the original problem without breaking other
devices, we can simply remove assumptions about if or when "set configuration"
will be received. Now we simply remain switch USB configuration to accessory mode
when we receive the "start accessory" command, and remain there until the existing
10 second timeout expires.
Bug: 13393825
Change-Id: I4c9e3423185bd7252a907e4568d9e3ff06044b7d
-rw-r--r-- | services/java/com/android/server/usb/UsbDeviceManager.java | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/services/java/com/android/server/usb/UsbDeviceManager.java b/services/java/com/android/server/usb/UsbDeviceManager.java index 8a5e2914f562..bb61e491c0d3 100644 --- a/services/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/java/com/android/server/usb/UsbDeviceManager.java @@ -538,7 +538,6 @@ public class UsbDeviceManager { if (mConfigured && enteringAccessoryMode) { // successfully entered accessory mode - mAccessoryModeRequestTime = 0; if (mAccessoryStrings != null) { mCurrentAccessory = new UsbAccessory(mAccessoryStrings); |