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

Commit a08620d2 authored by yamei du's avatar yamei du Committed by Bhakthavatsala Raghavendra
Browse files

btm_sec: Don't trigger new authentication before collision timer expired

After an authentication conflict, the host starts a backoff mechanism,
allowing the peer device to continue the authentication process.
However, if the host sends a new authentication request during this
period, a new au-rand will be sent to peer which may arrives at peer
before it finishing authentication, potentially causing the peer to
cease its response.

Bug: 342520649
Bug: 380328715
Flag: com.android.bluetooth.flags.ignore_auth_req_when_collision_timer_active
Test: m com.android.btservices
Test: Manual | Simultaneously initiate classic Bluetooth pairing or reconnection from both the local and remote devices.

Change-Id: Ic2604ec603edb2550297ad48ac28317cdf262d9f
parent 40710b64
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4513,6 +4513,14 @@ tBTM_STATUS btm_sec_execute_procedure(tBTM_SEC_DEV_REC* p_dev_rec) {
    }

    if (start_auth) {
      if (com::android::bluetooth::flags::ignore_auth_req_when_collision_timer_active() &&
          alarm_is_scheduled(btm_sec_cb.sec_collision_timer) &&
          (btm_sec_cb.p_collided_dev_rec->bd_addr == p_dev_rec->bd_addr)) {
        log::debug(
                "Security Manager: Authentication will be executed after collision "
                "timer expired");
        return tBTM_STATUS::BTM_CMD_STARTED;
      }
      log::debug("Security Manager: Start authentication");

      /*