OSDN Git Service

Remove btif_disable_bluetooth_evt
authorZach Johnson <zachoverflow@google.com>
Thu, 13 Aug 2020 17:38:07 +0000 (10:38 -0700)
committerZach Johnson <zachoverflow@google.com>
Thu, 13 Aug 2020 17:51:34 +0000 (10:51 -0700)
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

btif/include/btif_common.h
btif/src/btif_core.cc
btif/src/btif_dm.cc
btif/src/stack_manager.cc

index 9743ccb..9c31aee 100644 (file)
@@ -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,
index 785c7c9..57c3141 100644 (file)
@@ -388,29 +388,6 @@ void btif_enable_bluetooth_evt() {
 
 /*******************************************************************************
  *
- * 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
  *
  * Description      Cleanup BTIF state.
index 4ff55b4..4d0f351 100644 (file)
@@ -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:
index 339939a..9b03015 100644 (file)
@@ -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