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

Commit e9cd49a2 authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Prevent spurious connect failures callback"

am: 5c38d7c4

Change-Id: If8b053eaf419f3f44fcb8877f1e0a49f028d43cf
parents d645b8c4 5c38d7c4
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -4087,7 +4087,7 @@ static void btm_sec_connect_after_reject_timeout(UNUSED_ATTR void* data) {
 * Function         btm_sec_connected
 *
 * Description      This function is when a connection to the peer device is
 *                  establsihed
 *                  established
 *
 * Returns          void
 *
@@ -4283,6 +4283,15 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, uint8_t status,
      }
    }

    if (btm_cb.pairing_bda != bda) {
      /* Don't callback unless this Connection-Complete-failure event has the
       * same mac address as the bonding device */
      VLOG(1) << __func__
              << ": Different mac addresses: pairing_bda=" << btm_cb.pairing_bda
              << ", bda=" << bda << ", do not callback";
      return;
    }

    if (status == HCI_ERR_CONNECTION_TOUT ||
        status == HCI_ERR_LMP_RESPONSE_TIMEOUT ||
        status == HCI_ERR_UNSPECIFIED || status == HCI_ERR_PAGE_TIMEOUT)