4 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include <syspopup_caller.h>
23 #define POPUP_CONTENT "_SYSPOPUP_CONTENT_"
24 #define POPUP_NAME_POWERKEY "powerkey"
26 DBusMessage *launch_popup(E_DBus_Object *obj,
27 DBusMessage *msg, char *name)
30 DBusMessageIter aiter, piter;
41 _I("launch popup (%s)", name);
49 dbus_message_iter_init(msg, &iter);
50 dbus_message_iter_recurse(&iter, &aiter);
52 while (dbus_message_iter_get_arg_type(&aiter) != DBUS_TYPE_INVALID) {
53 dbus_message_iter_recurse(&aiter, &piter);
54 dbus_message_iter_get_basic(&piter, &key);
55 dbus_message_iter_next(&piter);
56 dbus_message_iter_get_basic(&piter, &value);
57 dbus_message_iter_next(&aiter);
59 _I("key(%s), value(%s)", key, value);
61 ret = bundle_add(b, key, value);
63 _E("Failed to add bundle (%s,%s) (ret:%d)", key, value, ret);
68 ret = syspopup_launch(name, b);
70 _E("Failed to launch popup(%d)", ret);
76 reply = dbus_message_new_method_return(msg);
77 dbus_message_iter_init_append(reply, &iter);
78 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret);