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

Commit a33d3b1b authored by Mallikarjuna GB's avatar Mallikarjuna GB Committed by Andre Eisenbach
Browse files

Don't initiate sniff in sniff mode

This change makes sure that AG does not retry
to intiate sniff if device is already in remote
initiated sniff mode.

Change-Id: I77a0c4c0aaf2e93e3168f49998fe22a971d46212
parent 88d1c867
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -543,6 +543,17 @@ static BOOLEAN bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, UINT8 index)
    if(mode != BTM_PM_MD_SNIFF)
#endif
    {
#if (BTM_SSR_INCLUDED == TRUE)
        /* Dont initiate Sniff if controller has alreay accepted
         * remote sniff params. This avoid sniff loop issue with
         * some agrresive headsets who use sniff latencies more than
         * DUT supported range of Sniff intervals.*/
        if ((mode == BTM_PM_MD_SNIFF) && (p_peer_dev->info & BTA_DM_DI_ACP_SNIFF))
        {
            APPL_TRACE_DEBUG("%s: already in remote initiate sniff", __func__);
            return TRUE;
        }
#endif
        /* if the current mode is not sniff, issue the sniff command.
         * If sniff, but SSR is not used in this link, still issue the command */
        memcpy(&pwr_md, &p_bta_dm_pm_md[index], sizeof (tBTM_PM_PWR_MD));