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

Commit 35cfd339 authored by Zach Johnson's avatar Zach Johnson
Browse files

Remove btif_disable_bluetooth_evt

signal future where it would have been called,

and move contents into stack manager

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I30f310f6e0481fd653b66598f99e72e47b4d51e3
parent bd2b9c6f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -204,7 +204,6 @@ int btif_is_enabled(void);
 * BTIF_Events
 */
void btif_enable_bluetooth_evt();
void btif_disable_bluetooth_evt(void);
void btif_adapter_properties_evt(bt_status_t status, uint32_t num_props,
                                 bt_property_t* p_props);
void btif_remote_properties_evt(bt_status_t status, RawAddress* remote_addr,
+0 −23
Original line number Diff line number Diff line
@@ -386,29 +386,6 @@ void btif_enable_bluetooth_evt() {
  LOG_INFO("%s finished", __func__);
}

/*******************************************************************************
 *
 * Function         btif_disable_bluetooth_evt
 *
 * Description      Event notifying BT disable is now complete.
 *                  Terminates main stack tasks and notifies HAL
 *                  user with updated BT state.
 *
 * Returns          void
 *
 ******************************************************************************/

void btif_disable_bluetooth_evt() {
  LOG_INFO("%s entered", __func__);

  bte_main_disable();

  /* callback to HAL */
  future_ready(stack_manager_get_hack_future(), FUTURE_SUCCESS);

  LOG_INFO("%s finished", __func__);
}

/*******************************************************************************
 *
 * Function         btif_cleanup_bluetooth
+2 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#include "advertise_data_parser.h"
#include "bt_common.h"
#include "bta_gatt_api.h"
#include "btif/include/stack_manager.h"
#include "btif_api.h"
#include "btif_av.h"
#include "btif_bqr.h"
@@ -1739,7 +1740,7 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) {
        }
      }
      bluetooth::bqr::EnableBtQualityReport(false);
      btif_disable_bluetooth_evt();
      future_ready(stack_manager_get_hack_future(), FUTURE_SUCCESS);
      break;

    case BTA_DM_PIN_REQ_EVT:
+1 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ static void event_shut_down_stack(UNUSED_ATTR void* context) {
  module_shut_down(get_module(BTIF_CONFIG_MODULE));

  future_await(local_hack_future);
  bte_main_disable();
  module_shut_down(get_module(CONTROLLER_MODULE));  // Doesn't do any work, just
                                                    // puts it in a restartable
                                                    // state