Skip to content

Commit 1644ed5

Browse files
committed
bluetooth: do not try to enable rfkilled devices
Bluez will not do this and reports a property change failure.
1 parent 91c9db5 commit 1644ed5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bluetooth/adapter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ QString BluetoothAdapter::adapterId() const {
5353

5454
void BluetoothAdapter::setEnabled(bool enabled) {
5555
if (enabled == this->bEnabled) return;
56+
57+
if (enabled && this->bState == BluetoothAdapterState::Blocked) {
58+
qCCritical(logAdapter) << "Cannot enable adapter because it is blocked by rfkill.";
59+
return;
60+
}
61+
5662
this->bEnabled = enabled;
5763
this->pEnabled.write();
5864
}

0 commit comments

Comments
 (0)