1
0
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:
bbedward
2025-07-18 18:32:29 -04:00
parent 3c7106735c
commit 8d87fca419
2 changed files with 38 additions and 20 deletions

View File

@@ -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();
}
}