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

Commit 595a6a2c 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 am: cb186627 am: acfc4057

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



Change-Id: I7474b68bd0074da0afde6051e8915ed1e0d32ac1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 19af6075 acfc4057
Loading
Loading
Loading
Loading
+25 −9
Original line number Original line 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] = {};
      Uuid existing_uuids[BT_MAX_NUM_UUIDS] = {};

      // Look up UUIDs using pseudo address (either RPA or static address)
      bt_status_t existing_lookup_result =
      bt_status_t existing_lookup_result =
          btif_get_existing_uuids(&bd_addr, existing_uuids);
          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 =
        existing_lookup_result =
            btif_get_existing_uuids(&static_addr_copy, existing_uuids);
            btif_get_existing_uuids(&static_addr_copy, existing_uuids);
        if (existing_lookup_result != BT_STATUS_FAIL) {
        if (existing_lookup_result != BT_STATUS_FAIL) {
          LOG_INFO("Got some existing UUIDs by static address %s",
          LOG_INFO("Got some existing UUIDs by static address %s",
                   ADDRESS_TO_LOGGABLE_CSTR(static_addr_copy));
                   ADDRESS_TO_LOGGABLE_CSTR(static_addr_copy));
        }
      }
          for (int i = 0; i < BT_MAX_NUM_UUIDS; i++) {
          for (int i = 0; i < BT_MAX_NUM_UUIDS; i++) {
            Uuid uuid = existing_uuids[i];
            Uuid uuid = existing_uuids[i];
            if (uuid.IsEmpty()) {
            if (uuid.IsEmpty()) {
@@ -1951,6 +1965,8 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
            }
            }
            uuids.insert(uuid);
            uuids.insert(uuid);
          }
          }
        }
      }


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