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

Commit fe762253 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

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
parent 583a8fd1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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