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

Commit 8aebfec8 authored by Qasim Javed's avatar Qasim Javed Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revert "Reland: EIR uuids should be added to device_found_cb...

Merge "Revert "Revert "Reland: EIR uuids should be added to device_found_cb am: 3154232a am: 1351819f am: ecf20624 am: 4791ca10 am: f7587cf6""" into tm-dev am: 634fb41d am: 6ddffcdb

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



Change-Id: Ieccf2b1ee1a8193e34bb4c396f9ac2ecccf8664b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b89df1db 6ddffcdb
Loading
Loading
Loading
Loading
+22 −9
Original line number Original line Diff line number Diff line
@@ -1209,7 +1209,8 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
      /* inquiry result */
      /* inquiry result */
      bt_bdname_t bdname;
      bt_bdname_t bdname;
      uint8_t remote_name_len;
      uint8_t remote_name_len;
      tBTA_SERVICE_MASK services = 0;
      uint8_t num_uuids = 0, max_num_uuid = 32;
      uint8_t uuid_list[32 * Uuid::kNumBytes16];


      if (p_search_data->inq_res.inq_result_type != BTM_INQ_RESULT_BLE) {
      if (p_search_data->inq_res.inq_result_type != BTM_INQ_RESULT_BLE) {
        p_search_data->inq_res.remt_name_not_required =
        p_search_data->inq_res.remt_name_not_required =
@@ -1225,18 +1226,15 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
      if (!check_eir_remote_name(p_search_data, bdname.name, &remote_name_len))
      if (!check_eir_remote_name(p_search_data, bdname.name, &remote_name_len))
        check_cached_remote_name(p_search_data, bdname.name, &remote_name_len);
        check_cached_remote_name(p_search_data, bdname.name, &remote_name_len);


      /* Check EIR for remote name and services */
      /* Check EIR for services */
      if (p_search_data->inq_res.p_eir) {
      if (p_search_data->inq_res.p_eir) {
        BTA_GetEirService(p_search_data->inq_res.p_eir,
        BTM_GetEirUuidList(p_search_data->inq_res.p_eir,
                          p_search_data->inq_res.eir_len, &services);
                           p_search_data->inq_res.eir_len, Uuid::kNumBytes16,
        BTIF_TRACE_DEBUG("%s()EIR BTA services = %08X", __func__,
                           &num_uuids, uuid_list, max_num_uuid);
                         (uint32_t)services);
        /* TODO:  Get the service list and check to see which uuids we got and
         * send it back to the client. */
      }
      }


      {
      {
        bt_property_t properties[6];
        bt_property_t properties[7];
        bt_device_type_t dev_type;
        bt_device_type_t dev_type;
        uint32_t num_properties = 0;
        uint32_t num_properties = 0;
        bt_status_t status;
        bt_status_t status;
@@ -1300,6 +1298,21 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
                                   &(p_search_data->inq_res.include_rsi));
                                   &(p_search_data->inq_res.include_rsi));
        num_properties++;
        num_properties++;


        /* EIR queried services */
        std::vector<Uuid> uuid128_list;
        if (num_uuids > 0) {
          uint16_t* p_uuid16 = (uint16_t*)uuid_list;
          for (int i = 0; i < num_uuids; ++i) {
            Uuid uuid = Uuid::From16Bit(p_uuid16[i]);
            uuid128_list.push_back(uuid);
          }

          BTIF_STORAGE_FILL_PROPERTY(
              &properties[num_properties], BT_PROPERTY_UUIDS,
              num_uuids * Uuid::kNumBytes128, uuid128_list.data());
          num_properties++;
        }

        status =
        status =
            btif_storage_add_remote_device(&bdaddr, num_properties, properties);
            btif_storage_add_remote_device(&bdaddr, num_properties, properties);
        ASSERTC(status == BT_STATUS_SUCCESS,
        ASSERTC(status == BT_STATUS_SUCCESS,