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

Commit 828ff867 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Move callback to dispatch thread

Change the thread that the timeout posts a connection request event to
so that the state machine handles calling the callback on the correct
thread to prevent a JNI crash.

Bug: 32754737
Test: Manually paired a device that normally crashes phone
Change-Id: I2c3384feaa404cc583e81b2df994b7cbd079d25d
parent 769318bb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -231,8 +231,8 @@ static void btif_initiate_av_open_timer_timeout(UNUSED_ATTR void* data) {
      connect_req.uuid = UUID_SERVCLASS_AUDIO_SINK;
    else if (bt_av_src_callbacks != NULL)
      connect_req.uuid = UUID_SERVCLASS_AUDIO_SOURCE;
    btif_sm_dispatch(btif_av_cb.sm_handle, BTIF_AV_CONNECT_REQ_EVT,
                     (char*)&connect_req);
    btif_dispatch_sm_event(BTIF_AV_CONNECT_REQ_EVT, (char*)&connect_req,
                           sizeof(connect_req));
  } else {
    BTIF_TRACE_ERROR("%s No connected RC peers", __func__);
  }