1 /*
2  * Copyright 2021 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  * Generated mock file from original source file
19  *   Functions generated:11
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Original included files, if any
32 // NOTE: Since this is a mock file with mock definitions some number of
33 //       include files may not be required.  The include-what-you-use
34 //       still applies, but crafting proper inclusion is out of scope
35 //       for this effort.  This compilation unit may compile as-is, or
36 //       may need attention to prune the inclusion set.
37 #include <base/bind.h>
38 #include <cstdint>
39 #include <unordered_map>
40 #include "device/include/controller.h"
41 #include "main/shim/acl_api.h"
42 #include "main/shim/shim.h"
43 #include "stack/btm/btm_dev.h"
44 #include "stack/btm/btm_int_types.h"
45 #include "stack/btm/security_device_record.h"
46 #include "stack/include/bt_types.h"
47 #include "stack/include/hcimsgs.h"
48 #include "types/raw_address.h"
49 
50 // Mocked compile conditionals, if any
51 #ifndef UNUSED_ATTR
52 #define UNUSED_ATTR
53 #endif
54 
55 namespace test {
56 namespace mock {
57 namespace stack_btm_ble_bgconn {
58 
59 // Shared state between mocked functions and tests
60 // Name: convert_to_address_with_type
61 // Params:  const RawAddress& bd_addr, const tBTM_SEC_DEV_REC* p_dev_rec
62 // Returns: const tBLE_BD_ADDR
63 struct convert_to_address_with_type {
64   tBLE_BD_ADDR ble_bd_addr;
65   std::function<const tBLE_BD_ADDR(const RawAddress& bd_addr,
66                                    const tBTM_SEC_DEV_REC* p_dev_rec)>
67       body{[this](const RawAddress& bd_addr,
68                   const tBTM_SEC_DEV_REC* p_dev_rec) { return ble_bd_addr; }};
operatorconvert_to_address_with_type69   const tBLE_BD_ADDR operator()(const RawAddress& bd_addr,
70                                 const tBTM_SEC_DEV_REC* p_dev_rec) {
71     return body(bd_addr, p_dev_rec);
72   };
73 };
74 extern struct convert_to_address_with_type convert_to_address_with_type;
75 // Name: btm_update_scanner_filter_policy
76 // Params: tBTM_BLE_SFP scan_policy
77 // Returns: void
78 struct btm_update_scanner_filter_policy {
79   std::function<void(tBTM_BLE_SFP scan_policy)> body{
80       [](tBTM_BLE_SFP scan_policy) {}};
operatorbtm_update_scanner_filter_policy81   void operator()(tBTM_BLE_SFP scan_policy) { body(scan_policy); };
82 };
83 extern struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
84 // Name: btm_ble_bgconn_cancel_if_disconnected
85 // Params: const RawAddress& bd_addr
86 // Returns: void
87 struct btm_ble_bgconn_cancel_if_disconnected {
88   std::function<void(const RawAddress& bd_addr)> body{
89       [](const RawAddress& bd_addr) {}};
operatorbtm_ble_bgconn_cancel_if_disconnected90   void operator()(const RawAddress& bd_addr) { body(bd_addr); };
91 };
92 extern struct btm_ble_bgconn_cancel_if_disconnected
93     btm_ble_bgconn_cancel_if_disconnected;
94 // Name: btm_ble_suspend_bg_conn
95 // Params: void
96 // Returns: bool
97 struct btm_ble_suspend_bg_conn {
98   std::function<bool(void)> body{[](void) { return false; }};
operatorbtm_ble_suspend_bg_conn99   bool operator()(void) { return body(); };
100 };
101 extern struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
102 // Name: btm_ble_resume_bg_conn
103 // Params: void
104 // Returns: bool
105 struct btm_ble_resume_bg_conn {
106   std::function<bool(void)> body{[](void) { return false; }};
operatorbtm_ble_resume_bg_conn107   bool operator()(void) { return body(); };
108 };
109 extern struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;
110 // Name: BTM_BackgroundConnectAddressKnown
111 // Params: const RawAddress& address
112 // Returns: bool
113 struct BTM_BackgroundConnectAddressKnown {
114   std::function<bool(const RawAddress& address)> body{
115       [](const RawAddress& address) { return false; }};
operatorBTM_BackgroundConnectAddressKnown116   bool operator()(const RawAddress& address) { return body(address); };
117 };
118 extern struct BTM_BackgroundConnectAddressKnown
119     BTM_BackgroundConnectAddressKnown;
120 // Name: BTM_SetLeConnectionModeToFast
121 // Params:
122 // Returns: bool
123 struct BTM_SetLeConnectionModeToFast {
124   std::function<bool()> body{[]() { return false; }};
operatorBTM_SetLeConnectionModeToFast125   bool operator()() { return body(); };
126 };
127 extern struct BTM_SetLeConnectionModeToFast BTM_SetLeConnectionModeToFast;
128 // Name: BTM_SetLeConnectionModeToSlow
129 // Params:
130 // Returns: void
131 struct BTM_SetLeConnectionModeToSlow {
132   std::function<void()> body{[]() {}};
operatorBTM_SetLeConnectionModeToSlow133   void operator()() { body(); };
134 };
135 extern struct BTM_SetLeConnectionModeToSlow BTM_SetLeConnectionModeToSlow;
136 // Name: BTM_AcceptlistAdd
137 // Params: const RawAddress& address
138 // Returns: bool
139 struct BTM_AcceptlistAdd {
140   std::function<bool(const RawAddress& address)> body{
141       [](const RawAddress& address) { return false; }};
operatorBTM_AcceptlistAdd142   bool operator()(const RawAddress& address) { return body(address); };
143 };
144 extern struct BTM_AcceptlistAdd BTM_AcceptlistAdd;
145 // Name: BTM_AcceptlistRemove
146 // Params: const RawAddress& address
147 // Returns: void
148 struct BTM_AcceptlistRemove {
149   std::function<void(const RawAddress& address)> body{
150       [](const RawAddress& address) {}};
operatorBTM_AcceptlistRemove151   void operator()(const RawAddress& address) { body(address); };
152 };
153 extern struct BTM_AcceptlistRemove BTM_AcceptlistRemove;
154 // Name: BTM_AcceptlistClear
155 // Params:
156 // Returns: void
157 struct BTM_AcceptlistClear {
158   std::function<void()> body{[]() {}};
operatorBTM_AcceptlistClear159   void operator()() { body(); };
160 };
161 extern struct BTM_AcceptlistClear BTM_AcceptlistClear;
162 
163 }  // namespace stack_btm_ble_bgconn
164 }  // namespace mock
165 }  // namespace test
166 
167 // END mockcify generation
168