summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemun Lee <semun.lee@samsung.com>2018-05-10 01:09:03 (GMT)
committerSemun Lee <semun.lee@samsung.com>2018-05-10 01:09:47 (GMT)
commit42fbd480e1964a75aea490b29e29dfcb4da33566 (patch)
treedc4dde06709af7103f17a55af18e34eaa416d53e
parent8077b0b7ced4ed49d51eda4c401999bc1c72cc5d (diff)
downloadui-gadget-1-42fbd480e1964a75aea490b29e29dfcb4da33566.zip
ui-gadget-1-42fbd480e1964a75aea490b29e29dfcb4da33566.tar.gz
ui-gadget-1-42fbd480e1964a75aea490b29e29dfcb4da33566.tar.bz2
Remove unnecessary code of ug-clientrefs/changes/83/178383/1
dbus signal related code is useless Change-Id: I306a5913a136183de4b911a25a669496e2da984c Signed-off-by: Semun Lee <semun.lee@samsung.com>
-rw-r--r--CMakeLists.txt2
-rw-r--r--client/ug-client.c110
-rw-r--r--packaging/ui-gadget-1.spec1
3 files changed, 1 insertions, 112 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63fb2f5..73b25c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ INCLUDE(FindPkgConfig)
AUX_SOURCE_DIRECTORY(src SRCS)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
-SET(PKGS_CHECK_MODULES "glib-2.0 bundle dlog capi-appfw-application appsvc capi-appfw-app-manager ecore dbus-glib-1 elementary pkgmgr-info libtzplatform-config ecore-wl2")
+SET(PKGS_CHECK_MODULES "glib-2.0 bundle dlog capi-appfw-application appsvc capi-appfw-app-manager ecore elementary pkgmgr-info libtzplatform-config ecore-wl2")
PKG_CHECK_MODULES(PKGS REQUIRED ${PKGS_CHECK_MODULES})
FOREACH(flag ${PKGS_CFLAGS})
SET(CFLAGS "${CFLAGS} ${flag}")
diff --git a/client/ug-client.c b/client/ug-client.c
index 9ffc2cd..a095e7e 100644
--- a/client/ug-client.c
+++ b/client/ug-client.c
@@ -32,8 +32,6 @@
#include <app.h>
#include <app_control_internal.h>
#include <vconf.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include "ug-client.h"
@@ -47,9 +45,6 @@
#define LOG_TAG "UI_GADGET_CLIENT"
-static int home_screen_pid = 0;
-static DBusConnection *bus;
-static int ug_dbus_signal_handler_initialized = 0;
static bool is_app_pause = false;
static void prt_usage(const char *cmd)
@@ -353,109 +348,6 @@ static int app_create(void *data)
return 0;
}
-static void _ug_client_home_screen_top_cb(void *data)
-{
- struct appdata *ad = data;
-
- if ((!ad->is_transient) && (home_screen_pid)) {
- LOGW("home key pressed. window is not transient. ug client will be terminated");
- elm_exit();
- }
- return;
-}
-
-static DBusHandlerResult
-_ug_client_dbus_signal_filter(DBusConnection *conn, DBusMessage *message,
- void *user_data)
-{
- const char *sender;
- const char *interface;
- int home_pid_by_dbus;
-
- DBusError error;
-
- dbus_error_init(&error);
-
- sender = dbus_message_get_sender(message);
- if (sender == NULL)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- if (dbus_bus_get_unix_user(conn, sender, &error) != 0) {
- LOGW("reject by security issue - no allowed sender\n");
- dbus_error_free(&error);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- interface = dbus_message_get_interface(message);
- if (interface == NULL) {
- LOGW("reject by security issue - no interface\n");
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- if (dbus_message_is_signal(
- message, interface, "home_launch")) {
-
- LOGD("interface signal is home_launch");
-
- if (dbus_message_get_args(message, &error, DBUS_TYPE_UINT32,
- &home_pid_by_dbus, DBUS_TYPE_INVALID) == FALSE) {
- LOGW("Failed to get data: %s", error.message);
- dbus_error_free(&error);
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- }
-
- LOGD("pid : %d", home_pid_by_dbus);
-
- home_screen_pid = home_pid_by_dbus;
-
- if (is_app_pause) {
- LOGD("home_launch signal under app_pause.\
- if home screen is top, app will be terminated");
- _ug_client_home_screen_top_cb(user_data);
- }
- }
-
- return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static void _ug_client_dbus_signal_handler_fini(void *data)
-{
- DBusError error;
- char rule[128];
-
- if (!ug_dbus_signal_handler_initialized)
- return;
-
- if (!dbus_connection_get_is_connected(bus)) {
- LOGD("dbus connection(%p) is not connected", bus);
- goto func_out;
- }
-
- dbus_connection_remove_filter(bus, _ug_client_dbus_signal_filter, data);
-
- dbus_error_init(&error);
-
- snprintf(rule, 128,
- "path='%s',type='signal',interface='%s'", "/aul/dbus_handler",
- "org.tizen.aul.signal");
- dbus_bus_remove_match(bus, rule, &error);
- if (dbus_error_is_set(&error)) {
- LOGE("Fail to rule unset: %s", error.message);
- dbus_error_free(&error);
- goto func_out;
- }
-
- dbus_connection_close(bus);
-
- LOGD("ug dbus signal finialized");
-
-func_out:
- ug_dbus_signal_handler_initialized = 0;
- bus = NULL;
-
- return;
-}
-
static int app_terminate(void *data)
{
struct appdata *ad = data;
@@ -475,8 +367,6 @@ static int app_terminate(void *data)
if (ug_file_path)
free(ug_file_path);
- _ug_client_dbus_signal_handler_fini(data);
-
evas_object_smart_callback_del(ad->win, "wm,rotation,changed", rotate);
ug_destroy_all();
diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec
index bd0186b..15b8e5a 100644
--- a/packaging/ui-gadget-1.spec
+++ b/packaging/ui-gadget-1.spec
@@ -17,7 +17,6 @@ BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: cmake
BuildRequires: edje-bin