Generate the progress event before completing the transfer 97/197397/1 accepted/tizen/unified/20190115.055943 submit/tizen/20190111.043317 submit/tizen/20190114.060943
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 11 Jan 2019 04:02:57 +0000 (13:02 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 11 Jan 2019 04:02:57 +0000 (13:02 +0900)
Change-Id: I6188c23b49add7a3f5c425c32e2c51c372dd4a0f
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-common.c

index 3d23a02..6f62ed5 100644 (file)
@@ -1715,13 +1715,20 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        case BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS:
                BT_INFO("bt_opp_client_transfer_in_progress_cb() will be called");
                client_info = (bt_opc_transfer_info_t *)(param->param_data);
-               ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback)
-                   (client_info->filename, client_info->size, client_info->percentage, bt_event_slot_container[event_index].user_data);
+
+               /* Progress 100% event will be invoked by BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE*/
+               if (client_info->percentage != 100)
+                       ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback)
+                           (client_info->filename, client_info->size, client_info->percentage, bt_event_slot_container[event_index].user_data);
                break;
 
        case BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE:
                BT_INFO("BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE");
-               /* This event don't be used in CAPI */
+               client_info = (bt_opc_transfer_info_t *)(param->param_data);
+
+               if (param->result == BLUETOOTH_ERROR_NONE)
+                       ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback)
+                           (client_info->filename, client_info->size, 100, bt_event_slot_container[event_index].user_data);
                break;
 
        case BLUETOOTH_EVENT_MAP_CONNECTED: