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

Commit 8a3f31bf authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "HH: Fix crash when calling JNI callback using main thread"

parents 46f4a6e7 42594fed
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -601,10 +601,13 @@ bt_status_t btif_hh_connect(const RawAddress* bd_addr) {
  btif_hh_cb.pending_conn_address = *bd_addr;
  BTA_HhOpen(*bd_addr);

  // TODO(jpawlowski); make cback accept const and remove tmp!
  auto tmp = *bd_addr;
  HAL_CBACK(bt_hh_callbacks, connection_state_cb, &tmp,
  do_in_jni_thread(
      base::Bind(
          [](RawAddress *bd_addr) {
            HAL_CBACK(bt_hh_callbacks, connection_state_cb, bd_addr,
                BTHH_CONN_STATE_CONNECTING);
          },
          (RawAddress*)bd_addr));
  return BT_STATUS_SUCCESS;
}