Home
last modified time | relevance | path

Searched refs:mAdapterService (Results 1 – 25 of 43) sorted by relevance

12

/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/
DAdapterServiceTest.java72 private AdapterService mAdapterService; field in AdapterServiceTest
120 () -> mAdapterService = new AdapterService()); in setUp()
156 mAdapterService.attach(mMockContext, null, null, null, null, null); in setUp()
158 mAdapterService.onCreate(); in setUp()
159 mAdapterService.registerCallback(mIBluetoothCallback); in setUp()
169 mAdapterService.unregisterCallback(mIBluetoothCallback); in tearDown()
170 mAdapterService.cleanup(); in tearDown()
184 Assert.assertFalse(mAdapterService.isEnabled()); in doEnable()
188 mAdapterService.enable(); in doEnable()
196 mAdapterService.addProfile(mMockGattService); in doEnable()
[all …]
DRemoteDevicesTest.java45 @Mock private AdapterService mAdapterService; field in RemoteDevicesTest
55 mRemoteDevices = new RemoteDevices(mAdapterService, mHandlerThread.getLooper()); in setUp()
73 verify(mAdapterService).sendBroadcast(any(), anyString()); in testSendUuidIntent()
74 verifyNoMoreInteractions(mAdapterService); in testSendUuidIntent()
86 verify(mAdapterService).sendBroadcast(mIntentArgument.capture(), mStringArgument.capture()); in testUpdateBatteryLevel_normalSequence()
97 verify(mAdapterService).sendBroadcast(any(), anyString()); in testUpdateBatteryLevel_normalSequence()
102 verify(mAdapterService, times(2)).sendBroadcast(mIntentArgument.capture(), in testUpdateBatteryLevel_normalSequence()
111 verifyNoMoreInteractions(mAdapterService); in testUpdateBatteryLevel_normalSequence()
123 verify(mAdapterService, never()).sendBroadcast(any(), anyString()); in testUpdateBatteryLevel_errorNegativeValue()
128 verifyNoMoreInteractions(mAdapterService); in testUpdateBatteryLevel_errorNegativeValue()
[all …]
DPhonePolicyTest.java61 @Mock private AdapterService mAdapterService; field in PhonePolicyTest
73 TestUtils.setAdapterService(mAdapterService); in setUp()
75 doReturn(MAX_CONNECTED_AUDIO_DEVICES).when(mAdapterService).getMaxConnectedAudioDevices(); in setUp()
83 doReturn(mHandlerThread.getLooper()).when(mAdapterService).getMainLooper(); in setUp()
85 doReturn(true).when(mAdapterService).isMock(); in setUp()
89 mPhonePolicy = new PhonePolicy(mAdapterService, mServiceFactory); in setUp()
95 TestUtils.clearAdapterService(mAdapterService); in tearDown()
137 when(mAdapterService.getState()).thenReturn(BluetoothAdapter.STATE_ON); in testAdapterOnAutoConnect()
138 when(mAdapterService.isQuietModeEnabled()).thenReturn(false); in testAdapterOnAutoConnect()
143 when(mAdapterService.getBondedDevices()).thenReturn(bondedDevices); in testAdapterOnAutoConnect()
[all …]
DSilenceDeviceManagerTest.java61 @Mock private AdapterService mAdapterService; field in SilenceDeviceManagerTest
73 TestUtils.setAdapterService(mAdapterService); in setUp()
83 mSilenceDeviceManager = new SilenceDeviceManager(mAdapterService, mServiceFactory, in setUp()
92 TestUtils.clearAdapterService(mAdapterService); in tearDown()
119 verify(mAdapterService, times(++mVerifyCount)).sendBroadcastAsUser( in testSetGetDeviceSilenceConnectedCase()
131 verify(mAdapterService, times(++mVerifyCount)).sendBroadcastAsUser( in testSetGetDeviceSilenceConnectedCase()
145 verify(mAdapterService, times(++mVerifyCount)).sendBroadcastAsUser( in testSetGetDeviceSilenceConnectedCase()
159 verify(mAdapterService, times(mVerifyCount)).sendBroadcastAsUser( in testSetGetDeviceSilenceDisconnectedCase()
DBondStateMachineTest.java63 @Mock private AdapterService mAdapterService; field in BondStateMachineTest
69 TestUtils.setAdapterService(mAdapterService); in setUp()
73 mRemoteDevices = new RemoteDevices(mAdapterService, mHandlerThread.getLooper()); in setUp()
75 when(mAdapterService.getResources()).thenReturn( in setUp()
77 mAdapterProperties = new AdapterProperties(mAdapterService); in setUp()
79 mBondStateMachine = BondStateMachine.make(mAdapterService, mAdapterProperties, in setUp()
86 TestUtils.clearAdapterService(mAdapterService); in tearDown()
233 verify(mAdapterService, times(++mVerifyCount)).sendBroadcastAsUser( in testSendIntentCase()
239 verify(mAdapterService, times(mVerifyCount)).sendBroadcastAsUser(any(Intent.class), in testSendIntentCase()
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/
DBondStateMachine.java71 private AdapterService mAdapterService; field in BondStateMachine
89 mAdapterService = service; in BondStateMachine()
108 mAdapterService = null; in cleanup()
228 mAdapterService.setPhonebookAccessPermission(dev, in processMessage()
230 mAdapterService.setMessageAccessPermission(dev, in processMessage()
232 mAdapterService.setSimAccessPermission(dev, in processMessage()
290 if (!mAdapterService.cancelBondNative(addr)) { in cancelBond()
302 if (!mAdapterService.removeBondNative(addr)) { in removeBond()
322 result = mAdapterService.createBondOutOfBandNative(addr, transport, oobData); in createBond()
324 result = mAdapterService.createBondNative(addr, transport); in createBond()
[all …]
DProfileService.java60 private AdapterService mAdapterService; field in ProfileService
226 mAdapterService = AdapterService.getAdapterService(); in doStart()
227 if (mAdapterService == null) { in doStart()
231 mAdapterService.addProfile(this); in doStart()
268 mAdapterService.onProfileServiceStateChanged(this, BluetoothAdapter.STATE_ON); in doStart()
276 if (mAdapterService != null) { in doStop()
277 mAdapterService.onProfileServiceStateChanged(this, BluetoothAdapter.STATE_OFF); in doStop()
282 if (mAdapterService != null) { in doStop()
283 mAdapterService.removeProfile(this); in doStop()
DAdapterState.java78 private AdapterService mAdapterService; field in AdapterState
98 mAdapterService = service; in AdapterState()
132 if (mAdapterService != null) { in cleanup()
133 mAdapterService = null; in cleanup()
155 mAdapterService.updateAdapterState(mPrevState, currState); in enter()
251 mAdapterService.bringUpBle(); in enter()
291 mAdapterService.startProfileServices(); in enter()
331 mAdapterService.stopProfileServices(); in enter()
371 mAdapterService.bringDownBle(); in enter()
DPhonePolicy.java86 private final AdapterService mAdapterService; field in PhonePolicy
212 mAdapterService.registerReceiver(mReceiver, filter); in start()
216 mAdapterService.unregisterReceiver(mReceiver); in cleanup()
221 mAdapterService = service; in PhonePolicy()
258 && mAdapterService.getResources() in processInitProfilePriorities()
322 for (BluetoothDevice device : mAdapterService.getBondedDevices()) { in processProfileActiveDeviceChanged()
377 if (mAdapterService.getState() != BluetoothAdapter.STATE_ON) { in autoConnect()
382 if (!mAdapterService.isQuietModeEnabled()) { in autoConnect()
384 final BluetoothDevice[] bondedDevices = mAdapterService.getBondedDevices(); in autoConnect()
431 if (mAdapterService.isQuietModeEnabled()) { in connectOtherProfile()
[all …]
DJniCallbacks.java23 private AdapterService mAdapterService; field in JniCallbacks
27 mAdapterService = adapterService; in JniCallbacks()
39 mAdapterService = null; in cleanup()
73 mAdapterService.stateChangeCallback(status); in stateChangeCallback()
DSilenceDeviceManager.java63 private final AdapterService mAdapterService; field in SilenceDeviceManager
210 mAdapterService = service; in SilenceDeviceManager()
225 mAdapterService.registerReceiver(mReceiver, filter); in start()
233 mAdapterService.unregisterReceiver(mReceiver); in cleanup()
281 mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, AdapterService.BLUETOOTH_PERM); in broadcastSilenceStateChange()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hfp/
DHeadsetServiceTest.java83 @Mock private AdapterService mAdapterService; field in HeadsetServiceTest
95 TestUtils.setAdapterService(mAdapterService); in setUp()
103 doReturn(true).when(mAdapterService).isEnabled(); in setUp()
104 doReturn(MAX_HEADSET_CONNECTIONS).when(mAdapterService).getMaxConnectedAudioDevices(); in setUp()
105 doReturn(new ParcelUuid[]{BluetoothUuid.Handsfree}).when(mAdapterService) in setUp()
110 doReturn(FAKE_HEADSET_UUID).when(mAdapterService) in setUp()
112 doReturn(BluetoothDevice.BOND_BONDED).when(mAdapterService) in setUp()
117 }).when(mAdapterService).getBondedDevices(); in setUp()
154 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in setUp()
171 TestUtils.clearAdapterService(mAdapterService); in tearDown()
[all …]
DHeadsetServiceAndStateMachineTest.java150 @Mock private AdapterService mAdapterService; field in HeadsetServiceAndStateMachineTest
166 TestUtils.setAdapterService(mAdapterService); in setUp()
167 doReturn(true).when(mAdapterService).isEnabled(); in setUp()
168 doReturn(MAX_HEADSET_CONNECTIONS).when(mAdapterService).getMaxConnectedAudioDevices(); in setUp()
169 doReturn(new ParcelUuid[]{BluetoothUuid.Handsfree}).when(mAdapterService) in setUp()
181 doReturn(FAKE_HEADSET_UUID).when(mAdapterService) in setUp()
183 doReturn(BluetoothDevice.BOND_BONDED).when(mAdapterService) in setUp()
186 mAdapterService).getBondedDevices(); in setUp()
253 TestUtils.clearAdapterService(mAdapterService); in tearDown()
282 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testConnectFromApi()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/a2dp/
DA2dpServiceTest.java78 @Mock private AdapterService mAdapterService; field in A2dpServiceTest
98 TestUtils.setAdapterService(mAdapterService); in setUp()
99 doReturn(MAX_CONNECTED_AUDIO_DEVICES).when(mAdapterService).getMaxConnectedAudioDevices(); in setUp()
100 doReturn(false).when(mAdapterService).isQuietModeEnabled(); in setUp()
122 doReturn(BluetoothDevice.BOND_BONDED).when(mAdapterService) in setUp()
124 doReturn(new ParcelUuid[]{BluetoothUuid.AudioSink}).when(mAdapterService) in setUp()
138 TestUtils.clearAdapterService(mAdapterService); in tearDown()
270 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetPriority()
277 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetPriority()
284 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetPriority()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hearingaid/
DHearingAidServiceTest.java73 @Mock private AdapterService mAdapterService; field in HearingAidServiceTest
93 TestUtils.setAdapterService(mAdapterService); in setUp()
118 doReturn(BluetoothDevice.BOND_BONDED).when(mAdapterService) in setUp()
120 doReturn(new ParcelUuid[]{BluetoothUuid.HearingAid}).when(mAdapterService) in setUp()
133 TestUtils.clearAdapterService(mAdapterService); in tearDown()
219 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority()
226 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority()
233 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority()
240 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testGetSetPriority()
303 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testOutgoingConnectMissingHearingAidUuid()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/
DA2dpService.java60 private AdapterService mAdapterService; field in A2dpService
104 mAdapterService = Objects.requireNonNull(AdapterService.getAdapterService(), in start()
113 mMaxConnectedAudioDevices = mAdapterService.getMaxConnectedAudioDevices(); in start()
129 mA2dpOffloadEnabled = mAdapterService.isA2dpOffloadEnabled(); in start()
197 mAdapterService = null; in stop()
236 if (!BluetoothUuid.isUuidPresent(mAdapterService.getRemoteUuids(device), in connect()
343 if (mAdapterService.isQuietModeEnabled() && !isOutgoingRequest) { in okToConnect()
355 int bondState = mAdapterService.getBondState(device); in okToConnect()
377 final BluetoothDevice[] bondedDevices = mAdapterService.getBondedDevices(); in getDevicesMatchingConnectionStates()
383 if (!BluetoothUuid.isUuidPresent(mAdapterService.getRemoteUuids(device), in getDevicesMatchingConnectionStates()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/storage/
DDatabaseManager.java59 private AdapterService mAdapterService = null; field in DatabaseManager
80 mAdapterService = service; in DatabaseManager()
99 .createDatabaseWithoutMigration(mAdapterService); in handleMessage()
239 mAdapterService.metadataChanged(address, key, newValue); in setCustomMeta()
532 if (mAdapterService == null) { in start()
551 mAdapterService.registerReceiver(mReceiver, filter); in start()
558 return mAdapterService.getDatabasePath(MetadataDatabase.DATABASE_NAME) in getDatabaseAbsolutePath()
576 mAdapterService.unregisterReceiver(mReceiver); in cleanup()
595 BluetoothDevice[] bondedDevices = mAdapterService.getBondedDevices(); in removeUnusedMetadata()
603 mAdapterService.metadataChanged(address, key, null); in removeUnusedMetadata()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/storage/
DDatabaseManagerTest.java48 @Mock private AdapterService mAdapterService; field in DatabaseManagerTest
67 TestUtils.setAdapterService(mAdapterService); in setUp()
75 when(mAdapterService.getPackageManager()).thenReturn( in setUp()
77 mDatabaseManager = new DatabaseManager(mAdapterService); in setUp()
80 doReturn(bondedDevices).when(mAdapterService).getBondedDevices(); in setUp()
81 doNothing().when(mAdapterService).metadataChanged( in setUp()
89 TestUtils.clearAdapterService(mAdapterService); in tearDown()
226 verify(mAdapterService).metadataChanged(OTHER_BT_ADDR1, 0, null); in testRemoveUnusedMetadata_WithSingleBondedDevice()
272 doReturn(bondedDevices).when(mAdapterService).getBondedDevices(); in testRemoveUnusedMetadata_WithMultiBondedDevices()
278 verify(mAdapterService).metadataChanged(TEST_BT_ADDR, 0, null); in testRemoveUnusedMetadata_WithMultiBondedDevices()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hid/
DHidHostServiceTest.java55 @Mock private AdapterService mAdapterService; field in HidHostServiceTest
64 TestUtils.setAdapterService(mAdapterService); in setUp()
84 TestUtils.clearAdapterService(mAdapterService); in tearDown()
154 doReturn(bondState).when(mAdapterService).getBondState(device); in testOkToConnectCase()
155 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in testOkToConnectCase()
160 doReturn(false).when(mAdapterService).isQuietModeEnabled(); in testOkToConnectCase()
164 doReturn(true).when(mAdapterService).isQuietModeEnabled(); in testOkToConnectCase()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/gatt/
DGattServiceTest.java38 @Mock private AdapterService mAdapterService; field in GattServiceTest
46 TestUtils.setAdapterService(mAdapterService); in setUp()
60 TestUtils.clearAdapterService(mAdapterService); in tearDown()
76 TestUtils.clearAdapterService(mAdapterService); in testServiceUpAndDown()
77 reset(mAdapterService); in testServiceUpAndDown()
78 TestUtils.setAdapterService(mAdapterService); in testServiceUpAndDown()
/packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/
DHearingAidService.java62 private AdapterService mAdapterService; field in HearingAidService
106 mAdapterService = Objects.requireNonNull(AdapterService.getAdapterService(), in start()
188 mAdapterService = null; in stop()
236 ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in connect()
354 if (mAdapterService.isQuietModeEnabled()) { in okToConnect()
360 int bondState = mAdapterService.getBondState(device); in okToConnect()
382 final BluetoothDevice[] bondedDevices = mAdapterService.getBondedDevices(); in getDevicesMatchingConnectionStates()
457 mAdapterService.getDatabase() in setPriority()
464 return mAdapterService.getDatabase() in getPriority()
635 mAdapterService.obfuscateAddress(device)); in reportActiveDevice()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hfp/
DHeadsetService.java99 private AdapterService mAdapterService; field in HeadsetService
142 mAdapterService = Objects.requireNonNull(AdapterService.getAdapterService(), in start()
151 mMaxHeadsetConnections = mAdapterService.getMaxConnectedAudioDevices(); in start()
224 mAdapterService = null; in stop()
306 mStateMachinesThread.getLooper(), this, mAdapterService, in messageFromNative()
687 ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in connect()
699 mAdapterService, mNativeInterface, mSystemInterface); in connect()
777 if (states == null || mAdapterService == null) { in getDevicesMatchingConnectionStates()
780 final BluetoothDevice[] bondedDevices = mAdapterService.getBondedDevices(); in getDevicesMatchingConnectionStates()
785 final ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in getDevicesMatchingConnectionStates()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/a2dpsink/
DA2dpSinkServiceTest.java54 @Mock private AdapterService mAdapterService; field in A2dpSinkServiceTest
63 TestUtils.setAdapterService(mAdapterService); in setUp()
70 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in setUp()
81 TestUtils.clearAdapterService(mAdapterService); in tearDown()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/mapclient/
DMapClientTest.java58 @Mock private AdapterService mAdapterService; field in MapClientTest
70 TestUtils.setAdapterService(mAdapterService); in setUp()
77 when(mAdapterService.getDatabase()).thenReturn(mDatabaseManager); in setUp()
88 TestUtils.clearAdapterService(mAdapterService); in tearDown()
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/opp/
DBluetoothOppServiceTest.java49 @Mock private AdapterService mAdapterService; field in BluetoothOppServiceTest
57 TestUtils.setAdapterService(mAdapterService); in setUp()
72 TestUtils.clearAdapterService(mAdapterService); in tearDown()

12