• 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:36
20  */
21 
22 #include <map>
23 #include <string>
24 
25 #include "common/metrics.h"
26 #include "test/common/mock_functions.h"
27 #include "types/raw_address.h"
28 
29 #if 0
30 #include <base/base64.h>
31 #include <base/logging.h>
32 #include <include/hardware/bt_av.h>
33 #include <statslog.h>
34 #include <unistd.h>
35 #include <algorithm>
36 #include <array>
37 #include <cerrno>
38 #include <chrono>
39 #include <cstdint>
40 #include <cstring>
41 #include <memory>
42 #include <mutex>
43 #include "address_obfuscator.h"
44 #include "bluetooth/metrics/bluetooth.pb.h"
45 #include "leaky_bonded_queue.h"
46 #include "metric_id_allocator.h"
47 #include "osi/include/osi.h"
48 #include "stack/include/btm_api_types.h"
49 #include "time_util.h"
50 #endif
51 
52 #ifndef UNUSED_ATTR
53 #define UNUSED_ATTR
54 #endif
55 
56 namespace bluetooth {
57 namespace common {
58 
Update(const A2dpSessionMetrics & metrics)59 void A2dpSessionMetrics::Update(const A2dpSessionMetrics& metrics) {
60   inc_func_call_count(__func__);
61 }
62 
63 struct BluetoothMetricsLogger::impl {
64   int mock{123};
65 };
66 
BluetoothMetricsLogger()67 BluetoothMetricsLogger::BluetoothMetricsLogger() {}
Build()68 void BluetoothMetricsLogger::Build() { inc_func_call_count(__func__); }
CutoffSession()69 void BluetoothMetricsLogger::CutoffSession() { inc_func_call_count(__func__); }
LogA2dpSession(const A2dpSessionMetrics & a2dp_session_metrics)70 void BluetoothMetricsLogger::LogA2dpSession(
71     const A2dpSessionMetrics& a2dp_session_metrics) {
72   inc_func_call_count(__func__);
73 }
LogBluetoothSessionDeviceInfo(uint32_t device_class,device_type_t device_type)74 void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(
75     uint32_t device_class, device_type_t device_type) {
76   inc_func_call_count(__func__);
77 }
LogBluetoothSessionEnd(disconnect_reason_t disconnect_reason,uint64_t timestamp_ms)78 void BluetoothMetricsLogger::LogBluetoothSessionEnd(
79     disconnect_reason_t disconnect_reason, uint64_t timestamp_ms) {
80   inc_func_call_count(__func__);
81 }
LogBluetoothSessionStart(connection_tech_t connection_tech_type,uint64_t timestamp_ms)82 void BluetoothMetricsLogger::LogBluetoothSessionStart(
83     connection_tech_t connection_tech_type, uint64_t timestamp_ms) {
84   inc_func_call_count(__func__);
85 }
LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID service_id)86 void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(
87     tBTA_SERVICE_ID service_id) {
88   inc_func_call_count(__func__);
89 }
LogPairEvent(uint32_t disconnect_reason,uint64_t timestamp_ms,uint32_t device_class,device_type_t device_type)90 void BluetoothMetricsLogger::LogPairEvent(uint32_t disconnect_reason,
91                                           uint64_t timestamp_ms,
92                                           uint32_t device_class,
93                                           device_type_t device_type) {
94   inc_func_call_count(__func__);
95 }
LogScanEvent(bool start,const std::string & initator,scan_tech_t type,uint32_t results,uint64_t timestamp_ms)96 void BluetoothMetricsLogger::LogScanEvent(bool start,
97                                           const std::string& initator,
98                                           scan_tech_t type, uint32_t results,
99                                           uint64_t timestamp_ms) {
100   inc_func_call_count(__func__);
101 }
LogWakeEvent(wake_event_type_t type,const std::string & requestor,const std::string & name,uint64_t timestamp_ms)102 void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t type,
103                                           const std::string& requestor,
104                                           const std::string& name,
105                                           uint64_t timestamp_ms) {
106   inc_func_call_count(__func__);
107 }
Reset()108 void BluetoothMetricsLogger::Reset() { inc_func_call_count(__func__); }
ResetLog()109 void BluetoothMetricsLogger::ResetLog() { inc_func_call_count(__func__); }
ResetSession()110 void BluetoothMetricsLogger::ResetSession() { inc_func_call_count(__func__); }
WriteBase64(int fd)111 void BluetoothMetricsLogger::WriteBase64(int fd) {
112   inc_func_call_count(__func__);
113 }
WriteBase64String(std::string * serialized)114 void BluetoothMetricsLogger::WriteBase64String(std::string* serialized) {
115   inc_func_call_count(__func__);
116 }
WriteString(std::string * serialized)117 void BluetoothMetricsLogger::WriteString(std::string* serialized) {
118   inc_func_call_count(__func__);
119 }
LogA2dpAudioOverrunEvent(const RawAddress & address,uint64_t encoding_interval_millis,int num_dropped_buffers,int num_dropped_encoded_frames,int num_dropped_encoded_bytes)120 void LogA2dpAudioOverrunEvent(const RawAddress& address,
121                               uint64_t encoding_interval_millis,
122                               int num_dropped_buffers,
123                               int num_dropped_encoded_frames,
124                               int num_dropped_encoded_bytes) {
125   inc_func_call_count(__func__);
126 }
LogA2dpAudioUnderrunEvent(const RawAddress & address,uint64_t encoding_interval_millis,int num_missing_pcm_bytes)127 void LogA2dpAudioUnderrunEvent(const RawAddress& address,
128                                uint64_t encoding_interval_millis,
129                                int num_missing_pcm_bytes) {
130   inc_func_call_count(__func__);
131 }
LogA2dpPlaybackEvent(const RawAddress & address,int playback_state,int audio_coding_mode)132 void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state,
133                           int audio_coding_mode) {
134   inc_func_call_count(__func__);
135 }
LogBluetoothHalCrashReason(const RawAddress & address,uint32_t error_code,uint32_t vendor_error_code)136 void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code,
137                                 uint32_t vendor_error_code) {
138   inc_func_call_count(__func__);
139 }
LogClassicPairingEvent(const RawAddress & address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)140 void LogClassicPairingEvent(const RawAddress& address, uint16_t handle,
141                             uint32_t hci_cmd, uint16_t hci_event,
142                             uint16_t cmd_status, uint16_t reason_code,
143                             int64_t event_value) {
144   inc_func_call_count(__func__);
145 }
LogHciTimeoutEvent(uint32_t hci_cmd)146 void LogHciTimeoutEvent(uint32_t hci_cmd) { inc_func_call_count(__func__); }
LogLinkLayerConnectionEvent(const RawAddress * 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)147 void LogLinkLayerConnectionEvent(const RawAddress* address,
148                                  uint32_t connection_handle,
149                                  android::bluetooth::DirectionEnum direction,
150                                  uint16_t link_type, uint32_t hci_cmd,
151                                  uint16_t hci_event, uint16_t hci_ble_event,
152                                  uint16_t cmd_status, uint16_t reason_code) {
153   inc_func_call_count(__func__);
154 }
LogManufacturerInfo(const RawAddress & address,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)155 void LogManufacturerInfo(const RawAddress& address,
156                          android::bluetooth::DeviceInfoSrcEnum source_type,
157                          const std::string& source_name,
158                          const std::string& manufacturer,
159                          const std::string& model,
160                          const std::string& hardware_version,
161                          const std::string& software_version) {
162   inc_func_call_count(__func__);
163 }
LogReadFailedContactCounterResult(const RawAddress & address,uint16_t handle,uint32_t cmd_status,int32_t failed_contact_counter)164 void LogReadFailedContactCounterResult(const RawAddress& address,
165                                        uint16_t handle, uint32_t cmd_status,
166                                        int32_t failed_contact_counter) {
167   inc_func_call_count(__func__);
168 }
LogReadRssiResult(const RawAddress & address,uint16_t handle,uint32_t cmd_status,int8_t rssi)169 void LogReadRssiResult(const RawAddress& address, uint16_t handle,
170                        uint32_t cmd_status, int8_t rssi) {
171   inc_func_call_count(__func__);
172 }
LogReadTxPowerLevelResult(const RawAddress & address,uint16_t handle,uint32_t cmd_status,int32_t transmit_power_level)173 void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle,
174                                uint32_t cmd_status,
175                                int32_t transmit_power_level) {
176   inc_func_call_count(__func__);
177 }
LogRemoteVersionInfo(uint16_t handle,uint8_t status,uint8_t version,uint16_t manufacturer_name,uint16_t subversion)178 void LogRemoteVersionInfo(uint16_t handle, uint8_t status, uint8_t version,
179                           uint16_t manufacturer_name, uint16_t subversion) {
180   inc_func_call_count(__func__);
181 }
LogSdpAttribute(const RawAddress & address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)182 void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid,
183                      uint16_t attribute_id, size_t attribute_size,
184                      const char* attribute_value) {
185   inc_func_call_count(__func__);
186 }
LogSmpPairingEvent(const RawAddress & address,uint8_t smp_cmd,android::bluetooth::DirectionEnum direction,uint8_t smp_fail_reason)187 void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd,
188                         android::bluetooth::DirectionEnum direction,
189                         uint8_t smp_fail_reason) {
190   inc_func_call_count(__func__);
191 }
LogSocketConnectionState(const RawAddress & 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)192 void LogSocketConnectionState(
193     const RawAddress& address, int port, int type,
194     android::bluetooth::SocketConnectionstateEnum connection_state,
195     int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port,
196     android::bluetooth::SocketRoleEnum socket_role) {
197   inc_func_call_count(__func__);
198 }
199 
LogLeAudioConnectionSessionReported(int32_t group_size,int32_t group_metric_id,int64_t connection_duration_nanos,std::vector<int64_t> & device_connecting_offset_nanos,std::vector<int64_t> & device_connected_offset_nanos,std::vector<int64_t> & device_connection_duration_nanos,std::vector<int32_t> & device_connection_status,std::vector<int32_t> & device_disconnection_status,std::vector<RawAddress> & device_address,std::vector<int64_t> & streaming_offset_nanos,std::vector<int64_t> & streaming_duration_nanos,std::vector<int32_t> & streaming_context_type)200 void LogLeAudioConnectionSessionReported(
201     int32_t group_size, int32_t group_metric_id,
202     int64_t connection_duration_nanos,
203     std::vector<int64_t>& device_connecting_offset_nanos,
204     std::vector<int64_t>& device_connected_offset_nanos,
205     std::vector<int64_t>& device_connection_duration_nanos,
206     std::vector<int32_t>& device_connection_status,
207     std::vector<int32_t>& device_disconnection_status,
208     std::vector<RawAddress>& device_address,
209     std::vector<int64_t>& streaming_offset_nanos,
210     std::vector<int64_t>& streaming_duration_nanos,
211     std::vector<int32_t>& streaming_context_type) {
212   inc_func_call_count(__func__);
213 }
214 
LogLeAudioBroadcastSessionReported(int64_t duration_nanos)215 void LogLeAudioBroadcastSessionReported(int64_t duration_nanos) {
216   inc_func_call_count(__func__);
217 }
218 
219 }  // namespace common
220 }  // namespace bluetooth
221