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

Commit e9714168 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Let LinkSecurityInterface know LL role

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: I2b34d10c89aeae77fce1f3dd5bbbe2daf06be56d
parent 14c83f0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -369,7 +369,7 @@ void Link::OnFlushOccurred() {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
}
void Link::OnRoleDiscoveryComplete(hci::Role current_role) {
  LOG_INFO("UNIMPLEMENTED %s current_role:%s", __func__, hci::RoleText(current_role).c_str());
  role_ = current_role;
}
void Link::OnReadLinkPolicySettingsComplete(uint16_t link_policy_settings) {
  LOG_INFO("UNIMPLEMENTED %s link_policy_settings:0x%x", __func__, link_policy_settings);
+5 −0
Original line number Diff line number Diff line
@@ -187,6 +187,10 @@ class Link : public l2cap::internal::ILink, public hci::acl_manager::ConnectionM
    return acl_handle_;
  }

  hci::Role GetRole() const {
    return role_;
  }

 private:
  friend class DumpsysHelper;
  void connect_to_pending_dynamic_channels();
@@ -206,6 +210,7 @@ class Link : public l2cap::internal::ILink, public hci::acl_manager::ConnectionM
  ClassicSignallingManager signalling_manager_;
  uint16_t acl_handle_;
  Mtu remote_connectionless_mtu_ = kMinimumClassicMtu;
  hci::Role role_ = hci::Role::CENTRAL;
  bool remote_extended_feature_received_ = false;
  bool remote_supports_ertm_ = false;
  bool remote_supports_fcs_ = false;
+4 −0
Original line number Diff line number Diff line
@@ -203,6 +203,10 @@ class LinkSecurityInterfaceImpl : public LinkSecurityInterface {
    return acl_handle_;
  }

  hci::Role GetRole() override {
    return link_manager_->GetLink(remote_)->GetRole();
  }

  os::Handler* handler_;
  LinkManager* link_manager_;
  hci::Address remote_;
+4 −0
Original line number Diff line number Diff line
@@ -81,6 +81,10 @@ class LinkSecurityInterface {
  virtual void EnsureEncrypted() = 0;

  virtual uint16_t GetAclHandle() = 0;

  virtual hci::Role GetRole() {
    return hci::Role::CENTRAL;
  }
};

class LinkSecurityInterfaceListener {