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
#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"
#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
#include <string.h>
#include <libsyscommon/libgdbus.h>
-#include "apps/apps.h"
#include "core/log.h"
#include "battery.h"
#include "config.h"
#include "shared/eventsystem.h"
#include "shared/plugin.h"
#include "shared/device-notifier.h"
+#include "shared/apps.h"
#define METHOD_LOW_NOTI_ON "BatteryLowNotiOn"
#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"
#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
#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"
#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
#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"
#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
+++ /dev/null
-/*
- * 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);
-}
+++ /dev/null
-/*
- * 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__ */
-
#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"
#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
#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"
#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"
#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
#include "display/display-ops.h"
#include "power-off.h"
#include "power.h"
-#include "apps/apps.h"
#include "power-boot.h"
#include "shared/plugin.h"
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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__ */
+
#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"
#include <eventsystem.h>
#include "core/log.h"
-#include "apps/apps.h"
+#include "shared/apps.h"
#include "extcon/extcon.h"
#include "usb-gadget.h"
#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"