--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+#include <stdarg.h>
+#include <glib.h>
+#include <libsyscommon/libgdbus.h>
+#include <libsyscommon/resource-manager.h>
+#include <libsyscommon/log.h>
+#include <syscommon-plugin-deviced-common-interface.h>
+#include <syscommon-plugin-deviced-display-interface.h>
+
+#include "plugin-util.h"
+
+#define POPUP_METHOD "PopupLaunch"
+
+static const struct app_dbus_match {
+ const char *type;
+ const char *bus;
+ const char *path;
+ const char *iface;
+ const char *method;
+} app_match[] = {
+ { APP_DEFAULT , POPUP_BUS_NAME, POPUP_PATH_SYSTEM , POPUP_INTERFACE_SYSTEM , POPUP_METHOD },
+ { APP_POWERKEY, POPUP_BUS_NAME, POPUP_PATH_POWERKEY, POPUP_INTERFACE_POWERKEY, POPUP_METHOD },
+ { APP_OVERHEAT, POPUP_BUS_NAME, POPUP_PATH_OVERHEAT, POPUP_INTERFACE_OVERHEAT, POPUP_METHOD },
+ { APP_ABNORMAL, POPUP_BUS_NAME, POPUP_PATH_SYSTEM , POPUP_INTERFACE_SYSTEM , POPUP_METHOD },
+ { APP_REMOVE , POPUP_BUS_NAME, POPUP_PATH_SYSTEM , POPUP_INTERFACE_SYSTEM , POPUP_METHOD },
+};
+
+#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
+
+static void __cb(GVariant *var, void *user_data, GError *err)
+{
+ int ret;
+
+ if (!var) {
+ _E("No message: %s", err->message);
+ return;
+ }
+
+ if (!g_variant_get_safe(var, "(i)", &ret)) {
+ _E("No message: %s", g_variant_get_type_string(var));
+ goto out;
+ }
+
+ _D("Reply value: %d", ret);
+
+out:
+ g_variant_unref(var);
+}
+
+int launch_system_app(char *type, int num, ...)
+{
+ char *app_type;
+ va_list args;
+ int i, match, ret;
+
+ if (type)
+ app_type = type;
+ else
+ app_type = APP_DEFAULT;
+
+ match = -1;
+ for (i = 0 ; i < ARRAY_SIZE(app_match) ; i++) {
+ if (strncmp(app_type, app_match[i].type, strlen(app_type)))
+ continue;
+ match = i;
+ break;
+ }
+ if (match < 0) {
+ _E("Failed to find matched app type(%s).", app_type);
+ return -EINVAL;
+ }
+
+ va_start(args, num);
+
+ ret = gdbus_call_pairs_async_with_reply(app_match[match].bus,
+ app_match[match].path,
+ app_match[match].iface,
+ app_match[match].method,
+ num,
+ args,
+ __cb,
+ -1,
+ NULL);
+
+ va_end(args);
+
+ syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+ DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON,
+ DEVICED_EVENT_MISC_POPUP);
+
+ return ret;
+}
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __PLUGIN_UTIL_H__
+#define __PLUGIN_UTIL_H__
+
+#define APP_POWERKEY "powerkey"
+#define APP_OVERHEAT "overheat"
+#define APP_DEFAULT "system"
+#define APP_ABNORMAL "abnormal"
+#define APP_REMOVE "remove"
+#define APP_KEY_TYPE "_SYSPOPUP_CONTENT_"
+
+int launch_system_app(char *type, int num, ...);
+int display_plugin_config_touch_wakeup(void);
+
+#endif /* __PLUGIN_UTIL_H__ */
+