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

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

Merge changes I1fd43afe,I849be7f8

* changes:
  CertSelfTest minor fix
  L2cap: Remove SecurityPolicy in FixedChannel part
parents f070d734 34e7a769
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ struct AttModule::impl {
    // TODO: move that into a ATT manager, or other proper place
    std::unique_ptr<bluetooth::l2cap::le::FixedChannelManager> l2cap_manager_le_(
        l2cap_le_module_->GetFixedChannelManager());
    l2cap_manager_le_->RegisterService(
        bluetooth::l2cap::kLeAttributeCid, l2cap::le::SecurityPolicy::NO_SECURITY_WHATSOEVER_PLAINTEXT_TRANSPORT_OK,
        common::BindOnce(&OnAttRegistrationCompleteLe), common::Bind(&OnAttConnectionOpenLe), att_handler_);
    l2cap_manager_le_->RegisterService(bluetooth::l2cap::kLeAttributeCid,
                                       common::BindOnce(&OnAttRegistrationCompleteLe),
                                       common::Bind(&OnAttConnectionOpenLe), att_handler_);
  }

  os::Handler* att_handler_;
+1 −1
Original line number Diff line number Diff line
@@ -762,7 +762,7 @@ class CertSelfTest(BaseTestClass):
        t1 = Timer(0.5, closure1)
        t1.start()
        closure2 = lambda: thing.behaviors.test_request_behavior.run("B")
        t2 = Timer(0.5, closure2)
        t2 = Timer(1, closure2)
        t2.start()

        wait_until(thing).test_request(anything()).times(2)
+1 −2
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ bool FixedChannelManager::ConnectServices(hci::Address device, OnConnectionFailu
  return true;
}

bool FixedChannelManager::RegisterService(Cid cid, const classic::SecurityPolicy& security_policy,
                                          OnRegistrationCompleteCallback on_registration_complete,
bool FixedChannelManager::RegisterService(Cid cid, OnRegistrationCompleteCallback on_registration_complete,
                                          OnConnectionOpenCallback on_connection_open, os::Handler* handler) {
  internal::FixedChannelServiceImpl::PendingRegistration pending_registration{
      .user_handler_ = handler,
+1 −4
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include "l2cap/cid.h"
#include "l2cap/classic/fixed_channel.h"
#include "l2cap/classic/fixed_channel_service.h"
#include "l2cap/classic/security_policy.h"
#include "os/handler.h"

namespace bluetooth {
@@ -122,14 +121,12 @@ class FixedChannelManager {
   * - on_open_callback, will only be triggered after on_service_registered callback
   *
   * @param cid:  cid used to receive incoming connections
   * @param security_policy: The security policy used for the connection.
   * @param on_registration_complete: A callback to indicate the service setup has completed. If the return status is
   *        not SUCCESS, it means service is not registered due to reasons like CID already take
   * @param on_open_callback: A callback to indicate success of a connection initiated from a remote device.
   * @param handler: The handler context in which to execute the @callback parameter.
   */
  virtual bool RegisterService(Cid cid, const SecurityPolicy& security_policy,
                               OnRegistrationCompleteCallback on_registration_complete,
  virtual bool RegisterService(Cid cid, OnRegistrationCompleteCallback on_registration_complete,
                               OnConnectionOpenCallback on_connection_open, os::Handler* handler);

  virtual ~FixedChannelManager() = default;
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ class MockFixedChannelManager : public FixedChannelManager {
  MOCK_METHOD(bool, ConnectServices,
              (hci::Address device, OnConnectionFailureCallback on_fail_callback, os::Handler* handler), (override));
  MOCK_METHOD(bool, RegisterService,
              (Cid cid, const SecurityPolicy& security_policy, OnRegistrationCompleteCallback on_registration_complete,
              (Cid cid, OnRegistrationCompleteCallback on_registration_complete,
               OnConnectionOpenCallback on_connection_open, os::Handler* handler),
              (override));
};
Loading