1 /*
2  * Copyright 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include "l2cap/classic/security_enforcement_interface.h"
19 #include "l2cap/le/security_enforcement_interface.h"
20 #include "os/handler.h"
21 #include "security/internal/security_manager_impl.h"
22 
23 namespace bluetooth {
24 namespace security {
25 class L2capSecurityModuleInterface : public l2cap::classic::SecurityEnforcementInterface,
26                                      public l2cap::le::SecurityEnforcementInterface {
27  public:
28   L2capSecurityModuleInterface(internal::SecurityManagerImpl* security_manager_impl, os::Handler* security_handler);
29   void Enforce(hci::AddressWithType remote, l2cap::classic::SecurityPolicy policy,
30                l2cap::classic::SecurityEnforcementInterface::ResultCallback result_callback) override;
31   void Enforce(hci::AddressWithType remote, l2cap::le::SecurityPolicy policy,
32                l2cap::le::SecurityEnforcementInterface::ResultCallback result_callback) override;
33 
34  private:
35   internal::SecurityManagerImpl* security_manager_impl_;
36   os::Handler* security_handler_ = nullptr;
37 };
38 
39 }  // namespace security
40 }  // namespace bluetooth
41