return 1;
}
-static void update_ovp(enum battery_noti_status status)
-{
- if (status == DEVICE_NOTI_ON)
- battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_DIM);
- else
- battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_NORMAL);
-}
-
static void health_timer_reset(void)
{
abnormal_timer = 0;
plugin->remove_health_popup = remove_health_popup;
plugin->check_power_supply_noti = check_power_supply_noti;
- plugin->update_ovp = update_ovp;
ret = gdbus_signal_subscribe(NULL, DEVICED_PATH_SYSNOTI,
DEVICED_INTERFACE_SYSNOTI, SIGNAL_CHARGEERR_RESPONSE, abnormal_popup_dbus_signal_handler, NULL, NULL);
return 0;
}
-static void update_ovp(enum battery_noti_status status)
-{
- battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_NORMAL);
-}
-
static void battery_notification_init(void *data)
{
struct battery_plugin *plugin = (struct battery_plugin *)data;
_D("Add plugins for battery notification.");
plugin->check_power_supply_noti = check_power_supply_noti;
- plugin->update_ovp = update_ovp;
plugin->launch_health_popup_by_display_state =
launch_health_popup_by_display_state;
}
#include <libsyscommon/libgdbus.h>
#include <libsyscommon/ini-parser.h>
#include <libsyscommon/resource-manager.h>
+#include <system/syscommon-plugin-deviced-battery.h>
#include <system/syscommon-plugin-deviced-common-interface.h>
#include <system/syscommon-plugin-deviced-power-interface.h>
static void check_abnormal_status(void)
{
- static int notify_status = DEVICE_NOTI_OFF;
-
if (old_battery.health != HEALTH_LOW && old_battery.health != HEALTH_HIGH &&
(battery.health == HEALTH_LOW || battery.health == HEALTH_HIGH))
update_health(DEVICE_NOTI_ON);
update_present(DEVICE_NOTI_OFF);
if (old_battery.health != HEALTH_OVP && battery.health == HEALTH_OVP) {
- _I("Charge %d OVP %d(old %d)",
- battery.charge_now, battery.health, old_battery.health);
-
- old_battery.health = battery.health;
-
- if (notify_status == DEVICE_NOTI_ON)
- return;
- notify_status = DEVICE_NOTI_ON;
-
- syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_OVP, (void *)&battery.health);
-
- if (battery_plgn->update_ovp)
- battery_plgn->update_ovp(DEVICE_NOTI_ON);
+ syscommon_plugin_deviced_battery_update_health_ovp_state(DEVICED_BATTERY_NOTI_ON);
} else if (battery.health != HEALTH_OVP && old_battery.health == HEALTH_OVP) {
- _I("Charge %d OVP %d(old %d)",
- battery.charge_now, battery.health, old_battery.health);
-
- old_battery.health = battery.health;
-
- if (notify_status == DEVICE_NOTI_OFF)
- return;
- notify_status = DEVICE_NOTI_OFF;
-
- syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_OVP, (void *)&battery.health);
-
- if (battery_plgn->update_ovp)
- battery_plgn->update_ovp(DEVICE_NOTI_OFF);
+ syscommon_plugin_deviced_battery_update_health_ovp_state(DEVICED_BATTERY_NOTI_OFF);
}
}