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

Commit ff210940 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I164532c6,Ie52a718d into main

* changes:
  btif_a2dp_source: Run a2dp::set_audio_low_latency_mode_allowed on bt_a2dp_source_worker_thread
  Flags 24Q3: Remove a2dp_async_allow_low_latency
parents 9479db36 392e1aff
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -31,16 +31,6 @@ flag {
    }
}

flag {
    name: "a2dp_async_allow_low_latency"
    namespace: "bluetooth"
    description: "Make allow_low_latency run on main thread"
    bug : "339368380"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "a2dp_ignore_started_when_responder"
    namespace: "bluetooth"
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ bool btif_a2dp_source_restart_session(const RawAddress& old_peer_address,
// streaming session for |peer_address|.
bool btif_a2dp_source_end_session(const RawAddress& peer_address);

// Update allowed low latency modes for the active session.
void btif_a2dp_source_allow_low_latency_audio(bool allowed);

// Shutdown the A2DP Source module.
// This function should be called by the BTIF state machine to stop streaming.
void btif_a2dp_source_shutdown(std::promise<void>);
+2 −7
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@
#include "bta/include/bta_vc_api.h"
#include "btif/avrcp/avrcp_service.h"
#include "btif/include/btif_a2dp.h"
#include "btif/include/btif_a2dp_source.h"
#include "btif/include/btif_api.h"
#include "btif/include/btif_av.h"
#include "btif/include/btif_bqr.h"
@@ -1117,13 +1118,7 @@ static int set_dynamic_audio_buffer_size(int codec, int size) {
}

static bool allow_low_latency_audio(bool allowed, const RawAddress& /* address */) {
  log::info("{}", allowed);
  if (com::android::bluetooth::flags::a2dp_async_allow_low_latency()) {
    do_in_main_thread(
            base::BindOnce(bluetooth::audio::a2dp::set_audio_low_latency_mode_allowed, allowed));
  } else {
    bluetooth::audio::a2dp::set_audio_low_latency_mode_allowed(allowed);
  }
  btif_a2dp_source_allow_low_latency_audio(allowed);
  return true;
}

+8 −0
Original line number Diff line number Diff line
@@ -515,6 +515,14 @@ static void btif_a2dp_source_end_session_delayed(const RawAddress& peer_address)
  }
}

void btif_a2dp_source_allow_low_latency_audio(bool allowed) {
  log::info("allowed={}", allowed);

  btif_a2dp_source_thread.DoInThread(
          FROM_HERE,
          base::BindOnce(bluetooth::audio::a2dp::set_audio_low_latency_mode_allowed, allowed));
}

void btif_a2dp_source_shutdown(std::promise<void> shutdown_complete_promise) {
  log::info("state={}", btif_a2dp_source_cb.StateStr());