battery: Relocate remove_health_popup() from mobile plugin
[platform/core/system/deviced.git] / src / battery / power-supply.c
index 55b9ff8..bd05bab 100644 (file)
@@ -413,6 +413,15 @@ static void charger_state_send_system_event(int state)
        event_system_send(SYS_EVENT_BATTERY_CHARGER_STATUS, EVT_KEY_BATTERY_CHARGER_STATUS, str);
 }
 
+static void remove_health_popup(void)
+{
+       int ret = 0;
+
+       ret = launch_system_app(APP_REMOVE, 2, APP_KEY_TYPE, REMOVE_POPUP);
+       if (ret < 0)
+               _W("Failed to launch remove battery popup(%d)", ret);
+}
+
 static int inform_changed_battery_connection(int status)
 {
        if (status == PRESENT_ABNORMAL)
@@ -488,8 +497,7 @@ static void update_health(enum battery_noti_status status)
                        g_source_remove(abnormal_health_popup_timer);
                        abnormal_health_popup_timer = 0;
                }
-               if (battery_plgn->remove_health_popup)
-                       battery_plgn->remove_health_popup();
+               remove_health_popup();
        }
 }