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

Commit 571fe10a authored by Zach Johnson's avatar Zach Johnson
Browse files

Inline bta_sys_hw_api_disable

Next patch will fix up hardware errors

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7af9deda6414ba743632bd35559d0e63cfe484a1
parent c7314094
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_disable();
void bta_sys_hw_evt_enabled();

#endif /* BTA_SYS_INT_H */
+0 −26
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@


void BTA_dm_on_hw_error();
void BTA_dm_on_hw_off();

/* system manager control block definition */
tBTA_SYS_CB bta_sys_cb;
@@ -112,9 +111,6 @@ static void bta_sys_sm_execute(tBTA_SYS_HW_EVT event) {
      break;
    case BTA_SYS_HW_STOPPING:
      switch (event) {
        case BTA_SYS_ERROR_EVT:
          bta_sys_hw_api_disable();
          break;
        default:
          break;
      }
@@ -146,28 +142,6 @@ void bta_sys_hw_error() {
  }
}

/*******************************************************************************
 *
 * Function         bta_sys_hw_disable
 *
 * Description     if no other module is using the HW, this function will call
 *                 (if defined) a user-macro to turn off the HW
 *
 *
 * Returns          success or failure
 *
 ******************************************************************************/
void bta_sys_hw_api_disable() {
  /* make sure the related SW blocks were stopped */
  bta_sys_disable();

  /* register which module we turn off */
  bta_sys_cb.bluetooth_active = false;

  bta_sys_set_state(BTA_SYS_HW_OFF);
  BTA_dm_on_hw_off();
}

/*******************************************************************************
 *
 * Function         bta_sys_event
+4 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
#include "main/shim/controller.h"

void BTA_dm_on_hw_on();
void BTA_dm_on_hw_off();

using bluetooth::common::MessageLoopThread;

@@ -278,7 +279,9 @@ static void event_shut_down_stack(UNUSED_ATTR void* context) {
  local_hack_future = future_new();
  hack_future = local_hack_future;

  bta_sys_hw_api_disable();
  bta_sys_disable();
  bta_sys_set_state(BTA_SYS_HW_OFF);
  BTA_dm_on_hw_off();

  module_shut_down(get_module(BTIF_CONFIG_MODULE));