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

Commit d107af3b authored by Venkata Jagadeesh Garaga's avatar Venkata Jagadeesh Garaga Committed by Myles Watson
Browse files

Remove the remote from paired list when auth fails

Problem:
Remote stuck in connecting state during reconnection.

Steps:
1.Pair and connect the remote.
2.disconnect the remote and try to connect again from the DUT. In few trial authentication failure observed.

Root Cause:
During profile re connection scenario stack not posting
bond state change call back with bond none state if any
authentication failure. Any profile connection triggered
after this can stuck in security procedure and
never recovers.

Fix:
Hence remove the remote from paired list when auth fails

Test: manual
Bug:69028610
Change-Id: I6ac627e733f8b0b191c600153542acbb07f8c7a8
parent eb4a936b
Loading
Loading
Loading
Loading
+15 −16
Original line number Diff line number Diff line
@@ -1054,13 +1054,14 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
    }
  }

  if (p_auth_cmpl->success) {
    // 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. Also, make sure that the link key is not derived from
  // secure LTK, because we will need to perform SDP in case of link key
  // derivation to allow bond state change notification for the BR/EDR transport
  // so that the subsequent BR/EDR connections to the remote can use the derived
  // link key.
    // authenticated device. Also, make sure that the link key is not derived
    // from secure LTK, because we will need to perform SDP in case of link key
    // derivation to allow bond state change notification for the BR/EDR
    // transport so that the subsequent BR/EDR connections to the remote can use
    // the derived link key.
    if (p_auth_cmpl->bd_addr != pairing_cb.bd_addr &&
        (!pairing_cb.ble.is_penc_key_rcvd)) {
      LOG(INFO) << __func__
@@ -1069,8 +1070,6 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
      return;
    }

  // Skip SDP for certain  HID Devices
  if (p_auth_cmpl->success) {
    btif_storage_set_remote_addr_type(&bd_addr, p_auth_cmpl->addr_type);
    btif_update_remote_properties(p_auth_cmpl->bd_addr, p_auth_cmpl->bd_name,
                                  NULL, p_auth_cmpl->dev_type);