Remove launch_powerkey_popup() and add signature for powerkey popup 95/182495/3 accepted/tizen/unified/20180626.140828 submit/tizen/20180626.073513
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 25 Jun 2018 11:58:17 +0000 (20:58 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 25 Jun 2018 12:29:10 +0000 (21:29 +0900)
There is no signature for powerkey popup, But actually, an array is made for dbus-send.

array [
   dict entry(
      string "_SYSPOPUP_CONTENT_"
      string "powerkey"
   )

The array is necessary in load_popup_by_type() for popup activation.
So, add signature a{ss} and use launch_popup() instead of launch_powerkey_popup()
for efficiency.

Change-Id: I4a95d5a8b1d054701d8b41ebb38658c6d1317bcc
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
src/launcher/launcher.c
src/launcher/popup.c

index 4f4f1cd..bb3d91f 100755 (executable)
@@ -81,7 +81,7 @@ dbus_system_methods[] = {
 static DBusMessage *powerkey_popup(E_DBus_Object *obj, DBusMessage *msg)
 {
        set_timer_to_terminate();
-       return launch_powerkey_popup(obj, msg, POWERKEY_SYSPOPUP);
+       return launch_popup(obj, msg, POWERKEY_SYSPOPUP);
 }
 
 /* Overheat popup */
@@ -228,7 +228,7 @@ static DBusMessage *media_device_noti_on(E_DBus_Object *obj, DBusMessage *msg)
 
 static const struct edbus_method
 dbus_powerkey_methods[] = {
-       { "PopupLaunch", NULL, "i", powerkey_popup },
+       { "PopupLaunch", "a{ss}", "i", powerkey_popup },
        /* Add methods here */
 };
 
index e396fc1..6bd7227 100755 (executable)
@@ -79,44 +79,3 @@ out:
 
        return reply;
 }
-
-DBusMessage *launch_powerkey_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_POWERKEY);
-       if (ret < 0) {
-               _E("Failed to add bundle (%s,%s) (ret:%d)", POPUP_CONTENT, POPUP_NAME_POWERKEY, 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;
-}