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

Commit 02670750 authored by Chris Manton's avatar Chris Manton
Browse files

stack::sec::btm_sec_connected Move stack vars to usage

Bug: 348054268
Test: m .
Flag: EXEMPT, Mechanical Refactor
Change-Id: Ia028f80f558e175481ac7a398c802dc697a8ba83
parent b6d78c8c
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -3629,9 +3629,6 @@ static void btm_sec_connect_after_reject_timeout(void* /* data */) {
void btm_sec_connected(const RawAddress& bda, uint16_t handle,
                       tHCI_STATUS status, uint8_t enc_mode,
                       tHCI_ROLE assigned_role) {
  tBTM_STATUS res;
  bool is_pairing_device = false;
  bool addr_matched;
  uint8_t bit_shift = 0;

  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
@@ -3715,8 +3712,8 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
  }

  p_dev_rec->device_type |= BT_DEVICE_TYPE_BREDR;

  addr_matched = (btm_sec_cb.pairing_bda == bda);
  bool is_pairing_device = false;
  const bool addr_matched = (btm_sec_cb.pairing_bda == bda);

  if ((btm_sec_cb.pairing_state != BTM_PAIR_STATE_IDLE) && addr_matched) {
    /* if we rejected incoming connection from bonding device */
@@ -3747,16 +3744,13 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
        alarm_set_on_mloop(btm_sec_cb.sec_collision_timer, 0,
                           btm_sec_connect_after_reject_timeout, NULL);
      }

      return;
    }
    } else if (status == HCI_ERR_CONNECTION_EXISTS) {
      /* wait for incoming connection without resetting pairing state */
    else if (status == HCI_ERR_CONNECTION_EXISTS) {
      log::warn(
          "Security Manager: btm_sec_connected: Wait for incoming connection");
      return;
    }

    is_pairing_device = true;
  }

@@ -3897,7 +3891,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle,
  log::debug("Is connection locally initiated:{}", p_dev_rec->is_originator);
  if (!(p_dev_rec->sec_rec.sec_flags & BTM_SEC_NAME_KNOWN) ||
      p_dev_rec->is_originator) {
    res = btm_sec_execute_procedure(p_dev_rec);
    tBTM_STATUS res = btm_sec_execute_procedure(p_dev_rec);
    if (res != BTM_CMD_STARTED)
      btm_sec_dev_rec_cback_event(p_dev_rec, res, false);
  }