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

Commit 6ab964a4 authored by Jeremy Wu's avatar Jeremy Wu
Browse files

Floss: allow |stop_audio_request| to clear |REMOTE_SUSPEND| flag

In aosp/2191602 we blocked |stop_audio_request| when there is no active
audio device because it will set |a2dp_pending_cmd_| that can never be
cleared and block further |start_audio_request|s.

That proved insufficient, thus in aosp/2353503 we made sure when
|btif_av_stream_stop(RawAddress::kEmpty)| is called in
|stop_audio_request|, it will end up properly clearing
|a2dp_pending_cmd_|.

Now we found that in some cases, the |REMOTE_SUSPEND| flag can be stuck
and it seems to be naturally cleared if |StopRequest| is invoked
regardless of whether there is an active device.

This CL is effectively reverting aosp/2191602.

Bug: 309393828
Tag: #floss
Test: atest net_test_stack_btm
Test: do profile-switch 257 times
Change-Id: Iebac5f75ee8774296082524ecbbb0a0ba13f76c5
parent 679f869e
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -2726,11 +2726,6 @@ impl IBluetoothMedia for BluetoothMedia {
    }

    fn stop_audio_request(&mut self) {
        if !self.a2dp_audio_state.values().any(|state| *state == BtavAudioState::Started) {
            info!("No active stream on A2DP device, ignoring request to stop audio.");
            return;
        }

        debug!("Stop audio request");

        match self.a2dp.as_mut() {