Merge "Revert "Stop usb tethering when user cancel it"" into rvc-dev am: 74755ac915 am: d3d9b3d462 am: 270646dbe1 am: b29970c5f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11708185 Change-Id: I7b4f907acd4b747bbfe44079135edb9dcf9dea94
This commit is contained in:
@@ -270,42 +270,4 @@ public class UsbDetailsFunctionsControllerTest {
|
||||
|
||||
verify(mUsbBackend).setCurrentFunctions(UsbManager.FUNCTION_PTP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_previousFunctionIsRndis_stopTethering() {
|
||||
mDetailsFunctionsController.mPreviousFunction = UsbManager.FUNCTION_RNDIS;
|
||||
|
||||
mDetailsFunctionsController.refresh(false, 0, 0, 0);
|
||||
|
||||
verify(mConnectivityManager).stopTethering(TETHERING_USB);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_previousFunctionIsNotRndis_doNothing() {
|
||||
mDetailsFunctionsController.mPreviousFunction = UsbManager.FUNCTION_MIDI;
|
||||
|
||||
mDetailsFunctionsController.refresh(false, 0, 0, 0);
|
||||
|
||||
verify(mConnectivityManager, never()).stopTethering(TETHERING_USB);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onRadioButtonClicked_previousFunctionIsRndis_stopTethering() {
|
||||
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_PTP));
|
||||
doReturn(UsbManager.FUNCTION_RNDIS).when(mUsbBackend).getCurrentFunctions();
|
||||
|
||||
mDetailsFunctionsController.onRadioButtonClicked(mRadioButtonPreference);
|
||||
|
||||
verify(mConnectivityManager).stopTethering(TETHERING_USB);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onRadioButtonClicked_previousFunctionIsNotRndis_doNothing() {
|
||||
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_PTP));
|
||||
doReturn(UsbManager.FUNCTION_MIDI).when(mUsbBackend).getCurrentFunctions();
|
||||
|
||||
mDetailsFunctionsController.onRadioButtonClicked(mRadioButtonPreference);
|
||||
|
||||
verify(mConnectivityManager, never()).stopTethering(TETHERING_USB);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user