From b7172959142e1af5515ed24d4d2da1a9437f49ae Mon Sep 17 00:00:00 2001 From: hughchen Date: Wed, 9 Oct 2019 16:17:26 +0800 Subject: [PATCH] Fix talkback will not speak correct status Update the UI in advance when user select any option. In this CL before, the UI update in advance only when user select "USB tethering". Bug: 141161849 Test: make -j42 RunSettingsRoboTests Change-Id: I1fa4b20408a00b06d7c8fac6136c63df7406154d --- .../usb/UsbDetailsFunctionsController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java index 9c9400db5b6..31bca1241ec 100644 --- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java +++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java @@ -114,16 +114,16 @@ public class UsbDetailsFunctionsController extends UsbDetailsController if (function != previousFunction && !Utils.isMonkeyRunning()) { mPreviousFunction = previousFunction; - if (function == UsbManager.FUNCTION_RNDIS) { - //Update the UI in advance to make it looks smooth - final RadioButtonPreference prevPref = - (RadioButtonPreference) mProfilesContainer.findPreference( - UsbBackend.usbFunctionsToString(mPreviousFunction)); - if (prevPref != null) { - prevPref.setChecked(false); - preference.setChecked(true); - } + //Update the UI in advance to make it looks smooth + final RadioButtonPreference prevPref = + (RadioButtonPreference) mProfilesContainer.findPreference( + UsbBackend.usbFunctionsToString(mPreviousFunction)); + if (prevPref != null) { + prevPref.setChecked(false); + preference.setChecked(true); + } + if (function == UsbManager.FUNCTION_RNDIS) { // We need to have entitlement check for usb tethering, so use API in // ConnectivityManager. mConnectivityManager.startTethering(TETHERING_USB, true /* showProvisioningUi */,