static DBusMessage *overheat_popup(E_DBus_Object *obj, DBusMessage *msg)
{
set_timer_to_terminate();
- return launch_overheat_popup(obj, msg, OVERHEAT_SYSPOPUP);
+ return launch_popup(obj, msg, OVERHEAT_SYSPOPUP);
}
/* Crash popup */
/* launch popup */
DBusMessage *launch_popup(E_DBus_Object *obj, DBusMessage *msg, char *name);
DBusMessage *launch_powerkey_popup(E_DBus_Object *obj, DBusMessage *msg, char *name);
-DBusMessage *launch_overheat_popup(E_DBus_Object *obj, DBusMessage *msg, char *name);
#endif /* __LAUNCHER_H__ */
#define POPUP_CONTENT "_SYSPOPUP_CONTENT_"
#define POPUP_NAME_POWERKEY "powerkey"
-#define POPUP_NAME_OVERHEAT "overheat"
DBusMessage *launch_popup(E_DBus_Object *obj,
DBusMessage *msg, char *name)
dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
return reply;
}
-
-DBusMessage *launch_overheat_popup(E_DBus_Object *obj,
- DBusMessage *msg, char *name)
-{
- DBusMessage *reply;
- DBusMessageIter iter;
- int ret;
- bundle *b = NULL;
-
- if (!name) {
- ret = -EINVAL;
- goto out;
- }
-
- _I("launch popup (%s)", name);
-
- b = bundle_create();
- if (!b) {
- ret = -ENOMEM;
- goto out;
- }
-
- ret = bundle_add(b, POPUP_CONTENT, POPUP_NAME_OVERHEAT);
- if (ret < 0) {
- _E("Failed to add bundle (%s,%s) (ret:%d)", POPUP_CONTENT, POPUP_NAME_OVERHEAT, ret);
- goto out;
- }
-
- ret = syspopup_launch(name, b);
- if (ret < 0)
- _E("Failed to launch popup(%d)", ret);
-
-out:
- if (b)
- bundle_free(b);
-
- reply = dbus_message_new_method_return(msg);
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);
-
- return reply;
-}
static const struct popup_ops overheat_ops;
static const struct popup_ops overheat_poweroff_warning_ops;
+static const struct popup_ops remove_overheat_popups_ops;
static void register_handlers(const struct popup_ops *ops);
static void unregister_handlers(const struct popup_ops *ops);
static void overheat_poweroff(const struct popup_ops *ops);
return 0;
}
+static int remove_all_overheat_popups(bundle *b, const struct popup_ops *ops)
+{
+ unload_simple_popup(&overheat_ops);
+ unload_simple_popup(&overheat_poweroff_warning_ops);
+ terminate_if_no_popup();
+
+ return 0;
+}
+
+static const struct popup_ops remove_overheat_popups_ops = {
+ .name = "remove_overheat_popups",
+ .show = remove_all_overheat_popups,
+};
+
static const struct popup_ops overheat_ops = {
.name = "overheat", //overheat first popup
.pattern = FEEDBACK_PATTERN_LOWBATT,
{
register_popup(&overheat_ops);
register_popup(&overheat_poweroff_warning_ops);
+ register_popup(&remove_overheat_popups_ops);
}