Loading system/gd/hci/acl_manager/acl_connection.h +2 −8 Original line number Diff line number Diff line Loading @@ -27,28 +27,22 @@ namespace acl_manager { class AclConnection { public: AclConnection() : queue_up_end_(nullptr), handle_(0), role_(Role::MASTER){}; AclConnection() : queue_up_end_(nullptr), handle_(0){}; virtual ~AclConnection() = default; uint16_t GetHandle() const { return handle_; } Role GetRole() const { return role_; } using Queue = common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder>; using QueueUpEnd = common::BidiQueueEnd<BasePacketBuilder, PacketView<kLittleEndian>>; using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>; virtual QueueUpEnd* GetAclQueueEnd() const; protected: AclConnection(QueueUpEnd* queue_up_end, uint16_t handle, Role role) : queue_up_end_(queue_up_end), handle_(handle), role_(role) {} AclConnection(QueueUpEnd* queue_up_end, uint16_t handle) : queue_up_end_(queue_up_end), handle_(handle) {} QueueUpEnd* queue_up_end_; uint16_t handle_; Role role_; DISALLOW_COPY_AND_ASSIGN(AclConnection); }; Loading system/gd/hci/acl_manager/classic_acl_connection.cc +4 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,8 @@ class AclConnectionTracker : public ConnectionManagementCallbacks { AclConnectionTracker(AclConnectionInterface* acl_connection_interface) : acl_connection_interface_(acl_connection_interface) {} ~AclConnectionTracker() override { ASSERT(queued_callbacks_.empty()); // If callbacks were registered, they should have been delivered. ASSERT(client_callbacks_ == nullptr || queued_callbacks_.empty()); } void RegisterCallbacks(ConnectionManagementCallbacks* callbacks, os::Handler* handler) { while (!queued_callbacks_.empty()) { Loading Loading @@ -301,9 +302,8 @@ ClassicAclConnection::ClassicAclConnection() ClassicAclConnection::ClassicAclConnection(std::shared_ptr<Queue> queue, AclConnectionInterface* acl_connection_interface, uint16_t handle, Address address, Role role) : AclConnection(queue->GetUpEnd(), handle, Role::MASTER), acl_connection_interface_(acl_connection_interface), address_(address) { Address address) : AclConnection(queue->GetUpEnd(), handle), acl_connection_interface_(acl_connection_interface), address_(address) { pimpl_ = new ClassicAclConnection::impl(acl_connection_interface, std::move(queue)); } Loading system/gd/hci/acl_manager/classic_acl_connection.h +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class ClassicAclConnection : public AclConnection { public: ClassicAclConnection(); ClassicAclConnection(std::shared_ptr<Queue> queue, AclConnectionInterface* acl_connection_interface, uint16_t handle, Address address, Role role); Address address); ~ClassicAclConnection() override; virtual Address GetAddress() const { Loading system/gd/hci/acl_manager/classic_impl.h +2 −1 Original line number Diff line number Diff line Loading @@ -214,9 +214,10 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage queue->GetDownEnd(), handler_)); round_robin_scheduler_->Register(RoundRobinScheduler::ConnectionType::CLASSIC, handle, queue); std::unique_ptr<ClassicAclConnection> connection( new ClassicAclConnection(std::move(queue), acl_connection_interface_, handle, address, current_role)); new ClassicAclConnection(std::move(queue), acl_connection_interface_, handle, address)); auto& connection_proxy = check_and_get_connection(handle); connection_proxy.connection_management_callbacks_ = connection->GetEventCallbacks(); connection_proxy.connection_management_callbacks_->OnRoleChange(current_role); client_handler_->Post(common::BindOnce(&ConnectionCallbacks::OnConnectSuccess, common::Unretained(client_callbacks_), std::move(connection))); while (!pending_outgoing_connections_.empty()) { Loading system/gd/hci/acl_manager/le_acl_connection.cc +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ LeAclConnection::LeAclConnection() LeAclConnection::LeAclConnection(std::shared_ptr<Queue> queue, LeAclConnectionInterface* le_acl_connection_interface, common::OnceCallback<void(DisconnectReason)> disconnect, uint16_t handle, AddressWithType local_address, AddressWithType remote_address, Role role) : AclConnection(queue->GetUpEnd(), handle, role), local_address_(local_address), remote_address_(remote_address) { : AclConnection(queue->GetUpEnd(), handle), local_address_(local_address), remote_address_(remote_address), role_(role) { pimpl_ = new LeAclConnection::impl(le_acl_connection_interface, std::move(queue), std::move(disconnect)); } Loading Loading
system/gd/hci/acl_manager/acl_connection.h +2 −8 Original line number Diff line number Diff line Loading @@ -27,28 +27,22 @@ namespace acl_manager { class AclConnection { public: AclConnection() : queue_up_end_(nullptr), handle_(0), role_(Role::MASTER){}; AclConnection() : queue_up_end_(nullptr), handle_(0){}; virtual ~AclConnection() = default; uint16_t GetHandle() const { return handle_; } Role GetRole() const { return role_; } using Queue = common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder>; using QueueUpEnd = common::BidiQueueEnd<BasePacketBuilder, PacketView<kLittleEndian>>; using QueueDownEnd = common::BidiQueueEnd<PacketView<kLittleEndian>, BasePacketBuilder>; virtual QueueUpEnd* GetAclQueueEnd() const; protected: AclConnection(QueueUpEnd* queue_up_end, uint16_t handle, Role role) : queue_up_end_(queue_up_end), handle_(handle), role_(role) {} AclConnection(QueueUpEnd* queue_up_end, uint16_t handle) : queue_up_end_(queue_up_end), handle_(handle) {} QueueUpEnd* queue_up_end_; uint16_t handle_; Role role_; DISALLOW_COPY_AND_ASSIGN(AclConnection); }; Loading
system/gd/hci/acl_manager/classic_acl_connection.cc +4 −4 Original line number Diff line number Diff line Loading @@ -27,7 +27,8 @@ class AclConnectionTracker : public ConnectionManagementCallbacks { AclConnectionTracker(AclConnectionInterface* acl_connection_interface) : acl_connection_interface_(acl_connection_interface) {} ~AclConnectionTracker() override { ASSERT(queued_callbacks_.empty()); // If callbacks were registered, they should have been delivered. ASSERT(client_callbacks_ == nullptr || queued_callbacks_.empty()); } void RegisterCallbacks(ConnectionManagementCallbacks* callbacks, os::Handler* handler) { while (!queued_callbacks_.empty()) { Loading Loading @@ -301,9 +302,8 @@ ClassicAclConnection::ClassicAclConnection() ClassicAclConnection::ClassicAclConnection(std::shared_ptr<Queue> queue, AclConnectionInterface* acl_connection_interface, uint16_t handle, Address address, Role role) : AclConnection(queue->GetUpEnd(), handle, Role::MASTER), acl_connection_interface_(acl_connection_interface), address_(address) { Address address) : AclConnection(queue->GetUpEnd(), handle), acl_connection_interface_(acl_connection_interface), address_(address) { pimpl_ = new ClassicAclConnection::impl(acl_connection_interface, std::move(queue)); } Loading
system/gd/hci/acl_manager/classic_acl_connection.h +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class ClassicAclConnection : public AclConnection { public: ClassicAclConnection(); ClassicAclConnection(std::shared_ptr<Queue> queue, AclConnectionInterface* acl_connection_interface, uint16_t handle, Address address, Role role); Address address); ~ClassicAclConnection() override; virtual Address GetAddress() const { Loading
system/gd/hci/acl_manager/classic_impl.h +2 −1 Original line number Diff line number Diff line Loading @@ -214,9 +214,10 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage queue->GetDownEnd(), handler_)); round_robin_scheduler_->Register(RoundRobinScheduler::ConnectionType::CLASSIC, handle, queue); std::unique_ptr<ClassicAclConnection> connection( new ClassicAclConnection(std::move(queue), acl_connection_interface_, handle, address, current_role)); new ClassicAclConnection(std::move(queue), acl_connection_interface_, handle, address)); auto& connection_proxy = check_and_get_connection(handle); connection_proxy.connection_management_callbacks_ = connection->GetEventCallbacks(); connection_proxy.connection_management_callbacks_->OnRoleChange(current_role); client_handler_->Post(common::BindOnce(&ConnectionCallbacks::OnConnectSuccess, common::Unretained(client_callbacks_), std::move(connection))); while (!pending_outgoing_connections_.empty()) { Loading
system/gd/hci/acl_manager/le_acl_connection.cc +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ LeAclConnection::LeAclConnection() LeAclConnection::LeAclConnection(std::shared_ptr<Queue> queue, LeAclConnectionInterface* le_acl_connection_interface, common::OnceCallback<void(DisconnectReason)> disconnect, uint16_t handle, AddressWithType local_address, AddressWithType remote_address, Role role) : AclConnection(queue->GetUpEnd(), handle, role), local_address_(local_address), remote_address_(remote_address) { : AclConnection(queue->GetUpEnd(), handle), local_address_(local_address), remote_address_(remote_address), role_(role) { pimpl_ = new LeAclConnection::impl(le_acl_connection_interface, std::move(queue), std::move(disconnect)); } Loading