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:22
20  */
21 
22 #include <map>
23 #include <string>
24 
25 extern std::map<std::string, int> mock_function_count_map;
26 
27 #include <base/bind.h>
28 #include <base/location.h>
29 #include <base/logging.h>
30 #include <cstdint>
31 #include <memory>
32 #include "bt_target.h"
33 #include "bta/jv/bta_jv_int.h"
34 #include "stack/include/btu.h"
35 #include "stack/include/gap_api.h"
36 #include "types/bluetooth/uuid.h"
37 #include "types/raw_address.h"
38 
39 #ifndef UNUSED_ATTR
40 #define UNUSED_ATTR
41 #endif
42 
BTA_JvCreateRecordByUser(uint32_t rfcomm_slot_id)43 tBTA_JV_STATUS BTA_JvCreateRecordByUser(uint32_t rfcomm_slot_id) {
44   mock_function_count_map[__func__]++;
45   return 0;
46 }
BTA_JvDeleteRecord(uint32_t handle)47 tBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle) {
48   mock_function_count_map[__func__]++;
49   return 0;
50 }
BTA_JvEnable(tBTA_JV_DM_CBACK * p_cback)51 tBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK* p_cback) {
52   mock_function_count_map[__func__]++;
53   return 0;
54 }
BTA_JvFreeChannel(uint16_t channel,int conn_type)55 tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type) {
56   mock_function_count_map[__func__]++;
57   return 0;
58 }
BTA_JvL2capClose(uint32_t handle)59 tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle) {
60   mock_function_count_map[__func__]++;
61   return 0;
62 }
BTA_JvL2capRead(uint32_t handle,uint32_t req_id,uint8_t * p_data,uint16_t len)63 tBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id,
64                                uint8_t* p_data, uint16_t len) {
65   mock_function_count_map[__func__]++;
66   return 0;
67 }
BTA_JvL2capReady(uint32_t handle,uint32_t * p_data_size)68 tBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t* p_data_size) {
69   mock_function_count_map[__func__]++;
70   return 0;
71 }
BTA_JvL2capStopServer(uint16_t local_psm,uint32_t l2cap_socket_id)72 tBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm,
73                                      uint32_t l2cap_socket_id) {
74   mock_function_count_map[__func__]++;
75   return 0;
76 }
BTA_JvL2capWrite(uint32_t handle,uint32_t req_id,BT_HDR * msg,uint32_t user_id)77 tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id, BT_HDR* msg,
78                                 uint32_t user_id) {
79   mock_function_count_map[__func__]++;
80   return 0;
81 }
BTA_JvRfcommClose(uint32_t handle,uint32_t rfcomm_slot_id)82 tBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, uint32_t rfcomm_slot_id) {
83   mock_function_count_map[__func__]++;
84   return 0;
85 }
BTA_JvRfcommConnect(tBTA_SEC sec_mask,tBTA_JV_ROLE role,uint8_t remote_scn,const RawAddress & peer_bd_addr,tBTA_JV_RFCOMM_CBACK * p_cback,uint32_t rfcomm_slot_id)86 tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
87                                    uint8_t remote_scn,
88                                    const RawAddress& peer_bd_addr,
89                                    tBTA_JV_RFCOMM_CBACK* p_cback,
90                                    uint32_t rfcomm_slot_id) {
91   mock_function_count_map[__func__]++;
92   return 0;
93 }
BTA_JvRfcommStartServer(tBTA_SEC sec_mask,tBTA_JV_ROLE role,uint8_t local_scn,uint8_t max_session,tBTA_JV_RFCOMM_CBACK * p_cback,uint32_t rfcomm_slot_id)94 tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
95                                        uint8_t local_scn, uint8_t max_session,
96                                        tBTA_JV_RFCOMM_CBACK* p_cback,
97                                        uint32_t rfcomm_slot_id) {
98   mock_function_count_map[__func__]++;
99   return 0;
100 }
BTA_JvRfcommStopServer(uint32_t handle,uint32_t rfcomm_slot_id)101 tBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle,
102                                       uint32_t rfcomm_slot_id) {
103   mock_function_count_map[__func__]++;
104   return 0;
105 }
BTA_JvRfcommWrite(uint32_t handle,uint32_t req_id)106 tBTA_JV_STATUS BTA_JvRfcommWrite(uint32_t handle, uint32_t req_id) {
107   mock_function_count_map[__func__]++;
108   return 0;
109 }
BTA_JvSetPmProfile(uint32_t handle,tBTA_JV_PM_ID app_id,tBTA_JV_CONN_STATE init_st)110 tBTA_JV_STATUS BTA_JvSetPmProfile(uint32_t handle, tBTA_JV_PM_ID app_id,
111                                   tBTA_JV_CONN_STATE init_st) {
112   mock_function_count_map[__func__]++;
113   return 0;
114 }
BTA_JvStartDiscovery(const RawAddress & bd_addr,uint16_t num_uuid,const bluetooth::Uuid * p_uuid_list,uint32_t rfcomm_slot_id)115 tBTA_JV_STATUS BTA_JvStartDiscovery(const RawAddress& bd_addr,
116                                     uint16_t num_uuid,
117                                     const bluetooth::Uuid* p_uuid_list,
118                                     uint32_t rfcomm_slot_id) {
119   mock_function_count_map[__func__]++;
120   return 0;
121 }
BTA_JvRfcommGetPortHdl(uint32_t handle)122 uint16_t BTA_JvRfcommGetPortHdl(uint32_t handle) {
123   mock_function_count_map[__func__]++;
124   return 0;
125 }
BTA_JvDisable(void)126 void BTA_JvDisable(void) { mock_function_count_map[__func__]++; }
BTA_JvGetChannelId(int conn_type,uint32_t id,int32_t channel)127 void BTA_JvGetChannelId(int conn_type, uint32_t id, int32_t channel) {
128   mock_function_count_map[__func__]++;
129 }
BTA_JvL2capConnect(int conn_type,tBTA_SEC sec_mask,tBTA_JV_ROLE role,std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,uint16_t remote_psm,uint16_t rx_mtu,std::unique_ptr<tL2CAP_CFG_INFO> cfg,const RawAddress & peer_bd_addr,tBTA_JV_L2CAP_CBACK * p_cback,uint32_t l2cap_socket_id)130 void BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
131                         std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
132                         uint16_t remote_psm, uint16_t rx_mtu,
133                         std::unique_ptr<tL2CAP_CFG_INFO> cfg,
134                         const RawAddress& peer_bd_addr,
135                         tBTA_JV_L2CAP_CBACK* p_cback,
136                         uint32_t l2cap_socket_id) {
137   mock_function_count_map[__func__]++;
138 }
BTA_JvL2capStartServer(int conn_type,tBTA_SEC sec_mask,tBTA_JV_ROLE role,std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,uint16_t local_psm,uint16_t rx_mtu,std::unique_ptr<tL2CAP_CFG_INFO> cfg,tBTA_JV_L2CAP_CBACK * p_cback,uint32_t l2cap_socket_id)139 void BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
140                             std::unique_ptr<tL2CAP_ERTM_INFO> ertm_info,
141                             uint16_t local_psm, uint16_t rx_mtu,
142                             std::unique_ptr<tL2CAP_CFG_INFO> cfg,
143                             tBTA_JV_L2CAP_CBACK* p_cback,
144                             uint32_t l2cap_socket_id) {
145   mock_function_count_map[__func__]++;
146 }
147