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

Commit 7162c7da authored by Chris Manton's avatar Chris Manton
Browse files

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

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

Change-Id: I7cb639ffb543a665b741ea42267b9bd51a6f5a7e
parent d3413067
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -678,18 +678,23 @@ void bta_av_role_res(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {

      if (p_data->role_res.hci_status != HCI_SUCCESS) {
        /* Open failed because of role switch. */
        tBTA_AV_OPEN av_open;
        av_open.bd_addr = p_scb->PeerAddress();
        av_open.chnl = p_scb->chnl;
        av_open.hndl = p_scb->hndl;
        av_open.status = BTA_AV_FAIL_ROLE;
        tBTA_AV bta_av_data = {
            .open =
                {
                    .chnl = p_scb->chnl,
                    .hndl = p_scb->hndl,
                    .bd_addr = p_scb->PeerAddress(),
                    .status = BTA_AV_FAIL_ROLE,
                    .starting = false,
                    .edr = 0,
                    .sep = AVDT_TSEP_INVALID,
                },
        };
        if (p_scb->seps[p_scb->sep_idx].tsep == AVDT_TSEP_SRC) {
          av_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) {
          av_open.sep = AVDT_TSEP_SRC;
          bta_av_data.open.sep = AVDT_TSEP_SRC;
        }
        tBTA_AV bta_av_data;
        bta_av_data.open = av_open;
        (*bta_av_cb.p_cback)(BTA_AV_OPEN_EVT, &bta_av_data);
      } else {
        /* Continue av open process */