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

Commit c8cd5053 authored by Thomas Girardier's avatar Thomas Girardier Committed by Automerger Merge Worker
Browse files

Merge "Fix inquiry time too long" am: af61e537 am: c9dc8d2f am: b4f88576...

Merge "Fix inquiry time too long" am: af61e537 am: c9dc8d2f am: b4f88576 am: 9fc7af2e am: b220579a

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



Change-Id: I5b1ea7754a6ee23104bc5568e78a13d5780d9191
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0df02d53 b220579a
Loading
Loading
Loading
Loading
+21 −1
Original line number Original line Diff line number Diff line
@@ -1331,7 +1331,9 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
    case BTA_DM_DISC_RES_EVT: {
    case BTA_DM_DISC_RES_EVT: {
      /* Remote name update */
      /* Remote name update */
      if (strlen((const char*)p_search_data->disc_res.bd_name)) {
      if (strlen((const char*)p_search_data->disc_res.bd_name)) {
        bt_property_t properties[1];
        /** Fix inquiry time too long @{ */
        bt_property_t properties[3];
        /** @} */
        bt_status_t status;
        bt_status_t status;


        properties[0].type = BT_PROPERTY_BDNAME;
        properties[0].type = BT_PROPERTY_BDNAME;
@@ -1345,6 +1347,24 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event,
                "failed to save remote device property", status);
                "failed to save remote device property", status);
        GetInterfaceToProfiles()->events->invoke_remote_device_properties_cb(
        GetInterfaceToProfiles()->events->invoke_remote_device_properties_cb(
            status, bdaddr, 1, properties);
            status, bdaddr, 1, properties);
        /** Fix inquiry time too long @{ */
        uint32_t cod = 0;
        /* Check if we already have cod in our btif_storage cache */
        BTIF_STORAGE_FILL_PROPERTY(&properties[2], BT_PROPERTY_CLASS_OF_DEVICE, sizeof(uint32_t), &cod);
        if (btif_storage_get_remote_device_property(
                        &bdaddr, &properties[2]) == BT_STATUS_SUCCESS) {
          BTIF_TRACE_DEBUG("%s, BTA_DM_DISC_RES_EVT, cod in storage = 0x%08x", __func__, cod);
        } else {
          BTIF_TRACE_DEBUG("%s, BTA_DM_DISC_RES_EVT, no cod in storage", __func__);
          cod = 0;
        }
        if (cod != 0) {
          BTIF_STORAGE_FILL_PROPERTY(&properties[1], BT_PROPERTY_BDADDR, sizeof(bdaddr), &bdaddr);
          BTIF_STORAGE_FILL_PROPERTY(&properties[2], BT_PROPERTY_CLASS_OF_DEVICE, sizeof(uint32_t), &cod);
          BTIF_TRACE_DEBUG("%s: Now we have name and cod, report to JNI", __func__);
          GetInterfaceToProfiles()->events->invoke_device_found_cb(3, properties);
        }
        /** @} */
      }
      }
      /* TODO: Services? */
      /* TODO: Services? */
    } break;
    } break;