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

Commit 5765ef51 authored by Chris Manton's avatar Chris Manton
Browse files

Properly init bta::av::bta_av_aact message structures 7/20

Bug: 261213459
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Ibdbb1dfa29c2e333e80d53ce99eff1f650984e36
parent 7b01db00
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -1636,30 +1636,31 @@ void bta_av_open_failed(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
     don't send disconnect req, just report the open event with
     BTA_AV_FAIL_GET_CAP status */
  if (is_av_opened) {
    tBTA_AV_OPEN open;
    open.bd_addr = p_scb->PeerAddress();
    open.chnl = p_scb->chnl;
    open.hndl = p_scb->hndl;
    open.status = BTA_AV_FAIL_GET_CAP;
    open.starting = bta_av_chk_start(p_scb);
    open.edr = 0;
    tBTA_AV bta_av_data = {.open = {
                               .chnl = p_scb->chnl,
                               .hndl = p_scb->hndl,
                               .bd_addr = p_scb->PeerAddress(),
                               .status = BTA_AV_FAIL_GET_CAP,
                               .starting = bta_av_chk_start(p_scb),
                               .edr = 0,
                               .sep = AVDT_TSEP_INVALID,
                           }};
    /* set the state back to initial state */
    bta_av_set_scb_sst_init(p_scb);

    if (p_scb->seps[p_scb->sep_idx].tsep == AVDT_TSEP_SRC) {
      open.sep = AVDT_TSEP_SNK;
      bta_av_data.open.sep = AVDT_TSEP_SNK;
    } else if (p_scb->seps[p_scb->sep_idx].tsep == AVDT_TSEP_SNK) {
      open.sep = AVDT_TSEP_SRC;
      bta_av_data.open.sep = AVDT_TSEP_SRC;
    }

    APPL_TRACE_ERROR(
        "%s: there is already an active connection: peer_addr=%s chnl=%d "
        "hndl=0x%x status=%d starting=%d edr=%d",
        __func__, ADDRESS_TO_LOGGABLE_CSTR(open.bd_addr), open.chnl, open.hndl,
        open.status, open.starting, open.edr);
        __func__, ADDRESS_TO_LOGGABLE_CSTR(bta_av_data.open.bd_addr),
        bta_av_data.open.chnl, bta_av_data.open.hndl, bta_av_data.open.status,
        bta_av_data.open.starting, bta_av_data.open.edr);

    tBTA_AV bta_av_data;
    bta_av_data.open = open;
    (*bta_av_cb.p_cback)(BTA_AV_OPEN_EVT, &bta_av_data);
  } else {
    AVDT_DisconnectReq(p_scb->PeerAddress(), &bta_av_proc_stream_evt);