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

Commit 939c3d32 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix handling CONFIGURED_BY_USER state

Make sure to notify Audio HAL that if needed after reconfiguration.

Bug: 222674521
Bug: 150670922
Test: atest --host bluetooth_le_audio_test bluetooth_le_audio_client_test

Change-Id: I9b4328e97e427c0186bc4eda3571d026fc3557c1
parent c6ecf4a2
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -3224,16 +3224,6 @@ class LeAudioClientImpl : public LeAudioClient {
        rxUnreceivedPackets, duplicatePackets);
  }

  void CompleteUserConfiguration(LeAudioDeviceGroup* group) {
    if (audio_sender_state_ == AudioState::RELEASING) {
      audio_sender_state_ = AudioState::IDLE;
    }

    if (audio_receiver_state_ == AudioState::RELEASING) {
      audio_receiver_state_ = AudioState::IDLE;
    }
  }

  void HandlePendingAvailableContexts(LeAudioDeviceGroup* group) {
    if (!group) return;

@@ -3280,7 +3270,12 @@ class LeAudioClientImpl : public LeAudioClient {
        SuspendAudio();
        break;
      case GroupStreamStatus::CONFIGURED_BY_USER:
        CompleteUserConfiguration(group);
        /* We are done with reconfiguration.
         * Clean state and if Audio HAL is waiting, cancel the request
         * so Audio HAL can Resume again.
         */
        CancelStreamingRequest();
        HandlePendingAvailableContexts(group);
        break;
      case GroupStreamStatus::CONFIGURED_AUTONOMOUS:
        /* This state is notified only when