Home
last modified time | relevance | path

Searched refs:device (Results 1 – 25 of 558) sorted by relevance

12345678910>>...23

/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/
DA2dpService.java240 public boolean connect(BluetoothDevice device) { in connect() argument
243 Log.d(TAG, "connect(): " + device); in connect()
246 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
247 Log.e(TAG, "Cannot connect to " + device + " : CONNECTION_POLICY_FORBIDDEN"); in connect()
250 if (!ArrayUtils.contains(mAdapterService.getRemoteUuids(device), in connect()
252 Log.e(TAG, "Cannot connect to " + device + " : Remote does not have A2DP Sink UUID"); in connect()
257 if (!connectionAllowedCheckMaxDevices(device)) { in connect()
265 if (sink.equals(device)) { in connect()
266 Log.w(TAG, "Connecting to device " + device + " : disconnect skipped"); in connect()
272 Log.e(TAG, "Cannot connect to " + device + " : too many connected devices"); in connect()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/
DHeadsetClientService.java221 public boolean connect(BluetoothDevice device) { in connect() argument
226 return service.connect(device); in connect()
230 public boolean disconnect(BluetoothDevice device) { in disconnect() argument
235 return service.disconnect(device); in disconnect()
257 public int getConnectionState(BluetoothDevice device) { in getConnectionState() argument
262 return service.getConnectionState(device); in getConnectionState()
266 public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy) { in setConnectionPolicy() argument
271 return service.setConnectionPolicy(device, connectionPolicy); in setConnectionPolicy()
275 public int getConnectionPolicy(BluetoothDevice device) { in getConnectionPolicy() argument
280 return service.getConnectionPolicy(device); in getConnectionPolicy()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hid/
DHidHostService.java121 for (BluetoothDevice device : mInputDevices.keySet()) { in cleanup()
122 int inputDeviceState = getConnectionState(device); in cleanup()
124 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED); in cleanup()
160 BluetoothDevice device = (BluetoothDevice) msg.obj;
161 if (!connectHidNative(Utils.getByteAddress(device))) {
162 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTING);
163 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED);
166 mTargetDevice = device;
170 BluetoothDevice device = (BluetoothDevice) msg.obj;
171 if (!disconnectHidNative(Utils.getByteAddress(device))) {
[all …]
DHidDeviceService.java93 BluetoothDevice device = msg.obj != null ? (BluetoothDevice) msg.obj : null; in handleMessage() local
97 Log.d(TAG, "App registered, set device to: " + device); in handleMessage()
98 mHidDevice = device; in handleMessage()
105 mCallback.onAppStatusChanged(device, success); in handleMessage()
147 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
152 mHidDevice = device; in handleMessage()
155 setAndBroadcastConnectionState(device, state); in handleMessage()
159 mCallback.onConnectionStateChanged(device, state); in handleMessage()
342 public boolean sendReport(BluetoothDevice device, int id, byte[] data) { in sendReport() argument
344 Log.d(TAG, "sendReport(): device=" + device + " id=" + id); in sendReport()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/
DHearingAidService.java232 public boolean connect(BluetoothDevice device) { in connect() argument
236 Log.d(TAG, "connect(): " + device); in connect()
238 if (device == null) { in connect()
242 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
245 ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in connect()
247 Log.e(TAG, "Cannot connect to " + device + " : Remote does not have Hearing Aid UUID"); in connect()
251 long hiSyncId = mDeviceHiSyncIdMap.getOrDefault(device, in connect()
263 HearingAidStateMachine smConnect = getOrCreateStateMachine(device); in connect()
265 Log.e(TAG, "Cannot connect to " + device + " : no state machine"); in connect()
271 if (device.equals(storedDevice)) { in connect()
[all …]
/packages/services/Car/service/src/com/android/car/
DBluetoothProfileDeviceManager.java154 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
157 handleDeviceConnectionStateChange(device, state); in onReceive()
159 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
162 handleDeviceBondStateChange(device, state); in onReceive()
164 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
166 handleDeviceUuidEvent(device, uuids); in onReceive()
188 private void handleDeviceConnectionStateChange(BluetoothDevice device, int state) { in handleDeviceConnectionStateChange() argument
189 logd("Connection state changed [device: " + device + ", state: " in handleDeviceConnectionStateChange()
192 if (isAutoConnecting() && isAutoConnectingDevice(device)) { in handleDeviceConnectionStateChange()
195 if (getProfilePriority(device) >= BluetoothProfile.PRIORITY_ON) { in handleDeviceConnectionStateChange()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hfp/
DHeadsetService.java271 private boolean doForStateMachine(BluetoothDevice device, StateMachineTask task) { in doForStateMachine() argument
273 HeadsetStateMachine stateMachine = mStateMachines.get(device); in doForStateMachine()
284 for (BluetoothDevice device : getConnectedDevices()) { in doForEachConnectedStateMachine()
285 task.execute(mStateMachines.get(device)); in doForEachConnectedStateMachine()
303 Objects.requireNonNull(stackEvent.device, in messageFromNative()
306 HeadsetStateMachine stateMachine = mStateMachines.get(stackEvent.device); in messageFromNative()
314 .makeStateMachine(stackEvent.device, in messageFromNative()
317 mStateMachines.put(stackEvent.device, stateMachine); in messageFromNative()
363 BluetoothDevice device =
365 logD("Received BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY, device=" + device
[all …]
DHeadsetStateMachine.java169 private HeadsetStateMachine(BluetoothDevice device, Looper looper, in HeadsetStateMachine() argument
175 mDevice = Objects.requireNonNull(device, "device cannot be null"); in HeadsetStateMachine()
196 static HeadsetStateMachine make(BluetoothDevice device, Looper looper, in make() argument
200 new HeadsetStateMachine(device, looper, headsetService, adapterService, in make()
203 Log.i(TAG, "Created state machine " + stateMachine + " for " + device); in make()
298 void broadcastConnectionState(BluetoothDevice device, int fromState, int toState) { in broadcastConnectionState() argument
299 stateLogD("broadcastConnectionState " + device + ": " + fromState + "->" + toState); in broadcastConnectionState()
300 mHeadsetService.onConnectionStateChangedFromStateMachine(device, fromState, toState); in broadcastConnectionState()
304 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); in broadcastConnectionState()
311 void broadcastAudioState(BluetoothDevice device, int fromState, int toState) { in broadcastAudioState() argument
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DBluetoothProfileDeviceManagerTest.java222 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address); in makeDeviceList() local
223 if (device == null) continue; in makeDeviceList()
224 devices.add(device); in makeDeviceList()
255 for (BluetoothDevice device : makeDeviceList(devices)) { in setPreconditionsAndStart()
256 mProfileDeviceManager.addDevice(device); in setPreconditionsAndStart()
260 private void mockDeviceAvailability(BluetoothDevice device, boolean available) in mockDeviceAvailability() argument
267 BluetoothDevice device = (BluetoothDevice) arguments[1]; in mockDeviceAvailability()
272 sendConnectionStateChanged(device, state); in mockDeviceAvailability()
277 }).when(mMockProxies).bluetoothConnectToProfile(mProfileId, device); in mockDeviceAvailability()
280 private void captureDevicePriority(BluetoothDevice device) throws Exception { in captureDevicePriority() argument
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/
DPhonePolicy.java170 BluetoothDevice device = in handleMessage() local
173 debugLog("Received ACTION_UUID for device " + device); in handleMessage()
180 processInitProfilePriorities(device, uuidsToSend); in handleMessage()
187 BluetoothDevice device = in handleMessage() local
191 processProfileStateChanged(device, msg.arg1, nextState, prevState); in handleMessage()
206 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
207 processConnectOtherProfiles(device); in handleMessage()
208 mConnectOtherProfilesDeviceSet.remove(device); in handleMessage()
218 BluetoothDevice device = in handleMessage() local
220 processDeviceConnected(device); in handleMessage()
[all …]
DSilenceDeviceManager.java125 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
127 handleSilenceDeviceStateChanged(device, state); in handleMessage()
133 BluetoothDevice device = in handleMessage() local
140 addConnectedDevice(device, BluetoothProfile.A2DP); in handleMessage()
141 if (!mSilenceDevices.containsKey(device)) { in handleMessage()
142 mSilenceDevices.put(device, false); in handleMessage()
146 removeConnectedDevice(device, BluetoothProfile.A2DP); in handleMessage()
147 if (!isBluetoothAudioConnected(device)) { in handleMessage()
148 handleSilenceDeviceStateChanged(device, false); in handleMessage()
149 mSilenceDevices.remove(device); in handleMessage()
[all …]
DAdapterService.java824 int profile, BluetoothDevice device) { in isSupported() argument
855 return mHidDeviceService.getConnectionState(device) in isSupported()
862 return mMapService.getConnectionState(device) == BluetoothProfile.STATE_CONNECTED; in isSupported()
865 return mPbapService.getConnectionState(device) == BluetoothProfile.STATE_CONNECTED; in isSupported()
891 private boolean isAnyProfileEnabled(BluetoothDevice device) { in isAnyProfileEnabled() argument
893 if (mA2dpService != null && mA2dpService.getConnectionPolicy(device) in isAnyProfileEnabled()
897 if (mA2dpSinkService != null && mA2dpSinkService.getConnectionPolicy(device) in isAnyProfileEnabled()
901 if (mHeadsetService != null && mHeadsetService.getConnectionPolicy(device) in isAnyProfileEnabled()
905 if (mHeadsetClientService != null && mHeadsetClientService.getConnectionPolicy(device) in isAnyProfileEnabled()
909 if (mMapClientService != null && mMapClientService.getConnectionPolicy(device) in isAnyProfileEnabled()
[all …]
DRemoteDevices.java81 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
82 if (device != null) { in handleMessage()
83 DeviceProperties prop = getDeviceProperties(device); in handleMessage()
84 sendUuidIntent(device, prop); in handleMessage()
168 DeviceProperties getDeviceProperties(BluetoothDevice device) { in getDeviceProperties() argument
170 return mDevices.get(device.getAddress()); in getDeviceProperties()
195 for (BluetoothDevice device : sAdapterService.getBondedDevices()) { in addDeviceProperties()
196 if (device.getAddress().equals(deleteKey)) { in addDeviceProperties()
299 void setAlias(BluetoothDevice device, String mAlias) { in setAlias() argument
305 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); in setAlias()
[all …]
DActiveDeviceManager.java191 BluetoothDevice device = in handleMessage() local
204 + "device " + device + " connected"); in handleMessage()
206 if (mA2dpConnectedDevices.contains(device)) { in handleMessage()
209 mA2dpConnectedDevices.add(device); in handleMessage()
212 setA2dpActiveDevice(device); in handleMessage()
222 + "device " + device + " disconnected"); in handleMessage()
224 mA2dpConnectedDevices.remove(device); in handleMessage()
225 if (Objects.equals(mA2dpActiveDevice, device)) { in handleMessage()
234 BluetoothDevice device = in handleMessage() local
238 + "device= " + device); in handleMessage()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/mapclient/
DMapClientService.java97 public synchronized boolean connect(BluetoothDevice device) { in connect() argument
100 if (device == null) { in connect()
106 Log.d(TAG, "MAP connect device: " + device in connect()
109 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
110 Log.w(TAG, "Connection not allowed: <" + device.getAddress() in connect()
114 MceStateMachine mapStateMachine = mMapInstanceMap.get(device); in connect()
118 addDeviceToMapAndConnect(device); in connect()
125 addDeviceToMapAndConnect(device); in connect()
129 + "Connect request rejected on " + device); in connect()
136 int state = getConnectionState(device); in connect()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hfp/
DHeadsetServiceAndStateMachineTest.java268 BluetoothDevice device = TestUtils.getTestDevice(mAdapter, 0); in testGetHeadsetService() local
270 mHeadsetService.getConnectionState(device)); in testGetHeadsetService()
272 mHeadsetService.getAudioState(device)); in testGetHeadsetService()
281 BluetoothDevice device = TestUtils.getTestDevice(mAdapter, 0); in testConnectFromApi() local
282 when(mDatabaseManager.getProfileConnectionPolicy(device, BluetoothProfile.HEADSET)) in testConnectFromApi()
284 mBondedDevices.add(device); in testConnectFromApi()
285 Assert.assertTrue(mHeadsetService.connect(device)); in testConnectFromApi()
286 verify(mObjectsFactory).makeStateMachine(device, in testConnectFromApi()
292 waitAndVerifyConnectionStateIntent(ASYNC_CALL_TIMEOUT_MILLIS, device, in testConnectFromApi()
294 verify(mNativeInterface).connectHfp(device); in testConnectFromApi()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcpcontroller/
DAvrcpCoverArtManager.java83 void onImageDownloadComplete(BluetoothDevice device, DownloadEvent event); in onImageDownloadComplete() argument
97 AvrcpBipSession(BluetoothDevice device) { in AvrcpBipSession() argument
98 mDevice = device; in AvrcpBipSession()
140 public synchronized boolean connect(BluetoothDevice device, int psm) { in connect() argument
141 debug("Connect " + device.getAddress() + ", psm: " + psm); in connect()
142 if (mClients.containsKey(device)) return false; in connect()
143 AvrcpBipClient client = new AvrcpBipClient(device, psm, new BipClientCallback(device)); in connect()
144 mClients.put(device, client); in connect()
145 mBipSessions.put(device, new AvrcpBipSession(device)); in connect()
155 public synchronized boolean refreshSession(BluetoothDevice device) { in refreshSession() argument
[all …]
DAvrcpControllerService.java103 public void onImageDownloadComplete(BluetoothDevice device, in onImageDownloadComplete() argument
106 Log.d(TAG, "Image downloaded [device: " + device + ", uuid: " + event.getUuid() in onImageDownloadComplete()
109 AvrcpControllerStateMachine stateMachine = getStateMachine(device); in onImageDownloadComplete()
111 Log.e(TAG, "No state machine found for device " + device); in onImageDownloadComplete()
112 mCoverArtManager.removeImage(device, event.getUuid()); in onImageDownloadComplete()
166 protected AvrcpControllerStateMachine newStateMachine(BluetoothDevice device) { in newStateMachine() argument
167 return new AvrcpControllerStateMachine(device, this); in newStateMachine()
170 protected void getCurrentMetadataIfNoCoverArt(BluetoothDevice device) { in getCurrentMetadataIfNoCoverArt() argument
171 if (device == null) return; in getCurrentMetadataIfNoCoverArt()
172 AvrcpControllerStateMachine stateMachine = getStateMachine(device); in getCurrentMetadataIfNoCoverArt()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcp/
DAvrcpVolumeManager.java74 private void switchVolumeDevice(@NonNull BluetoothDevice device) { in switchVolumeDevice() argument
76 d("switchVolumeDevice: Set Absolute volume support to " + mDeviceMap.get(device)); in switchVolumeDevice()
77 mAudioManager.avrcpSupportsAbsoluteVolume(device.getAddress(), mDeviceMap.get(device)); in switchVolumeDevice()
80 int savedVolume = getVolume(device, sNewDeviceVolume); in switchVolumeDevice()
85 if (mDeviceMap.get(device)) { in switchVolumeDevice()
89 mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); in switchVolumeDevice()
123 synchronized void storeVolumeForDevice(@NonNull BluetoothDevice device, int storeVolume) { in storeVolumeForDevice() argument
124 if (device.getBondState() != BluetoothDevice.BOND_BONDED) { in storeVolumeForDevice()
129 + device + " : " + storeVolume); in storeVolumeForDevice()
130 mVolumeMap.put(device, storeVolume); in storeVolumeForDevice()
[all …]
/packages/apps/Car/CompanionDeviceSupport/src/com/android/car/companiondevicesupport/feature/
DLocalFeature.java65 for (ConnectedDevice device : activeUsersDevices) { in start()
66 mConnectedDeviceManager.registerDeviceCallback(device, mFeatureId, in start()
75 for (ConnectedDevice device : mConnectedDeviceManager.getActiveUserConnectedDevices()) { in stop()
76 mConnectedDeviceManager.unregisterDeviceCallback(device, mFeatureId, mDeviceCallback); in stop()
100 ConnectedDevice device = getConnectedDeviceById(deviceId); in sendMessageSecurely() local
101 if (device == null) { in sendMessageSecurely()
108 sendMessageSecurely(device, message); in sendMessageSecurely()
112 public void sendMessageSecurely(@NonNull ConnectedDevice device, byte[] message) { in sendMessageSecurely() argument
113 getConnectedDeviceManager().sendMessageSecurely(device, getFeatureId(), message); in sendMessageSecurely()
118 ConnectedDevice device = getConnectedDeviceById(deviceId); in sendMessageUnsecurely() local
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dpsink/
DA2dpSinkService.java114 public void requestAudioFocus(BluetoothDevice device, boolean request) { in requestAudioFocus() argument
133 boolean isA2dpPlaying(BluetoothDevice device) { in isA2dpPlaying() argument
174 public boolean connect(BluetoothDevice device) { in connect() argument
179 return service.connect(device); in connect()
183 public boolean disconnect(BluetoothDevice device) { in disconnect() argument
188 return service.disconnect(device); in disconnect()
210 public int getConnectionState(BluetoothDevice device) { in getConnectionState() argument
215 return service.getConnectionState(device); in getConnectionState()
219 public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy) { in setConnectionPolicy() argument
224 return service.setConnectionPolicy(device, connectionPolicy); in setConnectionPolicy()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/storage/
DDatabaseManagerTest.java604 ContentValues device = new ContentValues(); in testDatabaseMigration_101_102() local
605 device.put("address", TEST_BT_ADDR); in testDatabaseMigration_101_102()
606 device.put("migrated", false); in testDatabaseMigration_101_102()
607 device.put("a2dpSupportsOptionalCodecs", -1); in testDatabaseMigration_101_102()
608 device.put("a2dpOptionalCodecsEnabled", -1); in testDatabaseMigration_101_102()
609 device.put("a2dp_priority", -1); in testDatabaseMigration_101_102()
610 device.put("a2dp_sink_priority", -1); in testDatabaseMigration_101_102()
611 device.put("hfp_priority", -1); in testDatabaseMigration_101_102()
612 device.put("hfp_client_priority", -1); in testDatabaseMigration_101_102()
613 device.put("hid_host_priority", -1); in testDatabaseMigration_101_102()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/pan/
DPanService.java164 for (BluetoothDevice device : devList) { in cleanup()
165 BluetoothPanDevice panDevice = mPanDevices.get(device); in cleanup()
166 Log.d(TAG, "panDevice: " + panDevice + " device address: " + device); in cleanup()
168 handlePanDeviceStateChange(device, mPanIfName, in cleanup()
182 BluetoothDevice device = (BluetoothDevice) msg.obj;
183 if (!connectPanNative(Utils.getByteAddress(device),
185 handlePanDeviceStateChange(device, null, BluetoothProfile.STATE_CONNECTING,
187 handlePanDeviceStateChange(device, null,
195 BluetoothDevice device = (BluetoothDevice) msg.obj;
196 if (!disconnectPanNative(Utils.getByteAddress(device))) {
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/pbapclient/
DPbapClientService.java116 void cleanupDevice(BluetoothDevice device) { in cleanupDevice() argument
117 if (DBG) Log.d(TAG, "Cleanup device: " + device); in cleanupDevice()
119 PbapClientStateMachine pbapClientStateMachine = mPbapClientStateMachineMap.get(device); in cleanupDevice()
121 mPbapClientStateMachineMap.remove(device); in cleanupDevice()
195 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
196 if (getConnectionState(device) == BluetoothProfile.STATE_CONNECTED) { in onReceive()
197 disconnect(device); in onReceive()
208 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
213 Log.d(TAG, "Received intent to disconnect HFP with " + device); in onReceive()
216 removeHfpCallLog(device.getAddress(), context); in onReceive()
[all …]
/packages/services/Car/car-usb-handler/src/android/car/usb/handler/
DUsbDeviceHandlerResolver.java62 UsbDevice device, List<UsbDeviceSettings> availableSettings); in onHandlersResolveCompleted() argument
99 public void resolve(UsbDevice device) { in resolve() argument
100 mHandler.requestResolveHandlers(device); in resolve()
106 public boolean dispatch(UsbDevice device, ComponentName component, boolean inAoap) { in dispatch() argument
108 Log.d(TAG, "dispatch: " + device + " component: " + component + " inAoap: " + inAoap); in dispatch()
119 Intent intent = createDeviceAttachedIntent(device); in dispatch()
121 if (AoapInterface.isDeviceInAoapMode(device)) { in dispatch()
125 packageMatches(activityInfo, intent.getAction(), device, true); in dispatch()
129 if (mAoapServiceManager.canSwitchDeviceToAoap(device, in dispatch()
131 requestAoapSwitch(device, filter); in dispatch()
[all …]

12345678910>>...23