Fix can't select the [USB Tethering] item in [Developer Options]

- This CL is using 'USB_CONFIGURED' to check whether the USB enumeration
  is completed from the intent. If 'USB_CONFIGURED' is true then update
  the UI.

Bug: 229200265
Test: make -j65 RunSettingsRoboTests
Change-Id: Icab05e37ae3fcc9f1bf404a610fc97c368c453f5
This commit is contained in:
Hugh Chen
2022-04-29 08:40:21 +00:00
parent aadc44ae26
commit ec0c171735
7 changed files with 92 additions and 37 deletions

View File

@@ -55,7 +55,7 @@ public class ConnectedUsbDeviceUpdater {
@VisibleForTesting
UsbConnectionBroadcastReceiver.UsbConnectionListener mUsbConnectionListener =
(connected, functions, powerRole, dataRole) -> {
(connected, functions, powerRole, dataRole, isUsbConfigured) -> {
if (connected) {
mUsbPreference.setSummary(getSummary(dataRole == DATA_ROLE_DEVICE
? functions : UsbManager.FUNCTION_NONE, powerRole));