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

Commit 1ea304fa authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Yet another improvements on data path

If peer disconnects CIS by them self, make sure to remove data path.

Bug: 242936102
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: Id7db039dc7ca85bcddec80437d02c8cba0ba9098
parent 8128c60f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -727,6 +727,12 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
            AudioStreamDataPathState::DATA_PATH_ESTABLISHED) {
      value |= bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionOutput;
    }

    if (value == 0) {
      LOG_INFO("Data path was not set. Nothing to do here.");
      return;
    }

    IsoManager::GetInstance()->RemoveIsoDataPath(cis_conn_hdl, value);
  }

@@ -737,6 +743,11 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {

    FreeLinkQualityReports(leAudioDevice);

    /* If this is peer disconnecting CIS, make sure to clear data path */
    if (event->reason != HCI_ERR_CONN_CAUSE_LOCAL_HOST) {
      RemoveDataPathByCisHandle(leAudioDevice, event->cis_conn_hdl);
    }

    auto ases_pair = leAudioDevice->GetAsesByCisConnHdl(event->cis_conn_hdl);
    if (ases_pair.sink) {
      ases_pair.sink->data_path_state = AudioStreamDataPathState::CIS_ASSIGNED;