/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/ |
D | BluetoothRequestPermissionActivityTest.java | 31 import android.bluetooth.BluetoothAdapter; 100 BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE, DEFAULT_DISCOVERABLE_TIMEOUT)) in setUp() 113 Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISABLE); in onCreate_requestDisableIntent_hasDisableRequestType() 123 Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); in onCreate_requestDiscoverableIntent_hasDiscoverableRequestType() 133 Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); in onCreate_requestDiscoverableIntent_noTimeoutSpecified_hasDefaultTimeout() 143 Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); in onCreate_requestDiscoverableIntent_timeoutSpecified_hasTimeout() 144 intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, in onCreate_requestDiscoverableIntent_timeoutSpecified_hasTimeout() 155 when(mMockLocalBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_ON); in onCreate_requestDiscoverableIntent_bypassforSetup_startsDiscoverableScan() 160 BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE, DEFAULT_DISCOVERABLE_TIMEOUT); in onCreate_requestDiscoverableIntent_bypassforSetup_startsDiscoverableScan() 165 when(mMockLocalBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_TURNING_ON); in onCreate_requestDiscoverableIntent_bypassforSetup_turningOn_noDialog() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
D | BluetoothSummaryUpdaterTest.java | 28 import android.bluetooth.BluetoothAdapter; 71 private final int[] mAdapterConnectionState = {BluetoothAdapter.STATE_DISCONNECTED}; 91 mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); in setUp() 114 mShadowBluetoothAdapter.setConnectionState(BluetoothAdapter.STATE_CONNECTED); in register_true_shouldSendSummaryChange() 128 mShadowBluetoothAdapter.setConnectionState(BluetoothAdapter.STATE_CONNECTED); in onBluetoothStateChanged_btDisabled_shouldSendDisabledSummary() 133 mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF); in onBluetoothStateChanged_btDisabled_shouldSendDisabledSummary() 141 mShadowBluetoothAdapter.setConnectionState(BluetoothAdapter.STATE_CONNECTED); in onBluetoothStateChanged_btEnabled_connected_shouldSendConnectedSummary() 146 mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_ON); in onBluetoothStateChanged_btEnabled_connected_shouldSendConnectedSummary() 155 mShadowBluetoothAdapter.setConnectionState(BluetoothAdapter.STATE_CONNECTED); in onBluetoothStateChanged_btEnabled_connectedMisMatch_shouldSendNotConnected() 161 mSummaryUpdater.onBluetoothStateChanged(BluetoothAdapter.STATE_ON); in onBluetoothStateChanged_btEnabled_connectedMisMatch_shouldSendNotConnected() [all …]
|
D | AlwaysDiscoverableTest.java | 24 import android.bluetooth.BluetoothAdapter; 42 private BluetoothAdapter mBluetoothAdapter; 48 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in setUp() 73 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in stopWithoutStart() 78 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_NONE); in startSetsModeAndRegistersReceiver() 81 .isEqualTo(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in startSetsModeAndRegistersReceiver() 97 .isEqualTo(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in resetsToDiscoverableModeWhenScanModeChanges() 99 sendScanModeChangedIntent(BluetoothAdapter.SCAN_MODE_CONNECTABLE, in resetsToDiscoverableModeWhenScanModeChanges() 100 BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in resetsToDiscoverableModeWhenScanModeChanges() 103 .isEqualTo(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in resetsToDiscoverableModeWhenScanModeChanges() [all …]
|
D | BluetoothEnablerTest.java | 29 import android.bluetooth.BluetoothAdapter; 102 mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); in setUp() 205 mShadowBluetoothAdapter.setState(BluetoothAdapter.STATE_OFF); in startWithBluetoothOff_switchIsOff() 213 mShadowBluetoothAdapter.setState(BluetoothAdapter.STATE_ON); in startWithBluetoothOn_switchIsOn() 226 mShadowBluetoothAdapter.setState(BluetoothAdapter.STATE_ON); in bluetoothTurnsOff_switchTurnsOff() 234 Intent turningOff = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED); in bluetoothTurnsOff_switchTurnsOff() 235 turningOff.putExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.STATE_TURNING_OFF); in bluetoothTurnsOff_switchTurnsOff() 237 Intent off = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED); in bluetoothTurnsOff_switchTurnsOff() 238 off.putExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.STATE_OFF); in bluetoothTurnsOff_switchTurnsOff() 251 mShadowBluetoothAdapter.setState(BluetoothAdapter.STATE_OFF); in bluetoothTurnsOn_switchTurnsOn() [all …]
|
D | RequestPermissionActivityTest.kt | 18 import android.bluetooth.BluetoothAdapter 40 bluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()) in setUp() 51 bluetoothAdapter.setState(BluetoothAdapter.STATE_OFF) in requestEnable_whenBluetoothIsOff_showConfirmDialog() 53 createActivity(action = BluetoothAdapter.ACTION_REQUEST_ENABLE) in requestEnable_whenBluetoothIsOff_showConfirmDialog() 63 bluetoothAdapter.setState(BluetoothAdapter.STATE_ON) in requestEnable_whenBluetoothIsOn_doNothing() 65 createActivity(action = BluetoothAdapter.ACTION_REQUEST_ENABLE) in requestEnable_whenBluetoothIsOn_doNothing() 73 bluetoothAdapter.setState(BluetoothAdapter.STATE_OFF) in requestDisable_whenBluetoothIsOff_doNothing() 75 createActivity(action = BluetoothAdapter.ACTION_REQUEST_DISABLE) in requestDisable_whenBluetoothIsOff_doNothing() 83 bluetoothAdapter.setState(BluetoothAdapter.STATE_ON) in requestDisable_whenBluetoothIsOn_showConfirmDialog() 85 createActivity(action = BluetoothAdapter.ACTION_REQUEST_DISABLE) in requestDisable_whenBluetoothIsOn_showConfirmDialog()
|
/packages/apps/Settings/src/com/android/settings/bluetooth/ |
D | RequestPermissionActivity.java | 22 import android.bluetooth.BluetoothAdapter; 68 private BluetoothAdapter mBluetoothAdapter; 99 case BluetoothAdapter.STATE_OFF: in onCreate() 100 case BluetoothAdapter.STATE_TURNING_OFF: in onCreate() 103 case BluetoothAdapter.STATE_ON: in onCreate() 104 case BluetoothAdapter.STATE_TURNING_ON: in onCreate() 126 case BluetoothAdapter.STATE_OFF: in onCreate() 127 case BluetoothAdapter.STATE_TURNING_OFF: in onCreate() 128 case BluetoothAdapter.STATE_TURNING_ON: in onCreate() 153 case BluetoothAdapter.STATE_ON: in onCreate() [all …]
|
D | AlwaysDiscoverable.java | 19 import android.bluetooth.BluetoothAdapter; 36 private BluetoothAdapter mBluetoothAdapter; 44 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in AlwaysDiscoverable() 46 mIntentFilter.addAction(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED); in AlwaysDiscoverable() 59 != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { in start() 60 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in start() 70 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in stop() 76 if (action != BluetoothAdapter.ACTION_SCAN_MODE_CHANGED) { in onReceive() 80 != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { in onReceive() 81 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in onReceive()
|
D | LocalDeviceNameDialogFragment.java | 20 import android.bluetooth.BluetoothAdapter; 32 private BluetoothAdapter mBluetoothAdapter; 38 if (BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED.equals(action) || 39 (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action) && 40 intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) 41 == BluetoothAdapter.STATE_ON)) { 50 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in onCreate() 57 filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); in onResume() 58 filter.addAction(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED); in onResume()
|
D | BluetoothDiscoverableEnabler.java | 19 import android.bluetooth.BluetoothAdapter; 68 private final BluetoothAdapter mBluetoothAdapter; 80 if (BluetoothAdapter.ACTION_SCAN_MODE_CHANGED.equals(intent.getAction())) { 81 int mode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE, 82 BluetoothAdapter.ERROR); 83 if (mode != BluetoothAdapter.ERROR) { 98 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in BluetoothDiscoverableEnabler() 113 IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED); in resume() 142 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in setEnabled() 154 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE); in setEnabled() [all …]
|
/packages/modules/Bluetooth/framework/tests/bumble/src/android/bluetooth/ |
D | DeviceDiscoveryTest.java | 50 private final BluetoothAdapter mAdapter = mManager.getAdapter(); 65 if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(intent.getAction())) { 67 BluetoothAdapter.ACTION_DISCOVERY_STARTED); 68 } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals( 71 BluetoothAdapter.ACTION_DISCOVERY_FINISHED); 83 IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_STARTED); in startDeviceDiscoveryTest() 84 filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); in startDeviceDiscoveryTest() 89 .isEqualTo(BluetoothAdapter.ACTION_DISCOVERY_STARTED); in startDeviceDiscoveryTest() 93 .isEqualTo(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); in startDeviceDiscoveryTest() 103 IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_STARTED); in cancelDeviceDiscoveryTest() [all …]
|
/packages/apps/Settings/tests/legacy_unit/src/com/android/settings/tests/ |
D | BluetoothRequestPermissionTest.java | 20 import android.bluetooth.BluetoothAdapter; 38 BluetoothAdapter mAdapter; 73 mAdapter = BluetoothAdapter.getDefaultAdapter(); in onCreate() 95 filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED); in onCreate() 96 filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); in onCreate() 97 filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); in onCreate() 107 i.setAction(BluetoothAdapter.ACTION_REQUEST_ENABLE); in requestPermission() 110 i.setAction(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); in requestPermission() 113 i.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, timeout); in requestPermission() 152 if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) { [all …]
|
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/bluetooth/ |
D | BluetoothPreferenceControllerTest.java | 32 import android.bluetooth.BluetoothAdapter; 175 BluetoothAdapter.getDefaultAdapter().disable(); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable() 176 getShadowBluetoothAdapter().setState(BluetoothAdapter.STATE_OFF); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable() 186 BluetoothAdapter.getDefaultAdapter().disable(); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneWrite() 187 getShadowBluetoothAdapter().setState(BluetoothAdapter.STATE_OFF); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneWrite() 197 BluetoothAdapter.getDefaultAdapter().disable(); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneRead() 198 getShadowBluetoothAdapter().setState(BluetoothAdapter.STATE_OFF); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneRead() 208 BluetoothAdapter.getDefaultAdapter().disable(); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneHidden() 209 getShadowBluetoothAdapter().setState(BluetoothAdapter.STATE_OFF); in getAvailabilityStatus_adapterDisabled_conditionallyUnavailable_zoneHidden() 218 BluetoothAdapter.getDefaultAdapter().enable(); in getAvailabilityStatus_available() [all …]
|
D | LocalRenameDialogFragmentTest.java | 19 import static android.bluetooth.BluetoothAdapter.EXTRA_LOCAL_NAME; 20 import static android.bluetooth.BluetoothAdapter.STATE_ON; 25 import android.bluetooth.BluetoothAdapter; 59 BluetoothAdapter.getDefaultAdapter().enable(); in setUp() 69 BluetoothAdapter.getDefaultAdapter().setName(NAME); in getDeviceName_adapterEnabled_returnsLocalAdapterName() 76 BluetoothAdapter.getDefaultAdapter().setName(NAME); in getDeviceName_adapterDisabled_returnsNull() 77 BluetoothAdapter.getDefaultAdapter().disable(); in getDeviceName_adapterDisabled_returnsNull() 84 BluetoothAdapter.getDefaultAdapter().setName(NAME); in localNameChangedBroadcast_updatesDeviceName() 89 BluetoothAdapter.getDefaultAdapter().setName(NAME_UPDATED); in localNameChangedBroadcast_updatesDeviceName() 90 Intent intent = new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED); in localNameChangedBroadcast_updatesDeviceName() [all …]
|
D | BluetoothNamePreferenceControllerTest.java | 28 import android.bluetooth.BluetoothAdapter; 73 BluetoothAdapter.getDefaultAdapter().enable(); in setUp() 74 getShadowBluetoothAdapter().setState(BluetoothAdapter.STATE_ON); in setUp() 90 BluetoothAdapter.getDefaultAdapter().setName(NAME); in refreshUi_setsNameAsSummary() 116 BluetoothAdapter.getDefaultAdapter().setName(NAME); in started_localNameChangedBroadcast_updatesSummary() 120 BluetoothAdapter.getDefaultAdapter().setName(NAME_UPDATED); in started_localNameChangedBroadcast_updatesSummary() 122 new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)); in started_localNameChangedBroadcast_updatesSummary() 129 BluetoothAdapter.getDefaultAdapter().setName(NAME); in stopped_noUpdateOnLocalNameChangedBroadcast() 134 BluetoothAdapter.getDefaultAdapter().setName(NAME_UPDATED); in stopped_noUpdateOnLocalNameChangedBroadcast() 136 new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)); in stopped_noUpdateOnLocalNameChangedBroadcast() [all …]
|
/packages/services/Car/service/src/com/android/car/bluetooth/ |
D | FastPairProvider.java | 21 import android.bluetooth.BluetoothAdapter; 56 private final BluetoothAdapter mBluetoothAdapter; 75 if (successful || mScanMode != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { 108 case BluetoothAdapter.ACTION_SCAN_MODE_CHANGED: 109 int newScanMode = intent.getIntExtra(BluetoothAdapter.EXTRA_SCAN_MODE, 110 BluetoothAdapter.ERROR); 120 if (mScanMode == BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { 135 } else if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) { 140 case BluetoothAdapter.ACTION_STATE_CHANGED: 141 int newState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, [all …]
|
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/bluetooth/ |
D | FastPairProviderTest.java | 38 import android.bluetooth.BluetoothAdapter; 130 @Mock BluetoothAdapter mMockBluetoothAdapter; 177 when(mMockBluetoothAdapter.getState()).thenReturn(BluetoothAdapter.STATE_OFF); in setUp() 314 Intent intent = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED); in sendAdapterStateChange() 315 intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState); in sendAdapterStateChange() 316 intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, fromState); in sendAdapterStateChange() 328 Intent intent = new Intent(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED); in sendScanModeChange() 329 intent.putExtra(BluetoothAdapter.EXTRA_SCAN_MODE, mode); in sendScanModeChange() 436 sendAdapterStateChange(BluetoothAdapter.STATE_TURNING_ON, BluetoothAdapter.STATE_OFF); in testReceiveAdapterOn_startGattService() 437 sendAdapterStateChange(BluetoothAdapter.STATE_ON, BluetoothAdapter.STATE_TURNING_ON); in testReceiveAdapterOn_startGattService() [all …]
|
/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/ |
D | BluetoothRequestPermissionActivity.java | 24 import android.bluetooth.BluetoothAdapter; 117 case BluetoothAdapter.STATE_OFF: in onCreate() 118 case BluetoothAdapter.STATE_TURNING_OFF: in onCreate() 122 case BluetoothAdapter.STATE_ON: in onCreate() 123 case BluetoothAdapter.STATE_TURNING_ON: in onCreate() 136 case BluetoothAdapter.STATE_OFF: in onCreate() 137 case BluetoothAdapter.STATE_TURNING_OFF: in onCreate() 141 case BluetoothAdapter.STATE_ON: in onCreate() 142 case BluetoothAdapter.STATE_TURNING_ON: in onCreate() 153 case BluetoothAdapter.STATE_OFF: in onCreate() [all …]
|
D | BluetoothStateSwitchPreferenceController.java | 25 import android.bluetooth.BluetoothAdapter; 53 BluetoothAdapter.ACTION_STATE_CHANGED); 57 int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); 61 private final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); 90 updateSwitchPreference(mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON in updateState() 91 || mBluetoothAdapter.getState() == BluetoothAdapter.STATE_TURNING_ON); in updateState() 178 case BluetoothAdapter.STATE_TURNING_ON: in handleStateChanged() 182 case BluetoothAdapter.STATE_ON: in handleStateChanged() 186 case BluetoothAdapter.STATE_TURNING_OFF: in handleStateChanged() 190 case BluetoothAdapter.STATE_OFF: in handleStateChanged() [all …]
|
/packages/modules/Bluetooth/android/app/src/com/android/bluetooth/avrcpcontroller/ |
D | AvrcpControllerNativeInterface.java | 19 import android.bluetooth.BluetoothAdapter; 123 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in onConnectionStateChanged() 138 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in getRcPsm() 146 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in handlePlayerAppSetting() 154 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in onPlayerAppSettingChanged() 162 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in handleSetAbsVolume() 170 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in handleRegisterNotificationAbsVol() 178 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in onTrackChanged() 186 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in onPlayPositionChanged() 194 BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address); in onPlayStatusChanged() [all …]
|
/packages/apps/Settings/src/com/android/settings/network/tether/ |
D | TetherSettings.java | 28 import android.bluetooth.BluetoothAdapter; 165 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in onCreate() 174 new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)); in onCreate() 232 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in onDestroy() 287 if (TextUtils.equals(action, BluetoothAdapter.ACTION_STATE_CHANGED)) { in onReceive() 289 intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); in onReceive() 290 Log.i(TAG, "onReceive: state: " + BluetoothAdapter.nameForState(state)); in onReceive() 293 case BluetoothAdapter.STATE_ON: in onReceive() 294 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); in onReceive() 335 } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { in onReceive() [all …]
|
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/btservice/ |
D | ProfileServiceTest.java | 24 import android.bluetooth.BluetoothAdapter; 187 setAllProfilesState(BluetoothAdapter.STATE_ON, 1); in testEnableDisable() 188 setAllProfilesState(BluetoothAdapter.STATE_OFF, 1); in testEnableDisable() 196 setAllProfilesState(BluetoothAdapter.STATE_ON, 1); in testEnableDisableTwice() 197 setAllProfilesState(BluetoothAdapter.STATE_OFF, 1); in testEnableDisableTwice() 198 setAllProfilesState(BluetoothAdapter.STATE_ON, 2); in testEnableDisableTwice() 199 setAllProfilesState(BluetoothAdapter.STATE_OFF, 2); in testEnableDisableTwice() 215 setProfileState(profile, BluetoothAdapter.STATE_ON); in testEnableDisableInterleaved() 216 setProfileState(profile, BluetoothAdapter.STATE_OFF); in testEnableDisableInterleaved() 221 .onProfileServiceStateChanged(starts.capture(), eq(BluetoothAdapter.STATE_ON)); in testEnableDisableInterleaved() [all …]
|
/packages/modules/Bluetooth/android/app/src/com/android/bluetooth/btservice/ |
D | AdapterProperties.java | 28 import android.bluetooth.BluetoothAdapter; 113 private volatile int mConnectionState = BluetoothAdapter.STATE_DISCONNECTED; 114 private volatile int mState = BluetoothAdapter.STATE_OFF; 122 private BluetoothAdapter mAdapter; 222 mAdapter = BluetoothAdapter.getDefaultAdapter(); in AdapterProperties() 298 BluetoothAdapter.invalidateGetProfileConnectionStateCache(); in invalidateGetProfileConnectionStateCache() 302 BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); in invalidateIsOffloadedFilteringSupportedCache() 311 BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); in invalidateGetConnectionStateCache() 419 debugLog("Setting state to " + BluetoothAdapter.nameForState(state)); in setState() 814 new Intent(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED) in updateOnProfileConnectionChanged() [all …]
|
D | AdapterState.java | 19 import android.bluetooth.BluetoothAdapter; 78 private int mPrevState = BluetoothAdapter.STATE_OFF; 158 Log.i(TAG, BluetoothAdapter.nameForState(getStateValue()) + " : " + msg); in infoLog() 162 Log.e(TAG, BluetoothAdapter.nameForState(getStateValue()) + " : " + msg); in errorLog() 170 return BluetoothAdapter.STATE_OFF; in getStateValue() 181 if (prevState == BluetoothAdapter.STATE_BLE_TURNING_OFF) { in enter() 205 return BluetoothAdapter.STATE_BLE_ON; in getStateValue() 231 return BluetoothAdapter.STATE_ON; in getStateValue() 253 return BluetoothAdapter.STATE_BLE_TURNING_ON; in getStateValue() 297 return BluetoothAdapter.STATE_TURNING_ON; in getStateValue() [all …]
|
/packages/modules/Bluetooth/android/app/src/com/android/bluetooth/ |
D | ObexServerSockets.java | 18 import android.bluetooth.BluetoothAdapter; 79 BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, in create() 80 BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, in create() 96 BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, in createInsecure() 97 BluetoothAdapter.SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, in createInsecure() 120 BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter(); in create() 157 if ((state != BluetoothAdapter.STATE_TURNING_ON) in create() 158 && (state != BluetoothAdapter.STATE_ON)) { in create() 234 BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter(); in onAcceptFailed() 235 if ((mAdapter != null) && (mAdapter.getState() == BluetoothAdapter.STATE_ON)) { in onAcceptFailed()
|
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/accessories/ |
D | BluetoothRequestPermissionActivity.java | 21 import android.bluetooth.BluetoothAdapter; 41 private BluetoothAdapter mBluetoothAdapter; 48 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in onCreate() 78 mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE); in proceedAndFinish() 89 if (intent.getAction().equals(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE) in parseIntent() 90 || intent.getAction().equals(BluetoothAdapter.ACTION_REQUEST_ENABLE)) { in parseIntent() 91 mTimeoutSeconds = intent.getIntExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, in parseIntent() 100 + BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); in parseIntent()
|