Home
last modified time | relevance | path

Searched refs:mHeadsetService (Results 1 – 10 of 10) 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()
163 mHeadsetService = HeadsetService.getHeadsetService(); in tearDown()
164 Assert.assertNull(mHeadsetService); in tearDown()
179 Assert.assertEquals(mHeadsetService, HeadsetService.getHeadsetService()); in testGetHeadsetService()
183 mHeadsetService.getConnectionState(mCurrentDevice)); in testGetHeadsetService()
185 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.java75 @Mock private HeadsetService mHeadsetService; field in HeadsetStateMachineTest
106 when(mHeadsetService.getContentResolver()).thenReturn(mMockContentResolver); in setUp()
109 when(mHeadsetService.bindService(any(Intent.class), any(ServiceConnection.class), anyInt())) in setUp()
111 when(mHeadsetService.getResources()).thenReturn( in setUp()
113 when(mHeadsetService.getPackageManager()).thenReturn( in setUp()
115 when(mHeadsetService.getPriority(any(BluetoothDevice.class))).thenReturn( in setUp()
117 when(mHeadsetService.getForceScoAudio()).thenReturn(true); in setUp()
118 when(mHeadsetService.okToAcceptConnection(any(BluetoothDevice.class))).thenReturn(true); in setUp()
119 when(mHeadsetService.isScoAcceptable(any(BluetoothDevice.class))).thenReturn(true); in setUp()
126 .makeStateMachine(mTestDevice, mHandlerThread.getLooper(), mHeadsetService, in setUp()
[all …]
DHeadsetPhoneStateTest.java54 @Mock private HeadsetService mHeadsetService; field in HeadsetPhoneStateTest
74 when(mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn( in setUp()
77 when(mHeadsetService.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)).thenReturn( in setUp()
81 when(mHeadsetService.getStateMachinesThreadLooper()).thenReturn(mHandlerThread.getLooper()); in setUp()
82 mHeadsetPhoneState = new HeadsetPhoneState(mHeadsetService); in setUp()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/
DPhonePolicyTest.java63 @Mock private HeadsetService mHeadsetService; field in PhonePolicyTest
70 when(mHeadsetService.connect(any(BluetoothDevice.class))).thenReturn(true); in setUp()
77 doReturn(mHeadsetService).when(mServiceFactory).getHeadsetService(); in setUp()
107 when(mHeadsetService.getPriority(device)).thenReturn(BluetoothProfile.PRIORITY_UNDEFINED); in testProcessInitProfilePriorities()
122 verify(mHeadsetService, timeout(ASYNC_CALL_TIMEOUT_MILLIS)).setPriority(eq(device), in testProcessInitProfilePriorities()
146 when(mHeadsetService.getPriority(bondedDevices[0])).thenReturn( in testAdapterOnAutoConnect()
158 verify(mHeadsetService, timeout(ASYNC_CALL_TIMEOUT_MILLIS)).connect(eq(bondedDevices[0])); in testAdapterOnAutoConnect()
180 when(mHeadsetService.getPriority(bondedDevices[0])).thenReturn( in testDisconnectNoAutoConnect()
182 when(mHeadsetService.getPriority(bondedDevices[1])).thenReturn( in testDisconnectNoAutoConnect()
184 when(mHeadsetService.getPriority(bondedDevices[2])).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.java44 private final HeadsetService mHeadsetService; field in HeadsetSystemInterface
75 mHeadsetService = headsetService; in HeadsetSystemInterface()
76 mAudioManager = (AudioManager) mHeadsetService.getSystemService(Context.AUDIO_SERVICE); in HeadsetSystemInterface()
78 (PowerManager) mHeadsetService.getSystemService(Context.POWER_SERVICE); in HeadsetSystemInterface()
82 mHeadsetPhoneState = new HeadsetPhoneState(mHeadsetService); in HeadsetSystemInterface()
91 intent.setComponent(intent.resolveSystemService(mHeadsetService.getPackageManager(), 0)); in init()
92 if (intent.getComponent() == null || !mHeadsetService.bindService(intent, in init()
109 mHeadsetService.unbindService(mPhoneProxyConnection); in stop()
159 mHeadsetService.setActiveDevice(device); in answerCall()
182 if (mHeadsetService.isVirtualCallStarted()) { in hangupCall()
[all …]
DHeadsetPhoneState.java52 private final HeadsetService mHeadsetService; field in HeadsetPhoneState
82 mHeadsetService = headsetService; in HeadsetPhoneState()
84 (TelephonyManager) mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE); in HeadsetPhoneState()
88 mSubscriptionManager = SubscriptionManager.from(mHeadsetService); in HeadsetPhoneState()
164 mHeadsetService.getStateMachinesThreadLooper()); in startListenForPhoneState()
257 mHeadsetService.onDeviceStateChanged( in sendDeviceStateChanged()
306 mHeadsetService.registerReceiver(new BroadcastReceiver() { in onServiceStateChanged()
316 mHeadsetService.unregisterReceiver(this); in onServiceStateChanged()
DHeadsetStateMachine.java128 private final HeadsetService mHeadsetService; field in HeadsetStateMachine
173 mHeadsetService = Objects.requireNonNull(headsetService, "headsetService cannot be null"); in HeadsetStateMachine()
181 mPhonebook = new AtPhonebook(mHeadsetService, mNativeInterface); in HeadsetStateMachine()
296 mHeadsetService.onConnectionStateChangedFromStateMachine(device, fromState, toState); in broadcastConnectionState()
302 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastConnectionState()
315 mHeadsetService.onAudioStateChangedFromStateMachine(device, fromState, toState); in broadcastAudioState()
320 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastAudioState()
450 getHandler().post(() -> mHeadsetService.removeStateMachine(mDevice)); in enter()
517 if (mHeadsetService.okToAcceptConnection(mDevice)) { in processConnectionEvent()
521 stateLogI("rejected incoming HF, priority=" + mHeadsetService.getPriority( in processConnectionEvent()
[all …]