Ignore probe_service even if the service is already added. 01/118201/1
authorDeokhyun Kim <dukan.kim@samsung.com>
Thu, 9 Mar 2017 06:27:13 +0000 (15:27 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 9 Mar 2017 06:45:39 +0000 (15:45 +0900)
Cause : Issue happened when,
 0. Gear doesn't have pairing information about remote device.
 1. Remote device initiates HFP connection to Gear
 2. Paired
 3. Gear's Reverse service discovery timer (1s) is expired before HFP
    connection request comes. So device_browse_sdp() is called and
    service resolving is almost done.
 4. HFP connection request comes. So HFP service has been probed here
 5. SDP is done. Because there is HFP in profiles_added, HFP service
    probe happens once more. This causes the issue. Normally,
    duplication checking is done in update_record() by SDP logic.
    But In the issue case, SDP happens first and there is no logic
    to check duplication in incoming connection case (ext_confirm ->
    create_conn -> btd_device_add_uuid). Measure : Ignore probe_service
    even if the service is already added.

Change-Id: I68fbbe3bf510c1e7668cf12f0477cc4385ea710c
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
src/device.c

index 9b536af..4e797c1 100644 (file)
@@ -5830,6 +5830,13 @@ static void dev_probe(struct btd_profile *p, void *user_data)
        struct probe_data *d = user_data;
        struct btd_service *service;
 
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       if (find_service_with_profile(d->dev->services, p)) {
+               DBG("%s is already probed.(UUID:%s)", p->name, p->remote_uuid);
+               return;
+       }
+#endif
+
        service = probe_service(d->dev, p, d->uuids);
        if (!service)
                return;