ret = notification_update_dnd_allow_exception(parameters, &reply_body, uid);
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)
+ ret = notification_send_noti_event_by_priv_id(parameters, &reply_body);
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)
" <arg type='i' name='event_type' direction='in'/>"
" </method>"
+ " <method name='send_noti_event_by_priv_id'>"
+ " <arg type='i' name='priv_id' direction='in'/>"
+ " <arg type='i' name='event_type' direction='in'/>"
+ " </method>"
+
" <method name='check_event_receiver'>"
" <arg type='i' name='priv_id' direction='in'/>"
" <arg type='i' name='available' direction='out'/>"
return ret;
DbgPrint("load_noti_by_priv_id pkgname : %s, priv_id : %d ", pkgname, priv_id);
- ret = notification_noti_get_by_priv_id(noti, pkgname, priv_id, param_uid);
+ ret = notification_noti_get_by_priv_id(noti, priv_id);
DbgPrint("notification_noti_get_by_priv_id ret : %d", ret);
print_noti(noti);
return ret;
}
+int notification_send_noti_event_by_priv_id(GVariant *parameters, GVariant **reply_body)
+{
+ int ret;
+ int event_type;
+ int priv_id;
+ bool event_flag = false;
+ notification_h noti;
+ GVariant *body = NULL;
+ event_sender_info_s *info;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if (noti != NULL) {
+ g_variant_get(parameters, "(ii)", &priv_id, &event_type);
+
+ ret = notification_noti_get_by_priv_id(noti, priv_id);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to get notification by priv id [%d]", ret);
+ notification_free(noti);
+ return ret;
+ }
+
+ ret = notification_get_event_flag(noti, &event_flag);
+ if (ret != NOTIFICATION_ERROR_NONE || event_flag == false) {
+ notification_free(noti);
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ info = __find_sender_info_by_priv_id(priv_id);
+ if (info == NULL || info->busname == NULL) {
+ notification_free(noti);
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!info->watcher_id) {
+ if (!is_existed_busname(info->busname)) {
+ __event_list = g_list_remove(g_list_first(__event_list), info);
+ __free_event_info(info);
+ notification_free(noti);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ } else {
+ info->watcher_id = __insert_sender_watcher_id(info);
+ }
+ }
+
+ body = notification_ipc_make_gvariant_from_noti(noti, false);
+ if (body == NULL) {
+ ErrPrint("Can't make gvariant to noti");
+ notification_free(noti);
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ }
+
+ ret = send_event_notify_by_busname(g_variant_new("(vi)", body, event_type), "send_event", info->busname, PROVIDER_NOTI_EVENT_INTERFACE_NAME);
+ notification_free(noti);
+ } else {
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ }
+
+ *reply_body = g_variant_new("()");
+ if (*reply_body == NULL) {
+ ErrPrint("cannot make reply body");
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ }
+
+ DbgPrint("notification_send_noti_event_by_priv_id done !! %d", ret);
+ return ret;
+}
+
int notification_check_event_receiver(GVariant *parameters, GVariant **reply_body)
{
int priv_id;