From 520b7004bd7b77633c968ad675332cced4ae55de Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 25 May 2017 10:31:03 +0900 Subject: [PATCH] Clean up app signal - Remove duplicated signals and unused signals Change-Id: If4357ff30b9ca78b8e021bad80d73bdd9ee7415d Signed-off-by: Hwankyu Jhun --- include/app_signal.h | 119 ++++++++++++++++++++++----------------------------- src/app_signal.c | 14 +++--- 2 files changed, 57 insertions(+), 76 deletions(-) diff --git a/include/app_signal.h b/include/app_signal.h index ea6b794..9df5b23 100644 --- a/include/app_signal.h +++ b/include/app_signal.h @@ -1,14 +1,14 @@ /* - * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2000 - 2017 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the License); + * 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, + * 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. @@ -16,72 +16,55 @@ #pragma once -#define AUL_DBUS_PATH "/aul/dbus_handler" -#define AUL_DBUS_SIGNAL_INTERFACE "org.tizen.aul.signal" -#define AUL_DBUS_APPDEAD_SIGNAL "app_dead" -#define AUL_DBUS_APPLAUNCH_SIGNAL "app_launch" -#define AUL_DBUS_HOMELAUNCH_SIGNAL "home_launch" - -#define AUL_APP_STATUS_DBUS_PATH "/Org/Tizen/Aul/AppStatus" -#define AUL_APP_STATUS_DBUS_SIGNAL_INTERFACE "org.tizen.aul.AppStatus" -#define STATUS_FOREGROUND "fg" -#define STATUS_BACKGROUND "bg" - -#define AUL_APP_STATUS_DBUS_LAUNCH_REQUEST "AppLaunch" -#define AUL_APP_STATUS_DBUS_RESUME_REQUEST "AppResume" -#define AUL_APP_STATUS_DBUS_TERMINATE_REQUEST "AppTerminate" -#define AUL_APP_STATUS_DBUS_STATUS_CHANGE "AppStatusChange" -#define AUL_APP_STATUS_DBUS_GROUP "AppGroup" -#define AUL_APP_STATUS_DBUS_TERMINATED "AppTerminated" - -#define SYSTEM_PATH_CORE "/Org/Tizen/System/DeviceD/Core" -#define SYSTEM_INTERFACE_CORE "org.tizen.system.deviced.core" - +#define AUL_DBUS_PATH "/aul/dbus_handler" +#define AUL_DBUS_SIGNAL_INTERFACE "org.tizen.aul.signal" +#define AUL_DBUS_APPDEAD_SIGNAL "app_dead" +#define AUL_DBUS_APPLAUNCH_SIGNAL "app_launch" +#define AUL_DBUS_HOMELAUNCH_SIGNAL "home_launch" + +#define AUL_APP_STATUS_DBUS_PATH "/Org/Tizen/Aul/AppStatus" +#define AUL_APP_STATUS_DBUS_SIGNAL_INTERFACE "org.tizen.aul.AppStatus" +#define AUL_APP_STATUS_DBUS_LAUNCH_REQUEST "AppLaunch" +#define AUL_APP_STATUS_DBUS_RESUME_REQUEST "AppResume" +#define AUL_APP_STATUS_DBUS_TERMINATE_REQUEST "AppTerminate" +#define AUL_APP_STATUS_DBUS_STATUS_CHANGE "AppStatusChange" +#define AUL_APP_STATUS_DBUS_GROUP "AppGroup" +#define AUL_APP_STATUS_DBUS_TERMINATED "AppTerminated" + +#define SYSTEM_PATH_CORE "/Org/Tizen/System/DeviceD/Core" +#define SYSTEM_INTERFACE_CORE "org.tizen.system.deviced.core" #define SYSTEM_SIGNAL_BOOTING_DONE "BootingDone" -#define SYSTEM_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti" -#define SYSTEM_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti" - +#define SYSTEM_PATH_SYSNOTI "/Org/Tizen/System/DeviceD/SysNoti" +#define SYSTEM_INTERFACE_SYSNOTI "org.tizen.system.deviced.SysNoti" #define SYSTEM_SIGNAL_COOLDOWN_CHANGED "CoolDownChanged" -#define RESOURCED_PATH_CORE "/Org/Tizen/ResourceD/Process" -#define RESOURCED_INTERFACE_CORE "org.tizen.resourced.process" - -#define RESOURCED_SIGNAL_PROCESS_STATUS "ProcStatus" - -#define ROTATION_BUS_NAME "org.tizen.system.coord" -#define ROTATION_OBJECT_PATH "/Org/Tizen/System/Coord/Rotation" -#define ROTATION_INTERFACE_NAME "org.tizen.system.coord.rotation" -#define ROTATION_METHOD_NAME "Degree" - -#define RESOURCED_PROC_OBJECT "/Org/Tizen/ResourceD/Process" -#define RESOURCED_PROC_INTERFACE "org.tizen.resourced.process" -#define RESOURCED_PROC_METHOD "ProcExclude" - -#define APPFW_SUSPEND_HINT_PATH "/Org/Tizen/Appfw/SuspendHint" -#define APPFW_SUSPEND_HINT_INTERFACE "org.tizen.appfw.SuspendHint" -#define APPFW_SUSPEND_HINT_SIGNAL "SuspendHint" - -#define RESOURCED_FREEZER_PATH "/Org/Tizen/Resourced/Freezer" -#define RESOURCED_FREEZER_INTERFACE "org.tizen.resourced.freezer" -#define RESOURCED_FREEZER_SIGNAL "FreezerState" - -#define RESOURCED_ALLOWED_BG_ATTRIBUTE 0x100 -#define RESOURCED_BACKGROUND_MANAGEMENT_ATTRIBUTE 0x200 -#define RESOURCED_API_VER_2_4_ATTRIBUTE 0x400 - -#define RESOURCED_PROC_PRELAUNCH_SIGNAL "ProcPrelaunch" -#define RESOURCED_PROC_WATCHDOG_SIGNAL "ProcWatchdog" - -#define PROC_TYPE_EXCLUDE "exclude" -#define PROC_TYPE_INCLUDE "include" -#define PROC_TYPE_WAKEUP "wakeup" - -#define TEP_BUS_NAME "org.tizen.system.deviced" -#define TEP_OBJECT_PATH "/Org/Tizen/System/DeviceD/Tzip" -#define TEP_INTERFACE_NAME "org.tizen.system.deviced.Tzip" -#define TEP_MOUNT_METHOD "Mount" -#define TEP_UNMOUNT_METHOD "Unmount" -#define TEP_IS_MOUNTED_METHOD "IsMounted" - - +#define TEP_BUS_NAME "org.tizen.system.deviced" +#define TEP_OBJECT_PATH "/Org/Tizen/System/DeviceD/Tzip" +#define TEP_INTERFACE_NAME "org.tizen.system.deviced.Tzip" +#define TEP_MOUNT_METHOD "Mount" +#define TEP_UNMOUNT_METHOD "Unmount" +#define TEP_IS_MOUNTED_METHOD "IsMounted" + +#define RESOURCED_PROC_PATH "/Org/Tizen/ResourceD/Process" +#define RESOURCED_PROC_INTERFACE "org.tizen.resourced.process" +#define RESOURCED_PROC_STATUS_SIGNAL "ProcStatus" +#define RESOURCED_PROC_PRELAUNCH_SIGNAL "ProcPrelaunch" +#define RESOURCED_PROC_WATCHDOG_SIGNAL "ProcWatchdog" +#define RESOURCED_PROC_METHOD "ProcExclude" +#define RESOURCED_PROC_TYPE_EXCLUDE "exclude" +#define RESOURCED_PROC_TYPE_INCLUDE "include" +#define RESOURCED_PROC_TYPE_WAKEUP "wakeup" + +#define RESOURCED_FREEZER_PATH "/Org/Tizen/Resourced/Freezer" +#define RESOURCED_FREEZER_INTERFACE "org.tizen.resourced.freezer" +#define RESOURCED_FREEZER_SIGNAL "FreezerState" + +#define ROTATION_BUS_NAME "org.tizen.system.coord" +#define ROTATION_OBJECT_PATH "/Org/Tizen/System/Coord/Rotation" +#define ROTATION_INTERFACE_NAME "org.tizen.system.coord.rotation" +#define ROTATION_METHOD_NAME "Degree" + +#define APPFW_SUSPEND_HINT_PATH "/Org/Tizen/Appfw/SuspendHint" +#define APPFW_SUSPEND_HINT_INTERFACE "org.tizen.appfw.SuspendHint" +#define APPFW_SUSPEND_HINT_SIGNAL "SuspendHint" diff --git a/src/app_signal.c b/src/app_signal.c index 78b90ca..d9b29c3 100644 --- a/src/app_signal.c +++ b/src/app_signal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2000 - 2017 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,7 +12,6 @@ * 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. - * */ #define _GNU_SOURCE @@ -69,8 +68,7 @@ static void __system_dbus_signal_handler(GDBusConnection *connection, if (g_strcmp0(signal_name, SYSTEM_SIGNAL_BOOTING_DONE) == 0) { if (booting_done_handler) booting_done_handler((int)pid, booting_done_data); - } else if (g_strcmp0(signal_name, - RESOURCED_SIGNAL_PROCESS_STATUS) == 0) { + } else if (g_strcmp0(signal_name, RESOURCED_PROC_STATUS_SIGNAL) == 0) { g_variant_get(parameters, "(ii)", &status, &pid); if (status_handler) @@ -285,9 +283,9 @@ API int aul_listen_app_status_signal(int (*func)(int, int, void *), if (status_handler && status_subscription_id == 0) { status_subscription_id = __system_dbus_register_signal( - RESOURCED_PATH_CORE, - RESOURCED_INTERFACE_CORE, - RESOURCED_SIGNAL_PROCESS_STATUS); + RESOURCED_PROC_PATH, + RESOURCED_PROC_INTERFACE, + RESOURCED_PROC_STATUS_SIGNAL); if (status_subscription_id == 0) return AUL_R_ERROR; } else if (status_handler == NULL && status_subscription_id) { @@ -350,7 +348,7 @@ API int aul_update_freezer_status(int pid, const char *type) GVariant *param; param = g_variant_new("(si)", type, pid); - ret = __system_dbus_send_signal(RESOURCED_PROC_OBJECT, + ret = __system_dbus_send_signal(RESOURCED_PROC_PATH, RESOURCED_PROC_INTERFACE, RESOURCED_PROC_METHOD, param); -- 2.7.4