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

Commit f53789f1 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Call BTA_VendorCleanup() during actual cleanup of the stack

Previously, BTA_VendorCleanup() was called during the shutdown
process, and this created race condition crashing the stack.

Bug: 28450506
Change-Id: Ibee90d406036862b95d18e2ef00b08b820c70f68
parent bf5d6c8d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -577,10 +577,6 @@ void btif_disable_bluetooth_evt(void)
    bte_main_enable_lpm(FALSE);
#endif

#if (BLE_INCLUDED == TRUE)
     BTA_VendorCleanup();
#endif

     bte_main_disable();

    /* callback to HAL */
@@ -601,6 +597,10 @@ bt_status_t btif_cleanup_bluetooth(void)
{
    BTIF_TRACE_DEBUG("%s", __FUNCTION__);

#if (BLE_INCLUDED == TRUE)
     BTA_VendorCleanup();
#endif

    btif_dm_cleanup();
    btif_jni_disassociate();
    btif_queue_release();
+5 −1
Original line number Diff line number Diff line
@@ -436,7 +436,11 @@ static uint8_t get_ble_resolving_list_max_size(void) {
}

static void set_ble_resolving_list_max_size(int resolving_list_max_size) {
  // Setting "resolving_list_max_size" to 0 is done during cleanup,
  // hence we ignore the "readable" flag already set to false during shutdown.
  if (resolving_list_max_size != 0) {
    assert(readable);
  }
  assert(ble_supported);
  ble_resolving_list_max_size = resolving_list_max_size;
}