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

Commit 9c4880ac authored by Myles Watson's avatar Myles Watson Committed by Android (Google) Code Review
Browse files

Merge "BTM: Do not start authentication twice" into tm-qpr-dev

parents 8927a742 f1f07b05
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4502,7 +4502,6 @@ static bool btm_sec_start_get_name(tBTM_SEC_DEV_REC* p_dev_rec) {
 *
 ******************************************************************************/
static void btm_sec_wait_and_start_authentication(tBTM_SEC_DEV_REC* p_dev_rec) {
  p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING;
  auto addr = new RawAddress(p_dev_rec->bd_addr);

  static const int32_t delay_auth =
@@ -4537,8 +4536,11 @@ static void btm_sec_auth_timer_timeout(void* data) {
    LOG_INFO("%s: invalid device or not found", __func__);
  } else if (btm_dev_authenticated(p_dev_rec)) {
    LOG_INFO("%s: device is already authenticated", __func__);
  } else if (p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING) {
    LOG_INFO("%s: device is in the process of authenticating", __func__);
  } else {
    LOG_INFO("%s: starting authentication", __func__);
    p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING;
    btsnd_hcic_auth_request(p_dev_rec->hci_handle);
  }
}