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
17 /*
18 * Generated mock file from original source file
19 * Functions generated:17
20 */
21
22 #include <map>
23 #include <string>
24
25 extern std::map<std::string, int> mock_function_count_map;
26
27 #include <base/strings/stringprintf.h>
28 #include <cstdint>
29 #include <unordered_map>
30 #include "bt_target.h"
31 #include "device/include/controller.h"
32 #include "device/include/interop.h"
33 #include "main/shim/dumpsys.h"
34 #include "main/shim/link_policy.h"
35 #include "main/shim/shim.h"
36 #include "osi/include/log.h"
37 #include "stack/btm/btm_int_types.h"
38 #include "stack/include/btm_api.h"
39 #include "stack/include/btm_api_types.h"
40 #include "stack/include/btm_status.h"
41 #include "types/raw_address.h"
42
43 #ifndef UNUSED_ATTR
44 #define UNUSED_ATTR
45 #endif
46
BTM_ReadPowerMode(const RawAddress & remote_bda,tBTM_PM_MODE * p_mode)47 bool BTM_ReadPowerMode(const RawAddress& remote_bda, tBTM_PM_MODE* p_mode) {
48 mock_function_count_map[__func__]++;
49 return false;
50 }
BTM_SetLinkPolicyActiveMode(const RawAddress & remote_bda)51 bool BTM_SetLinkPolicyActiveMode(const RawAddress& remote_bda) {
52 mock_function_count_map[__func__]++;
53 return false;
54 }
BTM_PM_ReadControllerState(void)55 tBTM_CONTRL_STATE BTM_PM_ReadControllerState(void) {
56 mock_function_count_map[__func__]++;
57 return 0;
58 }
BTM_PmRegister(uint8_t mask,uint8_t * p_pm_id,tBTM_PM_STATUS_CBACK * p_cb)59 tBTM_STATUS BTM_PmRegister(uint8_t mask, uint8_t* p_pm_id,
60 tBTM_PM_STATUS_CBACK* p_cb) {
61 mock_function_count_map[__func__]++;
62 return BTM_SUCCESS;
63 }
BTM_SetPowerMode(uint8_t pm_id,const RawAddress & remote_bda,const tBTM_PM_PWR_MD * p_mode)64 tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
65 const tBTM_PM_PWR_MD* p_mode) {
66 mock_function_count_map[__func__]++;
67 return BTM_SUCCESS;
68 }
BTM_SetSsrParams(const RawAddress & remote_bda,uint16_t max_lat,uint16_t min_rmt_to,uint16_t min_loc_to)69 tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
70 uint16_t min_rmt_to, uint16_t min_loc_to) {
71 mock_function_count_map[__func__]++;
72 return BTM_SUCCESS;
73 }
BTM_PM_OnConnected(uint16_t handle,const RawAddress & remote_bda)74 void BTM_PM_OnConnected(uint16_t handle, const RawAddress& remote_bda) {
75 mock_function_count_map[__func__]++;
76 }
BTM_PM_OnDisconnected(uint16_t handle)77 void BTM_PM_OnDisconnected(uint16_t handle) {
78 mock_function_count_map[__func__]++;
79 }
btm_pm_on_mode_change(tHCI_STATUS status,uint16_t handle,tHCI_MODE current_mode,uint16_t interval)80 void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
81 tHCI_MODE current_mode, uint16_t interval) {
82 mock_function_count_map[__func__]++;
83 }
btm_pm_on_sniff_subrating(tHCI_STATUS status,uint16_t handle,uint16_t maximum_transmit_latency,uint16_t maximum_receive_latency,uint16_t minimum_remote_timeout,uint16_t minimum_local_timeout)84 void btm_pm_on_sniff_subrating(tHCI_STATUS status, uint16_t handle,
85 uint16_t maximum_transmit_latency,
86 uint16_t maximum_receive_latency,
87 uint16_t minimum_remote_timeout,
88 uint16_t minimum_local_timeout) {
89 mock_function_count_map[__func__]++;
90 }
btm_pm_proc_cmd_status(tHCI_STATUS status)91 void btm_pm_proc_cmd_status(tHCI_STATUS status) {
92 mock_function_count_map[__func__]++;
93 }
btm_pm_proc_mode_change(tHCI_STATUS hci_status,uint16_t hci_handle,tHCI_MODE hci_mode,uint16_t interval)94 void btm_pm_proc_mode_change(tHCI_STATUS hci_status, uint16_t hci_handle,
95 tHCI_MODE hci_mode, uint16_t interval) {
96 mock_function_count_map[__func__]++;
97 }
btm_pm_proc_ssr_evt(uint8_t * p,UNUSED_ATTR uint16_t evt_len)98 void btm_pm_proc_ssr_evt(uint8_t* p, UNUSED_ATTR uint16_t evt_len) {
99 mock_function_count_map[__func__]++;
100 }
btm_pm_reset(void)101 void btm_pm_reset(void) { mock_function_count_map[__func__]++; }
process_ssr_event(tHCI_STATUS status,uint16_t handle,UNUSED_ATTR uint16_t max_tx_lat,uint16_t max_rx_lat)102 void process_ssr_event(tHCI_STATUS status, uint16_t handle,
103 UNUSED_ATTR uint16_t max_tx_lat, uint16_t max_rx_lat) {
104 mock_function_count_map[__func__]++;
105 }
106