merge in mnc-release history after reset to mnc-dev
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c
index 60da3b5..9593a42 100644
--- a/bta/dm/bta_dm_act.c
+++ b/bta/dm/bta_dm_act.c
@@ -4471,7 +4471,8 @@
             else
             {
                 sec_event.auth_cmpl.success = TRUE;
-                GATT_ConfigServiceChangeCCC(bda, TRUE, BT_TRANSPORT_LE);
+                if (!p_data->complt.smp_over_br)
+                    GATT_ConfigServiceChangeCCC(bda, TRUE, BT_TRANSPORT_LE);
             }
 
             if (bta_dm_cb.p_sec_cback)
diff --git a/btcore/src/osi_module.c b/btcore/src/osi_module.c
index a9fff61..9ba9685 100644
--- a/btcore/src/osi_module.c
+++ b/btcore/src/osi_module.c
@@ -25,15 +25,6 @@
 #include "osi/include/log.h"
 #include "osi/include/osi.h"
 
-future_t *osi_start_up(void) {
-  return NULL;
-}
-
-future_t *osi_shut_down(void) {
-  alarm_shutdown();
-  return NULL;
-}
-
 future_t *osi_clean_up(void) {
   alarm_cleanup();
   return NULL;
@@ -42,8 +33,8 @@
 const module_t osi_module = {
   .name = OSI_MODULE,
   .init = NULL,
-  .start_up = osi_start_up,
-  .shut_down = osi_shut_down,
+  .start_up = NULL,
+  .shut_down = NULL,
   .clean_up = osi_clean_up,
   .dependencies = {NULL}
 };
diff --git a/btif/src/bluetooth.c b/btif/src/bluetooth.c
index f842e5c..35d7501 100644
--- a/btif/src/bluetooth.c
+++ b/btif/src/bluetooth.c
@@ -124,9 +124,17 @@
   if (interface_ready())
     return BT_STATUS_DONE;
 
+  /*
+   * TODO: Temporary disable the allocation tracker initialization, and
+   * effectively the allocation tracker itself.
+   * This is a short-term workaround solution for several issues related to
+   * the usage of the allocation tracker.
+   */
+/*
 #ifdef BLUEDROID_DEBUG
   allocation_tracker_init();
 #endif
+*/
 
   bt_hal_cbacks = callbacks;
   stack_manager_get_interface()->init_stack();
diff --git a/btif/src/stack_manager.c b/btif/src/stack_manager.c
index 2fa8fc3..817e46f 100644
--- a/btif/src/stack_manager.c
+++ b/btif/src/stack_manager.c
@@ -126,7 +126,6 @@
   LOG_DEBUG("%s is bringing up the stack.", __func__);
   hack_future = future_new();
 
-  module_start_up(get_module(OSI_MODULE));
   // Include this for now to put btif config into a shutdown-able state
   module_start_up(get_module(BTIF_CONFIG_MODULE));
   bte_main_enable();
@@ -158,7 +157,6 @@
 
   future_await(hack_future);
   module_shut_down(get_module(CONTROLLER_MODULE)); // Doesn't do any work, just puts it in a restartable state
-  module_shut_down(get_module(OSI_MODULE));
 
   LOG_DEBUG("%s finished.", __func__);
   btif_thread_post(event_signal_stack_down, NULL);
@@ -186,10 +184,10 @@
 
   btif_shutdown_bluetooth();
   module_clean_up(get_module(BTIF_CONFIG_MODULE));
-  module_clean_up(get_module(OSI_MODULE));
   module_clean_up(get_module(BT_UTILS_MODULE));
 
   future_await(hack_future);
+  module_clean_up(get_module(OSI_MODULE));
   module_management_stop();
   LOG_DEBUG("%s finished.", __func__);
 }
diff --git a/osi/include/alarm.h b/osi/include/alarm.h
index 470c482..74a7302 100644
--- a/osi/include/alarm.h
+++ b/osi/include/alarm.h
@@ -52,9 +52,5 @@
 // |alarm| may not be NULL.
 void alarm_cancel(alarm_t *alarm);
 
-// Shuts down the alarm dispatch callback. To be called during module/stack
-// shutdown only.
-void alarm_shutdown(void);
-
 // Alarm-related state cleanup
 void alarm_cleanup(void);
diff --git a/osi/src/alarm.c b/osi/src/alarm.c
index 1ec090f..a9cd4dd 100644
--- a/osi/src/alarm.c
+++ b/osi/src/alarm.c
@@ -177,7 +177,7 @@
   pthread_mutex_unlock(&alarm->callback_lock);
 }
 
-void alarm_shutdown(void) {
+void alarm_cleanup(void) {
   // If lazy_initialize never ran there is nothing to do
   if (!alarms)
     return;
@@ -190,13 +190,6 @@
   semaphore_free(alarm_expired);
   alarm_expired = NULL;
   timer_delete(&timer);
-}
-
-void alarm_cleanup(void) {
-  // If lazy_initialize never ran there is nothing to do
-  if (!alarms)
-    return;
-
   list_free(alarms);
   alarms = NULL;
 
diff --git a/osi/src/allocation_tracker.c b/osi/src/allocation_tracker.c
index 7732d10..761e58d 100644
--- a/osi/src/allocation_tracker.c
+++ b/osi/src/allocation_tracker.c
@@ -69,6 +69,8 @@
   canary_size = strlen(canary);
 
   pthread_mutex_init(&lock, NULL);
+
+  pthread_mutex_lock(&lock);
   allocations = hash_map_new_internal(
     allocation_hash_map_size,
     hash_function_pointer,
@@ -76,19 +78,27 @@
     free,
     NULL,
     &untracked_calloc_allocator);
+  pthread_mutex_unlock(&lock);
 }
 
 // Test function only. Do not call in the normal course of operations.
 void allocation_tracker_uninit(void) {
+  if (!allocations)
+    return;
+
+  pthread_mutex_lock(&lock);
   hash_map_free(allocations);
   allocations = NULL;
+  pthread_mutex_unlock(&lock);
 }
 
 void allocation_tracker_reset(void) {
   if (!allocations)
     return;
 
+  pthread_mutex_lock(&lock);
   hash_map_clear(allocations);
+  pthread_mutex_unlock(&lock);
 }
 
 size_t allocation_tracker_expect_no_allocations(void) {
diff --git a/osi/test/AlarmTestHarness.cpp b/osi/test/AlarmTestHarness.cpp
index 98b25af..496c70d 100644
--- a/osi/test/AlarmTestHarness.cpp
+++ b/osi/test/AlarmTestHarness.cpp
@@ -52,7 +52,6 @@
 }
 
 void AlarmTestHarness::TearDown() {
-  alarm_shutdown();
   alarm_cleanup();
   timer_delete(timer);
   AllocationTestHarness::TearDown();