summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWesley Cheng <quic_wcheng@quicinc.com>2021-11-22 00:54:14 -0800
committerWesley Cheng <quic_wcheng@quicinc.com>2021-12-16 12:37:01 -0800
commit1f9425d5e876ac203ea2bd55654ae340631f18b1 (patch)
tree533cd1a9cd930d29c939982c43250de0795e4324
parent88daf9ce34ae13a85aa6d41d42d7f6d5f7d07c1a (diff)
Avoid removing USB state changes during CONFIGURED uevent
In order to avoid missing the CONNECTED uevent, skip removing previous events if moving into the CONFIGURED state. The Tethering class relies on the CONNECTED state change to tear down the USB RNDIS adapter. If this is skipped, the Tethering class will see no change to the USB state, and avoid restarting of the dependent tethering services. Bug: 207317644 CRs-Fixed:3066722 Test: USB RNDIS IP assigned to PC Change-Id: Iab800ee6b995f1ed8bb1f98934245dd010f4e560
-rwxr-xr-xservices/usb/java/com/android/server/usb/UsbDeviceManager.java2
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 0c1cf600ef23..97b95050f51c 100755
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -636,7 +636,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
Slog.e(TAG, "unknown state " + state);
return;
}
- removeMessages(MSG_UPDATE_STATE);
+ if (configured == 0) removeMessages(MSG_UPDATE_STATE);
if (connected == 1) removeMessages(MSG_FUNCTION_SWITCH_TIMEOUT);
Message msg = Message.obtain(this, MSG_UPDATE_STATE);
msg.arg1 = connected;