apps: move to shared library 68/276468/1
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 17 Jun 2022 05:26:50 +0000 (14:26 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Fri, 17 Jun 2022 05:26:50 +0000 (14:26 +0900)
Change-Id: I039bff30ad1b3745abd72ee4637caadd37487319
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 files changed:
CMakeLists.txt
plugins/iot-headed/display/core.c
plugins/iot-headed/display/key-filter.c
plugins/mobile/battery/battery-notification.c
plugins/mobile/display/core.c
plugins/mobile/display/key-filter.c
plugins/tv/display/core.c
plugins/tv/display/key-filter.c
plugins/wearable/display/core.c
plugins/wearable/display/key-filter.c
src/apps/apps.c [deleted file]
src/apps/apps.h [deleted file]
src/battery/lowbat-handler.c
src/battery/power-supply.c
src/display/display-dbus.c
src/display/display-lock.c
src/power/power-off.c
src/shared/apps.c [new file with mode: 0644]
src/shared/apps.h [new file with mode: 0644]
src/thermal/thermal.c
src/usb-gadget/usb-state.c
src/usb-host/usb-host.c

index de82918178d944196c5158288e0d53d7c6e83131..ba0c0c86b28788296d43b58f1b3257c440d719ea 100644 (file)
@@ -64,7 +64,6 @@ SET(CONFDIR "/etc/${PROJECT_NAME}")
 SET(VERSION 0.1.0)
 
 SET(SRCS
-       src/apps/apps.c
        src/control/control.c
        src/core/delayed-init-notifier.c
        src/core/devices.c
index cda404c645b41adf4e855625c84dad0be0805657..b6edf04eebb96d4438a85327ba58619378aa767b 100644 (file)
@@ -51,7 +51,7 @@
 #include "shared/device-notifier.h"
 #include "core/udev.h"
 #include "shared/common.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "extcon/extcon.h"
 #include "battery/power-supply.h"
 #include "power/power-off.h"
index 5f0d544ab94fe4dc8610b2c64ebc4aa123adc7fe..db9a338ea19a5f0ab44cb377e9e2268ebd3d535f 100644 (file)
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
+#include "shared/apps.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
-#include "apps/apps.h"
 #include "display/display-lock.h"
 
 #ifndef KEY_SCREENLOCK
index 8b7b1e608c62c6f7b1445ae99d0e8508f451df2b..b8a9578315b83264eab4d58832b0e1d7e955b58a 100644 (file)
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <libsyscommon/libgdbus.h>
 
-#include "apps/apps.h"
 #include "core/log.h"
 #include "battery.h"
 #include "config.h"
@@ -34,6 +33,7 @@
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"
 #include "shared/device-notifier.h"
+#include "shared/apps.h"
 
 
 #define METHOD_LOW_NOTI_ON          "BatteryLowNotiOn"
index 8a0a100d6ec90cc783e0ab4e96d573191d98eb12..2e2d569e7630cbdfcfe9dc7a9346bb9462edacad 100644 (file)
@@ -50,7 +50,7 @@
 #include "shared/device-notifier.h"
 #include "core/udev.h"
 #include "shared/common.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "extcon/extcon.h"
 #include "battery/power-supply.h"
 #include "power/power-off.h"
index c596cc18a1087ab04a156b3d198e8b8a717da843..1e56db1c9ca42343a474b79d0feed51596aa6331 100644 (file)
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
+#include "shared/apps.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
-#include "apps/apps.h"
 #include "display/display-lock.h"
 
 #ifndef KEY_SCREENLOCK
index f515e7ad896791d53eb9faef001bbecefd6f31e0..d8ba6420c2358d78c572e4017138ef3d8bf3c00a 100644 (file)
@@ -50,7 +50,7 @@
 #include "shared/device-notifier.h"
 #include "core/udev.h"
 #include "shared/common.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "extcon/extcon.h"
 #include "battery/power-supply.h"
 #include "power/power-off.h"
index dc2c2bd137706a1c39b5a6da65065b3929e2022c..42851ce176ff3bc4ca0dea0d4a6626558bbe4ab6 100644 (file)
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
+#include "shared/apps.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
-#include "apps/apps.h"
 #include "display/display-lock.h"
 
 #ifndef KEY_SCREENLOCK
index e29e1706717c313078a7446481cc8706cbd5e97c..1506958e16fe02c23d8be8690c0e8b0181c1138d 100644 (file)
@@ -51,7 +51,7 @@
 #include "shared/device-notifier.h"
 #include "core/udev.h"
 #include "shared/common.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "extcon/extcon.h"
 #include "battery/power-supply.h"
 #include "power/power-off.h"
index 68e774f9a7fc7d1de06439fd757607f94b89b424..ab4b47cdf9ed10831997f87805a17f69b0767fd1 100644 (file)
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
+#include "shared/apps.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
-#include "apps/apps.h"
 #include "display/display-lock.h"
 
 #ifndef KEY_SCREENLOCK
diff --git a/src/apps/apps.c b/src/apps/apps.c
deleted file mode 100644 (file)
index dc20230..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2012 - 2015 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 <stdarg.h>
-#include "core/log.h"
-#include "shared/common.h"
-#include "apps.h"
-#include "shared/plugin.h"
-#include "shared/bitmap.h"
-
-#define POPUP_METHOD "PopupLaunch"
-#define BUFF_MAX        255
-
-static struct display_plugin *disp_plgn;
-static struct dd_bitmap *bm_background;
-static int pid_max;
-
-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 },
-};
-
-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);
-
-       if (disp_plgn->pm_change_internal)
-               disp_plgn->pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
-
-       return ret;
-}
-
-int launch_message_post(char *type)
-{
-       int ret;
-
-       if (!type)
-               return -EINVAL;
-
-       ret = gdbus_call_async_with_reply(POPUP_BUS_NAME,
-                       POPUP_PATH_NOTI,
-                       POPUP_INTERFACE_NOTI,
-                       "MessagePostOn",
-                       g_variant_new("(s)", type),
-                       __cb, -1, NULL);
-
-       if (disp_plgn->pm_change_internal)
-               disp_plgn->pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
-       return ret;
-}
-
-int add_async_notification(char *type, dbus_pending_cb func, GVariant *param)
-{
-       int ret;
-
-       if (!type)
-               return -EINVAL;
-
-       ret = gdbus_call_async_with_reply(POPUP_BUS_NAME,
-                       POPUP_PATH_NOTI,
-                       POPUP_INTERFACE_NOTI,
-                       type,
-                       param,
-                       func,
-                       -1,
-                       NULL);
-
-       return ret;
-}
-
-int remove_notification(char *type, int id)
-{
-       if (!type || id < 0)
-               return -EINVAL;
-
-       return gdbus_call_async_with_reply(POPUP_BUS_NAME,
-                       POPUP_PATH_NOTI,
-                       POPUP_INTERFACE_NOTI,
-                       type, g_variant_new("(i)", id),
-                       __cb, -1, NULL);
-}
-
-bool is_app_background(pid_t pid)
-{
-       return test_bit(bm_background, pid);
-}
-
-void init_bm_background(void)
-{
-       int ret;
-
-       ret = sys_get_int("/proc/sys/kernel/pid_max", &pid_max);
-       if (ret < 0)
-               pid_max = 32768;
-
-       /* need (pid_max + 1) bits to represent pid 0 ~ pid_max */
-       bm_background = init_bitmap(pid_max + 1);
-       if (!bm_background)
-               _E("Failed to allock bm_background.");
-}
-
-void set_app_state(pid_t pid, enum application_state as)
-{
-       if (!bm_background)
-               return;
-
-       if (pid < 0 || pid > pid_max)
-               return;
-
-       if (as == APPLICATION_BACKGROUND)
-               set_bit(bm_background, pid);
-       else if (as == APPLICATION_FOREGROUND || as == APPLICATION_TERMINATED)
-               clear_bit(bm_background, pid);
-       else
-               _E("Invalid as=%d", as);
-}
-
-static void __CONSTRUCTOR__ initialize(void)
-{
-       disp_plgn = get_var_display_plugin();
-       if (!disp_plgn)
-               _E("Failed to get display plugin variable.");
-
-       init_bm_background();
-}
-
-static void __DESTRUCTOR__ finalize(void)
-{
-       deinit_bitmap(bm_background);
-}
diff --git a/src/apps/apps.h b/src/apps/apps.h
deleted file mode 100644 (file)
index 8e6ac23..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2012 - 2015 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 __APPS_H__
-#define __APPS_H__
-
-#include <string.h>
-#include <libsyscommon/libgdbus.h>
-#include "shared/common.h"
-#include "display/poll.h"
-#include "display/display-ops.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_"
-
-enum application_state {
-       APPLICATION_TERMINATED = 0,
-       APPLICATION_FOREGROUND,
-       APPLICATION_BACKGROUND, /* deactivate NORMAL, DIM lock */
-};
-
-int launch_system_app(char *type, int num, ...);
-int launch_message_post(char *type);
-int add_async_notification(char *type, dbus_pending_cb func, GVariant *param);
-int remove_notification(char *type, int id);
-void set_app_state(pid_t pid, enum application_state as);
-bool is_app_background (pid_t pid);
-#endif /* __APPS_H__ */
-
index 54b85f51f42487e2e97931a6a9965f22bd58f875..adc3513fb970e0ff3700f5c927ab91d9130497f4 100644 (file)
@@ -36,6 +36,7 @@
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
 #include "shared/common.h"
