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

Commit fea053dd authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix race condition in LE Create Connection Cancel handling

Message with description of the issue being fixed:
https://android-review.googlesource.com/c/platform/system/bt/+/646600#message-4781dd6e3e74d8b11ef716bbf58edbc64645f18c

Bug: 77429706
Change-Id: I1c076c7f033fc3d1aaf47887ce691b6325721d85
(cherry picked from commit 0d1d8e09e2cd2b14b4daa2d342eb40ccd66e401c)
parent e3cae61f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -352,10 +352,12 @@ void btm_ble_create_conn_cancel_complete(uint8_t* p) {
    /* This is a sign that logic around keeping connection state is broken */
    LOG(ERROR)
        << "Attempt to cancel LE connection, when no connection is pending.";
    if (btm_ble_get_conn_st() == BLE_CONN_CANCEL) {
      btm_ble_set_conn_st(BLE_CONN_IDLE);
      btm_ble_update_mode_operation(HCI_ROLE_UNKNOWN, nullptr, status);
    }
  }
}

void btm_send_hci_create_connection(
    uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,