Do nothing when choosing file transfer when in accessory mode am: e8dc7bc283

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13218257

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3bd051363458a75a0dd190f41b0cf2901e3bf680
This commit is contained in:
Hugh Chen
2020-12-15 05:01:34 +00:00
committed by Automerger Merge Worker
2 changed files with 19 additions and 1 deletions

View File

@@ -263,6 +263,18 @@ public class UsbDetailsFunctionsControllerTest {
UsbManager.FUNCTION_MTP);
}
@Test
public void onRadioButtonClicked_functionMtp_inAccessoryMode_doNothing() {
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_MTP));
doReturn(UsbManager.FUNCTION_ACCESSORY).when(mUsbBackend).getCurrentFunctions();
mDetailsFunctionsController.mPreviousFunction = UsbManager.FUNCTION_ACCESSORY;
mDetailsFunctionsController.onRadioButtonClicked(mRadioButtonPreference);
assertThat(mDetailsFunctionsController.mPreviousFunction).isEqualTo(
UsbManager.FUNCTION_ACCESSORY);
}
@Test
public void onRadioButtonClicked_clickSameButton_doNothing() {
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_PTP));