1 /*
2  * Copyright 2024 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  */
17 
18 #include "test/mock/mock_stack_security_client_interface.h"
19 
20 #include "stack/include/security_client_callbacks.h"
21 
22 // TODO(b/369381361) Enfore -Wmissing-prototypes
23 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
24 
25 namespace {
26 
27 // Initialize the working btm client interface to the default
28 MockSecurityClientInterface default_mock_security_client_interface;
29 
30 // Initialize the working btm client interface to the default
31 SecurityClientInterface* mock_security_client_interface = &default_mock_security_client_interface;
32 
33 }  // namespace
34 
35 // Reset the working btm client interface to the default
reset_mock_security_client_interface()36 void reset_mock_security_client_interface() {
37   mock_security_client_interface = &default_mock_security_client_interface;
38 }
39 
40 // Serve the working mock security interface
get_security_client_interface()41 const SecurityClientInterface& get_security_client_interface() {
42   return *mock_security_client_interface;
43 }
44 
set_security_client_interface(SecurityClientInterface * interface)45 void set_security_client_interface(SecurityClientInterface* interface) {
46   mock_security_client_interface = interface;
47 }
48