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

Commit 02482f38 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Łukasz Rymanowski (xWF)
Browse files

leaudio: Always start VBC timeout on Local Sink Suspend

To make sure there is no hanging configuration from the Local Sink, make
sure to start timeout.

Bug: 375334939
Test: atest bluetooth_le_audio_test
Flag: EXEMPT, regression tested with unit tests
Change-Id: Ib2df3fc444148a974a5f310d9db97a1b21a8d3bf
parent 129976ab
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -4310,6 +4310,11 @@ public:
                                            "r_state: " + ToString(audio_receiver_state_) +
                                                    ", s_state: " + ToString(audio_sender_state_));

    /* If the local sink direction is used, we want to monitor
     * if back channel is actually needed.
     */
    StartVbcCloseTimeout();

    /* Note: This callback is from audio hal driver.
     * Bluetooth peer is a Source for Audio Framework.
     * e.g. Peer is microphone.
@@ -4334,11 +4339,6 @@ public:
    if ((audio_sender_state_ == AudioState::IDLE) ||
        (audio_sender_state_ == AudioState::READY_TO_RELEASE)) {
      OnAudioSuspend();
    } else {
      /* If the local sink direction is used, we want to monitor
       * if back channel is actually needed.
       */
      StartVbcCloseTimeout();
    }

    log::info("OUT: audio_receiver_state_: {},  audio_sender_state_: {}",
+4 −3
Original line number Diff line number Diff line
@@ -9971,8 +9971,8 @@ TEST_F(UnicastTest, SwitchBetweenMicrophoneAndSoundEffectScenario) {
  LocalAudioSinkSuspend();
  SyncOnMainLoop();
  // VBC and Suspend
  ASSERT_EQ(1, get_func_call_count("alarm_set_on_mloop"));
  log::info("Expect VBC and Suspend timeouts to be started");
  ASSERT_EQ(2, get_func_call_count("alarm_set_on_mloop"));
  ASSERT_EQ(0, get_func_call_count("alarm_cancel"));
  log::info("Resume local source with touch tone - expect suspend timeout to be canceled");
@@ -9981,7 +9981,8 @@ TEST_F(UnicastTest, SwitchBetweenMicrophoneAndSoundEffectScenario) {
  LocalAudioSourceResume();
  SyncOnMainLoop();
  ASSERT_EQ(1, get_func_call_count("alarm_cancel"));
  log::info("Expect VBC and Suspend timeouts to be started");
  ASSERT_EQ(2, get_func_call_count("alarm_set_on_mloop"));
  auto group = streaming_groups.at(group_id);
  group->PrintDebugState();