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

Commit 7c552d43 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes Ie8c7b6e3,I16e1c17d am: fc801fe9

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2024523



Change-Id: I8975b812a64f775bae506e1f90e331523f741e18
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6f20818e fc801fe9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -734,7 +734,7 @@ void SecurityManagerImpl::OnPairingFinished(security::PairingResultOrFailure pai

void SecurityManagerImpl::WipeLePairingHandler() {
  pending_le_pairing_.handler_.reset();
  pending_le_pairing_.connection_handle_ = 0;
  pending_le_pairing_.connection_handle_ = kInvalidConnectionHandle;
  pending_le_pairing_.address_ = hci::AddressWithType();
}

+3 −1
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ static constexpr hci::AuthenticationRequirements kDefaultAuthenticationRequireme

namespace internal {

static constexpr uint16_t kInvalidConnectionHandle = 0xFFFF;

struct LeFixedChannelEntry {
  std::unique_ptr<l2cap::le::FixedChannel> channel_;
  std::unique_ptr<os::EnqueueBuffer<packet::BasePacketBuilder>> enqueue_buffer_;
@@ -278,7 +280,7 @@ class SecurityManagerImpl : public channel::ISecurityManagerChannelListener, pub

  struct {
    hci::AddressWithType address_;
    uint16_t connection_handle_;
    uint16_t connection_handle_{kInvalidConnectionHandle};
    std::unique_ptr<PairingHandlerLe> handler_;
  } pending_le_pairing_;

+8 −1
Original line number Diff line number Diff line
@@ -143,6 +143,10 @@ void ClassicPairingHandler::OnNameRequestComplete(hci::Address address, bool suc
    device_name_ = tmp_name;
  }
  has_gotten_name_response_ = true;
  // For PIN Pairing
  if (is_legacy_pin_code_) {
    NotifyUiDisplayPinCodeInput();
  }
  // For SSP/Numeric comparison flow
  if (user_confirmation_request_) {
    this->OnReceive(*user_confirmation_request_);
@@ -178,7 +182,10 @@ void ClassicPairingHandler::OnReceive(hci::PinCodeRequestView packet) {
  LOG_INFO("Received: %s", hci::EventCodeText(packet.GetEventCode()).c_str());
  ASSERT_LOG(GetRecord()->GetPseudoAddress()->GetAddress() == packet.GetBdAddr(), "Address mismatch");
  is_legacy_pin_code_ = true;
  NotifyUiDisplayPinCodeInput();
  GetNameDbModule()->ReadRemoteNameRequest(
      GetRecord()->GetPseudoAddress()->GetAddress(),
      common::BindOnce(&ClassicPairingHandler::OnNameRequestComplete, common::Unretained(this)),
      security_handler_);
}

void ClassicPairingHandler::OnReceive(hci::LinkKeyRequestView packet) {