plugin-api: deviced: Add attribute for handling abnormal battery health 44/312844/1
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 30 May 2024 07:39:12 +0000 (16:39 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Mon, 17 Jun 2024 04:27:47 +0000 (13:27 +0900)
New attribute:
 - id: DEVICED_BATTERY_ATTR_BOOL_DO_NOT_DISTURB
 - type: SYSCOMMON_RESMAN_DATA_TYPE_BOOLEAN
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_BATTERY_ATTR_INT_LOW_BATTERY_POPUP
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X
 - 1st param: enum syscommon_deviced_battery_option_type

In order to handle abnormal battery health status, above battery attributes are needed.
To support above attribute getter/setter,
enum syscommon_deviced_battery_option_type is added.

Change-Id: I4d8a66875d581feeb993b19921c5d37fb588c6a4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/plugin-api/deviced/include/system/syscommon-plugin-deviced-battery-interface.h

index 70e93fa0474a8c5dfb325f5341904cf39444127f..f9f1ce51929bfcc61b4309175958ad23a4e23e28 100644 (file)
@@ -33,6 +33,8 @@ extern "C" {
 
 #define DEVICED_BATTERY_ATTR_INT_STATUS_HEALTH                 (1ULL << 0)
 #define DEVICED_BATTERY_ATTR_STRING_STATUS_HEALTH              (1ULL << 1)
+#define DEVICED_BATTERY_ATTR_BOOL_DO_NOT_DISTURB               (1ULL << 2)
+#define DEVICED_BATTERY_ATTR_INT_LOW_BATTERY_POPUP             (1ULL << 3)
 
 enum syscommon_deviced_battery_noti_status {
        DEVICED_BATTERY_NOTI_OFF,
@@ -48,6 +50,18 @@ enum syscommon_deviced_battery_health_type {
        SYSCOMMON_DEVICED_BATTERY_HEALTH_OVP,
 };
 
+enum syscommon_deviced_battery_option_type {
+       SYSCOMMON_DEVICED_BATTERY_OPT_NONE,
+       SYSCOMMON_DEVICED_BATTERY_OPT_WARNING,
+       SYSCOMMON_DEVICED_BATTERY_OPT_CRITICAL,
+       SYSCOMMON_DEVICED_BATTERY_OPT_POWEROFF,
+       SYSCOMMON_DEVICED_BATTERY_OPT_ERR_TEMP_LOW,
+       SYSCOMMON_DEVICED_BATTERY_OPT_ERR_TEMP_HIGH,
+       SYSCOMMON_DEVICED_BATTERY_OPT_ERR_CF_OPEN,
+};
+
+#define DEVICED_BATTERY_ABNORMAL_CHECK_TIMER_INTERVAL  60
+
 typedef struct _syscommon_plugin_backend_deviced_battery_funcs {
        bool (*is_possible_to_notify_battery_full) (void);
        void (*update_health_ovp_state) (enum syscommon_deviced_battery_noti_status noti_status);