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:12
20 *
21 * mockcify.pl ver 0.2
22 */
23 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_main_shim_metrics_api.h"
25
26 #include <cstdint>
27 #include <string>
28
29 // Original included files, if any
30 #include "main/shim/metrics_api.h"
31 #include "test/common/mock_functions.h"
32 #include "types/raw_address.h"
33
34 // Mocked compile conditionals, if any
35 // Mocked internal structures, if any
36
37 namespace test {
38 namespace mock {
39 namespace main_shim_metrics_api {
40
41 // Function state capture and return values, if needed
42 struct LogMetricLinkLayerConnectionEvent LogMetricLinkLayerConnectionEvent;
43 struct LogMetricA2dpAudioUnderrunEvent LogMetricA2dpAudioUnderrunEvent;
44 struct LogMetricA2dpAudioOverrunEvent LogMetricA2dpAudioOverrunEvent;
45 struct LogMetricA2dpPlaybackEvent LogMetricA2dpPlaybackEvent;
46 struct LogMetricA2dpSessionMetricsEvent LogMetricA2dpSessionMetricsEvent;
47 struct LogMetricHfpPacketLossStats LogMetricHfpPacketLossStats;
48 struct LogMetricMmcTranscodeRttStats LogMetricMmcTranscodeRttStats;
49 struct LogMetricReadRssiResult LogMetricReadRssiResult;
50 struct LogMetricReadFailedContactCounterResult
51 LogMetricReadFailedContactCounterResult;
52 struct LogMetricReadTxPowerLevelResult LogMetricReadTxPowerLevelResult;
53 struct LogMetricSmpPairingEvent LogMetricSmpPairingEvent;
54 struct LogMetricClassicPairingEvent LogMetricClassicPairingEvent;
55 struct LogMetricSdpAttribute LogMetricSdpAttribute;
56 struct LogMetricSocketConnectionState LogMetricSocketConnectionState;
57 struct LogMetricManufacturerInfo LogMetricManufacturerInfo;
58
59 } // namespace main_shim_metrics_api
60 } // namespace mock
61 } // namespace test
62
63 // Mocked functions, if any
LogMetricLinkLayerConnectionEvent(const RawAddress * raw_address,uint32_t connection_handle,android::bluetooth::DirectionEnum direction,uint16_t link_type,uint32_t hci_cmd,uint16_t hci_event,uint16_t hci_ble_event,uint16_t cmd_status,uint16_t reason_code)64 void bluetooth::shim::LogMetricLinkLayerConnectionEvent(
65 const RawAddress* raw_address, uint32_t connection_handle,
66 android::bluetooth::DirectionEnum direction, uint16_t link_type,
67 uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
68 uint16_t cmd_status, uint16_t reason_code) {
69 inc_func_call_count(__func__);
70 test::mock::main_shim_metrics_api::LogMetricLinkLayerConnectionEvent(
71 raw_address, connection_handle, direction, link_type, hci_cmd, hci_event,
72 hci_ble_event, cmd_status, reason_code);
73 }
LogMetricA2dpAudioUnderrunEvent(const RawAddress & raw_address,uint64_t encoding_interval_millis,int num_missing_pcm_bytes)74 void bluetooth::shim::LogMetricA2dpAudioUnderrunEvent(
75 const RawAddress& raw_address, uint64_t encoding_interval_millis,
76 int num_missing_pcm_bytes) {
77 inc_func_call_count(__func__);
78 test::mock::main_shim_metrics_api::LogMetricA2dpAudioUnderrunEvent(
79 raw_address, encoding_interval_millis, num_missing_pcm_bytes);
80 }
LogMetricA2dpAudioOverrunEvent(const RawAddress & raw_address,uint64_t encoding_interval_millis,int num_dropped_buffers,int num_dropped_encoded_frames,int num_dropped_encoded_bytes)81 void bluetooth::shim::LogMetricA2dpAudioOverrunEvent(
82 const RawAddress& raw_address, uint64_t encoding_interval_millis,
83 int num_dropped_buffers, int num_dropped_encoded_frames,
84 int num_dropped_encoded_bytes) {
85 inc_func_call_count(__func__);
86 test::mock::main_shim_metrics_api::LogMetricA2dpAudioOverrunEvent(
87 raw_address, encoding_interval_millis, num_dropped_buffers,
88 num_dropped_encoded_frames, num_dropped_encoded_bytes);
89 }
LogMetricA2dpPlaybackEvent(const RawAddress & raw_address,int playback_state,int audio_coding_mode)90 void bluetooth::shim::LogMetricA2dpPlaybackEvent(const RawAddress& raw_address,
91 int playback_state,
92 int audio_coding_mode) {
93 inc_func_call_count(__func__);
94 test::mock::main_shim_metrics_api::LogMetricA2dpPlaybackEvent(
95 raw_address, playback_state, audio_coding_mode);
96 }
LogMetricA2dpSessionMetricsEvent(const RawAddress & raw_address,int64_t audio_duration_ms,int media_timer_min_ms,int media_timer_max_ms,int,int total_scheduling_count,int buffer_overruns_max_count,int buffer_overruns_total,float buffer_underruns_average,int buffer_underruns_count,int64_t codec_index,bool is_a2dp_offload)97 void bluetooth::shim::LogMetricA2dpSessionMetricsEvent(
98 const RawAddress& raw_address, int64_t audio_duration_ms,
99 int media_timer_min_ms, int media_timer_max_ms,
100 int /* media_timer_avg_ms */, int total_scheduling_count,
101 int buffer_overruns_max_count, int buffer_overruns_total,
102 float buffer_underruns_average, int buffer_underruns_count,
103 int64_t codec_index, bool is_a2dp_offload) {
104 inc_func_call_count(__func__);
105 test::mock::main_shim_metrics_api::LogMetricA2dpSessionMetricsEvent(
106 raw_address, audio_duration_ms, media_timer_min_ms, media_timer_max_ms,
107 audio_duration_ms, total_scheduling_count, buffer_overruns_max_count,
108 buffer_overruns_total, buffer_underruns_average, buffer_underruns_count,
109 codec_index, is_a2dp_offload);
110 }
LogMetricHfpPacketLossStats(const RawAddress & raw_address,int num_decoded_frames,double packet_loss_ratio,uint16_t codec_type)111 void bluetooth::shim::LogMetricHfpPacketLossStats(const RawAddress& raw_address,
112 int num_decoded_frames,
113 double packet_loss_ratio,
114 uint16_t codec_type) {
115 inc_func_call_count(__func__);
116 test::mock::main_shim_metrics_api::LogMetricHfpPacketLossStats(
117 raw_address, num_decoded_frames, packet_loss_ratio, codec_type);
118 }
LogMetricMmcTranscodeRttStats(int maximum_rtt,double mean_rtt,int num_requests,int codec_type)119 void bluetooth::shim::LogMetricMmcTranscodeRttStats(int maximum_rtt,
120 double mean_rtt,
121 int num_requests,
122 int codec_type) {
123 inc_func_call_count(__func__);
124 test::mock::main_shim_metrics_api::LogMetricMmcTranscodeRttStats(
125 maximum_rtt, mean_rtt, num_requests, codec_type);
126 }
LogMetricReadRssiResult(const RawAddress & raw_address,uint16_t handle,uint32_t cmd_status,int8_t rssi)127 void bluetooth::shim::LogMetricReadRssiResult(const RawAddress& raw_address,
128 uint16_t handle,
129 uint32_t cmd_status,
130 int8_t rssi) {
131 inc_func_call_count(__func__);
132 test::mock::main_shim_metrics_api::LogMetricReadRssiResult(
133 raw_address, handle, cmd_status, rssi);
134 }
LogMetricReadFailedContactCounterResult(const RawAddress & raw_address,uint16_t handle,uint32_t cmd_status,int32_t failed_contact_counter)135 void bluetooth::shim::LogMetricReadFailedContactCounterResult(
136 const RawAddress& raw_address, uint16_t handle, uint32_t cmd_status,
137 int32_t failed_contact_counter) {
138 inc_func_call_count(__func__);
139 test::mock::main_shim_metrics_api::LogMetricReadFailedContactCounterResult(
140 raw_address, handle, cmd_status, failed_contact_counter);
141 }
LogMetricReadTxPowerLevelResult(const RawAddress & raw_address,uint16_t handle,uint32_t cmd_status,int32_t transmit_power_level)142 void bluetooth::shim::LogMetricReadTxPowerLevelResult(
143 const RawAddress& raw_address, uint16_t handle, uint32_t cmd_status,
144 int32_t transmit_power_level) {
145 inc_func_call_count(__func__);
146 test::mock::main_shim_metrics_api::LogMetricReadTxPowerLevelResult(
147 raw_address, handle, cmd_status, transmit_power_level);
148 }
LogMetricSmpPairingEvent(const RawAddress & raw_address,uint16_t smp_cmd,android::bluetooth::DirectionEnum direction,uint16_t smp_fail_reason)149 void bluetooth::shim::LogMetricSmpPairingEvent(
150 const RawAddress& raw_address, uint16_t smp_cmd,
151 android::bluetooth::DirectionEnum direction, uint16_t smp_fail_reason) {
152 inc_func_call_count(__func__);
153 test::mock::main_shim_metrics_api::LogMetricSmpPairingEvent(
154 raw_address, smp_cmd, direction, smp_fail_reason);
155 }
LogMetricClassicPairingEvent(const RawAddress & raw_address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)156 void bluetooth::shim::LogMetricClassicPairingEvent(
157 const RawAddress& raw_address, uint16_t handle, uint32_t hci_cmd,
158 uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
159 int64_t event_value) {
160 inc_func_call_count(__func__);
161 test::mock::main_shim_metrics_api::LogMetricClassicPairingEvent(
162 raw_address, handle, hci_cmd, hci_event, cmd_status, reason_code,
163 event_value);
164 }
LogMetricSdpAttribute(const RawAddress & raw_address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)165 void bluetooth::shim::LogMetricSdpAttribute(const RawAddress& raw_address,
166 uint16_t protocol_uuid,
167 uint16_t attribute_id,
168 size_t attribute_size,
169 const char* attribute_value) {
170 inc_func_call_count(__func__);
171 test::mock::main_shim_metrics_api::LogMetricSdpAttribute(
172 raw_address, protocol_uuid, attribute_id, attribute_size,
173 attribute_value);
174 }
LogMetricSocketConnectionState(const RawAddress & raw_address,int port,int type,android::bluetooth::SocketConnectionstateEnum connection_state,int64_t tx_bytes,int64_t rx_bytes,int uid,int server_port,android::bluetooth::SocketRoleEnum socket_role)175 void bluetooth::shim::LogMetricSocketConnectionState(
176 const RawAddress& raw_address, int port, int type,
177 android::bluetooth::SocketConnectionstateEnum connection_state,
178 int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port,
179 android::bluetooth::SocketRoleEnum socket_role) {
180 inc_func_call_count(__func__);
181 test::mock::main_shim_metrics_api::LogMetricSocketConnectionState(
182 raw_address, port, type, connection_state, tx_bytes, rx_bytes, uid,
183 server_port, socket_role);
184 }
LogMetricManufacturerInfo(const RawAddress & raw_address,android::bluetooth::AddressTypeEnum address_type,android::bluetooth::DeviceInfoSrcEnum source_type,const std::string & source_name,const std::string & manufacturer,const std::string & model,const std::string & hardware_version,const std::string & software_version)185 void bluetooth::shim::LogMetricManufacturerInfo(
186 const RawAddress& raw_address,
187 android::bluetooth::AddressTypeEnum address_type,
188 android::bluetooth::DeviceInfoSrcEnum source_type,
189 const std::string& source_name, const std::string& manufacturer,
190 const std::string& model, const std::string& hardware_version,
191 const std::string& software_version) {
192 inc_func_call_count(__func__);
193 test::mock::main_shim_metrics_api::LogMetricManufacturerInfo(
194 raw_address, address_type, source_type, source_name, manufacturer, model,
195 hardware_version, software_version);
196 }
CountCounterMetrics(int32_t,int64_t)197 bool bluetooth::shim::CountCounterMetrics(int32_t /* key */,
198 int64_t /* count */) {
199 inc_func_call_count(__func__);
200 return false;
201 }
LogMetricBluetoothLEConnectionMetricEvent(const RawAddress &,android::bluetooth::le::LeConnectionOriginType,android::bluetooth::le::LeConnectionType,android::bluetooth::le::LeConnectionState,std::vector<std::pair<bluetooth::os::ArgumentType,int>>)202 void bluetooth::shim::LogMetricBluetoothLEConnectionMetricEvent(
203 const RawAddress& /* raw_address */,
204 android::bluetooth::le::LeConnectionOriginType /* origin_type */,
205 android::bluetooth::le::LeConnectionType /* connection_type */,
206 android::bluetooth::le::LeConnectionState /* transaction_state */,
207 std::vector<
208 std::pair<bluetooth::os::ArgumentType, int>> /* argument_list */) {
209 inc_func_call_count(__func__);
210 // test::mock::main_shim_metrics_api::LogMetricBluetoothLEConnectionMetricEvent(raw_address, origin_type, connection_type, transaction_state, argument_list);
211 }
212 // END mockcify generation
213