/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/bluetooth/ |
H A D | CachedBluetoothDeviceManager.java | 56 cachedDevice.setJustDiscovered(false); in onDeviceDisappeared() 62 if (cachedDevice != null) { in onDeviceNameUpdated() 63 cachedDevice.refreshName(); in onDeviceNameUpdated() 79 if (cachedDevice.getDevice().equals(device)) { in findDevice() 80 return cachedDevice; in findDevice() 167 if (cachedDevice != null && cachedDevice.getName() != null) { in getName() 168 return cachedDevice.getName(); in getName() 181 mCachedDevices.removeIf(cachedDevice in clearNonBondedDevices() 192 cachedDevice.setSubDevice(null); in clearNonBondedSubDevices() 203 cachedDevice.setJustDiscovered(false); in onScanningStateChanged() [all …]
|
H A D | HearingAidDeviceManager.java | 83 if (cachedDevice.getHiSyncId() == hiSyncId) { in getCachedDevice() 84 return cachedDevice; in getCachedDevice() 99 cachedDevice.setHiSyncId(newHiSyncId); in updateHearingAidsDevices() 116 if (cachedDevice.getHiSyncId() != hiSyncId) { in onHiSyncIdChanged() 134 if (cachedDevice.isConnected()) { in onHiSyncIdChanged() 135 mainDevice = cachedDevice; in onHiSyncIdChanged() 141 subDevice = cachedDevice; in onHiSyncIdChanged() 182 mainDevice = findMainDevice(cachedDevice); in onProfileConnectionStateChangedIfProcessed() 183 if (cachedDevice.getUnpairing()) { in onProfileConnectionStateChangedIfProcessed() 198 cachedDevice.refresh(); in onProfileConnectionStateChangedIfProcessed() [all …]
|
H A D | BluetoothEventManager.java | 181 if (cachedDevice == null) { in readPairedDevices() 217 cachedDevice.onAudioModeChanged(); in dispatchAudioModeChanged() 300 if (cachedDevice == null) { in onReceive() 309 cachedDevice.setRssi(rssi); in onReceive() 340 if (cachedDevice == null) { in onReceive() 403 if (cachedDevice != null) { in onReceive() 404 cachedDevice.refresh(); in onReceive() 412 if (cachedDevice != null) { in onReceive() 413 cachedDevice.onUuidChanged(); in onReceive() 421 if (cachedDevice != null) { in onReceive() [all …]
|
H A D | BluetoothCallback.java | 57 default void onDeviceAdded(CachedBluetoothDevice cachedDevice) {} in onDeviceAdded() argument 64 default void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {} in onDeviceDeleted() argument 76 default void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) {} in onDeviceBondStateChanged() argument 92 default void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {} in onConnectionStateChanged() argument 127 default void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, in onProfileConnectionStateChanged() argument 141 default void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { in onAclConnectionStateChanged() argument
|
H A D | LocalBluetoothProfileManager.java | 272 CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); in onReceive() local 273 if (cachedDevice == null) { in onReceive() 275 cachedDevice = mDeviceManager.addDevice(device); in onReceive() 277 onReceiveInternal(intent, cachedDevice); in onReceive() 295 cachedDevice.setHiSyncId(newHiSyncId); in onReceiveInternal() 299 cachedDevice.onProfileStateChanged(mProfile, newState); in onReceiveInternal() 301 if (!(cachedDevice.getHiSyncId() != BluetoothHearingAid.HI_SYNC_ID_INVALID in onReceiveInternal() 304 cachedDevice.refresh(); in onReceiveInternal() 324 public void onReceiveInternal(Intent intent, CachedBluetoothDevice cachedDevice) { in onReceiveInternal() argument 330 cachedDevice.refresh(); in onReceiveInternal() [all …]
|
H A D | BluetoothUtils.java | 74 CachedBluetoothDevice cachedDevice) { in getBtClassDrawableWithDescription() argument 75 BluetoothClass btClass = cachedDevice.getBtClass(); in getBtClassDrawableWithDescription() 105 List<LocalBluetoothProfile> profiles = cachedDevice.getProfiles(); in getBtClassDrawableWithDescription() 143 CachedBluetoothDevice cachedDevice) { in getBtRainbowDrawableWithDescription() argument 146 cachedDevice); in getBtRainbowDrawableWithDescription() 154 pair.first, cachedDevice.getAddress().hashCode()), pair.second); in getBtRainbowDrawableWithDescription() 181 CachedBluetoothDevice cachedDevice) { in getBtDrawableWithDescription() argument 183 context, cachedDevice); in getBtDrawableWithDescription() 184 final BluetoothDevice bluetoothDevice = cachedDevice.getDevice(); in getBtDrawableWithDescription()
|
/aosp12/packages/apps/Car/Settings/src/com/android/car/settings/bluetooth/ |
H A D | BluetoothDevicesGroupPreferenceController.java | 94 return new BluetoothDevicePreference(getContext(), cachedDevice); in createDevicePreference() 124 for (CachedBluetoothDevice cachedDevice : cachedDevices) { in updateState() 125 if (getDeviceFilter().matches(cachedDevice.getDevice())) { in updateState() 126 addPreference(cachedDevice); in updateState() 128 removePreference(cachedDevice); in updateState() 156 private void addPreference(CachedBluetoothDevice cachedDevice) { in addPreference() argument 157 if (!mPreferenceMap.containsKey(cachedDevice)) { in addPreference() 160 mPreferenceMap.put(cachedDevice, devicePreference); in addPreference() 165 private void removePreference(CachedBluetoothDevice cachedDevice) { in removePreference() argument 166 if (mPreferenceMap.containsKey(cachedDevice)) { in removePreference() [all …]
|
H A D | BluetoothBondedDevicesPreferenceController.java | 95 protected void onDeviceClicked(CachedBluetoothDevice cachedDevice) { in onDeviceClicked() argument 98 BluetoothDeviceDetailsFragment.newInstance(cachedDevice)); in onDeviceClicked() 154 cachedDevice.connect(); in toggleBluetoothConnectivity() 155 } else if (cachedDevice.isConnected()) { in toggleBluetoothConnectivity() 156 cachedDevice.disconnect(); in toggleBluetoothConnectivity() 161 CachedBluetoothDevice cachedDevice = preference.getCachedDevice(); in setButtonsCheckedAndListeners() local 164 if (cachedDevice.isBusy()) { in setButtonsCheckedAndListeners() 175 for (LocalBluetoothProfile profile : cachedDevice.getProfiles()) { in setButtonsCheckedAndListeners() 184 boolean isConnected = cachedDevice.isConnected(); in setButtonsCheckedAndListeners() 192 if (cachedDevice.isBusy()) { in setButtonsCheckedAndListeners() [all …]
|
H A D | BluetoothDevicePickerPreferenceController.java | 104 protected void onDeviceClickedInternal(CachedBluetoothDevice cachedDevice) { in onDeviceClickedInternal() argument 105 mSelectedDevice = cachedDevice; in onDeviceClickedInternal() 106 BluetoothUtils.persistSelectedDeviceInPicker(getContext(), cachedDevice.getAddress()); in onDeviceClickedInternal() 108 if (cachedDevice.getBondState() == BluetoothDevice.BOND_BONDED || !mNeedAuth) { in onDeviceClickedInternal() 109 sendDevicePickedIntent(cachedDevice.getDevice()); in onDeviceClickedInternal() 114 if (cachedDevice.startPairing()) { in onDeviceClickedInternal() 117 BluetoothUtils.showError(getContext(), cachedDevice.getName(), in onDeviceClickedInternal() 139 public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { in onDeviceBondStateChanged() argument 140 super.onDeviceBondStateChanged(cachedDevice, bondState); in onDeviceBondStateChanged() 141 if (bondState == BluetoothDevice.BOND_BONDED && cachedDevice.equals(mSelectedDevice)) { in onDeviceBondStateChanged()
|
H A D | BluetoothDeviceNamePreferenceController.java | 57 CachedBluetoothDevice cachedDevice = getCachedDevice(); in updateState() local 61 cachedDevice); in updateState() 68 if (!cachedDevice.isConnected()) { in updateState() 72 String summaryText = cachedDevice.getCarConnectionSummary(); in updateState() 78 String pairDeviceSummary = getCachedDeviceManager().getSubDeviceSummary(cachedDevice); in updateState() 82 preference.setTitle(cachedDevice.getName()); in updateState()
|
H A D | BluetoothScanningDevicesGroupPreferenceController.java | 61 protected final void onDeviceClicked(CachedBluetoothDevice cachedDevice) { in onDeviceClicked() argument 62 LOG.d("onDeviceClicked: " + cachedDevice); in onDeviceClicked() 64 onDeviceClickedInternal(cachedDevice); in onDeviceClicked() 72 protected abstract void onDeviceClickedInternal(CachedBluetoothDevice cachedDevice); in onDeviceClickedInternal() argument 149 public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { in onDeviceBondStateChanged() argument 150 LOG.d("onDeviceBondStateChanged device: " + cachedDevice + " state: " + bondState); in onDeviceBondStateChanged()
|
H A D | BluetoothUnbondedDevicesPreferenceController.java | 61 protected void onDeviceClickedInternal(CachedBluetoothDevice cachedDevice) { in onDeviceClickedInternal() argument 62 if (cachedDevice.startPairing()) { in onDeviceClickedInternal() 66 cachedDevice.getDevice().setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); in onDeviceClickedInternal() 67 cachedDevice.getDevice().setMessageAccessPermission(BluetoothDevice.ACCESS_ALLOWED); in onDeviceClickedInternal() 69 BluetoothUtils.showError(getContext(), cachedDevice.getName(), in onDeviceClickedInternal()
|
/aosp12/packages/apps/Settings/src/com/android/settings/bluetooth/ |
H A D | BluetoothDeviceUpdater.java | 153 public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { in onDeviceAdded() argument 154 update(cachedDevice); in onDeviceAdded() 162 removePreference(cachedDevice); in onDeviceDeleted() 167 update(cachedDevice); in onDeviceBondStateChanged() 177 update(cachedDevice); in onProfileConnectionStateChanged() 186 update(cachedDevice); in onAclConnectionStateChanged() 243 final BluetoothDevice device = cachedDevice.getDevice(); in addPreference() 264 final BluetoothDevice device = cachedDevice.getDevice(); in removePreference() 309 if (cachedDevice == null) { in isDeviceConnected() 312 final BluetoothDevice device = cachedDevice.getDevice(); in isDeviceConnected() [all …]
|
H A D | SavedBluetoothDeviceUpdater.java | 68 if (cachedDevice != null) { in forceUpdate() 69 update(cachedDevice); in forceUpdate() 82 if (cachedDevice != null) { in removePreferenceIfNecessary() 83 removePreference(cachedDevice); in removePreferenceIfNecessary() 90 public void update(CachedBluetoothDevice cachedDevice) { in update() argument 91 if (isFilterMatched(cachedDevice)) { in update() 95 removePreference(cachedDevice); in update() 100 public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) { in isFilterMatched() argument 101 final BluetoothDevice device = cachedDevice.getDevice(); in isFilterMatched() 103 Log.d(TAG, "isFilterMatched() device name : " + cachedDevice.getName() + in isFilterMatched() [all …]
|
H A D | ConnectedBluetoothDeviceUpdater.java | 54 public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) { in isFilterMatched() argument 69 if (isDeviceConnected(cachedDevice)) { in isFilterMatched() 75 if (cachedDevice.isConnectedHearingAidDevice()) { in isFilterMatched() 87 isFilterMatched = !cachedDevice.isConnectedA2dpDevice(); in isFilterMatched() 90 isFilterMatched = !cachedDevice.isConnectedHfpDevice(); in isFilterMatched() 95 cachedDevice.getName() + ", isFilterMatched : " + isFilterMatched); in isFilterMatched() 102 protected void addPreference(CachedBluetoothDevice cachedDevice) { in addPreference() argument 103 super.addPreference(cachedDevice); in addPreference() 104 final BluetoothDevice device = cachedDevice.getDevice(); in addPreference()
|
H A D | DeviceListPreferenceFragment.java | 143 for (CachedBluetoothDevice cachedDevice : cachedDevices) { in addCachedDevices() 144 onDeviceAdded(cachedDevice); in addCachedDevices() 172 public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { in onDeviceAdded() argument 173 if (mDevicePreferenceMap.get(cachedDevice) != null) { in onDeviceAdded() 180 if (mFilter.matches(cachedDevice.getDevice())) { in onDeviceAdded() 181 createDevicePreference(cachedDevice); in onDeviceAdded() 185 void createDevicePreference(CachedBluetoothDevice cachedDevice) { in createDevicePreference() argument 192 String key = cachedDevice.getDevice().getAddress(); in createDevicePreference() 196 preference = new BluetoothDevicePreference(getPrefContext(), cachedDevice, in createDevicePreference() 205 mDevicePreferenceMap.put(cachedDevice, preference); in createDevicePreference() [all …]
|
H A D | BluetoothPairingDetail.java | 177 public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { in onDeviceBondStateChanged() argument 183 if (mSelectedDevice != null && cachedDevice != null) { in onDeviceBondStateChanged() 184 BluetoothDevice device = cachedDevice.getDevice(); in onDeviceBondStateChanged() 194 public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, in onProfileConnectionStateChanged() argument 201 if (cachedDevice != null && cachedDevice.isConnected()) { in onProfileConnectionStateChanged() 202 final BluetoothDevice device = cachedDevice.getDevice(); in onProfileConnectionStateChanged() 205 } else if (mDevicePreferenceMap.containsKey(cachedDevice)) { in onProfileConnectionStateChanged() 206 onDeviceDeleted(cachedDevice); in onProfileConnectionStateChanged()
|
H A D | AvailableMediaBluetoothDeviceUpdater.java | 54 public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) { in isFilterMatched() argument 69 if (isDeviceConnected(cachedDevice)) { in isFilterMatched() 75 if (cachedDevice.isConnectedHearingAidDevice()) { in isFilterMatched() 86 isFilterMatched = cachedDevice.isConnectedA2dpDevice(); in isFilterMatched() 89 isFilterMatched = cachedDevice.isConnectedHfpDevice(); in isFilterMatched() 94 cachedDevice.getName() + ", isFilterMatched : " + isFilterMatched); in isFilterMatched()
|
/aosp12/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/ |
H A D | BluetoothControllerImpl.java | 334 public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { in onDeviceAdded() argument 335 if (DEBUG) Log.d(TAG, "DeviceAdded=" + cachedDevice.getAddress()); in onDeviceAdded() 336 cachedDevice.registerCallback(this); in onDeviceAdded() 342 public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { in onDeviceDeleted() argument 343 if (DEBUG) Log.d(TAG, "DeviceDeleted=" + cachedDevice.getAddress()); in onDeviceDeleted() 344 mCachedState.remove(cachedDevice); in onDeviceDeleted() 352 mCachedState.remove(cachedDevice); in onDeviceBondStateChanged() 367 Log.d(TAG, "ConnectionStateChanged=" + cachedDevice.getAddress() + " " in onConnectionStateChanged() 370 mCachedState.remove(cachedDevice); in onConnectionStateChanged() 382 mCachedState.remove(cachedDevice); in onProfileConnectionStateChanged() [all …]
|
/aosp12/packages/apps/Car/Settings/src/com/android/car/settings/qc/ |
H A D | PairedBluetoothDevicesWorker.java | 63 public void onDeviceAdded(CachedBluetoothDevice cachedDevice) { in onDeviceAdded() argument 68 public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { in onDeviceDeleted() argument 73 public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { in onDeviceBondStateChanged() argument 78 public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { in onConnectionStateChanged() argument 88 public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, in onProfileConnectionStateChanged() argument
|
H A D | PairedBluetoothDevices.java | 113 for (CachedBluetoothDevice cachedDevice : cachedDevices) { in getQCItem() 115 filteredDevices.add(cachedDevice); in getQCItem() 133 CachedBluetoothDevice cachedDevice = filteredDevices.get(j); in getQCItem() local 135 .setTitle(cachedDevice.getName()) in getQCItem() 136 .setSubtitle(getSubtitle(cachedDevice)) in getQCItem() 138 .addEndItem(createBluetoothButton(cachedDevice, i++)) in getQCItem() 139 .addEndItem(createPhoneButton(cachedDevice, i++)) in getQCItem() 140 .addEndItem(createMediaButton(cachedDevice, i++)) in getQCItem() 163 for (CachedBluetoothDevice cachedDevice : cachedDevices) { in onNotifyChange() 164 if (cachedDevice.getAddress().equals(deviceKey)) { in onNotifyChange() [all …]
|
/aosp12/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
H A D | DevicePickerFragmentTest.java | 73 final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class); in callingPackageIsEqualToLaunchPackage_sendBroadcastToLaunchPackage() local 76 when(cachedDevice.getDevice()).thenReturn(bluetoothDevice); in callingPackageIsEqualToLaunchPackage_sendBroadcastToLaunchPackage() 82 mFragment.onDeviceBondStateChanged(cachedDevice, BluetoothDevice.BOND_BONDED); in callingPackageIsEqualToLaunchPackage_sendBroadcastToLaunchPackage() 92 final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class); in callingPackageIsNotEqualToLaunchPackage_broadcastNotSend() local 95 when(cachedDevice.getDevice()).thenReturn(bluetoothDevice); in callingPackageIsNotEqualToLaunchPackage_broadcastNotSend() 101 mFragment.onDeviceBondStateChanged(cachedDevice, BluetoothDevice.BOND_BONDED); in callingPackageIsNotEqualToLaunchPackage_broadcastNotSend()
|
/aosp12/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/ |
H A D | LocalMediaManagerTest.java | 185 when(cachedDevice.isConnected()).thenReturn(false); in connectDevice_bluetoothDeviceNotConnected_connectBluetoothDevice() 186 when(cachedDevice.isBusy()).thenReturn(false); in connectDevice_bluetoothDeviceNotConnected_connectBluetoothDevice() 191 verify(cachedDevice).connect(); in connectDevice_bluetoothDeviceNotConnected_connectBluetoothDevice() 502 when(cachedDevice.isConnected()).thenReturn(false); in onDeviceAttributesChanged_failingTransferring_shouldResetState() 503 when(cachedDevice.isBusy()).thenReturn(false); in onDeviceAttributesChanged_failingTransferring_shouldResetState() 579 when(cachedDevice.isConnected()).thenReturn(false); in onDeviceListAdded_haveDisconnectedDevice_addDisconnectedDevice() 581 when(cachedDevice.getDevice()).thenReturn(bluetoothDevice); in onDeviceListAdded_haveDisconnectedDevice_addDisconnectedDevice() 611 when(cachedDevice.isConnected()).thenReturn(false); in onDeviceListAdded_transferToDisconnectedBluetooth_verifyConnectDevice() 612 when(cachedDevice.isBusy()).thenReturn(false); in onDeviceListAdded_transferToDisconnectedBluetooth_verifyConnectDevice() 617 verify(cachedDevice).connect(); in onDeviceListAdded_transferToDisconnectedBluetooth_verifyConnectDevice() [all …]
|
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/media/ |
H A D | MediaDeviceUtils.java | 33 public static String getId(CachedBluetoothDevice cachedDevice) { in getId() argument 34 if (cachedDevice.isHearingAidDevice()) { in getId() 35 return Long.toString(cachedDevice.getHiSyncId()); in getId() 37 return cachedDevice.getAddress(); in getId()
|
H A D | LocalMediaManager.java | 164 final CachedBluetoothDevice cachedDevice = in connectDevice() local 166 if (!cachedDevice.isConnected() && !cachedDevice.isBusy()) { in connectDevice() 169 cachedDevice.connect(); in connectDevice() 524 final CachedBluetoothDevice cachedDevice = in buildDisconnectedBluetoothDevice() local 526 if (cachedDevice != null) { in buildDisconnectedBluetoothDevice() 527 if (cachedDevice.getBondState() == BluetoothDevice.BOND_BONDED in buildDisconnectedBluetoothDevice() 528 && !cachedDevice.isConnected() in buildDisconnectedBluetoothDevice() 529 && isA2dpOrHearingAidDevice(cachedDevice)) { in buildDisconnectedBluetoothDevice() 531 cachedBluetoothDeviceList.add(cachedDevice); in buildDisconnectedBluetoothDevice() 541 for (CachedBluetoothDevice cachedDevice : cachedBluetoothDeviceList) { in buildDisconnectedBluetoothDevice() [all …]
|