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

Commit 43589532 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Bluetooth: Bring up storage once" am: 90756340 am: b352a564 am: e11315ed

parents 110e48d6 e11315ed
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -211,7 +211,6 @@ extern const module_t bt_utils_module;
extern const module_t bte_logmsg_module;
extern const module_t btif_config_module;
extern const module_t gd_controller_module;
extern const module_t gd_idle_module;
extern const module_t gd_shim_module;
extern const module_t interop_module;
extern const module_t osi_module;
@@ -228,7 +227,6 @@ const struct module_lookup module_table[] = {
    {BTE_LOGMSG_MODULE, &bte_logmsg_module},
    {BTIF_CONFIG_MODULE, &btif_config_module},
    {GD_CONTROLLER_MODULE, &gd_controller_module},
    {GD_IDLE_MODULE, &gd_idle_module},
    {GD_SHIM_MODULE, &gd_shim_module},
    {INTEROP_MODULE, &interop_module},
    {OSI_MODULE, &osi_module},
@@ -261,12 +259,12 @@ static void init_stack_internal(bluetooth::core::CoreInterface* interface) {

  module_init(get_local_module(DEVICE_IOT_CONFIG_MODULE));
  module_init(get_local_module(OSI_MODULE));
  module_start_up(get_local_module(GD_IDLE_MODULE));
  bte_main_init();
  module_start_up(get_local_module(GD_SHIM_MODULE));
  module_init(get_local_module(BTIF_CONFIG_MODULE));
  btif_init_bluetooth();

  module_init(get_local_module(INTEROP_MODULE));
  bte_main_init();
  module_init(get_local_module(STACK_CONFIG_MODULE));

  // stack init is synchronous, so no waiting necessary here
@@ -314,9 +312,7 @@ static void event_start_up_stack(bluetooth::core::CoreInterface* interface,
  hack_future = local_hack_future;

  LOG_INFO("%s Gd shim module enabled", __func__);
  module_shut_down(get_local_module(GD_IDLE_MODULE));
  get_btm_client_interface().lifecycle.btm_init();
  module_start_up(get_local_module(GD_SHIM_MODULE));
  module_start_up(get_local_module(BTIF_CONFIG_MODULE));

  l2c_init();
@@ -402,10 +398,7 @@ static void event_shut_down_stack(ProfileStopCallback stopProfiles) {
  sdp_free();
  get_btm_client_interface().lifecycle.btm_ble_free();

  LOG_INFO("%s Gd shim module disabled", __func__);
  module_shut_down(get_local_module(GD_SHIM_MODULE));
  get_btm_client_interface().lifecycle.btm_free();
  module_start_up(get_local_module(GD_IDLE_MODULE));

  hack_future = future_new();
  do_in_jni_thread(FROM_HERE, base::Bind(event_signal_stack_down, nullptr));
@@ -443,7 +436,8 @@ static void event_clean_up_stack(std::promise<void> promise,
  module_clean_up(get_local_module(DEVICE_IOT_CONFIG_MODULE));

  module_clean_up(get_local_module(OSI_MODULE));
  module_shut_down(get_local_module(GD_IDLE_MODULE));
  LOG_INFO("%s Gd shim module disabled", __func__);
  module_shut_down(get_local_module(GD_SHIM_MODULE));

  main_thread_shut_down();

+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};

module_t bt_utils_module;
module_t gd_controller_module;
module_t gd_idle_module;
module_t gd_shim_module;
module_t osi_module;
module_t rust_module;
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ uint8_t btu_trace_level = BT_TRACE_LEVEL_DEBUG;

module_t bt_utils_module;
module_t gd_controller_module;
module_t gd_idle_module;
module_t gd_shim_module;
module_t osi_module;
module_t rust_module;
+0 −13
Original line number Diff line number Diff line
@@ -23,11 +23,6 @@
#include "gd/common/init_flags.h"
#include "gd/os/log.h"

future_t* IdleModuleStartUp() {
  bluetooth::shim::Stack::GetInstance()->StartIdleMode();
  return kReturnImmediate;
}

future_t* ShimModuleStartUp() {
  bluetooth::shim::Stack::GetInstance()->StartEverything();
  return kReturnImmediate;
@@ -38,14 +33,6 @@ future_t* GeneralShutDown() {
  return kReturnImmediate;
}

EXPORT_SYMBOL extern const module_t gd_idle_module = {
    .name = GD_IDLE_MODULE,
    .init = kUnusedModuleApi,
    .start_up = IdleModuleStartUp,
    .shut_down = GeneralShutDown,
    .clean_up = kUnusedModuleApi,
    .dependencies = {kUnusedModuleDependencies}};

EXPORT_SYMBOL extern const module_t gd_shim_module = {
    .name = GD_SHIM_MODULE,
    .init = kUnusedModuleApi,
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
#include "main/shim/entry.h"
#include "osi/include/future.h"

static const char GD_IDLE_MODULE[] = "gd_idle_module";
static const char GD_SHIM_MODULE[] = "gd_shim_module";

constexpr future_t* kReturnImmediate = nullptr;
Loading