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

Commit ae74d761 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Andre Eisenbach
Browse files

Set idle timeout to zero when removing fixed channel

Use Case:
1) pair and Connect to HOGP mouse
2) Disconnect from setting menu.

Failure:
Disconnect is not sent immediately

Root Cause:
While disconnecting we start lcb's default timeout of 4 seconds before
disconnecting the link. Since we are removing fixed channels associated
to a remote, setting idle timeout to 0 for immediate disconnection.

Bug: 21877809
Change-Id: I39fedb6cac6f952149cb2722d028115fbdc20b70
parent 5698eef8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1651,6 +1651,17 @@ BOOLEAN L2CA_RemoveFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda)
    p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] = NULL;
    p_lcb->disc_reason = HCI_ERR_CONN_CAUSE_LOCAL_HOST;

#if BLE_INCLUDED == TRUE
    // Retain the link for a few more seconds after SMP pairing is done, since the Android
    // platform always does service discovery after pairing is complete. This will avoid
    // the link down (pairing is complete) and an immediate re-connection for service
    // discovery.
    // Some devices do not do auto advertising when link is dropped, thus fail the second
    // connection and service discovery.
    if ((fixed_cid == L2CAP_ATT_CID ) && !p_lcb->ccb_queue.p_first_ccb)
        p_lcb->idle_timeout = 0;
#endif

    l2cu_release_ccb (p_ccb);

    return (TRUE);