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

Commit 93b88c34 authored by Stanley Tng's avatar Stanley Tng
Browse files

Do completion callback during failed security authenication

This CL fixes a regression caused by the earlier commit SHA bf5a62d4 where the
completion callback for this failed security authenication attempt is
rejected incorrectly. The corner case is when the authenication failed
but the bonding address matches the current address.

Test: Run SL4A "BleCocTest:test_coc_secured_connection_throughput"
Change-Id: I68b75b0e96d2762dcd2862787d51aeb90d7b90a0
parent 02f9b77b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4104,6 +4104,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, uint8_t status,
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
  uint8_t res;
  bool is_pairing_device = false;
  bool addr_matched;
  tACL_CONN* p_acl_cb;
  uint8_t bit_shift = 0;

@@ -4193,8 +4194,9 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, uint8_t status,

  p_dev_rec->rs_disc_pending = BTM_SEC_RS_NOT_PENDING; /* reset flag */

  if ((btm_cb.pairing_state != BTM_PAIR_STATE_IDLE) &&
      (btm_cb.pairing_bda == bda)) {
  addr_matched = (btm_cb.pairing_bda == bda);

  if ((btm_cb.pairing_state != BTM_PAIR_STATE_IDLE) && addr_matched) {
    /* if we rejected incoming connection from bonding device */
    if ((status == HCI_ERR_HOST_REJECT_DEVICE) &&
        (btm_cb.pairing_flags & BTM_PAIR_FLAGS_REJECTED_CONNECT)) {
@@ -4290,7 +4292,7 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, uint8_t status,
      }
    }

    if (btm_cb.pairing_bda != bda) {
    if (!addr_matched) {
      /* Don't callback unless this Connection-Complete-failure event has the
       * same mac address as the bonding device */
      VLOG(1) << __func__