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

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

Merge "Only use gd storage if gd stack has been started up"

parents 72f9eb78 c1705d71
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ static const storage_config_t interface = {
};

static const storage_config_t* storage_config_get_interface() {
  if (bluetooth::shim::is_gd_shim_enabled()) {
  if (bluetooth::shim::is_gd_stack_started_up()) {
    return bluetooth::shim::storage_config_get_interface();
  } else {
    return &interface;
+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ static bluetooth::common::MessageLoopThread bt_shim_thread("bt_shim_thread");

static bool gd_shim_enabled_ = false;
static bool gd_shim_property_checked_ = false;
static bool gd_stack_started_up_ = false;

future_t* ShimModuleStartUp() {
  bt_shim_thread.StartUp();
@@ -37,10 +38,12 @@ future_t* ShimModuleStartUp() {
      << "Unable to start bt shim message loop thread.";
  module_start_up(get_module(GD_SHIM_BTM_MODULE));
  bluetooth::shim::StartGabeldorscheStack();
  gd_stack_started_up_ = true;
  return kReturnImmediate;
}

future_t* ShimModuleShutDown() {
  gd_stack_started_up_ = false;
  bluetooth::shim::StopGabeldorscheStack();
  module_shut_down(get_module(GD_SHIM_BTM_MODULE));
  bt_shim_thread.ShutDown();
@@ -66,3 +69,5 @@ bool bluetooth::shim::is_gd_shim_enabled() {
  }
  return gd_shim_enabled_;
}

bool bluetooth::shim::is_gd_stack_started_up() { return gd_stack_started_up_; }
+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,13 @@ namespace shim {
 */
bool is_gd_shim_enabled();

/**
 * Checks if the bluetooth gd stack has been started up.
 *
 * @return true if bluetooth gd stack is started, false otherwise.
 */
bool is_gd_stack_started_up();

/**
 * Posts a task on the shim message queue.
 *