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

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

Merge changes Id108e40c,I1ce27a47,Ia4fbf395,I9f3db595

* changes:
  Remove bte_main_postload_cfg, it does nothing
  Inline bte_main_enable
  lol resetting the controller on hardware error
  Who are we kidding...we can't reset state in process safely
parents a9975185 539bfff0
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -89,11 +89,6 @@ void BTA_EnableTestMode(void) {
                    base::Bind(base::IgnoreResult(BTM_EnableTestMode)));
}

/** Disable bluetooth device under test mode */
void BTA_DisableTestMode(void) {
  do_in_main_thread(FROM_HERE, base::Bind(BTM_DeviceReset));
}

/** This function sets the Bluetooth name of local device */
void BTA_DmSetDeviceName(char* p_name) {
  std::vector<uint8_t> name(BD_NAME_LEN);
+0 −12
Original line number Diff line number Diff line
@@ -996,18 +996,6 @@ extern tBTA_STATUS BTA_DisableBluetooth(void);
 ******************************************************************************/
extern void BTA_EnableTestMode(void);

/*******************************************************************************
 *
 * Function         BTA_DisableTestMode
 *
 * Description      Disable bluetooth device under test mode
 *
 *
 * Returns          None
 *
 ******************************************************************************/
extern void BTA_DisableTestMode(void);

/*******************************************************************************
 *
 * Function         BTA_DmSetDeviceName
+0 −2
Original line number Diff line number Diff line
@@ -212,10 +212,8 @@ void btif_remote_properties_evt(bt_status_t status, RawAddress* remote_addr,

void bte_load_did_conf(const char* p_path);
void bte_main_boot_entry(void);
void bte_main_enable(void);
void bte_main_disable(void);
void bte_main_cleanup(void);
void bte_main_postload_cfg(void);

bt_status_t btif_transfer_context(tBTIF_CBACK* p_cback, uint16_t event,
                                  char* p_params, int param_len,
+2 −3
Original line number Diff line number Diff line
@@ -368,8 +368,6 @@ void btif_enable_bluetooth_evt(tBTA_STATUS status) {
              &prop);
  }

  bte_main_postload_cfg();

  /* callback to HAL */
  if (status == BTA_SUCCESS) {
    uid_set = uid_set_create();
@@ -515,7 +513,8 @@ bt_status_t btif_dut_mode_configure(uint8_t enable) {
  if (enable == 1) {
    BTA_EnableTestMode();
  } else {
    BTA_DisableTestMode();
    // Can't do in process reset anyways - just quit
    kill(getpid(), SIGKILL);
  }
  return BT_STATUS_SUCCESS;
}
+14 −2
Original line number Diff line number Diff line
@@ -28,10 +28,12 @@
#include "btif_common.h"
#include "common/message_loop_thread.h"
#include "device/include/controller.h"
#include "hci/include/btsnoop.h"
#include "main/shim/shim.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "osi/include/semaphore.h"
#include "stack/include/btu.h"

// Temp includes
#include "bt_utils.h"
@@ -150,8 +152,18 @@ static void event_start_up_stack(UNUSED_ATTR void* context) {
  future_t* local_hack_future = future_new();
  hack_future = local_hack_future;

  // Include this for now to put btif config into a shutdown-able state
  bte_main_enable();
  if (bluetooth::shim::is_any_gd_enabled()) {
    LOG_INFO("%s Gd shim module enabled", __func__);
    module_shut_down(get_module(GD_IDLE_MODULE));
    module_start_up(get_module(GD_SHIM_MODULE));
    module_start_up(get_module(BTIF_CONFIG_MODULE));
  } else {
    module_start_up(get_module(BTIF_CONFIG_MODULE));
    module_start_up(get_module(BTSNOOP_MODULE));
    module_start_up(get_module(HCI_MODULE));
  }

  BTU_StartUp();

  if (future_await(local_hack_future) != FUTURE_SUCCESS) {
    LOG_ERROR("%s failed to start up the stack", __func__);
Loading