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

Commit 51b8f535 authored by Omair Kamil's avatar Omair Kamil
Browse files

Delay the start of ranging until the rust module starts, since GATT server...

Delay the start of ranging until the rust module starts, since GATT server depends on the rust module.

Bug: 356462170
Bug: 313335632
Flag: scan_manager_refactor
Fix: 356462170
Test: atest BumbleBluetoothTests, atest pts-bot:GATT
Change-Id: Id008998ea22df9930b8816003473dda9615d6f67
parent 23529c08
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -330,11 +330,11 @@ static void event_start_up_stack(bluetooth::core::CoreInterface* interface,
  if (!com::android::bluetooth::flags::scan_manager_refactor()) {
    info("Starting rust module");
    module_start_up(get_local_module(RUST_MODULE));
  }
    if (com::android::bluetooth::flags::channel_sounding_in_stack()) {
      bluetooth::ras::GetRasServer()->Initialize();
      bluetooth::ras::GetRasClient()->Initialize();
    }
  }

  stack_is_running = true;
  info("finished");
@@ -395,6 +395,11 @@ static void event_shut_down_stack(ProfileStopCallback stopProfiles) {
static void event_start_up_rust_module(std::promise<void> promise) {
  info("is bringing up the Rust module");
  module_start_up(get_local_module(RUST_MODULE));
  if (com::android::bluetooth::flags::channel_sounding_in_stack()) {
    // GATT server requires the rust module to be running
    bluetooth::ras::GetRasServer()->Initialize();
    bluetooth::ras::GetRasClient()->Initialize();
  }
  promise.set_value();
  info("finished");
}