/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hfp/ |
D | HeadsetServiceTest.java | 73 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 …]
|
D | HeadsetServiceAndStateMachineTest.java | 95 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 …]
|
D | HeadsetStateMachineTest.java | 80 @Mock private HeadsetService mHeadsetService; field in HeadsetStateMachineTest 111 when(mHeadsetService.getContentResolver()).thenReturn(mMockContentResolver); in setUp() 114 when(mHeadsetService.bindService(any(Intent.class), any(ServiceConnection.class), anyInt())) in setUp() 116 when(mHeadsetService.getResources()).thenReturn( in setUp() 118 when(mHeadsetService.getPackageManager()).thenReturn( in setUp() 120 when(mHeadsetService.getConnectionPolicy(any(BluetoothDevice.class))).thenReturn( in setUp() 122 when(mHeadsetService.getForceScoAudio()).thenReturn(true); in setUp() 123 when(mHeadsetService.okToAcceptConnection(any(BluetoothDevice.class))).thenReturn(true); in setUp() 124 when(mHeadsetService.isScoAcceptable(any(BluetoothDevice.class))).thenReturn(true); in setUp() 131 .makeStateMachine(mTestDevice, mHandlerThread.getLooper(), mHeadsetService, in setUp() [all …]
|
D | HeadsetPhoneStateTest.java | 56 @Mock private HeadsetService mHeadsetService; field in HeadsetPhoneStateTest 82 when(mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn( in setUp() 85 when(mHeadsetService.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE)).thenReturn( in setUp() 89 when(mHeadsetService.getStateMachinesThreadLooper()).thenReturn(mHandlerThread.getLooper()); in setUp() 90 mHeadsetPhoneState = new HeadsetPhoneState(mHeadsetService); in setUp()
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/ |
D | PhonePolicyTest.java | 65 @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 …]
|
D | ActiveDeviceManagerTest.java | 65 @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 …]
|
D | SilenceDeviceManagerTest.java | 66 @Mock private HeadsetService mHeadsetService; field in SilenceDeviceManagerTest 77 when(mServiceFactory.getHeadsetService()).thenReturn(mHeadsetService); in setUp() 111 doReturn(true).when(mHeadsetService).setSilenceMode(mTestDevice, enableSilence); in testSetGetDeviceSilenceConnectedCase()
|
/packages/apps/Bluetooth/src/com/android/bluetooth/hfp/ |
D | HeadsetSystemInterface.java | 54 private final HeadsetService mHeadsetService; field in HeadsetSystemInterface 65 mHeadsetService = headsetService; in HeadsetSystemInterface() 66 mAudioManager = (AudioManager) mHeadsetService.getSystemService(Context.AUDIO_SERVICE); in HeadsetSystemInterface() 68 (PowerManager) mHeadsetService.getSystemService(Context.POWER_SERVICE); in HeadsetSystemInterface() 72 mHeadsetPhoneState = new com.android.bluetooth.hfp.HeadsetPhoneState(mHeadsetService); in HeadsetSystemInterface() 73 mTelephonyManager = mHeadsetService.getSystemService(TelephonyManager.class); in HeadsetSystemInterface() 74 mTelecomManager = mHeadsetService.getSystemService(TelecomManager.class); in HeadsetSystemInterface() 166 mHeadsetService.setActiveDevice(device); in answerCall() 187 if (mHeadsetService.isVirtualCallStarted()) { in hangupCall() 188 mHeadsetService.stopScoUsingVirtualVoiceCall(); in hangupCall() [all …]
|
D | HeadsetStateMachine.java | 136 private final HeadsetService mHeadsetService; field in HeadsetStateMachine 181 mHeadsetService = Objects.requireNonNull(headsetService, "headsetService cannot be null"); in HeadsetStateMachine() 189 mPhonebook = new AtPhonebook(mHeadsetService, mNativeInterface); in HeadsetStateMachine() 305 mHeadsetService.onConnectionStateChangedFromStateMachine(device, fromState, toState); in broadcastConnectionState() 311 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastConnectionState() 325 mHeadsetService.onAudioStateChangedFromStateMachine(device, fromState, toState); in broadcastAudioState() 330 mHeadsetService.sendBroadcastAsUser(intent, UserHandle.ALL, in broadcastAudioState() 460 getHandler().post(() -> mHeadsetService.removeStateMachine(mDevice)); in enter() 529 if (mHeadsetService.okToAcceptConnection(mDevice)) { in processConnectionEvent() 534 + mHeadsetService.getConnectionPolicy(mDevice) + " bondState=" in processConnectionEvent() [all …]
|
D | HeadsetPhoneState.java | 50 private final HeadsetService mHeadsetService; field in HeadsetPhoneState 78 mHeadsetService = headsetService; in HeadsetPhoneState() 80 (TelephonyManager) mHeadsetService.getSystemService(Context.TELEPHONY_SERVICE); in HeadsetPhoneState() 84 mSubscriptionManager = SubscriptionManager.from(mHeadsetService); in HeadsetPhoneState() 247 mHeadsetService.onDeviceStateChanged( in sendDeviceStateChanged()
|
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/ |
D | AdapterService.java | 282 private HeadsetService mHeadsetService; field in AdapterService 1035 if (mHeadsetService != null && mHeadsetService.getConnectionPolicy(device) in isAnyProfileEnabled() 1094 if (mHeadsetService != null && isSupported(localDeviceUuids, remoteDeviceUuids, in connectEnabledProfiles() 1095 BluetoothProfile.HEADSET, device) && mHeadsetService.getConnectionPolicy(device) in connectEnabledProfiles() 1098 mHeadsetService.connect(device); in connectEnabledProfiles() 1166 mHeadsetService = HeadsetService.getHeadsetService(); in initProfileServices() 2846 if (setHeadset && mHeadsetService != null && (device == null in setActiveDevice() 2847 || mHeadsetService.getConnectionPolicy(device) in setActiveDevice() 2850 mHeadsetService.setActiveDevice(device); in setActiveDevice() 2896 if (mHeadsetService != null && isSupported(localDeviceUuids, remoteDeviceUuids, in connectAllEnabledProfiles() [all …]
|