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

Commit 5a98b28c authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Android (Google) Code Review
Browse files

Merge "Fix crashes in btif_sendmsg when worqueue not initialized" into nyc-dev

parents 45625ee5 2febd399
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -298,10 +298,21 @@ static void bt_jni_msg_ready(void *context) {

void btif_sendmsg(void *p_msg)
{
  if (!bt_jni_workqueue_thread) {
    BTIF_TRACE_ERROR("%s: message dropped, queue not initialized or gone", __func__);
    osi_free(p_msg);
    return;
  }

  thread_post(bt_jni_workqueue_thread, bt_jni_msg_ready, p_msg);
}

void btif_thread_post(thread_fn func, void *context) {
  if (!bt_jni_workqueue_thread) {
    BTIF_TRACE_ERROR("%s: call dropped, queue not initialized or gone", __func__);
    return;
  }

  thread_post(bt_jni_workqueue_thread, func, context);
}