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