+#include "shared/apps.h"
 #include "core/udev.h"
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"
@@ -44,7 +45,6 @@
 #include "display/display-ops.h"
 #include "power/power.h"
 #include "power/power-off.h"
-#include "apps/apps.h"
 #include "power-supply.h"
 
 #define BATTERY_UNKNOWN                -1
index f5c57c4fc46103bf74bdc3e7ed87185cc8de734e..dea6007e35a63990b49456c286dc08d7d5168336 100644 (file)
@@ -34,9 +34,9 @@
 #include "display/setting.h"
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"
+#include "shared/apps.h"
 #include "display/core.h"
 #include "display/display-ops.h"
-#include "apps/apps.h"
 #include "power-supply.h"
 #include "battery.h"
 #include "battery-ops.h"
index a6a59096bc98e6d6578ab74555bf2c4662fa79c3..9b73ba9b16bd6627e846335508c87b8969600cd0 100644 (file)
@@ -36,7 +36,7 @@
 #include "shared/common.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "dd-display.h"
 #include "display-actor.h"
 #include "display-ops.h"
index 9fb232faf3278e6148eecbf3dd3356788f99cf16..b866a664d77d074e451c3c9880bbfb03ed68bc24 100644 (file)
@@ -29,7 +29,7 @@
 #include "lock-detector.h"
 #include "display-lock.h"
 #include "shared/log-macro.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 
 #define METHOD_APP_STATUS      "CheckAppStatus"
 #define PID_MAX                        6
