Glen Kuhne | 9481457 | 2016-10-25 12:40:35 -0700 | [diff] [blame] | 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 | |
| 17 | syntax = "proto2"; |
| 18 | |
| 19 | package clearcut.connectivity; |
| 20 | |
| 21 | option java_package = "com.android.server.wifi"; |
| 22 | option java_outer_classname = "WifiMetricsProto"; |
| 23 | |
| 24 | // The information about the Wifi events. |
| 25 | message 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 | // Total number of saved hidden networks |
| 198 | optional int32 num_hidden_networks = 37; |
| 199 | |
| 200 | // Total number of saved passpoint / hotspot 2.0 networks |
| 201 | optional int32 num_passpoint_networks = 38; |
| 202 | |
| 203 | // Total number of scan results |
| 204 | optional int32 num_total_scan_results = 39; |
| 205 | |
| 206 | // Total number of scan results for open networks |
| 207 | optional int32 num_open_network_scan_results = 40; |
| 208 | |
| 209 | // Total number of scan results for personal networks |
| 210 | optional int32 num_personal_network_scan_results = 41; |
| 211 | |
| 212 | // Total number of scan results for enterprise networks |
| 213 | optional int32 num_enterprise_network_scan_results = 42; |
| 214 | |
| 215 | // Total number of scan results for hidden networks |
| 216 | optional int32 num_hidden_network_scan_results = 43; |
| 217 | |
| 218 | // Total number of scan results for hotspot 2.0 r1 networks |
| 219 | optional int32 num_hotspot2_r1_network_scan_results = 44; |
| 220 | |
| 221 | // Total number of scan results for hotspot 2.0 r2 networks |
| 222 | optional int32 num_hotspot2_r2_network_scan_results = 45; |
| 223 | |
| 224 | // Total number of scans handled by framework (oneshot or otherwise) |
| 225 | optional int32 num_scans = 46; |
| 226 | |
| 227 | // Counts the occurrences of each alert reason. |
| 228 | repeated AlertReasonCount alert_reason_count = 47; |
| 229 | |
| 230 | // Counts the occurrences of each Wifi score |
| 231 | repeated WifiScoreCount wifi_score_count = 48; |
| 232 | |
| 233 | // Histogram of Soft AP Durations |
| 234 | repeated SoftApDurationBucket soft_ap_duration = 49; |
| 235 | |
| 236 | // Histogram of Soft AP ReturnCode |
| 237 | repeated SoftApReturnCodeCount soft_ap_return_code = 50; |
| 238 | |
| 239 | // Histogram of the delta between scan result RSSI and RSSI polls |
| 240 | repeated RssiPollCount rssi_poll_delta_count = 51; |
| 241 | } |
| 242 | |
| 243 | // Information that gets logged for every WiFi connection. |
| 244 | message RouterFingerPrint { |
| 245 | |
| 246 | enum RoamType { |
| 247 | |
| 248 | // Type is unknown. |
| 249 | ROAM_TYPE_UNKNOWN = 0; |
| 250 | |
| 251 | // No roaming - usually happens on a single band (2.4 GHz) router. |
| 252 | ROAM_TYPE_NONE = 1; |
| 253 | |
| 254 | // Enterprise router. |
| 255 | ROAM_TYPE_ENTERPRISE = 2; |
| 256 | |
| 257 | // DBDC => Dual Band Dual Concurrent essentially a router that |
| 258 | // supports both 2.4 GHz and 5 GHz bands. |
| 259 | ROAM_TYPE_DBDC = 3; |
| 260 | } |
| 261 | |
| 262 | enum Auth { |
| 263 | |
| 264 | // Auth is unknown. |
| 265 | AUTH_UNKNOWN = 0; |
| 266 | |
| 267 | // No authentication. |
| 268 | AUTH_OPEN = 1; |
| 269 | |
| 270 | // If the router uses a personal authentication. |
| 271 | AUTH_PERSONAL = 2; |
| 272 | |
| 273 | // If the router is setup for enterprise authentication. |
| 274 | AUTH_ENTERPRISE = 3; |
| 275 | } |
| 276 | |
| 277 | enum RouterTechnology { |
| 278 | |
| 279 | // Router is unknown. |
| 280 | ROUTER_TECH_UNKNOWN = 0; |
| 281 | |
| 282 | // Router Channel A. |
| 283 | ROUTER_TECH_A = 1; |
| 284 | |
| 285 | // Router Channel B. |
| 286 | ROUTER_TECH_B = 2; |
| 287 | |
| 288 | // Router Channel G. |
| 289 | ROUTER_TECH_G = 3; |
| 290 | |
| 291 | // Router Channel N. |
| 292 | ROUTER_TECH_N = 4; |
| 293 | |
| 294 | // Router Channel AC. |
| 295 | ROUTER_TECH_AC = 5; |
| 296 | |
| 297 | // When the channel is not one of the above. |
| 298 | ROUTER_TECH_OTHER = 6; |
| 299 | } |
| 300 | |
| 301 | optional RoamType roam_type = 1; |
| 302 | |
| 303 | // Channel on which the connection takes place. |
| 304 | optional int32 channel_info = 2; |
| 305 | |
| 306 | // DTIM setting of the router. |
| 307 | optional int32 dtim = 3; |
| 308 | |
| 309 | // Authentication scheme of the router. |
| 310 | optional Auth authentication = 4; |
| 311 | |
| 312 | // If the router is hidden. |
| 313 | optional bool hidden = 5; |
| 314 | |
| 315 | // Channel information. |
| 316 | optional RouterTechnology router_technology = 6; |
| 317 | |
| 318 | // whether ipv6 is supported. |
| 319 | optional bool supports_ipv6 = 7; |
| 320 | |
| 321 | // If the router is a passpoint / hotspot 2.0 network |
| 322 | optional bool passpoint = 8; |
| 323 | } |
| 324 | |
| 325 | message ConnectionEvent { |
| 326 | |
| 327 | // Roam Type. |
| 328 | enum RoamType { |
| 329 | |
| 330 | // Type is unknown. |
| 331 | ROAM_UNKNOWN = 0; |
| 332 | |
| 333 | // No roaming. |
| 334 | ROAM_NONE = 1; |
| 335 | |
| 336 | // DBDC roaming. |
| 337 | ROAM_DBDC = 2; |
| 338 | |
| 339 | // Enterprise roaming. |
| 340 | ROAM_ENTERPRISE = 3; |
| 341 | |
| 342 | // User selected roaming. |
| 343 | ROAM_USER_SELECTED = 4; |
| 344 | |
| 345 | // Unrelated. |
| 346 | ROAM_UNRELATED = 5; |
| 347 | } |
| 348 | |
| 349 | // Connectivity Level Failure. |
| 350 | enum ConnectivityLevelFailure { |
| 351 | |
| 352 | // Failure is unknown. |
| 353 | HLF_UNKNOWN = 0; |
| 354 | |
| 355 | // No failure. |
| 356 | HLF_NONE = 1; |
| 357 | |
| 358 | // DHCP failure. |
| 359 | HLF_DHCP = 2; |
| 360 | |
| 361 | // No internet connection. |
| 362 | HLF_NO_INTERNET = 3; |
| 363 | |
| 364 | // No internet connection. |
| 365 | HLF_UNWANTED = 4; |
| 366 | } |
| 367 | |
| 368 | // Start time of the connection. |
| 369 | optional int64 start_time_millis = 1;// [(datapol.semantic_type) = ST_TIMESTAMP]; |
| 370 | |
| 371 | // Duration to connect. |
| 372 | optional int32 duration_taken_to_connect_millis = 2; |
| 373 | |
| 374 | // Router information. |
| 375 | optional RouterFingerPrint router_fingerprint = 3; |
| 376 | |
| 377 | // RSSI at the start of the connection. |
| 378 | optional int32 signal_strength = 4; |
| 379 | |
| 380 | // Roam Type. |
| 381 | optional RoamType roam_type = 5; |
| 382 | |
| 383 | // Result of the connection. |
| 384 | optional int32 connection_result = 6; |
| 385 | |
| 386 | // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant). |
| 387 | optional int32 level_2_failure_code = 7; |
| 388 | |
| 389 | // Failures that happen at the connectivity layer. |
| 390 | optional ConnectivityLevelFailure connectivity_level_failure_code = 8; |
| 391 | |
| 392 | // Has bug report been taken. |
| 393 | optional bool automatic_bug_report_taken = 9; |
| 394 | } |
| 395 | |
| 396 | // Number of occurrences of a specific RSSI poll rssi value |
| 397 | message RssiPollCount { |
| 398 | // RSSI |
| 399 | optional int32 rssi = 1; |
| 400 | |
| 401 | // Number of RSSI polls with 'rssi' |
| 402 | optional int32 count = 2; |
| 403 | } |
| 404 | |
| 405 | // Number of occurrences of a specific alert reason value |
| 406 | message AlertReasonCount { |
| 407 | // Alert reason |
| 408 | optional int32 reason = 1; |
| 409 | |
| 410 | // Number of alerts with |reason|. |
| 411 | optional int32 count = 2; |
| 412 | } |
| 413 | |
| 414 | // Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport |
| 415 | message WifiScoreCount { |
| 416 | // Wifi Score |
| 417 | optional int32 score = 1; |
| 418 | |
| 419 | // Number of Wifi score reports with this score |
| 420 | optional int32 count = 2; |
| 421 | } |
| 422 | |
| 423 | // Number of occurrences of Soft AP session durations |
| 424 | message SoftApDurationBucket { |
| 425 | // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec) |
| 426 | // The (inclusive) lower bound of Soft AP session duration represented by this bucket |
| 427 | optional int32 duration_sec = 1; |
| 428 | |
| 429 | // The size of this bucket |
| 430 | optional int32 bucket_size_sec = 2; |
| 431 | |
| 432 | // Number of soft AP session durations that fit into this bucket |
| 433 | optional int32 count = 3; |
| 434 | } |
| 435 | |
| 436 | // Number of occurrences of a soft AP session return code |
| 437 | message SoftApReturnCodeCount { |
Rebecca Silberstein | 28d9de2 | 2017-01-24 10:42:59 -0800 | [diff] [blame] | 438 | |
| 439 | enum SoftApStartResult { |
| 440 | |
| 441 | // SoftApManager return code unknown |
| 442 | SOFT_AP_RETURN_CODE_UNKNOWN = 0; |
| 443 | |
| 444 | // SoftAp started successfully |
| 445 | SOFT_AP_STARTED_SUCCESSFULLY = 1; |
| 446 | |
| 447 | // Catch all for failures with no specific failure reason |
| 448 | SOFT_AP_FAILED_GENERAL_ERROR = 2; |
| 449 | |
| 450 | // SoftAp failed to start due to NO_CHANNEL error |
| 451 | SOFT_AP_FAILED_NO_CHANNEL = 3; |
| 452 | } |
| 453 | |
| 454 | // Historical, no longer used for writing as of 01/2017. |
| 455 | optional int32 return_code = 1 [deprecated = true]; |
Glen Kuhne | 9481457 | 2016-10-25 12:40:35 -0700 | [diff] [blame] | 456 | |
| 457 | // Occurrences of this soft AP return code |
| 458 | optional int32 count = 2; |
Rebecca Silberstein | 28d9de2 | 2017-01-24 10:42:59 -0800 | [diff] [blame] | 459 | |
| 460 | // Result of attempt to start SoftAp |
| 461 | optional SoftApStartResult start_result = 3; |
Glen Kuhne | 9481457 | 2016-10-25 12:40:35 -0700 | [diff] [blame] | 462 | } |