[PATCH BlueZ 2/3] device: Hide WakeAllowed when adapter cannot wake
Matthew Schwartz <[email protected]> Sat, 25 Jul 2026 13:18:55 -0700
| Newsgroups | org.kernel.vger.linux-bluetooth |
|---|---|
| Message-ID | <[email protected]> |
dev_property_wake_allowed_exist() only checks whether the device has a
profile that supports wake configuration (HID/HoG), so WakeAllowed is
exposed on every input device even when the host controller cannot or
will not wake the system.
Gate the property on btd_adapter_may_wake() as well. The remote
wakeup device flag itself remains settable through mgmt and is still
stored. The kernel independently ignores it during suspend when the
controller may not wake the host, and the stored preference reapplies
once wakeup is enabled again. No PropertiesChanged signal is emitted
when the sysfs attribute changes, so clients observe the state that
is current at the time they query the property.
Assisted-by: Claude:claude-fable-5
---
src/device.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/device.c b/src/device.c
index 65d84be56..697baf628 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1839,7 +1839,10 @@ static gboolean dev_property_wake_allowed_exist(
{
struct btd_device *device = data;
- return device_get_wake_support(device);
+ if (!device_get_wake_support(device))
+ return FALSE;
+
+ return btd_adapter_may_wake(device->adapter);
}
static void append_set(void *data, void *user_data)
--
2.55.0