power: add getter wakeup reason
authorTaeminYeom <taemin.yeom@samsung.com>
Thu, 1 Dec 2022 08:29:55 +0000 (17:29 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 16 Dec 2022 06:33:49 +0000 (15:33 +0900)
commit69590fa50047f0824dd87c64a85d96d370fd389e
tree8ae332b6d4e68b35bdd7e5eb41f08d89a84d138a
parent62b4ec330b0509b7aa8c46aa3133b5a8efb577fa
power: add getter wakeup reason

Add function to call dbus method in deviced and get wakeup reason.
"wakeup reason" is the power transition state reason of sleep to normal.
There are several reasons why the device wakeup and sometimes it is
needed to get the reason.

Add enum to support many typical wakeup reason in device_power_transition_reason_e.

function
int device_power_get_wakeup_reason(device_power_transition_reason_e *reason)

added enum
device_power_transition_reason_e:
DEVICE_POWER_TRANSITION_REASON_VOLUME_UP_KEY         : Volume up key pressed
DEVICE_POWER_TRANSITION_REASON_VOLUME_DOWN_KEY       : Volume down key pressed
DEVICE_POWER_TRANSITION_REASON_TOUCH_SCREEN          : Touch screen pressed
DEVICE_POWER_TRANSITION_REASON_USB                   : USB attached or detached
DEVICE_POWER_TRANSITION_REASON_CHARGER               : Charger attached or detached
DEVICE_POWER_TRANSITION_REASON_HDMI                  : HDMI cable attached or detached
DEVICE_POWER_TRANSITION_REASON_DISPLAY_PORT          : Display port cable attached or detached
DEVICE_POWER_TRANSITION_REASON_EMBEDDED_DISPLAY_PORT : Embedded display port cable attached or detached
DEVICE_POWER_TRANSITION_REASON_WIFI                  : WIFI event
DEVICE_POWER_TRANSITION_REASON_BLUETOOTH             : Bluetooth event
DEVICE_POWER_TRANSITION_REASON_NFC                   : NFC event
DEVICE_POWER_TRANSITION_REASON_TELEPHONY             : Telephony event
DEVICE_POWER_TRANSITION_REASON_ZIGBEE                : Zigbee event
DEVICE_POWER_TRANSITION_REASON_ETHERNET              : Ethernet event
DEVICE_POWER_TRANSITION_REASON_AUDIO                 : Audio event
DEVICE_POWER_TRANSITION_REASON_ALARM                 : Alarm event
DEVICE_POWER_TRANSITION_REASON_SENSOR                : Sensor event
DEVICE_POWER_TRANSITION_REASON_RTC                   : RTC event
DEVICE_POWER_TRANSITION_REASON_HEADSET               : Headset attatched or detached or button pressed
DEVICE_POWER_TRANSITION_REASON_EXTERNAL_MEMORY       : External memory inserted or deleted

Change-Id: Ia22bc8df426c15ae28965e70ae8ded0caddd5b4e
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
include/power-internal.h
src/power-internal.c