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

Commit 3f30eaa1 authored by Hemant Gupta's avatar Hemant Gupta Committed by Andre Eisenbach
Browse files

HID: Prevent incoming and outgoing SDP collision

SDP is performed 2 times as part of HID connection in BD stack,
one after successful authentication, and one in HID stack layer
as SDP data is not stored currently in stack. When there is outgoing and
incoming connections, SDP failed message was posted which was resulting
in SDP failure for HID host resulting in improper disconnection of
HID interrupt channel.

Change-Id: I5b4813dc916696e2c0f76be27a85c1a89c2d8be0
parent 18d791d8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -399,6 +399,14 @@ void bta_hh_start_sdp(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
        } else {
            status = BTA_HH_OK;
        }
    } else if (bta_hh_cb.p_disc_db) {
        /* It is possible that there is incoming/outgoing collision case. DUT initiated
         * HID connection at same time remote has connected L2CAP for HID control,
         * so SDP would be in progress, when this flow reaches here. Just do nothing
         * when the code reaches here, and ongoing SDP completion or failure will handle this case.
         */
        APPL_TRACE_DEBUG("%s: ignoring as SDP already in progress", __func__);
        return;
    }

    if (status != BTA_HH_OK)