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

Commit a33b07b9 authored by Cheney Ni's avatar Cheney Ni
Browse files

A2DP: Clear local pending flags while AV is stable

There was a timing issue that the local pending state was cleared, AV
state was transitioning from started to opened, and was still saw as
started before entered the opened state. This caused a mismatched
between Bluetooth stack and audio HAL, and since we would clear those
local pending flags while entring opened state, it was redundant to
clear the state before the transition.

Bug: 140609685
Test: A2DP playback manually
Change-Id: Ie60bc9c432faa5038340f57da18282255ea5c7c4
parent eae6653e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2109,10 +2109,8 @@ bool BtifAvStateMachine::StateStarted::ProcessEvent(uint32_t event,
        state = BTAV_AUDIO_STATE_STOPPED;
      }

      // Suspend completed, clear pending status
      peer_.ClearFlags(BtifAvPeer::kFlagLocalSuspendPending);

      btif_report_audio_state(peer_.PeerAddress(), state);
      // Suspend completed, clear local pending flags while entering Opened
      peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateOpened);
    } break;