Home
last modified time | relevance | path

Searched refs:mBluetoothAdapter (Results 1 – 25 of 80) sorted by relevance

1234

/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DBluetoothProfileDeviceManagerTest.java124 private BluetoothAdapter mBluetoothAdapter; field in BluetoothProfileDeviceManagerTest
169 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in setUp()
170 Assert.assertTrue(mBluetoothAdapter != null); in setUp()
189 mBluetoothAdapter = null; in tearDown()
220 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address); in makeDeviceList()
480 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(SINGLE_DEVICE_LIST.get(0)); in testAddDeviceAlreadyInList_priorityListUnchanged()
502 mProfileDeviceManager.removeDevice(mBluetoothAdapter.getRemoteDevice("DE:AD:BE:EF:00:00")); in testRemoveDeviceFromEmptyList_priorityListUnchanged()
519 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(SINGLE_DEVICE_LIST.get(0)); in testRemoveDeviceFront_deviceNoLongerInPriorityList()
540 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(SMALL_DEVICE_LIST.get(1)); in testRemoveDeviceMiddle_deviceNoLongerInPriorityList()
560 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(SMALL_DEVICE_LIST.get(2)); in testRemoveDeviceEnd_deviceNoLongerInPriorityList()
[all …]
DBluetoothAdapterHelper.java44 private BluetoothAdapter mBluetoothAdapter; field in BluetoothAdapterHelper
94 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothAdapterHelper()
123 return mBluetoothAdapter.getState(); in getAdapterState()
161 while (desiredState != mBluetoothAdapter.getState()) { in waitForAdapterState()
175 assertTrue(mBluetoothAdapter.getState() == desiredState); in waitForAdapterState()
207 mBluetoothAdapter.enable(); in forceAdapterState()
209 mBluetoothAdapter.disable(persistAcrossReboot); in forceAdapterState()
/packages/apps/Car/Settings/src/com/android/car/settings/quicksettings/
DBluetoothTile.java41 private BluetoothAdapter mBluetoothAdapter; field in BluetoothTile
93 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothTile()
94 if (mBluetoothAdapter == null) { in BluetoothTile()
113 return mBluetoothAdapter != null; in isAvailable()
149 if (mBluetoothAdapter == null) { in onClick()
152 if (mBluetoothAdapter.isEnabled()) { in onClick()
153 mBluetoothAdapter.disable(); in onClick()
155 mBluetoothAdapter.enable(); in onClick()
160 if (mBluetoothAdapter.getConnectionState() == BluetoothAdapter.STATE_CONNECTED) { in updateBluetoothIconState()
163 } else if (mBluetoothAdapter.isEnabled()) { in updateBluetoothIconState()
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/
DBluetoothPairingDetailTest.java77 private BluetoothAdapter mBluetoothAdapter; field in BluetoothPairingDetailTest
93 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in setUp()
95 mBluetoothDevice = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS); in setUp()
97 mFragment.mBluetoothAdapter = mBluetoothAdapter; in setUp()
138 assertThat(mBluetoothAdapter.getScanMode()) in updateContent_stateOn_addDevices()
155 assertThat(mBluetoothAdapter.isEnabled()).isTrue(); in updateBluetooth_bluetoothOff_turnOnBluetooth()
227 final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_B); in onProfileConnectionStateChanged_deviceInSelectedListAndConnected_finish()
242 final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_B); in onProfileConnectionStateChanged_deviceNotInSelectedList_doNothing()
256 final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_B); in onProfileConnectionStateChanged_deviceDisconnected_doNothing()
274 final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS); in onProfileConnectionStateChanged_deviceInPreferenceMapAndConnected_removed()
[all …]
DSavedBluetoothDeviceUpdaterTest.java67 private BluetoothAdapter mBluetoothAdapter; field in SavedBluetoothDeviceUpdaterTest
90 mBluetoothDeviceUpdater.mBluetoothAdapter = mBluetoothAdapter; in setUp()
152 when(mBluetoothAdapter.isEnabled()).thenReturn(true); in forceUpdate_findCachedBluetoothDeviceIsMatched_addPreference()
153 when(mBluetoothAdapter.getMostRecentlyConnectedDevices()).thenReturn(bluetoothDevices); in forceUpdate_findCachedBluetoothDeviceIsMatched_addPreference()
170 when(mBluetoothAdapter.isEnabled()).thenReturn(true); in forceUpdate_findCachedBluetoothDeviceNotMatched_removePreference()
171 when(mBluetoothAdapter.getMostRecentlyConnectedDevices()).thenReturn(bluetoothDevices); in forceUpdate_findCachedBluetoothDeviceNotMatched_removePreference()
187 when(mBluetoothAdapter.isEnabled()).thenReturn(true); in forceUpdate_notFindCachedBluetoothDevice_doNothing()
188 when(mBluetoothAdapter.getMostRecentlyConnectedDevices()).thenReturn(bluetoothDevices); in forceUpdate_notFindCachedBluetoothDevice_doNothing()
206 when(mBluetoothAdapter.isEnabled()).thenReturn(false); in forceUpdate_bluetoothAdapterNotEnable_removeAllDevicesFromPreference()
225 when(mBluetoothAdapter.isEnabled()).thenReturn(true); in forceUpdate_deviceNotContain_removePreference()
[all …]
DAlwaysDiscoverableTest.java42 private BluetoothAdapter mBluetoothAdapter; field in AlwaysDiscoverableTest
48 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in setUp()
73 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in stopWithoutStart()
78 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_NONE); in startSetsModeAndRegistersReceiver()
80 assertThat(mBluetoothAdapter.getScanMode()) in startSetsModeAndRegistersReceiver()
95 assertThat(mBluetoothAdapter.getScanMode()) in resetsToDiscoverableModeWhenScanModeChanges()
101 assertThat(mBluetoothAdapter.getScanMode()) in resetsToDiscoverableModeWhenScanModeChanges()
106 mBluetoothAdapter.setScanMode(newMode); in sendScanModeChangedIntent()
/packages/services/Telecomm/src/com/android/server/telecom/
DBluetoothAdapterProxy.java28 private BluetoothAdapter mBluetoothAdapter; field in BluetoothAdapterProxy
31 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothAdapterProxy()
36 if (mBluetoothAdapter == null) { in getProfileProxy()
39 return mBluetoothAdapter.getProfileProxy(context, listener, profile); in getProfileProxy()
43 if (mBluetoothAdapter == null) { in setActiveDevice()
47 return mBluetoothAdapter.setActiveDevice(device, profiles); in setActiveDevice()
49 return mBluetoothAdapter.removeActiveDevice(profiles); in setActiveDevice()
/packages/apps/Settings/src/com/android/settings/bluetooth/
DAlwaysDiscoverable.java36 private BluetoothAdapter mBluetoothAdapter; field in AlwaysDiscoverable
44 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in AlwaysDiscoverable()
57 if (mBluetoothAdapter.getScanMode() in start()
59 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in start()
69 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in stop()
78 if (mBluetoothAdapter.getScanMode() in onReceive()
80 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in onReceive()
DBluetoothEnabler.java46 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothEnabler
81 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothEnabler()
82 if (mBluetoothAdapter == null) { in BluetoothEnabler()
105 if (mBluetoothAdapter == null) { in resume()
112 handleStateChanged(mBluetoothAdapter.getState()); in resume()
121 if (mBluetoothAdapter == null) { in pause()
186 if (mBluetoothAdapter != null) { in onSwitchToggled()
249 return isEnabled ? mBluetoothAdapter.enable() : mBluetoothAdapter.disable(); in setBluetoothEnabled()
DBluetoothDiscoverableEnabler.java66 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothDiscoverableEnabler
96 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothDiscoverableEnabler()
103 if (mBluetoothAdapter == null) { in resume()
114 handleModeChanged(mBluetoothAdapter.getScanMode()); in resume()
118 if (mBluetoothAdapter == null) { in pause()
140 mBluetoothAdapter in setEnabled()
153 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in setEnabled()
252 handleModeChanged(mBluetoothAdapter.getScanMode()); in setNumberOfPairedDevices()
275 int mode = mBluetoothAdapter.getScanMode(); in updateCountdownSummary()
DBluetoothSummaryUpdater.java41 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothSummaryUpdater
48 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothSummaryUpdater()
63 if (mBluetoothAdapter == null) { in register()
76 if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) { in getSummary()
79 switch (mBluetoothAdapter.getConnectionState()) { in getSummary()
95 final Set<BluetoothDevice> devices = mBluetoothAdapter.getBondedDevices(); in getConnectedDeviceSummary()
DBluetoothDeviceNamePreferenceController.java47 protected BluetoothAdapter mBluetoothAdapter; field in BluetoothDeviceNamePreferenceController
55 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothDeviceNamePreferenceController()
56 if (mBluetoothAdapter == null) { in BluetoothDeviceNamePreferenceController()
83 return mBluetoothAdapter != null ? AVAILABLE : UNSUPPORTED_ON_DEVICE; in getAvailabilityStatus()
130 return mBluetoothAdapter.getName(); in getDeviceName()
144 if (mPreference != null && mBluetoothAdapter != null
145 && mBluetoothAdapter.isEnabled()) {
DLocalDeviceNameDialogFragment.java32 private BluetoothAdapter mBluetoothAdapter; field in LocalDeviceNameDialogFragment
50 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in onCreate()
80 if (mBluetoothAdapter != null && mBluetoothAdapter.isEnabled()) { in getDeviceName()
81 return mBluetoothAdapter.getName(); in getDeviceName()
88 mBluetoothAdapter.setName(deviceName); in setDeviceName()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/bluetooth/
DAlwaysDiscoverable.java36 private BluetoothAdapter mBluetoothAdapter; field in AlwaysDiscoverable
44 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in AlwaysDiscoverable()
57 if (mBluetoothAdapter.getScanMode() in start()
59 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in start()
69 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in stop()
78 if (mBluetoothAdapter.getScanMode() in onReceive()
80 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in onReceive()
DBluetoothEnabler.java46 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothEnabler
81 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothEnabler()
82 if (mBluetoothAdapter == null) { in BluetoothEnabler()
105 if (mBluetoothAdapter == null) { in resume()
112 handleStateChanged(mBluetoothAdapter.getState()); in resume()
121 if (mBluetoothAdapter == null) { in pause()
186 if (mBluetoothAdapter != null) { in onSwitchToggled()
249 return isEnabled ? mBluetoothAdapter.enable() : mBluetoothAdapter.disable(); in setBluetoothEnabled()
DBluetoothDiscoverableEnabler.java66 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothDiscoverableEnabler
96 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothDiscoverableEnabler()
103 if (mBluetoothAdapter == null) { in resume()
114 handleModeChanged(mBluetoothAdapter.getScanMode()); in resume()
118 if (mBluetoothAdapter == null) { in pause()
140 mBluetoothAdapter in setEnabled()
153 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in setEnabled()
252 handleModeChanged(mBluetoothAdapter.getScanMode()); in setNumberOfPairedDevices()
275 int mode = mBluetoothAdapter.getScanMode(); in updateCountdownSummary()
DBluetoothSummaryUpdater.java41 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothSummaryUpdater
48 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothSummaryUpdater()
63 if (mBluetoothAdapter == null) { in register()
76 if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) { in getSummary()
79 switch (mBluetoothAdapter.getConnectionState()) { in getSummary()
95 final Set<BluetoothDevice> devices = mBluetoothAdapter.getBondedDevices(); in getConnectedDeviceSummary()
DBluetoothDeviceNamePreferenceController.java47 protected BluetoothAdapter mBluetoothAdapter; field in BluetoothDeviceNamePreferenceController
55 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothDeviceNamePreferenceController()
56 if (mBluetoothAdapter == null) { in BluetoothDeviceNamePreferenceController()
83 return mBluetoothAdapter != null ? AVAILABLE : UNSUPPORTED_ON_DEVICE; in getAvailabilityStatus()
130 return mBluetoothAdapter.getName(); in getDeviceName()
144 if (mPreference != null && mBluetoothAdapter != null
145 && mBluetoothAdapter.isEnabled()) {
DDeviceListPreferenceFragment.java67 BluetoothAdapter mBluetoothAdapter; field in DeviceListPreferenceFragment
100 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in onCreate()
175 if (mBluetoothAdapter.getState() != BluetoothAdapter.STATE_ON) return; in onDeviceAdded()
215 bidiFormatter.unicodeWrap(mBluetoothAdapter.getAddress()))); in updateFooterPreference()
281 if (!mBluetoothAdapter.isDiscovering()) { in startScanning()
282 mBluetoothAdapter.startDiscovery(); in startScanning()
287 if (mBluetoothAdapter.isDiscovering()) { in stopScanning()
288 mBluetoothAdapter.cancelDiscovery(); in stopScanning()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/network/
DTetherPreferenceController.java62 private final BluetoothAdapter mBluetoothAdapter; field in TetherPreferenceController
86 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in TetherPreferenceController()
95 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in TetherPreferenceController()
128 if (mBluetoothAdapter != null && in onCreate()
129 mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in onCreate()
130 mBluetoothAdapter.getProfileProxy(mContext, mBtProfileServiceListener, in onCreate()
162 if (profile != null && mBluetoothAdapter != null) { in onDestroy()
163 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.PAN, profile); in onDestroy()
209 && mBluetoothAdapter != null in updateSummary()
210 && mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in updateSummary()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DAllInOneTetherPreferenceControllerTest.java118 private BluetoothAdapter mBluetoothAdapter; field in AllInOneTetherPreferenceControllerTest
138 ReflectionHelpers.setField(mController, "mBluetoothAdapter", mBluetoothAdapter); in setUp()
148 when(mBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_ON); in onCreate_shouldInitBluetoothPan()
151 verify(mBluetoothAdapter).getState(); in onCreate_shouldInitBluetoothPan()
152 verify(mBluetoothAdapter).getProfileProxy(mContext, mController.mBtProfileServiceListener, in onCreate_shouldInitBluetoothPan()
158 when(mBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_OFF); in onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
161 verify(mBluetoothAdapter).getState(); in onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
162 verifyNoMoreInteractions(mBluetoothAdapter); in onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
174 verify(mBluetoothAdapter).closeProfileProxy(BluetoothProfile.PAN, pan); in goThroughLifecycle_shouldDestroyBluetoothProfile()
DTetherPreferenceControllerTest.java61 private BluetoothAdapter mBluetoothAdapter; field in TetherPreferenceControllerTest
73 ReflectionHelpers.setField(mController, "mBluetoothAdapter", mBluetoothAdapter); in setUp()
79 when(mBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_ON); in lifeCycle_onCreate_shouldInitBluetoothPan()
82 verify(mBluetoothAdapter).getState(); in lifeCycle_onCreate_shouldInitBluetoothPan()
83 verify(mBluetoothAdapter).getProfileProxy(mContext, mController.mBtProfileServiceListener, in lifeCycle_onCreate_shouldInitBluetoothPan()
89 when(mBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_OFF); in lifeCycle_onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
92 verify(mBluetoothAdapter).getState(); in lifeCycle_onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
93 verifyNoMoreInteractions(mBluetoothAdapter); in lifeCycle_onCreate_shouldNotInitBluetoothPanWhenBluetoothOff()
105 verify(mBluetoothAdapter).closeProfileProxy(BluetoothProfile.PAN, pan); in goThroughLifecycle_shouldDestoryBluetoothProfile()
/packages/apps/Settings/src/com/android/settings/network/
DTetherPreferenceController.java64 private final BluetoothAdapter mBluetoothAdapter; field in TetherPreferenceController
88 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in TetherPreferenceController()
97 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in TetherPreferenceController()
131 if (mBluetoothAdapter != null && in onCreate()
132 mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in onCreate()
133 mBluetoothAdapter.getProfileProxy(mContext, mBtProfileServiceListener, in onCreate()
165 if (profile != null && mBluetoothAdapter != null) { in onDestroy()
166 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.PAN, profile); in onDestroy()
212 && mBluetoothAdapter != null in updateSummary()
213 && mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in updateSummary()
/packages/services/Car/service/src/com/android/car/
DBluetoothDeviceConnectionPolicy.java46 private final BluetoothAdapter mBluetoothAdapter; field in BluetoothDeviceConnectionPolicy
68 if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) {
157 mBluetoothAdapter = Objects.requireNonNull(BluetoothAdapter.getDefaultAdapter()); in BluetoothDeviceConnectionPolicy()
183 if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in init()
227 if (mBluetoothAdapter == null) { in enableBluetooth()
231 mBluetoothAdapter.enable(); in enableBluetooth()
242 if (mBluetoothAdapter == null) { in disableBluetooth()
246 mBluetoothAdapter.disable(false); in disableBluetooth()
DCarBluetoothUserService.java41 private final BluetoothAdapter mBluetoothAdapter; field in CarBluetoothUserService
83 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in CarBluetoothUserService()
84 Objects.requireNonNull(mBluetoothAdapter, "Bluetooth adapter cannot be null"); in CarBluetoothUserService()
107 mBluetoothAdapter.getProfileProxy(mService.getApplicationContext(), in setupBluetoothConnectionProxies()
120 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.A2DP_SINK, mBluetoothA2dpSink); in closeBluetoothConnectionProxies()
124 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.HEADSET_CLIENT, in closeBluetoothConnectionProxies()
129 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.PBAP_CLIENT, mBluetoothPbapClient); in closeBluetoothConnectionProxies()
133 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.MAP_CLIENT, mBluetoothMapClient); in closeBluetoothConnectionProxies()
137 mBluetoothAdapter.closeProfileProxy(BluetoothProfile.PAN, mBluetoothPan); in closeBluetoothConnectionProxies()
222 if (!mBluetoothAdapter.isEnabled()) return false; in isBluetoothConnectionProxyAvailable()
[all …]

1234