Fix USB tethering is not turned on with a single tap

Before this CL, the USB default settings will set default usb functions
to RNDIS when tethering is started. Because in some devices, the NCM
is used instead of RNDIS to start tethering. If RNDIS is set in the
device that uses NCM to start tethering, it will cause start
tethering failed.

This CL will use the current functions to set default usb functions
to fix this issue.

Bug: 195068679
Bug: 197026638
Test: make -j42 RunSettingsRoboTests
Change-Id: Ic9353c5ac76c0cd517318a4304fa214d6b2201d2
(cherry picked from commit ba30b04cc3)
This commit is contained in:
Hugh Chen
2021-08-03 17:32:25 +08:00
parent 1f6f807834
commit ffeefd4d11
2 changed files with 4 additions and 3 deletions

View File

@@ -198,8 +198,9 @@ public class UsbDefaultFragment extends RadioButtonPickerFragment {
@Override
public void onTetheringStarted() {
Log.d(TAG, "onTetheringStarted()");
// Set default usb functions again to make internal data persistent
mCurrentFunctions = mUsbBackend.getCurrentFunctions();
Log.d(TAG, "onTetheringStarted() : mCurrentFunctions " + mCurrentFunctions);
mUsbBackend.setDefaultUsbFunctions(mCurrentFunctions);
}