Ignore probe_service even if the service is already added. 88/118188/1
authorDeokhyun Kim <dukan.kim@samsung.com>
Thu, 9 Mar 2017 06:27:13 +0000 (15:27 +0900)
committerDeokhyun Kim <dukan.kim@samsung.com>
Thu, 9 Mar 2017 06:29:18 +0000 (15:29 +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 1996ea0..6bd3ceb 100644 (file)
@@ -5829,6 +5829,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;