diff options
| author | 2018-11-26 15:31:47 +0800 | |
|---|---|---|
| committer | 2019-01-07 11:41:20 +0800 | |
| commit | d215b8218dcdba814f1d19c78526177a2b74e75c (patch) | |
| tree | f916b87429b17c3af94c7507fa5ab9db3f7b31d0 | |
| parent | 7ec9e6849e78b5c8a28e9523f2a77e607569c9a6 (diff) | |
Make sure mCurrentUsbFunctionsRequested flag be updated currectly
There is a situation that getCurrentUsbFunctions callback function will
be invoked before mCurrentUsbFunctionsRequested flag updated, thus, gadget
will be reset during boot completed. Make sure mCurrentUsbFunctionsRequested
flag be updated before getCurrentUsbFunctions callback function invoked.
Bug: 119688133
Test: Verified that gadget reset does not happen
Change-Id: Id8b58d9ccd3f62c976d1292575a06554bef622a4
Merged-In: Id8b58d9ccd3f62c976d1292575a06554bef622a4
Signed-off-by: Howard Yen <howardyen@google.com>
| -rw-r--r-- | services/usb/java/com/android/server/usb/UsbDeviceManager.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index aa93c6b9cb89..7ea61e30dafe 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -1760,8 +1760,8 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver mGadgetProxy.linkToDeath(new UsbGadgetDeathRecipient(), USB_GADGET_HAL_DEATH_COOKIE); mCurrentFunctions = UsbManager.FUNCTION_NONE; - mGadgetProxy.getCurrentUsbFunctions(new UsbGadgetCallback()); mCurrentUsbFunctionsRequested = true; + mGadgetProxy.getCurrentUsbFunctions(new UsbGadgetCallback()); } String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim(); updateState(state); |