Home
last modified time | relevance | path

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

12345678910>>...33

/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/
DA2dpService.java245 public boolean connect(BluetoothDevice device) { in connect() argument
247 Log.d(TAG, "connect(): " + device); in connect()
250 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
251 Log.e(TAG, "Cannot connect to " + device + " : CONNECTION_POLICY_FORBIDDEN"); in connect()
254 if (!ArrayUtils.contains(mAdapterService.getRemoteUuids(device), in connect()
256 Log.e(TAG, "Cannot connect to " + device + " : Remote does not have A2DP Sink UUID"); in connect()
261 if (!connectionAllowedCheckMaxDevices(device)) { in connect()
269 if (sink.equals(device)) { in connect()
270 Log.w(TAG, "Connecting to device " + device + " : disconnect skipped"); in connect()
276 Log.e(TAG, "Cannot connect to " + device + " : too many connected devices"); in connect()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hid/
DHidHostService.java124 for (BluetoothDevice device : mInputDevices.keySet()) { in cleanup()
125 int inputDeviceState = getConnectionState(device); in cleanup()
127 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED); in cleanup()
163 BluetoothDevice device = (BluetoothDevice) msg.obj;
164 Attributable.setAttributionSource(device,
166 if (!connectHidNative(Utils.getByteAddress(device))) {
167 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTING);
168 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED);
171 mTargetDevice = device;
175 BluetoothDevice device = (BluetoothDevice) msg.obj;
[all …]
DHidDeviceService.java99 BluetoothDevice device = msg.obj != null ? (BluetoothDevice) msg.obj : null; in handleMessage() local
100 Attributable.setAttributionSource(device, in handleMessage()
105 Log.d(TAG, "App registered, set device to: " + device); in handleMessage()
106 mHidDevice = device; in handleMessage()
113 mCallback.onAppStatusChanged(device, success); in handleMessage()
155 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
156 Attributable.setAttributionSource(device, in handleMessage()
162 mHidDevice = device; in handleMessage()
165 setAndBroadcastConnectionState(device, state); in handleMessage()
169 mCallback.onConnectionStateChanged(device, state); in handleMessage()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/
DHeadsetClientService.java250 public boolean connect(BluetoothDevice device, AttributionSource source) { in connect() argument
251 Attributable.setAttributionSource(device, source); in connect()
256 return service.connect(device); in connect()
260 public boolean disconnect(BluetoothDevice device, AttributionSource source) { in disconnect() argument
261 Attributable.setAttributionSource(device, source); in disconnect()
266 return service.disconnect(device); in disconnect()
289 public int getConnectionState(BluetoothDevice device, AttributionSource source) { in getConnectionState() argument
290 Attributable.setAttributionSource(device, source); in getConnectionState()
295 return service.getConnectionState(device); in getConnectionState()
299 public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy, in setConnectionPolicy() argument
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/
DHearingAidService.java238 public boolean connect(BluetoothDevice device) { in connect() argument
242 Log.d(TAG, "connect(): " + device); in connect()
244 if (device == null) { in connect()
248 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
251 ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in connect()
253 Log.e(TAG, "Cannot connect to " + device + " : Remote does not have Hearing Aid UUID"); in connect()
257 long hiSyncId = mDeviceHiSyncIdMap.getOrDefault(device, in connect()
269 HearingAidStateMachine smConnect = getOrCreateStateMachine(device); in connect()
271 Log.e(TAG, "Cannot connect to " + device + " : no state machine"); in connect()
277 if (device.equals(storedDevice)) { in connect()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/hfp/
DHeadsetService.java272 private boolean doForStateMachine(BluetoothDevice device, StateMachineTask task) { in doForStateMachine() argument
274 HeadsetStateMachine stateMachine = mStateMachines.get(device); in doForStateMachine()
285 for (BluetoothDevice device : getConnectedDevices()) { in doForEachConnectedStateMachine()
286 task.execute(mStateMachines.get(device)); in doForEachConnectedStateMachine()
304 Objects.requireNonNull(stackEvent.device, in messageFromNative()
307 HeadsetStateMachine stateMachine = mStateMachines.get(stackEvent.device); in messageFromNative()
315 .makeStateMachine(stackEvent.device, in messageFromNative()
318 mStateMachines.put(stackEvent.device, stateMachine); in messageFromNative()
364 BluetoothDevice device =
366 logD("Received BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY, device=" + device
[all …]
DHeadsetStateMachine.java174 private HeadsetStateMachine(BluetoothDevice device, Looper looper, in HeadsetStateMachine() argument
180 mDevice = Objects.requireNonNull(device, "device cannot be null"); in HeadsetStateMachine()
201 static HeadsetStateMachine make(BluetoothDevice device, Looper looper, in make() argument
205 new HeadsetStateMachine(device, looper, headsetService, adapterService, in make()
208 Log.i(TAG, "Created state machine " + stateMachine + " for " + device); in make()
303 void broadcastConnectionState(BluetoothDevice device, int fromState, int toState) { in broadcastConnectionState() argument
304 stateLogD("broadcastConnectionState " + device + ": " + fromState + "->" + toState); in broadcastConnectionState()
305 mHeadsetService.onConnectionStateChangedFromStateMachine(device, fromState, toState); in broadcastConnectionState()
309 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); in broadcastConnectionState()
316 void broadcastAudioState(BluetoothDevice device, int fromState, int toState) { in broadcastAudioState() argument
[all …]
/packages/services/Car/service/src/com/android/car/
DBluetoothProfileDeviceManager.java156 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
159 handleDeviceConnectionStateChange(device, state); in onReceive()
161 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
164 handleDeviceBondStateChange(device, state); in onReceive()
166 BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); in onReceive() local
168 handleDeviceUuidEvent(device, uuids); in onReceive()
190 private void handleDeviceConnectionStateChange(BluetoothDevice device, int state) { in handleDeviceConnectionStateChange() argument
191 logd("Connection state changed [device: " + device + ", state: " in handleDeviceConnectionStateChange()
194 if (isAutoConnecting() && isAutoConnectingDevice(device)) { in handleDeviceConnectionStateChange()
197 if (getProfilePriority(device) >= BluetoothProfile.PRIORITY_ON) { in handleDeviceConnectionStateChange()
[all …]
/packages/modules/adb/
Dtest_device.py44 if self.device.get_prop('ro.debuggable') != '1':
47 was_root = self.device.shell(['id', '-un'])[0].strip() == 'root'
49 self.device.root()
50 self.device.wait()
56 self.device.unroot()
57 self.device.wait()
64 was_root = self.device.shell(['id', '-un'])[0].strip() == 'root'
66 self.device.unroot()
67 self.device.wait()
73 self.device.root()
[all …]
Dbenchmark_device.py26 def lock_min(device): argument
27 device.shell_nocheck(["""
34 def lock_max(device): argument
35 device.shell_nocheck(["""
42 def unlock(device): argument
43 device.shell_nocheck(["""
61 def benchmark_sink(device=None, size_mb=100): argument
62 if device == None:
63 device = adb.get_device()
66 cmd = device.adb_cmd + ["raw", "sink:%d" % (size_mb * 1024 * 1024)]
[all …]
/packages/services/Mtp/src/com/android/mtp/
DMtpManager.java95 final MtpDevice device = new MtpDevice(rawDevice); in openDevice() local
101 if (!device.open(connection)) { in openDevice()
108 device.getStorageIds(), in openDevice()
111 mDevices.put(deviceId, device); in openDevice()
125 for (UsbDevice device : mManager.getDeviceList().values()) { in getDevices()
126 if (!isMtpDevice(device)) { in getDevices()
129 devices.add(createDeviceRecord(device)); in getDevices()
135 final MtpDevice device = getDevice(deviceId); in getObjectInfo() local
136 synchronized (device) { in getObjectInfo()
138 device.getObjectInfo(objectHandle), in getObjectInfo()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/
DPhonePolicy.java184 BluetoothDevice device = in handleMessage() local
187 debugLog("Received ACTION_UUID for device " + device); in handleMessage()
194 processInitProfilePriorities(device, uuidsToSend); in handleMessage()
201 BluetoothDevice device = in handleMessage() local
205 processProfileStateChanged(device, msg.arg1, nextState, prevState); in handleMessage()
220 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
221 Attributable.setAttributionSource(device, in handleMessage()
223 processConnectOtherProfiles(device); in handleMessage()
224 mConnectOtherProfilesDeviceSet.remove(device); in handleMessage()
234 BluetoothDevice device = in handleMessage() local
[all …]
DSilenceDeviceManager.java131 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
132 Attributable.setAttributionSource(device, in handleMessage()
135 handleSilenceDeviceStateChanged(device, state); in handleMessage()
141 BluetoothDevice device = in handleMessage() local
148 addConnectedDevice(device, BluetoothProfile.A2DP); in handleMessage()
149 if (!mSilenceDevices.containsKey(device)) { in handleMessage()
150 mSilenceDevices.put(device, false); in handleMessage()
154 removeConnectedDevice(device, BluetoothProfile.A2DP); in handleMessage()
155 if (!isBluetoothAudioConnected(device)) { in handleMessage()
156 handleSilenceDeviceStateChanged(device, false); in handleMessage()
[all …]
DRemoteDevices.java90 BluetoothDevice device = (BluetoothDevice) msg.obj; in handleMessage() local
91 Attributable.setAttributionSource(device, in handleMessage()
93 if (device != null) { in handleMessage()
94 DeviceProperties prop = getDeviceProperties(device); in handleMessage()
95 sendUuidIntent(device, prop); in handleMessage()
127 private final Predicate<BluetoothDevice> mLocationDenylistPredicate = (device) -> {
128 final MacAddress parsedAddress = MacAddress.fromString(device.getAddress());
133 final String name = Utils.getName(device);
197 DeviceProperties getDeviceProperties(BluetoothDevice device) { in getDeviceProperties() argument
199 return mDevices.get(device.getAddress()); in getDeviceProperties()
[all …]
DAdapterService.java957 int profile, BluetoothDevice device) { in isSupported() argument
988 return mHidDeviceService.getConnectionState(device) in isSupported()
995 return mMapService.getConnectionState(device) == BluetoothProfile.STATE_CONNECTED; in isSupported()
998 return mPbapService.getConnectionState(device) == BluetoothProfile.STATE_CONNECTED; in isSupported()
1025 private boolean isAnyProfileEnabled(BluetoothDevice device) { in isAnyProfileEnabled() argument
1027 if (mA2dpService != null && mA2dpService.getConnectionPolicy(device) in isAnyProfileEnabled()
1031 if (mA2dpSinkService != null && mA2dpSinkService.getConnectionPolicy(device) in isAnyProfileEnabled()
1035 if (mHeadsetService != null && mHeadsetService.getConnectionPolicy(device) in isAnyProfileEnabled()
1039 if (mHeadsetClientService != null && mHeadsetClientService.getConnectionPolicy(device) in isAnyProfileEnabled()
1043 if (mMapClientService != null && mMapClientService.getConnectionPolicy(device) in isAnyProfileEnabled()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DBluetoothProfileDeviceManagerTest.java220 BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address); in makeDeviceList() local
221 if (device == null) continue; in makeDeviceList()
222 devices.add(device); in makeDeviceList()
253 for (BluetoothDevice device : makeDeviceList(devices)) { in setPreconditionsAndStart()
254 mProfileDeviceManager.addDevice(device); in setPreconditionsAndStart()
258 private void mockDeviceAvailability(BluetoothDevice device, boolean available) in mockDeviceAvailability() argument
265 BluetoothDevice device = (BluetoothDevice) arguments[1]; in mockDeviceAvailability()
270 sendConnectionStateChanged(device, state); in mockDeviceAvailability()
275 }).when(mMockProxies).bluetoothConnectToProfile(mProfileId, device); in mockDeviceAvailability()
278 private void captureDevicePriority(BluetoothDevice device) throws Exception { in captureDevicePriority() argument
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/le_audio/
DLeAudioService.java203 public boolean connect(BluetoothDevice device) { in connect() argument
205 Log.d(TAG, "connect(): " + device); in connect()
208 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
209 Log.e(TAG, "Cannot connect to " + device + " : CONNECTION_POLICY_FORBIDDEN"); in connect()
212 ParcelUuid[] featureUuids = mAdapterService.getRemoteUuids(device); in connect()
214 Log.e(TAG, "Cannot connect to " + device + " : Remote does not have LE_AUDIO UUID"); in connect()
218 int groupId = getGroupId(device); in connect()
223 Log.d(TAG, "connect(): " + device + "group id: " + groupId); in connect()
227 LeAudioStateMachine sm = getOrCreateStateMachine(device); in connect()
229 Log.e(TAG, "Ignored connect request for " + device + " : no state machine"); in connect()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/mapclient/
DMapClientService.java99 public synchronized boolean connect(BluetoothDevice device) { in connect() argument
102 if (device == null) { in connect()
108 Log.d(TAG, "MAP connect device: " + device in connect()
111 if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) { in connect()
112 Log.w(TAG, "Connection not allowed: <" + device.getAddress() in connect()
116 MceStateMachine mapStateMachine = mMapInstanceMap.get(device); in connect()
120 addDeviceToMapAndConnect(device); in connect()
127 addDeviceToMapAndConnect(device); in connect()
131 + "Connect request rejected on " + device); in connect()
138 int state = getConnectionState(device); in connect()
[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()
158 public synchronized boolean connect(BluetoothDevice device, int psm) { in connect() argument
159 debug("Connect " + device.getAddress() + ", psm: " + psm); in connect()
160 if (mClients.containsKey(device)) return false; in connect()
161 AvrcpBipClient client = new AvrcpBipClient(device, psm, new BipClientCallback(device)); in connect()
162 mClients.put(device, client); in connect()
163 mBipSessions.put(device, new AvrcpBipSession(device)); in connect()
173 public synchronized boolean refreshSession(BluetoothDevice device) { in refreshSession() argument
[all …]
DAvrcpControllerService.java116 public void onImageDownloadComplete(BluetoothDevice device, in onImageDownloadComplete() argument
119 Log.d(TAG, "Image downloaded [device: " + device + ", uuid: " + event.getUuid() in onImageDownloadComplete()
122 AvrcpControllerStateMachine stateMachine = getStateMachine(device); in onImageDownloadComplete()
124 Log.e(TAG, "No state machine found for device " + device); in onImageDownloadComplete()
125 mCoverArtManager.removeImage(device, event.getUuid()); in onImageDownloadComplete()
189 private boolean setActiveDevice(BluetoothDevice device) { in setActiveDevice() argument
196 if ((device == null && currentActiveDevice == null) in setActiveDevice()
197 || (device != null && device.equals(currentActiveDevice))) { in setActiveDevice()
203 if (a2dpSinkService.setActiveDevice(device)) { in setActiveDevice()
204 mActiveDevice = device; in setActiveDevice()
[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/avrcp/
DAvrcpVolumeManager.java76 private void switchVolumeDevice(@NonNull BluetoothDevice device) { in switchVolumeDevice() argument
78 d("switchVolumeDevice: Set Absolute volume support to " + mDeviceMap.get(device)); in switchVolumeDevice()
79 mAudioManager.avrcpSupportsAbsoluteVolume(device.getAddress(), mDeviceMap.get(device)); in switchVolumeDevice()
82 int savedVolume = getVolume(device, sNewDeviceVolume); in switchVolumeDevice()
87 if (mDeviceMap.get(device)) { in switchVolumeDevice()
91 mNativeInterface.sendVolumeChanged(device.getAddress(), avrcpVolume); in switchVolumeDevice()
125 synchronized void storeVolumeForDevice(@NonNull BluetoothDevice device, int storeVolume) { in storeVolumeForDevice() argument
126 if (device.getBondState() != BluetoothDevice.BOND_BONDED) { in storeVolumeForDevice()
131 + device + " : " + storeVolume); in storeVolumeForDevice()
132 mVolumeMap.put(device, storeVolume); in storeVolumeForDevice()
[all …]
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/accessories/
DBluetoothDevicesService.java68 for (BluetoothDevice device : getDevices()) { in addListener()
69 if (device.isConnected()) { in addListener()
70 listener.onDeviceUpdated(device); in addListener()
82 public void connectDevice(BluetoothDevice device) { in connectDevice() argument
83 BluetoothDevicesService.this.connectDevice(device); in connectDevice()
87 public void disconnectDevice(BluetoothDevice device) { in disconnectDevice() argument
88 BluetoothDevicesService.this.disconnectDevice(device); in disconnectDevice()
92 public void forgetDevice(BluetoothDevice device) { in forgetDevice() argument
93 BluetoothDevicesService.this.forgetDevice(device); in forgetDevice()
97 public void renameDevice(BluetoothDevice device, String newName) { in renameDevice() argument
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dpsink/
DA2dpSinkService.java120 public boolean setActiveDevice(BluetoothDevice device) { in setActiveDevice() argument
123 if (device != null) { in setActiveDevice()
124 address = Utils.getByteAddress(device); in setActiveDevice()
131 mActiveDevice = device; in setActiveDevice()
150 public void requestAudioFocus(BluetoothDevice device, boolean request) { in requestAudioFocus() argument
170 boolean isA2dpPlaying(BluetoothDevice device) { in isA2dpPlaying() argument
209 public boolean connect(BluetoothDevice device, AttributionSource source) { in connect() argument
210 Attributable.setAttributionSource(device, source); in connect()
215 return service.connect(device); in connect()
219 public boolean disconnect(BluetoothDevice device, AttributionSource source) { in disconnect() argument
[all …]
/packages/modules/Wifi/framework/java/android/net/wifi/p2p/
DWifiP2pDeviceList.java54 for (WifiP2pDevice device : devices) { in WifiP2pDeviceList()
55 if (device.deviceAddress != null) { in WifiP2pDeviceList()
56 mDevices.put(device.deviceAddress, new WifiP2pDevice(device)); in WifiP2pDeviceList()
61 private void validateDevice(WifiP2pDevice device) { in validateDevice() argument
62 if (device == null) throw new IllegalArgumentException("Null device"); in validateDevice()
63 if (TextUtils.isEmpty(device.deviceAddress)) { in validateDevice()
88 public void update(WifiP2pDevice device) { in update() argument
89 updateSupplicantDetails(device); in update()
90 mDevices.get(device.deviceAddress).status = device.status; in update()
94 public void updateSupplicantDetails(WifiP2pDevice device) { in updateSupplicantDetails() argument
[all …]

12345678910>>...33