ParanoidSystemUI: BluetoothDialog: Don't ever show non paired devices

Hppens right after we forget a device.
It also annoyingly shows first in the list

Change-Id: Ia641e8d15043a303d769ba6968590d864523b647
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
This commit is contained in:
Ido Ben-Hur 2023-12-16 15:35:53 +02:00 committed by Adithya R
parent dff5d308a3
commit b50ecb0639
1 changed files with 4 additions and 1 deletions

View File

@ -279,7 +279,10 @@ public class BluetoothDialog extends SystemUIDialog implements Window.Callback {
if (devices == null) return null;
if (devices.size() <= 1) return devices;
Collection<CachedBluetoothDevice> sorted = new ArrayList<>();
devices.stream().sorted(new BtDeviceComparator()).forEach(sorted::add);
devices.stream().sorted(new BtDeviceComparator()).forEach(device -> {
if (device.getDevice().getBondState() != BluetoothDevice.BOND_NONE)
sorted.add(device);
});
return sorted;
}