#include <notification_setting_service.h>
#include <notification_db.h>
#include <notification_viewer.h>
+#include <notification_shared_file.h>
#define PROVIDER_NOTI_INTERFACE_NAME "org.tizen.data_provider_noti_service"
#define PROVIDER_NOTI_EVENT_INTERFACE_NAME "org.tizen.data_provider_noti_event_service"
const gchar *name,
gpointer user_data)
{
- DbgPrint("name vanished : %s", name);
monitoring_info_s *info = (monitoring_info_s *)user_data;
+
+ DbgPrint("name vanished : %s", name);
if (info) {
DbgPrint("name vanished uid : %d", info->uid);
+ notification_remove_private_sharing_target_id(name, info->uid);
g_bus_unwatch_name(info->watcher_id);
delete_monitoring_list(&_monitoring_hash, info->bus_name, info->uid);
uid_t uid = get_sender_uid(sender);
pid_t pid = get_sender_pid(sender);
- if (g_strcmp0(method_name, "noti_service_register") == 0)
+ if (g_strcmp0(method_name, "noti_service_register") == 0) {
ret = service_register(parameters, &reply_body, sender,
_on_name_appeared, _on_name_vanished, &_monitoring_hash, uid);
- else if (g_strcmp0(method_name, "update_noti") == 0)
+ if (ret == NOTIFICATION_ERROR_NONE)
+ notification_add_private_sharing_target_id(pid, sender, uid);
+ }
+ else if (g_strcmp0(method_name, "update_noti") == 0) {
ret = notification_update_noti(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "add_noti") == 0)
+ }
+ else if (g_strcmp0(method_name, "add_noti") == 0) {
ret = notification_add_noti(parameters, &reply_body, sender, uid);
- else if (g_strcmp0(method_name, "refresh_noti") == 0)
+ }
+ else if (g_strcmp0(method_name, "refresh_noti") == 0) {
ret = notification_refresh_noti(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "del_noti_single") == 0)
+ }
+ else if (g_strcmp0(method_name, "del_noti_single") == 0) {
ret = notification_del_noti_single(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "del_noti_multiple") == 0)
+ }
+ else if (g_strcmp0(method_name, "del_noti_multiple") == 0) {
ret = notification_del_noti_multiple(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "get_noti_count") == 0)
+ }
+ else if (g_strcmp0(method_name, "get_noti_count") == 0) {
ret = notification_get_noti_count(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "update_noti_setting") == 0)
+ }
+ else if (g_strcmp0(method_name, "update_noti_setting") == 0) {
ret = notification_update_noti_setting(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "update_noti_sys_setting") == 0)
+ }
+ else if (g_strcmp0(method_name, "update_noti_sys_setting") == 0) {
ret = notification_update_noti_sys_setting(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_noti_by_tag") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_noti_by_tag") == 0) {
ret = notification_load_noti_by_tag(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_noti_by_priv_id") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_noti_by_priv_id") == 0) {
ret = notification_load_noti_by_priv_id(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_noti_grouping_list") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_noti_grouping_list") == 0) {
+ notification_add_private_sharing_target_id(pid, sender, uid);
ret = notification_load_grouping_list(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_noti_detail_list") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_noti_detail_list") == 0) {
+ notification_add_private_sharing_target_id(pid, sender, uid);
ret = notification_load_detail_list(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "get_setting_array") == 0)
+ }
+ else if (g_strcmp0(method_name, "get_setting_array") == 0) {
ret = notification_get_setting_array(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "get_setting_by_app_id") == 0)
+ }
+ else if (g_strcmp0(method_name, "get_setting_by_app_id") == 0) {
ret = notification_get_setting_by_app_id(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_system_setting") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_system_setting") == 0) {
ret = notification_load_system_setting(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "save_as_template") == 0)
+ }
+ else if (g_strcmp0(method_name, "save_as_template") == 0) {
ret = notification_add_noti_template(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "create_from_template") == 0)
+ }
+ else if (g_strcmp0(method_name, "create_from_template") == 0) {
ret = notification_get_noti_template(parameters, &reply_body, pid, uid);
- else if (g_strcmp0(method_name, "create_from_package_template") == 0)
+ }
+ else if (g_strcmp0(method_name, "create_from_package_template") == 0) {
ret = notification_get_noti_package_template(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "get_noti_block_state") == 0)
+ }
+ else if (g_strcmp0(method_name, "get_noti_block_state") == 0) {
ret = notification_get_block_state(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "load_dnd_allow_exception") == 0)
+ }
+ else if (g_strcmp0(method_name, "load_dnd_allow_exception") == 0) {
ret = notification_load_dnd_allow_exception(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "update_dnd_allow_exception") == 0)
+ }
+ else if (g_strcmp0(method_name, "update_dnd_allow_exception") == 0) {
ret = notification_update_dnd_allow_exception(parameters, &reply_body, uid);
- else if (g_strcmp0(method_name, "send_noti_event") == 0)
+ }
+ else if (g_strcmp0(method_name, "send_noti_event") == 0) {
ret = notification_send_noti_event(parameters, &reply_body);
- else if (g_strcmp0(method_name, "send_noti_event_by_priv_id") == 0)
+ }
+ else if (g_strcmp0(method_name, "send_noti_event_by_priv_id") == 0) {
ret = notification_send_noti_event_by_priv_id(parameters, &reply_body);
- else if (g_strcmp0(method_name, "check_event_receiver") == 0)
+ }
+ else if (g_strcmp0(method_name, "check_event_receiver") == 0) {
ret = notification_check_event_receiver(parameters, &reply_body);
- else if (g_strcmp0(method_name, "reset_event_handler") == 0)
+ }
+ else if (g_strcmp0(method_name, "reset_event_handler") == 0) {
ret = notification_reset_event_receiver(parameters, &reply_body, sender);
+ }
if (ret == NOTIFICATION_ERROR_NONE) {
DbgPrint("notification service success : %d", ret);
return ret;
}
+ notification_set_private_sharing(noti, uid);
+
body = notification_ipc_make_gvariant_from_noti(noti, true);
if (body == NULL) {
ErrPrint("cannot make gvariant to noti");
int ret;
GVariant *body = NULL;
int priv_id = NOTIFICATION_PRIV_ID_NONE;
+ notification_h source_noti;
print_noti(noti);
+
+ if (notification_validate_private_sharing(noti) == false) {
+ source_noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ notification_get_id(noti, NULL, &priv_id);
+ notification_noti_get_by_priv_id(source_noti, priv_id);
+
+ notification_calibrate_private_sharing(noti, source_noti);
+ notification_free(source_noti);
+ }
+
ret = notification_noti_update(noti);
if (ret != NOTIFICATION_ERROR_NONE) {
ErrPrint("failed to update a notification:%d\n", ret);
return ret;
}
+ notification_set_private_sharing(noti, uid);
+
body = notification_ipc_make_gvariant_from_noti(noti, true);
if (body == NULL) {
ErrPrint("cannot make gvariant to noti");
list_iter = notification_list_get_head(get_list);
do {
noti = notification_list_get_data(list_iter);
+ notification_set_private_sharing(noti, param_uid);
body = notification_ipc_make_gvariant_from_noti(noti, true);
g_variant_builder_add(builder, "(v)", body);
list_iter = notification_list_get_head(get_list);
do {
noti = notification_list_get_data(list_iter);
+ notification_set_private_sharing(noti, param_uid);
body = notification_ipc_make_gvariant_from_noti(noti, true);
if (body) {
g_variant_builder_add(builder, "(v)", body);
return ret;
}
+ notification_remove_private_sharing(app_id, priv_id, param_uid);
+
ret = __delete_sender_info(priv_id);
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
}
for (i = 0; i < num_deleted; i++) {
+ notification_remove_private_sharing(app_id, *(list_deleted + i), param_uid);
ret = __delete_sender_info(*(list_deleted + i));
if (ret != NOTIFICATION_ERROR_NONE)
return ret;