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

Commit 13a0f006 authored by WANG XING's avatar WANG XING Committed by Chenjie Luo
Browse files

DO NOT MERGE ANYWHERE Disconnect the AVDT connection for A2DP SRC device.



If phone send A2DP connection request to device, the
device will start 2 seconds timer loop to check the
connection status of A2DP, bluetooth wake
lock will not be released. If the remote device is A2DP
source device, disconnect the AVDT connection.

BUG=26274393

Change-Id: I3a419e9e3dd613f20c973638b166d2a6012c45f7
Signed-off-by: default avatarm00182044 <m00182044@notesmail.huawei.com>
parent 4b2f2c11
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1434,7 +1434,18 @@ void bta_av_sig_chg(tBTA_AV_DATA *p_data)
            {
                mask = 1 << xx;
                APPL_TRACE_DEBUG("conn_lcb: 0x%x", p_cb->conn_lcb);

                tBTA_AV_SCB *p_scb = p_cb->p_scb[xx];
                if (p_scb != NULL)
                {
                    UINT8 avdt_tsep_type = p_scb->seps[p_scb->sep_idx].tsep;
                    /* If the device is a A2DP source, disconnect the AVDT connection */
                    if ((avdt_tsep_type == AVDT_TSEP_SRC) && (p_data->hdr.offset == AVDT_ACP))
                    {
                        LOG_INFO("%s disconnecting invalid A2DP source to A2DP source connection.", __func__);
                        AVDT_DisconnectReq(p_data->str_msg.bd_addr, NULL);
                        return;
                    }
                }
                /* look for a p_lcb with its p_scb registered */
                if((!(mask & p_cb->conn_lcb)) && (p_cb->p_scb[xx] != NULL))
                {