#include "popup-common.h"
static const struct popup_ops lowbattery_poweroff_ops;
+static const struct popup_ops lowbattery_critical_ops;
+static const struct popup_ops lowbattery_warning_ops;
static const struct popup_ops charge_error_low_ops;
static const struct popup_ops charge_error_high_ops;
static const struct popup_ops battery_disconnected_ops;
_D("remove_other_lowbattery_popups() is finished.");
if (ops != &lowbattery_poweroff_ops)
unload_simple_popup(&lowbattery_poweroff_ops);
+
+ if (ops != &lowbattery_critical_ops)
+ unload_simple_popup(&lowbattery_critical_ops);
+
+ if (ops != &lowbattery_warning_ops)
+ unload_simple_popup(&lowbattery_warning_ops);
}
static int remove_other_charge_popups(bundle *b, const struct popup_ops *ops)
battery_status_changed);
}
-
static void register_charger_status_handler(const struct popup_ops *ops)
{
if (vconf_notify_key_changed(VCONFKEY_SYSMAN_CHARGER_STATUS,
"s", param);
if (ret < 0)
_E("Failed to request poweroff to deviced: %d", ret);
-
}
static void charge_error_ok_clicked(const struct popup_ops *ops)
{
_I("Remove battery related popups.");
unload_simple_popup(&lowbattery_poweroff_ops);
+ unload_simple_popup(&lowbattery_critical_ops);
+ unload_simple_popup(&lowbattery_warning_ops);
unload_simple_popup(&charge_error_low_ops);
unload_simple_popup(&charge_error_high_ops);
unload_simple_popup(&battery_disconnected_ops);
.terminate = lowbattery_terminate,
};
+static const struct popup_ops lowbattery_critical_ops = {
+ .name = "lowbattery_critical",
+ .pattern = FEEDBACK_PATTERN_LOWBATT,
+ .title = "IDS_COM_HEADER_BATTERY_CRITICALLY_LOW",
+ .show = load_simple_popup,
+ .content = "IDS_COM_POP_BATTERYLOW",
+ .left_text = "IDS_COM_SK_OK",
+ .pre = lowbattery_launch,
+ .terminate = lowbattery_terminate,
+};
+
+static const struct popup_ops lowbattery_warning_ops = {
+ .name = "lowbattery_warning",
+ .pattern = FEEDBACK_PATTERN_LOWBATT,
+ .title = "IDS_COM_HEADER_BATTERY_LOW_ABB",
+ .show = load_simple_popup,
+ .content = "IDS_COM_POP_BATTERYLOW",
+ .left_text = "IDS_COM_SK_OK",
+ .pre = lowbattery_launch,
+ .terminate = lowbattery_terminate,
+};
+
static const struct popup_ops battery_remove_ops = {
.name = "remove_battery_popups",
.show = remove_battery_popups,
static __attribute__ ((constructor)) void battery_register_popup(void)
{
register_popup(&lowbattery_poweroff_ops);
+ register_popup(&lowbattery_critical_ops);
+ register_popup(&lowbattery_warning_ops);
register_popup(&battery_remove_ops);
register_popup(&charge_error_low_ops);
register_popup(&charge_error_high_ops);
#define SIGNAL_CHARGEERR_RESPONSE "ChargeErrResponse"
static const struct popup_ops lowbattery_poweroff_ops;
+static const struct popup_ops lowbattery_critical_ops;
+static const struct popup_ops lowbattery_warning_ops;
static const struct popup_ops charge_error_low_ops;
static const struct popup_ops charge_error_high_ops;
static const struct popup_ops battery_disconnected_ops;
if (ops != &lowbattery_poweroff_ops)
unload_simple_popup(&lowbattery_poweroff_ops);
+ if (ops != &lowbattery_critical_ops)
+ unload_simple_popup(&lowbattery_critical_ops);
+
+ if (ops != &lowbattery_warning_ops)
+ unload_simple_popup(&lowbattery_warning_ops);
+
return 0;
}
{
_I("Remove battery related popups.");
unload_simple_popup(&lowbattery_poweroff_ops);
+ unload_simple_popup(&lowbattery_critical_ops);
+ unload_simple_popup(&lowbattery_warning_ops);
unload_simple_popup(&charge_error_low_ops);
unload_simple_popup(&charge_error_high_ops);
unload_simple_popup(&battery_disconnected_ops);
.terminate = lowbattery_terminate,
};
+static const struct popup_ops lowbattery_critical_ops = {
+ .name = "lowbattery_critical",
+ .pattern = FEEDBACK_PATTERN_LOWBATT,
+ .show = load_simple_popup,
+ .content = "IDS_COM_POP_BATTERYLOW",
+ .left_text = "IDS_COM_SK_OK",
+ .pre = lowbattery_launch,
+ .terminate = lowbattery_terminate,
+};
+
+static const struct popup_ops lowbattery_warning_ops = {
+ .name = "lowbattery_warning",
+ .pattern = FEEDBACK_PATTERN_LOWBATT,
+ .show = load_simple_popup,
+ .content = "IDS_COM_POP_BATTERYLOW",
+ .left_text = "IDS_COM_SK_OK",
+ .pre = lowbattery_launch,
+ .terminate = lowbattery_terminate,
+};
+
static const struct popup_ops battery_remove_ops = {
.name = "remove_battery_popups",
.show = remove_battery_popups,
static __attribute__ ((constructor)) void battery_register_popup(void)
{
register_popup(&lowbattery_poweroff_ops);
+ register_popup(&lowbattery_critical_ops);
+ register_popup(&lowbattery_warning_ops);
register_popup(&battery_remove_ops);
register_popup(&charge_error_low_ops);
register_popup(&charge_error_high_ops);