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

Commit 938e9cb2 authored by Sharvil Nanavati's avatar Sharvil Nanavati Committed by android-build-merger
Browse files

Fix bug where a bonded device could enter BONDING and BONDED states again.

am: 1d5616a6

* commit '1d5616a6':
  Fix bug where a bonded device could enter BONDING and BONDED states again.
parents c44a0c59 1d5616a6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1089,6 +1089,16 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
        }
    }

    // We could have received a new link key without going through the pairing flow.
    // If so, we don't want to perform SDP or any other operations on the authenticated
    // device.
    if (!bdaddr_equals(p_auth_cmpl->bd_addr, pairing_cb.bd_addr)) {
      char address[32];
      bdaddr_to_string(&p_auth_cmpl->bd_addr, address, sizeof(address));
      LOG_INFO("%s skipping SDP since we did not initiate pairing to %s.", __func__, address);
      return;
    }

    // Skip SDP for certain  HID Devices
    if (p_auth_cmpl->success)
    {