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

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

Merge "L2cap: Add SecurityModuleInterface"

parents 8b419b07 5b55f72c
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, {},
                                       common::BindOnce(&OnAttRegistrationCompleteLe),
                                       common::Bind(&OnAttConnectionOpenLe), att_handler_);
    l2cap_manager_le_->RegisterService(
        bluetooth::l2cap::kLeAttributeCid, l2cap::le::SecurityPolicy::NO_SECURITY_WHATSOEVER_PLAINTEXT_TRANSPORT_OK,
        common::BindOnce(&OnAttRegistrationCompleteLe), common::Bind(&OnAttConnectionOpenLe), att_handler_);
  }

  os::Handler* att_handler_;
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ filegroup {
        "classic/internal/link_manager.cc",
        "classic/internal/signalling_manager.cc",
        "classic/l2cap_classic_module.cc",
        "classic/security_policy.cc",
        "dynamic_channel.cc",
        "internal/basic_mode_channel_data_controller.cc",
        "internal/data_pipeline_manager.cc",
@@ -38,6 +39,7 @@ filegroup {
        "le/internal/link_manager.cc",
        "le/internal/signalling_manager.cc",
        "le/l2cap_le_module.cc",
        "le/security_policy.cc",
    ],
}

+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ class L2capClassicModuleFacadeService : public L2capClassicModuleFacade::Service
      DynamicChannelConfigurationOption configuration_option = {};
      configuration_option.channel_mode = (DynamicChannelConfigurationOption::RetransmissionAndFlowControlMode)mode;
      dynamic_channel_manager_->RegisterService(
          psm, configuration_option, {},
          psm, configuration_option, SecurityPolicy::_SDP_ONLY_NO_SECURITY_WHATSOEVER_PLAINTEXT_TRANSPORT_OK,
          common::BindOnce(&L2capDynamicChannelHelper::on_l2cap_service_registration_complete,
                           common::Unretained(this)),
          common::Bind(&L2capDynamicChannelHelper::on_connection_open, common::Unretained(this)), handler_);
+2 −2
Original line number Diff line number Diff line
@@ -44,11 +44,11 @@ class DynamicChannelServiceImpl {
    user_handler_->Post(common::BindOnce(on_connection_open_callback_, std::move(channel)));
  }

  DynamicChannelConfigurationOption GetConfigOption() const {
  virtual DynamicChannelConfigurationOption GetConfigOption() const {
    return config_option_;
  }

  classic::SecurityPolicy GetSecurityPolicy() const {
  virtual SecurityPolicy GetSecurityPolicy() const {
    return security_policy_;
  }

+39 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#pragma once

#include "l2cap/classic/internal/dynamic_channel_service_impl.h"

#include <gmock/gmock.h>

// Unit test interfaces
namespace bluetooth {
namespace l2cap {
namespace classic {
namespace internal {
namespace testing {

class MockDynamicChannelServiceImpl : public DynamicChannelServiceImpl {
 public:
  MockDynamicChannelServiceImpl() : DynamicChannelServiceImpl({}, {}, {}, {}) {}
  MOCK_METHOD(SecurityPolicy, GetSecurityPolicy, (), (const, override));
};

}  // namespace testing
}  // namespace internal
}  // namespace classic
}  // namespace l2cap
}  // namespace bluetooth
Loading