device: Support marking a device with wake allowed
authorAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Mon, 6 Jul 2020 20:25:15 +0000 (13:25 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
commit351b08317120ed42d579ba8b6f8c517c30d78a2f
treeb6360982c5769bbe0f78db30533131c3a1b2e06f
parent00d360e4f63a278c2ab09c645ec5f301612ad9cf
device: Support marking a device with wake allowed

If a device is allowed to wake the host system from suspend, it should
be marked as wake allowed. We add support for a new property that is
sent to the kernel via set device flags mgmt op. We also add the dbus
endpoint to allow the wake allowed setting to be controlled.

In order for wake allowed to be set, the profile must also support wake.
This setting isn't exposed to the user but must be set by profiles that
intend to support wake from suspend.

If a device is connecting for the first time, it will be marked
WakeAllowed if the profile supports it. On subsequent reloads of bluez,
the stored setting "WakeAllowed" will be used to override any other
setting.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
lib/mgmt.h
src/adapter.c
src/adapter.h
src/device.c
src/device.h