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

Commit 63665a6f authored by Chris Manton's avatar Chris Manton
Browse files

Re-log /stack/btm/btm_ble::btm_ble_connected

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: act.py -tc BleCocTest

Change-Id: I69a7bffa33eb0c650fbf2cdcfc73bff20494780f
parent f1b902e8
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -1727,23 +1727,15 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,
                       bool addr_matched) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
  if (!p_dev_rec) {
    VLOG(1) << __func__ << " Security Manager: handle:" << handle
            << " enc_mode:" << loghex(enc_mode) << "  bda: " << bda
            << " p_dev_rec:" << p_dev_rec;
    /* There is no device record for new connection.  Allocate one */
    LOG_DEBUG("Creating new device record for new ble connection");
    p_dev_rec = btm_sec_alloc_dev(bda);
    if (p_dev_rec == nullptr) {
      LOG_WARN("%s Unable to create ble connection", __func__);
      LOG_WARN("Unable to create device record for new ble connection");
      return;
    }
  } else /* Update the timestamp for this device */
  {
    VLOG(1) << __func__ << " Security Manager: handle:" << handle
            << " enc_mode:" << loghex(enc_mode) << "  bda: " << bda
            << " RName: " << p_dev_rec->sec_bd_name
            << " p_dev_rec:" << p_dev_rec;

    BTM_TRACE_DEBUG("btm_ble_connected sec_flags=0x%x", p_dev_rec->sec_flags);
  } else {
    LOG_DEBUG("Updating device record timestamp for existing ble connection");
    // TODO() Why is timestamp a counter ?
    p_dev_rec->timestamp = btm_cb.dev_rec_count++;
  }