OSDN Git Service

btu_task_shut_down -> main_thread_shut_down
authorZach Johnson <zachoverflow@google.com>
Thu, 13 Aug 2020 18:00:11 +0000 (11:00 -0700)
committerZach Johnson <zachoverflow@google.com>
Thu, 13 Aug 2020 18:00:50 +0000 (11:00 -0700)
pull out unrelated code into stack manager

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4c3ad4ff51cbc0b0240a824bb9be749aa5810e1b

btif/src/stack_manager.cc
stack/btu/btu_task.cc

index fe86a52..043ef1b 100644 (file)
@@ -69,7 +69,8 @@
 #include "btif/include/btif_sock.h"
 #include "main/shim/controller.h"
 
-void btu_task_shut_down();
+void main_thread_shut_down();
+void main_thread_start_up();
 void BTA_dm_on_hw_on();
 void BTA_dm_on_hw_off();
 
@@ -91,8 +92,6 @@ static void event_clean_up_stack(void* context);
 static void event_signal_stack_up(void* context);
 static void event_signal_stack_down(void* context);
 
-void main_thread_start_up();
-
 // Unvetted includes/imports, etc which should be removed or vetted in the
 // future
 static future_t* hack_future;
@@ -296,7 +295,11 @@ static void event_shut_down_stack(UNUSED_ATTR void* context) {
     module_shut_down(get_module(BTSNOOP_MODULE));
   }
 
-  btu_task_shut_down();
+  main_thread_shut_down();
+
+  module_clean_up(get_module(BTE_LOGMSG_MODULE));
+
+  btu_free_core();
 
   module_shut_down(get_module(CONTROLLER_MODULE));  // Doesn't do any work, just
                                                     // puts it in a restartable
index 819cd0e..c44203a 100644 (file)
@@ -118,11 +118,4 @@ void main_thread_start_up() {
   }
 }
 
-void btu_task_shut_down() {
-  // Shutdown message loop on task completed
-  main_thread.ShutDown();
-
-  module_clean_up(get_module(BTE_LOGMSG_MODULE));
-
-  btu_free_core();
-}
+void main_thread_shut_down() { main_thread.ShutDown(); }