1  /******************************************************************************
2   *
3   *  Copyright 2018 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 <bluetooth/log.h>
20  
21  #include "common/metrics.h"
22  #include "types/raw_address.h"
23  
24  // TODO(b/369381361) Enfore -Wmissing-prototypes
25  #pragma GCC diagnostic ignored "-Wmissing-prototypes"
26  
27  namespace bluetooth {
28  
29  namespace common {
30  
Update(const A2dpSessionMetrics &)31  void A2dpSessionMetrics::Update(const A2dpSessionMetrics& /* metrics */) {}
32  
operator ==(const A2dpSessionMetrics &) const33  bool A2dpSessionMetrics::operator==(const A2dpSessionMetrics& /* rhs */) const {
34    log::info("UNIMPLEMENTED");
35    return true;
36  }
37  
38  struct BluetoothMetricsLogger::impl {
implbluetooth::common::BluetoothMetricsLogger::impl39    impl(size_t /* max_bluetooth_session */, size_t /* max_pair_event */, size_t /* max_wake_event */,
40         size_t /* max_scan_event */) {}
41  };
42  
BluetoothMetricsLogger()43  BluetoothMetricsLogger::BluetoothMetricsLogger()
44      : pimpl_(new impl(kMaxNumBluetoothSession, kMaxNumPairEvent, kMaxNumWakeEvent,
45                        kMaxNumScanEvent)) {}
46  
LogPairEvent(uint32_t,uint64_t,uint32_t,device_type_t)47  void BluetoothMetricsLogger::LogPairEvent(uint32_t /* disconnect_reason */,
48                                            uint64_t /* timestamp_ms */, uint32_t /* device_class */,
49                                            device_type_t /* device_type */) {}
50  
LogWakeEvent(wake_event_type_t,const std::string &,const std::string &,uint64_t)51  void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t /* type */,
52                                            const std::string& /* requestor */,
53                                            const std::string& /* name */,
54                                            uint64_t /* timestamp_ms */) {}
55  
LogScanEvent(bool,const std::string &,scan_tech_t,uint32_t,uint64_t)56  void BluetoothMetricsLogger::LogScanEvent(bool /* start */, const std::string& /* initiator */,
57                                            scan_tech_t /* type */, uint32_t /* results */,
58                                            uint64_t /* timestamp_ms */) {}
59  
LogBluetoothSessionStart(connection_tech_t,uint64_t)60  void BluetoothMetricsLogger::LogBluetoothSessionStart(connection_tech_t /* connection_tech_type */,
61                                                        uint64_t /* timestamp_ms */) {}
62  
LogBluetoothSessionEnd(disconnect_reason_t,uint64_t)63  void BluetoothMetricsLogger::LogBluetoothSessionEnd(disconnect_reason_t /* disconnect_reason */,
64                                                      uint64_t /* timestamp_ms */) {}
65  
LogBluetoothSessionDeviceInfo(uint32_t,device_type_t)66  void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t /* device_class */,
67                                                             device_type_t /* device_type */) {}
68  
LogA2dpSession(const A2dpSessionMetrics &)69  void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& /* a2dp_session_metrics */) {}
70  
LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID)71  void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID /* service_id */) {}
72  
WriteString(std::string *)73  void BluetoothMetricsLogger::WriteString(std::string* /* serialized */) {}
74  
WriteBase64String(std::string *)75  void BluetoothMetricsLogger::WriteBase64String(std::string* /* serialized */) {}
76  
WriteBase64(int)77  void BluetoothMetricsLogger::WriteBase64(int /* fd */) {}
78  
CutoffSession()79  void BluetoothMetricsLogger::CutoffSession() {}
80  
Build()81  void BluetoothMetricsLogger::Build() {}
82  
ResetSession()83  void BluetoothMetricsLogger::ResetSession() {}
84  
ResetLog()85  void BluetoothMetricsLogger::ResetLog() {}
86  
Reset()87  void BluetoothMetricsLogger::Reset() {}
88  
LogClassicPairingEvent(const RawAddress &,uint16_t,uint32_t,uint16_t,uint16_t,uint16_t,int64_t)89  void LogClassicPairingEvent(const RawAddress& /* address */, uint16_t /* handle */,
90                              uint32_t /* hci_cmd */, uint16_t /* hci_event */,
91                              uint16_t /* cmd_status */, uint16_t /* reason_code */,
92                              int64_t /* event_value */) {}
93  
LogSocketConnectionState(const RawAddress &,int,int,android::bluetooth::SocketConnectionstateEnum,int64_t,int64_t,int,int,android::bluetooth::SocketRoleEnum)94  void LogSocketConnectionState(const RawAddress& /* address */, int /* port */, int /* type */,
95                                android::bluetooth::SocketConnectionstateEnum /* connection_state */,
96                                int64_t /* tx_bytes */, int64_t /* rx_bytes */, int /* uid */,
97                                int /* server_port */,
98                                android::bluetooth::SocketRoleEnum /* socket_role */) {}
99  
LogHciTimeoutEvent(uint32_t)100  void LogHciTimeoutEvent(uint32_t /* hci_cmd */) {}
101  
LogA2dpAudioUnderrunEvent(const RawAddress &,uint64_t,int)102  void LogA2dpAudioUnderrunEvent(const RawAddress& /* address */,
103                                 uint64_t /* encoding_interval_millis */,
104                                 int /* num_missing_pcm_bytes */) {}
105  
LogA2dpAudioOverrunEvent(const RawAddress &,uint64_t,int,int,int)106  void LogA2dpAudioOverrunEvent(const RawAddress& /* address */,
107                                uint64_t /* encoding_interval_millis */,
108                                int /* num_dropped_buffers */, int /* num_dropped_encoded_frames */,
109                                int /* num_dropped_encoded_bytes */) {}
110  
LogA2dpPlaybackEvent(const RawAddress &,int,int)111  void LogA2dpPlaybackEvent(const RawAddress& /* address */, int /* playback_state */,
112                            int /* audio_coding_mode */) {}
113  
LogBluetoothHalCrashReason(const RawAddress &,uint32_t,uint32_t)114  void LogBluetoothHalCrashReason(const RawAddress& /* address */, uint32_t /* error_code */,
115                                  uint32_t /* vendor_error_code */) {}
116  
LogReadRssiResult(const RawAddress &,uint16_t,uint32_t,int8_t)117  void LogReadRssiResult(const RawAddress& /* address */, uint16_t /* handle */,
118                         uint32_t /* cmd_status */, int8_t /* rssi */) {}
119  
LogReadFailedContactCounterResult(const RawAddress &,uint16_t,uint32_t,int32_t)120  void LogReadFailedContactCounterResult(const RawAddress& /* address */, uint16_t /* handle */,
121                                         uint32_t /* cmd_status */,
122                                         int32_t /* failed_contact_counter */) {}
123  
LogReadTxPowerLevelResult(const RawAddress &,uint16_t,uint32_t,int32_t)124  void LogReadTxPowerLevelResult(const RawAddress& /* address */, uint16_t /* handle */,
125                                 uint32_t /* cmd_status */, int32_t /* transmit_power_level */) {}
126  
LogRemoteVersionInfo(uint16_t,uint8_t,uint8_t,uint16_t,uint16_t)127  void LogRemoteVersionInfo(uint16_t /* handle */, uint8_t /* status */, uint8_t /* version */,
128                            uint16_t /* manufacturer_name */, uint16_t /* subversion */) {}
129  
LogLinkLayerConnectionEvent(const RawAddress *,uint32_t,android::bluetooth::DirectionEnum,uint16_t,uint32_t,uint16_t,uint16_t,uint16_t,uint16_t)130  void LogLinkLayerConnectionEvent(const RawAddress* /* address */, uint32_t /* connection_handle */,
131                                   android::bluetooth::DirectionEnum /* direction */,
132                                   uint16_t /* link_type */, uint32_t /* hci_cmd */,
133                                   uint16_t /* hci_event */, uint16_t /* hci_ble_event */,
134                                   uint16_t /* cmd_status */, uint16_t /* reason_code */) {}
135  
LogManufacturerInfo(const RawAddress &,android::bluetooth::DeviceInfoSrcEnum,const std::string &,std::string &,const std::string &,const std::string &,const std::string &)136  void LogManufacturerInfo(const RawAddress& /* address */,
137                           android::bluetooth::DeviceInfoSrcEnum /* source_type */,
138                           const std::string& /* source_name */,
139                           /* const */ std::string& /* manufacturer */,
140                           const std::string& /* model */, const std::string& /* hardware_version */,
141                           const std::string& /* software_version */) {}
142  
LogSdpAttribute(const RawAddress &,uint16_t,uint16_t,size_t,const char *)143  void LogSdpAttribute(const RawAddress& /* address */, uint16_t /* protocol_uuid */,
144                       uint16_t /* attribute_id */, size_t /* attribute_size */,
145                       const char* /* attribute_value */) {}
146  
LogSmpPairingEvent(const RawAddress &,uint8_t,android::bluetooth::DirectionEnum,uint8_t)147  void LogSmpPairingEvent(const RawAddress& /* address */, uint8_t /* smp_cmd */,
148                          android::bluetooth::DirectionEnum /* direction */,
149                          uint8_t /* smp_fail_reason */) {}
150  
LogLeAudioConnectionSessionReported(int32_t,int32_t,int64_t,const std::vector<int64_t> &,const std::vector<int64_t> &,const std::vector<int64_t> &,const std::vector<int32_t> &,const std::vector<int32_t> &,const std::vector<RawAddress> &,const std::vector<int64_t> &,const std::vector<int64_t> &,const std::vector<int32_t> &)151  void LogLeAudioConnectionSessionReported(
152          int32_t /* group_size */, int32_t /* group_metric_id */,
153          int64_t /* connection_duration_nanos */,
154          const std::vector<int64_t>& /* device_connecting_offset_nanos */,
155          const std::vector<int64_t>& /* device_connected_offset_nanos */,
156          const std::vector<int64_t>& /* device_connection_duration_nanos */,
157          const std::vector<int32_t>& /* device_connection_status */,
158          const std::vector<int32_t>& /* device_disconnection_status */,
159          const std::vector<RawAddress>& /* device_address */,
160          const std::vector<int64_t>& /* streaming_offset_nanos */,
161          const std::vector<int64_t>& /* streaming_duration_nanos */,
162          const std::vector<int32_t>& /* streaming_context_type */) {}
163  
LogLeAudioBroadcastSessionReported(int64_t)164  void LogLeAudioBroadcastSessionReported(int64_t /* duration_nanos */) {}
165  
166  }  // namespace common
167  
168  }  // namespace bluetooth
169