Remove notification-display-service 66/45766/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150811.114159 accepted/tizen/tv/20150811.114245 accepted/tizen/wearable/20150811.114326 submit/tizen/20150811.112359 submit/tizen_common/20151015.190624 submit/tizen_common/20151019.135620 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorHurnjoo Lee <hurnjoo.lee@samsung.com>
Tue, 11 Aug 2015 05:36:35 +0000 (14:36 +0900)
committerHurnjoo Lee <hurnjoo.lee@samsung.com>
Tue, 11 Aug 2015 05:41:02 +0000 (14:41 +0900)
1. remove notification-display-service
2. change systemd install target to graphical.target

Change-Id: I1298b882c78ffb8dc5e75db0dbaf4b247917d7a9
Signed-off-by: Hurnjoo Lee <hurnjoo.lee@samsung.com>
Makefile.am
configure.ac
notification_display_service.c [deleted file]
notifications-display-ivi.service.in [deleted file]
notifications-display-wayland.service.in [deleted file]
notifications-display-x11.service.in [deleted file]
notifications.service.in
packaging/notification-service.spec

index 7e95034..ad214e8 100644 (file)
@@ -1,7 +1,7 @@
 SUBDIRS = plugins
 moduledir = $(libdir)/notification-service/plugins
 
-bin_PROGRAMS = notification-service notification-display-service sample-display-client send-notification bluetooth_notification_client
+bin_PROGRAMS = notification-service sample-display-client send-notification bluetooth_notification_client
 
 AM_CFLAGS = $(GCC_CFLAGS)
 AM_CPPFLAGS = $(GCC_CFLAGS) -DPLUGINSDIR='"$(moduledir)"'
@@ -13,10 +13,6 @@ notification_service_SOURCES = \
 notification_service_CFLAGS = -I. $(TIZEN_CFLAGS)
 notification_service_LDADD = $(TIZEN_LIBS)
 
-notification_display_service_SOURCES = notification_display_service.c
-notification_display_service_CFLAGS = -I. $(TIZEN_CFLAGS)
-notification_display_service_LDADD = $(TIZEN_LIBS) $(DLOPEN_LIBS)
-
 send_notification_SOURCES = send_notification.c
 send_notification_CFLAGS = -I. $(TIZEN_CFLAGS)
 send_notification_LDADD = $(TIZEN_LIBS)
@@ -30,10 +26,7 @@ bluetooth_notification_client_CFLAGS = -I. $(TIZEN_CFLAGS)
 bluetooth_notification_client_LDADD = $(TIZEN_LIBS)
 
 SCRIPT_IN_FILES = \
-     notifications.service.in \
-     notifications-display-ivi.service.in \
-     notifications-display-x11.service.in \
-     notifications-display-wayland.service.in
+     notifications.service.in
 
 install-data-hook:
        $(mkinstalldirs) $(DESTDIR)/usr/lib/systemd/system/
