Merge "Fix usb menu not switch to "File Transfer/Android Auto" right after connected to car unit"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bea5bfe1ce
@@ -153,6 +153,19 @@ public class UsbDetailsFunctionsControllerTest {
|
||||
assertThat(prefs.get(0).isChecked()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void displayRefresh_accessoryEnabled_shouldCheckSwitches() {
|
||||
when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true);
|
||||
|
||||
mDetailsFunctionsController.refresh(true, UsbManager.FUNCTION_ACCESSORY, POWER_ROLE_SINK,
|
||||
DATA_ROLE_DEVICE);
|
||||
List<RadioButtonPreference> prefs = getRadioPreferences();
|
||||
|
||||
assertThat(prefs.get(0).getKey())
|
||||
.isEqualTo(UsbBackend.usbFunctionsToString(UsbManager.FUNCTION_MTP));
|
||||
assertThat(prefs.get(0).isChecked()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onClickMtp_noneEnabled_shouldEnableMtp() {
|
||||
when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true);
|
||||
|
Reference in New Issue
Block a user