index b7bb97c249e0635ba941c698df7c69d2e55d2c39..89f9b190965daf15455be0721742a0721b7edbf3 100644 (file)
@@ -49,7 +49,6 @@
 #include "display/display-ops.h"
 #include "power-off.h"
 #include "power.h"
-#include "apps/apps.h"
 #include "power-boot.h"
 #include "shared/plugin.h"
 
diff --git a/src/shared/apps.c b/src/shared/apps.c
new file mode 100644 (file)
index 0000000..10e53a0
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * deviced
+ *
+ * Copyright (c) 2012 - 2015 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 <stdarg.h>
+#include <libsyscommon/libgdbus.h>
+
+#include "core/log.h"
+#include "shared/common.h"
+#include "apps.h"
+#include "shared/plugin.h"
+#include "shared/bitmap.h"
+
+#define POPUP_METHOD "PopupLaunch"
+#define BUFF_MAX        255
+
+static struct display_plugin *disp_plgn;
+static struct dd_bitmap *bm_background;
+static int pid_max;
+
+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 },
+};
+
+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);
+
+       if (disp_plgn->pm_change_internal)
+               disp_plgn->pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+
+       return ret;
+}
+
+int launch_message_post(char *type)
+{
+       int ret;
+
+       if (!type)
+               return -EINVAL;
+
+       ret = gdbus_call_async_with_reply(POPUP_BUS_NAME,
+                       POPUP_PATH_NOTI,
+                       POPUP_INTERFACE_NOTI,
+                       "MessagePostOn",
+                       g_variant_new("(s)", type),
+                       __cb, -1, NULL);
+
+       if (disp_plgn->pm_change_internal)
+               disp_plgn->pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+       return ret;
+}
+
+int add_async_notification(char *type, dbus_pending_cb func, GVariant *param)
+{
+       int ret;
+
+       if (!type)
+               return -EINVAL;
+
+       ret = gdbus_call_async_with_reply(POPUP_BUS_NAME,
+                       POPUP_PATH_NOTI,
+                       POPUP_INTERFACE_NOTI,
+                       type,
+                       param,
+                       func,
+                       -1,
+                       NULL);
+
+       return ret;
+}
+
+int remove_notification(char *type, int id)
+{
+       if (!type || id < 0)
+               return -EINVAL;
+
+       return gdbus_call_async_with_reply(POPUP_BUS_NAME,
+                       POPUP_PATH_NOTI,
+                       POPUP_INTERFACE_NOTI,
+                       type, g_variant_new("(i)", id),
+                       __cb, -1, NULL);
+}
+
+bool is_app_background(pid_t pid)
+{
+       return test_bit(bm_background, pid);
+}
+
+void init_bm_background(void)
+{
+       int ret;
+
+       ret = sys_get_int("/proc/sys/kernel/pid_max", &pid_max);
+       if (ret < 0)
+               pid_max = 32768;
+
+       /* need (pid_max + 1) bits to represent pid 0 ~ pid_max */
+       bm_background = init_bitmap(pid_max + 1);
+       if (!bm_background)
+               _E("Failed to allock bm_background.");
+}
+
+void set_app_state(pid_t pid, enum application_state as)
+{
+       if (!bm_background)
+               return;
+
+       if (pid < 0 || pid > pid_max)
+               return;
+
+       if (as == APPLICATION_BACKGROUND)
+               set_bit(bm_background, pid);
+       else if (as == APPLICATION_FOREGROUND || as == APPLICATION_TERMINATED)
+               clear_bit(bm_background, pid);
+       else
+               _E("Invalid as=%d", as);
+}
+
+static void __CONSTRUCTOR__ initialize(void)
+{
+       disp_plgn = get_var_display_plugin();
+       if (!disp_plgn)
+               _E("Failed to get display plugin variable.");
+
+       init_bm_background();
+}
+
+static void __DESTRUCTOR__ finalize(void)
+{
+       deinit_bitmap(bm_background);
+}
diff --git a/src/shared/apps.h b/src/shared/apps.h
new file mode 100644 (file)
index 0000000..8e6ac23
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * deviced
+ *
+ * Copyright (c) 2012 - 2015 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 __APPS_H__
+#define __APPS_H__
+
+#include <string.h>
+#include <libsyscommon/libgdbus.h>
+#include "shared/common.h"
+#include "display/poll.h"
+#include "display/display-ops.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_"
+
+enum application_state {
+       APPLICATION_TERMINATED = 0,
+       APPLICATION_FOREGROUND,
+       APPLICATION_BACKGROUND, /* deactivate NORMAL, DIM lock */
+};
+
+int launch_system_app(char *type, int num, ...);
+int launch_message_post(char *type);
+int add_async_notification(char *type, dbus_pending_cb func, GVariant *param);
+int remove_notification(char *type, int id);
+void set_app_state(pid_t pid, enum application_state as);
+bool is_app_background (pid_t pid);
+#endif /* __APPS_H__ */
+
index 6eee26342e02a2c0a8802d063995d570756b0b44..386d96b31708a1392399d14e1234f51fe267dca0 100644 (file)
@@ -23,7 +23,7 @@
 #include <hal/device/hal-thermal.h>
 #include <libsyscommon/libgdbus.h>
 
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "shared/devices.h"
 #include "core/log.h"
 #include "shared/device-notifier.h"
index a3e766df2b39fbbda7488d5aac2216c7a0e33b5b..8d7a4cc2c395fba558181dc5c7048c4908124de3 100644 (file)
@@ -23,7 +23,7 @@
 #include <eventsystem.h>
 
 #include "core/log.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
 #include "extcon/extcon.h"
 
 #include "usb-gadget.h"
index 9155fb5f243931e2b8c7c0fb7f2ec4de0f0133ad..3dc6d789941b05e30b3366307f3754070f53e7d9 100644 (file)
@@ -28,8 +28,8 @@
 #include "core/log.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
+#include "shared/apps.h"
 #include "core/udev.h"
-#include "apps/apps.h"
 #include "extcon/extcon.h"
 #include "display/display-ops.h"
 #include "display/core.h"