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

Commit 8c0736b4 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

LeAudio: Improve group activation

It is reasonable to configure Le Audio group for the most
recent audio usage. This is most important when groups are
activated during the ongoing streams.

Tag: #feature
Bug: 269394021
Test: atest --host bluetooth_le_audio_client_test bluetooth_le_audio_test --no-bazel-mode
Change-Id: Idaf3ed1507820dbb9f53e8e52076167f7d574654
parent 81ac9be6
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -1057,11 +1057,12 @@ class LeAudioClientImpl : public LeAudioClient {
      }
    }

    /* Mini policy: Try configure audio HAL sessions with most frequent context.
    /* Mini policy: Try configure audio HAL sessions with most recent context.
     * If reconfiguration is not needed it means, context type is not supported.
     * If most frequest scenario is not supported, try to find first supported.
     * If most recent scenario is not supported, try to find first supported.
     */
    LeAudioContextType default_context_type = LeAudioContextType::UNSPECIFIED;
    LeAudioContextType default_context_type = configuration_context_type_;
    if (!group->IsContextSupported(default_context_type)) {
      if (group->IsContextSupported(LeAudioContextType::MEDIA)) {
        default_context_type = LeAudioContextType::MEDIA;
      } else {
@@ -1073,6 +1074,7 @@ class LeAudioClientImpl : public LeAudioClient {
          }
        }
      }
    }
    UpdateConfigAndCheckIfReconfigurationIsNeeded(group_id,
                                                  default_context_type);
    if (current_source_codec_config.IsInvalid() &&