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

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

leaudio: Add priority to GAME context type

Bug: 232898053
Test: atest BluetoothInstrumentationTests
sponsor: @jpawlowski
Change-Id: I9104254b26e3564cb1e16fc58bdfeb8eeda634ca
(cherry picked from commit ad5dcde1)
parent 4f957ae2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3119,12 +3119,16 @@ class LeAudioClientImpl : public LeAudioClient {

  LeAudioContextType ChooseContextType(
      std::vector<LeAudioContextType>& available_contents) {
    /* Mini policy. Voice is prio 1, media is prio 2 */
    /* Mini policy. Voice is prio 1, game prio 2, media is prio 3 */
    auto iter = find(available_contents.begin(), available_contents.end(),
                     LeAudioContextType::CONVERSATIONAL);
    if (iter != available_contents.end())
      return LeAudioContextType::CONVERSATIONAL;

    iter = find(available_contents.begin(), available_contents.end(),
                LeAudioContextType::GAME);
    if (iter != available_contents.end()) return LeAudioContextType::GAME;

    iter = find(available_contents.begin(), available_contents.end(),
                LeAudioContextType::MEDIA);
    if (iter != available_contents.end()) return LeAudioContextType::MEDIA;