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:
parent
d4dd159b6e
commit
263a169398
|
@ -275,7 +275,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue