bluetooth: do not try to enable rfkilled devices

Bluez will not do this and reports a property change failure.
This commit is contained in:
outfoxxed 2025-07-26 17:02:35 -07:00
parent 91c9db581e
commit 1644ed5e19
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -53,6 +53,12 @@ QString BluetoothAdapter::adapterId() const {
void BluetoothAdapter::setEnabled(bool enabled) {
if (enabled == this->bEnabled) return;
if (enabled && this->bState == BluetoothAdapterState::Blocked) {
qCCritical(logAdapter) << "Cannot enable adapter because it is blocked by rfkill.";
return;
}
this->bEnabled = enabled;
this->pEnabled.write();
}