Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b3f9dcd authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix service discovery on dual mode device, when pairing on LE...

Merge "Fix service discovery on dual mode device, when pairing on LE transport" into main am: 159f23fe

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2761669



Change-Id: Iab52948dde12a1cb519f2f05e917167d03d7937c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bd3f1b2d 159f23fe
Loading
Loading
Loading
Loading
+25 −9
Original line number Diff line number Diff line
@@ -1933,17 +1933,31 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
      }

      Uuid existing_uuids[BT_MAX_NUM_UUIDS] = {};

      // Look up UUIDs using pseudo address (either RPA or static address)
      bt_status_t existing_lookup_result =
          btif_get_existing_uuids(&bd_addr, existing_uuids);
      if (existing_lookup_result == BT_STATUS_FAIL &&
          bd_addr != static_addr_copy) {

      if (existing_lookup_result != BT_STATUS_FAIL) {
        LOG_INFO("Got some existing UUIDs by address %s",
                 ADDRESS_TO_LOGGABLE_CSTR(bd_addr));

        for (int i = 0; i < BT_MAX_NUM_UUIDS; i++) {
          Uuid uuid = existing_uuids[i];
          if (uuid.IsEmpty()) {
            continue;
          }
          uuids.insert(uuid);
        }
      }

      if (bd_addr != static_addr_copy) {
        // Look up UUID using static address, if different than sudo address
        existing_lookup_result =
            btif_get_existing_uuids(&static_addr_copy, existing_uuids);
        if (existing_lookup_result != BT_STATUS_FAIL) {
          LOG_INFO("Got some existing UUIDs by static address %s",
                   ADDRESS_TO_LOGGABLE_CSTR(static_addr_copy));
        }
      }
          for (int i = 0; i < BT_MAX_NUM_UUIDS; i++) {
            Uuid uuid = existing_uuids[i];
            if (uuid.IsEmpty()) {
@@ -1951,6 +1965,8 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
            }
            uuids.insert(uuid);
          }
        }
      }

      for (auto& uuid : uuids) {
        auto uuid_128bit = uuid.To128BitBE();