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

Commit bcde3cb3 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

Fix crash when removing bond to HID device am: b6f493cb

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1543151

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5923c66912ae7b99cc1d46cca1c9d63e80f27eb0
parents ad1f7555 b6f493cb
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -469,8 +469,13 @@ void btif_hh_remove_device(RawAddress bd_addr) {

  /* need to notify up-layer device is disconnected to avoid state out of sync
   * with up-layer */
  HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr),

  do_in_jni_thread(base::Bind(
      [](RawAddress bd_addr) {
        HAL_CBACK(bt_hh_callbacks, connection_state_cb, &bd_addr,
                  BTHH_CONN_STATE_DISCONNECTED);
      },
      p_dev->bd_addr));

  p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN;
  p_dev->dev_handle = BTA_HH_INVALID_HANDLE;