Fix : Bonding complete event is sent twice. 12/207612/1 accepted/tizen/unified/20190611.050050 accepted/tizen/unified/20190612.111712 submit/tizen/20190610.063128 submit/tizen/20190611.064259 submit/tizen/20190612.015823
authorinjun.yang <injun.yang@samsung.com>
Tue, 7 May 2019 04:24:51 +0000 (13:24 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 10 Jun 2019 04:27:28 +0000 (13:27 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] When DUT request LE pairing, bonding complete event generated twice.
[Cause & Measure] Callback invoked twice in "Pair" dbus callback and the property changed event.
 This patch will handle all bonding complete event in the property changed event.
[Checking Method] Request LE pairing

[Team] IoT Hub
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

* bluez patch required
cb38640b07e8be0d5589e42b12bdc2a7e9fad652

Change-Id: Ifeb59d23b62d0d0e6316f7faf3920bb346d02057
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service/bt-service-device.c
bt-service/bt-service-event-receiver.c

index 82c81ee..c1599a7 100644 (file)
@@ -697,9 +697,6 @@ static void __bt_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
        GVariant *out_param1;
        request_info_t *req_info;
        bluetooth_device_info_t dev_info;
-       bt_remote_dev_info_t *remote_dev_info;
-       GVariant *manufacture_data;
-       GVariant *param;
 
        /* Terminate ALL system popup */
        syspopup_destroy_all();
@@ -836,45 +833,6 @@ static void __bt_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
                goto dbus_return;
        }
 
-       remote_dev_info = _bt_get_remote_device_info(bonding_info->addr);
-       if (!remote_dev_info)
-               goto dbus_return;
-
-       GVariant *uuids = NULL;
-       GVariantBuilder *builder = NULL;
-       int i = 0;
-       builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
-       for (i = 0; i < remote_dev_info->uuid_count; i++) {
-               g_variant_builder_add(builder, "s",
-                       remote_dev_info->uuids[i]);
-       }
-       uuids = g_variant_new("as", builder);
-       g_variant_builder_unref(builder);
-       manufacture_data = g_variant_new_from_data((const GVariantType *)"ay",
-                                               remote_dev_info->manufacturer_data, remote_dev_info->manufacturer_data_len,
-                                               TRUE, NULL, NULL);
-
-       param = g_variant_new("(isunsbub@asn@ay)",
-                       result,
-                       bonding_info->addr,
-                       remote_dev_info->class,
-                       remote_dev_info->rssi,
-                       remote_dev_info->name,
-                       remote_dev_info->paired,
-                       remote_dev_info->connected,
-                       remote_dev_info->trust,
-                       uuids,
-                       remote_dev_info->manufacturer_data_len,
-                       manufacture_data);
-
-
-       /* Send the event to application */
-       _bt_send_event(BT_ADAPTER_EVENT,
-               BLUETOOTH_EVENT_BONDING_FINISHED,
-               param);
-
-       _bt_free_device_info(remote_dev_info);
-
 dbus_return:
        if (req_info->context == NULL)
                goto done;
index 77404c3..105943a 100644 (file)
@@ -1087,14 +1087,6 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
                                BT_INFO("### Paired: %s", secure_addr);
                                __bt_update_remote_cache_devinfo(address, TRUE);
 
-                               if (_bt_is_device_creating() == TRUE) {
-                                       BT_DBG("Try to Pair by me");
-                                       _bt_free_device_info(remote_dev_info);
-                                       g_free(address);
-                                       g_free(property);
-                                       g_variant_unref(val);
-                                       return;
-                               }
                                GVariant *uuids = NULL;
                                GVariantBuilder *builder = NULL;
                                int i = 0;