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 com_android_server_wifi;
20
21option java_package = "com.android.server.wifi.proto";
22option java_outer_classname = "WifiMetricsProto";
23
24// The information about the Wifi events.
25message WifiLog {
26  reserved 122;
27
28  // Session information that gets logged for every Wifi connection.
29  repeated ConnectionEvent connection_event = 1;
30
31  // Number of saved networks in the user profile.
32  optional int32 num_saved_networks = 2;
33
34  // Number of open networks in the saved networks.
35  optional int32 num_open_networks = 3;
36
37  // Number of legacy personal networks.
38  optional int32 num_legacy_personal_networks = 4;
39
40  // Number of legacy enterprise networks.
41  optional int32 num_legacy_enterprise_networks = 5;
42
43  // Does the user have location setting enabled.
44  optional bool is_location_enabled = 6;
45
46  // Does the user have scanning enabled.
47  optional bool is_scanning_always_enabled = 7;
48
49  // Number of times user toggled wifi using the settings menu.
50  optional int32 num_wifi_toggled_via_settings = 8;
51
52  // Number of times user toggled wifi using the airplane menu.
53  optional int32 num_wifi_toggled_via_airplane = 9;
54
55  // Number of networks added by the user.
56  optional int32 num_networks_added_by_user = 10;
57
58  // Number of networks added by applications.
59  optional int32 num_networks_added_by_apps = 11;
60
61  // Number scans that returned empty results.
62  optional int32 num_empty_scan_results = 12;
63
64  // Number scans that returned at least one result.
65  optional int32 num_non_empty_scan_results = 13;
66
67  // Number of single scans requests.
68  optional int32 num_oneshot_scans = 14;
69
70  // Number of repeated background scans that were scheduled to the chip.
71  optional int32 num_background_scans = 15;
72
73  // Error codes that a scan can result in.
74  enum ScanReturnCode {
75
76    // Return Code is unknown.
77    SCAN_UNKNOWN = 0;
78
79    // Scan was successful.
80    SCAN_SUCCESS = 1;
81
82    // Scan was successfully started, but was interrupted.
83    SCAN_FAILURE_INTERRUPTED = 2;
84
85    //  Scan failed to start because of invalid configuration
86    //  (bad channel, etc).
87    SCAN_FAILURE_INVALID_CONFIGURATION = 3;
88
89    // Could not start a scan because wifi is disabled.
90    FAILURE_WIFI_DISABLED = 4;
91
92  }
93
94  // Mapping of error codes to the number of times that scans resulted
95  // in that error.
96  repeated ScanReturnEntry scan_return_entries = 16;
97
98  message ScanReturnEntry {
99
100    // Return code of the scan.
101    optional ScanReturnCode scan_return_code = 1;
102
103    // Number of entries that were found in the scan.
104    optional int32 scan_results_count = 2;
105  }
106
107  // State of the Wifi.
108  enum WifiState {
109
110    // State is unknown.
111    WIFI_UNKNOWN = 0;
112
113    // Wifi is disabled.
114    WIFI_DISABLED = 1;
115
116    // Wifi is enabled.
117    WIFI_DISCONNECTED = 2;
118
119    // Wifi is enabled and associated with an AP.
120    WIFI_ASSOCIATED = 3;
121  }
122
123  // Mapping of system state to the number of times that scans were requested in
124  // that state
125  repeated WifiSystemStateEntry wifi_system_state_entries = 17;
126
127  message WifiSystemStateEntry {
128
129    // Current WiFi state.
130    optional WifiState wifi_state = 1;
131
132    // Count of scans in state.
133    optional int32 wifi_state_count = 2;
134
135    // Is screen on.
136    optional bool is_screen_on = 3;
137  }
138
139  // Mapping of Error/Success codes to the number of background scans that resulted in it
140  repeated ScanReturnEntry background_scan_return_entries = 18;
141
142  // Mapping of system state to the number of times that Background scans were requested in that
143  // state
144  repeated WifiSystemStateEntry background_scan_request_state = 19;
145
146  // Total number of times the Watchdog of Last Resort triggered, resetting the wifi stack
147  optional int32 num_last_resort_watchdog_triggers = 20;
148
149  // Total number of networks over bad association threshold when watchdog triggered
150  optional int32 num_last_resort_watchdog_bad_association_networks_total = 21;
151
152  // Total number of networks over bad authentication threshold when watchdog triggered
153  optional int32 num_last_resort_watchdog_bad_authentication_networks_total = 22;
154
155  // Total number of networks over bad dhcp threshold when watchdog triggered
156  optional int32 num_last_resort_watchdog_bad_dhcp_networks_total = 23;
157
158  // Total number of networks over bad other threshold when watchdog triggered
159  optional int32 num_last_resort_watchdog_bad_other_networks_total = 24;
160
161  // Total count of networks seen when watchdog triggered
162  optional int32 num_last_resort_watchdog_available_networks_total = 25;
163
164  // Total count of triggers with atleast one bad association network
165  optional int32 num_last_resort_watchdog_triggers_with_bad_association = 26;
166
167  // Total count of triggers with atleast one bad authentication network
168  optional int32 num_last_resort_watchdog_triggers_with_bad_authentication = 27;
169
170  // Total count of triggers with atleast one bad dhcp network
171  optional int32 num_last_resort_watchdog_triggers_with_bad_dhcp = 28;
172
173  // Total count of triggers with atleast one bad other network
174  optional int32 num_last_resort_watchdog_triggers_with_bad_other = 29;
175
176  // Count of times connectivity watchdog confirmed pno is working
177  optional int32 num_connectivity_watchdog_pno_good = 30;
178
179  // Count of times connectivity watchdog found pno not working
180  optional int32 num_connectivity_watchdog_pno_bad = 31;
181
182  // Count of times connectivity watchdog confirmed background scan is working
183  optional int32 num_connectivity_watchdog_background_good = 32;
184
185  // Count of times connectivity watchdog found background scan not working
186  optional int32 num_connectivity_watchdog_background_bad = 33;
187
188  // The time duration represented by this wifi log, from start to end of capture
189  optional int32 record_duration_sec = 34;
190
191  // Counts the occurrences of each individual RSSI poll level
192  repeated RssiPollCount rssi_poll_rssi_count = 35;
193
194  // Total number of times WiFi connected immediately after a Last Resort Watchdog trigger,
195  // without new networks becoming available.
196  optional int32 num_last_resort_watchdog_successes = 36;
197
198  // Total number of saved hidden networks
199  optional int32 num_hidden_networks = 37;
200
201  // Total number of saved passpoint / hotspot 2.0 networks
202  optional int32 num_passpoint_networks = 38;
203
204  // Total number of scan results
205  optional int32 num_total_scan_results = 39;
206
207  // Total number of scan results for open networks
208  optional int32 num_open_network_scan_results = 40;
209
210  // Total number of scan results for legacy personal networks
211  optional int32 num_legacy_personal_network_scan_results = 41;
212
213  // Total number of scan results for legacy enterprise networks
214  optional int32 num_legacy_enterprise_network_scan_results = 42;
215
216  // Total number of scan results for hidden networks
217  optional int32 num_hidden_network_scan_results = 43;
218
219  // Total number of scan results for hotspot 2.0 r1 networks
220  optional int32 num_hotspot2_r1_network_scan_results = 44;
221
222  // Total number of scan results for hotspot 2.0 r2 networks
223  optional int32 num_hotspot2_r2_network_scan_results = 45;
224
225  // Total number of scans handled by framework (oneshot or otherwise)
226  optional int32 num_scans = 46;
227
228  // Counts the occurrences of each alert reason.
229  repeated AlertReasonCount alert_reason_count = 47;
230
231  // Counts the occurrences of each Wifi score
232  repeated WifiScoreCount wifi_score_count = 48;
233
234  // Histogram of Soft AP Durations
235  repeated SoftApDurationBucket soft_ap_duration = 49;
236
237  // Histogram of Soft AP ReturnCode
238  repeated SoftApReturnCodeCount soft_ap_return_code = 50;
239
240  // Histogram of the delta between scan result RSSI and RSSI polls
241  repeated RssiPollCount rssi_poll_delta_count = 51;
242
243  // List of events
244  repeated StaEvent sta_event_list = 52;
245
246  // Total number of times WiFi HAL crashed.
247  optional int32 num_hal_crashes = 53;
248
249  // Total number of times WiFicond crashed.
250  optional int32 num_wificond_crashes = 54;
251
252  // Indicates the number of times an error was encountered in
253  // Wifi HAL on |WifiNative.setupInterfaceForClientMode|.
254  optional int32 num_setup_client_interface_failure_due_to_hal = 55;
255
256  // Indicates the number of times an error was encountered in
257  // Wificond on |WifiNative.setupInterfaceForClientMode|.
258  optional int32 num_setup_client_interface_failure_due_to_wificond = 56;
259
260  // Wi-Fi Aware metrics
261  optional WifiAwareLog wifi_aware_log = 57;
262
263  // Number of saved Passpoint providers in user profile.
264  optional int32 num_passpoint_providers = 58;
265
266  // Count of times Passpoint provider being installed.
267  optional int32 num_passpoint_provider_installation = 59;
268
269  // Count of times Passpoint provivider is installed successfully.
270  optional int32 num_passpoint_provider_install_success = 60;
271
272  // Count of times Passpoint provider is being uninstalled.
273  optional int32 num_passpoint_provider_uninstallation = 61;
274
275  // Count of times Passpoint provider is uninstalled successfully.
276  optional int32 num_passpoint_provider_uninstall_success = 62;
277
278  // Count of saved Passpoint providers device has ever connected to.
279  optional int32 num_passpoint_providers_successfully_connected = 63;
280
281  // Histogram counting instances of scans with N many ScanResults with unique ssids
282  repeated NumConnectableNetworksBucket total_ssids_in_scan_histogram = 64;
283
284  // Histogram counting instances of scans with N many ScanResults/bssids
285  repeated NumConnectableNetworksBucket total_bssids_in_scan_histogram = 65;
286
287  // Histogram counting instances of scans with N many unique open ssids
288  repeated NumConnectableNetworksBucket available_open_ssids_in_scan_histogram = 66;
289
290  // Histogram counting instances of scans with N many bssids for open networks
291  repeated NumConnectableNetworksBucket available_open_bssids_in_scan_histogram = 67;
292
293  // Histogram counting instances of scans with N many unique ssids for saved networks
294  repeated NumConnectableNetworksBucket available_saved_ssids_in_scan_histogram = 68;
295
296  // Histogram counting instances of scans with N many bssids for saved networks
297  repeated NumConnectableNetworksBucket available_saved_bssids_in_scan_histogram = 69;
298
299  // Histogram counting instances of scans with N many unique SSIDs for open or saved networks
300  repeated NumConnectableNetworksBucket available_open_or_saved_ssids_in_scan_histogram = 70;
301
302  // Histogram counting instances of scans with N many BSSIDs for open or saved networks
303  repeated NumConnectableNetworksBucket available_open_or_saved_bssids_in_scan_histogram = 71;
304
305  // Histogram counting instances of scans with N many ScanResults matching unique saved passpoint providers
306  repeated NumConnectableNetworksBucket available_saved_passpoint_provider_profiles_in_scan_histogram = 72;
307
308  // Histogram counting instances of scans with N many ScanResults BSSIDs matching a saved passpoint provider
309  repeated NumConnectableNetworksBucket available_saved_passpoint_provider_bssids_in_scan_histogram = 73;
310
311  // Counts the number of AllSingleScanLister.onResult calls with a full band scan result
312  optional int32 full_band_all_single_scan_listener_results = 74;
313
314  // Counts the number of AllSingleScanLister.onResult calls with a partial (channels) scan result
315  optional int32 partial_all_single_scan_listener_results = 75;
316
317  // Pno scan metrics
318  optional PnoScanMetrics pno_scan_metrics = 76;
319
320  // Histogram of "Connect to Network" notifications.
321  // The notification Action should be unset.
322  repeated ConnectToNetworkNotificationAndActionCount connect_to_network_notification_count = 77;
323
324  // Histogram of "Connect to Network" notification user actions.
325  repeated ConnectToNetworkNotificationAndActionCount connect_to_network_notification_action_count = 78;
326
327  // The number of SSIDs blocked from recommendation by the open network
328  // notification recommender
329  optional int32 open_network_recommender_blocklist_size = 79;
330
331  // Is the available network notification feature turned on
332  optional bool is_wifi_networks_available_notification_on = 80;
333
334  // Count of recommendation updates made by the open network notification
335  // recommender
336  optional int32 num_open_network_recommendation_updates = 81;
337
338  // Count of connection attempts that were initiated unsuccessfully
339  optional int32 num_open_network_connect_message_failed_to_send = 82;
340
341  // Histogram counting instances of scans with N many HotSpot 2.0 R1 APs
342  repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_in_scan_histogram = 83;
343
344  // Histogram counting instances of scans with N many HotSpot 2.0 R2 APs
345  repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_in_scan_histogram = 84;
346
347  // Histogram counting instances of scans with N many unique HotSpot 2.0 R1 ESS.
348  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
349  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
350  // order).
351  repeated NumConnectableNetworksBucket observed_hotspot_r1_ess_in_scan_histogram = 85;
352
353  // Histogram counting instances of scans with N many unique HotSpot 2.0 R2 ESS.
354  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
355  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
356  // order).
357  repeated NumConnectableNetworksBucket observed_hotspot_r2_ess_in_scan_histogram = 86;
358
359  // Histogram counting number of HotSpot 2.0 R1 APs per observed ESS in a scan
360  // (one value added per unique ESS - potentially multiple counts per single
361  // scan!)
362  repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_per_ess_in_scan_histogram = 87;
363
364  // Histogram counting number of HotSpot 2.0 R2 APs per observed ESS in a scan
365  // (one value added per unique ESS - potentially multiple counts per single
366  // scan!)
367  repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_per_ess_in_scan_histogram = 88;
368
369  // SoftAP event list tracking sessions and client counts in tethered mode
370  repeated SoftApConnectedClientsEvent soft_ap_connected_clients_events_tethered = 89;
371
372  // SoftAP event list tracking sessions and client counts in local only mode
373  repeated SoftApConnectedClientsEvent soft_ap_connected_clients_events_local_only = 90;
374
375  // WPS connection metrics - removed
376  reserved 91;
377  reserved "wps_metrics";
378
379  // Wifi power statistics
380  optional WifiPowerStats wifi_power_stats = 92;
381
382  // Number of connectivity single scan requests.
383  optional int32 num_connectivity_oneshot_scans = 93;
384
385  // WifiWake statistics
386  optional WifiWakeStats wifi_wake_stats = 94;
387
388  // Histogram counting instances of scans with N many 802.11mc (RTT) supporting APs
389  repeated NumConnectableNetworksBucket observed_80211mc_supporting_aps_in_scan_histogram = 95;
390
391  // Total number of times supplicant crashed.
392  optional int32 num_supplicant_crashes = 96;
393
394  // Total number of times hostapd crashed.
395  optional int32 num_hostapd_crashes = 97;
396
397  // Indicates the number of times an error was encountered in
398  // supplicant on |WifiNative.setupInterfaceForClientMode|.
399  optional int32 num_setup_client_interface_failure_due_to_supplicant = 98;
400
401  // Indicates the number of times an error was encountered in
402  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
403  optional int32 num_setup_soft_ap_interface_failure_due_to_hal = 99;
404
405  // Indicates the number of times an error was encountered in
406  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
407  optional int32 num_setup_soft_ap_interface_failure_due_to_wificond = 100;
408
409  // Indicates the number of times an error was encountered in
410  // Wifi HAL on |WifiNative.setupInterfaceForSoftApMode|.
411  optional int32 num_setup_soft_ap_interface_failure_due_to_hostapd = 101;
412
413  // Indicates the number of times we got an interface down in client mode.
414  optional int32 num_client_interface_down = 102;
415
416  // Indicates the number of times we got an interface down in softap mode.
417  optional int32 num_soft_ap_interface_down = 103;
418
419  // Indicates the number of scan requests from external apps.
420  optional int32 num_external_app_oneshot_scan_requests = 104;
421
422  // Indicates the number of times a scan request from an external foreground app was throttled.
423  optional int32 num_external_foreground_app_oneshot_scan_requests_throttled = 105;
424
425  // Indicates the number of times a scan request from an external background app was throttled.
426  optional int32 num_external_background_app_oneshot_scan_requests_throttled = 106;
427
428  // WifiLastResortWatchdog time milliseconds delta between trigger and first connection success
429  optional int64 watchdog_trigger_to_connection_success_duration_ms = 107 [default = -1];
430
431  // The number of times wifi experienced failures after watchdog has already been triggered and is
432  // waiting for a connection success
433  optional int64 watchdog_total_connection_failure_count_after_trigger = 108;
434
435  // Number of times DFS channel scans are requested in single scan requests.
436  optional int32 num_oneshot_has_dfs_channel_scans = 109;
437
438  // Wi-Fi RTT metrics
439  optional WifiRttLog wifi_rtt_log = 110;
440
441  // Flag which indicates if Connected MAC Randomization is enabled
442  optional bool is_mac_randomization_on = 111 [default = false];
443
444  // Number of radio mode changes to MCC (Multi channel concurrency).
445  optional int32 num_radio_mode_change_to_mcc = 112;
446
447  // Number of radio mode changes to SCC (Single channel concurrency).
448  optional int32 num_radio_mode_change_to_scc = 113;
449
450  // Number of radio mode changes to SBS (Single band simultaneous).
451  optional int32 num_radio_mode_change_to_sbs = 114;
452
453  // Number of radio mode changes to DBS (Dual band simultaneous).
454  optional int32 num_radio_mode_change_to_dbs = 115;
455
456  // Number of times the firmware picked a SoftAp channel not satisfying user band preference.
457  optional int32 num_soft_ap_user_band_preference_unsatisfied = 116;
458
459  // Identifier for experimental scoring parameter settings.
460  optional string score_experiment_id = 117;
461
462  // Data on wifi radio usage
463  optional WifiRadioUsage wifi_radio_usage = 118;
464
465  // Stores settings values used for metrics testing.
466  optional ExperimentValues experiment_values = 119;
467
468  // List of WifiIsUnusableEvents which get logged when we notice that WiFi is unusable.
469  // Collected only when WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED Settings is enabled.
470  repeated WifiIsUnusableEvent wifi_is_unusable_event_list = 120;
471
472  // Counts the occurrences of each link speed (Mbps) level
473  // with rssi (dBm) and rssi^2 sums (dBm^2)
474  repeated LinkSpeedCount link_speed_counts = 121;
475
476  // Hardware revision (EVT, DVT, PVT etc.)
477  optional string hardware_revision = 124;
478
479  // Total wifi link layer usage data over the logging duration in ms.
480  optional WifiLinkLayerUsageStats wifi_link_layer_usage_stats = 125;
481
482  // Multiple lists of timestamped link layer stats with labels to represent whether wifi is usable
483  repeated WifiUsabilityStats wifi_usability_stats_list = 126;
484
485  // Counts the occurrences of each Wifi usability score provided by external app
486  repeated WifiUsabilityScoreCount wifi_usability_score_count = 127;
487
488  // List of PNO scan stats, one element for each mobility state
489  repeated DeviceMobilityStatePnoScanStats mobility_state_pno_stats_list = 128;
490
491  // Wifi p2p statistics
492  optional WifiP2pStats wifi_p2p_stats = 129;
493
494  // Easy Connect (DPP) metrics
495  optional WifiDppLog wifi_dpp_log = 130;
496
497  // Number of Enhanced Open (OWE) networks in the saved networks.
498  optional int32 num_enhanced_open_networks = 131;
499
500  // Number of WPA3-Personal networks.
501  optional int32 num_wpa3_personal_networks = 132;
502
503  // Number of WPA3-Enterprise networks.
504  optional int32 num_wpa3_enterprise_networks = 133;
505
506  // Total number of scan results for Enhanced open networks
507  optional int32 num_enhanced_open_network_scan_results = 134;
508
509  // Total number of scan results for WPA3-Personal networks
510  optional int32 num_wpa3_personal_network_scan_results = 135;
511
512  // Total number of scan results for WPA3-Enterprise networks
513  optional int32 num_wpa3_enterprise_network_scan_results = 136;
514
515  // WifiConfigStore read/write metrics.
516  optional WifiConfigStoreIO wifi_config_store_io = 137;
517
518  // Total number of saved networks with mac randomization enabled.
519  optional int32 num_saved_networks_with_mac_randomization = 138;
520
521  // Link Probe metrics
522  optional LinkProbeStats link_probe_stats = 139;
523
524  // List of NetworkSelectionExperimentDecisions stats for each experiment
525  repeated NetworkSelectionExperimentDecisions network_selection_experiment_decisions_list = 140;
526
527  // Network Request API surface metrics.
528  optional WifiNetworkRequestApiLog wifi_network_request_api_log = 141;
529
530  // Network Suggestion API surface metrics.
531  optional WifiNetworkSuggestionApiLog wifi_network_suggestion_api_log = 142;
532
533  // WifiLock statistics
534  optional WifiLockStats wifi_lock_stats = 143;
535
536  // Stats on number of times Wi-Fi is turned on/off though the WifiManager#setWifiEnabled API
537  optional WifiToggleStats wifi_toggle_stats = 144;
538
539  // Number of times WifiManager#addOrUpdateNetwork is called.
540  optional int32 num_add_or_update_network_calls = 145;
541
542  // Number of times WifiManager#enableNetwork is called.
543  optional int32 num_enable_network_calls = 146;
544
545  // Passpoint provison metrics
546  optional PasspointProvisionStats passpoint_provision_stats = 147;
547
548  // Histogram of the EAP method type of all installed Passpoint profiles for R1
549  repeated PasspointProfileTypeCount installed_passpoint_profile_type_for_r1 = 123;
550
551  // Histogram of the EAP method type of all installed Passpoint profiles for R2
552  repeated PasspointProfileTypeCount installed_passpoint_profile_type_for_r2 = 148;
553
554  // Histogram of Tx link speed at 2G
555  repeated Int32Count tx_link_speed_count_2g = 149;
556
557  // Histogram of Tx link speed at 5G low band
558  repeated Int32Count tx_link_speed_count_5g_low = 150;
559
560  // Histogram of Tx link speed at 5G middle band
561  repeated Int32Count tx_link_speed_count_5g_mid = 151;
562
563  // Histogram of Tx link speed at 5G high band
564  repeated Int32Count tx_link_speed_count_5g_high = 152;
565
566  // Histogram of Rx link speed at 2G
567  repeated Int32Count rx_link_speed_count_2g = 153;
568
569  // Histogram of Rx link speed at 5G low band
570  repeated Int32Count rx_link_speed_count_5g_low = 154;
571
572  // Histogram of Rx link speed at 5G middle band
573  repeated Int32Count rx_link_speed_count_5g_mid = 155;
574
575  // Histogram of Rx link speed at 5G high band
576  repeated Int32Count rx_link_speed_count_5g_high = 156;
577
578  // Count of IP renewal failures.
579  optional int32 num_ip_renewal_failure = 157;
580
581  // Metrics collected by health monitor
582  optional HealthMonitorMetrics health_monitor_metrics = 158;
583
584  // Metrics related to the WifiBlocklistMonitor
585  optional BssidBlocklistStats bssid_blocklist_stats = 159;
586
587  // Connection duration under various health conditions
588  optional ConnectionDurationStats connection_duration_stats = 160;
589
590  // Number of WAPI-Personal saved networks.
591  optional int32 num_wapi_personal_networks = 161;
592
593  // Number of WAPI-Enterprise saved networks.
594  optional int32 num_wapi_enterprise_networks = 162;
595
596  // Total number of scan results for WAPI-Personal networks
597  optional int32 num_wapi_personal_network_scan_results = 163;
598
599  // Total number of scan results for WAPI-Enterprise networks
600  optional int32 num_wapi_enterprise_network_scan_results = 164;
601
602  // Is the external WiFi connected network scorer from OEM extension module turned on
603  optional bool is_external_wifi_scorer_on = 165 [default = false];
604
605  // Metrics related to Wi-Fi off
606  optional WifiOffMetrics wifi_off_metrics = 166;
607
608  // Total number of scan results for MBO supported networks
609  optional int32 num_mbo_supported_network_scan_results = 167;
610
611  // Total number of scan results for MBO cellular data aware networks
612  optional int32 num_mbo_cellular_data_aware_network_scan_results = 168;
613
614  // Total number of scan results for OCE supported networks
615  optional int32 num_oce_supported_network_scan_results = 169;
616
617  // Total number of scan results for FILS supported networks
618  optional int32 num_fils_supported_network_scan_results = 170;
619
620  // Total number of bssids filtered from network selection due to mbo association
621  // disallowed indication
622  optional int32 num_bssid_filtered_due_to_mbo_assoc_disallow_ind = 171;
623
624  // Total number of connection to network supporting MBO
625  optional int32 num_connect_to_network_supporting_mbo = 172;
626
627  // Total number of connection to network supporting OCE
628  optional int32 num_connect_to_network_supporting_oce = 173;
629
630  // Total number of scans triggered due to steering request from AP
631  optional int32 num_force_scan_due_to_steering_request = 174;
632
633  // Total number of cellular switch requests from MBO supported AP
634  optional int32 num_mbo_cellular_switch_request = 175;
635
636  // Total number of connect request to AP adding FILS AKM
637  optional int32 num_connect_request_with_fils_akm = 176;
638
639  // Total number of successful L2 connection through FILS authentication
640  optional int32 num_l2_connection_through_fils_authentication = 177;
641
642  // Metrics related to limitation in soft ap config
643  optional SoftApConfigLimitationMetrics soft_ap_config_limitation_metrics = 178;
644
645  // WiFi channel utilization histogram of various RF bands
646  optional ChannelUtilizationHistogram channel_utilization_histogram = 179;
647
648  // WiFi Tx and Rx throughput histogram at various RF bands
649  optional ThroughputMbpsHistogram throughput_mbps_histogram = 180;
650
651  // Total number of steering requests which include MBO assoc retry delay
652  optional int32 num_steering_request_including_mbo_assoc_retry_delay = 181;
653
654  // Total number of scan results from 11ax network
655  optional int32 num_11ax_network_scan_results = 182;
656
657  // Total number of scan results from 6GHz band
658  optional int32 num_6g_network_scan_results = 183;
659
660  // Initial partial scan stats
661  optional InitPartialScanStats init_partial_scan_stats = 184;
662
663  // Total number of scan results for hotspot 2.0 r3 networks
664  optional int32 num_hotspot2_r3_network_scan_results = 185;
665
666  // Histogram counting instances of scans with N many HotSpot 2.0 R3 APs
667  repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_in_scan_histogram = 186;
668
669  // Histogram counting number of HotSpot 2.0 R3 APs per observed ESS in a scan
670  // (one value added per unique ESS - potentially multiple counts per single
671  // scan!)
672  repeated NumConnectableNetworksBucket observed_hotspot_r3_aps_per_ess_in_scan_histogram = 187;
673
674  // Histogram counting instances of scans with N many unique HotSpot 2.0 R3 ESS.
675  // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or
676  // (SSID, BSSID) tuple depending on AP configuration (in the above priority
677  // order).
678  repeated NumConnectableNetworksBucket observed_hotspot_r3_ess_in_scan_histogram = 188;
679
680  // Total number of Passpoint providers with no Root CA in their profile.
681  optional int32 num_passpoint_provider_with_no_root_ca = 189;
682
683  // Total number of Passpoint providers with self-signed root CA in their profile.
684  optional int32 num_passpoint_provider_with_self_signed_root_ca = 190;
685
686  // Total number of Passpoint providers with subscription expiration date in their profile.
687  optional int32 num_passpoint_provider_with_subscription_expiration = 191;
688
689  // List of user initiated actions
690  repeated UserActionEvent user_action_events = 192;
691
692  // Does the user have wifi verbose logging enabled.
693  optional bool is_verbose_logging_enabled = 193;
694
695  // Does the user have enhanced MAC randomization forced to on.
696  optional bool is_enhanced_mac_randomization_force_enabled = 194;
697
698  // Metered stats for saved networks.
699  optional MeteredNetworkStats metered_network_stats_saved = 195;
700
701  // Metered stats for suggestion networks.
702  optional MeteredNetworkStats metered_network_stats_suggestion = 196;
703
704  // Does the user have wifi wake enabled.
705  optional bool is_wifi_wake_enabled = 197;
706
707  // User reaction to the carrier or suggestion app approval UI.
708  optional UserReactionToApprovalUiEvent user_reaction_to_approval_ui_event = 198;
709
710  // Number of connection with different BSSID between framework and firmware selection.
711  optional int32 num_bssid_different_selection_between_framework_and_firmware = 199;
712
713  // Metrics about carrier wifi network.
714  optional CarrierWifiMetrics carrier_wifi_metrics = 200;
715
716  // Long version code of wifi mainline module, 0 means not available.
717  optional int64 mainline_module_version = 201;
718
719  // Histogram of Tx link speed at 6G low band
720  repeated Int32Count tx_link_speed_count_6g_low = 202;
721
722  // Histogram of Tx link speed at 6G middle band
723  repeated Int32Count tx_link_speed_count_6g_mid = 203;
724
725  // Histogram of Tx link speed at 6G high band
726  repeated Int32Count tx_link_speed_count_6g_high = 204;
727
728  // Histogram of Rx link speed at 6G low band
729  repeated Int32Count rx_link_speed_count_6g_low = 205;
730
731  // Histogram of Rx link speed at 6G middle band
732  repeated Int32Count rx_link_speed_count_6g_mid = 206;
733
734  // Histogram of Rx link speed at 6G high band
735  repeated Int32Count rx_link_speed_count_6g_high = 207;
736
737  // Metrics about the first connection after boot.
738  optional FirstConnectAfterBootStats first_connect_after_boot_stats = 208;
739
740  // Metrics for Wifi to Wifi switches.
741  optional WifiToWifiSwitchStats wifi_to_wifi_switch_stats = 209;
742
743  // Bandwidth estimator stats.
744  optional BandwidthEstimatorStats bandwidth_estimator_stats = 210;
745
746  // Total number of scan results from 6GHz PSC band
747  optional int32 num_6g_psc_network_scan_results = 211;
748
749  // Total number of Passpoint connections with a venue URL
750  optional int32 total_number_of_passpoint_connections_with_venue_url = 212;
751
752  // Total number of Passpoint connections with a T&C URL
753  optional int32 total_number_of_passpoint_connections_with_terms_and_conditions_url = 213;
754
755  // Total number of user accepted and T&C process completed successfully
756  optional int32 total_number_of_passpoint_acceptance_of_terms_and_conditions = 214;
757
758  // Total number of Passpoint profiles with decorated identity prefix
759  optional int32 total_number_of_passpoint_profiles_with_decorated_identity = 215;
760
761  // Scope of Passpoint deauth-imminent notification: ESS or BSS
762  repeated Int32Count passpoint_deauth_imminent_scope = 216;
763
764  // Total number of steering requests from AP
765  optional int32 num_steering_request = 217;
766
767  // Histogram corresponding to the number of times recent connection failure status are reported
768  // per WifiConfiguration.RecentFailureReason
769  repeated Int32Count recent_failure_association_status = 218;
770
771  // Histogram of country codes observed from scan results.
772  // Bucket WifiMetrics.COUNTRY_CODE_CONFLICT_WIFI_SCAN for the code conflict within scan results.
773  // Bucket WifiMetrics.COUNTRY_CODE_CONFLICT_WIFI_SCAN_TELEPHONY for the code conflict between wifi
774  // and telephony.
775  // Bucket value is capped to WifiMetrics.MAX_COUNTRY_CODE_COUNT.
776  repeated Int32Count country_code_scan_histogram = 219;
777
778  // Each WifiUsabilityStatsTraining instance contains a list of WifiUsabilityStatsEntry objects,
779  // representing a time series of WiFi usability statistics recorded within a specific data
780  // capture period. It also includes information about the type of data capture and the duration
781  // of the capture period.
782  repeated WifiUsabilityStatsTraining wifi_usability_stats_training = 220;
783}
784
785// Information that gets logged for every WiFi connection.
786message RouterFingerPrint {
787
788  enum RoamType {
789
790    // Type is unknown.
791    ROAM_TYPE_UNKNOWN = 0;
792
793    // No roaming - usually happens on a single band (2.4 GHz) router.
794    ROAM_TYPE_NONE = 1;
795
796    // Enterprise router.
797    ROAM_TYPE_ENTERPRISE = 2;
798
799    // DBDC => Dual Band Dual Concurrent essentially a router that
800    // supports both 2.4 GHz and 5 GHz bands.
801    ROAM_TYPE_DBDC = 3;
802  }
803
804  enum Auth {
805
806    // Auth is unknown.
807    AUTH_UNKNOWN = 0;
808
809    // No authentication.
810    AUTH_OPEN = 1;
811
812    // If the router uses a personal authentication.
813    AUTH_PERSONAL = 2;
814
815    // If the router is setup for enterprise authentication.
816    AUTH_ENTERPRISE = 3;
817  }
818
819  enum RouterTechnology {
820
821    // Router is unknown.
822    ROUTER_TECH_UNKNOWN = 0;
823
824    // Router Channel A.
825    ROUTER_TECH_A = 1;
826
827    // Router Channel B.
828    ROUTER_TECH_B = 2;
829
830    // Router Channel G.
831    ROUTER_TECH_G = 3;
832
833    // Router Channel N.
834    ROUTER_TECH_N = 4;
835
836    // Router Channel AC.
837    ROUTER_TECH_AC = 5;
838
839    // When the channel is not one of the above.
840    ROUTER_TECH_OTHER = 6;
841
842    // Router Channel AX.
843    ROUTER_TECH_AX = 7;
844  }
845
846  enum EapMethod {
847
848    // No EAP method used
849    TYPE_EAP_UNKNOWN = 0;
850
851    // EAP with Transport Layer Security
852    TYPE_EAP_TLS = 1;
853
854    // EAP with Tunneled Transport Layer Security
855    TYPE_EAP_TTLS = 2;
856
857    // EAP with Subscriber Identity Module [RFC-4186]
858    TYPE_EAP_SIM = 3;
859
860    // EAP with Authentication and Key Agreement [RFC-4187]
861    TYPE_EAP_AKA = 4;
862
863    // EAP with Authentication and Key Agreement Prime [RFC-5448]
864    TYPE_EAP_AKA_PRIME = 5;
865
866    // Protected EAP
867    TYPE_EAP_PEAP = 6;
868
869    // EAP for Hotspot 2.0 r2 OSEN
870    TYPE_EAP_UNAUTH_TLS = 7;
871
872    // EAP with Password
873    TYPE_EAP_PWD = 8;
874
875    // EAP with WAPI certifcate
876    TYPE_EAP_WAPI_CERT = 9;
877  }
878
879  enum AuthPhase2Method {
880
881    // No phase2 method
882    TYPE_PHASE2_NONE = 0;
883
884    // Password Authentication Protocol
885    TYPE_PHASE2_PAP = 1;
886
887    // Microsoft Challenge Handshake Authentication Protocol
888    TYPE_PHASE2_MSCHAP = 2;
889
890    // Microsoft Challenge Handshake Authentication Protocol v2
891    TYPE_PHASE2_MSCHAPV2 = 3;
892
893    // Generic Token Card
894    TYPE_PHASE2_GTC = 4;
895
896    // EAP-Subscriber Identity Module [RFC-4186]
897    TYPE_PHASE2_SIM = 5;
898
899    // EAP-Authentication and Key Agreement [RFC-4187]
900    TYPE_PHASE2_AKA = 6;
901
902    // EAP-Authentication and Key Agreement Prime [RFC-5448]
903    TYPE_PHASE2_AKA_PRIME = 7;
904  }
905
906  enum OcspType {
907    // Do not use OCSP stapling
908    TYPE_OCSP_NONE = 0;
909
910    // Try to use OCSP stapling, but not require response
911    TYPE_OCSP_REQUEST_CERT_STATUS = 1;
912
913    // Require valid OCSP stapling response
914    TYPE_OCSP_REQUIRE_CERT_STATUS = 2;
915
916    // Require valid OCSP stapling response for all not-trusted certificates
917    // in the server certificate chain
918    TYPE_OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3;
919  }
920
921  optional RoamType roam_type = 1;
922
923  // Channel on which the connection takes place.
924  optional int32 channel_info = 2;
925
926  // DTIM setting of the router.
927  optional int32 dtim = 3;
928
929  // Authentication scheme of the router.
930  optional Auth authentication = 4;
931
932  // If the router is hidden.
933  optional bool hidden = 5;
934
935  // Channel information.
936  optional RouterTechnology router_technology = 6;
937
938  // whether ipv6 is supported.
939  optional bool supports_ipv6 = 7;
940
941  // If the router is a Passpoint / Hotspot 2.0 network
942  optional bool passpoint = 8;
943
944  // EAP method used by the enterprise network
945  optional EapMethod eap_method = 9;
946
947  // Phase 2 authentication method after setting up a secure channel
948  optional AuthPhase2Method auth_phase2_method = 10;
949
950  // Online certificate status protocol stapling type
951  optional OcspType ocsp_type = 11;
952
953  // PMK caching enablement
954  optional bool pmk_cache_enabled = 12;
955
956  // Max Tx link speed (in Mbps) supported by current network (STA and AP)
957  optional int32 max_supported_tx_link_speed_mbps = 13;
958
959  // Max Rx link speed (in Mbps) supported by current network (STA and AP)
960  optional int32 max_supported_rx_link_speed_mbps = 14;
961
962  // If the Passpoint connection is provided by the Home provider or Roaming/visited network
963  optional bool is_passpoint_home_provider = 15;
964}
965
966enum ClientRole {
967  // default/Invalid role
968  ROLE_UNKNOWN = 0;
969
970  // STA created for scans only.
971  ROLE_CLIENT_SCAN_ONLY = 1;
972
973  // secondary STA used for make before break.
974  ROLE_CLIENT_SECONDARY_TRANSIENT = 2;
975
976  // secondary STA created for local connection (no internet connectivity).
977  ROLE_CLIENT_LOCAL_ONLY = 3;
978
979  // primary STA.
980  ROLE_CLIENT_PRIMARY = 4;
981
982  // Long lived secondary STA used for restricted use cases
983  ROLE_CLIENT_SECONDARY_LONG_LIVED = 5;
984}
985
986message ConnectionEvent {
987
988  // Roam Type.
989  enum RoamType {
990
991    // Type is unknown.
992    ROAM_UNKNOWN = 0;
993
994    // No roaming.
995    ROAM_NONE = 1;
996
997    // DBDC roaming.
998    ROAM_DBDC = 2;
999
1000    // Enterprise roaming.
1001    ROAM_ENTERPRISE = 3;
1002
1003    // User selected roaming.
1004    ROAM_USER_SELECTED = 4;
1005
1006    // Unrelated.
1007    ROAM_UNRELATED = 5;
1008  }
1009
1010  // Connectivity Level Failure.
1011  enum ConnectivityLevelFailure {
1012
1013    // Failure is unknown.
1014    HLF_UNKNOWN = 0;
1015
1016    // No failure.
1017    HLF_NONE = 1;
1018
1019    // DHCP failure.
1020    HLF_DHCP = 2;
1021
1022    // No internet connection.
1023    HLF_NO_INTERNET = 3;
1024
1025    // No internet connection.
1026    HLF_UNWANTED = 4;
1027  }
1028
1029  // Level 2 failure reason.
1030  enum Level2FailureReason {
1031
1032    // Unknown default
1033    FAILURE_REASON_UNKNOWN = 0;
1034
1035    // The reason code if there is no error during authentication. It could
1036    // also imply that there no authentication in progress.
1037    AUTH_FAILURE_NONE = 1;
1038
1039    // The reason code if there was a timeout authenticating.
1040    AUTH_FAILURE_TIMEOUT = 2;
1041
1042    // The reason code if there was a wrong password while authenticating.
1043    AUTH_FAILURE_WRONG_PSWD = 3;
1044
1045    // The reason code if there was EAP failure while authenticating.
1046    AUTH_FAILURE_EAP_FAILURE = 4;
1047
1048    // The reason code if the AP can no longer accept new clients.
1049    ASSOCIATION_REJECTION_AP_UNABLE_TO_HANDLE_NEW_STA = 5;
1050
1051    // The reason code if AP disconnects STA during the connecting state.
1052    DISCONNECTION_NON_LOCAL = 6;
1053
1054    // The reason code if a user rejects this connection.
1055    AUTH_FAILURE_REJECTED_BY_USER = 7;
1056
1057    // The reason code if an insecure Enterprise connection requires user's approval
1058    DISCONNECTED_USER_APPROVAL_NEEDED = 8;
1059  }
1060
1061  // Entity that recommended connecting to this network.
1062  enum ConnectionNominator {
1063    // Unknown nominator
1064    NOMINATOR_UNKNOWN = 0;
1065
1066    // User selected network manually
1067    NOMINATOR_MANUAL = 1;
1068
1069    // Saved network
1070    NOMINATOR_SAVED = 2;
1071
1072    // Suggestion API
1073    NOMINATOR_SUGGESTION = 3;
1074
1075    // Passpoint
1076    NOMINATOR_PASSPOINT = 4;
1077
1078    // Carrier suggestion
1079    NOMINATOR_CARRIER = 5;
1080
1081    // External scorer
1082    NOMINATOR_EXTERNAL_SCORED = 6;
1083
1084    // Network Specifier
1085    NOMINATOR_SPECIFIER = 7;
1086
1087    // User connected choice override
1088    NOMINATOR_SAVED_USER_CONNECT_CHOICE = 8;
1089
1090    // Open Network Available Pop-up
1091    NOMINATOR_OPEN_NETWORK_AVAILABLE = 9;
1092  }
1093
1094  enum NetworkType {
1095    // Unknown network type
1096    TYPE_UNKNOWN = 0;
1097
1098    // WPA2 network
1099    TYPE_WPA2 = 1;
1100
1101    // WPA3 network
1102    TYPE_WPA3 = 2;
1103
1104    // Passpoint network
1105    TYPE_PASSPOINT = 3;
1106
1107    // EAP network, excluding passpoint
1108    TYPE_EAP = 4;
1109
1110    // OWE network
1111    TYPE_OWE = 5;
1112
1113    // Open network
1114    TYPE_OPEN = 6;
1115
1116    // WAPI network
1117    TYPE_WAPI = 7;
1118  }
1119
1120  enum NetworkCreator {
1121    // This network is created by an unknown app.
1122    CREATOR_UNKNOWN = 0;
1123
1124    // This network is created by the user.
1125    CREATOR_USER = 1;
1126
1127    // This network is created by a carrier app.
1128    CREATOR_CARRIER = 2;
1129  }
1130
1131  // Start time of the connection, in milliseconds since Unix epoch (1970-01-01).
1132  optional int64 start_time_millis = 1 [deprecated=true]; // [(datapol.semantic_type) = ST_TIMESTAMP];
1133
1134  // Start time of the connection, in milliseconds since device boot
1135  optional int64 start_time_since_boot_millis = 28 [default = 0];
1136
1137  // Duration to connect.
1138  optional int32 duration_taken_to_connect_millis = 2;
1139
1140  // Router information.
1141  optional RouterFingerPrint router_fingerprint = 3;
1142
1143  // RSSI at the start of the connection.
1144  optional int32 signal_strength = 4;
1145
1146  // Roam Type.
1147  optional RoamType roam_type = 5;
1148
1149  // Result of the connection.
1150  optional int32 connection_result = 6;
1151
1152  // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant).
1153  optional int32 level_2_failure_code = 7;
1154
1155  // Failures that happen at the connectivity layer.
1156  optional ConnectivityLevelFailure connectivity_level_failure_code = 8;
1157
1158  // Has bug report been taken.
1159  optional bool automatic_bug_report_taken = 9;
1160
1161  // Connection is using locally generated random MAC address.
1162  optional bool use_randomized_mac = 10 [default = false];
1163
1164  // Who chose to connect.
1165  optional ConnectionNominator connection_nominator = 11;
1166
1167  // The currently running network selector when this connection event occurred.
1168  optional int32 network_selector_experiment_id = 12;
1169
1170  // Breakdown of level_2_failure_code with more detailed reason.
1171  optional Level2FailureReason level_2_failure_reason = 13
1172          [default = FAILURE_REASON_UNKNOWN];
1173
1174  // Connection is using an aggressively generated random MAC address.
1175  optional bool use_aggressive_mac = 14;
1176
1177  // Number of BSSIDs for this network that were excluded from network selection.
1178  optional int32 num_bssid_in_blocklist = 15;
1179
1180  // The type of network for this connection.
1181  optional NetworkType network_type = 16;
1182
1183  // UID of the app that created this network.
1184  optional NetworkCreator network_creator = 17;
1185
1186  // Whether the screen is on when the connection event starts
1187  optional bool screen_on = 18;
1188
1189  // Number of consecutive connection failures with the same SSID at high RSSI
1190  // before current connection event. Any connection failure at low RSSI in the
1191  // middle won't break the streak count. The count is cleared after
1192  // a network disconnection event.
1193  optional int32 num_consecutive_connection_failure = 19 [default = -1];
1194
1195  // Indicates if the profile used for the connection was provisioned by Passpoint OSU server
1196  optional bool is_osu_provisioned = 20;
1197
1198  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
1199  // ConnectionEvent belongs to when multiple interfaces are active concurrently.
1200  optional string interface_name = 27;
1201
1202  // The role of the wireless interface at the start of the connection.
1203  // Gives more information on what purpose this interface is used for.
1204  optional ClientRole interface_role = 29;
1205
1206  // Indicates if the profile used for the connection is carrier merged.
1207  optional bool is_carrier_merged = 30;
1208
1209  // Indicates if this was the first connection event after boot
1210  optional bool is_first_connection_after_boot = 31;
1211}
1212
1213// Number of occurrences of a specific RSSI poll rssi value
1214message RssiPollCount {
1215  // RSSI
1216  optional int32 rssi = 1;
1217
1218  // Number of RSSI polls with 'rssi'
1219  optional int32 count = 2;
1220
1221  // Beacon frequency of the channel in MHz
1222  optional int32 frequency = 3;
1223}
1224
1225// Number of occurrences of a specific alert reason value
1226message AlertReasonCount {
1227  // Alert reason
1228  optional int32 reason = 1;
1229
1230  // Number of alerts with |reason|.
1231  optional int32 count = 2;
1232}
1233
1234// Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport
1235message WifiScoreCount {
1236  // Wifi Score
1237  optional int32 score = 1;
1238
1239  // Number of Wifi score reports with this score
1240  optional int32 count = 2;
1241}
1242
1243// Counts the number of instances of a specific Wifi Usability Score
1244message WifiUsabilityScoreCount {
1245  // Wifi Usability Score
1246  optional int32 score = 1;
1247
1248  // Number of Wifi score reports with this score
1249  optional int32 count = 2;
1250}
1251
1252// Number of occurrences of a specific link speed (Mbps)
1253// and sum of rssi (dBm) and rssi^2 (dBm^2)
1254message LinkSpeedCount {
1255  // Link speed (Mbps)
1256  optional int32 link_speed_mbps = 1;
1257
1258  // Number of RSSI polls with link_speed
1259  optional int32 count = 2;
1260
1261  // Sum of absolute values of rssi values (dBm)
1262  optional int32 rssi_sum_dbm = 3;
1263
1264  // Sum of squares of rssi values (dBm^2)
1265  optional int64 rssi_sum_of_squares_dbm_sq = 4;
1266}
1267
1268
1269// Number of occurrences of Soft AP session durations
1270message SoftApDurationBucket {
1271  // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec)
1272  // The (inclusive) lower bound of Soft AP session duration represented by this bucket
1273  optional int32 duration_sec = 1;
1274
1275  // The size of this bucket
1276  optional int32 bucket_size_sec = 2;
1277
1278  // Number of soft AP session durations that fit into this bucket
1279  optional int32 count = 3;
1280}
1281
1282// Number of occurrences of a soft AP session return code
1283message SoftApReturnCodeCount {
1284
1285  enum SoftApStartResult {
1286
1287    // SoftApManager return code unknown
1288    SOFT_AP_RETURN_CODE_UNKNOWN = 0;
1289
1290    // SoftAp started successfully
1291    SOFT_AP_STARTED_SUCCESSFULLY = 1;
1292
1293    // Catch all for failures with no specific failure reason
1294    SOFT_AP_FAILED_GENERAL_ERROR = 2;
1295
1296    // SoftAp failed to start due to NO_CHANNEL error
1297    SOFT_AP_FAILED_NO_CHANNEL = 3;
1298
1299    // SoftAp failed to start due to unsupported configuration error
1300    SOFT_AP_FAILED_UNSUPPORTED_CONFIGURATION = 4;
1301  }
1302
1303  // Historical, no longer used for writing as of 01/2017.
1304  optional int32 return_code = 1 [deprecated = true];
1305
1306  // Occurrences of this soft AP return code
1307  optional int32 count = 2;
1308
1309  // Result of attempt to start SoftAp
1310  optional SoftApStartResult start_result = 3;
1311}
1312
1313message StaEvent {
1314  message ConfigInfo {
1315    // The set of key management protocols supported by this configuration.
1316    optional uint32 allowed_key_management = 1 [default = 0];
1317
1318    // The set of security protocols supported by this configuration.
1319    optional uint32 allowed_protocols = 2 [default = 0];
1320
1321    // The set of authentication protocols supported by this configuration.
1322    optional uint32 allowed_auth_algorithms = 3 [default = 0];
1323
1324    // The set of pairwise ciphers for WPA supported by this configuration.
1325    optional uint32 allowed_pairwise_ciphers = 4 [default = 0];
1326
1327    // The set of group ciphers supported by this configuration.
1328    optional uint32 allowed_group_ciphers = 5;
1329
1330    // Is this a 'hidden network'
1331    optional bool hidden_ssid = 6;
1332
1333    // Is this a Hotspot 2.0 / passpoint network
1334    optional bool is_passpoint = 7;
1335
1336    // Is this an 'ephemeral' network (Not in saved network list, recommended externally)
1337    optional bool is_ephemeral = 8;
1338
1339    // Has a successful connection ever been established using this WifiConfiguration
1340    optional bool has_ever_connected = 9;
1341
1342    // RSSI of the scan result candidate associated with this WifiConfiguration
1343    optional int32 scan_rssi = 10 [default = -127];
1344
1345    // Frequency of the scan result candidate associated with this WifiConfiguration
1346    optional int32 scan_freq = 11 [default = -1];
1347  }
1348
1349  enum EventType {
1350    // Default/Invalid event
1351    TYPE_UNKNOWN = 0;
1352
1353    // Supplicant Association Rejection event. Code contains the 802.11
1354    TYPE_ASSOCIATION_REJECTION_EVENT = 1;
1355
1356    // Supplicant L2 event,
1357    TYPE_AUTHENTICATION_FAILURE_EVENT = 2;
1358
1359    // Supplicant L2 event
1360    TYPE_NETWORK_CONNECTION_EVENT = 3;
1361
1362    // Supplicant L2 event
1363    TYPE_NETWORK_DISCONNECTION_EVENT = 4;
1364
1365    // Supplicant L2 event
1366    TYPE_SUPPLICANT_STATE_CHANGE_EVENT = 5;
1367
1368    // Supplicant L2 event
1369    TYPE_CMD_ASSOCIATED_BSSID = 6;
1370
1371    // IP Manager successfully completed IP Provisioning
1372    TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL = 7;
1373
1374    // IP Manager failed to complete IP Provisioning
1375    TYPE_CMD_IP_CONFIGURATION_LOST = 8;
1376
1377    // IP Manager lost reachability to network neighbors
1378    TYPE_CMD_IP_REACHABILITY_LOST = 9;
1379
1380    // Indicator that Supplicant is targeting a BSSID for roam/connection
1381    TYPE_CMD_TARGET_BSSID = 10;
1382
1383    // Wifi framework is initiating a connection attempt
1384    TYPE_CMD_START_CONNECT = 11;
1385
1386    // Wifi framework is initiating a roaming connection attempt
1387    TYPE_CMD_START_ROAM = 12;
1388
1389    // SystemAPI connect() command, Settings App
1390    TYPE_CONNECT_NETWORK = 13;
1391
1392    // Network Agent has validated the internet connection (Captive Portal Check success, or user
1393    // validation)
1394    TYPE_NETWORK_AGENT_VALID_NETWORK = 14;
1395
1396    // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect
1397    // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true
1398    TYPE_FRAMEWORK_DISCONNECT = 15;
1399
1400    // The NetworkAgent score for wifi has changed in a way that may impact
1401    // connectivity
1402    TYPE_SCORE_BREACH = 16;
1403
1404    // Framework changed Sta interface MAC address
1405    TYPE_MAC_CHANGE = 17;
1406
1407    // Wifi is turned on
1408    TYPE_WIFI_ENABLED = 18;
1409
1410    // Wifi is turned off
1411    TYPE_WIFI_DISABLED = 19;
1412
1413    // The NetworkAgent Wifi usability score has changed in a way that may
1414    // impact connectivity
1415    TYPE_WIFI_USABILITY_SCORE_BREACH = 20;
1416
1417    // Link probe was performed
1418    TYPE_LINK_PROBE = 21;
1419  }
1420
1421  enum FrameworkDisconnectReason {
1422    // default/none/unknown value
1423    DISCONNECT_UNKNOWN = 0;
1424
1425    // API DISCONNECT
1426    DISCONNECT_API = 1;
1427
1428    // Some framework internal reason (generic)
1429    DISCONNECT_GENERIC = 2;
1430
1431    // Network Agent network validation failed, user signaled network unwanted
1432    DISCONNECT_UNWANTED = 3;
1433
1434    // Roaming timed out
1435    DISCONNECT_ROAM_WATCHDOG_TIMER = 4;
1436
1437    // P2P service requested wifi disconnect
1438    DISCONNECT_P2P_DISCONNECT_WIFI_REQUEST = 5;
1439
1440    // SIM was removed while using a SIM config
1441    DISCONNECT_RESET_SIM_NETWORKS = 6;
1442
1443    // The network being evaluated in Make-Before-Break was disconnected due to no internet.
1444    DISCONNECT_MBB_NO_INTERNET = 7;
1445
1446    // The network has been removed from the database.
1447    DISCONNECT_NETWORK_REMOVED = 8;
1448
1449    // The network has been marked as metered.
1450    DISCONNECT_NETWORK_METERED = 9;
1451
1452    // The network has been disabled temporarily.
1453    DISCONNECT_NETWORK_TEMPORARY_DISABLED = 10;
1454
1455    // The network has been disabled permanently.
1456    DISCONNECT_NETWORK_PERMANENT_DISABLED = 11;
1457
1458    // Carrier offload for this network has been disabled.
1459    DISCONNECT_CARRIER_OFFLOAD_DISABLED = 12;
1460
1461    // Disconnected due to an issue with passpoint terms and conditions URL.
1462    DISCONNECT_PASSPOINT_TAC = 13;
1463
1464    // VCN policy is requesting to tear down the network.
1465    DISCONNECT_VCN_REQUEST = 14;
1466
1467    // Connected to a network that's not found in the database.
1468    DISCONNECT_UNKNOWN_NETWORK = 15;
1469
1470    // The network has been marked as untrusted.
1471    DISCONNECT_NETWORK_UNTRUSTED = 16;
1472
1473    // Wi-Fi 7 support for this network has been enabled or disabled.
1474    DISCONNECT_NETWORK_WIFI7_TOGGLED = 17;
1475
1476    // IP configuration is lost. Triggered by connectivity
1477    DISCONNECT_IP_CONFIGURATION_LOST = 18;
1478
1479    // IP reachability is lost. Triggered by connectivity
1480    DISCONNECT_IP_REACHABILITY_LOST = 19;
1481
1482    // No credentials
1483    DISCONNECT_NO_CREDENTIALS = 20;
1484  }
1485
1486  // Authentication Failure reasons as reported through the API.
1487  enum AuthFailureReason {
1488    // Unknown default
1489    AUTH_FAILURE_UNKNOWN = 0;
1490
1491    // The reason code if there is no error during authentication. It could also imply that there no
1492    // authentication in progress,
1493    AUTH_FAILURE_NONE = 1;
1494
1495    // The reason code if there was a timeout authenticating.
1496    AUTH_FAILURE_TIMEOUT = 2;
1497
1498    // The reason code if there was a wrong password while authenticating.
1499    AUTH_FAILURE_WRONG_PSWD = 3;
1500
1501    // The reason code if there was EAP failure while authenticating.
1502    AUTH_FAILURE_EAP_FAILURE = 4;
1503  }
1504
1505  // What event was this
1506  optional EventType type = 1;
1507
1508  // 80211 death reason code, relevant to NETWORK_DISCONNECTION_EVENTs
1509  optional int32 reason = 2 [default = -1];
1510
1511  // 80211 Association Status code, relevant to ASSOCIATION_REJECTION_EVENTs
1512  optional int32 status = 3 [default = -1];
1513
1514  // Designates whether a NETWORK_DISCONNECT_EVENT was by the STA or AP
1515  optional bool local_gen = 4 [default = false];
1516
1517  // Network information from the WifiConfiguration of a framework initiated connection attempt
1518  optional ConfigInfo config_info = 5;
1519
1520  // RSSI from the last rssi poll (Only valid for active connections)
1521  optional int32 last_rssi = 6 [default = -127];
1522
1523  // Link speed from the last rssi poll (Only valid for active connections)
1524  optional int32 last_link_speed = 7 [default = -1];
1525
1526  // Frequency from the last rssi poll (Only valid for active connections)
1527  optional int32 last_freq = 8 [default = -1];
1528
1529  // Enum used to define bit positions in the supplicant_state_change_bitmask
1530  // See {@code frameworks/base/wifi/java/android/net/wifi/SupplicantState.java} for documentation
1531  enum SupplicantState {
1532    STATE_DISCONNECTED = 0;
1533
1534    STATE_INTERFACE_DISABLED = 1;
1535
1536    STATE_INACTIVE = 2;
1537
1538    STATE_SCANNING = 3;
1539
1540    STATE_AUTHENTICATING = 4;
1541
1542    STATE_ASSOCIATING = 5;
1543
1544    STATE_ASSOCIATED = 6;
1545
1546    STATE_FOUR_WAY_HANDSHAKE = 7;
1547
1548    STATE_GROUP_HANDSHAKE = 8;
1549
1550    STATE_COMPLETED = 9;
1551
1552    STATE_DORMANT = 10;
1553
1554    STATE_UNINITIALIZED = 11;
1555
1556    STATE_INVALID = 12;
1557  }
1558
1559  // Bit mask of all supplicant state changes that occurred since the last event
1560  optional uint32 supplicant_state_changes_bitmask = 9 [default = 0];
1561
1562  // The number of milliseconds that have elapsed since the device booted
1563  optional int64 start_time_millis = 10 [default = 0];
1564
1565  optional FrameworkDisconnectReason framework_disconnect_reason = 11 [default = DISCONNECT_UNKNOWN];
1566
1567  // Flag which indicates if an association rejection event occurred due to a timeout
1568  optional bool association_timed_out = 12 [default = false];
1569
1570  // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code)
1571  optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN];
1572
1573  // NetworkAgent score of connected wifi
1574  optional int32 last_score = 14 [default = -1];
1575
1576  // NetworkAgent Wifi usability score of connected wifi
1577  optional int32 last_wifi_usability_score = 15 [default = -1];
1578
1579  // Prediction horizon (in second) of Wifi usability score provided by external
1580  // system app
1581  optional int32 last_prediction_horizon_sec = 16 [default = -1];
1582
1583  // Only valid if event type == TYPE_LINK_PROBE.
1584  // true if link probe succeeded, false otherwise.
1585  optional bool link_probe_was_success = 17;
1586
1587  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == true.
1588  // Elapsed time, in milliseconds, of a successful link probe.
1589  optional int32 link_probe_success_elapsed_time_ms = 18;
1590
1591  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == false.
1592  // Failure reason for an unsuccessful link probe.
1593  optional LinkProbeStats.LinkProbeFailureReason link_probe_failure_reason = 19;
1594
1595  // Number of bytes transmitted across mobile networks since device boot.
1596  optional int64 mobile_tx_bytes = 20 [default = -1];
1597
1598  // // Number of bytes received across mobile networks since device boot.
1599  optional int64 mobile_rx_bytes = 21 [default = -1];
1600
1601  // Number of bytes transmitted since device boot.
1602  optional int64 total_tx_bytes = 22 [default = -1];
1603
1604  // Number of bytes received since device boot.
1605  optional int64 total_rx_bytes = 23 [default = -1];
1606
1607  // Whether screen is on when the event happens
1608  optional bool screen_on = 24;
1609
1610  // Whether cellular data network is available
1611  optional bool is_cellular_data_available = 25;
1612
1613  // Whether Adaptive Connectivity is enabled
1614  optional bool is_adaptive_connectivity_enabled = 26;
1615
1616  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
1617  // StaEvent belongs to when multiple interfaces are active concurrently.
1618  optional string interface_name = 27;
1619
1620  // The role of the wireless interface
1621  // Gives more information on what purpose this interface is used for.
1622  optional ClientRole interface_role = 28;
1623}
1624
1625// Wi-Fi Aware metrics
1626message WifiAwareLog {
1627  // total number of unique apps that used Aware (measured on attach)
1628  optional int32 num_apps = 1;
1629
1630  // total number of unique apps that used an identity callback when attaching
1631  optional int32 num_apps_using_identity_callback = 2;
1632
1633  // maximum number of attaches for an app
1634  optional int32 max_concurrent_attach_sessions_in_app = 3;
1635
1636  // histogram of attach request results
1637  repeated NanStatusHistogramBucket histogram_attach_session_status = 4;
1638
1639  // maximum number of concurrent publish sessions in a single app
1640  optional int32 max_concurrent_publish_in_app = 5;
1641
1642  // maximum number of concurrent subscribe sessions in a single app
1643  optional int32 max_concurrent_subscribe_in_app = 6;
1644
1645  // maximum number of concurrent discovery (publish+subscribe) sessions in a single app
1646  optional int32 max_concurrent_discovery_sessions_in_app = 7;
1647
1648  // maximum number of concurrent publish sessions in the system
1649  optional int32 max_concurrent_publish_in_system = 8;
1650
1651  // maximum number of concurrent subscribe sessions in the system
1652  optional int32 max_concurrent_subscribe_in_system = 9;
1653
1654  // maximum number of concurrent discovery (publish+subscribe) sessions in the system
1655  optional int32 max_concurrent_discovery_sessions_in_system = 10;
1656
1657  // histogram of publish request results
1658  repeated NanStatusHistogramBucket histogram_publish_status = 11;
1659
1660  // histogram of subscribe request results
1661  repeated NanStatusHistogramBucket histogram_subscribe_status = 12;
1662
1663  // number of unique apps which experienced a discovery session creation failure due to lack of
1664  // resources
1665  optional int32 num_apps_with_discovery_session_failure_out_of_resources = 13;
1666
1667  // histogram of create ndp request results
1668  repeated NanStatusHistogramBucket histogram_request_ndp_status = 14;
1669
1670  // histogram of create ndp out-of-band (OOB) request results
1671  repeated NanStatusHistogramBucket histogram_request_ndp_oob_status = 15;
1672
1673  // maximum number of concurrent active data-interfaces (NDI) in a single app
1674  optional int32 max_concurrent_ndi_in_app = 19;
1675
1676  // maximum number of concurrent active data-interfaces (NDI) in the system
1677  optional int32 max_concurrent_ndi_in_system = 20;
1678
1679  // maximum number of concurrent data-paths (NDP) in a single app
1680  optional int32 max_concurrent_ndp_in_app = 21;
1681
1682  // maximum number of concurrent data-paths (NDP) in the system
1683  optional int32 max_concurrent_ndp_in_system = 22;
1684
1685  // maximum number of concurrent secure data-paths (NDP) in a single app
1686  optional int32 max_concurrent_secure_ndp_in_app = 23;
1687
1688  // maximum number of concurrent secure data-paths (NDP) in the system
1689  optional int32 max_concurrent_secure_ndp_in_system = 24;
1690
1691  // maximum number of concurrent data-paths (NDP) per data-interface (NDI)
1692  optional int32 max_concurrent_ndp_per_ndi = 25;
1693
1694  // histogram of durations of Aware being available
1695  repeated HistogramBucket histogram_aware_available_duration_ms = 26;
1696
1697  // histogram of durations of Aware being enabled
1698  repeated HistogramBucket histogram_aware_enabled_duration_ms = 27;
1699
1700  // histogram of duration (in ms) of attach sessions
1701  repeated HistogramBucket histogram_attach_duration_ms = 28;
1702
1703  // histogram of duration (in ms) of publish sessions
1704  repeated HistogramBucket histogram_publish_session_duration_ms = 29;
1705
1706  // histogram of duration (in ms) of subscribe sessions
1707  repeated HistogramBucket histogram_subscribe_session_duration_ms = 30;
1708
1709  // histogram of duration (in ms) of data-paths (NDP)
1710  repeated HistogramBucket histogram_ndp_session_duration_ms = 31;
1711
1712  // histogram of usage (in MB) of data-paths (NDP)
1713  repeated HistogramBucket histogram_ndp_session_data_usage_mb = 32;
1714
1715  // histogram of usage (in MB) of data-path creation time (in ms) measured as request -> confirm
1716  repeated HistogramBucket histogram_ndp_creation_time_ms = 33;
1717
1718  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: minimum
1719  optional int64 ndp_creation_time_ms_min = 34;
1720
1721  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: maximum
1722  optional int64 ndp_creation_time_ms_max = 35;
1723
1724  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum
1725  optional int64 ndp_creation_time_ms_sum = 36;
1726
1727  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum of sq
1728  optional int64 ndp_creation_time_ms_sum_of_sq = 37;
1729
1730  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: number of
1731  // samples
1732  optional int64 ndp_creation_time_ms_num_samples = 38;
1733
1734  // total time within the logging window that aware was available
1735  optional int64 available_time_ms = 39;
1736
1737  // total time within the logging window that aware was enabled
1738  optional int64 enabled_time_ms = 40;
1739
1740  // maximum number of concurrent publish sessions enabling ranging in a single app
1741  optional int32 max_concurrent_publish_with_ranging_in_app = 41;
1742
1743  // maximum number of concurrent subscribe sessions specifying a geofence in a single app
1744  optional int32 max_concurrent_subscribe_with_ranging_in_app = 42;
1745
1746  // maximum number of concurrent publish sessions enabling ranging in the system
1747  optional int32 max_concurrent_publish_with_ranging_in_system = 43;
1748
1749  // maximum number of concurrent subscribe sessions specifying a geofence in the system
1750  optional int32 max_concurrent_subscribe_with_ranging_in_system = 44;
1751
1752  // histogram of subscribe session geofence minimum (only when specified)
1753  repeated HistogramBucket histogram_subscribe_geofence_min = 45;
1754
1755  // histogram of subscribe session geofence maximum (only when specified)
1756  repeated HistogramBucket histogram_subscribe_geofence_max = 46;
1757
1758  // total number of subscribe sessions which enabled ranging
1759  optional int32 num_subscribes_with_ranging = 47;
1760
1761  // total number of matches (service discovery indication) with ranging provided
1762  optional int32 num_matches_with_ranging = 48;
1763
1764  // total number of matches (service discovery indication) for service discovery with ranging
1765  // enabled which did not trigger ranging
1766  optional int32 num_matches_without_ranging_for_ranging_enabled_subscribes = 49;
1767
1768  // Total number of different types of NDP requests
1769  repeated NdpRequestTypeHistogramBucket histogram_ndp_request_type = 50;
1770
1771  // Histogram bucket for Wi-Fi Aware logs. Range is [start, end)
1772  message HistogramBucket {
1773    // lower range of the bucket (inclusive)
1774    optional int64 start = 1;
1775
1776    // upper range of the bucket (exclusive)
1777    optional int64 end = 2;
1778
1779    // number of samples in the bucket
1780    optional int32 count = 3;
1781  }
1782
1783  // Status of various NAN operations
1784  enum NanStatusTypeEnum {
1785    // constant to be used by proto
1786    UNKNOWN = 0;
1787
1788    // NAN operation succeeded
1789    SUCCESS = 1;
1790
1791    // NAN Discovery Engine/Host driver failures
1792    INTERNAL_FAILURE = 2;
1793
1794    // NAN OTA failures
1795    PROTOCOL_FAILURE = 3;
1796
1797    // The publish/subscribe discovery session id is invalid
1798    INVALID_SESSION_ID = 4;
1799
1800    // Out of resources to fufill request
1801    NO_RESOURCES_AVAILABLE = 5;
1802
1803    // Invalid arguments passed
1804    INVALID_ARGS = 6;
1805
1806    // Invalid peer id
1807    INVALID_PEER_ID = 7;
1808
1809    // Invalid NAN data-path (ndp) id
1810    INVALID_NDP_ID = 8;
1811
1812    // Attempting to enable NAN when not available, e.g. wifi is disabled
1813    NAN_NOT_ALLOWED = 9;
1814
1815    // Over the air ACK not received
1816    NO_OTA_ACK = 10;
1817
1818    // Attempting to enable NAN when already enabled
1819    ALREADY_ENABLED = 11;
1820
1821    // Can't queue tx followup message foor transmission
1822    FOLLOWUP_TX_QUEUE_FULL = 12;
1823
1824    // Unsupported concurrency of NAN and another feature - NAN disabled
1825    UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 13;
1826
1827    // Unknown NanStatusType
1828    UNKNOWN_HAL_STATUS = 14;
1829  }
1830
1831  // Histogram bucket for Wi-Fi Aware (NAN) status.
1832  message NanStatusHistogramBucket {
1833    // status type defining the bucket
1834    optional NanStatusTypeEnum nan_status_type = 1;
1835
1836    // number of samples in the bucket
1837    optional int32 count = 2;
1838  }
1839
1840  enum NdpRequestTypeEnum {
1841    // Unknown Type
1842    NETWORK_SPECIFIER_TYPE_UNKNOWN = 0;
1843
1844    // TYPE: in band, specific peer: role, client_id, session_id, peer_id, pmk/passphrase optional
1845    NETWORK_SPECIFIER_TYPE_IB = 1;
1846
1847    // TYPE: in band, any peer: role, client_id, session_id, pmk/passphrase optional
1848    NETWORK_SPECIFIER_TYPE_IB_ANY_PEER = 2;
1849
1850    //TYPE: out-of-band: role, client_id, peer_mac, pmk/passphrase optional
1851    NETWORK_SPECIFIER_TYPE_OOB = 3;
1852
1853    //TYPE: out-of-band, any peer: role, client_id, pmk/passphrase optional
1854    NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER = 4;
1855
1856  }
1857
1858  message NdpRequestTypeHistogramBucket {
1859    // request type defining the bucket
1860    optional NdpRequestTypeEnum ndp_request_type = 1;
1861    // number of samples in the bucket
1862    optional int32 count = 2;
1863
1864  }
1865}
1866
1867// Data point used to build 'Number of Connectable Network' histograms
1868message NumConnectableNetworksBucket {
1869  // Number of connectable networks seen in a scan result
1870  optional int32 num_connectable_networks = 1 [default = 0];
1871
1872  // Number of scan results with num_connectable_networks
1873  optional int32 count = 2 [default = 0];
1874}
1875
1876// Pno scan metrics
1877// Here "Pno Scan" refers to the session of offloaded scans, these metrics count the result of a
1878// single session, and not the individual scans within that session.
1879message PnoScanMetrics {
1880  // Total number of attempts to offload pno scans
1881  optional int32 num_pno_scan_attempts = 1;
1882
1883  // Total number of pno scans failed
1884  optional int32 num_pno_scan_failed = 2;
1885
1886  // Number of pno scans started successfully over offload
1887  optional int32 num_pno_scan_started_over_offload = 3;
1888
1889  // Number of pno scans failed over offload
1890  optional int32 num_pno_scan_failed_over_offload = 4;
1891
1892  // Total number of pno scans that found any network
1893  optional int32 num_pno_found_network_events = 5;
1894}
1895
1896// Number of occurrences for a particular "Connect to Network" Notification or
1897// notification Action.
1898message ConnectToNetworkNotificationAndActionCount {
1899
1900  // "Connect to Network" notifications
1901  enum Notification {
1902
1903    // Default
1904    NOTIFICATION_UNKNOWN = 0;
1905
1906    // Initial notification with a recommended network.
1907    NOTIFICATION_RECOMMEND_NETWORK = 1;
1908
1909    // Notification when connecting to the recommended network.
1910    NOTIFICATION_CONNECTING_TO_NETWORK = 2;
1911
1912    // Notification when successfully connected to the network.
1913    NOTIFICATION_CONNECTED_TO_NETWORK = 3;
1914
1915    // Notification when failed to connect to network.
1916    NOTIFICATION_FAILED_TO_CONNECT = 4;
1917  }
1918
1919  // "Connect to Network" notification actions
1920  enum Action {
1921
1922    // Default
1923    ACTION_UNKNOWN = 0;
1924
1925    // User dismissed the "Connect to Network" notification.
1926    ACTION_USER_DISMISSED_NOTIFICATION = 1;
1927
1928    // User tapped action button to connect to recommended network.
1929    ACTION_CONNECT_TO_NETWORK = 2;
1930
1931    // User tapped action button to open Wi-Fi Settings.
1932    ACTION_PICK_WIFI_NETWORK = 3;
1933
1934    // User tapped "Failed to connect" notification to open Wi-Fi Settings.
1935    ACTION_PICK_WIFI_NETWORK_AFTER_CONNECT_FAILURE = 4;
1936  }
1937
1938  // Recommenders of the "Connect to Network" notification
1939  enum Recommender {
1940
1941    // Default.
1942    RECOMMENDER_UNKNOWN = 0;
1943
1944    // Open Network Available recommender.
1945    RECOMMENDER_OPEN = 1;
1946  }
1947
1948  // Notification Type.
1949  optional Notification notification = 1;
1950
1951  // Action Type.
1952  optional Action action = 2;
1953
1954  // Recommender Type.
1955  optional Recommender recommender = 3;
1956
1957  // Occurrences of this action.
1958  optional int32 count = 4;
1959}
1960
1961// SoftAP event tracking sessions and client counts
1962message SoftApConnectedClientsEvent {
1963
1964  // Soft AP event Types
1965  enum SoftApEventType {
1966
1967    // Soft AP in single AP mode is Up and ready for use.
1968    // The sequence of the events in single AP mode:
1969    // SOFT_AP_UP -> ... (ex:NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
1970    SOFT_AP_UP = 0;
1971
1972    // Soft AP in single/dual AP mode is Down.
1973    SOFT_AP_DOWN = 1;
1974
1975    // Number of connected soft AP clients has changed.
1976    NUM_CLIENTS_CHANGED = 2;
1977
1978    // Soft AP in dual AP mode is Up and ready for use.
1979    // There are two DUAL_AP_BOTH_INSTANCES_UP events in dual AP mode for
1980    // storing each instance information.
1981    // The sequence of the events in dual AP mode:
1982    // DUAL_AP_BOTH_INSTANCES_UP -> DUAL_AP_BOTH_INSTANCES_UP
1983    // ... (ex: DUAL_AP_ONE_INSTANCE_DOWN or NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
1984    DUAL_AP_BOTH_INSTANCES_UP = 3;
1985
1986    // One of the dual AP instance is Down.
1987    DUAL_AP_ONE_INSTANCE_DOWN = 4;
1988  }
1989
1990  // Soft AP channel bandwidth types
1991  enum ChannelBandwidth {
1992
1993    BANDWIDTH_INVALID = 0;
1994
1995    BANDWIDTH_20_NOHT = 1;
1996
1997    BANDWIDTH_20 = 2;
1998
1999    BANDWIDTH_40 = 3;
2000
2001    BANDWIDTH_80 = 4;
2002
2003    BANDWIDTH_80P80 = 5;
2004
2005    BANDWIDTH_160 = 6;
2006  }
2007
2008  // The operational mode  of the Soft AP.
2009  enum Generation {
2010
2011    WIFI_STANDARD_UNKNOWN = 0;
2012
2013    WIFI_STANDARD_LEGACY = 1;
2014
2015    WIFI_STANDARD_11N = 4;
2016
2017    WIFI_STANDARD_11AC = 5;
2018
2019    WIFI_STANDARD_11AX = 6;
2020  }
2021
2022  // Type of event being recorded
2023  optional SoftApEventType event_type = 1;
2024
2025  // Time passed since last boot in milliseconds
2026  optional int64 time_stamp_millis = 2;
2027
2028  // Number of connected clients if event_type is NUM_CLIENTS_CHANGED, otherwise zero.
2029  optional int32 num_connected_clients = 3;
2030
2031  // Channel frequency used for Soft AP
2032  optional int32 channel_frequency = 4;
2033
2034  // Channel bandwidth used for Soft AP
2035  optional ChannelBandwidth channel_bandwidth = 5;
2036
2037  // Maximum number of client setting in SoftApConfiguration
2038  optional int32 max_num_clients_setting_in_softap_configuration = 6;
2039
2040  // Maximum number of client setting in SoftApCapability
2041  optional int32 max_num_clients_setting_in_softap_capability = 7;
2042
2043  // Auto shutdown timeout setting in SoftApConfiguration
2044  optional int64 shutdown_timeout_setting_in_softap_configuration = 8;
2045
2046  // Framework default auto shutdown timeout setting
2047  optional int64 default_shutdown_timeout_setting = 9;
2048
2049  // Indicates if user enabled the client_control
2050  optional bool client_control_is_enabled = 10;
2051
2052  // The operational mode of the AP
2053  optional Generation generation = 11;
2054
2055  // Number of connected clients on current frequency if event_type is NUM_CLIENTS_CHANGED,
2056  // otherwise zero. On dual AP, it may be different from num_connected_clients
2057  // because there are two instances and num_connected_clients is used to record
2058  // total number of the clients. But num_connected_clients_on_current_frequency
2059  // is used to record the number of the clients on specific instance. (depends
2060  // on channel_frequency)
2061  optional int32 num_connected_clients_on_current_frequency = 12;
2062}
2063
2064// Power stats for Wifi
2065message WifiPowerStats {
2066
2067  // Duration of log (ms)
2068  optional int64 logging_duration_ms = 1;
2069
2070  // Energy consumed by wifi (mAh)
2071  optional double energy_consumed_mah = 2;
2072
2073  // Amount of time wifi is in idle (ms)
2074  optional int64 idle_time_ms = 3;
2075
2076  // Amount of time wifi is in rx (ms)
2077  optional int64 rx_time_ms = 4;
2078
2079  // Amount of time wifi is in tx (ms)
2080  optional int64 tx_time_ms = 5;
2081
2082  // Amount of time kernel is active because of wifi data (ms)
2083  optional int64 wifi_kernel_active_time_ms = 6;
2084
2085  // Number of packets sent (tx)
2086  optional int64 num_packets_tx = 7;
2087
2088  // Number of bytes sent (tx)
2089  optional int64 num_bytes_tx = 8;
2090
2091  // Number of packets received (rx)
2092  optional int64 num_packets_rx = 9;
2093
2094  // Number of bytes sent (rx)
2095  optional int64 num_bytes_rx = 10;
2096
2097  // Amount of time wifi is in sleep (ms)
2098  optional int64 sleep_time_ms = 11;
2099
2100  // Amount of time wifi is scanning (ms)
2101  optional int64 scan_time_ms = 12;
2102
2103  // Actual monitored rail energy consumed by wifi (mAh)
2104  optional double monitored_rail_energy_consumed_mah = 13;
2105}
2106
2107// Metrics for Wifi Wake
2108message WifiWakeStats {
2109  // An individual session for Wifi Wake
2110  message Session {
2111    // A Wifi Wake lifecycle event
2112    message Event {
2113      // Elapsed time in milliseconds since start of session.
2114      optional int64 elapsed_time_millis = 1;
2115
2116      // Number of scans that have occurred since start of session.
2117      optional int32 elapsed_scans = 2;
2118    }
2119
2120    // Start time of session in milliseconds.
2121    optional int64 start_time_millis = 1;
2122
2123    // The number of networks the lock was provided with at start.
2124    optional int32 locked_networks_at_start = 2;
2125
2126    // The number of networks in the lock at the time of the initialize event. Only valid if
2127    // initialize_event is recorded.
2128    optional int32 locked_networks_at_initialize = 6;
2129
2130    // Event for fully initializing the WakeupLock (i.e. WakeupLock is "locked").
2131    optional Event initialize_event = 7;
2132
2133    // Event for unlocking the WakeupLock. Does not occur if lock was initialized with 0 networks.
2134    optional Event unlock_event = 3;
2135
2136    // Event for triggering wakeup.
2137    optional Event wakeup_event = 4;
2138
2139    // Event for WifiWake reset event. This event marks the end of a session.
2140    optional Event reset_event = 5;
2141  }
2142
2143  // Total number of sessions for Wifi Wake.
2144  optional int32 num_sessions = 1;
2145
2146  // Session information for every Wifi Wake session (up to a maximum of 10).
2147  repeated Session sessions = 2;
2148
2149  // Number of ignored calls to start (due to WakeupController already being active).
2150  optional int32 num_ignored_starts = 3;
2151
2152  // Number of Wifi Wake sessions that have recorded wakeup events.
2153  optional int32 num_wakeups = 4;
2154}
2155
2156// Metrics for Wi-Fi RTT
2157message WifiRttLog {
2158  // Number of RTT request API calls
2159  optional int32 num_requests = 1;
2160
2161  // Histogram of RTT operation overall status
2162  repeated RttOverallStatusHistogramBucket histogram_overall_status = 2;
2163
2164  // RTT to Access Points metrics
2165  optional RttToPeerLog rtt_to_ap = 3;
2166
2167  // RTT to Wi-Fi Aware peers metrics
2168  optional RttToPeerLog rtt_to_aware = 4;
2169
2170  // Histogram of how long a measurement with only AP take.
2171  repeated HistogramBucket histogram_measurement_duration_ap_only = 5;
2172
2173  // Histogram of how long a measurement with aware peer included take.
2174  repeated HistogramBucket histogram_measurement_duration_with_aware = 6;
2175
2176  // Metrics for a RTT to Peer (peer = AP or Wi-Fi Aware)
2177  message RttToPeerLog {
2178    // Total number of API calls
2179    optional int32 num_requests = 1;
2180
2181    // Total number of individual requests
2182    optional int32 num_individual_requests = 2;
2183
2184    // Total number of apps which requested RTT
2185    optional int32 num_apps = 3;
2186
2187    // Histogram of total number of RTT requests by an app (WifiRttManager#startRanging)
2188    repeated HistogramBucket histogram_num_requests_per_app = 4;
2189
2190    // Histogram of number of peers in a single RTT request (RangingRequest entries)
2191    repeated HistogramBucket histogram_num_peers_per_request = 5;
2192
2193    // Histogram of status of individual RTT operations (RangingResult entries)
2194    repeated RttIndividualStatusHistogramBucket histogram_individual_status = 6;
2195
2196    // Histogram of measured distances (RangingResult entries)
2197    repeated HistogramBucket histogram_distance = 7;
2198
2199    // Histogram of interval of RTT requests by an app (WifiRttManager#startRanging)
2200    repeated HistogramBucket histogram_request_interval_ms = 8;
2201  }
2202
2203  // Histogram bucket for Wi-Fi RTT logs. Range is [start, end)
2204  message HistogramBucket {
2205    // lower range of the bucket (inclusive)
2206    optional int64 start = 1;
2207
2208    // upper range of the bucket (exclusive)
2209    optional int64 end = 2;
2210
2211    // number of samples in the bucket
2212    optional int32 count = 3;
2213  }
2214
2215  // Status codes for overall RTT operation
2216  enum RttOverallStatusTypeEnum {
2217    // constant to be used by proto
2218    OVERALL_UNKNOWN = 0;
2219
2220    // RTT operation succeeded (individual results may still fail)
2221    OVERALL_SUCCESS = 1;
2222
2223    // RTT operation failed (unspecified reason)
2224    OVERALL_FAIL = 2;
2225
2226    // RTT operation failed since RTT was not available (e.g. Airplane mode)
2227    OVERALL_RTT_NOT_AVAILABLE = 3;
2228
2229    // RTT operation timed-out: didn't receive response from HAL in expected time
2230    OVERALL_TIMEOUT = 4;
2231
2232    // RTT operation aborted since the app is spamming the service
2233    OVERALL_THROTTLE = 5;
2234
2235    // RTT request to HAL received immediate failure
2236    OVERALL_HAL_FAILURE = 6;
2237
2238    // RTT to Wi-Fi Aware peer using PeerHandle failed to get a MAC address translation
2239    OVERALL_AWARE_TRANSLATION_FAILURE = 7;
2240
2241    // RTT operation failed due to missing Location permission (post execution)
2242    OVERALL_LOCATION_PERMISSION_MISSING = 8;
2243  }
2244
2245  // Status codes for individual RTT operation
2246  enum RttIndividualStatusTypeEnum {
2247    // constant to be used by proto
2248    UNKNOWN = 0;
2249
2250    // RTT operation succeeded
2251    SUCCESS = 1;
2252
2253    // RTT failure: generic reason (no further information)
2254    FAILURE = 2;
2255
2256    // Target STA does not respond to request
2257    FAIL_NO_RSP = 3;
2258
2259    // Request rejected. Applies to 2-sided RTT only
2260    FAIL_REJECTED = 4;
2261
2262    // Operation not scheduled
2263    FAIL_NOT_SCHEDULED_YET = 5;
2264
2265    // Timing measurement times out
2266    FAIL_TM_TIMEOUT = 6;
2267
2268    // Target on different channel, cannot range
2269    FAIL_AP_ON_DIFF_CHANNEL = 7;
2270
2271    // Ranging not supported
2272    FAIL_NO_CAPABILITY = 8;
2273
2274    // Request aborted for unknown reason
2275    ABORTED = 9;
2276
2277    // Invalid T1-T4 timestamp
2278    FAIL_INVALID_TS = 10;
2279
2280    // 11mc protocol failed
2281    FAIL_PROTOCOL = 11;
2282
2283    // Request could not be scheduled
2284    FAIL_SCHEDULE = 12;
2285
2286    // Responder cannot collaborate at time of request
2287    FAIL_BUSY_TRY_LATER = 13;
2288
2289    // Bad request args
2290    INVALID_REQ = 14;
2291
2292    // WiFi not enabled
2293    NO_WIFI = 15;
2294
2295    // Responder overrides param info, cannot range with new params
2296    FAIL_FTM_PARAM_OVERRIDE = 16;
2297
2298    // HAL did not provide a result to a framework request
2299    MISSING_RESULT = 17;
2300  }
2301
2302  // Histogram bucket for Wi-Fi RTT overall operation status
2303  message RttOverallStatusHistogramBucket {
2304    // status type defining the bucket
2305    optional RttOverallStatusTypeEnum status_type = 1;
2306
2307    // number of samples in the bucket
2308    optional int32 count = 2;
2309  }
2310
2311  // Histogram bucket for Wi-Fi RTT individual operation status
2312  message RttIndividualStatusHistogramBucket {
2313    // status type defining the bucket
2314    optional RttIndividualStatusTypeEnum status_type = 1;
2315
2316    // number of samples in the bucket
2317    optional int32 count = 2;
2318  }
2319}
2320
2321// Usage data for the wifi radio while device is running on battery.
2322message WifiRadioUsage {
2323  // Duration of log (ms)
2324  optional int64 logging_duration_ms = 1;
2325
2326  // Total time for which the radio is awake due to scan.
2327  optional int64 scan_time_ms = 2;
2328}
2329
2330message ExperimentValues {
2331  reserved 1;
2332  reserved "wifi_is_unusable_logging_enabled";
2333
2334  // Minimum number of txBad to trigger a data stall
2335  optional int32 wifi_data_stall_min_tx_bad = 2;
2336
2337  // Minimum number of txSuccess to trigger a data stall
2338  // when rxSuccess is 0
2339  optional int32 wifi_data_stall_min_tx_success_without_rx = 3;
2340
2341  // Indicates if we are logging LinkSpeedCount in metrics
2342  optional bool link_speed_counts_logging_enabled = 4;
2343
2344  // Duration for evaluating Wifi condition to trigger a data stall
2345  // measured in milliseconds
2346  optional int32 data_stall_duration_ms = 5;
2347
2348  // Threshold of Tx throughput below which to trigger a data stall
2349  // measured in Kbps
2350  optional int32 data_stall_tx_tput_thr_kbps = 6;
2351
2352  // Threshold of Rx throughput below which to trigger a data stall
2353  // measured in Kbps
2354  optional int32 data_stall_rx_tput_thr_kbps = 7;
2355
2356  // Threshold of Tx packet error rate above which to trigger a data stall
2357  // in percentage
2358  optional int32 data_stall_tx_per_thr = 8;
2359
2360  // Threshold of CCA level above which to trigger a data stall in percentage
2361  optional int32 data_stall_cca_level_thr = 9;
2362
2363  // Health monitor RSSI poll valid time in ms
2364  optional int32 health_monitor_rssi_poll_valid_time_ms = 10;
2365}
2366
2367message BssidBlocklistStats {
2368  // Distributions of number of blocked BSSIDs filtered out from network selection.
2369  repeated Int32Count network_selection_filtered_bssid_count = 1;
2370
2371  // If this is enabled, then network connections in high movement state will be skipped unless
2372  // we find a candidate BSSID with similar RSSI in 2 scans sufficiently far apart.
2373  optional bool high_movement_multiple_scans_feature_enabled = 2;
2374
2375  // Number of times connection is skipped in the high movement state
2376  // only relevant if high_movement_multiple_scans_feature_enabled=true
2377  optional int32 num_high_movement_connection_skipped = 3;
2378
2379  // Number of times connection is initiated in the high movement state
2380  // only relevant if high_movement_multiple_scans_feature_enabled=true
2381  optional int32 num_high_movement_connection_started = 4;
2382
2383  // Histogram corresponding to the number of times BSSIDs are blocked per
2384  // WifiBlocklistMonitor.FailureReason.
2385  repeated Int32Count bssid_blocklist_per_reason_count = 5;
2386
2387  // Histogram corresponding to the number of times WifiConfigurations are blocked per
2388  // WifiConfiguration.NetworkSelectionStatus.NetworkSelectionDisableReason.
2389  repeated Int32Count wifi_config_blocklist_per_reason_count = 6;
2390}
2391
2392message WifiIsUnusableEvent {
2393  enum TriggerType {
2394    // Default/Invalid event
2395    TYPE_UNKNOWN = 0;
2396
2397    // There is a data stall from tx failures
2398    TYPE_DATA_STALL_BAD_TX = 1;
2399
2400    // There is a data stall from rx failures
2401    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;
2402
2403    // There is a data stall from both tx and rx failures
2404    TYPE_DATA_STALL_BOTH = 3;
2405
2406    // Firmware generated an alert
2407    TYPE_FIRMWARE_ALERT = 4;
2408
2409    // IP Manager lost reachability to network neighbors
2410    TYPE_IP_REACHABILITY_LOST = 5;
2411  }
2412
2413  // What event triggered WifiIsUnusableEvent.
2414  optional TriggerType type = 1;
2415
2416  // The timestamp at which this event occurred.
2417  // Measured in milliseconds that have elapsed since the device booted.
2418  optional int64 start_time_millis = 2;
2419
2420  // NetworkAgent score of connected wifi.
2421  // Defaults to -1 if the score was never set.
2422  optional int32 last_score = 3 [default = -1];
2423
2424  // Delta of successfully transmitted (ACKed) unicast data packets
2425  // between the last two WifiLinkLayerStats.
2426  optional int64 tx_success_delta = 4;
2427
2428  // Delta of transmitted unicast data retry packets
2429  // between the last two WifiLinkLayerStats.
2430  optional int64 tx_retries_delta = 5;
2431
2432  // Delta of lost (not ACKed) transmitted unicast data packets
2433  // between the last two WifiLinkLayerStats.
2434  optional int64 tx_bad_delta = 6;
2435
2436  // Delta of received unicast data packets
2437  // between the last two WifiLinkLayerStats.
2438  optional int64 rx_success_delta = 7;
2439
2440  // Time in millisecond between the last two WifiLinkLayerStats.
2441  optional int64 packet_update_time_delta = 8;
2442
2443  // The timestamp at which the last WifiLinkLayerStats was updated.
2444  // Measured in milliseconds that have elapsed since the device booted.
2445  optional int64 last_link_layer_stats_update_time = 9;
2446
2447  // Firmware alert code. Only valid when the event was triggered by a firmware alert, otherwise -1.
2448  optional int32 firmware_alert_code = 10 [default = -1];
2449
2450  // NetworkAgent wifi usability score of connected wifi.
2451  // Defaults to -1 if the score was never set.
2452  optional int32 last_wifi_usability_score = 11 [default = -1];
2453
2454  // Prediction horizon (in second) of Wifi usability score provided by external
2455  // system app
2456  optional int32 last_prediction_horizon_sec = 12 [default = -1];
2457
2458  // Whether screen status is on when WifiIsUnusableEvent happens.
2459  optional bool screen_on = 13 [default = false];
2460
2461  // Number of bytes transmitted across mobile networks since device boot.
2462  optional int64 mobile_tx_bytes = 14 [default = -1];
2463
2464  // // Number of bytes received across mobile networks since device boot.
2465  optional int64 mobile_rx_bytes = 15 [default = -1];
2466
2467  // Number of bytes transmitted since device boot.
2468  optional int64 total_tx_bytes = 16 [default = -1];
2469
2470  // Number of bytes received since device boot.
2471  optional int64 total_rx_bytes = 17 [default = -1];
2472}
2473
2474message PasspointProfileTypeCount {
2475  enum EapMethod {
2476    // Unknown Type
2477    TYPE_UNKNOWN = 0;
2478
2479    // EAP_TLS (13)
2480    TYPE_EAP_TLS = 1;
2481
2482    // EAP_TTLS (21)
2483    TYPE_EAP_TTLS = 2;
2484
2485    // EAP_SIM (18)
2486    TYPE_EAP_SIM = 3;
2487
2488    // EAP_AKA (23)
2489    TYPE_EAP_AKA = 4;
2490
2491    // EAP_AKA_PRIME (50)
2492    TYPE_EAP_AKA_PRIME = 5;
2493  }
2494
2495  // Eap method type set in Passpoint profile
2496  optional EapMethod eap_method_type = 1;
2497
2498  // Num of installed Passpoint profile with same eap method
2499  optional int32 count = 2;
2500}
2501
2502message WifiLinkLayerUsageStats {
2503  // Total logging duration in ms.
2504  optional int64 logging_duration_ms = 1;
2505
2506  // Total time the wifi radio is on in ms over the logging duration.
2507  optional int64 radio_on_time_ms = 2;
2508
2509  // Total time the wifi radio is doing tx in ms over the logging duration.
2510  optional int64 radio_tx_time_ms = 3;
2511
2512  // Total time the wifi radio is doing rx in ms over the logging duration.
2513  optional int64 radio_rx_time_ms = 4;
2514
2515  // Total time the wifi radio is scanning in ms over the logging duration.
2516  optional int64 radio_scan_time_ms = 5;
2517
2518  // Total time the wifi radio spent doing nan scans in ms over the logging duration.
2519  optional int64 radio_nan_scan_time_ms = 6;
2520
2521  // Total time the wifi radio spent doing background scans in ms over the logging duration.
2522  optional int64 radio_background_scan_time_ms = 7;
2523
2524  // Total time the wifi radio spent doing roam scans in ms over the logging duration.
2525  optional int64 radio_roam_scan_time_ms = 8;
2526
2527  // Total time the wifi radio spent doing pno scans in ms over the logging duration.
2528  optional int64 radio_pno_scan_time_ms = 9;
2529
2530  // Total time the wifi radio spent doing hotspot 2.0 scans and GAS exchange
2531  // in ms over the logging duration.
2532  optional int64 radio_hs20_scan_time_ms = 10;
2533
2534  // Radio stats from all the radios
2535  repeated RadioStats radio_stats = 11;
2536}
2537
2538message WifiUsabilityStatsEntry {
2539  // Status codes for link probe status
2540  enum LinkProbeStatus {
2541    // Link probe status is unknown
2542    PROBE_STATUS_UNKNOWN = 0;
2543
2544    // Link probe is not triggered
2545    PROBE_STATUS_NO_PROBE = 1;
2546
2547    // Link probe is triggered and the result is success
2548    PROBE_STATUS_SUCCESS = 2;
2549
2550    // Link probe is triggered and the result is failure
2551    PROBE_STATUS_FAILURE = 3;
2552  }
2553
2554  // Codes for cellular data network type
2555  enum CellularDataNetworkType {
2556    // Unknown network
2557    NETWORK_TYPE_UNKNOWN = 0;
2558
2559    // GSM network
2560    NETWORK_TYPE_GSM = 1;
2561
2562    // CDMA network
2563    NETWORK_TYPE_CDMA = 2;
2564
2565    // CDMA EVDO network
2566    NETWORK_TYPE_EVDO_0 = 3;
2567
2568    // WCDMA network
2569    NETWORK_TYPE_UMTS = 4;
2570
2571    // TDSCDMA network
2572    NETWORK_TYPE_TD_SCDMA = 5;
2573
2574    // LTE network
2575    NETWORK_TYPE_LTE = 6;
2576
2577    // NR network
2578    NETWORK_TYPE_NR = 7;
2579  }
2580
2581  enum CaptureEventType {
2582    // Unknown event
2583    CAPTURE_EVENT_TYPE_UNKNOWN = 0;
2584
2585    // This is a synchronous event
2586    CAPTURE_EVENT_TYPE_SYNCHRONOUS = 1;
2587
2588    // RSSI polling turned on
2589    CAPTURE_EVENT_TYPE_RSSI_POLLING_ENABLED = 2;
2590
2591    // RSSI polling turned off
2592    CAPTURE_EVENT_TYPE_RSSI_POLLING_DISABLED = 3;
2593
2594    // Data sample came from CMD_ONESHOT_RSSI_POLL
2595    CAPTURE_EVENT_TYPE_ONESHOT_RSSI_POLL = 4;
2596
2597    // IP reachability lost
2598    CAPTURE_EVENT_TYPE_IP_REACHABILITY_LOST = 5;
2599
2600    // IP reachability failure
2601    CAPTURE_EVENT_TYPE_IP_REACHABILITY_FAILURE = 6;
2602
2603    // Firmware alert
2604    CAPTURE_EVENT_TYPE_FIRMWARE_ALERT = 7;
2605  }
2606
2607  // Absolute milliseconds from device boot when these stats were sampled
2608  optional int64 time_stamp_ms = 1;
2609
2610  // The RSSI at the sample time
2611  optional int32 rssi = 2;
2612
2613  // Link speed at the sample time in Mbps
2614  optional int32 link_speed_mbps = 3;
2615
2616  // The total number of tx success counted from the last radio chip reset
2617  optional int64 total_tx_success = 4;
2618
2619  // The total number of MPDU data packet retries counted from the last radio chip reset
2620  optional int64 total_tx_retries = 5;
2621
2622  // The total number of tx bad counted from the last radio chip reset
2623  optional int64 total_tx_bad = 6;
2624
2625  // The total number of rx success counted from the last radio chip reset
2626  optional int64 total_rx_success = 7;
2627
2628  // The total time the wifi radio is on in ms counted from the last radio chip reset
2629  optional int64 total_radio_on_time_ms = 8;
2630
2631  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
2632  optional int64 total_radio_tx_time_ms = 9;
2633
2634  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
2635  optional int64 total_radio_rx_time_ms = 10;
2636
2637  // The total time spent on all types of scans in ms counted from the last radio chip reset
2638  optional int64 total_scan_time_ms = 11;
2639
2640  // The total time spent on nan scans in ms counted from the last radio chip reset
2641  optional int64 total_nan_scan_time_ms = 12;
2642
2643  // The total time spent on background scans in ms counted from the last radio chip reset
2644  optional int64 total_background_scan_time_ms = 13;
2645
2646  // The total time spent on roam scans in ms counted from the last radio chip reset
2647  optional int64 total_roam_scan_time_ms = 14;
2648
2649  // The total time spent on pno scans in ms counted from the last radio chip reset
2650  optional int64 total_pno_scan_time_ms = 15;
2651
2652  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
2653  // chip reset
2654  optional int64 total_hotspot_2_scan_time_ms = 16;
2655
2656  // Internal framework Wifi score
2657  optional int32 wifi_score = 17;
2658
2659  // Wifi usability score provided by external system app
2660  optional int32 wifi_usability_score = 18;
2661
2662  // Sequence number from external system app to framework
2663  optional int32 seq_num_to_framework = 19;
2664
2665  // The total time CCA is on busy status on the current frequency in ms
2666  // counted from the last radio chip reset
2667  optional int64 total_cca_busy_freq_time_ms = 20;
2668
2669  // The total radio on time of the current frequency from the last radio
2670  // chip reset
2671  optional int64 total_radio_on_freq_time_ms = 21;
2672
2673  // The total number of beacons received from the last radio chip reset
2674  optional int64 total_beacon_rx = 22;
2675
2676  // Prediction horizon (in second) of Wifi usability score provided by external
2677  // system app
2678  optional int32 prediction_horizon_sec = 23;
2679
2680  // The link probe status since last stats update
2681  optional LinkProbeStatus probe_status_since_last_update = 24;
2682
2683  // The elapsed time of the most recent link probe since last stats update;
2684  optional int32 probe_elapsed_time_since_last_update_ms = 25;
2685
2686  // The MCS rate of the most recent link probe since last stats update
2687  optional int32 probe_mcs_rate_since_last_update = 26;
2688
2689  // Rx link speed at the sample time in Mbps
2690  optional int32 rx_link_speed_mbps = 27;
2691
2692  // Sequence number generated by framework
2693  optional int32 seq_num_inside_framework = 28;
2694
2695  // Whether current entry is for the same BSSID on the same frequency compared
2696  // to last entry
2697  optional bool is_same_bssid_and_freq = 29;
2698
2699  // Cellular data network type currently in use on the device for data transmission
2700  optional CellularDataNetworkType cellular_data_network_type = 30;
2701
2702  // Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
2703  // CDMA: Rssi, EVDO: Rssi, GSM: Rssi
2704  optional int32 cellular_signal_strength_dbm = 31;
2705
2706  // Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
2707  // CDMA: Ecio, EVDO: SNR, GSM: invalid */
2708  optional int32 cellular_signal_strength_db = 32;
2709
2710  // Whether the primary registered cell of current entry is same as that of previous entry
2711  optional bool is_same_registered_cell = 33;
2712
2713  // The device mobility state
2714  optional DeviceMobilityStatePnoScanStats.DeviceMobilityState
2715          device_mobility_state = 34;
2716
2717  // Duty cycle of the connection.
2718  // if this connection is being served using time slicing on a radio with one or more interfaces
2719  // (i.e MCC), then this field contains the duty cycle assigned to this interface in percent.
2720  // If no concurrency or not using time slicing during concurrency (i.e SCC or DBS), set to 100.
2721  optional int32 time_slice_duty_cycle_in_percent = 35;
2722
2723  // WME data packet contention time statistics for all four categories: BE, BK, VI, VO
2724  repeated ContentionTimeStats contention_time_stats = 36;
2725
2726  // The channel utilization ratio (value) in the range of
2727  // [BssLoad.MIN_CHANNEL_UTILIZATION, BssLoad.MAX_CHANNEL_UTILIZATION], where MIN_CHANNEL_UTILIZATION
2728  // corresponds to ratio 0%, MAX_CHANNEL_UTILIZATION corresponds to ratio 100%,
2729  // see {@link com.android.server.wifi.util.InformationElementUtil}
2730  optional int32 channel_utilization_ratio = 37;
2731
2732  // Indicate whether current link layer throughput is sufficient, see {@link WifiDataStall#isThroughputSufficient()}.
2733  optional bool is_throughput_sufficient = 38;
2734
2735  // Indicate whether Wi-Fi scoring is enabled by the user, see {@link WifiManager#setWifiScoringEnabled(boolean)}.
2736  optional bool is_wifi_scoring_enabled = 39;
2737
2738  // Indicate whether Cellular data is available, see {@link WifiDataStall#isCellularDataAvailable()}.
2739  optional bool is_cellular_data_available = 40;
2740
2741  // Rate statistics, including number of successful packets, retries, etc.,
2742  // indexed by preamble, bandwidth, number of spatial streams, MCS.
2743  repeated RateStats rate_stats = 41;
2744
2745  // Number of stations associated with current AP.
2746  optional int32 sta_count = 42;
2747
2748  // Channel utilization at current AP in the range of [0, 255].
2749  optional int32 channel_utilization = 43;
2750
2751  // Link layer radio stats for all the radios
2752  repeated RadioStats radio_stats = 44;
2753
2754  // Number of WiFi links.
2755  optional int32 wifi_link_count = 45;
2756
2757  // Link layer radio stats for all WiFi links
2758  repeated LinkStats link_stats = 46;
2759
2760  // The MLO mode
2761  // See details in @WifiManager.MloMode
2762  optional int32 mlo_mode = 47;
2763
2764  // The number of tx bytes transmitted on current interface
2765  optional int64 tx_transmitted_bytes = 48;
2766
2767  // The number of rx bytes transmitted on current interface
2768  optional int64 rx_transmitted_bytes = 49;
2769
2770  // The total number of LABEL_BAD event happens
2771  optional int32 label_bad_event_count = 50;
2772
2773  // Current WiFi state in framework
2774  optional int32 wifi_framework_state = 51;
2775
2776  // Downstream throughput estimation provided by Network Capabilities
2777  optional int32 is_network_capabilities_downstream_sufficient = 52;
2778
2779  // Upstream throughput estimation provided by Network Capabilities
2780  optional int32 is_network_capabilities_upstream_sufficient = 53;
2781
2782  // Downstream throughput estimation used in Network Selection
2783  optional int32 is_throughput_predictor_downstream_sufficient = 54;
2784
2785  // Upstream throughput estimation provided by Network Capabilities
2786  optional int32 is_throughput_predictor_upstream_sufficient = 55;
2787
2788  // If bluetooth is connected
2789  optional bool is_bluetooth_connected = 56;
2790
2791  // State of UWB adapter. Refers to
2792  // UwbManager#registerAdapterStateCallback(Executor, AdapterStateCallback)
2793  optional int32 uwb_adapter_state = 57;
2794
2795  // Wifi Low Latency mode state
2796  optional bool is_low_latency_activated = 58;
2797
2798  // Maximum supported tx link speed in Mbps
2799  optional int32 max_supported_tx_linkspeed = 59;
2800
2801  // Maximum supported rx link speed in Mbps
2802  optional int32 max_supported_rx_linkspeed = 60;
2803
2804  // Wifi Voip mode state
2805  optional int32 voip_mode = 61;
2806
2807  // Device Role of thread. Refers to ThreadNetworkController@DeviceRole
2808  optional int32 thread_device_role = 62;
2809
2810  // Capture buffer event type
2811  optional CaptureEventType capture_event_type = 63;
2812
2813  // Some capture event types (eg. ip reachability lost) have a code associated
2814  // with them. This code is stored here.
2815  optional int32 capture_event_type_subcode = 64;
2816
2817  optional int32 status_data_stall = 65;
2818}
2819
2820message ContentionTimeStats {
2821  enum AccessCategory {
2822    // WME Best Effort Access Category
2823    WME_ACCESS_CATEGORY_BE = 0;
2824
2825    // WME Background Access Category
2826    WME_ACCESS_CATEGORY_BK = 1;
2827
2828    // WME Video Access Category
2829    WME_ACCESS_CATEGORY_VI = 2;
2830
2831    // WME Voice Access Category
2832    WME_ACCESS_CATEGORY_VO = 3;
2833  }
2834
2835  // WME access category
2836  optional AccessCategory access_category = 1;
2837
2838  // Data packet min contention time in microseconds
2839  optional int64 contention_time_min_micros = 2;
2840
2841  // Data packet max contention time in microseconds
2842  optional int64 contention_time_max_micros = 3;
2843
2844  // Data packet average contention time in microseconds
2845  optional int64 contention_time_avg_micros = 4;
2846
2847  // Number of data packets used for contention statistics
2848  optional int64 contention_num_samples = 5;
2849}
2850
2851message PacketStats {
2852  enum AccessCategory {
2853    // WME Best Effort Access Category
2854    WME_ACCESS_CATEGORY_BE = 0;
2855
2856    // WME Background Access Category
2857    WME_ACCESS_CATEGORY_BK = 1;
2858
2859    // WME Video Access Category
2860    WME_ACCESS_CATEGORY_VI = 2;
2861
2862    // WME Voice Access Category
2863    WME_ACCESS_CATEGORY_VO = 3;
2864  }
2865
2866  // WME access category
2867  optional AccessCategory access_category = 1;
2868
2869  // The number of tx success counted from the last radio chip reset
2870  optional int64 tx_success = 2;
2871
2872  // The number of MPDU data packet retries counted from the last radio chip reset
2873  optional int64 tx_retries = 3;
2874
2875  // The number of tx bad counted from the last radio chip reset
2876  optional int64 tx_bad = 4;
2877
2878  // The number of rx success counted from the last radio chip reset
2879  optional int64 rx_success = 5;
2880}
2881
2882message RateStats {
2883  enum WifiPreambleType {
2884    // Preamble type for IEEE 802.11a/g, IEEE Std 802.11-2020, Section 17
2885    WIFI_PREAMBLE_OFDM = 0;
2886    // Preamble type for IEEE 802.11b, IEEE Std 802.11-2020, Section 16
2887    WIFI_PREAMBLE_CCK = 1;
2888    // Preamble type for IEEE 802.11n, IEEE Std 802.11-2020, Section 19
2889    WIFI_PREAMBLE_HT = 2;
2890    // Preamble type for IEEE 802.11ac, IEEE Std 802.11-2020, Section 21
2891    WIFI_PREAMBLE_VHT = 3;
2892    // Preamble type for IEEE 802.11ax, IEEE Std 802.11-2020, Section 27
2893    WIFI_PREAMBLE_HE = 5;
2894    // Invalid
2895    WIFI_PREAMBLE_INVALID = -1;
2896  }
2897
2898  enum WifiSpatialStreams {
2899    // Single stream, 1x1
2900    WIFI_SPATIAL_STREAMS_ONE = 0;
2901    // Dual streams, 2x2
2902    WIFI_SPATIAL_STREAMS_TWO = 1;
2903    // Three streams, 3x3
2904    WIFI_SPATIAL_STREAMS_THREE = 2;
2905    // Four streams, 4x4
2906    WIFI_SPATIAL_STREAMS_FOUR = 3;
2907    // Invalid
2908    WIFI_SPATIAL_STREAMS_INVALID = -1;
2909  }
2910
2911  enum WifiChannelBandwidth {
2912    // Channel bandwidth: 20MHz
2913    WIFI_BANDWIDTH_20_MHZ = 0;
2914    // Channel bandwidth: 40MHz
2915    WIFI_BANDWIDTH_40_MHZ = 1;
2916    // Channel bandwidth: 80MHz
2917    WIFI_BANDWIDTH_80_MHZ = 2;
2918    // Channel bandwidth: 160MHz
2919    WIFI_BANDWIDTH_160_MHZ = 3;
2920    // Channel bandwidth: 80MHz + 80MHz
2921    WIFI_BANDWIDTH_80P80_MHZ = 4;
2922    // Channel bandwidth: 5MHz
2923    WIFI_BANDWIDTH_5_MHZ = 5;
2924    // Channel bandwidth: 10MHz
2925    WIFI_BANDWIDTH_10_MHZ = 6;
2926    // Channel bandwidth: 320MHz
2927    WIFI_BANDWIDTH_320_MHZ = 7;
2928    // Invalid channel bandwidth
2929    WIFI_BANDWIDTH_INVALID = -1;
2930  }
2931
2932  // Preamble information.
2933  optional WifiPreambleType preamble = 1;
2934
2935  // Number of spatial streams.
2936  optional WifiSpatialStreams nss = 2;
2937
2938  // Bandwidth information.
2939  optional WifiChannelBandwidth bw = 3;
2940
2941  // MCS index. OFDM/CCK rate code would be as per IEEE std in the units of 0.5Mbps.
2942  // HT/VHT/HE: it would be MCS index.
2943  optional int32 rate_mcs_idx = 4;
2944
2945  // Bitrate in units of 100 Kbps.
2946  optional int32 bit_rate_in_kbps = 5;
2947
2948  // Number of successfully transmitted data packets (ACK received).
2949  optional int32 tx_mpdu = 6;
2950
2951  // Number of received data packets.
2952  optional int32 rx_mpdu = 7;
2953
2954  // Number of data packet losses (no ACK).
2955  optional int32 mpdu_lost = 8;
2956
2957  // Number of data packet retries.
2958  optional int32 retries = 9;
2959}
2960
2961message RadioStats {
2962  // The Radio ID
2963  optional int32 radio_id = 1;
2964  // The total time the wifi radio is on in ms counted from the last radio chip reset
2965  optional int64 total_radio_on_time_ms = 2;
2966
2967  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
2968  optional int64 total_radio_tx_time_ms = 3;
2969
2970  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
2971  optional int64 total_radio_rx_time_ms = 4;
2972
2973  // The total time spent on all types of scans in ms counted from the last radio chip reset
2974  optional int64 total_scan_time_ms = 5;
2975
2976  // The total time spent on nan scans in ms counted from the last radio chip reset
2977  optional int64 total_nan_scan_time_ms = 6;
2978
2979  // The total time spent on background scans in ms counted from the last radio chip reset
2980  optional int64 total_background_scan_time_ms = 7;
2981
2982  // The total time spent on roam scans in ms counted from the last radio chip reset
2983  optional int64 total_roam_scan_time_ms = 8;
2984
2985  // The total time spent on pno scans in ms counted from the last radio chip reset
2986  optional int64 total_pno_scan_time_ms = 9;
2987
2988  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
2989  // chip reset
2990  optional int64 total_hotspot_2_scan_time_ms = 10;
2991
2992  // Time for which the radio is in active tranmission per tx level
2993  repeated int32 tx_time_ms_per_level = 11;
2994}
2995
2996message LinkStats {
2997  enum LinkState {
2998    // Chip does not support reporting the state of the link
2999    LINK_STATE_UNKNOWN = 0;
3000
3001    // Link has not been in use since last report. It is placed in power save
3002    LINK_STATE_NOT_IN_USE = 1;
3003
3004    // Link is in use. In presence of traffic, it is set to be power active.
3005    LINK_STATE_IN_USE = 2;
3006  }
3007
3008  enum WifiChannelBandwidth {
3009    // Channel bandwidth: 20MHz
3010    WIFI_BANDWIDTH_20_MHZ = 0;
3011    // Channel bandwidth: 40MHz
3012    WIFI_BANDWIDTH_40_MHZ = 1;
3013    // Channel bandwidth: 80MHz
3014    WIFI_BANDWIDTH_80_MHZ = 2;
3015    // Channel bandwidth: 160MHz
3016    WIFI_BANDWIDTH_160_MHZ = 3;
3017    // Channel bandwidth: 80MHz + 80MHz
3018    WIFI_BANDWIDTH_80P80_MHZ = 4;
3019    // Channel bandwidth: 5MHz
3020    WIFI_BANDWIDTH_5_MHZ = 5;
3021    // Channel bandwidth: 10MHz
3022    WIFI_BANDWIDTH_10_MHZ = 6;
3023    // Channel bandwidth: 320MHz
3024    WIFI_BANDWIDTH_320_MHZ = 7;
3025    // Invalid channel bandwidth
3026    WIFI_BANDWIDTH_INVALID = -1;
3027  }
3028
3029  // The Link ID
3030  optional int32 link_id = 1;
3031
3032  // Link state
3033  optional LinkState state = 2;
3034
3035  // Identifier of the radio on which link is currently operating
3036  optional int32 radio_id = 3;
3037
3038  // Frequency of the link in MHz
3039  optional int32 frequency_mhz = 4;
3040
3041  // Number of beacons received from our own AP
3042  optional int32 beacon_rx = 5;
3043
3044  // RSSI of management frames
3045  optional int32 rssi_mgmt = 6;
3046
3047  // Duty cycle of the link.
3048  optional int32 time_slice_duty_cycle_in_percent = 7;
3049
3050  // Overall RSSI from wpa_supplicant signal_poll
3051  optional int32 rssi = 8;
3052
3053  // channel width of WiFi link.
3054  optional WifiChannelBandwidth channel_width = 9;
3055
3056  // Center frequency (MHz) of first segment.
3057  optional int32 center_freq_first_seg = 10;
3058
3059  // Center frequency (MHz) of second segment.
3060  optional int32 center_freq_second_seg = 11;
3061
3062  // Total time for which the radio is awake on this channel.
3063  optional int64 on_time_in_ms = 12;
3064
3065  // Total time for which CCA is held busy on this channel.
3066  optional int64 cca_busy_time_in_ms = 13;
3067
3068  // WME data packet contention time statistics for all four categories: BE, BK, VI, VO
3069  repeated ContentionTimeStats contention_time_stats = 14;
3070
3071  // Packet statistics for all four categories: BE, BK, VI, VO
3072  repeated PacketStats packet_stats = 15;
3073
3074  // Peer statistics on this WiFi link
3075  repeated PeerInfo peer_info = 16;
3076
3077  // List of scan results who have the same freq with current WiFi link
3078  repeated ScanResultWithSameFreq scan_result_with_same_freq = 17;
3079
3080  // TX linkspeed in this WiFi link
3081  optional int32 tx_linkspeed = 18;
3082
3083  // RX linkspeed in this WiFi link
3084  optional int32 rx_linkspeed = 19;
3085}
3086
3087message PeerInfo {
3088  // Station count.
3089  optional int32 sta_count = 1;
3090
3091  // Channel utilization.
3092  optional int32 chan_util = 2;
3093
3094  // Rate statistics, including number of successful packets, retries, etc.,
3095  // indexed by preamble, bandwidth, number of spatial streams, MCS.
3096  repeated RateStats rate_stats = 3;
3097}
3098
3099message ScanResultWithSameFreq {
3100  // timestamp in microseconds (since boot) when this result was last seen.
3101  optional int64 scan_result_timestamp_micros = 1;
3102
3103  // The detected signal level in dBm
3104  optional int32 rssi = 2;
3105
3106  // The center frequency of the primary 20 MHz frequency (in MHz) of the channel
3107  optional int32 frequencyMhz = 3;
3108}
3109
3110message WifiUsabilityStats {
3111  enum Label {
3112    // Default label
3113    LABEL_UNKNOWN = 0;
3114
3115    // Wifi is usable
3116    LABEL_GOOD = 1;
3117
3118    // Wifi is unusable
3119    LABEL_BAD = 2;
3120  }
3121
3122  enum UsabilityStatsTriggerType {
3123    // Default/Invalid event
3124    TYPE_UNKNOWN = 0;
3125
3126    // There is a data stall from tx failures
3127    TYPE_DATA_STALL_BAD_TX = 1;
3128
3129    // There is a data stall from rx failures
3130    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;
3131
3132    // There is a data stall from both tx and rx failures
3133    TYPE_DATA_STALL_BOTH = 3;
3134
3135    // Firmware generated an alert
3136    TYPE_FIRMWARE_ALERT = 4;
3137
3138    // IP Manager lost reachability to network neighbors
3139    TYPE_IP_REACHABILITY_LOST = 5;
3140  }
3141
3142  // The current wifi usability state
3143  optional Label label = 1;
3144
3145  // The list of timestamped wifi usability stats
3146  repeated WifiUsabilityStatsEntry stats = 2;
3147
3148  // What event triggered WifiUsabilityStats.
3149  optional UsabilityStatsTriggerType trigger_type = 3;
3150
3151  // Firmware alert code. Only valid when the stats was triggered by a firmware
3152  // alert, otherwise -1.
3153  optional int32 firmware_alert_code = 4 [default = -1];
3154
3155  // Absolute milliseconds from device boot when these stats were sampled
3156  optional int64 time_stamp_ms = 5;
3157}
3158
3159message TrainingData {
3160  // The list of timestamped wifi usability stats
3161  repeated WifiUsabilityStatsEntry stats = 1;
3162}
3163
3164message WifiUsabilityStatsTraining {
3165  // Data capture type
3166  optional int32 data_capture_type = 1;
3167
3168  // Capture period start timestamp floored to the nearest hour.
3169  optional int64 capture_start_timestamp_secs = 2;
3170
3171  optional TrainingData training_data = 3;
3172}
3173
3174message DeviceMobilityStatePnoScanStats {
3175  // see WifiManager.DEVICE_MOBILITY_STATE_* constants
3176  enum DeviceMobilityState {
3177    // Unknown mobility
3178    UNKNOWN = 0;
3179
3180    // High movement
3181    HIGH_MVMT = 1;
3182
3183    // Low movement
3184    LOW_MVMT = 2;
3185
3186    // Stationary
3187    STATIONARY = 3;
3188  }
3189
3190  // The device mobility state
3191  optional DeviceMobilityState device_mobility_state = 1;
3192
3193  // The number of times that this state was entered
3194  optional int32 num_times_entered_state = 2;
3195
3196  // The total duration elapsed while in this mobility state, in ms
3197  optional int64 total_duration_ms = 3;
3198
3199  // the total duration elapsed while in this mobility state with PNO scans running, in ms
3200  optional int64 pno_duration_ms = 4;
3201}
3202
3203// The information about the Wifi P2p events.
3204message WifiP2pStats {
3205
3206  // Group event list tracking sessions and client counts in tethered mode.
3207  repeated GroupEvent group_event = 1;
3208
3209  // Session information that gets logged for every Wifi P2p connection.
3210  repeated P2pConnectionEvent connection_event = 2;
3211
3212  // Number of persistent group in the user profile.
3213  optional int32 num_persistent_group = 3;
3214
3215  // Number of peer scan.
3216  optional int32 num_total_peer_scans = 4;
3217
3218  // Number of service scan.
3219  optional int32 num_total_service_scans = 5;
3220}
3221
3222message P2pConnectionEvent {
3223
3224  enum ConnectionType {
3225
3226    // fresh new connection.
3227    CONNECTION_FRESH = 0;
3228
3229    // reinvoke a group.
3230    CONNECTION_REINVOKE = 1;
3231
3232    // create a group with the current device as the group owner locally.
3233    CONNECTION_LOCAL = 2;
3234
3235    // create a group or join a group with config.
3236    CONNECTION_FAST = 3;
3237  }
3238
3239  enum ConnectivityLevelFailure {
3240
3241    // Failure is unknown.
3242    CLF_UNKNOWN = 0;
3243
3244    // No failure.
3245    CLF_NONE = 1;
3246
3247    // Timeout for current connecting request.
3248    CLF_TIMEOUT = 2;
3249
3250    // The connecting request is canceled by the user.
3251    CLF_CANCEL = 3;
3252
3253    // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
3254    CLF_PROV_DISC_FAIL = 4;
3255
3256    // Invitation failure, e.g. rejected by the peer.
3257    CLF_INVITATION_FAIL = 5;
3258
3259    // Incoming request is rejected by the user.
3260    CLF_USER_REJECT = 6;
3261
3262    // New connection request is issued before ending previous connecting request.
3263    CLF_NEW_CONNECTION_ATTEMPT = 7;
3264
3265    // Group has been removed
3266    CLF_GROUP_REMOVED = 8;
3267
3268    // Creating group failed
3269    CLF_CREATE_GROUP_FAILED = 9;
3270  }
3271
3272  // WPS method.
3273  enum WpsMethod {
3274    // WPS is skipped for Group Reinvoke.
3275    WPS_NA = -1;
3276
3277    // Push button configuration.
3278    WPS_PBC = 0;
3279
3280    // Display pin method configuration - pin is generated and displayed on device.
3281    WPS_DISPLAY = 1;
3282
3283    // Keypad pin method configuration - pin is entered on device.
3284    WPS_KEYPAD = 2;
3285
3286    // Label pin method configuration - pin is labelled on device.
3287    WPS_LABEL = 3;
3288  }
3289
3290  enum GroupBand {
3291    // Unknown band/frequency
3292    BAND_UNKNOWN = 0;
3293    // With any band
3294    BAND_AUTO = 1;
3295    // With 2G band
3296    BAND_2G = 2;
3297    // With 5G band
3298    BAND_5G = 3;
3299    // With 6G band
3300    BAND_6G = 4;
3301    // With a specific frequency
3302    BAND_FREQUENCY = 5;
3303  }
3304
3305  // Start time of the connection.
3306  optional int64 start_time_millis = 1;
3307
3308  // Type of the connection.
3309  optional ConnectionType connection_type = 2;
3310
3311  // WPS method.
3312  optional WpsMethod wps_method = 3 [default = WPS_NA];
3313
3314  // Duration to connect.
3315  optional int32 duration_taken_to_connect_millis = 4;
3316
3317  // Failures that happen at the connectivity layer.
3318  optional ConnectivityLevelFailure connectivity_level_failure_code = 5;
3319
3320  // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
3321  // credential.
3322  optional GroupEvent.GroupRole group_role = 6;
3323
3324  // Group band preference
3325  optional GroupBand band = 7;
3326
3327  // Group frequency in MHz if positive. Otherwise, no frequency preference.
3328  optional int32 frequency_mhz = 8;
3329
3330  // STA mode channel frequency. 0 means unknown.
3331  optional int32 sta_frequency_mhz = 9;
3332
3333  // The uid of the app that initiates the connection.
3334  optional int32 uid = 10;
3335
3336  // if the country code is in the world mode
3337  optional bool is_country_code_world_mode = 11;
3338
3339  // fallback to negotiation if device receives invitation response status code "information is
3340  // currently unavailable"
3341  optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 12;
3342
3343  // The try count of connection
3344  optional int32 try_count = 13;
3345
3346  // The Attribution tag to identify the caller
3347  optional string attribution_tag = 14;
3348}
3349
3350// GroupEvent tracking group information from GroupStarted to GroupRemoved.
3351message GroupEvent {
3352
3353  enum GroupRole {
3354
3355    GROUP_OWNER = 0;
3356
3357    GROUP_CLIENT = 1;
3358
3359    GROUP_UNKNOWN = 2;
3360  }
3361
3362  // The ID of network in supplicant for this group.
3363  optional int32 net_id = 1;
3364
3365  // Start time of the group.
3366  optional int64 start_time_millis = 2;
3367
3368  // Channel frequency used for Group.
3369  optional int32 channel_frequency = 3;
3370
3371  // Is group owner or group client.
3372  optional GroupRole group_role = 5;
3373
3374  // Number of connected clients.
3375  optional int32 num_connected_clients = 6;
3376
3377  // Cumulative number of connected clients.
3378  optional int32 num_cumulative_clients = 7;
3379
3380  // The session duration.
3381  optional int32 session_duration_millis = 8;
3382
3383  // The idle duration. A group without any client is in idle.
3384  optional int32 idle_duration_millis = 9;
3385}
3386
3387// Easy Connect (DPP)
3388message WifiDppLog {
3389  reserved 6;
3390
3391  // Number of Configurator-Initiator requests
3392  optional int32 num_dpp_configurator_initiator_requests = 1;
3393
3394  // Number of Enrollee-Initiator requests
3395  optional int32 num_dpp_enrollee_initiator_requests = 2;
3396
3397  // Easy Connect (DPP) Enrollee success
3398  optional int32 num_dpp_enrollee_success = 3;
3399
3400  // Easy Connect (DPP) Configurator success code bucket
3401  repeated DppConfiguratorSuccessStatusHistogramBucket dpp_configurator_success_code = 4;
3402
3403  // Easy Connect (DPP) failure code bucket
3404  repeated DppFailureStatusHistogramBucket dpp_failure_code = 5;
3405
3406  // Easy Connect (DPP) operation time bucket
3407  repeated HistogramBucketInt32 dpp_operation_time = 7;
3408
3409  // Number of Enrollee-Responder peer devices supporting DPP protocol version 1
3410  optional int32 num_dpp_r1_capable_enrollee_responder_devices = 8;
3411
3412  // Number of Enrollee-Responder peer devices supporting DPP protocol version 2
3413  optional int32 num_dpp_r2_capable_enrollee_responder_devices = 9;
3414
3415  // Number of Enrollee-Responder incompatible configurations found in DPP R2 compatibility check.
3416  optional int32 num_dpp_r2_enrollee_responder_incompatible_configuration = 10;
3417
3418  // Number of Enrollee-Responder requests
3419  optional int32 num_dpp_enrollee_responder_requests = 11;
3420
3421  // Number of Enrollee-Responder success
3422  optional int32 num_dpp_enrollee_responder_success = 12;
3423
3424  // Histogram bucket for Wi-Fi DPP configurator success
3425  message DppConfiguratorSuccessStatusHistogramBucket {
3426    // status type defining the bucket
3427    optional DppConfiguratorSuccessCode dpp_status_type = 1;
3428
3429    // number of samples in the bucket
3430    optional int32 count = 2;
3431  }
3432
3433  // Histogram bucket for Wi-Fi DPP failures
3434  message DppFailureStatusHistogramBucket {
3435    // status type defining the bucket
3436    optional DppFailureCode dpp_status_type = 1;
3437
3438    // number of samples in the bucket
3439    optional int32 count = 2;
3440  }
3441
3442  enum DppConfiguratorSuccessCode {
3443    // Unknown success code
3444    EASY_CONNECT_EVENT_SUCCESS_UNKNOWN = 0;
3445
3446    // Easy Connect Configurator success event: Configuration sent to enrollee
3447    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 1;
3448
3449    // Easy Connect Configurator success event: Configuration applied by enrollee
3450    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 2;
3451  }
3452
3453  enum DppFailureCode {
3454    // Unknown failure
3455    EASY_CONNECT_EVENT_FAILURE_UNKNOWN = 0;
3456
3457    // Easy Connect Failure event: Scanned QR code is either not a Easy Connect URI, or the Easy
3458    // Connect URI has errors.
3459    EASY_CONNECT_EVENT_FAILURE_INVALID_URI = 1;
3460
3461    // Easy Connect Failure event: Bootstrapping/Authentication initialization process failure.
3462    EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = 2;
3463
3464    // Easy Connect Failure event: Both devices are implementing the same role and are
3465    // incompatible.
3466    EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = 3;
3467
3468    // Easy Connect Failure event: Configuration process has failed due to malformed message.
3469    EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = 4;
3470
3471    // Easy Connect Failure event: Easy Connect request while in another Easy Connect exchange.
3472    EASY_CONNECT_EVENT_FAILURE_BUSY = 5;
3473
3474    // Easy Connect Failure event: No response from the peer.
3475    EASY_CONNECT_EVENT_FAILURE_TIMEOUT = 6;
3476
3477    // Easy Connect Failure event: General protocol failure.
3478    EASY_CONNECT_EVENT_FAILURE_GENERIC = 7;
3479
3480    // Easy Connect Failure event: Feature or option is not supported.
3481    EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = 8;
3482
3483    // Easy Connect Failure event: Invalid network provided to Easy Connect configurator.
3484    // Network must either be WPA3-Personal (SAE) or WPA2-Personal (PSK).
3485    EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = 9;
3486
3487    // Easy Connect R2 Failure event: Enrollee cannot find the network.
3488    EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK = 10;
3489
3490    // Easy Connect R2 Failure event: Enrollee failed to authenticate with the network.
3491    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION = 11;
3492
3493    // Easy Connect R2 Failure event: Enrollee rejected the configuration.
3494    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION = 12;
3495
3496    // Easy Connect Failure event: System failed to generate DPP URI.
3497    EASY_CONNECT_EVENT_FAILURE_URI_GENERATION = 13;
3498
3499    // Easy Connect Failure event: Enrollee didn't scan the network's operating channel.
3500    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_FAILED_TO_SCAN_NETWORK_CHANNEL = 14;
3501  }
3502}
3503
3504// WifiConfigStore read/write metrics.
3505message WifiConfigStoreIO {
3506  // Histogram of config store read durations.
3507  repeated DurationBucket read_durations = 1;
3508
3509  // Histogram of config store write durations.
3510  repeated DurationBucket write_durations = 2;
3511
3512  // Total Number of instances of write/read duration in this duration bucket.
3513  message DurationBucket {
3514    // Bucket covers duration : [range_start_ms, range_end_ms)
3515    // The (inclusive) lower bound of read/write duration represented by this bucket
3516    optional int32 range_start_ms = 1;
3517
3518    // The (exclusive) upper bound of read/write duration represented by this bucket
3519    optional int32 range_end_ms = 2;
3520
3521    // Number of read/write durations that fit into this bucket
3522    optional int32 count = 3;
3523  }
3524}
3525
3526// Histogram bucket counting with int32. Range is [start, end)
3527message HistogramBucketInt32 {
3528  // lower range of the bucket (inclusive)
3529  optional int32 start = 1;
3530
3531  // upper range of the bucket (exclusive)
3532  optional int32 end = 2;
3533
3534  // number of samples in the bucket
3535  optional int32 count = 3;
3536}
3537
3538// Counts occurrences of a int32 key
3539message Int32Count {
3540  // the key
3541  optional int32 key = 1;
3542
3543  // the count
3544  optional int32 count = 2;
3545}
3546
3547message LinkProbeStats {
3548  enum LinkProbeFailureReason {
3549    // unknown reason
3550    LINK_PROBE_FAILURE_REASON_UNKNOWN = 0;
3551
3552    // Specified MCS rate when it is unsupported by the driver.
3553    LINK_PROBE_FAILURE_REASON_MCS_UNSUPPORTED = 1;
3554
3555    // Driver reported that no ACK was received for the transmitted probe.
3556    LINK_PROBE_FAILURE_REASON_NO_ACK = 2;
3557
3558    // Driver failed to report on the status of the transmitted probe within the timeout.
3559    LINK_PROBE_FAILURE_REASON_TIMEOUT = 3;
3560
3561    // An existing link probe is in progress.
3562    LINK_PROBE_FAILURE_REASON_ALREADY_STARTED = 4;
3563  }
3564
3565  // Counts the number of failures for each failure reason.
3566  message LinkProbeFailureReasonCount {
3567    // The failure reason.
3568    optional LinkProbeFailureReason failure_reason = 1;
3569
3570    // The number of occurrences for this failure reason.
3571    optional int32 count = 2;
3572  }
3573
3574  // Counts the number of link probes for each experiment.
3575  message ExperimentProbeCounts {
3576    // The experiment ID.
3577    optional string experiment_id = 1;
3578
3579    // The number of link probes triggered for this experiment.
3580    optional int32 probe_count = 2;
3581  }
3582
3583  // Counts the occurrences of RSSI values when a link probe succeeds.
3584  repeated Int32Count success_rssi_counts = 1;
3585
3586  // Counts the occurrences of RSSI values when a link probe fails.
3587  repeated Int32Count failure_rssi_counts = 2;
3588
3589  // Counts the occurrences of Link Speed values when a link probe succeeds.
3590  repeated Int32Count success_link_speed_counts = 3;
3591
3592  // Counts the occurrences of Link Speed values when a link probe fails.
3593  repeated Int32Count failure_link_speed_counts = 4;
3594
3595  // Histogram for the number of seconds since the last TX success when a link probe succeeds.
3596  repeated HistogramBucketInt32 success_seconds_since_last_tx_success_histogram = 5;
3597
3598  // Histogram for the number of seconds since the last TX success when a link probe fails.
3599  repeated HistogramBucketInt32 failure_seconds_since_last_tx_success_histogram = 6;
3600
3601  // Histogram for the elapsed time of successful link probes, in ms.
3602  repeated HistogramBucketInt32 success_elapsed_time_ms_histogram = 7;
3603
3604  // Counts the occurrences of error codes for failed link probes.
3605  repeated LinkProbeFailureReasonCount failure_reason_counts = 8;
3606
3607  // Counts the number of link probes for each experiment.
3608  repeated ExperimentProbeCounts experiment_probe_counts = 9;
3609}
3610
3611// Stores the decisions that were made by a experiment when compared against another experiment
3612message NetworkSelectionExperimentDecisions {
3613  // the id of one experiment
3614  optional int32 experiment1_id = 1;
3615
3616  // the id of the other experiment
3617  optional int32 experiment2_id = 2;
3618
3619  // Counts occurrences of the number of network choices there were when experiment1 makes the
3620  // same network selection as experiment2.
3621  // The keys are the number of network choices, and the values are the number of occurrences of
3622  // this number of network choices when exp1 and exp2 make the same network selection.
3623  repeated Int32Count same_selection_num_choices_counter = 3;
3624
3625  // Counts occurrences of the number of network choices there were when experiment1 makes the
3626  // same network selection as experiment2.
3627  // The keys are the number of network choices, and the values are the number of occurrences of
3628  // this number of network choices when exp1 and exp2 make different network selections.
3629  // Note that it is possible for the network selection to be different even when there only exists
3630  // a single network choice, since choosing not to connect to that network is a valid choice.
3631  repeated Int32Count different_selection_num_choices_counter = 4;
3632}
3633
3634// NetworkRequest API metrics.
3635message WifiNetworkRequestApiLog {
3636  // Number of requests via this API surface.
3637  optional int32 num_request = 1;
3638
3639  // Histogram of requests via this API surface to number of networks matched in scan results.
3640  repeated HistogramBucketInt32 network_match_size_histogram = 2;
3641
3642  // Number of requests via this API surface that bypassed user approval.
3643  optional int32 num_user_approval_bypass = 4;
3644
3645  // Number of requests via this API surface that was rejected by the user.
3646  optional int32 num_user_reject = 5;
3647
3648  // Number of unique apps using this API surface.
3649  optional int32 num_apps = 6;
3650
3651  // Number of connections on primary iface.
3652  optional int32 num_connect_on_primary_iface = 7;
3653
3654  // Number of successful network connection from this API.
3655  optional int32 num_connect_success_on_primary_iface = 3;
3656
3657  // Histogram of connection durations in seconds using this API surface.
3658  repeated HistogramBucketInt32 connection_duration_sec_on_primary_iface_histogram = 8;
3659
3660  // Number of connections on secondary iface (STA + STA)
3661  optional int32 num_connect_on_secondary_iface = 9;
3662
3663  // Number of connection success on secondary iface (STA + STA)
3664  optional int32 num_connect_success_on_secondary_iface = 10;
3665
3666  // Histogram of connection durations in seconds on secondary iface using this API surface.
3667  repeated HistogramBucketInt32 connection_duration_sec_on_secondary_iface_histogram = 11;
3668
3669  // Number of times there were concurrent connections (STA + STA):
3670  // - on a primary iface (internet) and
3671  // - on a secondary iface (using this API surface)
3672  optional int32 num_concurrent_connection = 12;
3673
3674  // Histogram of concurrent connection durations in seconds using this API surface (STA + STA).
3675  repeated HistogramBucketInt32 concurrent_connection_duration_sec_histogram = 13;
3676}
3677
3678// NetworkSuggestion API metrics.
3679message WifiNetworkSuggestionApiLog {
3680  enum SuggestionAppTypeCode {
3681    // UNKNOWN type suggestion app.
3682    TYPE_UNKNOWN = 0;
3683    // Suggestion app with carrier privilege.
3684    TYPE_CARRIER_PRIVILEGED = 1;
3685    // Suggestion app with network provisioning permission(NETWORK_CARRIER_PROVISIONING).
3686    TYPE_NETWORK_PROVISIONING = 2;
3687    // Suggestion app without special privilege.
3688    TYPE_NON_PRIVILEGED = 3;
3689  }
3690
3691  message SuggestionAppCount {
3692    // Suggestion app type.
3693    optional SuggestionAppTypeCode app_type = 1;
3694    // Num of app in this type.
3695    optional int32 count = 2;
3696  }
3697
3698  // Number of modifications to their suggestions by apps.
3699  optional int32 num_modification = 1;
3700
3701  // Number of successful network connection from app suggestions.
3702  optional int32 num_connect_success = 2;
3703
3704  // Number of network connection failures from app suggestions.
3705  optional int32 num_connect_failure = 3;
3706
3707  // Histogram for size of the network lists provided by various apps on the device.
3708  repeated HistogramBucketInt32 network_list_size_histogram = 4;
3709
3710  // Count of app using suggestion API with different privilege.
3711  repeated SuggestionAppCount app_count_per_type = 5;
3712
3713  // Number of user revoke app's permission from settings or disallowed from UI.
3714  optional int32 user_revoke_app_suggestion_permission = 6;
3715
3716  // Number of priority groups configured on the device, excluding the default priority group.
3717  optional int32 num_priority_groups = 7;
3718
3719  // Number of times when a ScanResult matched more than one suggestions.
3720  optional int32 num_multiple_suggestions = 8;
3721
3722  // Number of saved profiles which also have at least one suggestion (for the same network)
3723  // provisioned on the device.
3724  optional int32 num_saved_networks_with_configured_suggestion = 9;
3725}
3726
3727// WifiLock metrics
3728message WifiLockStats {
3729    // Amount of time wifi is actively in HIGH_PERF mode (ms)
3730    // This means the lock takes effect and the device takes the actions required for this mode
3731    optional int64 high_perf_active_time_ms = 1;
3732
3733    // Amount of time wifi is actively in LOW_LATENCY mode (ms)
3734    // This means the lock takes effect and the device takes the actions required for this mode
3735    optional int64 low_latency_active_time_ms = 2;
3736
3737    // Histogram of HIGH_PERF lock acquisition duration (seconds)
3738    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
3739    repeated HistogramBucketInt32 high_perf_lock_acq_duration_sec_histogram = 3;
3740
3741    // Histogram of LOW_LATENCY lock acquisition duration (seconds)
3742    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
3743    repeated HistogramBucketInt32 low_latency_lock_acq_duration_sec_histogram = 4;
3744
3745    // Histogram of HIGH_PERF active session duration (seconds)
3746    // This means the lock takes effect and the device takes the actions required for this mode
3747    repeated HistogramBucketInt32 high_perf_active_session_duration_sec_histogram = 5;
3748
3749    // Histogram of LOW_LATENCY active session duration (seconds)
3750    // This means the lock takes effect and the device takes the actions required for this mode
3751    repeated HistogramBucketInt32 low_latency_active_session_duration_sec_histogram = 6;
3752}
3753
3754// Stats on number of times Wi-Fi is turned on/off though the WifiManager#setWifiEnabled API
3755message WifiToggleStats {
3756  // Number of time Wi-Fi is turned on by privileged apps
3757  optional int32 num_toggle_on_privileged = 1;
3758
3759  // Number of time Wi-Fi is turned off by privileged apps
3760  optional int32 num_toggle_off_privileged = 2;
3761
3762  // Number of time Wi-Fi is turned on by normal apps
3763  optional int32 num_toggle_on_normal = 3;
3764
3765  // Number of time Wi-Fi is turned off by normal apps
3766  optional int32 num_toggle_off_normal = 4;
3767}
3768
3769// Information about the Passpoint provision metrics.
3770message PasspointProvisionStats {
3771  enum ProvisionFailureCode {
3772    // provisioning failure for unknown reason.
3773    OSU_FAILURE_UNKNOWN = 0;
3774
3775    // The reason code for Provisioning Failure due to connection failure to OSU AP.
3776    OSU_FAILURE_AP_CONNECTION = 1;
3777
3778    // The reason code for invalid server URL address.
3779    OSU_FAILURE_SERVER_URL_INVALID = 2;
3780
3781    // The reason code for provisioning failure due to connection failure to the server.
3782    OSU_FAILURE_SERVER_CONNECTION = 3;
3783
3784    // The reason code for provisioning failure due to invalid server certificate.
3785    OSU_FAILURE_SERVER_VALIDATION = 4;
3786
3787    // The reason code for provisioning failure due to invalid service provider.
3788    OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5;
3789
3790    // The reason code for provisioning failure when a provisioning flow is aborted.
3791    OSU_FAILURE_PROVISIONING_ABORTED = 6;
3792
3793    // The reason code for provisioning failure when a provisioning flow is not possible.
3794    OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;
3795
3796    // The reason code for provisioning failure due to invalid web url format for an OSU web page.
3797    OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8;
3798
3799    // The reason code for provisioning failure when a command received is not the expected command
3800    // type.
3801    OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9;
3802
3803    // The reason code for provisioning failure when a SOAP message is not the expected message
3804    // type.
3805    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10;
3806
3807    // The reason code for provisioning failure when a SOAP message exchange fails.
3808    OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11;
3809
3810    // The reason code for provisioning failure when a redirect listener fails to start.
3811    OSU_FAILURE_START_REDIRECT_LISTENER = 12;
3812
3813    // The reason code for provisioning failure when a redirect listener timed out to receive a HTTP
3814    // redirect response.
3815    OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13;
3816
3817    // The reason code for provisioning failure when there is no OSU activity to listen to intent.
3818    OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14;
3819
3820    // The reason code for provisioning failure when the status of a SOAP message is not the
3821    // expected message status.
3822    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15;
3823
3824    // The reason code for provisioning failure when there is no PPS MO.
3825    OSU_FAILURE_NO_PPS_MO = 16;
3826
3827    // The reason code for provisioning failure when there is no AAAServerTrustRoot node in a PPS
3828    // MO.
3829    OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17;
3830
3831    // The reason code for provisioning failure when there is no TrustRoot node for remediation
3832    // server in a PPS MO.
3833    OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18;
3834
3835    // The reason code for provisioning failure when there is no TrustRoot node for policy server in
3836    // a PPS MO.
3837    OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19;
3838
3839    // The reason code for provisioning failure when failing to retrieve trust root certificates
3840    // used for validating server certificate for AAA, Remediation and Policy server.
3841    OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20;
3842
3843    // The reason code for provisioning failure when there is no trust root certificate for AAA
3844    // server.
3845    OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21;
3846
3847    // The reason code for provisioning failure when a {@link PasspointConfiguration} is failed to
3848    // install.
3849    OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22;
3850
3851    // The reason code for provisioning failure when an {@link OsuProvider} is not found for
3852    // provisioning.
3853    OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23;
3854  }
3855
3856  // Number of passpoint provisioning success
3857  optional int32 num_provision_success = 1;
3858
3859  // Count for passpoint provisioning failure
3860  repeated ProvisionFailureCount provision_failure_count = 2;
3861
3862  // Number of occurrences of a specific passpoint provision failure code
3863  message ProvisionFailureCount {
3864    // Failure code
3865    optional ProvisionFailureCode failure_code = 1;
3866
3867    // Number of failure for the failure_code.
3868    optional int32 count = 2;
3869  }
3870}
3871
3872// Counts number of networks on the device that are metered.
3873message MeteredNetworkStats {
3874  // Number of networks that are set or detected as metered.
3875  optional int32 num_metered = 1 [default = 0];
3876
3877  // Number of networks that are set or detected as unmetered.
3878  optional int32 num_unmetered = 2;
3879
3880  // Number of networks that have meteredOverride set to metered.
3881  optional int32 num_override_metered = 3;
3882
3883  // Number of networks that have meteredOverride set to unmetered.
3884  optional int32 num_override_unmetered = 4;
3885}
3886
3887// An event capturing user action on wifi
3888message UserActionEvent {
3889  enum EventType {
3890    // The default and unused event
3891    EVENT_UNKNOWN = 0;
3892    // User forgets the network
3893    EVENT_FORGET_WIFI = 1;
3894    // User manually triggers disconnect
3895    EVENT_DISCONNECT_WIFI = 2;
3896    // User changes the metered setting to "metered"
3897    EVENT_CONFIGURE_METERED_STATUS_METERED = 3;
3898    // User changes the metered setting to "unmetered"
3899    EVENT_CONFIGURE_METERED_STATUS_UNMETERED = 4;
3900    // User changes the mac randomization setting to use random MAC
3901    EVENT_CONFIGURE_MAC_RANDOMIZATION_ON = 5;
3902    // User changes the mac randomization setting to use factory MAC
3903    EVENT_CONFIGURE_MAC_RANDOMIZATION_OFF = 6;
3904    // User sets auto-connect to on
3905    EVENT_CONFIGURE_AUTO_CONNECT_ON = 7;
3906    // User sets auto-connect to off
3907    EVENT_CONFIGURE_AUTO_CONNECT_OFF = 8;
3908    // User toggles wifi on
3909    EVENT_TOGGLE_WIFI_ON = 9;
3910    // User toggles wifi off
3911    EVENT_TOGGLE_WIFI_OFF = 10;
3912    // User manually connects to a network
3913    EVENT_MANUAL_CONNECT = 11;
3914    // User changes the metered setting to "detect automatically"
3915    EVENT_CONFIGURE_METERED_STATUS_AUTO = 12;
3916    // User adds a new network or updates configurations for an existing network.
3917    EVENT_ADD_OR_UPDATE_NETWORK = 13;
3918    // User sets the adaptive connectivity to on
3919    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_ON = 14;
3920    // User sets the adaptive connectivity to off
3921    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_OFF = 15;
3922    // User restarts wifi subsystem
3923    EVENT_RESTART_WIFI_SUB_SYSTEM = 16;
3924  }
3925
3926  // The type of user action
3927  optional EventType event_type = 1;
3928
3929  // The start time of the event in milliseconds since boot.
3930  optional int64 start_time_millis = 2;
3931
3932  // Additional information on the target network for the action. This is not applicable and will
3933  // be null for some actions such as EVENT_TOGGLE_WIFI_ON.
3934  optional TargetNetworkInfo target_network_info = 3;
3935
3936  // Information about the currently connected network.
3937  optional WifiStatus wifi_status = 4;
3938
3939  // Reasons why the network applicable for this user action is disabled.
3940  // Normally this should be referring to the currently connected network.
3941  // For a manual connection, this is referring to the user selected networks.
3942  optional NetworkDisableReason network_disable_reason = 5;
3943}
3944
3945message WifiStatus {
3946  // Wifi is connected.
3947  optional bool is_connected = 1;
3948
3949  // Wifi is validated
3950  optional bool is_validated = 2;
3951
3952  // The last observed RSSI
3953  optional sint32 last_rssi = 3;
3954
3955  // Estimated TX
3956  optional int32 estimated_tx_kbps = 4;
3957
3958  // Estimated RX
3959  optional int32 estimated_rx_kbps = 5;
3960
3961  // There is another candidate with better score, but user connect choice is preventing the switch.
3962  optional bool is_stuck_due_to_user_connect_choice = 6;
3963}
3964
3965// Additional information on a network
3966message TargetNetworkInfo {
3967  // Whether the network is an ephemeral network.
3968  optional bool is_ephemeral = 1;
3969
3970  // Whether the target is a passpoint network.
3971  optional bool is_passpoint = 2;
3972}
3973
3974// Reasons why a configuration or BSSID is disabled.
3975message NetworkDisableReason {
3976  enum DisableReason {
3977    // Default value, should not be used.
3978    REASON_UNKNOWN = 0;
3979    // AP unable to accept more clients, a special kind of association rejection failure.
3980    REASON_AP_UNABLE_TO_HANDLE_NEW_STA = 1;
3981    // No internet
3982    REASON_NETWORK_VALIDATION_FAILURE = 2;
3983    // Password is incorrect, a special kind of authentication failure.
3984    REASON_WRONG_PASSWORD = 3;
3985    // Incorrect EAP credentials.
3986    REASON_EAP_FAILURE = 4;
3987    // Other association rejection failures.
3988    REASON_ASSOCIATION_REJECTION = 5;
3989    // Associated timeout failures.
3990    REASON_ASSOCIATION_TIMEOUT = 6;
3991    // Other authentication failures.
3992    REASON_AUTHENTICATION_FAILURE = 7;
3993    // DHCP failures.
3994    REASON_DHCP_FAILURE = 8;
3995    // Device disconnected shortly after connection.
3996    REASON_ABNORMAL_DISCONNECT = 9;
3997    // AP initiated disconnect for a given duration.
3998    REASON_FRAMEWORK_DISCONNECT_MBO_OCE = 10;
3999    // Avoid connecting to the failed AP when trying to reconnect on other available candidates.
4000    REASON_FRAMEWORK_DISCONNECT_FAST_RECONNECT = 11;
4001    // The connected scorer has disconnected this network.
4002    REASON_FRAMEWORK_DISCONNECT_CONNECTED_SCORE = 12;
4003    // The network is disabled due to absence of user credentials
4004    REASON_AUTHENTICATION_NO_CREDENTIALS = 13;
4005    // The network is disabled because service is not subscribed, a special kind of EAP failure.
4006    REASON_AUTHENTICATION_NO_SUBSCRIPTION = 14;
4007    // User disabled auto-join for this network.
4008    REASON_AUTO_JOIN_DISABLED = 15;
4009  }
4010
4011  // The reason for disabling a network.
4012  optional DisableReason disable_reason = 1;
4013
4014  // The configuration is temporarily disabled.
4015  optional bool config_temporarily_disabled = 2;
4016
4017  // The configuration is disabled until the user manually re-enables it.
4018  optional bool config_permanently_disabled = 3;
4019
4020  // Reasons why 1 or more BSSIDs are temporarily disabled.
4021  repeated DisableReason bssid_disable_reasons = 4;
4022}
4023
4024// Number of networks with a large change of connection/disconnection
4025// failure rate or high failure rate at high RSSI
4026message HealthMonitorFailureStats {
4027  // Number of networks with a large change of (or high) association rejection rate
4028  optional int32 cnt_assoc_rejection = 1;
4029  // Number of networks with a large change of (or high) association timeout rate
4030  optional int32 cnt_assoc_timeout = 2;
4031  // Number of networks with a large change of (or high) auth failure rate
4032  optional int32 cnt_auth_failure = 3;
4033  // Number of networks with a large change of (or high) connection failure rate
4034  optional int32 cnt_connection_failure = 4;
4035  // Number of networks with a large change of (or high) nonlocal disconnection rate
4036  optional int32 cnt_disconnection_nonlocal = 5;
4037  // Number of networks with a large change of (or high) short disconnection rate
4038  optional int32 cnt_short_connection_nonlocal = 6;
4039  // Number of networks with a large change of (or high) disconnection-during-connecting rate
4040  optional int32 cnt_disconnection_nonlocal_connecting = 7;
4041}
4042
4043// Metrics collected by health monitor
4044message HealthMonitorMetrics {
4045  // Number of networks with a large increase (compared to stats of previous build) of
4046  // connection/disconnection failure rate
4047  optional HealthMonitorFailureStats failure_stats_increase = 1;
4048  // Number of networks with a large decrease (compared to stats of previous build) of
4049  // connection/disconnection failure rate
4050  optional HealthMonitorFailureStats failure_stats_decrease = 2;
4051  // Number of networks with high connection/disconnection failure rate for
4052  // current build but without sufficient connection attempts for previous build
4053  optional HealthMonitorFailureStats failure_stats_high = 3;
4054  // Number of networks with sufficient connection attempts for current build
4055  // but without suffcient connection attempts for previous build
4056  optional int32 num_network_sufficient_recent_stats_only = 4;
4057  // Number of networks with sufficient connection attempts for both current and previous builds
4058  optional int32 num_network_sufficient_recent_prev_stats = 5;
4059}
4060
4061// Connection duration statistics collected under various health conditions
4062// while Wifi link layer stats report are on
4063message ConnectionDurationStats {
4064  // Total time with sufficient Wifi throughput and with cellular data on
4065  optional int32 total_time_sufficient_throughput_ms = 1;
4066  // Total time with insufficient Wifi throughput and with cellular data on
4067  optional int32 total_time_insufficient_throughput_ms = 2;
4068  // Total time with cellular data off
4069  optional int32 total_time_cellular_data_off_ms = 3;
4070  // Total time with insufficient Wifi throughput and with cellular data on
4071  // while wifi is the default network
4072  optional int32 total_time_insufficient_throughput_default_wifi_ms = 4;
4073}
4074
4075// Wi-Fi off metrics
4076// Keeps track of Wi-Fi off stats
4077message WifiOffMetrics {
4078  // Total number of Wi-Fi off
4079  optional int32 num_wifi_off = 1;
4080
4081  // Total number of Wi-Fi off with deferring
4082  optional int32 num_wifi_off_deferring = 2;
4083
4084  // Total number of Wi-Fi off deferring timeout
4085  optional int32 num_wifi_off_deferring_timeout = 3;
4086
4087  // Histogram of wifi off deferring time
4088  repeated Int32Count wifi_off_deferring_time_histogram = 4;
4089}
4090
4091// SoftAp Config  Limitation Metrics
4092message SoftApConfigLimitationMetrics {
4093  // Total number of softap security configuration reset to default because
4094  // hardware limitation when restore configuration from cloud
4095  optional int32 num_security_type_reset_to_default = 1;
4096
4097  // Total number of softap max client setting reset to default because
4098  // hardware limitation when restore configuration from cloud
4099  optional int32 num_max_client_setting_reset_to_default = 2;
4100
4101  // Total number of softap client control by user reset to default because
4102  // hardware limitation when restore configuration from cloud
4103  optional int32 num_client_control_by_user_reset_to_default = 3;
4104
4105  // Histogram of max client count when client connection fail because
4106  // setting limitation
4107  repeated Int32Count max_client_setting_when_reach_histogram = 4;
4108}
4109
4110// Channel utilization histogram
4111// The valid utilization range is between 0 and 255 corresponding to
4112// utilization ratio between 0 and 1
4113message ChannelUtilizationHistogram {
4114  // Histogram at 2G
4115  repeated HistogramBucketInt32 utilization_2g = 1;
4116  // Histogram above 2G
4117  repeated HistogramBucketInt32 utilization_above_2g = 2;
4118}
4119
4120// Throughput histogram
4121message ThroughputMbpsHistogram {
4122  // Tx histogram at 2G
4123  repeated HistogramBucketInt32 tx_2g = 1;
4124  // Tx histogram above 2G
4125  repeated HistogramBucketInt32 tx_above_2g = 2;
4126  // Rx histogram at 2G
4127  repeated HistogramBucketInt32 rx_2g = 3;
4128  // Rx histogram above 2G
4129  repeated HistogramBucketInt32 rx_above_2g = 4;
4130}
4131
4132// Initial Partial Scan stats
4133message InitPartialScanStats {
4134  // Total number of partial scans
4135  optional int32 num_scans = 1;
4136
4137  // Number of instances a partial scan results in finding a network
4138  optional int32 num_success_scans = 2;
4139
4140  // Number of instances a patial scan does not result in finding a network
4141  // and a follow up full scan finds a network.
4142  optional int32 num_failure_scans = 3;
4143
4144  // Histogram of number of channels used in a successful partial scan
4145  repeated HistogramBucketInt32 successful_scan_channel_count_histogram = 4;
4146
4147  // Histogram of number of channels used in a failed partial scan
4148  repeated HistogramBucketInt32 failed_scan_channel_count_histogram = 5;
4149}
4150
4151// User reaction to the carrier IMSI protection exemption UI
4152message UserReactionToApprovalUiEvent {
4153  enum UserActionCode {
4154    // UNKNOWN user action.
4155    ACTION_UNKNOWN = 0;
4156    // Action user allowed.
4157    ACTION_ALLOWED = 1;
4158    // Action user disallowed.
4159    ACTION_DISALLOWED = 2;
4160    // Action user dismiss.
4161    ACTION_DISMISS = 3;
4162  }
4163  message UserReaction {
4164    // User action to the UI.
4165    optional UserActionCode user_action = 1;
4166    // Is UI a dialog or notification.
4167    optional bool is_dialog = 2;
4168  }
4169
4170  // Event of user reaction to the app approval UI.
4171  repeated UserReaction user_approval_app_ui_reaction = 1;
4172
4173  // Event of user reaction to the carrier approval UI.
4174  repeated UserReaction user_approval_carrier_ui_reaction = 2;
4175}
4176
4177message CarrierWifiMetrics {
4178  // Number of successful network connection using Carrier ID
4179  optional int32 num_connection_success = 1;
4180  // Number of failed authentication from network connection using Carrier ID
4181  optional int32 num_connection_auth_failure = 2;
4182  optional int32 num_connection_non_auth_failure = 3;
4183}
4184
4185message FirstConnectAfterBootStats {
4186  message Attempt {
4187    // The attempt completion timestamp, in milliseconds since boot.
4188    optional int64 timestamp_since_boot_millis = 1;
4189
4190    // whether the attempt was successful.
4191    optional bool is_success = 2;
4192  }
4193
4194  // Info about whether Wifi was enabled at boot time.
4195  // `is_success` is true if Wifi is toggled ON at boot, false otherwise.
4196  // This field will never be null.
4197  optional Attempt wifi_enabled_at_boot = 1;
4198
4199  // Info about the first network selection attempt for auto-join.
4200  // `is_success` is true if a network candidate was found, false otherwise.
4201  // This field is null if `wifi_enabled_at_boot.is_success` is false.
4202  optional Attempt first_network_selection = 2;
4203
4204  // Info about the first successful L2 connection.
4205  // `is_success` is true if the L2 connection was successfully established, false otherwise.
4206  // This field is null if `first_network_selection.is_success` is false.
4207  optional Attempt first_l2_connection = 3;
4208
4209  // Info about the first successful L3 connection.
4210  // `is_success` is true if the L3 connection was successfully established, false otherwise.
4211  // This field is null if `first_l2_connection.is_success` is false.
4212  optional Attempt first_l3_connection = 4;
4213}
4214
4215// Stats for Autojoin switches between Wifi networks. Does not include user/app-initiated switches.
4216message WifiToWifiSwitchStats {
4217  // Whether Make Before Break is supported by the hardware and enabled.
4218  optional bool is_make_before_break_supported = 1;
4219
4220  // Number of times Wifi to Wifi switch was triggered. This includes Make Before Break and Break
4221  // Before Make.
4222  optional int32 wifi_to_wifi_switch_trigger_count = 2;
4223
4224  // Number of times Wifi to Wifi switch was triggered using Make Before Break (MBB).
4225  // Note that MBB may not always be used for various reasons e.g. no additional iface available due
4226  // to ongoing SoftAP, both old and new network have MAC randomization disabled, etc.
4227  // TODO(b/180974604): also add metrics for the various reasons to not use MBB even when it is
4228  //  supported by the device.
4229  optional int32 make_before_break_trigger_count = 3;
4230
4231  // TODO(b/180974604): add metrics for L2 failure and L3 failure
4232
4233  // Number of times Make Before Break was aborted due to the new network not having internet.
4234  optional int32 make_before_break_no_internet_count = 4;
4235
4236  // Number of times where, for some reason, Make Before Break resulted in the loss of the primary
4237  // ClientModeManager, and we needed to recover by making one of the SECONDARY_TRANSIENT
4238  // ClientModeManagers primary.
4239  optional int32 make_before_break_recover_primary_count = 5;
4240
4241  // Number of times the new network in Make Before Break had its internet connection validated.
4242  optional int32 make_before_break_internet_validated_count = 6;
4243
4244  // Number of times the new network was made primary in Make Before Break.
4245  // TODO(b/180974604): add metrics for the various ways this could fail.
4246  optional int32 make_before_break_success_count = 7;
4247
4248  // Number of times the old network in Make Before Break completed lingering and was disconnected.
4249  optional int32 make_before_break_linger_completed_count = 8;
4250
4251  // Histogram of lingering duration caused by make before break in seconds.
4252  repeated Int32Count make_before_break_linger_duration_seconds = 9;
4253}
4254
4255// Network layer bandwidth estimator stats
4256message BandwidthEstimatorStats {
4257  // Bandwidth stats of each signal level
4258  message PerLevel {
4259    // Signal level derived by RssiUtil.calculateSignalLevel based on RSSI
4260    optional uint32 signal_level = 1;
4261    // Accumulated bandwidth sample count
4262    optional uint32 count = 2;
4263    // Average network layer bandwidth in kbps based on TrafficStats byte count and radio on time
4264    // of link layer stats.
4265    optional uint32 avg_bandwidth_kbps = 3;
4266    // Error of layer 2 link bandwidth in percent
4267    optional uint32 l2_error_percent = 4;
4268    // Error of network layer bandwidth estimation in percent
4269    optional uint32 bandwidth_est_error_percent = 5;
4270  }
4271
4272  // Bandwidth stats of each link
4273  message PerLink {
4274    repeated PerLevel level = 1;
4275  }
4276
4277  // Bandwidth stats of each band
4278  message PerBand {
4279    // Tx bandwidth stats
4280    optional PerLink tx = 1;
4281    // Rx bandwidth stats
4282    optional PerLink rx = 2;
4283  }
4284
4285  // Stats of 2g band
4286  optional PerBand stats_2g = 1;
4287  // Stats of above-2g band
4288  optional PerBand stats_above_2g = 2;
4289}
4290
4291