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

Commit 2fbe0b0f authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

SM: Ensure we cannot cancel a pairing handler twice. am: bcdc4fb8

Change-Id: I5d229f145c1057726414b518b4770cbddf5ebabe
parents eda25667 bcdc4fb8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ void ClassicPairingHandler::Initiate(bool locally_initiated, hci::IoCapability i
}

void ClassicPairingHandler::Cancel() {
  if (is_cancelled_) return;
  is_cancelled_ = true;
  PairingResultOrFailure result = PairingResult();
  if (last_status_ != hci::ErrorCode::SUCCESS) {
    result = PairingFailure(hci::ErrorCodeText(last_status_));
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ class ClassicPairingHandler : public PairingHandler {
  UI* user_interface_;
  os::Handler* user_interface_handler_;
  std::string device_name_;
  bool is_cancelled_ = false;

  hci::ErrorCode last_status_ = hci::ErrorCode::UNKNOWN_HCI_COMMAND;
  bool locally_initiated_ = false;