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