When the battery health state is changed to OVP, update_health_ovp_state is called
according to deviced battery policy.
It is moved from deviced mobile plugin to syscommon plugin api.
Change-Id: I00daa9d69c73e41d4c00ea928d9823292a648f94
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
#endif
#include <stdbool.h>
+
+enum syscommon_deviced_battery_noti_status {
+ DEVICED_BATTERY_NOTI_OFF,
+ DEVICED_BATTERY_NOTI_ON,
+};
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);
} syscommon_plugin_backend_deviced_battery_funcs;
#endif
#include <stdbool.h>
+#include <system/syscommon-plugin-deviced-battery-interface.h>
/**
* @brief Get the backend data of deviced-battery module
*/
int syscommon_plugin_deviced_battery_is_possible_to_notify_battery_full(bool *possible_notify);
+/**
+ * @brief Call theupdate_battery_health_ovp_state of deviced-battery module
+ * @return @c 0 on success, otherwise a negative error value
+ */
+int syscommon_plugin_deviced_battery_update_health_ovp_state(enum syscommon_deviced_battery_noti_status noti_status);
+
#ifdef __cplusplus
}
#endif
*possible_notify = funcs->is_possible_to_notify_battery_full();
return 0;
}
+
+EXPORT
+int syscommon_plugin_deviced_battery_update_health_ovp_state(enum syscommon_deviced_battery_noti_status noti_status)
+{
+ int ret = 0;
+
+ if (!funcs) {
+ ret = syscommon_plugin_deviced_battery_get_backend();
+ if (ret < 0)
+ return ret;
+ }
+
+ if (!funcs || !funcs->update_health_ovp_state) {
+ _E("No backend or no \"update_battery_health_ovp_state\" function");
+ return -ENOTSUP;
+ }
+
+ funcs->update_health_ovp_state(noti_status);
+ return 0;
+}
\ No newline at end of file