Fix the bug to update the notification string 33/98033/1 accepted/tizen/common/20161117.085342 submit/tizen/20161117.015745
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 16 Nov 2016 02:27:38 +0000 (11:27 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 16 Nov 2016 02:27:38 +0000 (11:27 +0900)
Change-Id: Iccf1df07b69d6e6ac2ea1e6cadf9a7cfaa46f496
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-share/src/obex-event-handler.c

index 5af4735..14a3e60 100644 (file)
@@ -896,18 +896,6 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
                        ERR("snd_noti_info == NULL, this shouldn't happen");
                        goto done;
                }
-               if (snd_noti_info->send_noti == NULL) {
-                       ad->send_data.tr_success = snd_noti_info->send_data.tr_success;
-                       ad->send_data.tr_fail = snd_noti_info->send_data.tr_fail;
-                       snd_noti_info->send_noti = _bt_insert_notification(ad,
-                               BT_SENT_NOTI, snd_noti_info->device_name,
-                               snd_noti_info->address, snd_noti_info->db_sid);
-               }
-
-               if (snd_noti_info->send_data.tr_success)
-                       _bt_insert_instant_notification(BT_SENT_NOTI);
-               else
-                       _bt_insert_instant_notification(BT_SENT_FAILED_NOTI);
 
                if (node->file_cnt > send_index) {
                        int *uids;
@@ -948,10 +936,22 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
                        ad->send_noti = snd_noti_info->send_noti;
                        ad->send_data.tr_success = snd_noti_info->send_data.tr_success;
                        ad->send_data.tr_fail = snd_noti_info->send_data.tr_fail;
-                       _bt_update_notification(ad, ad->send_noti, NULL, NULL, NULL, NULL);
                        g_free(uids);
                }
 
+               if (snd_noti_info->send_noti == NULL) {
+                       ad->send_data.tr_success = snd_noti_info->send_data.tr_success;
+                       ad->send_data.tr_fail = snd_noti_info->send_data.tr_fail;
+                       snd_noti_info->send_noti = _bt_insert_notification(ad,
+                               BT_SENT_NOTI, snd_noti_info->device_name,
+                               snd_noti_info->address, snd_noti_info->db_sid);
+               }
+
+               if (snd_noti_info->send_data.tr_success)
+                       _bt_insert_instant_notification(BT_SENT_NOTI);
+               else
+                       _bt_insert_instant_notification(BT_SENT_FAILED_NOTI);
+
                /* Update Database with Notification ID*/
                __bt_update_db_with_noti_id(BT_DB_OUTBOUND, snd_noti_info->send_noti,
                                snd_noti_info->db_sid);