index 76a7053..ae138cc 100644 (file)
@@ -19,6 +19,6 @@ PKG_CHECK_MODULES([TIZEN], [eina ecore com-core notification dbus-1 bluetooth-ap
 AC_SUBST(TIZEN_CFLAGS)
 AC_SUBST(TIZEN_LIBS)
 
-AC_CONFIG_FILES([Makefile plugins/Makefile notifications.service notifications-display-ivi.service notifications-display-x11.service notifications-display-wayland.service])
+AC_CONFIG_FILES([Makefile plugins/Makefile notifications.service])
 AC_PROG_RANLIB([ranlib])
 AC_OUTPUT
diff --git a/notification_display_service.c b/notification_display_service.c
deleted file mode 100644 (file)
index e0d2fd8..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <glib.h>
-#include <dirent.h>
-#include <notification.h>
-#include <dlfcn.h>
-#include <dlog.h>
-
-
-void load_plugins (char *path, int (**fct)(notification_h))
-{
-       DIR *dir;
-       struct dirent *plugins_dir;
-       char *plugin_path;
-       void *plugin;
-       int (*plugin_fct)(notification_h);
-
-       dir = opendir (path);
-       if (!dir)
-               return;
-
-       while ((plugins_dir = readdir(dir)) != NULL) {
-               if (g_str_has_suffix (plugins_dir->d_name, ".so")) {
-                       plugin_path = g_strconcat (path, G_DIR_SEPARATOR_S, plugins_dir->d_name, NULL);
-                       plugin = dlopen (plugin_path, RTLD_NOW | RTLD_LOCAL);
-                       plugin_fct = dlsym (plugin, "display_notification");
-                       g_free (plugin_path);
-                       if (!plugin) {
-                               LOGD("\"%s\" is not a plugin, continuing", plugins_dir->d_name);
-                               continue;
-                       } else if (!plugin_fct) {
-                               LOGD("Plugin \"%s\" incompatible, continuing", plugins_dir->d_name);
-                               dlclose (plugins_dir->d_name);
-                               continue;
-                       } else {
-                                /* use the first working plugin, if not configured otherwise */
-                               LOGD("Plugin \"%s\" compatible, loading...", plugins_dir->d_name);
-                               *fct = plugin_fct;
-                               break;
-                       }
-               }
-       }
-
-       closedir (dir);
-}
-
-int display_notification_text (notification_h noti)
-{
-       char *pkgname = NULL;
-       char *title = NULL;
-       char *content = NULL;
-       char *image_path = NULL;
-
-       notification_get_pkgname (noti, &pkgname);
-       if (pkgname == NULL)
-               notification_get_application (noti, &pkgname);
-       notification_get_title (noti, &title, NULL);
-       notification_get_text (noti, NOTIFICATION_TEXT_TYPE_CONTENT, &content);
-       notification_get_image (noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
-
-       LOGD("\nNew Notification : %s", title);
-       LOGD("Icon : %s", image_path);
-       LOGD("Message : %s", content);
-
-       return 1;
-}
-
-void display_notifications_cb (void *data, notification_type_e notif_type)
-{
-       int (*fct)(notification_h) = data;
-       notification_h noti = NULL;
-       notification_list_h notification_list = NULL;
-       notification_list_h get_list = NULL;
-
-       notification_get_list (NOTIFICATION_TYPE_NOTI, -1, &notification_list);
-       if (notification_list) {
-               get_list = notification_list_get_head (notification_list);
-               while (get_list) {
-                       noti = notification_list_get_data (get_list);
-
-                        /* if the display function was successful, delete the notification */
-                       if  ( (*fct)(noti) ) {
-                               get_list = notification_list_remove(get_list, noti);
-                               notification_delete(noti);
-                       }
-               }
-       }
-}
-
-void del_pending_notifications(void)
-{
-       notification_h noti = NULL;
-       notification_list_h notification_list = NULL;
-       notification_list_h get_list = NULL;
-
-       notification_get_list (NOTIFICATION_TYPE_NOTI, -1, &notification_list);
-       if (notification_list) {
-               get_list = notification_list_get_head (notification_list);
-               while (get_list) {
-                       noti = notification_list_get_data(get_list);
-                       notification_delete(noti);
-                       LOGD("remove pending notification: %p from DB", noti);
-                       get_list = notification_list_remove(get_list, noti);
-               }
-       }
-}
-
-int main (int argc, char **argv)
-{
-       GMainLoop *mainloop = NULL;
-       gboolean error_s;
-       notification_error_e error_n;
-       int (*disp_fct)(notification_h);
-
-        /* fall back to pure text notification if no plugin works */
-       disp_fct = &display_notification_text;
-       LOGD("Checking for display plugins...");
-       if (g_file_test (PLUGINSDIR, G_FILE_TEST_IS_DIR))
-               load_plugins (PLUGINSDIR, &disp_fct);
-
-retry_socket:
-       LOGD("Checking if the notifications server socket exists...");
-       error_s = g_file_test ("/tmp/.notification.service", G_FILE_TEST_EXISTS);
-       if (!error_s) {
-               LOGD("Could not find the notifications server socket");
-               sleep (5);
-               goto retry_socket;
-       }
-
-       /* remove all notifications stored in DB before handling new notifications */
-       del_pending_notifications();
-
-retry_service:
-       LOGD("Checking if the notifications server is available...");
-       error_n = notification_resister_changed_cb (display_notifications_cb, (*disp_fct));
-       if (error_n != NOTIFICATION_ERROR_NONE) {
-               LOGD("Could not register with notifications server");
-               sleep (5);
-               goto retry_service;
-       }
-
-       mainloop = g_main_loop_new (NULL, FALSE);
-       if (!mainloop) {
-               printf ("Failed to create the GLib main loop\n");
-               return -1;
-       }
-
-       g_main_loop_run (mainloop);
-
-       return 0;
-}
diff --git a/notifications-display-ivi.service.in b/notifications-display-ivi.service.in
deleted file mode 100644 (file)
index 5844dd3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Notifications Popup daemon
-
-[Service]
-ExecStart=/usr/bin/notification-display-service
-
-[Install]
-WantedBy=default.target
diff --git a/notifications-display-wayland.service.in b/notifications-display-wayland.service.in
deleted file mode 100644 (file)
index a2d140d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Notifications Popup daemon
-Requires=notifications.service display-manager-run.service
-After=notifications.service display-manager-run.service
-
-[Service]
-ExecStart=/usr/bin/notification-display-service
-EnvironmentFile=/etc/sysconfig/weston
-
-[Install]
-WantedBy=default.target
diff --git a/notifications-display-x11.service.in b/notifications-display-x11.service.in
deleted file mode 100644 (file)
index 627d623..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Notifications Popup daemon
-Requires=notifications.service display-manager-run.service
-After=notifications.service display-manager-run.service
-
-[Service]
-ExecStart=/usr/bin/notification-display-service
-Environment=DISPLAY=:0
-
-[Install]
-WantedBy=default.target
index 8da6d89..fb2ead0 100644 (file)
@@ -7,4 +7,4 @@ After=vconf-setup.service
 ExecStart=/usr/bin/notification-service
 
 [Install]
-WantedBy=default.target
+WantedBy=graphical.target
index d1e6930..d0b9009 100644 (file)
@@ -44,21 +44,7 @@ make %{?_smp_mflags}
 
 %install
 %make_install
-%install_service default.target.wants notifications.service
-
-%if "%{profile}" == "ivi"
-mkdir -p %{buildroot}/%{_unitdir_user}/default.target.wants
-install -m 0644 notifications-display-ivi.service %{buildroot}/%_unitdir_user/notifications-display.service
-ln -s ../notifications-display.service  %{buildroot}/%{_unitdir_user}/default.target.wants/notifications-display.service
-%else
-%if %{with x}
-install -m 0644 notifications-display-x11.service %{buildroot}/%_unitdir/notifications-display.service
-%endif
-%if %{with wayland}
-install -m 0644 notifications-display-wayland.service %{buildroot}/%_unitdir/notifications-display.service
-%endif
-%install_service default.target.wants notifications-display.service
-%endif
+%install_service graphical.target.wants notifications.service
 
 %post
 %systemd_post notifications.service
@@ -72,17 +58,9 @@ install -m 0644 notifications-display-wayland.service %{buildroot}/%_unitdir/not
 %files
 %defattr(-,root,root,-)
 %{_bindir}/notification-service
-%{_bindir}/notification-display-service
 %{_libdir}/notification-service/plugins/wlmessage.so
 %{_unitdir}/notifications.service
-%{_unitdir}/default.target.wants/notifications.service
-%if "%{profile}" == "ivi"
-%{_unitdir_user}/notifications-display.service
-%{_unitdir_user}/default.target.wants/notifications-display.service
-%else
-%{_unitdir}/notifications-display.service
-%{_unitdir}/default.target.wants/notifications-display.service
-%endif
+%{_unitdir}/graphical.target.wants/notifications.service
 
 %files test
 %defattr(-,root,root,-)