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

Commit 69f1ba34 authored by Zach Johnson's avatar Zach Johnson
Browse files

Rename bte_main_boot_entry, and pull out irrelevant module inits

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I26d9f4890b14739d0b0566366597356e8e69d3fa
parent 6c51b479
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ void btif_remote_properties_evt(bt_status_t status, RawAddress* remote_addr,
                                uint32_t num_props, bt_property_t* p_props);

void bte_load_did_conf(const char* p_path);
void bte_main_boot_entry(void);
void bte_main_init(void);
void bte_main_cleanup(void);

bt_status_t btif_transfer_context(tBTIF_CBACK* p_cback, uint16_t event,
+6 −1
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@
#include "bta_dm_int.h"
#include "btif/include/btif_pan.h"
#include "btif/include/btif_sock.h"
#include "device/include/interop.h"
#include "internal_include/stack_config.h"
#include "main/shim/controller.h"

void main_thread_shut_down();
@@ -154,7 +156,10 @@ static void event_init_stack(void* context) {
    }
    module_init(get_module(BTIF_CONFIG_MODULE));
    btif_init_bluetooth();
    bte_main_boot_entry();

    module_init(get_module(INTEROP_MODULE));
    bte_main_init();
    module_init(get_module(STACK_CONFIG_MODULE));

    // stack init is synchronous, so no waiting necessary here
    stack_is_initialized = true;
+1 −14
Original line number Diff line number Diff line
@@ -92,18 +92,7 @@ void post_to_main_message_loop(const base::Location& from_here, BT_HDR* p_msg) {
  }
}

/******************************************************************************
 *
 * Function         bte_main_boot_entry
 *
 * Description      BTE MAIN API - Entry point for BTE chip/stack initialization
 *
 * Returns          None
 *
 *****************************************************************************/
void bte_main_boot_entry(void) {
  module_init(get_module(INTEROP_MODULE));

void bte_main_init(void) {
  hci = hci_layer_get_interface();
  if (!hci) {
    LOG_ERROR("%s could not get hci layer interface.", __func__);
@@ -111,8 +100,6 @@ void bte_main_boot_entry(void) {
  }

  hci->set_data_cb(base::Bind(&post_to_main_message_loop));

  module_init(get_module(STACK_CONFIG_MODULE));
}

/******************************************************************************