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

Commit edb1bd07 authored by Zach Johnson's avatar Zach Johnson
Browse files

Flatten bta_sys_hw_api_enable

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7756a9a969283310ae4d38f0206f76f101329cf7
parent 7e3a55dd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ extern tBTA_SYS_CB bta_sys_cb;

/* functions used for BTA SYS HW state machine */
void bta_sys_hw_error();
void bta_sys_hw_api_enable();
void bta_sys_hw_api_disable();
void bta_sys_hw_evt_enabled();

+0 −24
Original line number Diff line number Diff line
@@ -167,30 +167,6 @@ void bta_sys_hw_error() {
  }
}

/*******************************************************************************
 *
 * Function         bta_sys_hw_enable
 *
 * Description     this function is called after API enable and HW has been
 *                 turned on
 *
 *
 * Returns          success or failure
 *
 ******************************************************************************/

void bta_sys_hw_api_enable() {
  if (!bta_sys_cb.bluetooth_active && bta_sys_cb.state != BTA_SYS_HW_ON) {
    /* register which HW module was turned on */
    bta_sys_cb.bluetooth_active = true;

    BTM_DeviceReset();
  } else {
    bta_sys_cb.bluetooth_active = true;
    BTA_dm_on_hw_on();
  }
}

/*******************************************************************************
 *
 * Function         bta_sys_hw_disable
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ static void event_start_up_stack(UNUSED_ATTR void* context) {
  bta_dm_enable(bte_dm_evt);

  bta_sys_set_state(BTA_SYS_HW_STARTING);
  bta_sys_hw_api_enable();
  BTM_DeviceReset();

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