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

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

leaudio: Mechanical refactor

Extract PTS function to separate function for better code readines

Bug: 331775328
Flag: EXEMPT, mechanical refactor
Test: atest bluetooth_le_audio_client_test
Change-Id: I2295ee457cdc98b8e7292c459044b6726f304284
parent 30b7f139
Loading
Loading
Loading
Loading
+24 −19
Original line number Diff line number Diff line
@@ -4770,9 +4770,8 @@ public:
    return remote_metadata;
  }

  /* Return true if stream is started */
  bool ReconfigureOrUpdateRemote(LeAudioDeviceGroup* group, int remote_direction) {
    if (stack_config_get_interface()->get_pts_force_le_audio_multiple_contexts_metadata()) {
  bool ReconfigureOrUpdateRemoteForPTS(LeAudioDeviceGroup* group, int remote_direction) {
    log::info("{}", group->group_id_);
    // Use common audio stream contexts exposed by the PTS
    auto override_contexts = AudioContexts(0xFFFF);
    for (auto device = group->GetFirstDevice(); device != nullptr;
@@ -4794,6 +4793,12 @@ public:
    return GroupStream(active_group_id_, new_configuration_context, remote_contexts);
  }

  /* Return true if stream is started */
  bool ReconfigureOrUpdateRemote(LeAudioDeviceGroup* group, int remote_direction) {
    if (stack_config_get_interface()->get_pts_force_le_audio_multiple_contexts_metadata()) {
      return ReconfigureOrUpdateRemoteForPTS(group, remote_direction);
    }

    /* When the local sink and source update their metadata, we need to come up
     * with a coherent set of contexts for either one or both directions,
     * especially when bidirectional scenarios can be triggered be either sink