Home
last modified time | relevance | path

Searched refs:BluetoothAdapter (Results 1 – 25 of 99) sorted by relevance

1234

/frameworks/base/core/tests/bluetoothtests/src/android/bluetooth/
DBluetoothRebootStressTest.java54 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in testStart()
64 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in testMiddleNoToggle()
75 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in testMiddleToggle()
88 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in testStop()
DBluetoothTestUtils.java108 if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(intent.getAction())) { in onReceive()
110 } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(intent.getAction())) { in onReceive()
112 } else if (BluetoothAdapter.ACTION_SCAN_MODE_CHANGED.equals(intent.getAction())) { in onReceive()
113 int mode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE, -1); in onReceive()
116 case BluetoothAdapter.SCAN_MODE_NONE: in onReceive()
119 case BluetoothAdapter.SCAN_MODE_CONNECTABLE: in onReceive()
122 case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: in onReceive()
126 } else if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) { in onReceive()
127 int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1); in onReceive()
130 case BluetoothAdapter.STATE_OFF: in onReceive()
[all …]
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/
DLocalBluetoothAdapter.java19 import android.bluetooth.BluetoothAdapter;
46 private final BluetoothAdapter mAdapter;
52 private int mState = BluetoothAdapter.ERROR;
58 private LocalBluetoothAdapter(BluetoothAdapter adapter) { in LocalBluetoothAdapter()
74 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in getInstance()
209 if (state == BluetoothAdapter.STATE_ON) { in setBluetoothStateInt()
235 ? BluetoothAdapter.STATE_TURNING_ON in setBluetoothEnabled()
236 : BluetoothAdapter.STATE_TURNING_OFF); in setBluetoothEnabled()
DBluetoothEventManager.java20 import android.bluetooth.BluetoothAdapter;
90 addHandler(BluetoothAdapter.ACTION_STATE_CHANGED, new AdapterStateChangedHandler()); in BluetoothEventManager()
92 addHandler(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED, in BluetoothEventManager()
96 … addHandler(BluetoothAdapter.ACTION_DISCOVERY_STARTED, new ScanningStateChangedHandler(true)); in BluetoothEventManager()
97 … addHandler(BluetoothAdapter.ACTION_DISCOVERY_FINISHED, new ScanningStateChangedHandler(false)); in BluetoothEventManager()
275 int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, in onReceive()
276 BluetoothAdapter.ERROR); in onReceive()
339 int state = intent.getIntExtra(BluetoothAdapter.EXTRA_CONNECTION_STATE, in onReceive()
340 BluetoothAdapter.ERROR); in onReceive()
500 state = BluetoothAdapter.STATE_CONNECTED; in onReceive()
[all …]
DBluetoothDiscoverableTimeoutReceiver.java22 import android.bluetooth.BluetoothAdapter;
79 localBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { in onReceive()
81 localBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in onReceive()
/frameworks/base/services/core/java/com/android/server/
DBluetoothManagerService.java23 import android.bluetooth.BluetoothAdapter;
272 int st = BluetoothAdapter.STATE_OFF;
286 "Airplane Mode change - current state: " + BluetoothAdapter.nameForState(
294 if (st == BluetoothAdapter.STATE_BLE_ON) {
310 } else if (st == BluetoothAdapter.STATE_ON) {
327 if (BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED.equals(action)) {
328 String newName = intent.getStringExtra(BluetoothAdapter.EXTRA_LOCAL_NAME);
335 } else if (BluetoothAdapter.ACTION_BLUETOOTH_ADDRESS_CHANGED.equals(action)) {
336 String newAddress = intent.getStringExtra(BluetoothAdapter.EXTRA_BLUETOOTH_ADDRESS);
387 mState = BluetoothAdapter.STATE_OFF; in BluetoothManagerService()
[all …]
DBluetoothService.java19 import android.bluetooth.BluetoothAdapter;
47 publishBinderService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE, in onBootPhase()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/deviceinfo/
DAbstractBluetoothAddressPreferenceController.java20 import android.bluetooth.BluetoothAdapter;
41 BluetoothAdapter.ACTION_STATE_CHANGED
52 return BluetoothAdapter.getDefaultAdapter() != null; in isAvailable()
75 BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter(); in updateConnectivity()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/
DBluetoothControllerImplTest.java27 import android.bluetooth.BluetoothAdapter;
90 when(mMockAdapter.getConnectionState()).thenReturn(BluetoothAdapter.STATE_DISCONNECTED); in testNoConnectionWithDevices()
93 BluetoothAdapter.STATE_DISCONNECTED); in testNoConnectionWithDevices()
173 when(mMockAdapter.getConnectionState()).thenReturn(BluetoothAdapter.STATE_CONNECTING); in testOnServiceConnected_updatesConnectionState()
183 mBluetoothControllerImpl.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF); in testOnBluetoothStateChange_updatesBluetoothState()
185 assertEquals(BluetoothAdapter.STATE_OFF, mBluetoothControllerImpl.getBluetoothState()); in testOnBluetoothStateChange_updatesBluetoothState()
187 mBluetoothControllerImpl.onBluetoothStateChanged(BluetoothAdapter.STATE_ON); in testOnBluetoothStateChange_updatesBluetoothState()
189 assertEquals(BluetoothAdapter.STATE_ON, mBluetoothControllerImpl.getBluetoothState()); in testOnBluetoothStateChange_updatesBluetoothState()
195 BluetoothAdapter.STATE_CONNECTING, in testOnBluetoothStateChange_updatesConnectionState()
196 BluetoothAdapter.STATE_DISCONNECTED); in testOnBluetoothStateChange_updatesConnectionState()
[all …]
/frameworks/base/core/tests/hosttests/test-apps/ExternalSharedPermsBT/src/com/android/framework/externalsharedpermsbttestapp/
DExternalSharedPermsBTTest.java18 import android.bluetooth.BluetoothAdapter;
32 BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in testRunBluetooth()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/
DBluetoothControllerImpl.java23 import android.bluetooth.BluetoothAdapter;
68 private int mConnectionState = BluetoothAdapter.STATE_DISCONNECTED;
116 case BluetoothAdapter.STATE_CONNECTED: in stateToString()
118 case BluetoothAdapter.STATE_CONNECTING: in stateToString()
120 case BluetoothAdapter.STATE_DISCONNECTED: in stateToString()
122 case BluetoothAdapter.STATE_DISCONNECTING: in stateToString()
170 return mConnectionState == BluetoothAdapter.STATE_CONNECTED; in isBluetoothConnected()
175 return mConnectionState == BluetoothAdapter.STATE_CONNECTING; in isBluetoothConnecting()
233 if (mConnectedDevices.isEmpty() && state == BluetoothAdapter.STATE_CONNECTED) { in updateConnected()
236 state = BluetoothAdapter.STATE_DISCONNECTED; in updateConnected()
[all …]
/frameworks/base/cmds/svc/src/com/android/commands/svc/
DBluetoothCommand.java19 import android.bluetooth.BluetoothAdapter;
43 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in run()
/frameworks/base/core/tests/hosttests/test-apps/ExternalSharedPerms/src/com/android/framework/externalsharedpermstestapp/
DExternalSharedPermsTest.java18 import android.bluetooth.BluetoothAdapter;
48 BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in testRunLocationAndBluetooth()
/frameworks/base/core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/src/com/android/framework/externalsharedpermsdiffkeytestapp/
DExternalSharedPermsDiffKeyTest.java18 import android.bluetooth.BluetoothAdapter;
46 BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in testRunBluetoothAndFineLocation()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/
DBluetoothAddressPreferenceControllerTest.java23 import android.bluetooth.BluetoothAdapter;
59 @Implements(BluetoothAdapter.class)
62 public static BluetoothAdapter getDefaultAdapter() { in getDefaultAdapter()
95 .asList().contains(BluetoothAdapter.ACTION_STATE_CHANGED); in testHasBluetoothStateChangedFilter()
/frameworks/base/core/java/android/bluetooth/
DBluetoothPbapClient.java50 private BluetoothAdapter mAdapter;
67 mAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothPbapClient()
228 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in isEnabled()
229 if (adapter != null && adapter.getState() == BluetoothAdapter.STATE_ON) { in isEnabled()
237 return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); in isValidDevice()
DBluetoothSap.java90 private BluetoothAdapter mAdapter;
105 mAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothSap()
355 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in isEnabled()
357 if (adapter != null && adapter.getState() == BluetoothAdapter.STATE_ON) { in isEnabled()
365 return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); in isValidDevice()
DBluetoothMap.java52 private BluetoothAdapter mAdapter;
67 mAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothMap()
330 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in isEnabled()
331 if (adapter != null && adapter.getState() == BluetoothAdapter.STATE_ON) return true; in isEnabled()
336 return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); in isValidDevice()
DBluetoothAdapter.java109 public final class BluetoothAdapter { class
640 private static BluetoothAdapter sAdapter;
692 public static synchronized BluetoothAdapter getDefaultAdapter() { in getDefaultAdapter()
697 sAdapter = new BluetoothAdapter(managerService); in getDefaultAdapter()
708 BluetoothAdapter(IBluetoothManager managerService) { in BluetoothAdapter() method in BluetoothAdapter
859 Log.d(TAG, "isLeEnabled(): " + BluetoothAdapter.nameForState(state)); in isLeEnabled()
861 return (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_BLE_ON); in isLeEnabled()
896 if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_BLE_ON) { in disableBLE()
985 int state = BluetoothAdapter.STATE_OFF; in getState()
999 if (state == BluetoothAdapter.STATE_BLE_ON || state == BluetoothAdapter.STATE_BLE_TURNING_ON in getState()
[all …]
DBluetoothAvrcpController.java79 private BluetoothAdapter mAdapter;
95 mAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothAvrcpController()
235 return mAdapter.getState() == BluetoothAdapter.STATE_ON; in isEnabled()
239 return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); in isValidDevice()
DBluetoothMapClient.java75 private BluetoothAdapter mAdapter;
90 mAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothMapClient()
360 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in isEnabled()
361 if (adapter != null && adapter.getState() == BluetoothAdapter.STATE_ON) return true; in isEnabled()
367 return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); in isValidDevice()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/
DBluetoothEventManagerTest.java25 import android.bluetooth.BluetoothAdapter;
144 BluetoothAdapter.STATE_DISCONNECTED); in dispatchAclConnectionStateChanged_aclDisconnected_shouldDispatchCallback()
156 BluetoothAdapter.STATE_CONNECTED); in dispatchAclConnectionStateChanged_aclConnected_shouldDispatchCallback()
169 BluetoothAdapter.STATE_DISCONNECTED); in dispatchAclConnectionStateChanged_aclDisconnected_shouldNotCallbackSubDevice()
182 BluetoothAdapter.STATE_CONNECTED); in dispatchAclConnectionStateChanged_aclConnected_shouldNotCallbackSubDevice()
195 BluetoothAdapter.STATE_CONNECTED); in dispatchAclConnectionStateChanged_findDeviceReturnNull_shouldNotDispatchCallback()
/frameworks/opt/telephony/src/java/com/android/internal/telephony/
DBtSmsInterfaceManager.java22 import android.bluetooth.BluetoothAdapter;
45 BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter(); in sendText()
108 BluetoothAdapter.getDefaultAdapter() in onServiceConnected()
/frameworks/base/core/tests/bluetoothtests/src/android/bluetooth/le/
DScanResultTest.java19 import android.bluetooth.BluetoothAdapter;
39 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice( in testScanResultParceling()
/frameworks/base/services/core/java/com/android/server/deviceidle/
DBluetoothConstraint.java19 import android.bluetooth.BluetoothAdapter;
68 filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); in startMonitoring()
112 BluetoothAdapter adapter = bluetoothManager.getAdapter(); in isBluetoothConnected()

1234