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

Commit ecefb405 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Revert "Bluetooth: Fix the issue that peer A2DP SNK device can not auto-reconnect."

This reverts commit 5db07990.

Despite the original patch intention, it actually causes various remote
devices (tested Android Auto, Logitech Speakerphone, Tesla Model S and
many more) to no connect A2DP (only HFP) in various re-connect
scenarios.

This is due to the fact that the stream end point type is not correctly
determined yet in some of these scenarios causing the AVDT stream to be
closed prematurely and thus the A2DP connection to fail.

Test: manual; various devices
Fixes: 32688022
parent dbdeb315
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -1399,20 +1399,6 @@ void bta_av_sig_chg(tBTA_AV_DATA* p_data) {
      for (xx = 0; xx < BTA_AV_NUM_LINKS; xx++) {
        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_t avdt_tsep_type = p_scb->sep_info[p_scb->sep_info_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(LOG_TAG,
                     "%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)) {
          p_lcb = &p_cb->lcb[xx];