diff options
author | Pradeep Panigrahi <pradeepp@codeaurora.org> | 2016-01-22 14:30:26 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-02-02 00:21:43 -0800 |
commit | 5b1ce4753babf2985a863d8413c36be22065cba1 (patch) | |
tree | 5fe13a36fc2d2ee24780f14459aa2daf7134a0d1 | |
parent | af69c1e623a79119e9b8180d23671a661bdb1eab (diff) | |
download | android_system_bt-5b1ce4753babf2985a863d8413c36be22065cba1.tar.gz android_system_bt-5b1ce4753babf2985a863d8413c36be22065cba1.tar.bz2 android_system_bt-5b1ce4753babf2985a863d8413c36be22065cba1.zip |
Bluetooth: Enforce BT state check during GATT operations.
Enforce BT state check when BLE Apps call into GATT, to handle
scenarios in which delayed call from BLE App to disconnect/close
comes after the BT is OFF. This would prevent bluetooth crash in
such scenarios.
Change-Id: I7bf501abd023e478d25cbe6ee861dfc50eff05db
CRs-fixed: 960933
-rw-r--r-- | btif/src/btif_core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c index 1fc263c08..9b4494e05 100644 --- a/btif/src/btif_core.c +++ b/btif/src/btif_core.c @@ -318,11 +318,13 @@ static void bt_jni_msg_ready(void *context) { void btif_sendmsg(void *p_msg) { - thread_post(bt_jni_workqueue_thread, bt_jni_msg_ready, p_msg); + if(bt_jni_workqueue_thread != NULL) + thread_post(bt_jni_workqueue_thread, bt_jni_msg_ready, p_msg); } void btif_thread_post(thread_fn func, void *context) { - thread_post(bt_jni_workqueue_thread, func, context); + if(bt_jni_workqueue_thread != NULL) + thread_post(bt_jni_workqueue_thread, func, context); } static bool fetch_vendor_addr (bt_bdaddr_t *local_addr) |