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

Commit 819733cd authored by Etienne Ruffieux's avatar Etienne Ruffieux
Browse files

Make allow_low_latency run on main thread

Bug: 329537023
Test: m Bluetooth | Connect/Disconnect Opus supported device
Change-Id: Ie95054cbca65985fa810763fd1764bd4e202dabf
parent ba2e6728
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1049,7 +1049,15 @@ 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(
        FROM_HERE,
        base::BindOnce(
            bluetooth::audio::a2dp::set_audio_low_latency_mode_allowed,
            allowed));
  } else {
    bluetooth::audio::a2dp::set_audio_low_latency_mode_allowed(allowed);
  }
  return true;
}