summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Son <seungha.son@samsung.com>2018-01-18 17:08:06 +0900
committerSeungha Son <seungha.son@samsung.com>2018-01-18 17:11:58 +0900
commit97d658d20c6b22b0682841ebb0c90d6d1f24e380 (patch)
treeac6bd475b5bea553ac4d12eaf488488c075abbd1
parentecce7e266467b8a6e6707b0d1942db2aa9527e35 (diff)
downloadnotification-97d658d20c6b22b0682841ebb0c90d6d1f24e380.tar.gz
notification-97d658d20c6b22b0682841ebb0c90d6d1f24e380.tar.bz2
notification-97d658d20c6b22b0682841ebb0c90d6d1f24e380.zip
Change ipc init timing
Signed-off-by: Seungha Son <seungha.son@samsung.com> Change-Id: Iadf84e14e6cbede472b31df9dbbfa8749e955af8
-rwxr-xr-xsrc/notification_internal.c16
-rwxr-xr-xsrc/notification_ipc.c8
2 files changed, 15 insertions, 9 deletions
diff --git a/src/notification_internal.c b/src/notification_internal.c
index 45d655b..c09f872 100755
--- a/src/notification_internal.c
+++ b/src/notification_internal.c
@@ -220,9 +220,6 @@ EXPORT_API int notification_resister_changed_cb_for_uid(
if (changed_cb == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- if (notification_ipc_monitor_init(uid) != NOTIFICATION_ERROR_NONE)
- return NOTIFICATION_ERROR_IO_ERROR;
-
if (_noti_cb_hash == NULL)
_noti_cb_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
@@ -248,6 +245,11 @@ EXPORT_API int notification_resister_changed_cb_for_uid(
noti_cb_list = g_list_append(noti_cb_list, noti_cb_info_new);
}
+ if (notification_ipc_monitor_init(uid) != NOTIFICATION_ERROR_NONE) {
+ notification_unresister_changed_cb_for_uid(changed_cb, uid);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+
return NOTIFICATION_ERROR_NONE;
}
@@ -1184,9 +1186,6 @@ EXPORT_API int notification_register_detailed_changed_cb_for_uid(
if (detailed_changed_cb == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- if (notification_ipc_monitor_init(uid) != NOTIFICATION_ERROR_NONE)
- return NOTIFICATION_ERROR_IO_ERROR;
-
if (_noti_cb_hash == NULL)
_noti_cb_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
@@ -1212,6 +1211,11 @@ EXPORT_API int notification_register_detailed_changed_cb_for_uid(
noti_cb_list = g_list_append(noti_cb_list, noti_cb_info_new);
}
+ if (notification_ipc_monitor_init(uid) != NOTIFICATION_ERROR_NONE) {
+ notification_unregister_detailed_changed_cb_for_uid(detailed_changed_cb, user_data, uid);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+
return NOTIFICATION_ERROR_NONE;
}
diff --git a/src/notification_ipc.c b/src/notification_ipc.c
index 4ac8d97..9abf88e 100755
--- a/src/notification_ipc.c
+++ b/src/notification_ipc.c
@@ -2503,6 +2503,8 @@ static int _send_service_register(uid_t uid)
return result;
}
+ is_master_started = 1;
+
noti_op = _ipc_create_op(NOTIFICATION_OP_SERVICE_READY, 1, NULL, 1, NULL);
if (noti_op != NULL) {
notification_call_changed_cb_for_uid(noti_op, 1, uid);
@@ -2529,8 +2531,9 @@ static void _on_name_appeared(GDBusConnection *connection,
int uid = GPOINTER_TO_INT(user_data);
DBG("uid[%d] name[%s]", uid, name);
- is_master_started = 1;
- _ipc_monitor_register(uid);
+
+ if (is_master_started == 0)
+ _ipc_monitor_register(uid);
/* TODO: dbus activation isn't enough ? */
_do_deffered_task();
@@ -2578,7 +2581,6 @@ int notification_ipc_monitor_init(uid_t uid)
}
if (provider_monitor_id == 0) {
-
provider_monitor_id = g_bus_watch_name_on_connection(
_gdbus_conn,
PROVIDER_BUS_NAME,