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

Commit b8a310f3 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix regression on data path removal

This patch fix typo regression after

b6523f3a leaudio: Fix for removing data path

Also improves unit test which catch that.

Bug: 242936102
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I346aafb6f2a364efe51179ed87434e16f4605a49
parent 1d4b1bb9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -718,12 +718,13 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
    uint8_t value = 0;

    if (ases_pair.sink && ases_pair.sink->data_path_state ==
                              AudioStreamDataPathState::CIS_ESTABLISHED) {
                              AudioStreamDataPathState::DATA_PATH_ESTABLISHED) {
      value |= bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput;
    }

    if (ases_pair.source && ases_pair.source->data_path_state ==
                              AudioStreamDataPathState::CIS_ESTABLISHED) {
    if (ases_pair.source &&
        ases_pair.source->data_path_state ==
            AudioStreamDataPathState::DATA_PATH_ESTABLISHED) {
      value |= bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionOutput;
    }
    IsoManager::GetInstance()->RemoveIsoDataPath(cis_conn_hdl, value);
+17 −3
Original line number Diff line number Diff line
@@ -1574,7 +1574,11 @@ TEST_F(StateMachineTest, testDisableSingle) {
  EXPECT_CALL(*mock_iso_manager_, CreateCig(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, EstablishCis(_)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, SetupIsoDataPath(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, RemoveIsoDataPath(_, _)).Times(1);
  EXPECT_CALL(
      *mock_iso_manager_,
      RemoveIsoDataPath(
          _, bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput))
      .Times(1);
  EXPECT_CALL(*mock_iso_manager_, DisconnectCis(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, RemoveCig(_)).Times(0);

@@ -1637,7 +1641,11 @@ TEST_F(StateMachineTest, testDisableMultiple) {
  EXPECT_CALL(*mock_iso_manager_, CreateCig(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, EstablishCis(_)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, SetupIsoDataPath(_, _)).Times(2);
  EXPECT_CALL(*mock_iso_manager_, RemoveIsoDataPath(_, _)).Times(2);
  EXPECT_CALL(
      *mock_iso_manager_,
      RemoveIsoDataPath(
          _, bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput))
      .Times(2);
  EXPECT_CALL(*mock_iso_manager_, DisconnectCis(_, _)).Times(2);
  EXPECT_CALL(*mock_iso_manager_, RemoveCig(_)).Times(0);

@@ -1695,7 +1703,13 @@ TEST_F(StateMachineTest, testDisableBidirectional) {
  EXPECT_CALL(*mock_iso_manager_, CreateCig(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, EstablishCis(_)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, SetupIsoDataPath(_, _)).Times(2);
  EXPECT_CALL(*mock_iso_manager_, RemoveIsoDataPath(_, _)).Times(1);
  EXPECT_CALL(
      *mock_iso_manager_,
      RemoveIsoDataPath(
          _,
          bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput |
              bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionOutput))
      .Times(1);
  EXPECT_CALL(*mock_iso_manager_, DisconnectCis(_, _)).Times(1);
  EXPECT_CALL(*mock_iso_manager_, RemoveCig(_)).Times(0);