#define METHOD_CRITICAL_NOTI_OFF "BatteryCriticalNotiOff"
#define REMOVE_POPUP "remove_battery_popups"
-#define DISCONNECT_POPUP "battdisconnect"
enum event_noti_type {
NOTI_NONE = -1,
_D("Noti_crit(%d) noti_low(%d).", noti_crit, noti_low);
}
-static int changed_battery_cf(int status)
-{
- if (status == PRESENT_ABNORMAL)
- return launch_system_app(APP_ABNORMAL, 2, APP_KEY_TYPE, DISCONNECT_POPUP);
- return launch_system_app(APP_REMOVE, 2, APP_KEY_TYPE, REMOVE_POPUP);
-}
-
static void remove_health_popup(void)
{
int ret;
plugin->lowbat_noti_launch = launch_lowbat_noti;
plugin->lowbat_noti_clean = clean_lowbat_noti;
- plugin->changed_battery_cf = changed_battery_cf;
plugin->remove_health_popup = remove_health_popup;
plugin->check_power_supply_noti = check_power_supply_noti;
plugin->update_ovp = update_ovp;
int (*lowbat_noti_launch) (int capacity, int option);
void (*lowbat_noti_clean) (const char *prev, const char *str);
- int (*changed_battery_cf) (int status);
void (*remove_health_popup) (void);
void (*launch_health_popup_by_display_state) (int display_state);
#define METHOD_FULL_NOTI_OFF "BatteryFullNotiOff"
#define METHOD_CHARGE_NOTI_ON "BatteryChargeNotiOn"
+#define REMOVE_POPUP "remove_battery_popups"
+#define DISCONNECT_POPUP "battdisconnect"
+
#define CHARGER_CHARGE_ON_NODE "/sys/class/power_supply/battery/chg_on"
#define RETRY_MAX 5
event_system_send(SYS_EVENT_BATTERY_CHARGER_STATUS, EVT_KEY_BATTERY_CHARGER_STATUS, str);
}
+static int inform_changed_battery_connection(int status)
+{
+ if (status == PRESENT_ABNORMAL)
+ return launch_system_app(APP_ABNORMAL, 2, APP_KEY_TYPE, DISCONNECT_POPUP);
+ return launch_system_app(APP_REMOVE, 2, APP_KEY_TYPE, REMOVE_POPUP);
+}
+
static void update_present(enum battery_noti_status status)
{
syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_PRESENT, (void *)&battery.present);
display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_DIM, PM_SLEEP_MARGIN);
}
- if (battery_plgn->changed_battery_cf)
- battery_plgn->changed_battery_cf(battery.present);
+ inform_changed_battery_connection(battery.present);
}
static void launch_health_popup(void)