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

Commit 9142b5e6 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix stopStream while late attach.

This patch adds test case which is verifing that group is properly stopped
when it is initiated while attaching device is changing ASE state trying to get to stream.

Bug: 331775328
Flag: Exempt, regression tested with unit test, new test added
Test: atest bluetooth_le_audio_test

Change-Id: I278161e8a48fad0d2cf171578a8753d7a456cc11
parent e7bd4bc6
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -2083,10 +2083,10 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
          log::debug(
              "Autonomus change for device {}, ase id {}. Just store it.",
              leAudioDevice->address_, ase->id);

          /* Since at least one ASE is in configured state, we should admit
           * group is configured state */
          if (group->HaveAllActiveDevicesAsesTheSameState(
                  AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED)) {
            group->SetState(AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED);
          }
          return;
        }

@@ -2360,6 +2360,14 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
        SetAseState(leAudioDevice, ase,
                    AseState::BTA_LE_AUDIO_ASE_STATE_QOS_CONFIGURED);

        if (group->GetTargetState() !=
            AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
          log::warn("{}, ase_id: {}, target state: {}", leAudioDevice->address_,
                    ase->id, ToString(group->GetTargetState()));
          group->PrintDebugState();
          return;
        }

        if (!leAudioDevice->HaveAllActiveAsesSameState(
                AseState::BTA_LE_AUDIO_ASE_STATE_QOS_CONFIGURED)) {
          /* More ASEs notification from this device has to come for this group
@@ -2855,6 +2863,14 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
        SetAseState(leAudioDevice, ase,
                    AseState::BTA_LE_AUDIO_ASE_STATE_ENABLING);

        if (group->GetTargetState() !=
            AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
          log::warn("{}, ase_id: {}, target state: {}", leAudioDevice->address_,
                    ase->id, ToString(group->GetTargetState()));
          group->PrintDebugState();
          return;
        }

        if (group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
          if (ase->cis_state < CisState::CONNECTING) {
            /* We are here because of the reconnection of the single device. */
+743 −12

File changed.

Preview size limit exceeded, changes collapsed.