From 13fe711de4e0b68220cfdeca6fc000d0f1364d62 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Wed, 11 Nov 2020 11:25:16 -0800 Subject: [PATCH] Clean up user apps before GD is shutdown GATT, L2C, SDP, BTM depend on GD core modules if GD is enabled. Stop them first before GD. Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I8f3029d396fc05878a1ffa95ef935b4a5fa1cbd1 --- btif/src/stack_manager.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/btif/src/stack_manager.cc b/btif/src/stack_manager.cc index 26ced7a85..db5b87d91 100644 --- a/btif/src/stack_manager.cc +++ b/btif/src/stack_manager.cc @@ -291,6 +291,11 @@ static void event_shut_down_stack(UNUSED_ATTR void* context) { future_await(local_hack_future); + gatt_free(); + l2c_free(); + sdp_free(); + btm_free(); + if (bluetooth::shim::is_any_gd_enabled()) { LOG_INFO("%s Gd shim module disabled", __func__); module_shut_down(get_module(GD_SHIM_MODULE)); @@ -304,11 +309,6 @@ static void event_shut_down_stack(UNUSED_ATTR void* context) { module_clean_up(get_module(BTE_LOGMSG_MODULE)); - gatt_free(); - l2c_free(); - sdp_free(); - btm_free(); - module_shut_down(get_module(CONTROLLER_MODULE)); // Doesn't do any work, just // puts it in a restartable // state -- 2.11.0