1 // Copyright 2014 Google Inc. All Rights Reserved. 2 // Author: pkanwar (a] google.com (Pankaj Kanwar) 3 // Protos for uploading bluetooth metrics. 4 5 syntax = "proto2"; 6 7 package com.android.bluetooth.btservice; 8 9 option java_package = "com.android.bluetooth.btservice"; 10 option java_outer_classname = "BluetoothProto"; 11 //option (datapol.file_vetting_status) = "latest"; 12 13 // import "storage/datapol/annotations/proto/semantic_annotations.proto"; 14 15 message BluetoothLog { 16 17 // Session information that gets logged for every BT connection. 18 repeated BluetoothSession session = 1; 19 20 // Session information that gets logged for every Pair event. 21 repeated PairEvent pair_event = 2; 22 23 // Information for Wake locks. 24 repeated WakeEvent wake_event = 3; 25 26 // Scan event information. 27 repeated ScanEvent scan_event = 4; 28 29 // Number of bonded devices. 30 optional int32 num_bonded_devices = 5; 31 32 // Number of BluetoothSession including discarded ones beyond capacity 33 optional int64 num_bluetooth_session = 6; 34 35 // Number of PairEvent including discarded ones beyond capacity 36 optional int64 num_pair_event = 7; 37 38 // Number of WakeEvent including discarded ones beyond capacity 39 optional int64 num_wake_event = 8; 40 41 // Number of ScanEvent including discarded ones beyond capacity 42 optional int64 num_scan_event = 9; 43 } 44 45 // The information about the device. 46 message DeviceInfo { 47 48 // Device type. 49 enum DeviceType { 50 51 // Type is unknown. 52 DEVICE_TYPE_UNKNOWN = 0; 53 54 DEVICE_TYPE_BREDR = 1; 55 56 DEVICE_TYPE_LE = 2; 57 58 DEVICE_TYPE_DUMO = 3; 59 } 60 61 // Device class 62 // https://cs.corp.google.com/#android/system/bt/stack/include/btm_api.h&q=major_computer. 63 optional int32 device_class = 1; 64 65 // Device type. 66 optional DeviceType device_type = 2; 67 } 68 69 // Information that gets logged for every Bluetooth connection. 70 message BluetoothSession { 71 72 // Type of technology used in the connection. 73 enum ConnectionTechnologyType { 74 75 CONNECTION_TECHNOLOGY_TYPE_UNKNOWN = 0; 76 77 CONNECTION_TECHNOLOGY_TYPE_LE = 1; 78 79 CONNECTION_TECHNOLOGY_TYPE_BREDR = 2; 80 } 81 82 // Duration of the session. 83 optional int64 session_duration_sec = 2; 84 85 // Technology type. 86 optional ConnectionTechnologyType connection_technology_type = 3; 87 88 // Reason for disconnecting. 89 optional string disconnect_reason = 4; 90 91 // The information about the device which it is connected to. 92 optional DeviceInfo device_connected_to = 5; 93 94 // The information about the RFComm session. 95 optional RFCommSession rfcomm_session = 6; 96 97 // The information about the A2DP audio session. 98 optional A2DPSession a2dp_session = 7; 99 } 100 101 message RFCommSession { 102 103 // bytes transmitted. 104 optional int32 rx_bytes = 1; 105 106 // bytes transmitted. 107 optional int32 tx_bytes = 2; 108 } 109 110 // Session information that gets logged for A2DP session. 111 message A2DPSession { 112 113 // Media timer in milliseconds. 114 optional int32 media_timer_min_millis = 1; 115 116 // Media timer in milliseconds. 117 optional int32 media_timer_max_millis = 2; 118 119 // Media timer in milliseconds. 120 optional int32 media_timer_avg_millis = 3; 121 122 // Buffer overruns count. 123 optional int32 buffer_overruns_max_count = 4; 124 125 // Buffer overruns total. 126 optional int32 buffer_overruns_total = 5; 127 128 // Buffer underruns average. 129 optional float buffer_underruns_average = 6; 130 131 // Buffer underruns count. 132 optional int32 buffer_underruns_count = 7; 133 134 // Total audio time in this A2DP session 135 optional int64 audio_duration_millis = 8; 136 } 137 138 message PairEvent { 139 140 // The reason for disconnecting 141 // https://cs.corp.google.com/#android/system/bt/stack/include/hcidefs.h&q=failed_establish. 142 optional int32 disconnect_reason = 1; 143 144 // Pair event time 145 optional int64 event_time_millis = 2; // [(datapol.semantic_type) = ST_TIMESTAMP]; 146 147 // The information about the device which it is paired to. 148 optional DeviceInfo device_paired_with = 3; 149 } 150 151 message WakeEvent { 152 153 // Information about the wake event type. 154 enum WakeEventType { 155 156 // Type is unknown. 157 UNKNOWN = 0; 158 159 // WakeLock was acquired. 160 ACQUIRED = 1; 161 162 // WakeLock was released. 163 RELEASED = 2; 164 } 165 166 // Information about the wake event type. 167 optional WakeEventType wake_event_type = 1; 168 169 // Initiator of the scan. Only the first three names will be stored. 170 // e.g. com.google.gms. 171 optional string requestor = 2; 172 173 // Name of the wakelock (e.g. bluedroid_timer). 174 optional string name = 3; 175 176 // Time of the event. 177 optional int64 event_time_millis = 4; // [(datapol.semantic_type) = ST_TIMESTAMP]; 178 } 179 180 message ScanEvent { 181 182 // Scan type. 183 enum ScanTechnologyType { 184 185 // Scan Type is unknown. 186 SCAN_TYPE_UNKNOWN = 0; 187 188 SCAN_TECH_TYPE_LE = 1; 189 190 SCAN_TECH_TYPE_BREDR = 2; 191 192 SCAN_TECH_TYPE_BOTH = 3; 193 } 194 195 // Scan event type. 196 enum ScanEventType { 197 198 // Scan started. 199 SCAN_EVENT_START = 0; 200 201 // Scan stopped. 202 SCAN_EVENT_STOP = 1; 203 } 204 205 // Scan event type. 206 optional ScanEventType scan_event_type = 1; 207 208 // Initiator of the scan. Only the first three names will be stored. 209 // e.g. com.google.gms. 210 optional string initiator = 2; 211 212 // Technology used for scanning. 213 optional ScanTechnologyType scan_technology_type = 3; 214 215 // Number of results returned. 216 optional int32 number_results = 4; 217 218 // Time of the event. 219 optional int64 event_time_millis = 5; // [(datapol.semantic_type) = ST_TIMESTAMP]; 220 } 221