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

Commit 1c99376e authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "[Invisalign2] use btm_find_or_alloc_dev in btm_ble_connected" into main...

Merge "[Invisalign2] use btm_find_or_alloc_dev in btm_ble_connected" into main am: 63a51615 am: 72245939

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



Change-Id: I32d6d5df25fb0f473e663782799abaa94a83a250
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 256035b3 72245939
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -1496,19 +1496,11 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,
                       uint8_t role, tBLE_ADDR_TYPE addr_type,
                       bool addr_matched,
                       bool can_read_discoverable_characteristics) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
  if (!p_dev_rec) {
    LOG_INFO("Creating new device record for new ble connection");
    p_dev_rec = btm_sec_alloc_dev(bda);
    if (p_dev_rec == nullptr) {
      LOG_WARN("Unable to create device record for new ble connection");
      return;
    }
  } else {
    LOG_INFO("Updating device record timestamp for existing ble connection");
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_or_alloc_dev(bda);

  LOG_INFO("Updating device record timestamp for the ble connection");
  // TODO() Why is timestamp a counter ?
  p_dev_rec->timestamp = btm_sec_cb.dev_rec_count++;
  }

  if (is_ble_addr_type_known(addr_type))
    p_dev_rec->ble.SetAddressType(addr_type);