mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
bluetooth: trust device before connecting
Fixes devices not staying in history
This commit is contained in:
@@ -18,7 +18,7 @@ Singleton {
|
||||
return [];
|
||||
|
||||
return adapter.devices.values.filter((dev) => {
|
||||
return dev && dev.paired;
|
||||
return dev && (dev.paired || dev.trusted);
|
||||
});
|
||||
}
|
||||
readonly property var allDevicesWithBattery: {
|
||||
@@ -158,6 +158,18 @@ Singleton {
|
||||
|
||||
return "signal_cellular_0_bar";
|
||||
}
|
||||
|
||||
function isDeviceBusy(device) {
|
||||
if (!device) return false;
|
||||
return device.pairing || device.state === BluetoothDeviceState.Disconnecting || device.state === BluetoothDeviceState.Connecting;
|
||||
}
|
||||
|
||||
function connectDeviceWithTrust(device) {
|
||||
if (!device) return;
|
||||
|
||||
device.trusted = true;
|
||||
device.connect();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user