1/* 2 * Copyright (C) 2016 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 17syntax = "proto2"; 18 19package clearcut.connectivity; 20 21option java_package = "com.android.server.wifi"; 22option java_outer_classname = "WifiMetricsProto"; 23 24// The information about the Wifi events. 25message WifiLog { 26 27 // Session information that gets logged for every Wifi connection. 28 repeated ConnectionEvent connection_event = 1; 29 30 // Number of saved networks in the user profile. 31 optional int32 num_saved_networks = 2; 32 33 // Number of open networks in the saved networks. 34 optional int32 num_open_networks = 3; 35 36 // Number of personal networks. 37 optional int32 num_personal_networks = 4; 38 39 // Number of enterprise networks. 40 optional int32 num_enterprise_networks = 5; 41 42 // Does the user have location setting enabled. 43 optional bool is_location_enabled = 6; 44 45 // Does the user have scanning enabled. 46 optional bool is_scanning_always_enabled = 7; 47 48 // Number of times user toggled wifi using the settings menu. 49 optional int32 num_wifi_toggled_via_settings = 8; 50 51 // Number of times user toggled wifi using the airplane menu. 52 optional int32 num_wifi_toggled_via_airplane = 9; 53 54 // Number of networks added by the user. 55 optional int32 num_networks_added_by_user = 10; 56 57 // Number of networks added by applications. 58 optional int32 num_networks_added_by_apps = 11; 59 60 // Number scans that returned empty results. 61 optional int32 num_empty_scan_results = 12; 62 63 // Number scans that returned at least one result. 64 optional int32 num_non_empty_scan_results = 13; 65 66 // Number of scans that were one time. 67 optional int32 num_oneshot_scans = 14; 68 69 // Number of repeated background scans that were scheduled to the chip. 70 optional int32 num_background_scans = 15; 71 72 // Error codes that a scan can result in. 73 enum ScanReturnCode { 74 75 // Return Code is unknown. 76 SCAN_UNKNOWN = 0; 77 78 // Scan was successful. 79 SCAN_SUCCESS = 1; 80 81 // Scan was successfully started, but was interrupted. 82 SCAN_FAILURE_INTERRUPTED = 2; 83 84 // Scan failed to start because of invalid configuration 85 // (bad channel, etc). 86 SCAN_FAILURE_INVALID_CONFIGURATION = 3; 87 88 // Could not start a scan because wifi is disabled. 89 FAILURE_WIFI_DISABLED = 4; 90 91 } 92 93 // Mapping of error codes to the number of times that scans resulted 94 // in that error. 95 repeated ScanReturnEntry scan_return_entries = 16; 96 97 message ScanReturnEntry { 98 99 // Return code of the scan. 100 optional ScanReturnCode scan_return_code = 1; 101 102 // Number of entries that were found in the scan. 103 optional int32 scan_results_count = 2; 104 } 105 106 // State of the Wifi. 107 enum WifiState { 108 109 // State is unknown. 110 WIFI_UNKNOWN = 0; 111 112 // Wifi is disabled. 113 WIFI_DISABLED = 1; 114 115 // Wifi is enabled. 116 WIFI_DISCONNECTED = 2; 117 118 // Wifi is enabled and associated with an AP. 119 WIFI_ASSOCIATED = 3; 120 } 121 122 // Mapping of system state to the number of times that scans were requested in 123 // that state 124 repeated WifiSystemStateEntry wifi_system_state_entries = 17; 125 126 message WifiSystemStateEntry { 127 128 // Current WiFi state. 129 optional WifiState wifi_state = 1; 130 131 // Count of scans in state. 132 optional int32 wifi_state_count = 2; 133 134 // Is screen on. 135 optional bool is_screen_on = 3; 136 } 137 138 // Mapping of Error/Success codes to the number of background scans that resulted in it 139 repeated ScanReturnEntry background_scan_return_entries = 18; 140 141 // Mapping of system state to the number of times that Background scans were requested in that 142 // state 143 repeated WifiSystemStateEntry background_scan_request_state = 19; 144 145 // Total number of times the Watchdog of Last Resort triggered, resetting the wifi stack 146 optional int32 num_last_resort_watchdog_triggers = 20; 147 148 // Total number of networks over bad association threshold when watchdog triggered 149 optional int32 num_last_resort_watchdog_bad_association_networks_total = 21; 150 151 // Total number of networks over bad authentication threshold when watchdog triggered 152 optional int32 num_last_resort_watchdog_bad_authentication_networks_total = 22; 153 154 // Total number of networks over bad dhcp threshold when watchdog triggered 155 optional int32 num_last_resort_watchdog_bad_dhcp_networks_total = 23; 156 157 // Total number of networks over bad other threshold when watchdog triggered 158 optional int32 num_last_resort_watchdog_bad_other_networks_total = 24; 159 160 // Total count of networks seen when watchdog triggered 161 optional int32 num_last_resort_watchdog_available_networks_total = 25; 162 163 // Total count of triggers with atleast one bad association network 164 optional int32 num_last_resort_watchdog_triggers_with_bad_association = 26; 165 166 // Total count of triggers with atleast one bad authentication network 167 optional int32 num_last_resort_watchdog_triggers_with_bad_authentication = 27; 168 169 // Total count of triggers with atleast one bad dhcp network 170 optional int32 num_last_resort_watchdog_triggers_with_bad_dhcp = 28; 171 172 // Total count of triggers with atleast one bad other network 173 optional int32 num_last_resort_watchdog_triggers_with_bad_other = 29; 174 175 // Count of times connectivity watchdog confirmed pno is working 176 optional int32 num_connectivity_watchdog_pno_good = 30; 177 178 // Count of times connectivity watchdog found pno not working 179 optional int32 num_connectivity_watchdog_pno_bad = 31; 180 181 // Count of times connectivity watchdog confirmed background scan is working 182 optional int32 num_connectivity_watchdog_background_good = 32; 183 184 // Count of times connectivity watchdog found background scan not working 185 optional int32 num_connectivity_watchdog_background_bad = 33; 186 187 // The time duration represented by this wifi log, from start to end of capture 188 optional int32 record_duration_sec = 34; 189 190 // Counts the occurrences of each individual RSSI poll level 191 repeated RssiPollCount rssi_poll_rssi_count = 35; 192 193 // Total number of times WiFi connected immediately after a Last Resort Watchdog trigger, 194 // without new networks becoming available. 195 optional int32 num_last_resort_watchdog_successes = 36; 196 197 // Counts the occurrences of each alert reason. 198 repeated AlertReasonCount alert_reason_count = 47; 199 200 // Total number of saved hidden networks 201 optional int32 num_hidden_networks = 37; 202 203 // Total number of saved passpoint / hotspot 2.0 networks 204 optional int32 num_passpoint_networks = 38; 205 206 // Total number of scan results 207 optional int32 num_total_scan_results = 39; 208 209 // Total number of scan results for open networks 210 optional int32 num_open_network_scan_results = 40; 211 212 // Total number of scan results for personal networks 213 optional int32 num_personal_network_scan_results = 41; 214 215 // Total number of scan results for enterprise networks 216 optional int32 num_enterprise_network_scan_results = 42; 217 218 // Total number of scan results for hidden networks 219 optional int32 num_hidden_network_scan_results = 43; 220 221 // Total number of scan results for hotspot 2.0 r1 networks 222 optional int32 num_hotspot2_r1_network_scan_results = 44; 223 224 // Total number of scan results for hotspot 2.0 r2 networks 225 optional int32 num_hotspot2_r2_network_scan_results = 45; 226 227 // Total number of scans handled by framework (oneshot or otherwise) 228 optional int32 num_scans = 46; 229 230 // Counts the occurrences of each Wifi score 231 repeated WifiScoreCount wifi_score_count = 48; 232} 233 234// Information that gets logged for every WiFi connection. 235message RouterFingerPrint { 236 237 enum RoamType { 238 239 // Type is unknown. 240 ROAM_TYPE_UNKNOWN = 0; 241 242 // No roaming - usually happens on a single band (2.4 GHz) router. 243 ROAM_TYPE_NONE = 1; 244 245 // Enterprise router. 246 ROAM_TYPE_ENTERPRISE = 2; 247 248 // DBDC => Dual Band Dual Concurrent essentially a router that 249 // supports both 2.4 GHz and 5 GHz bands. 250 ROAM_TYPE_DBDC = 3; 251 } 252 253 enum Auth { 254 255 // Auth is unknown. 256 AUTH_UNKNOWN = 0; 257 258 // No authentication. 259 AUTH_OPEN = 1; 260 261 // If the router uses a personal authentication. 262 AUTH_PERSONAL = 2; 263 264 // If the router is setup for enterprise authentication. 265 AUTH_ENTERPRISE = 3; 266 } 267 268 enum RouterTechnology { 269 270 // Router is unknown. 271 ROUTER_TECH_UNKNOWN = 0; 272 273 // Router Channel A. 274 ROUTER_TECH_A = 1; 275 276 // Router Channel B. 277 ROUTER_TECH_B = 2; 278 279 // Router Channel G. 280 ROUTER_TECH_G = 3; 281 282 // Router Channel N. 283 ROUTER_TECH_N = 4; 284 285 // Router Channel AC. 286 ROUTER_TECH_AC = 5; 287 288 // When the channel is not one of the above. 289 ROUTER_TECH_OTHER = 6; 290 } 291 292 optional RoamType roam_type = 1; 293 294 // Channel on which the connection takes place. 295 optional int32 channel_info = 2; 296 297 // DTIM setting of the router. 298 optional int32 dtim = 3; 299 300 // Authentication scheme of the router. 301 optional Auth authentication = 4; 302 303 // If the router is hidden. 304 optional bool hidden = 5; 305 306 // Channel information. 307 optional RouterTechnology router_technology = 6; 308 309 // whether ipv6 is supported. 310 optional bool supports_ipv6 = 7; 311 312 // If the router is a passpoint / hotspot 2.0 network 313 optional bool passpoint = 8; 314} 315 316message ConnectionEvent { 317 318 // Roam Type. 319 enum RoamType { 320 321 // Type is unknown. 322 ROAM_UNKNOWN = 0; 323 324 // No roaming. 325 ROAM_NONE = 1; 326 327 // DBDC roaming. 328 ROAM_DBDC = 2; 329 330 // Enterprise roaming. 331 ROAM_ENTERPRISE = 3; 332 333 // User selected roaming. 334 ROAM_USER_SELECTED = 4; 335 336 // Unrelated. 337 ROAM_UNRELATED = 5; 338 } 339 340 // Connectivity Level Failure. 341 enum ConnectivityLevelFailure { 342 343 // Failure is unknown. 344 HLF_UNKNOWN = 0; 345 346 // No failure. 347 HLF_NONE = 1; 348 349 // DHCP failure. 350 HLF_DHCP = 2; 351 352 // No internet connection. 353 HLF_NO_INTERNET = 3; 354 355 // No internet connection. 356 HLF_UNWANTED = 4; 357 } 358 359 // Start time of the connection. 360 optional int64 start_time_millis = 1;// [(datapol.semantic_type) = ST_TIMESTAMP]; 361 362 // Duration to connect. 363 optional int32 duration_taken_to_connect_millis = 2; 364 365 // Router information. 366 optional RouterFingerPrint router_fingerprint = 3; 367 368 // RSSI at the start of the connection. 369 optional int32 signal_strength = 4; 370 371 // Roam Type. 372 optional RoamType roam_type = 5; 373 374 // Result of the connection. 375 optional int32 connection_result = 6; 376 377 // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant). 378 optional int32 level_2_failure_code = 7; 379 380 // Failures that happen at the connectivity layer. 381 optional ConnectivityLevelFailure connectivity_level_failure_code = 8; 382 383 // Has bug report been taken. 384 optional bool automatic_bug_report_taken = 9; 385} 386 387// Number of occurrences of a specific RSSI poll rssi value 388message RssiPollCount { 389 // RSSI 390 optional int32 rssi = 1; 391 392 // Number of RSSI polls with 'rssi' 393 optional int32 count = 2; 394} 395 396// Number of occurrences of a specific alert reason value 397message AlertReasonCount { 398 // Alert reason 399 optional int32 reason = 1; 400 401 // Number of alerts with |reason|. 402 optional int32 count = 2; 403} 404 405// Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport 406message WifiScoreCount { 407 // Wifi Score 408 optional int32 score = 1; 409 410 // Number of Wifi score reports with this score 411 optional int32 count = 2; 412} 413