[Temp bonding] Hide temp bond devices from existing lists

The metadata change listener will be added in later changes.

Test: atest: com.android.settings.bluetooth.ConnectedBluetoothDeviceUpdaterTest
Bug: 362859132
Flag: com.android.settingslib.flags.enable_temporary_bond_devices_ui
Change-Id: I3ba5a978ce66e748fc1a7666fa4f6e84144c2c54
This commit is contained in:
Ze Li
2024-12-31 16:17:12 +08:00
parent 12df61328a
commit 440de09d47
4 changed files with 45 additions and 0 deletions

View File

@@ -57,6 +57,14 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
@Override
public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) {
// If the device is temporary bond, it shouldn't be shown here.
if (Flags.enableTemporaryBondDevicesUi()
&& BluetoothUtils.isTemporaryBondDevice(cachedDevice.getDevice())) {
Log.d(TAG,
"isFilterMatched() Filter out temporary bond device " + cachedDevice.getName());
return false;
}
final int currentAudioProfile;
if (mAudioMode == AudioManager.MODE_RINGTONE