overheat popup : add remove_overheat_popups 83/134583/1 accepted/tizen/4.0/unified/20170816.012354 accepted/tizen/4.0/unified/20170816.015257 accepted/tizen/4.0/unified/20170829.020047 accepted/tizen/unified/20170706.193742 submit/tizen/20170706.004100 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100004 submit/tizen_4.0_unified/20170814.115522
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 19 Jun 2017 09:06:38 +0000 (18:06 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 19 Jun 2017 09:07:12 +0000 (18:07 +0900)
Change-Id: Ic82ab786cb4a62c098d66268dc03ca7174522de2
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/launcher/launcher.c
src/launcher/launcher.h
src/launcher/popup.c
src/overheat/overheat.c

index 5c492fb..089d46b 100755 (executable)
@@ -88,7 +88,7 @@ static DBusMessage *powerkey_popup(E_DBus_Object *obj, DBusMessage *msg)
 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 */
index 81c69eb..b76eeaf 100755 (executable)
@@ -119,6 +119,5 @@ struct edbus_object {
 /* 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__ */
 
index 146eddb..e396fc1 100755 (executable)
@@ -22,7 +22,6 @@
 
 #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)
@@ -121,45 +120,3 @@ out:
        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;
-}
index c49ed67..a1b0626 100755 (executable)
@@ -44,6 +44,7 @@ static Evas_Object *timer_label;
 
 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);
@@ -347,6 +348,20 @@ int overheat_popup(bundle *b, 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,
@@ -371,4 +386,5 @@ static __attribute__ ((constructor)) void overheat_register_popup(void)
 {
        register_popup(&overheat_ops);
        register_popup(&overheat_poweroff_warning_ops);
+       register_popup(&remove_overheat_popups_ops);
 }