Home
last modified time | relevance | path

Searched refs:mUsbBackend (Results 1 – 18 of 18) sorted by relevance

/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/usb/
DUsbDefaultFragmentTest.java53 private UsbBackend mUsbBackend; field in UsbDefaultFragmentTest
65 mFragment.mUsbBackend = mUsbBackend; in setUp()
72 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_NONE); in getDefaultKey_isNone_shouldReturnNone()
79 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MTP); in getDefaultKey_isMtp_shouldReturnMtp()
86 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_PTP); in getDefaultKey_isPtp_shouldReturnPtp()
93 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_RNDIS); in getDefaultKey_isRndis_shouldReturnRndis()
100 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MIDI); in getDefaultKey_isMidi_shouldReturnMidi()
107 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_NCM); in getDefaultKey_isNcm_returnsRndis()
116 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_NONE); in setDefaultKey_isNone_shouldSetNone()
122 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_MTP); in setDefaultKey_isMtp_shouldSetMtp()
[all …]
DUsbDetailsFunctionsControllerTest.java80 private UsbBackend mUsbBackend; field in UsbDetailsFunctionsControllerTest
103 mUsbBackend); in setUp()
114 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_allAllowed_shouldCreatePrefs()
129 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_disconnected_shouldDisable()
138 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MIDI)).thenReturn(true); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref()
139 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref()
140 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_PTP)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref()
141 when(mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_RNDIS)).thenReturn(false); in displayRefresh_onlyMidiAllowed_shouldCreateOnlyMidiPref()
153 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_mtpEnabled_shouldCheckSwitches()
166 when(mUsbBackend.areFunctionsSupported(anyLong())).thenReturn(true); in displayRefresh_accessoryEnabled_shouldCheckSwitches()
[all …]
DUsbDetailsPowerRoleControllerTest.java72 private UsbBackend mUsbBackend; field in UsbDetailsPowerRoleControllerTest
96 mUsbBackend); in setUp()
108 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_sink_shouldUncheck()
121 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_source_shouldCheck()
133 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_disconnected_shouldDisable()
146 when(mUsbBackend.areAllRolesSupported()).thenReturn(false); in displayRefresh_notSupported_shouldRemove()
159 when(mUsbBackend.getPowerRole()).thenReturn(POWER_ROLE_SINK); in onClick_sink_shouldSetSource()
164 verify(mUsbBackend).setPowerRole(POWER_ROLE_SOURCE); in onClick_sink_shouldSetSource()
173 when(mUsbBackend.getPowerRole()).thenReturn(POWER_ROLE_SINK); in onClickTwice_sink_shouldSetSourceOnce()
181 verify(mUsbBackend, times(1)).setPowerRole(POWER_ROLE_SOURCE); in onClickTwice_sink_shouldSetSourceOnce()
[all …]
DUsbDetailsDataRoleControllerTest.java74 private UsbBackend mUsbBackend; field in UsbDetailsDataRoleControllerTest
96 mUsbBackend); in setUp()
138 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDevice_hostEnabled_shouldSetDevice()
143 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDevice_hostEnabled_shouldSetDevice()
150 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDeviceTwice_hostEnabled_shouldSetDeviceOnce()
158 verify(mUsbBackend).setDataRole(DATA_ROLE_DEVICE); in onClickDeviceTwice_hostEnabled_shouldSetDeviceOnce()
163 when(mUsbBackend.getDataRole()).thenReturn(DATA_ROLE_HOST); in onClickDeviceAndRefresh_success_shouldClearSubtext()
168 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 …]
DUsbDetailsTranscodeMtpControllerTest.java68 private UsbBackend mUsbBackend; field in UsbDetailsTranscodeMtpControllerTest
87 mUnderTest = new UsbDetailsTranscodeMtpController(mContext, mFragment, mUsbBackend); in setUp()
98 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noUsbConnection_shouldDisablePrefCategory()
108 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noDataTransfer_shouldDisablePrefCategory()
118 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_noDataRole_shouldDisablePrefCategory()
129 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withAbsentProp_shouldCheck()
141 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withUnsetProp_shouldUncheck()
153 when(mUsbBackend.areAllRolesSupported()).thenReturn(true); in displayRefresh_fileTransfer_withSetProp_shouldCheck()
DUsbDetailsControllerTest.java56 private UsbBackend mUsbBackend; field in UsbDetailsControllerTest
68 mContext, mUsbDetailsFragment, mUsbBackend) { in setUp()
89 Runnable action = () -> mUsbBackend.setDataRole(UsbPortStatus.DATA_ROLE_HOST); in requireAuthAndExecute_whenAlreadyAuthenticated_executes()
93 verify(mUsbBackend).setDataRole(anyInt()); in requireAuthAndExecute_whenAlreadyAuthenticated_executes()
101 Runnable action = () -> mUsbBackend.setDataRole(UsbPortStatus.DATA_ROLE_HOST); in requireAuthAndExecute_authenticatesAndExecutes()
106 verify(mUsbBackend).setDataRole(anyInt()); in requireAuthAndExecute_authenticatesAndExecutes()
DConnectedUsbDeviceUpdaterTest.java63 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdaterTest
76 mUsbBackend); in setUp()
DUsbDetailsHeaderControllerTest.java70 private UsbBackend mUsbBackend; field in UsbDetailsHeaderControllerTest
95 mDetailsHeaderController = new UsbDetailsHeaderController(mContext, mFragment, mUsbBackend); in setUp()
DUsbConnectionBroadcastReceiverTest.java53 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiverTest
60 mReceiver = new UsbConnectionBroadcastReceiver(mContext, mListener, mUsbBackend); in setUp()
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbDefaultFragment.java55 UsbBackend mUsbBackend; field in UsbDefaultFragment
75 final long defaultFunctions = mUsbBackend.getDefaultUsbFunctions();
99 mUsbBackend = new UsbBackend(context); in onAttach()
102 mUsbBackend); in onAttach()
105 mCurrentFunctions = mUsbBackend.getDefaultUsbFunctions(); in onAttach()
134 if (mUsbBackend.areFunctionsSupported(option)) { in getCandidates()
158 long defaultUsbFunctions = mUsbBackend.getDefaultUsbFunctions(); in getDefaultKey()
168 mPreviousFunctions = mUsbBackend.getCurrentFunctions(); in setDefaultKey()
178 mUsbBackend.setDefaultUsbFunctions(functions); in setDefaultKey()
195 mCurrentFunctions = mUsbBackend.getCurrentFunctions(); in onPause()
[all …]
DUsbDetailsPowerRoleController.java74 if (connected && !mUsbBackend.areAllRolesSupported()) { in refresh()
76 } else if (connected && mUsbBackend.areAllRolesSupported()) { in refresh()
110 if (mUsbBackend.getPowerRole() != newRole && mNextPowerRole == POWER_ROLE_NONE in onPreferenceClick()
112 mUsbBackend.setPowerRole(newRole); in onPreferenceClick()
118 mUsbBackend.areAllRolesSupported() ? UsbBackend.PD_ROLE_SWAP_TIMEOUT_MS in onPreferenceClick()
DUsbDetailsFunctionsController.java72 mPreviousFunction = mUsbBackend.getCurrentFunctions(); in UsbDetailsFunctionsController()
80 refresh(/* connected */ false, /* functions */ mUsbBackend.getDefaultUsbFunctions(), in displayPreference()
117 if (mUsbBackend.areFunctionsSupported(option)) { in refresh()
135 final long previousFunction = mUsbBackend.getCurrentFunctions(); in onRadioButtonClicked()
162 mUsbBackend.setCurrentFunctions(function); in onRadioButtonClicked()
192 mUsbBackend.setCurrentFunctions(mPreviousFunction); in onTetheringFailed()
DUsbDetailsTranscodeMtpController.java67 if (mUsbBackend.areFunctionsSupported(UsbManager.FUNCTION_MTP | UsbManager.FUNCTION_PTP)) { in refresh()
85 final long previousFunctions = mUsbBackend.getCurrentFunctions(); in onPreferenceClick()
87 mUsbBackend.setCurrentFunctions(previousFunctions & ~UsbManager.FUNCTION_MTP); in onPreferenceClick()
88 mUsbBackend.setCurrentFunctions(previousFunctions); in onPreferenceClick()
DUsbDetailsFragment.java47 private UsbBackend mUsbBackend; field in UsbDetailsFragment
97 mUsbBackend = new UsbBackend(context); in createPreferenceControllers()
98 mControllers = createControllerList(context, mUsbBackend, this); in createPreferenceControllers()
100 mUsbBackend); in createPreferenceControllers()
DUsbConnectionBroadcastReceiver.java41 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiver
52 mUsbBackend = backend; in UsbConnectionBroadcastReceiver()
94 mDataRole = mUsbBackend.getDataRole(); in onReceive()
95 mPowerRole = mUsbBackend.getPowerRole(); in onReceive()
DUsbDetailsDataRoleController.java103 if (role != mUsbBackend.getDataRole() && mNextRolePref == null in onRadioButtonClicked()
105 mUsbBackend.setDataRole(role); in onRadioButtonClicked()
110 mUsbBackend.areAllRolesSupported() ? UsbBackend.PD_ROLE_SWAP_TIMEOUT_MS in onRadioButtonClicked()
DConnectedUsbDeviceUpdater.java49 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdater
78 mUsbBackend = usbBackend; in ConnectedUsbDeviceUpdater()
80 mUsbConnectionListener, mUsbBackend); in ConnectedUsbDeviceUpdater()
DUsbDetailsController.java38 protected final UsbBackend mUsbBackend; field in UsbDetailsController
47 mUsbBackend = backend; in UsbDetailsController()