diff options
author | Kausik Sinnaswamy <kausik@broadcom.com> | 2012-04-09 20:09:44 +0530 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:15 -0700 |
commit | b5dc70a1f69f8607f28956cf4bbe94e6183e982f (patch) | |
tree | 7815fa8e719025afb025885e18a68c9d56a6c6c4 | |
parent | ee20641263a5f34fe6c8dab176d95e07243657b1 (diff) | |
download | external_bluetooth_bluedroid-b5dc70a1f69f8607f28956cf4bbe94e6183e982f.zip external_bluetooth_bluedroid-b5dc70a1f69f8607f28956cf4bbe94e6183e982f.tar.gz external_bluetooth_bluedroid-b5dc70a1f69f8607f28956cf4bbe94e6183e982f.tar.bz2 |
To improve enable/disable stability, ensure that GKI buffer pool gets
reset/reclaimed after every enable/disable cycle
Change-Id: Ifc84b9bdaefa91096fe3da369d31884bbac8eaa0
-rwxr-xr-x | btif/src/btif_core.c | 9 | ||||
-rw-r--r-- | main/bte_main.c | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c index 19f26aa..47d09f2 100755 --- a/btif/src/btif_core.c +++ b/btif/src/btif_core.c @@ -281,12 +281,12 @@ static void btif_task(UINT32 params) GKI_task_self_cleanup(BTIF_TASK); + bte_main_shutdown(); + if (btif_shutdown_pending) { btif_shutdown_pending = 0; - bte_main_shutdown(); - /* shutdown complete, all events notified and we reset HAL callbacks */ bt_hal_cbacks = NULL; } @@ -369,6 +369,9 @@ bt_status_t btif_enable_bluetooth(void) LOGI("btif_enable_bluetooth"); + /* initialize OS */ + GKI_init(); + if (btif_enabled == 1) { LOGD("already enabled\n"); @@ -447,7 +450,6 @@ void btif_enable_bluetooth_evt(tBTA_STATUS status, BD_ADDR local_bd) ** Returns void ** *******************************************************************************/ - bt_status_t btif_disable_bluetooth(void) { tBTA_STATUS status; @@ -459,7 +461,6 @@ bt_status_t btif_disable_bluetooth(void) } BTIF_TRACE_DEBUG1("%s", __FUNCTION__); - //cleanup rfcomm & l2cap api btif_sock_cleanup(); status = BTA_DisableBluetooth(); diff --git a/main/bte_main.c b/main/bte_main.c index 7707d48..3cf6a96 100644 --- a/main/bte_main.c +++ b/main/bte_main.c @@ -143,9 +143,6 @@ void bte_main_in_hw_init(void) ******************************************************************************/ void bte_main_boot_entry(void) { - /* initialize OS */ - GKI_init(); - bte_main_in_hw_init(); bte_load_conf(BTE_STACK_CONF_FILE); @@ -173,7 +170,7 @@ void bte_main_shutdown() bt_vendor_if->cleanup(); #endif - bt_vendor_if = NULL; + //bt_vendor_if = NULL; GKI_shutdown(); } |