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

Commit cdf489ab authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "gd: Add local/remote acl connection initiator bit"

parents 5db58df3 ab18ade9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ class AclConnection {
  using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>;
  virtual QueueUpEnd* GetAclQueueEnd() const;

  bool locally_initiated_{false};

 protected:
  AclConnection(QueueUpEnd* queue_up_end, uint16_t handle) : queue_up_end_(queue_up_end), handle_(handle) {}
  QueueUpEnd* queue_up_end_;
+3 −0
Original line number Diff line number Diff line
@@ -190,9 +190,11 @@ struct classic_impl : public security::ISecurityManagerListener {
    auto status = connection_complete.GetStatus();
    auto address = connection_complete.GetBdAddr();
    Role current_role = Role::CENTRAL;
    bool locally_initiated = true;
    if (outgoing_connecting_address_ == address) {
      outgoing_connecting_address_ = Address::kEmpty;
    } else {
      locally_initiated = false;
      ASSERT_LOG(incoming_connecting_address_ == address, "No prior connection request for %s",
                 address.ToString().c_str());
      incoming_connecting_address_ = Address::kEmpty;
@@ -212,6 +214,7 @@ struct classic_impl : public security::ISecurityManagerListener {
    round_robin_scheduler_->Register(RoundRobinScheduler::ConnectionType::CLASSIC, handle, queue);
    std::unique_ptr<ClassicAclConnection> connection(
        new ClassicAclConnection(std::move(queue), acl_connection_interface_, handle, address));
    connection->locally_initiated_ = locally_initiated;
    auto& connection_proxy = check_and_get_connection(handle);
    connection_proxy.connection_management_callbacks_ = connection->GetEventCallbacks();
    connection_proxy.connection_management_callbacks_->OnRoleChange(current_role);