Home
last modified time | relevance | path

Searched refs:mHeadsetService (Results 1 – 11 of 11) sorted by relevance

/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hfp/
DHeadsetServiceTest.java73 private HeadsetService mHeadsetService; field in HeadsetServiceTest
146 mHeadsetService = HeadsetService.getHeadsetService(); in setUp()
147 Assert.assertNotNull(mHeadsetService); in setUp()
148 verify(mObjectsFactory).makeSystemInterface(mHeadsetService); in setUp()
150 mHeadsetServiceBinder = (IBluetoothHeadset.Stub) mHeadsetService.initBinder(); in setUp()
161 mHeadsetService = HeadsetService.getHeadsetService(); in tearDown()
162 Assert.assertNull(mHeadsetService); in tearDown()
177 Assert.assertEquals(mHeadsetService, HeadsetService.getHeadsetService()); in testGetHeadsetService()
181 mHeadsetService.getConnectionState(mCurrentDevice)); in testGetHeadsetService()
183 mHeadsetService.getAudioState(mCurrentDevice)); in testGetHeadsetService()
[all …]
DHeadsetServiceAndStateMachineTest.java95 private HeadsetService mHeadsetService; field in HeadsetServiceAndStateMachineTest
221 mHeadsetService = HeadsetService.getHeadsetService(); in setUp()
222 Assert.assertNotNull(mHeadsetService); in setUp()
223 verify(mObjectsFactory).makeSystemInterface(mHeadsetService); in setUp()
226 mHeadsetServiceBinder = (IBluetoothHeadset.Stub) mHeadsetService.initBinder(); in setUp()
247 mHeadsetService = HeadsetService.getHeadsetService(); in tearDown()
248 Assert.assertNull(mHeadsetService); in tearDown()
266 Assert.assertEquals(mHeadsetService, HeadsetService.getHeadsetService()); in testGetHeadsetService()
270 mHeadsetService.getConnectionState(device)); in testGetHeadsetService()
272 mHeadsetService.getAudioState(device)); in testGetHeadsetService()
[all …]
DHeadsetStateMachineTest.java79 @Mock private HeadsetService mHeadsetService; field in HeadsetStateMachineTest
110 when(mHeadsetService.getContentResolver()).thenReturn(mMockContentResolver); in setUp()
113 when(mHeadsetService.bindService(any(Intent.class), any(ServiceConnection.class), anyInt())) in setUp()
115 when(mHeadsetService.getResources()).thenReturn( in setUp()
117 when(mHeadsetService.getPackageManager()).thenReturn( in setUp()
119 when(mHeadsetService.getConnectionPolicy(any(BluetoothDevice.class))).thenReturn( in setUp()
121 when(mHeadsetService.getForceScoAudio()).thenReturn(true); in setUp()
122 when(mHeadsetService.okToAcceptConnection(any(BluetoothDevice.class))).thenReturn(true); in setUp()
123 when(mHeadsetService.isScoAcceptable(any(BluetoothDevice.class))).thenReturn(true); in setUp()
130 .makeStateMachine(mTestDevice, mHandlerThread.getLooper(), mHeadsetService, in setUp()
[all …]
DHeadsetPhoneStateTest.java55 @Mock private HeadsetService mHeadsetService; field in HeadsetPhoneStateTest
78 when(mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn( in setUp()
81 when(mHeadsetService.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)).thenReturn( in setUp()
85 when(mHeadsetService.getStateMachinesThreadLooper()).thenReturn(mHandlerThread.getLooper()); in setUp()
86 mHeadsetPhoneState = new HeadsetPhoneState(mHeadsetService); in setUp()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/
DPhonePolicyTest.java65 @Mock private HeadsetService mHeadsetService; field in PhonePolicyTest
73 when(mHeadsetService.connect(any(BluetoothDevice.class))).thenReturn(true); in setUp()
81 doReturn(mHeadsetService).when(mServiceFactory).getHeadsetService(); in setUp()
111 when(mHeadsetService.getConnectionPolicy(device)) in testProcessInitProfilePriorities()
156 when(mHeadsetService.getConnectionPolicy(bondedDevice)).thenReturn( in testAdapterOnAutoConnect()
168 verify(mHeadsetService, timeout(ASYNC_CALL_TIMEOUT_MILLIS)).connect(eq(bondedDevice)); in testAdapterOnAutoConnect()
191 when(mHeadsetService.getConnectionPolicy(connectionOrder.get(0))).thenReturn( in testDisconnectNoAutoConnect()
193 when(mHeadsetService.getConnectionPolicy(connectionOrder.get(1))).thenReturn( in testDisconnectNoAutoConnect()
195 when(mHeadsetService.getConnectionPolicy(connectionOrder.get(2))).thenReturn( in testDisconnectNoAutoConnect()
197 when(mHeadsetService.getConnectionPolicy(connectionOrder.get(3))).thenReturn( in testDisconnectNoAutoConnect()
[all …]
DActiveDeviceManagerTest.java65 @Mock private HeadsetService mHeadsetService; field in ActiveDeviceManagerTest
82 when(mServiceFactory.getHeadsetService()).thenReturn(mHeadsetService); in setUp()
85 when(mHeadsetService.setActiveDevice(any())).thenReturn(true); in setUp()
169 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mHeadsetDevice); in onlyHeadsetConnected_setHeadsetActive()
178 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mHeadsetDevice); in secondHeadsetConnected_setSecondHeadsetActive()
181 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mA2dpHeadsetDevice); in secondHeadsetConnected_setSecondHeadsetActive()
190 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mHeadsetDevice); in lastHeadsetDisconnected_clearHeadsetActive()
193 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(isNull()); in lastHeadsetDisconnected_clearHeadsetActive()
202 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mHeadsetDevice); in headsetActiveDeviceSelected_setActive()
205 verify(mHeadsetService, timeout(TIMEOUT_MS)).setActiveDevice(mA2dpHeadsetDevice); in headsetActiveDeviceSelected_setActive()
[all …]
DSilenceDeviceManagerTest.java64 @Mock private HeadsetService mHeadsetService; field in SilenceDeviceManagerTest
75 when(mServiceFactory.getHeadsetService()).thenReturn(mHeadsetService); in setUp()
109 doReturn(true).when(mHeadsetService).setSilenceMode(mTestDevice, enableSilence); in testSetGetDeviceSilenceConnectedCase()
/packages/apps/Bluetooth/src/com/android/bluetooth/hfp/
DHeadsetSystemInterface.java51 private final HeadsetService mHeadsetService; field in HeadsetSystemInterface
82 mHeadsetService = headsetService; in HeadsetSystemInterface()
83 mAudioManager = (AudioManager) mHeadsetService.getSystemService(Context.AUDIO_SERVICE); in HeadsetSystemInterface()
85 (PowerManager) mHeadsetService.getSystemService(Context.POWER_SERVICE); in HeadsetSystemInterface()
89 mHeadsetPhoneState = new HeadsetPhoneState(mHeadsetService); in HeadsetSystemInterface()
98 intent.setComponent(resolveSystemService(mHeadsetService.getPackageManager(), 0, intent)); in init()
99 if (intent.getComponent() == null || !mHeadsetService.bindService(intent, in init()
149 mHeadsetService.unbindService(mPhoneProxyConnection); in stop()
199 mHeadsetService.setActiveDevice(device); in answerCall()
222 if (mHeadsetService.isVirtualCallStarted()) { in hangupCall()
[all …]
DHeadsetStateMachine.java131 private final HeadsetService mHeadsetService; field in HeadsetStateMachine
176 mHeadsetService = Objects.requireNonNull(headsetService, "headsetService cannot be null"); in HeadsetStateMachine()
184 mPhonebook = new AtPhonebook(mHeadsetService, mNativeInterface); in HeadsetStateMachine()
300 mHeadsetService.onConnectionStateChangedFromStateMachine(device, fromState, toState); in broadcastConnectionState()
306 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastConnectionState()
320 mHeadsetService.onAudioStateChangedFromStateMachine(device, fromState, toState); in broadcastAudioState()
325 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastAudioState()
455 getHandler().post(() -> mHeadsetService.removeStateMachine(mDevice)); in enter()
522 if (mHeadsetService.okToAcceptConnection(mDevice)) { in processConnectionEvent()
527 + mHeadsetService.getConnectionPolicy(mDevice) + " bondState=" in processConnectionEvent()
[all …]
DHeadsetPhoneState.java48 private final HeadsetService mHeadsetService; field in HeadsetPhoneState
76 mHeadsetService = headsetService; in HeadsetPhoneState()
78 (TelephonyManager) mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE); in HeadsetPhoneState()
82 mSubscriptionManager = SubscriptionManager.from(mHeadsetService); in HeadsetPhoneState()
245 mHeadsetService.onDeviceStateChanged( in sendDeviceStateChanged()
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/
DAdapterService.java232 private HeadsetService mHeadsetService; field in AdapterService
901 if (mHeadsetService != null && mHeadsetService.getConnectionPolicy(device) in isAnyProfileEnabled()
956 if (mHeadsetService != null && isSupported(localDeviceUuids, remoteDeviceUuids, in connectEnabledProfiles()
957 BluetoothProfile.HEADSET, device) && mHeadsetService.getConnectionPolicy(device) in connectEnabledProfiles()
960 mHeadsetService.connect(device); in connectEnabledProfiles()
1028 mHeadsetService = HeadsetService.getHeadsetService(); in initProfileServices()
2378 if (setHeadset && mHeadsetService != null && (device == null in setActiveDevice()
2379 || mHeadsetService.getConnectionPolicy(device) in setActiveDevice()
2382 mHeadsetService.setActiveDevice(device); in setActiveDevice()
2424 if (mHeadsetService != null && isSupported(localDeviceUuids, remoteDeviceUuids, in connectAllEnabledProfiles()
[all …]