Also, removed the OSI module's start_up and shut_down steps,
because now they are no-op.
Bug:
21558791
Change-Id: I24259b327f399af57c37937111158baa9704f644
#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;
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}
};
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();
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);
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__);
}
// |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);
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;
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;
}
void AlarmTestHarness::TearDown() {
- alarm_shutdown();
alarm_cleanup();
timer_delete(timer);
AllocationTestHarness::TearDown();