From d089655f7fea15d3dd5b570ded9e83ebd4b82bbe Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Mon, 7 Aug 2023 19:34:28 +0900 Subject: [PATCH] plugin-api: deviced: Add enum deviced_event It replaces enum of the deviced, INTERNAL_LOCK_*, and it enumerates events that the deviced can handle. The events are grouped by module name. And each group can have a single 'General' event and several 'Specific' events. General event is named with module name. Specific event have suffix to the general event, describing what the event exactly is. For example, - DEVICED_EVENT_BATTERY : Representative event of battery event. Represents overall events of battery and can be used by general battery event. - DEVICED_EVENT_BATTERY_CAPACITY_LOW : Specific event of battery event. Denotes battery capacity has entered into or escaped from low status. Change-Id: I4bd752c2d5303ff25d7a070a621fe122f7d0f0dc Signed-off-by: Youngjae Cho --- ...yscommon-plugin-deviced-common-interface.h | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/plugin-api/deviced/include/syscommon-plugin-deviced-common-interface.h b/src/plugin-api/deviced/include/syscommon-plugin-deviced-common-interface.h index 2efa669..2ffd792 100644 --- a/src/plugin-api/deviced/include/syscommon-plugin-deviced-common-interface.h +++ b/src/plugin-api/deviced/include/syscommon-plugin-deviced-common-interface.h @@ -36,6 +36,57 @@ enum deviced_resource_type { DEVICED_RESOURCE_TYPE_END, }; +/** + * Define event of the deviced. + * + * Each event has a category, usually name of a module, that the event is related to. + * There must be a 'General' event for a category, such as DEVICED_EVENT_DISPLAY. + * There can be several 'Specfic' events in a category, such as DEVICED_EVENT_DISPLAY_LOCK. + */ +enum deviced_event { + DEVICED_EVENT_BASE = 10000, + DEVICED_EVENT_UNKNOWN, + + /* display */ + DEVICED_EVENT_DISPLAY, + DEVICED_EVENT_DISPLAY_AMBIENT, + DEVICED_EVENT_DISPLAY_LOCK, + + /* battery */ + DEVICED_EVENT_BATTERY, + DEVICED_EVENT_BATTERY_CAPACITY_FULL, + DEVICED_EVENT_BATTERY_CAPACITY_LOW, + DEVICED_EVENT_BATTERY_HEALTH_OVERHEAT, + DEVICED_EVENT_BATTERY_HEALTH_OVERCOOL, + + /* extcon */ + DEVICED_EVENT_EXTCON, + DEVICED_EVENT_EXTCON_USB, + DEVICED_EVENT_EXTCON_USBHOST, + DEVICED_EVENT_EXTCON_CRADLE, + DEVICED_EVENT_EXTCON_EARJACK, + + /* input */ + DEVICED_EVENT_INPUT, + DEVICED_EVENT_INPUT_POWERKEY, + DEVICED_EVENT_INPUT_BEZEL, + + /* power */ + DEVICED_EVENT_POWER, + + /* touchscreen */ + DEVICED_EVENT_TOUCHSCREEN, + + /* misc */ + DEVICED_EVENT_MISC, + DEVICED_EVENT_MISC_SWIMMODE, + DEVICED_EVENT_MISC_DBUS, + DEVICED_EVENT_MISC_BOOTING, + DEVICED_EVENT_MISC_DUMPMODE, + DEVICED_EVENT_MISC_POPUP, + DEVICED_EVENT_MISC_TIME, +}; + #ifdef __cplusplus } #endif -- 2.34.1