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

Commit 7fd3b7f3 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Call btm_ble_set_conn_st before on_connection_complete

on_connection_complete can trigger BTM_WhiteListRemove, which sends
"LE Create Connection Cancel" if the connection is pending.

Make sure connection state is updated before calling on_connection_complete.
Otherwise we send an unnecessary "LE Create Connection Cancel" request.

Bug: 112827989
Test: establish Direct connection with at least one device in the
      background connection procedure. Verify HCI snoop log content

Change-Id: I1b8532f4e58d5ab62b471ce0bde6c48640c83ff7
parent a007df68
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1958,6 +1958,10 @@ void btm_ble_conn_complete(uint8_t* p, UNUSED_ATTR uint16_t evt_len,
    }
    }
#endif
#endif


    if (role == HCI_ROLE_MASTER) {
      btm_ble_set_conn_st(BLE_CONN_IDLE);
    }

    gatt::connection_manager::on_connection_complete(bda);
    gatt::connection_manager::on_connection_complete(bda);
    btm_ble_connected(bda, handle, HCI_ENCRYPT_MODE_DISABLED, role, bda_type,
    btm_ble_connected(bda, handle, HCI_ENCRYPT_MODE_DISABLED, role, bda_type,
                      match);
                      match);
+0 −1
Original line number Original line Diff line number Diff line
@@ -285,7 +285,6 @@ void l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
      __func__, handle, type, conn_interval, conn_latency, conn_timeout);
      __func__, handle, type, conn_interval, conn_latency, conn_timeout);


  if (role == HCI_ROLE_MASTER) {
  if (role == HCI_ROLE_MASTER) {
    btm_ble_set_conn_st(BLE_CONN_IDLE);
    l2cb.is_ble_connecting = false;
    l2cb.is_ble_connecting = false;
  }
  }