• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:16
20  */
21 
22 #include "test/mock/mock_stack_btm_dev.h"
23 
24 #include <stddef.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 
29 #include <map>
30 #include <string>
31 
32 #include "btm_api.h"
33 #include "device/include/controller.h"
34 #include "l2c_api.h"
35 #include "main/shim/btm_api.h"
36 #include "main/shim/shim.h"
37 #include "stack/btm/btm_dev.h"
38 #include "stack/include/acl_api.h"
39 #include "stack/include/bt_octets.h"
40 #include "test/common/mock_functions.h"
41 #include "types/raw_address.h"
42 
43 #ifndef UNUSED_ATTR
44 #define UNUSED_ATTR
45 #endif
46 
47 namespace test {
48 namespace mock {
49 namespace stack_btm_dev {
50 
51 struct btm_find_dev btm_find_dev;
52 
53 }
54 }  // namespace mock
55 }  // namespace test
56 
BTM_SecAddDevice(const RawAddress & bd_addr,DEV_CLASS dev_class,const BD_NAME & bd_name,uint8_t * features,LinkKey * p_link_key,uint8_t key_type,uint8_t pin_length)57 bool BTM_SecAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class,
58                       const BD_NAME& bd_name, uint8_t* features,
59                       LinkKey* p_link_key, uint8_t key_type,
60                       uint8_t pin_length) {
61   inc_func_call_count(__func__);
62   return false;
63 }
BTM_SecDeleteDevice(const RawAddress & bd_addr)64 bool BTM_SecDeleteDevice(const RawAddress& bd_addr) {
65   inc_func_call_count(__func__);
66   return false;
67 }
btm_dev_support_role_switch(const RawAddress & bd_addr)68 bool btm_dev_support_role_switch(const RawAddress& bd_addr) {
69   inc_func_call_count(__func__);
70   return false;
71 }
btm_set_bond_type_dev(const RawAddress & bd_addr,tBTM_SEC_DEV_REC::tBTM_BOND_TYPE bond_type)72 bool btm_set_bond_type_dev(const RawAddress& bd_addr,
73                            tBTM_SEC_DEV_REC::tBTM_BOND_TYPE bond_type) {
74   inc_func_call_count(__func__);
75   return false;
76 }
is_address_equal(void * data,void * context)77 bool is_address_equal(void* data, void* context) {
78   inc_func_call_count(__func__);
79   return false;
80 }
is_handle_equal(void * data,void * context)81 bool is_handle_equal(void* data, void* context) {
82   inc_func_call_count(__func__);
83   return false;
84 }
BTM_SecReadDevName(const RawAddress & bd_addr)85 char* BTM_SecReadDevName(const RawAddress& bd_addr) {
86   inc_func_call_count(__func__);
87   return nullptr;
88 }
btm_find_dev(const RawAddress & bd_addr)89 tBTM_SEC_DEV_REC* btm_find_dev(const RawAddress& bd_addr) {
90   inc_func_call_count(__func__);
91   return test::mock::stack_btm_dev::btm_find_dev.body(bd_addr);
92 }
btm_find_dev_by_handle(uint16_t handle)93 tBTM_SEC_DEV_REC* btm_find_dev_by_handle(uint16_t handle) {
94   inc_func_call_count(__func__);
95   return nullptr;
96 }
btm_find_or_alloc_dev(const RawAddress & bd_addr)97 tBTM_SEC_DEV_REC* btm_find_or_alloc_dev(const RawAddress& bd_addr) {
98   inc_func_call_count(__func__);
99   return nullptr;
100 }
btm_sec_alloc_dev(const RawAddress & bd_addr)101 tBTM_SEC_DEV_REC* btm_sec_alloc_dev(const RawAddress& bd_addr) {
102   inc_func_call_count(__func__);
103   return nullptr;
104 }
btm_sec_allocate_dev_rec(void)105 tBTM_SEC_DEV_REC* btm_sec_allocate_dev_rec(void) {
106   inc_func_call_count(__func__);
107   return nullptr;
108 }
btm_get_bond_type_dev(const RawAddress & bd_addr)109 tBTM_SEC_DEV_REC::tBTM_BOND_TYPE btm_get_bond_type_dev(
110     const RawAddress& bd_addr) {
111   inc_func_call_count(__func__);
112   return tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN;
113 }
BTM_SecClearSecurityFlags(const RawAddress & bd_addr)114 void BTM_SecClearSecurityFlags(const RawAddress& bd_addr) {
115   inc_func_call_count(__func__);
116 }
btm_consolidate_dev(tBTM_SEC_DEV_REC * p_target_rec)117 void btm_consolidate_dev(tBTM_SEC_DEV_REC* p_target_rec) {
118   inc_func_call_count(__func__);
119 }
wipe_secrets_and_remove(tBTM_SEC_DEV_REC * p_dev_rec)120 void wipe_secrets_and_remove(tBTM_SEC_DEV_REC* p_dev_rec) {
121   inc_func_call_count(__func__);
122 }
btm_dev_consolidate_existing_connections(const RawAddress & bd_addr)123 void btm_dev_consolidate_existing_connections(const RawAddress& bd_addr) {
124   inc_func_call_count(__func__);
125 }
BTM_SecDump(const std::string & label)126 void BTM_SecDump(const std::string& label) { inc_func_call_count(__func__); }
BTM_SecDumpDev(const RawAddress & bd_addr)127 void BTM_SecDumpDev(const RawAddress& bd_addr) {
128   inc_func_call_count(__func__);
129 }
btm_get_sec_dev_rec()130 std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() {
131   inc_func_call_count(__func__);
132   return {};
133 }
134 
BTM_SetConsolidationCallback(BTM_CONSOLIDATION_CB * cb)135 void BTM_SetConsolidationCallback(BTM_CONSOLIDATION_CB* cb) {
136   inc_func_call_count(__func__);
137 }
138