#include "popup-common.h"
+static const struct popup_ops cooldown_poweroff_ops;
+static const struct popup_ops cooldown_ops;
+static const struct popup_ops cooled_down_ops;
+static const struct popup_ops cooldown_remove_ops;
+
+static int remove_cooldown_popups(bundle *b, const struct popup_ops *ops)
+{
+ unload_simple_popup(&cooldown_poweroff_ops);
+ unload_simple_popup(&cooldown_ops);
+ unload_simple_popup(&cooled_down_ops);
+ terminate_if_no_popup();
+
+ return 0;
+}
+
+static int remove_other_cooldown_popups(bundle *b, const struct popup_ops *ops)
+{
+ if (!ops) {
+ _E("Invalid removal request for cooldown");
+ return 0;
+ }
+
+ if (ops != &cooldown_poweroff_ops)
+ unload_simple_popup(&cooldown_poweroff_ops);
+
+ if (ops != &cooldown_ops)
+ unload_simple_popup(&cooldown_ops);
+
+ if (ops != &cooled_down_ops)
+ unload_simple_popup(&cooled_down_ops);
+
+ return 0;
+}
+
static const struct popup_ops cooldown_poweroff_ops = {
.name = "cooldown_poweroff",
.pattern = FEEDBACK_PATTERN_LOWBATT,
.title = "IDS_ST_HEADER_POWER_OFF_ABB",
.content = "IDS_QP_POP_YOUR_DEVICE_IS_OVERHEATING_IT_WILL_NOW_POWER_OFF_TO_COOL_DOWN",
.left_text = "IDS_QP_BUTTON_DO_NOT_POWER_OFF_ABB",
+ .pre = remove_other_cooldown_popups,
};
static const struct popup_ops cooldown_ops = {
.title = "IDS_IDLE_HEADER_PHONE_COOLING_DOWN_ABB",
.content = "IDS_IDLE_POP_YOUR_PHONE_IS_OVERHEATING_STEPS_WILL_BE_TAKEN_TO_COOL_IT_DOWN_N_NYOU_CAN_STILL_USE_YOUR_PHONE_MSG",
.left_text = "IDS_COM_SK_OK",
+ .pre = remove_other_cooldown_popups,
};
static const struct popup_ops cooled_down_ops = {
.title = "IDS_IDLE_HEADER_PHONE_COOLED_DOWN",
.content = "IDS_IDLE_POP_YOUR_PHONE_IS_NOW_READY_TO_USE",
.left_text = "IDS_COM_SK_OK",
+ .pre = remove_other_cooldown_popups,
+};
+
+static const struct popup_ops cooldown_remove_ops = {
+ .name = "remove_cooldown_popups",
+ .show = remove_cooldown_popups,
};
/* Constructor to register cooldown button */
register_popup(&cooldown_poweroff_ops);
register_popup(&cooldown_ops);
register_popup(&cooled_down_ops);
+ register_popup(&cooldown_remove_ops);
}