Add condition to check case of accessory combinations am: b767df1a08
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13218259 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I4a4502e3568d0049c4fff7f730b42d1bc975cea4
This commit is contained in:
@@ -275,6 +275,18 @@ public class UsbDetailsFunctionsControllerTest {
|
||||
UsbManager.FUNCTION_ACCESSORY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onRadioButtonClicked_functionMtp_inAccessoryCombinationsMode_doNothing() {
|
||||
final long function = UsbManager.FUNCTION_ACCESSORY | UsbManager.FUNCTION_AUDIO_SOURCE;
|
||||
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_MTP));
|
||||
doReturn(UsbManager.FUNCTION_ACCESSORY).when(mUsbBackend).getCurrentFunctions();
|
||||
|
||||
mDetailsFunctionsController.mPreviousFunction = function;
|
||||
mDetailsFunctionsController.onRadioButtonClicked(mRadioButtonPreference);
|
||||
|
||||
assertThat(mDetailsFunctionsController.mPreviousFunction).isEqualTo(function);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onRadioButtonClicked_clickSameButton_doNothing() {
|
||||
mRadioButtonPreference.setKey(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_PTP));
|
||||
|
Reference in New Issue
Block a user