upload tizen1.0 source
authorKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:01:41 +0000 (17:01 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Sun, 29 Apr 2012 08:01:41 +0000 (17:01 +0900)
27 files changed:
AUTHORS [changed mode: 0755->0644]
CMakeLists.txt [changed mode: 0755->0644]
LICENSE [changed mode: 0755->0644]
debian/changelog
debian/compat [changed mode: 0755->0644]
debian/control [changed mode: 0755->0644]
debian/libnotification-0.install.in [changed mode: 0755->0644]
debian/libnotification-0.postinst.in [changed mode: 0755->0644]
debian/libnotification-dev.install.in [changed mode: 0755->0644]
include/notification.h
include/notification_db.h [changed mode: 0755->0644]
include/notification_debug.h [changed mode: 0755->0644]
include/notification_error.h
include/notification_group.h [changed mode: 0755->0644]
include/notification_internal.h [changed mode: 0755->0644]
include/notification_list.h [changed mode: 0755->0644]
include/notification_noti.h
include/notification_ongoing.h
include/notification_type.h
notification.pc.in [changed mode: 0755->0644]
packaging/notification.spec
src/notification.c
src/notification_db.c [changed mode: 0755->0644]
src/notification_group.c
src/notification_list.c [changed mode: 0755->0644]
src/notification_noti.c
src/notification_ongoing.c

diff --git a/AUTHORS b/AUTHORS
old mode 100755 (executable)
new mode 100644 (file)
index fa6ae31..7619a9d
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,4 +1,3 @@
-Seungtaek Chung <seungtaek.chung@samsung.com>
-Mi-Ju Lee <miju52.lee@samsung.com>
-Xi zhichan <zhichan.xi@samsung.com>
+Jeonghoon Park <jh1979.park@samsung.com>
+Youngjoo Park <yjoo93.park@samsung.com>
 
old mode 100755 (executable)
new mode 100644 (file)
index 4380100..1f80c2f
@@ -25,7 +25,18 @@ SET(HEADERS ./include/notification.h
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED sqlite3 db-util heynoti vconf bundle dbus-1 dlog ail aul appsvc)
+pkg_check_modules(pkgs REQUIRED 
+       sqlite3 
+       db-util 
+       vconf 
+       bundle 
+       dlog 
+       ail 
+       aul 
+       appsvc
+       dbus-1
+       dbus-glib-1
+)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/LICENSE b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
index 9448d7549b76de28f6a06726a84a020f078e41e9..a9b6900d5298c068d06eca47926aa2c0015438f5 100644 (file)
@@ -1,3 +1,11 @@
+libnotification (0.1.1-10) unstable; urgency=low
+
+  * update latest changes
+  * Git: slp/pkgs/n/notification
+  * Tag: libnotification_0.1.1-10
+
+ -- Jeonghoon Park <jh1979.park@samsung.com>  Tue, 20 Mar 2012 19:00:25 +0900
+
 libnotification (0.1.1-9) unstable; urgency=low
 
   * Add content update API
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d1060e9..8add5ef
@@ -1,21 +1,21 @@
 Source: libnotification
 Section: libs
 Priority: optional
-Maintainer: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
-Build-Depends: debhelper (>= 5), libsqlite3-dev, libslp-db-util-dev, libheynoti-dev, libvconf-dev, libbundle-dev, libdbus-1-dev, dlog-dev, libail-0-dev, libaul-1-dev, libappsvc-dev
+Maintainer: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
+Build-Depends: debhelper (>= 5), libsqlite3-dev, libslp-db-util-dev, libvconf-dev, libbundle-dev, libdbus-1-dev, dlog-dev, libail-0-dev, libaul-1-dev, libappsvc-dev, libdbus-glib-1-dev
 Standards-Version: 3.7.2
 
 Package: libnotification-dev
 Section: libdevel
 Architecture: any
-Depends: libnotification-0 (= ${Source-Version}), libsqlite3-dev, libslp-db-util-dev, libheynoti-dev, libvconf-dev, libbundle-dev, dlog-dev, libail-0-dev, libaul-1-dev
+Depends: libnotification-0 (= ${Source-Version})
 Description: Notification library
  This package contains devel content.
 
 Package: libnotification-0
 Section: libs
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, sqlite3, libdlog-0
+Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Notification library
  This package contains notification library.
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 064458444693ad45a2bf7cb29bb43ad5259108ea..1a1936084a793955ec162009367e3b016be361ee 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index a7fb204..426aa2f
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index feebbb7..a50bc76
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #ifndef _DLOG_H_
 #include <stdio.h>
-#define NOTIFICATION_ERR(fmt, arg...)\
-       do { fprintf(stderr, "["LOG_TAG"] %s(%d):"fmt"\n", __FUNCTION__, __LINE__, ##arg); } while (0)
-#define NOTIFICATION_INFO(fmt, arg...)\
-       do { fprintf(stdout, "["LOG_TAG"] %s(%d):"fmt"\n", __FUNCTION__, __LINE__, ##arg); } while (0)
-#define NOTIFICATION_DBG(fmt, arg...)\
-       do { fprintf(stdout, "["LOG_TAG"] %s(%d):"fmt"\n", __FUNCTION__, __LINE__, ##arg); } while (0)
-#else
-#define NOTIFICATION_ERR(...) LOGE(__VA_ARGS__)
-#define NOTIFICATION_INFO(...) LOGI(__VA_ARGS__)
-#define NOTIFICATION_DBG(...) LOGD(__VA_ARGS__)
-#endif
+
+#define NOTIFICATION_DBG(fmt , args...) \
+       do{ \
+               printf("[D][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_INFO(fmt , args...) \
+       do{ \
+               printf("[I][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_WARN(fmt , args...) \
+       do{ \
+               printf("[W][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_ERR(fmt , args...) \
+       do{ \
+               printf("[E][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
+       } while(0)
+
+#else /* _DLOG_H_ */
+
+#define NOTIFICATION_DBG(fmt , args...) \
+       do{ \
+               LOGD("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_INFO(fmt , args...) \
+       do{ \
+               LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_WARN(fmt , args...) \
+       do{ \
+               LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
+       } while(0)
+
+#define NOTIFICATION_ERR(fmt , args...) \
+       do{ \
+               LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
+       } while(0)
+
+#endif /* _DLOG_H_ */
 
 #endif                         /* __NOTIFICATION_DEBUG_H__ */
index e91b57e68cf6c4576a59e9919430431abfa656a0..f2494694ca417cda048ae38fd1b7f1d4f30ed0ef 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index 5c79232..e362cf7
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index 77b75c3..9ed1bdb
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index 2a490e3..80f4805
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 9c84f609666f5ef68598af75e08d21577b6054c5..fce99595979ec6cf64c59f5d0bb47c2ec20b8918 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 39f7c96180d7866039f737ba51d63c93d5c4f827..440725be23964054c19feadfa0266b19821df108 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 744f7e847327a072feca42702670bef1b52b927c..71bd41837c0de249c07356dc208697fb1b16e3fc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index a43f5b8..e17e700
@@ -6,6 +6,6 @@ includedir=@INCLUDEDIR@
 Name: notification
 Description: Notification Library
 Version: @VERSION@
-Requires: sqlite3 heynoti bundle db-util ail aul
+Requires: bundle 
 Libs: -L${libdir} -lnotification
 Cflags: -I${includedir}
index 1d2bbde0945908d275b2aa1e1a26f1a080d3dde4..f45c5d9a17ed406a400ac85896ebc08598452811 100644 (file)
@@ -1,12 +1,11 @@
 Name:       notification
 Summary:    notification library
 Version:    0.1.1
-Release:    4.11
-Group:      System/Library
+Release:    1
+Group:      TBD
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires: pkgconfig(sqlite3)
-BuildRequires: pkgconfig(appsvc)
 BuildRequires: pkgconfig(db-util)
 BuildRequires: pkgconfig(heynoti)
 BuildRequires: pkgconfig(vconf)
@@ -15,14 +14,17 @@ BuildRequires: pkgconfig(dbus-1)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(dbus-glib-1)
+
 BuildRequires: cmake
 Requires(post): /sbin/ldconfig
 Requires(post): /usr/bin/sqlite3
 requires(postun): /sbin/ldconfig
+
 %description
 Notificaiton library.
 
-
 %prep
 %setup -q
 
@@ -30,14 +32,6 @@ Notificaiton library.
 Summary:    Notification library (devel)
 Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
-Requires: pkgconfig(sqlite3)
-Requires: pkgconfig(db-util)
-Requires: pkgconfig(heynoti)
-Requires: pkgconfig(vconf)
-Requires: pkgconfig(bundle)
-Requires: pkgconfig(dlog)
-Requires: pkgconfig(ail)
-Requires: pkgconfig(aul)
 
 %description devel
 Notificaiton library (devel).
@@ -48,13 +42,19 @@ LDFLAGS="$LDFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
 make %{?jobs:-j%jobs}
 
 %install
+rm -rf %{buildroot}
 %make_install
 
+%clean
+rm -rf %{buildroot}
 
 %post
 /sbin/ldconfig
 
-mkdir -p /opt/dbspace
+if [ ! -d /opt/dbspace ]
+then
+       mkdir /opt/dbspace
+fi
 
 if [ ! -f /opt/dbspace/.notification.db ]
 then
@@ -131,7 +131,6 @@ then
                        UNIQUE (caller_pkgname, priv_id)  
                ); 
        '
-
 fi
 
 chown root:5000 /opt/dbspace/.notification.db
@@ -142,13 +141,11 @@ chmod 660 /opt/dbspace/.notification.db-journal
 %postun -p /sbin/ldconfig
 
 %files
-%{_libdir}/libnotification.so.0*
+%defattr(-,root,root,-)
+%{_libdir}/libnotification.so*
 
 %files devel
-%{_includedir}/notification/notification.h
-%{_includedir}/notification/notification_error.h
-%{_includedir}/notification/notification_list.h
-%{_includedir}/notification/notification_type.h
-%{_libdir}/libnotification.so
+%defattr(-,root,root,-)
+%{_includedir}/notification/*.h
 %{_libdir}/pkgconfig/notification.pc
 
index 3525865104ada46a84cc2f435544c5d4be60c83e..90f23149738276c78a4e67d28adc7f45dbdfcd08 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <unistd.h>
 #include <fcntl.h>
 #include <libintl.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
 
 #include <aul.h>
 #include <ail.h>
 #include <appsvc.h>
-#include <heynoti.h>
 #include <vconf-keys.h>
 #include <vconf.h>
 
@@ -52,12 +53,16 @@ struct _notification_cb_list {
 };
 
 static notification_cb_list_s *g_notification_cb_list = NULL;
-static int g_notification_heynoti_fd = -1;
+static DBusConnection *g_dbus_handle;
 
 #define NOTI_PKGNAME_LEN       512
 #define NOTI_CHANGED_NOTI      "notification_noti_changed"
 #define NOTI_CHANGED_ONGOING   "notification_ontoing_changed"
 
+#define NOTI_DBUS_BUS_NAME     "org.tizen.libnotification"
+#define NOTI_DBUS_PATH                 "/org/tizen/libnotification"
+#define NOTI_DBUS_INTERFACE    "org.tizen.libnotification.signal"
+
 static char *_notification_get_pkgname_by_pid(void)
 {
        char buf[NOTI_PKGNAME_LEN] = { 0, };
@@ -213,9 +218,126 @@ static void _notification_chagned_ongoing_cb(void *data)
 
 static void _notification_changed(const char *type)
 {
-       heynoti_publish(type);
+       DBusConnection *connection = NULL;
+       DBusMessage *message = NULL;
+       DBusError err;
+       dbus_bool_t ret;
+
+       if (!type) {
+               NOTIFICATION_ERR("type is NULL");
+               return;
+       }
+
+       dbus_error_init(&err);
+       connection = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
+       if (!connection) {
+               NOTIFICATION_ERR("Fail to dbus_bus_get : %s", err.message);
+               return;
+       }
+
+       message = dbus_message_new_signal(NOTI_DBUS_PATH,
+                               NOTI_DBUS_INTERFACE,
+                               type);
+
+       if (!message) {
+               NOTIFICATION_ERR("fail to create dbus message");
+               goto release_n_return;
+       }
+
+       ret = dbus_connection_send(connection, message, NULL);
+       if (!ret) {
+               NOTIFICATION_ERR("fail to send dbus message : %s", type);
+               goto release_n_return;
+       }
+
+       dbus_connection_flush(connection);
+       
+       NOTIFICATION_DBG("success to emit signal [%s]", type);
+
+release_n_return:
+       dbus_error_free(&err);
+
+       if (message)
+               dbus_message_unref(message);
+
+       if (connection)
+               dbus_connection_unref(connection);
+}
+
+static DBusHandlerResult _dbus_signal_filter(DBusConnection *conn,
+               DBusMessage *msg, void *user_data)
+{
+       const char *interface = NULL;
+       
+       interface = dbus_message_get_interface(msg);
+       NOTIFICATION_DBG("path : %s", dbus_message_get_path(msg));
+       NOTIFICATION_DBG("interface : %s", interface);
+
+       if (strcmp(NOTI_DBUS_INTERFACE, interface))
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+
+       switch (dbus_message_get_type(msg)) {
+               case DBUS_MESSAGE_TYPE_SIGNAL:
+                       _notification_chagned_noti_cb(NULL);    
+                       return DBUS_HANDLER_RESULT_HANDLED;
+               default:
+                       break;
+       }
+       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static DBusConnection *_noti_changed_monitor_init()
+{
+       DBusError err;
+       DBusConnection *conn = NULL;
+       char rule[1024];
+
+       dbus_error_init(&err);
+       conn = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
+       if (!conn) {
+               printf("fail to get bus\n");
+               return NULL;
+       }
+       dbus_connection_setup_with_g_main(conn, NULL);
+       snprintf(rule, 1024, 
+               "path='%s',type='signal',interface='%s',member='%s'",
+               NOTI_DBUS_PATH, 
+               NOTI_DBUS_INTERFACE,
+               NOTI_CHANGED_NOTI);
+
+       dbus_bus_add_match(conn, rule, &err);
+       if (dbus_connection_add_filter(conn,_dbus_signal_filter, 
+                                       NULL, NULL) == FALSE) {
+               NOTIFICATION_ERR("fail to dbus_connection_add_filter");
+               dbus_connection_close(conn);
+               return NULL;
+       }
+
+       dbus_connection_set_exit_on_disconnect(conn, FALSE);
+       return conn;
 }
 
+static void _noti_chanaged_monitor_fini()
+{
+       DBusConnection *conn = g_dbus_handle;
+       char rule[1024];
+
+       if (!conn)
+               return;
+       dbus_connection_remove_filter(conn, _dbus_signal_filter, NULL);
+
+       snprintf(rule, 1024, 
+               "path='%s',type='signal',interface='%s',member='%s'",
+               NOTI_DBUS_PATH, 
+               NOTI_DBUS_INTERFACE,
+               NOTI_CHANGED_NOTI);
+       dbus_bus_remove_match(conn, rule, NULL);
+
+       dbus_connection_close(conn);
+       g_dbus_handle = NULL;
+}      
+
 /* notification_set_icon will be removed */
 EXPORT_API notification_error_e notification_set_icon(notification_h noti,
                                                      const char *icon_path)
@@ -2497,6 +2619,12 @@ notification_resister_changed_cb(void (*changed_cb)
        notification_cb_list_s *noti_cb_list_new = NULL;
        notification_cb_list_s *noti_cb_list = NULL;
 
+       if (!g_dbus_handle) {
+               g_dbus_handle = _noti_changed_monitor_init();
+               if (!g_dbus_handle)
+                       return NOTIFICATION_ERROR_FROM_DBUS;
+       }
+
        noti_cb_list_new =
            (notification_cb_list_s *) malloc(sizeof(notification_cb_list_s));
 
@@ -2518,16 +2646,6 @@ notification_resister_changed_cb(void (*changed_cb)
                noti_cb_list->next = noti_cb_list_new;
                noti_cb_list_new->prev = noti_cb_list;
        }
-
-       if (g_notification_heynoti_fd < 0) {
-               g_notification_heynoti_fd = heynoti_init();
-
-               heynoti_subscribe(g_notification_heynoti_fd, NOTI_CHANGED_NOTI,
-                                 _notification_chagned_noti_cb, NULL);
-
-               heynoti_attach_handler(g_notification_heynoti_fd);
-       }
-
        return NOTIFICATION_ERROR_NONE;
 }
 
@@ -2570,12 +2688,8 @@ notification_unresister_changed_cb(void (*changed_cb)
 
                        free(noti_cb_list);
 
-                       if (g_notification_cb_list == NULL) {
-                               heynoti_detach_handler
-                                   (g_notification_heynoti_fd);
-                               heynoti_close(g_notification_heynoti_fd);
-                               g_notification_heynoti_fd = -1;
-                       }
+                       if (g_notification_cb_list == NULL)
+                               _noti_chanaged_monitor_fini();
 
                        return NOTIFICATION_ERROR_NONE;
                }
old mode 100755 (executable)
new mode 100644 (file)
index 2f7d41a..4c722f7
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index c21770499faa5a3ead78d46667e2320e810cfa04..03c3e1478b82f8c0d9fe30d201057b7427d7f4cd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
old mode 100755 (executable)
new mode 100644 (file)
index b066c74..db28842
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index bb0a60f6df63c7240757c125edcb82916c88ef47..9b06bebfdc79509d7b70795f5c05e061159b2cec 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 18a64e7f0636034d334fbf36ccd31d1ed2fcb2ac..0800883eab3bf275319a494f90772dc8f2b0b0ae 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Contact: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.