/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/usb/ |
D | UsbDefaultFragmentTest.java | 54 private UsbBackend mUsbBackend; field in UsbDefaultFragmentTest 66 mFragment.mUsbBackend = mUsbBackend; in setUp() 73 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_NONE); in getDefaultKey_isNone_shouldReturnNone() 80 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MTP); in getDefaultKey_isMtp_shouldReturnMtp() 87 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_PTP); in getDefaultKey_isPtp_shouldReturnPtp() 94 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_RNDIS); in getDefaultKey_isRndis_shouldReturnRndis() 101 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MIDI); in getDefaultKey_isMidi_shouldReturnMidi() 108 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_NCM); in getDefaultKey_isNcm_returnsRndis() 117 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_NONE); in setDefaultKey_isNone_shouldSetNone() 123 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_MTP); in setDefaultKey_isMtp_shouldSetMtp() [all …]
|
D | UsbDetailsFunctionsControllerTest.java | 71 private UsbBackend mUsbBackend; field in UsbDetailsFunctionsControllerTest 96 mUsbBackend); in setUp() 107 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_allAllowed_shouldCreatePrefs() 122 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_disconnected_shouldDisable() 131 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MIDI)).thenReturn(true); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref() 132 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref() 133 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_PTP)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref() 134 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_RNDIS)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref() 146 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_mtpEnabled_shouldCheckSwitches() 159 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_accessoryEnabled_shouldCheckSwitches() [all …]
|
D | UsbDetailsPowerRoleControllerTest.java | 67 private UsbBackend mUsbBackend; field in UsbDetailsPowerRoleControllerTest 91 mUsbBackend); in setUp() 102 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_sink_shouldUncheck() 114 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_source_shouldCheck() 126 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_disconnected_shouldDisable() 139 when(mUsbBackend.areAllRolesSupported()).thenReturn(false); in displayRefresh_notSupported_shouldRemove() 151 when(mUsbBackend.getPowerRole()).thenReturn(POWER_ROLE_SINK); in onClick_sink_shouldSetSource() 156 verify(mUsbBackend).setPowerRole(POWER_ROLE_SOURCE); in onClick_sink_shouldSetSource() 164 when(mUsbBackend.getPowerRole()).thenReturn(POWER_ROLE_SINK); in onClickTwice_sink_shouldSetSourceOnce() 172 verify(mUsbBackend, times(1)).setPowerRole(POWER_ROLE_SOURCE); in onClickTwice_sink_shouldSetSourceOnce() [all …]
|
D | UsbDetailsDataRoleControllerTest.java | 64 private UsbBackend mUsbBackend; field in UsbDetailsDataRoleControllerTest 88 mUsbBackend); in setUp() 135 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDevice_hostEnabled_shouldSetDevice() 140 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDevice_hostEnabled_shouldSetDevice() 148 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDeviceTwice_hostEnabled_shouldSetDeviceOnce() 156 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDeviceTwice_hostEnabled_shouldSetDeviceOnce() 162 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDeviceAndRefresh_success_shouldClearSubtext() 167 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDeviceAndRefresh_success_shouldClearSubtext() 180 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDeviceAndRefresh_failed_shouldShowFailureText() 185 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDeviceAndRefresh_failed_shouldShowFailureText() [all …]
|
D | UsbDetailsTranscodeMtpControllerTest.java | 58 private UsbBackend mUsbBackend; field in UsbDetailsTranscodeMtpControllerTest 78 mUnderTest = new UsbDetailsTranscodeMtpController(mContext, mFragment, mUsbBackend); in setUp() 88 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noUsbConnection_shouldDisablePrefCategory() 99 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noDataTransfer_shouldDisablePrefCategory() 110 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noDataRole_shouldDisablePrefCategory() 121 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withAbsentProp_shouldCheck() 133 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withUnsetProp_shouldUncheck() 145 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withSetProp_shouldCheck()
|
D | ConnectedUsbDeviceUpdaterTest.java | 63 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdaterTest 76 mUsbBackend); in setUp()
|
D | UsbDetailsHeaderControllerTest.java | 68 private UsbBackend mUsbBackend; field in UsbDetailsHeaderControllerTest 93 mDetailsHeaderController = new UsbDetailsHeaderController(mContext, mFragment, mUsbBackend); in setUp()
|
D | UsbConnectionBroadcastReceiverTest.java | 53 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiverTest 60 mReceiver = new UsbConnectionBroadcastReceiver(mContext, mListener, mUsbBackend); in setUp()
|
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/ |
D | UsbDefaultFragment.java | 53 UsbBackend mUsbBackend; field in UsbDefaultFragment 73 final long defaultFunctions = mUsbBackend.getDefaultUsbFunctions(); 87 mUsbBackend.setDefaultUsbFunctions(functions); 96 mUsbBackend = new UsbBackend(context); in onAttach() 99 mUsbBackend); in onAttach() 102 mCurrentFunctions = mUsbBackend.getDefaultUsbFunctions(); in onAttach() 131 if (mUsbBackend.areFunctionsSupported(option)) { in getCandidates() 155 long defaultUsbFunctions = mUsbBackend.getDefaultUsbFunctions(); in getDefaultKey() 165 mPreviousFunctions = mUsbBackend.getCurrentFunctions(); in setDefaultKey() 175 mUsbBackend.setDefaultUsbFunctions(functions); in setDefaultKey() [all …]
|
D | UsbDetailsFunctionsController.java | 71 mPreviousFunction = mUsbBackend.getCurrentFunctions(); in UsbDetailsFunctionsController() 79 refresh(/* connected */ false, /* functions */ mUsbBackend.getDefaultUsbFunctions(), in displayPreference() 116 if (mUsbBackend.areFunctionsSupported(option)) { in refresh() 133 final long previousFunction = mUsbBackend.getCurrentFunctions(); in onRadioButtonClicked() 160 mUsbBackend.setCurrentFunctions(function); in onRadioButtonClicked() 189 mUsbBackend.setCurrentFunctions(mPreviousFunction); in onTetheringFailed()
|
D | UsbDetailsPowerRoleController.java | 71 if (connected && !mUsbBackend.areAllRolesSupported()) { in refresh() 73 } else if (connected && mUsbBackend.areAllRolesSupported()) { in refresh() 107 if (mUsbBackend.getPowerRole() != newRole && mNextPowerRole == POWER_ROLE_NONE in onPreferenceClick() 109 mUsbBackend.setPowerRole(newRole); in onPreferenceClick() 115 mUsbBackend.areAllRolesSupported() ? UsbBackend.PD_ROLE_SWAP_TIMEOUT_MS in onPreferenceClick()
|
D | UsbDetailsFragment.java | 47 private UsbBackend mUsbBackend; field in UsbDetailsFragment 82 mUsbBackend = new UsbBackend(context); in createPreferenceControllers() 83 mControllers = createControllerList(context, mUsbBackend, this); in createPreferenceControllers() 85 mUsbBackend); in createPreferenceControllers()
|
D | UsbConnectionBroadcastReceiver.java | 37 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiver 48 mUsbBackend = backend; in UsbConnectionBroadcastReceiver() 82 mDataRole = mUsbBackend.getDataRole(); in onReceive() 83 mPowerRole = mUsbBackend.getPowerRole(); in onReceive()
|
D | UsbDetailsDataRoleController.java | 102 if (role != mUsbBackend.getDataRole() && mNextRolePref == null in onRadioButtonClicked() 104 mUsbBackend.setDataRole(role); in onRadioButtonClicked() 109 mUsbBackend.areAllRolesSupported() ? UsbBackend.PD_ROLE_SWAP_TIMEOUT_MS in onRadioButtonClicked()
|
D | ConnectedUsbDeviceUpdater.java | 49 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdater 78 mUsbBackend = usbBackend; in ConnectedUsbDeviceUpdater() 80 mUsbConnectionListener, mUsbBackend); in ConnectedUsbDeviceUpdater()
|
D | UsbDetailsController.java | 36 protected final UsbBackend mUsbBackend; field in UsbDetailsController 45 mUsbBackend = backend; in UsbDetailsController()
|
D | UsbDetailsTranscodeMtpController.java | 64 if (mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP | UsbManager.FUNCTION_PTP)) { in refresh()
|