1 /******************************************************************************
2  *
3  *  Copyright 2021 Google, Inc.
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 #include "os/metrics.h"
20 
21 namespace bluetooth {
22 namespace os {
23 
24 using bluetooth::hci::Address;
25 
LogMetricClassicPairingEvent(const Address & address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)26 void LogMetricClassicPairingEvent(const Address& address, uint16_t handle, uint32_t hci_cmd,
27                                   uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code,
28                                   int64_t event_value) {}
29 
LogMetricSocketConnectionState(const Address & 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)30 void LogMetricSocketConnectionState(const Address& address, int port, int type,
31                                     android::bluetooth::SocketConnectionstateEnum connection_state,
32                                     int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port,
33                                     android::bluetooth::SocketRoleEnum socket_role) {}
34 
LogMetricHciTimeoutEvent(uint32_t hci_cmd)35 void LogMetricHciTimeoutEvent(uint32_t hci_cmd) {}
36 
LogMetricA2dpAudioUnderrunEvent(const Address & address,uint64_t encoding_interval_millis,int num_missing_pcm_bytes)37 void LogMetricA2dpAudioUnderrunEvent(const Address& address, uint64_t encoding_interval_millis,
38                                      int num_missing_pcm_bytes) {}
39 
LogMetricA2dpAudioOverrunEvent(const Address & address,uint64_t encoding_interval_millis,int num_dropped_buffers,int num_dropped_encoded_frames,int num_dropped_encoded_bytes)40 void LogMetricA2dpAudioOverrunEvent(const Address& address, uint64_t encoding_interval_millis,
41                                     int num_dropped_buffers, int num_dropped_encoded_frames,
42                                     int num_dropped_encoded_bytes) {}
43 
LogMetricReadRssiResult(const Address & address,uint16_t handle,uint32_t cmd_status,int8_t rssi)44 void LogMetricReadRssiResult(const Address& address, uint16_t handle, uint32_t cmd_status,
45                              int8_t rssi) {}
46 
LogMetricReadFailedContactCounterResult(const Address & address,uint16_t handle,uint32_t cmd_status,int32_t failed_contact_counter)47 void LogMetricReadFailedContactCounterResult(const Address& address, uint16_t handle,
48                                              uint32_t cmd_status, int32_t failed_contact_counter) {}
49 
LogMetricReadTxPowerLevelResult(const Address & address,uint16_t handle,uint32_t cmd_status,int32_t transmit_power_level)50 void LogMetricReadTxPowerLevelResult(const Address& address, uint16_t handle, uint32_t cmd_status,
51                                      int32_t transmit_power_level) {}
52 
LogMetricRemoteVersionInfo(uint16_t handle,uint8_t status,uint8_t version,uint16_t manufacturer_name,uint16_t subversion)53 void LogMetricRemoteVersionInfo(uint16_t handle, uint8_t status, uint8_t version,
54                                 uint16_t manufacturer_name, uint16_t subversion) {}
55 
LogMetricLinkLayerConnectionEvent(const Address * 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)56 void LogMetricLinkLayerConnectionEvent(const Address* address, uint32_t connection_handle,
57                                        android::bluetooth::DirectionEnum direction,
58                                        uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event,
59                                        uint16_t hci_ble_event, uint16_t cmd_status,
60                                        uint16_t reason_code) {}
61 
LogMetricManufacturerInfo(const Address & 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)62 void LogMetricManufacturerInfo(const Address& address,
63                                android::bluetooth::AddressTypeEnum address_type,
64                                android::bluetooth::DeviceInfoSrcEnum source_type,
65                                const std::string& source_name, const std::string& manufacturer,
66                                const std::string& model, const std::string& hardware_version,
67                                const std::string& software_version) {}
68 
LogMetricSdpAttribute(const Address & address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)69 void LogMetricSdpAttribute(const Address& address, uint16_t protocol_uuid, uint16_t attribute_id,
70                            size_t attribute_size, const char* attribute_value) {}
71 
LogMetricSmpPairingEvent(const Address & address,uint16_t smp_cmd,android::bluetooth::DirectionEnum direction,uint16_t smp_fail_reason)72 void LogMetricSmpPairingEvent(const Address& address, uint16_t smp_cmd,
73                               android::bluetooth::DirectionEnum direction,
74                               uint16_t smp_fail_reason) {}
75 
LogMetricA2dpPlaybackEvent(const Address & address,int playback_state,int audio_coding_mode)76 void LogMetricA2dpPlaybackEvent(const Address& address, int playback_state, int audio_coding_mode) {
77 }
78 
LogMetricA2dpSessionMetricsEvent(const Address & address,int64_t audio_duration_ms,int media_timer_min_ms,int media_timer_max_ms,int media_timer_avg_ms,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)79 void LogMetricA2dpSessionMetricsEvent(const Address& address, int64_t audio_duration_ms,
80                                       int media_timer_min_ms, int media_timer_max_ms,
81                                       int media_timer_avg_ms, int total_scheduling_count,
82                                       int buffer_overruns_max_count, int buffer_overruns_total,
83                                       float buffer_underruns_average, int buffer_underruns_count,
84                                       int64_t codec_index, bool is_a2dp_offload) {}
85 
LogMetricHfpPacketLossStats(const Address & address,int num_decoded_frames,double packet_loss_ratio,uint16_t codec_type)86 void LogMetricHfpPacketLossStats(const Address& address, int num_decoded_frames,
87                                  double packet_loss_ratio, uint16_t codec_type) {}
88 
LogMetricMmcTranscodeRttStats(int maximum_rtt,double mean_rtt,int num_requests,int codec_type)89 void LogMetricMmcTranscodeRttStats(int maximum_rtt, double mean_rtt, int num_requests,
90                                    int codec_type) {}
91 
LogMetricBluetoothHalCrashReason(const Address & address,uint32_t error_code,uint32_t vendor_error_code)92 void LogMetricBluetoothHalCrashReason(const Address& address, uint32_t error_code,
93                                       uint32_t vendor_error_code) {}
94 
LogMetricBluetoothLocalSupportedFeatures(uint32_t page_num,uint64_t features)95 void LogMetricBluetoothLocalSupportedFeatures(uint32_t page_num, uint64_t features) {}
96 
LogMetricBluetoothLocalVersions(uint32_t lmp_manufacturer_name,uint8_t lmp_version,uint32_t lmp_subversion,uint8_t hci_version,uint32_t hci_revision)97 void LogMetricBluetoothLocalVersions(uint32_t lmp_manufacturer_name, uint8_t lmp_version,
98                                      uint32_t lmp_subversion, uint8_t hci_version,
99                                      uint32_t hci_revision) {}
100 
LogMetricBluetoothDisconnectionReasonReported(uint32_t reason,const Address & address,uint32_t connection_handle)101 void LogMetricBluetoothDisconnectionReasonReported(uint32_t reason, const Address& address,
102                                                    uint32_t connection_handle) {}
103 
LogMetricBluetoothRemoteSupportedFeatures(const Address & address,uint32_t page,uint64_t features,uint32_t connection_handle)104 void LogMetricBluetoothRemoteSupportedFeatures(const Address& address, uint32_t page,
105                                                uint64_t features, uint32_t connection_handle) {}
106 
LogMetricBluetoothCodePathCounterMetrics(int32_t key,int64_t count)107 void LogMetricBluetoothCodePathCounterMetrics(int32_t key, int64_t count) {}
108 
LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions)109 void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {}
110 
LogMetricBluetoothEvent(const Address & address,android::bluetooth::EventType event_type,android::bluetooth::State state)111 void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type,
112                              android::bluetooth::State state) {}
113 }  // namespace os
114 }  // namespace bluetooth
115