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

Commit 25a8748b authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

HCI: return non-const security interfaces

If we return pointer to const, we can't call any of the methods in the
interface, as they are not marked const. Remove the qualifier.

Test: Try calling any method on LeSecurityInterface
Bug: 139138713
Change-Id: I1948fbda55b3c21ad613b5a79aff5caba75fa029
parent fd1d181f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -441,7 +441,7 @@ void HciLayer::UnregisterLeEventHandler(SubeventCode subevent_code) {
  impl_->UnregisterLeEventHandler(subevent_code);
}

const SecurityInterface* HciLayer::GetSecurityInterface(common::Callback<void(EventPacketView)> event_handler,
SecurityInterface* HciLayer::GetSecurityInterface(common::Callback<void(EventPacketView)> event_handler,
                                                  os::Handler* handler) {
  for (const auto event : SecurityInterface::SecurityEvents) {
    RegisterEventHandler(event, event_handler, handler);
@@ -449,7 +449,7 @@ const SecurityInterface* HciLayer::GetSecurityInterface(common::Callback<void(Ev
  return &impl_->security_interface;
}

const LeSecurityInterface* HciLayer::GetLeSecurityInterface(common::Callback<void(LeMetaEventView)> event_handler,
LeSecurityInterface* HciLayer::GetLeSecurityInterface(common::Callback<void(LeMetaEventView)> event_handler,
                                                      os::Handler* handler) {
  for (const auto subevent : LeSecurityInterface::LeSecurityEvents) {
    RegisterLeEventHandler(subevent, event_handler, handler);
+3 −4
Original line number Diff line number Diff line
@@ -57,10 +57,9 @@ class HciLayer : public Module {

  virtual void UnregisterLeEventHandler(SubeventCode subevent_code);

  const SecurityInterface* GetSecurityInterface(common::Callback<void(EventPacketView)> event_handler,
                                                os::Handler* handler);
  SecurityInterface* GetSecurityInterface(common::Callback<void(EventPacketView)> event_handler, os::Handler* handler);

  const LeSecurityInterface* GetLeSecurityInterface(common::Callback<void(LeMetaEventView)> event_handler,
  LeSecurityInterface* GetLeSecurityInterface(common::Callback<void(LeMetaEventView)> event_handler,
                                              os::Handler* handler);

  static const ModuleFactory Factory;