Merge "Add condition to check case of accessory combinations"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ccdf18ccee
@@ -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