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

Commit a35c2773 authored by Zach Johnson's avatar Zach Johnson Committed by Gerrit Code Review
Browse files

Merge changes I51ab4137,I338026a9,I4e366329

* changes:
  btu_trace_level is already set by default
  Remove unused parameter from btu_task_start_up
  Remove unused parameters from btu_task_shut_down
parents 6455809a a7f3195a
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ using bluetooth::common::MessageLoopThread;

MessageLoopThread bt_startup_thread("bt_startup_thread");

void btu_task_start_up(void* context);
void btu_task_shut_down(void* context);
void btu_task_start_up();
void btu_task_shut_down();

/*****************************************************************************
 *
@@ -95,7 +95,6 @@ void btu_free_core() {
 *
 *****************************************************************************/
void BTU_StartUp() {
  btu_trace_level = HCI_INITIAL_TRACE_LEVEL;
  bt_startup_thread.StartUp();
  if (!bt_startup_thread.EnableRealTimeScheduling()) {
    LOG(ERROR) << __func__ << ": Unable to set real time scheduling policy for "
@@ -103,8 +102,7 @@ void BTU_StartUp() {
    BTU_ShutDown();
    return;
  }
  if (!bt_startup_thread.DoInThread(FROM_HERE,
                                    base::Bind(btu_task_start_up, nullptr))) {
  if (!bt_startup_thread.DoInThread(FROM_HERE, base::Bind(btu_task_start_up))) {
    LOG(ERROR) << __func__ << ": Unable to continue start-up on "
               << bt_startup_thread;
    BTU_ShutDown();
@@ -113,6 +111,6 @@ void BTU_StartUp() {
}

void BTU_ShutDown() {
  btu_task_shut_down(nullptr);
  btu_task_shut_down();
  bt_startup_thread.ShutDown();
}
+2 −2
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ bt_status_t do_in_main_thread_delayed(const base::Location& from_here,
  return BT_STATUS_SUCCESS;
}

void btu_task_start_up(UNUSED_ATTR void* context) {
void btu_task_start_up() {
  LOG(INFO) << "Bluetooth chip preload is complete";

  /* Initialize the mandatory core stack control blocks
@@ -141,7 +141,7 @@ void btu_task_start_up(UNUSED_ATTR void* context) {
  }
}

void btu_task_shut_down(UNUSED_ATTR void* context) {
void btu_task_shut_down() {
  // Shutdown message loop on task completed
  main_thread.ShutDown();

+4 −4
Original line number Diff line number Diff line
@@ -60,8 +60,8 @@ class TimeoutHelper {
TimeoutHelper helper;

// External function definitions
void btu_task_start_up(void* context);
void btu_task_shut_down(void* context);
void btu_task_start_up();
void btu_task_shut_down();

/* Below are methods and variables that must be implemented if we don't want to
 * compile the whole stack. They will be removed, or changed into mocks one by
@@ -95,13 +95,13 @@ class BtuMessageLoopTest : public testing::Test {
    bt_startup_thread.StartUp();
    // btu_task_start_up calls btif_transfer_context to let the stack know
    // start up is finished
    btu_task_start_up(nullptr);
    btu_task_start_up();
    helper.wait(5, base::Bind(&BtuMessageLoopTest::Fail, base::Unretained(this),
                              "BTU startup timed out"));
  }

  void TearDown() override {
    btu_task_shut_down(nullptr);
    btu_task_shut_down();
    alarm_cleanup();
    bt_startup_thread.ShutDown();
  }