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

Commit a548f216 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix unnecessary reconfiguration for Ringtone

When Volume Ring & Notification slider is used, then sample ringtone is
played along with metadata update.

If LeAudio is streaming and this point of time, BT stack might incorretly
interpret it as a need to reconfigure for the call.

Bug: 244683442
Test: atest BluetoothInstrumentationTests
Test: stream media and use the volume slider
Tag: #feature
Change-Id: I4a340ec0fd67960def5614926f7a3364ec6ed650
parent ded212c9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3110,8 +3110,12 @@ class LeAudioClientImpl : public LeAudioClient {

    if ((available_contexts &
         AudioContexts(static_cast<T>(LeAudioContextType::RINGTONE)))
            .any())
            .any()) {
      if (!in_call_) {
        return LeAudioContextType::MEDIA;
      }
      return LeAudioContextType::RINGTONE;
    }

    if ((available_contexts &
         AudioContexts(static_cast<T>(LeAudioContextType::MEDIA)))
+7 −1
Original line number Diff line number Diff line
@@ -3691,6 +3691,8 @@ TEST_F(UnicastTest, StartNotSupportedContextType) {
  uint8_t cis_count_out = 1;
  uint8_t cis_count_in = 0;

  LeAudioClient::Get()->SetInCall(true);

  // Audio sessions are started only when device gets active
  EXPECT_CALL(*mock_unicast_audio_source_, Start(_, _)).Times(1);
  EXPECT_CALL(*mock_audio_sink_, Start(_, _)).Times(1);
@@ -3706,7 +3708,11 @@ TEST_F(UnicastTest, StartNotSupportedContextType) {
  // Verify Data transfer on one audio source cis
  TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920);

  // Fallback scenario now supports 48Khz just like Media so we will reconfigure
  LeAudioClient::Get()->SetInCall(false);

  /* Fallback scenario now supports 48Khz just like Media so we will reconfigure
   * Note: Fallback is forced by the frequency on the remote device.
   */
  EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1);
  UpdateMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, true);