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

Commit 54d4f428 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

GAP: Avoiding two disconnections from DUT

Avoid sending two hci disconnect commandss from DUT when remote
initiated connection fails when user presses cancel for incoming
pairing request.

Change-Id: Idd05ffbcaac427515a54216adcdd7dbe26cb21c8
parent 5282c268
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3798,9 +3798,13 @@ void btm_simple_pair_complete (UINT8 *p)
    if (disc)
    {
        /* simple pairing failed */
        /* Avoid sending disconnect on HCI_ERR_PEER_USER */
        if ((status != HCI_ERR_PEER_USER) && (status != HCI_ERR_CONN_CAUSE_LOCAL_HOST))
        {
            btm_sec_send_hci_disconnect (p_dev_rec, HCI_ERR_AUTH_FAILURE, p_dev_rec->hci_handle);
        }
    }
}

#if BTM_OOB_INCLUDED == TRUE
/*******************************************************************************
@@ -4037,7 +4041,10 @@ void btm_sec_auth_complete (UINT16 handle, UINT8 status)
        p_dev_rec->security_required &= ~BTM_SEC_OUT_AUTHENTICATE;

        if (status != HCI_SUCCESS)
        {
            if(((status != HCI_ERR_PEER_USER) && (status != HCI_ERR_CONN_CAUSE_LOCAL_HOST)))
                btm_sec_send_hci_disconnect (p_dev_rec, HCI_ERR_PEER_USER, p_dev_rec->hci_handle);
        }
        else
            l2cu_start_post_bond_timer (p_dev_rec->hci_handle);