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

Commit e035c0c0 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk Committed by Automerger Merge Worker
Browse files

le_audio: Allow to set up other than MEDIA as default context am: db312874...

le_audio: Allow to set up other than MEDIA as default context am: db312874 am: ee488a68 am: 31cb5a92

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2134461



Change-Id: Ia700b2b74e20e19176ad2962ce332b524278e52e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b6ca4822 31cb5a92
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -852,11 +852,24 @@ class LeAudioClientImpl : public LeAudioClient {
      }
    }

    /* Configure audio HAL sessions with most frequent context.
     * If reconfiguration is not needed it means, context type is not supported
    /* Try configure audio HAL sessions with most frequent 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.
     */
    LeAudioContextType default_context_type = LeAudioContextType::UNSPECIFIED;
    if (group->IsContextSupported(LeAudioContextType::MEDIA)) {
      default_context_type = LeAudioContextType::MEDIA;
    } else {
      for (LeAudioContextType context_type :
           le_audio::types::kLeAudioContextAllTypesArray) {
        if (group->IsContextSupported(context_type)) {
          default_context_type = context_type;
          break;
        }
      }
    }
    UpdateConfigAndCheckIfReconfigurationIsNeeded(group_id,
                                                  LeAudioContextType::MEDIA);
                                                  default_context_type);
    if (current_source_codec_config.IsInvalid() &&
        current_sink_codec_config.IsInvalid()) {
      LOG(WARNING) << __func__ << ", unsupported device configurations";