plugin-api: deviced: Add enum deviced_event 35/296935/2
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 7 Aug 2023 10:34:28 +0000 (19:34 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 7 Aug 2023 11:03:52 +0000 (20:03 +0900)
 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 <y0.cho@samsung.com>
src/plugin-api/deviced/include/syscommon-plugin-deviced-common-interface.h

index 2efa66997483362790562db875dacffe07e2bcab..2ffd792a6b7d304d0184c7190822890b5299ab3c 100644 (file)
@@ -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