Home
last modified time | relevance | path

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

/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/usb/
DUsbDetailsFunctionsControllerTest.java71 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 onClickMtp_noneEnabled_shouldEnableMtp()
[all …]
DUsbDefaultFragmentTest.java46 private UsbBackend mUsbBackend; field in UsbDefaultFragmentTest
56 mFragment.mUsbBackend = mUsbBackend; in setUp()
62 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_NONE); in getDefaultKey_isNone_shouldReturnNone()
69 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MTP); in getDefaultKey_isMtp_shouldReturnMtp()
76 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_PTP); in getDefaultKey_isPtp_shouldReturnPtp()
83 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_RNDIS); in getDefaultKey_isRndis_shouldReturnRndis()
90 when(mUsbBackend.getDefaultUsbFunctions()).thenReturn(UsbManager.FUNCTION_MIDI); in getDefaultKey_isMidi_shouldReturnMidi()
98 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_NONE); in setDefaultKey_isNone_shouldSetNone()
104 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_MTP); in setDefaultKey_isMtp_shouldSetMtp()
110 verify(mUsbBackend).setDefaultUsbFunctions(UsbManager.FUNCTION_PTP); in setDefaultKey_isPtp_shouldSetPtp()
[all …]
DUsbDetailsPowerRoleControllerTest.java67 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 …]
DUsbDetailsDataRoleControllerTest.java64 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 …]
DConnectedUsbDeviceUpdaterTest.java57 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdaterTest
67 mUsbBackend); in setUp()
DUsbConnectionBroadcastReceiverTest.java53 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiverTest
60 mReceiver = new UsbConnectionBroadcastReceiver(mContext, mListener, mUsbBackend); in setUp()
DUsbDetailsHeaderControllerTest.java68 private UsbBackend mUsbBackend; field in UsbDetailsHeaderControllerTest
93 mDetailsHeaderController = new UsbDetailsHeaderController(mContext, mFragment, mUsbBackend); in setUp()
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbDefaultFragment.java46 UsbBackend mUsbBackend; field in UsbDefaultFragment
57 mUsbBackend = new UsbBackend(context); in onAttach()
89 if (mUsbBackend.areFunctionsSupported(option)) { in getCandidates()
113 return UsbBackend.usbFunctionsToString(mUsbBackend.getDefaultUsbFunctions()); in getDefaultKey()
119 mPreviousFunctions = mUsbBackend.getCurrentFunctions(); in setDefaultKey()
127 mUsbBackend.setDefaultUsbFunctions(functions); in setDefaultKey()
142 mUsbBackend.setDefaultUsbFunctions(UsbManager.FUNCTION_RNDIS); in onTetheringStarted()
148 mUsbBackend.setDefaultUsbFunctions(mPreviousFunctions); in onTetheringFailed()
DUsbDetailsPowerRoleController.java71 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()
DUsbDetailsFunctionsController.java65 mPreviousFunction = mUsbBackend.getCurrentFunctions(); in UsbDetailsFunctionsController()
102 if (mUsbBackend.areFunctionsSupported(option)) { in refresh()
113 final long previousFunction = mUsbBackend.getCurrentFunctions(); in onRadioButtonClicked()
132 mUsbBackend.setCurrentFunctions(function); in onRadioButtonClicked()
154 mUsbBackend.setCurrentFunctions(mPreviousFunction); in onTetheringFailed()
DUsbDetailsFragment.java45 private UsbBackend mUsbBackend; field in UsbDetailsFragment
74 mUsbBackend = new UsbBackend(context); in createPreferenceControllers()
75 mControllers = createControllerList(context, mUsbBackend, this); in createPreferenceControllers()
77 mUsbBackend); in createPreferenceControllers()
DUsbConnectionBroadcastReceiver.java37 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiver
48 mUsbBackend = backend; in UsbConnectionBroadcastReceiver()
77 mDataRole = mUsbBackend.getDataRole(); in onReceive()
78 mPowerRole = mUsbBackend.getPowerRole(); in onReceive()
DUsbDetailsDataRoleController.java102 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()
DConnectedUsbDeviceUpdater.java38 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdater
67 mUsbBackend = usbBackend; in ConnectedUsbDeviceUpdater()
69 mUsbConnectionListener, mUsbBackend); in ConnectedUsbDeviceUpdater()
DUsbDetailsController.java36 protected final UsbBackend mUsbBackend; field in UsbDetailsController
45 mUsbBackend = backend; in UsbDetailsController()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/connecteddevice/usb/
DUsbDefaultFragment.java46 UsbBackend mUsbBackend; field in UsbDefaultFragment
57 mUsbBackend = new UsbBackend(context); in onAttach()
89 if (mUsbBackend.areFunctionsSupported(option)) { in getCandidates()
113 return UsbBackend.usbFunctionsToString(mUsbBackend.getDefaultUsbFunctions()); in getDefaultKey()
119 mPreviousFunctions = mUsbBackend.getCurrentFunctions(); in setDefaultKey()
127 mUsbBackend.setDefaultUsbFunctions(functions); in setDefaultKey()
142 mUsbBackend.setDefaultUsbFunctions(UsbManager.FUNCTION_RNDIS); in onTetheringStarted()
148 mUsbBackend.setDefaultUsbFunctions(mPreviousFunctions); in onTetheringFailed()
DUsbDetailsPowerRoleController.java71 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()
DUsbDetailsFunctionsController.java65 mPreviousFunction = mUsbBackend.getCurrentFunctions(); in UsbDetailsFunctionsController()
102 if (mUsbBackend.areFunctionsSupported(option)) { in refresh()
113 final long previousFunction = mUsbBackend.getCurrentFunctions(); in onRadioButtonClicked()
132 mUsbBackend.setCurrentFunctions(function); in onRadioButtonClicked()
154 mUsbBackend.setCurrentFunctions(mPreviousFunction); in onTetheringFailed()
DUsbDetailsFragment.java45 private UsbBackend mUsbBackend; field in UsbDetailsFragment
74 mUsbBackend = new UsbBackend(context); in createPreferenceControllers()
75 mControllers = createControllerList(context, mUsbBackend, this); in createPreferenceControllers()
77 mUsbBackend); in createPreferenceControllers()
DUsbConnectionBroadcastReceiver.java37 private UsbBackend mUsbBackend; field in UsbConnectionBroadcastReceiver
48 mUsbBackend = backend; in UsbConnectionBroadcastReceiver()
77 mDataRole = mUsbBackend.getDataRole(); in onReceive()
78 mPowerRole = mUsbBackend.getPowerRole(); in onReceive()
DUsbDetailsDataRoleController.java102 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()
DConnectedUsbDeviceUpdater.java38 private UsbBackend mUsbBackend; field in ConnectedUsbDeviceUpdater
67 mUsbBackend = usbBackend; in ConnectedUsbDeviceUpdater()
69 mUsbConnectionListener, mUsbBackend); in ConnectedUsbDeviceUpdater()
DUsbDetailsController.java36 protected final UsbBackend mUsbBackend; field in UsbDetailsController
45 mUsbBackend = backend; in UsbDetailsController()