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
779// Information that gets logged for every WiFi connection.
780message RouterFingerPrint {
781
782  enum RoamType {
783
784    // Type is unknown.
785    ROAM_TYPE_UNKNOWN = 0;
786
787    // No roaming - usually happens on a single band (2.4 GHz) router.
788    ROAM_TYPE_NONE = 1;
789
790    // Enterprise router.
791    ROAM_TYPE_ENTERPRISE = 2;
792
793    // DBDC => Dual Band Dual Concurrent essentially a router that
794    // supports both 2.4 GHz and 5 GHz bands.
795    ROAM_TYPE_DBDC = 3;
796  }
797
798  enum Auth {
799
800    // Auth is unknown.
801    AUTH_UNKNOWN = 0;
802
803    // No authentication.
804    AUTH_OPEN = 1;
805
806    // If the router uses a personal authentication.
807    AUTH_PERSONAL = 2;
808
809    // If the router is setup for enterprise authentication.
810    AUTH_ENTERPRISE = 3;
811  }
812
813  enum RouterTechnology {
814
815    // Router is unknown.
816    ROUTER_TECH_UNKNOWN = 0;
817
818    // Router Channel A.
819    ROUTER_TECH_A = 1;
820
821    // Router Channel B.
822    ROUTER_TECH_B = 2;
823
824    // Router Channel G.
825    ROUTER_TECH_G = 3;
826
827    // Router Channel N.
828    ROUTER_TECH_N = 4;
829
830    // Router Channel AC.
831    ROUTER_TECH_AC = 5;
832
833    // When the channel is not one of the above.
834    ROUTER_TECH_OTHER = 6;
835
836    // Router Channel AX.
837    ROUTER_TECH_AX = 7;
838  }
839
840  enum EapMethod {
841
842    // No EAP method used
843    TYPE_EAP_UNKNOWN = 0;
844
845    // EAP with Transport Layer Security
846    TYPE_EAP_TLS = 1;
847
848    // EAP with Tunneled Transport Layer Security
849    TYPE_EAP_TTLS = 2;
850
851    // EAP with Subscriber Identity Module [RFC-4186]
852    TYPE_EAP_SIM = 3;
853
854    // EAP with Authentication and Key Agreement [RFC-4187]
855    TYPE_EAP_AKA = 4;
856
857    // EAP with Authentication and Key Agreement Prime [RFC-5448]
858    TYPE_EAP_AKA_PRIME = 5;
859
860    // Protected EAP
861    TYPE_EAP_PEAP = 6;
862
863    // EAP for Hotspot 2.0 r2 OSEN
864    TYPE_EAP_UNAUTH_TLS = 7;
865
866    // EAP with Password
867    TYPE_EAP_PWD = 8;
868
869    // EAP with WAPI certifcate
870    TYPE_EAP_WAPI_CERT = 9;
871  }
872
873  enum AuthPhase2Method {
874
875    // No phase2 method
876    TYPE_PHASE2_NONE = 0;
877
878    // Password Authentication Protocol
879    TYPE_PHASE2_PAP = 1;
880
881    // Microsoft Challenge Handshake Authentication Protocol
882    TYPE_PHASE2_MSCHAP = 2;
883
884    // Microsoft Challenge Handshake Authentication Protocol v2
885    TYPE_PHASE2_MSCHAPV2 = 3;
886
887    // Generic Token Card
888    TYPE_PHASE2_GTC = 4;
889
890    // EAP-Subscriber Identity Module [RFC-4186]
891    TYPE_PHASE2_SIM = 5;
892
893    // EAP-Authentication and Key Agreement [RFC-4187]
894    TYPE_PHASE2_AKA = 6;
895
896    // EAP-Authentication and Key Agreement Prime [RFC-5448]
897    TYPE_PHASE2_AKA_PRIME = 7;
898  }
899
900  enum OcspType {
901    // Do not use OCSP stapling
902    TYPE_OCSP_NONE = 0;
903
904    // Try to use OCSP stapling, but not require response
905    TYPE_OCSP_REQUEST_CERT_STATUS = 1;
906
907    // Require valid OCSP stapling response
908    TYPE_OCSP_REQUIRE_CERT_STATUS = 2;
909
910    // Require valid OCSP stapling response for all not-trusted certificates
911    // in the server certificate chain
912    TYPE_OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3;
913  }
914
915  optional RoamType roam_type = 1;
916
917  // Channel on which the connection takes place.
918  optional int32 channel_info = 2;
919
920  // DTIM setting of the router.
921  optional int32 dtim = 3;
922
923  // Authentication scheme of the router.
924  optional Auth authentication = 4;
925
926  // If the router is hidden.
927  optional bool hidden = 5;
928
929  // Channel information.
930  optional RouterTechnology router_technology = 6;
931
932  // whether ipv6 is supported.
933  optional bool supports_ipv6 = 7;
934
935  // If the router is a Passpoint / Hotspot 2.0 network
936  optional bool passpoint = 8;
937
938  // EAP method used by the enterprise network
939  optional EapMethod eap_method = 9;
940
941  // Phase 2 authentication method after setting up a secure channel
942  optional AuthPhase2Method auth_phase2_method = 10;
943
944  // Online certificate status protocol stapling type
945  optional OcspType ocsp_type = 11;
946
947  // PMK caching enablement
948  optional bool pmk_cache_enabled = 12;
949
950  // Max Tx link speed (in Mbps) supported by current network (STA and AP)
951  optional int32 max_supported_tx_link_speed_mbps = 13;
952
953  // Max Rx link speed (in Mbps) supported by current network (STA and AP)
954  optional int32 max_supported_rx_link_speed_mbps = 14;
955
956  // If the Passpoint connection is provided by the Home provider or Roaming/visited network
957  optional bool is_passpoint_home_provider = 15;
958}
959
960enum ClientRole {
961  // default/Invalid role
962  ROLE_UNKNOWN = 0;
963
964  // STA created for scans only.
965  ROLE_CLIENT_SCAN_ONLY = 1;
966
967  // secondary STA used for make before break.
968  ROLE_CLIENT_SECONDARY_TRANSIENT = 2;
969
970  // secondary STA created for local connection (no internet connectivity).
971  ROLE_CLIENT_LOCAL_ONLY = 3;
972
973  // primary STA.
974  ROLE_CLIENT_PRIMARY = 4;
975
976  // Long lived secondary STA used for restricted use cases
977  ROLE_CLIENT_SECONDARY_LONG_LIVED = 5;
978}
979
980message ConnectionEvent {
981
982  // Roam Type.
983  enum RoamType {
984
985    // Type is unknown.
986    ROAM_UNKNOWN = 0;
987
988    // No roaming.
989    ROAM_NONE = 1;
990
991    // DBDC roaming.
992    ROAM_DBDC = 2;
993
994    // Enterprise roaming.
995    ROAM_ENTERPRISE = 3;
996
997    // User selected roaming.
998    ROAM_USER_SELECTED = 4;
999
1000    // Unrelated.
1001    ROAM_UNRELATED = 5;
1002  }
1003
1004  // Connectivity Level Failure.
1005  enum ConnectivityLevelFailure {
1006
1007    // Failure is unknown.
1008    HLF_UNKNOWN = 0;
1009
1010    // No failure.
1011    HLF_NONE = 1;
1012
1013    // DHCP failure.
1014    HLF_DHCP = 2;
1015
1016    // No internet connection.
1017    HLF_NO_INTERNET = 3;
1018
1019    // No internet connection.
1020    HLF_UNWANTED = 4;
1021  }
1022
1023  // Level 2 failure reason.
1024  enum Level2FailureReason {
1025
1026    // Unknown default
1027    FAILURE_REASON_UNKNOWN = 0;
1028
1029    // The reason code if there is no error during authentication. It could
1030    // also imply that there no authentication in progress.
1031    AUTH_FAILURE_NONE = 1;
1032
1033    // The reason code if there was a timeout authenticating.
1034    AUTH_FAILURE_TIMEOUT = 2;
1035
1036    // The reason code if there was a wrong password while authenticating.
1037    AUTH_FAILURE_WRONG_PSWD = 3;
1038
1039    // The reason code if there was EAP failure while authenticating.
1040    AUTH_FAILURE_EAP_FAILURE = 4;
1041
1042    // The reason code if the AP can no longer accept new clients.
1043    ASSOCIATION_REJECTION_AP_UNABLE_TO_HANDLE_NEW_STA = 5;
1044
1045    // The reason code if AP disconnects STA during the connecting state.
1046    DISCONNECTION_NON_LOCAL = 6;
1047
1048    // The reason code if a user rejects this connection.
1049    AUTH_FAILURE_REJECTED_BY_USER = 7;
1050
1051    // The reason code if an insecure Enterprise connection requires user's approval
1052    DISCONNECTED_USER_APPROVAL_NEEDED = 8;
1053  }
1054
1055  // Entity that recommended connecting to this network.
1056  enum ConnectionNominator {
1057    // Unknown nominator
1058    NOMINATOR_UNKNOWN = 0;
1059
1060    // User selected network manually
1061    NOMINATOR_MANUAL = 1;
1062
1063    // Saved network
1064    NOMINATOR_SAVED = 2;
1065
1066    // Suggestion API
1067    NOMINATOR_SUGGESTION = 3;
1068
1069    // Passpoint
1070    NOMINATOR_PASSPOINT = 4;
1071
1072    // Carrier suggestion
1073    NOMINATOR_CARRIER = 5;
1074
1075    // External scorer
1076    NOMINATOR_EXTERNAL_SCORED = 6;
1077
1078    // Network Specifier
1079    NOMINATOR_SPECIFIER = 7;
1080
1081    // User connected choice override
1082    NOMINATOR_SAVED_USER_CONNECT_CHOICE = 8;
1083
1084    // Open Network Available Pop-up
1085    NOMINATOR_OPEN_NETWORK_AVAILABLE = 9;
1086  }
1087
1088  enum NetworkType {
1089    // Unknown network type
1090    TYPE_UNKNOWN = 0;
1091
1092    // WPA2 network
1093    TYPE_WPA2 = 1;
1094
1095    // WPA3 network
1096    TYPE_WPA3 = 2;
1097
1098    // Passpoint network
1099    TYPE_PASSPOINT = 3;
1100
1101    // EAP network, excluding passpoint
1102    TYPE_EAP = 4;
1103
1104    // OWE network
1105    TYPE_OWE = 5;
1106
1107    // Open network
1108    TYPE_OPEN = 6;
1109
1110    // WAPI network
1111    TYPE_WAPI = 7;
1112  }
1113
1114  enum NetworkCreator {
1115    // This network is created by an unknown app.
1116    CREATOR_UNKNOWN = 0;
1117
1118    // This network is created by the user.
1119    CREATOR_USER = 1;
1120
1121    // This network is created by a carrier app.
1122    CREATOR_CARRIER = 2;
1123  }
1124
1125  // Start time of the connection, in milliseconds since Unix epoch (1970-01-01).
1126  optional int64 start_time_millis = 1 [deprecated=true]; // [(datapol.semantic_type) = ST_TIMESTAMP];
1127
1128  // Start time of the connection, in milliseconds since device boot
1129  optional int64 start_time_since_boot_millis = 28 [default = 0];
1130
1131  // Duration to connect.
1132  optional int32 duration_taken_to_connect_millis = 2;
1133
1134  // Router information.
1135  optional RouterFingerPrint router_fingerprint = 3;
1136
1137  // RSSI at the start of the connection.
1138  optional int32 signal_strength = 4;
1139
1140  // Roam Type.
1141  optional RoamType roam_type = 5;
1142
1143  // Result of the connection.
1144  optional int32 connection_result = 6;
1145
1146  // Reasons for level 2 failure (needs to be coordinated with wpa-supplicant).
1147  optional int32 level_2_failure_code = 7;
1148
1149  // Failures that happen at the connectivity layer.
1150  optional ConnectivityLevelFailure connectivity_level_failure_code = 8;
1151
1152  // Has bug report been taken.
1153  optional bool automatic_bug_report_taken = 9;
1154
1155  // Connection is using locally generated random MAC address.
1156  optional bool use_randomized_mac = 10 [default = false];
1157
1158  // Who chose to connect.
1159  optional ConnectionNominator connection_nominator = 11;
1160
1161  // The currently running network selector when this connection event occurred.
1162  optional int32 network_selector_experiment_id = 12;
1163
1164  // Breakdown of level_2_failure_code with more detailed reason.
1165  optional Level2FailureReason level_2_failure_reason = 13
1166          [default = FAILURE_REASON_UNKNOWN];
1167
1168  // Connection is using an aggressively generated random MAC address.
1169  optional bool use_aggressive_mac = 14;
1170
1171  // Number of BSSIDs for this network that were excluded from network selection.
1172  optional int32 num_bssid_in_blocklist = 15;
1173
1174  // The type of network for this connection.
1175  optional NetworkType network_type = 16;
1176
1177  // UID of the app that created this network.
1178  optional NetworkCreator network_creator = 17;
1179
1180  // Whether the screen is on when the connection event starts
1181  optional bool screen_on = 18;
1182
1183  // Number of consecutive connection failures with the same SSID at high RSSI
1184  // before current connection event. Any connection failure at low RSSI in the
1185  // middle won't break the streak count. The count is cleared after
1186  // a network disconnection event.
1187  optional int32 num_consecutive_connection_failure = 19 [default = -1];
1188
1189  // Indicates if the profile used for the connection was provisioned by Passpoint OSU server
1190  optional bool is_osu_provisioned = 20;
1191
1192  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
1193  // ConnectionEvent belongs to when multiple interfaces are active concurrently.
1194  optional string interface_name = 27;
1195
1196  // The role of the wireless interface at the start of the connection.
1197  // Gives more information on what purpose this interface is used for.
1198  optional ClientRole interface_role = 29;
1199
1200  // Indicates if the profile used for the connection is carrier merged.
1201  optional bool is_carrier_merged = 30;
1202
1203  // Indicates if this was the first connection event after boot
1204  optional bool is_first_connection_after_boot = 31;
1205}
1206
1207// Number of occurrences of a specific RSSI poll rssi value
1208message RssiPollCount {
1209  // RSSI
1210  optional int32 rssi = 1;
1211
1212  // Number of RSSI polls with 'rssi'
1213  optional int32 count = 2;
1214
1215  // Beacon frequency of the channel in MHz
1216  optional int32 frequency = 3;
1217}
1218
1219// Number of occurrences of a specific alert reason value
1220message AlertReasonCount {
1221  // Alert reason
1222  optional int32 reason = 1;
1223
1224  // Number of alerts with |reason|.
1225  optional int32 count = 2;
1226}
1227
1228// Counts the number of instances of a specific Wifi Score calculated by WifiScoreReport
1229message WifiScoreCount {
1230  // Wifi Score
1231  optional int32 score = 1;
1232
1233  // Number of Wifi score reports with this score
1234  optional int32 count = 2;
1235}
1236
1237// Counts the number of instances of a specific Wifi Usability Score
1238message WifiUsabilityScoreCount {
1239  // Wifi Usability Score
1240  optional int32 score = 1;
1241
1242  // Number of Wifi score reports with this score
1243  optional int32 count = 2;
1244}
1245
1246// Number of occurrences of a specific link speed (Mbps)
1247// and sum of rssi (dBm) and rssi^2 (dBm^2)
1248message LinkSpeedCount {
1249  // Link speed (Mbps)
1250  optional int32 link_speed_mbps = 1;
1251
1252  // Number of RSSI polls with link_speed
1253  optional int32 count = 2;
1254
1255  // Sum of absolute values of rssi values (dBm)
1256  optional int32 rssi_sum_dbm = 3;
1257
1258  // Sum of squares of rssi values (dBm^2)
1259  optional int64 rssi_sum_of_squares_dbm_sq = 4;
1260}
1261
1262
1263// Number of occurrences of Soft AP session durations
1264message SoftApDurationBucket {
1265  // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec)
1266  // The (inclusive) lower bound of Soft AP session duration represented by this bucket
1267  optional int32 duration_sec = 1;
1268
1269  // The size of this bucket
1270  optional int32 bucket_size_sec = 2;
1271
1272  // Number of soft AP session durations that fit into this bucket
1273  optional int32 count = 3;
1274}
1275
1276// Number of occurrences of a soft AP session return code
1277message SoftApReturnCodeCount {
1278
1279  enum SoftApStartResult {
1280
1281    // SoftApManager return code unknown
1282    SOFT_AP_RETURN_CODE_UNKNOWN = 0;
1283
1284    // SoftAp started successfully
1285    SOFT_AP_STARTED_SUCCESSFULLY = 1;
1286
1287    // Catch all for failures with no specific failure reason
1288    SOFT_AP_FAILED_GENERAL_ERROR = 2;
1289
1290    // SoftAp failed to start due to NO_CHANNEL error
1291    SOFT_AP_FAILED_NO_CHANNEL = 3;
1292
1293    // SoftAp failed to start due to unsupported configuration error
1294    SOFT_AP_FAILED_UNSUPPORTED_CONFIGURATION = 4;
1295  }
1296
1297  // Historical, no longer used for writing as of 01/2017.
1298  optional int32 return_code = 1 [deprecated = true];
1299
1300  // Occurrences of this soft AP return code
1301  optional int32 count = 2;
1302
1303  // Result of attempt to start SoftAp
1304  optional SoftApStartResult start_result = 3;
1305}
1306
1307message StaEvent {
1308  message ConfigInfo {
1309    // The set of key management protocols supported by this configuration.
1310    optional uint32 allowed_key_management = 1 [default = 0];
1311
1312    // The set of security protocols supported by this configuration.
1313    optional uint32 allowed_protocols = 2 [default = 0];
1314
1315    // The set of authentication protocols supported by this configuration.
1316    optional uint32 allowed_auth_algorithms = 3 [default = 0];
1317
1318    // The set of pairwise ciphers for WPA supported by this configuration.
1319    optional uint32 allowed_pairwise_ciphers = 4 [default = 0];
1320
1321    // The set of group ciphers supported by this configuration.
1322    optional uint32 allowed_group_ciphers = 5;
1323
1324    // Is this a 'hidden network'
1325    optional bool hidden_ssid = 6;
1326
1327    // Is this a Hotspot 2.0 / passpoint network
1328    optional bool is_passpoint = 7;
1329
1330    // Is this an 'ephemeral' network (Not in saved network list, recommended externally)
1331    optional bool is_ephemeral = 8;
1332
1333    // Has a successful connection ever been established using this WifiConfiguration
1334    optional bool has_ever_connected = 9;
1335
1336    // RSSI of the scan result candidate associated with this WifiConfiguration
1337    optional int32 scan_rssi = 10 [default = -127];
1338
1339    // Frequency of the scan result candidate associated with this WifiConfiguration
1340    optional int32 scan_freq = 11 [default = -1];
1341  }
1342
1343  enum EventType {
1344    // Default/Invalid event
1345    TYPE_UNKNOWN = 0;
1346
1347    // Supplicant Association Rejection event. Code contains the 802.11
1348    TYPE_ASSOCIATION_REJECTION_EVENT = 1;
1349
1350    // Supplicant L2 event,
1351    TYPE_AUTHENTICATION_FAILURE_EVENT = 2;
1352
1353    // Supplicant L2 event
1354    TYPE_NETWORK_CONNECTION_EVENT = 3;
1355
1356    // Supplicant L2 event
1357    TYPE_NETWORK_DISCONNECTION_EVENT = 4;
1358
1359    // Supplicant L2 event
1360    TYPE_SUPPLICANT_STATE_CHANGE_EVENT = 5;
1361
1362    // Supplicant L2 event
1363    TYPE_CMD_ASSOCIATED_BSSID = 6;
1364
1365    // IP Manager successfully completed IP Provisioning
1366    TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL = 7;
1367
1368    // IP Manager failed to complete IP Provisioning
1369    TYPE_CMD_IP_CONFIGURATION_LOST = 8;
1370
1371    // IP Manager lost reachability to network neighbors
1372    TYPE_CMD_IP_REACHABILITY_LOST = 9;
1373
1374    // Indicator that Supplicant is targeting a BSSID for roam/connection
1375    TYPE_CMD_TARGET_BSSID = 10;
1376
1377    // Wifi framework is initiating a connection attempt
1378    TYPE_CMD_START_CONNECT = 11;
1379
1380    // Wifi framework is initiating a roaming connection attempt
1381    TYPE_CMD_START_ROAM = 12;
1382
1383    // SystemAPI connect() command, Settings App
1384    TYPE_CONNECT_NETWORK = 13;
1385
1386    // Network Agent has validated the internet connection (Captive Portal Check success, or user
1387    // validation)
1388    TYPE_NETWORK_AGENT_VALID_NETWORK = 14;
1389
1390    // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect
1391    // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true
1392    TYPE_FRAMEWORK_DISCONNECT = 15;
1393
1394    // The NetworkAgent score for wifi has changed in a way that may impact
1395    // connectivity
1396    TYPE_SCORE_BREACH = 16;
1397
1398    // Framework changed Sta interface MAC address
1399    TYPE_MAC_CHANGE = 17;
1400
1401    // Wifi is turned on
1402    TYPE_WIFI_ENABLED = 18;
1403
1404    // Wifi is turned off
1405    TYPE_WIFI_DISABLED = 19;
1406
1407    // The NetworkAgent Wifi usability score has changed in a way that may
1408    // impact connectivity
1409    TYPE_WIFI_USABILITY_SCORE_BREACH = 20;
1410
1411    // Link probe was performed
1412    TYPE_LINK_PROBE = 21;
1413  }
1414
1415  enum FrameworkDisconnectReason {
1416    // default/none/unknown value
1417    DISCONNECT_UNKNOWN = 0;
1418
1419    // API DISCONNECT
1420    DISCONNECT_API = 1;
1421
1422    // Some framework internal reason (generic)
1423    DISCONNECT_GENERIC = 2;
1424
1425    // Network Agent network validation failed, user signaled network unwanted
1426    DISCONNECT_UNWANTED = 3;
1427
1428    // Roaming timed out
1429    DISCONNECT_ROAM_WATCHDOG_TIMER = 4;
1430
1431    // P2P service requested wifi disconnect
1432    DISCONNECT_P2P_DISCONNECT_WIFI_REQUEST = 5;
1433
1434    // SIM was removed while using a SIM config
1435    DISCONNECT_RESET_SIM_NETWORKS = 6;
1436
1437    // The network being evaluated in Make-Before-Break was disconnected due to no internet.
1438    DISCONNECT_MBB_NO_INTERNET = 7;
1439
1440    // The network has been removed from the database.
1441    DISCONNECT_NETWORK_REMOVED = 8;
1442
1443    // The network has been marked as metered.
1444    DISCONNECT_NETWORK_METERED = 9;
1445
1446    // The network has been disabled temporarily.
1447    DISCONNECT_NETWORK_TEMPORARY_DISABLED = 10;
1448
1449    // The network has been disabled permanently.
1450    DISCONNECT_NETWORK_PERMANENT_DISABLED = 11;
1451
1452    // Carrier offload for this network has been disabled.
1453    DISCONNECT_CARRIER_OFFLOAD_DISABLED = 12;
1454
1455    // Disconnected due to an issue with passpoint terms and conditions URL.
1456    DISCONNECT_PASSPOINT_TAC = 13;
1457
1458    // VCN policy is requesting to tear down the network.
1459    DISCONNECT_VCN_REQUEST = 14;
1460
1461    // Connected to a network that's not found in the database.
1462    DISCONNECT_UNKNOWN_NETWORK = 15;
1463
1464    // The network has been marked as untrusted.
1465    DISCONNECT_NETWORK_UNTRUSTED = 16;
1466
1467    // Wi-Fi 7 support for this network has been enabled or disabled.
1468    DISCONNECT_NETWORK_WIFI7_TOGGLED = 17;
1469  }
1470
1471  // Authentication Failure reasons as reported through the API.
1472  enum AuthFailureReason {
1473    // Unknown default
1474    AUTH_FAILURE_UNKNOWN = 0;
1475
1476    // The reason code if there is no error during authentication. It could also imply that there no
1477    // authentication in progress,
1478    AUTH_FAILURE_NONE = 1;
1479
1480    // The reason code if there was a timeout authenticating.
1481    AUTH_FAILURE_TIMEOUT = 2;
1482
1483    // The reason code if there was a wrong password while authenticating.
1484    AUTH_FAILURE_WRONG_PSWD = 3;
1485
1486    // The reason code if there was EAP failure while authenticating.
1487    AUTH_FAILURE_EAP_FAILURE = 4;
1488  }
1489
1490  // What event was this
1491  optional EventType type = 1;
1492
1493  // 80211 death reason code, relevant to NETWORK_DISCONNECTION_EVENTs
1494  optional int32 reason = 2 [default = -1];
1495
1496  // 80211 Association Status code, relevant to ASSOCIATION_REJECTION_EVENTs
1497  optional int32 status = 3 [default = -1];
1498
1499  // Designates whether a NETWORK_DISCONNECT_EVENT was by the STA or AP
1500  optional bool local_gen = 4 [default = false];
1501
1502  // Network information from the WifiConfiguration of a framework initiated connection attempt
1503  optional ConfigInfo config_info = 5;
1504
1505  // RSSI from the last rssi poll (Only valid for active connections)
1506  optional int32 last_rssi = 6 [default = -127];
1507
1508  // Link speed from the last rssi poll (Only valid for active connections)
1509  optional int32 last_link_speed = 7 [default = -1];
1510
1511  // Frequency from the last rssi poll (Only valid for active connections)
1512  optional int32 last_freq = 8 [default = -1];
1513
1514  // Enum used to define bit positions in the supplicant_state_change_bitmask
1515  // See {@code frameworks/base/wifi/java/android/net/wifi/SupplicantState.java} for documentation
1516  enum SupplicantState {
1517    STATE_DISCONNECTED = 0;
1518
1519    STATE_INTERFACE_DISABLED = 1;
1520
1521    STATE_INACTIVE = 2;
1522
1523    STATE_SCANNING = 3;
1524
1525    STATE_AUTHENTICATING = 4;
1526
1527    STATE_ASSOCIATING = 5;
1528
1529    STATE_ASSOCIATED = 6;
1530
1531    STATE_FOUR_WAY_HANDSHAKE = 7;
1532
1533    STATE_GROUP_HANDSHAKE = 8;
1534
1535    STATE_COMPLETED = 9;
1536
1537    STATE_DORMANT = 10;
1538
1539    STATE_UNINITIALIZED = 11;
1540
1541    STATE_INVALID = 12;
1542  }
1543
1544  // Bit mask of all supplicant state changes that occurred since the last event
1545  optional uint32 supplicant_state_changes_bitmask = 9 [default = 0];
1546
1547  // The number of milliseconds that have elapsed since the device booted
1548  optional int64 start_time_millis = 10 [default = 0];
1549
1550  optional FrameworkDisconnectReason framework_disconnect_reason = 11 [default = DISCONNECT_UNKNOWN];
1551
1552  // Flag which indicates if an association rejection event occurred due to a timeout
1553  optional bool association_timed_out = 12 [default = false];
1554
1555  // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code)
1556  optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN];
1557
1558  // NetworkAgent score of connected wifi
1559  optional int32 last_score = 14 [default = -1];
1560
1561  // NetworkAgent Wifi usability score of connected wifi
1562  optional int32 last_wifi_usability_score = 15 [default = -1];
1563
1564  // Prediction horizon (in second) of Wifi usability score provided by external
1565  // system app
1566  optional int32 last_prediction_horizon_sec = 16 [default = -1];
1567
1568  // Only valid if event type == TYPE_LINK_PROBE.
1569  // true if link probe succeeded, false otherwise.
1570  optional bool link_probe_was_success = 17;
1571
1572  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == true.
1573  // Elapsed time, in milliseconds, of a successful link probe.
1574  optional int32 link_probe_success_elapsed_time_ms = 18;
1575
1576  // Only valid if event type == TYPE_LINK_PROBE and link_probe_was_success == false.
1577  // Failure reason for an unsuccessful link probe.
1578  optional LinkProbeStats.LinkProbeFailureReason link_probe_failure_reason = 19;
1579
1580  // Number of bytes transmitted across mobile networks since device boot.
1581  optional int64 mobile_tx_bytes = 20 [default = -1];
1582
1583  // // Number of bytes received across mobile networks since device boot.
1584  optional int64 mobile_rx_bytes = 21 [default = -1];
1585
1586  // Number of bytes transmitted since device boot.
1587  optional int64 total_tx_bytes = 22 [default = -1];
1588
1589  // Number of bytes received since device boot.
1590  optional int64 total_rx_bytes = 23 [default = -1];
1591
1592  // Whether screen is on when the event happens
1593  optional bool screen_on = 24;
1594
1595  // Whether cellular data network is available
1596  optional bool is_cellular_data_available = 25;
1597
1598  // Whether Adaptive Connectivity is enabled
1599  optional bool is_adaptive_connectivity_enabled = 26;
1600
1601  // The wireless interface name e.g. "wlan0", "wlan1". Used to distinguish which event stream this
1602  // StaEvent belongs to when multiple interfaces are active concurrently.
1603  optional string interface_name = 27;
1604
1605  // The role of the wireless interface
1606  // Gives more information on what purpose this interface is used for.
1607  optional ClientRole interface_role = 28;
1608}
1609
1610// Wi-Fi Aware metrics
1611message WifiAwareLog {
1612  // total number of unique apps that used Aware (measured on attach)
1613  optional int32 num_apps = 1;
1614
1615  // total number of unique apps that used an identity callback when attaching
1616  optional int32 num_apps_using_identity_callback = 2;
1617
1618  // maximum number of attaches for an app
1619  optional int32 max_concurrent_attach_sessions_in_app = 3;
1620
1621  // histogram of attach request results
1622  repeated NanStatusHistogramBucket histogram_attach_session_status = 4;
1623
1624  // maximum number of concurrent publish sessions in a single app
1625  optional int32 max_concurrent_publish_in_app = 5;
1626
1627  // maximum number of concurrent subscribe sessions in a single app
1628  optional int32 max_concurrent_subscribe_in_app = 6;
1629
1630  // maximum number of concurrent discovery (publish+subscribe) sessions in a single app
1631  optional int32 max_concurrent_discovery_sessions_in_app = 7;
1632
1633  // maximum number of concurrent publish sessions in the system
1634  optional int32 max_concurrent_publish_in_system = 8;
1635
1636  // maximum number of concurrent subscribe sessions in the system
1637  optional int32 max_concurrent_subscribe_in_system = 9;
1638
1639  // maximum number of concurrent discovery (publish+subscribe) sessions in the system
1640  optional int32 max_concurrent_discovery_sessions_in_system = 10;
1641
1642  // histogram of publish request results
1643  repeated NanStatusHistogramBucket histogram_publish_status = 11;
1644
1645  // histogram of subscribe request results
1646  repeated NanStatusHistogramBucket histogram_subscribe_status = 12;
1647
1648  // number of unique apps which experienced a discovery session creation failure due to lack of
1649  // resources
1650  optional int32 num_apps_with_discovery_session_failure_out_of_resources = 13;
1651
1652  // histogram of create ndp request results
1653  repeated NanStatusHistogramBucket histogram_request_ndp_status = 14;
1654
1655  // histogram of create ndp out-of-band (OOB) request results
1656  repeated NanStatusHistogramBucket histogram_request_ndp_oob_status = 15;
1657
1658  // maximum number of concurrent active data-interfaces (NDI) in a single app
1659  optional int32 max_concurrent_ndi_in_app = 19;
1660
1661  // maximum number of concurrent active data-interfaces (NDI) in the system
1662  optional int32 max_concurrent_ndi_in_system = 20;
1663
1664  // maximum number of concurrent data-paths (NDP) in a single app
1665  optional int32 max_concurrent_ndp_in_app = 21;
1666
1667  // maximum number of concurrent data-paths (NDP) in the system
1668  optional int32 max_concurrent_ndp_in_system = 22;
1669
1670  // maximum number of concurrent secure data-paths (NDP) in a single app
1671  optional int32 max_concurrent_secure_ndp_in_app = 23;
1672
1673  // maximum number of concurrent secure data-paths (NDP) in the system
1674  optional int32 max_concurrent_secure_ndp_in_system = 24;
1675
1676  // maximum number of concurrent data-paths (NDP) per data-interface (NDI)
1677  optional int32 max_concurrent_ndp_per_ndi = 25;
1678
1679  // histogram of durations of Aware being available
1680  repeated HistogramBucket histogram_aware_available_duration_ms = 26;
1681
1682  // histogram of durations of Aware being enabled
1683  repeated HistogramBucket histogram_aware_enabled_duration_ms = 27;
1684
1685  // histogram of duration (in ms) of attach sessions
1686  repeated HistogramBucket histogram_attach_duration_ms = 28;
1687
1688  // histogram of duration (in ms) of publish sessions
1689  repeated HistogramBucket histogram_publish_session_duration_ms = 29;
1690
1691  // histogram of duration (in ms) of subscribe sessions
1692  repeated HistogramBucket histogram_subscribe_session_duration_ms = 30;
1693
1694  // histogram of duration (in ms) of data-paths (NDP)
1695  repeated HistogramBucket histogram_ndp_session_duration_ms = 31;
1696
1697  // histogram of usage (in MB) of data-paths (NDP)
1698  repeated HistogramBucket histogram_ndp_session_data_usage_mb = 32;
1699
1700  // histogram of usage (in MB) of data-path creation time (in ms) measured as request -> confirm
1701  repeated HistogramBucket histogram_ndp_creation_time_ms = 33;
1702
1703  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: minimum
1704  optional int64 ndp_creation_time_ms_min = 34;
1705
1706  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: maximum
1707  optional int64 ndp_creation_time_ms_max = 35;
1708
1709  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum
1710  optional int64 ndp_creation_time_ms_sum = 36;
1711
1712  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: sum of sq
1713  optional int64 ndp_creation_time_ms_sum_of_sq = 37;
1714
1715  // statistics for data-path (NDP) creation time (in ms) measured as request -> confirm: number of
1716  // samples
1717  optional int64 ndp_creation_time_ms_num_samples = 38;
1718
1719  // total time within the logging window that aware was available
1720  optional int64 available_time_ms = 39;
1721
1722  // total time within the logging window that aware was enabled
1723  optional int64 enabled_time_ms = 40;
1724
1725  // maximum number of concurrent publish sessions enabling ranging in a single app
1726  optional int32 max_concurrent_publish_with_ranging_in_app = 41;
1727
1728  // maximum number of concurrent subscribe sessions specifying a geofence in a single app
1729  optional int32 max_concurrent_subscribe_with_ranging_in_app = 42;
1730
1731  // maximum number of concurrent publish sessions enabling ranging in the system
1732  optional int32 max_concurrent_publish_with_ranging_in_system = 43;
1733
1734  // maximum number of concurrent subscribe sessions specifying a geofence in the system
1735  optional int32 max_concurrent_subscribe_with_ranging_in_system = 44;
1736
1737  // histogram of subscribe session geofence minimum (only when specified)
1738  repeated HistogramBucket histogram_subscribe_geofence_min = 45;
1739
1740  // histogram of subscribe session geofence maximum (only when specified)
1741  repeated HistogramBucket histogram_subscribe_geofence_max = 46;
1742
1743  // total number of subscribe sessions which enabled ranging
1744  optional int32 num_subscribes_with_ranging = 47;
1745
1746  // total number of matches (service discovery indication) with ranging provided
1747  optional int32 num_matches_with_ranging = 48;
1748
1749  // total number of matches (service discovery indication) for service discovery with ranging
1750  // enabled which did not trigger ranging
1751  optional int32 num_matches_without_ranging_for_ranging_enabled_subscribes = 49;
1752
1753  // Total number of different types of NDP requests
1754  repeated NdpRequestTypeHistogramBucket histogram_ndp_request_type = 50;
1755
1756  // Histogram bucket for Wi-Fi Aware logs. Range is [start, end)
1757  message HistogramBucket {
1758    // lower range of the bucket (inclusive)
1759    optional int64 start = 1;
1760
1761    // upper range of the bucket (exclusive)
1762    optional int64 end = 2;
1763
1764    // number of samples in the bucket
1765    optional int32 count = 3;
1766  }
1767
1768  // Status of various NAN operations
1769  enum NanStatusTypeEnum {
1770    // constant to be used by proto
1771    UNKNOWN = 0;
1772
1773    // NAN operation succeeded
1774    SUCCESS = 1;
1775
1776    // NAN Discovery Engine/Host driver failures
1777    INTERNAL_FAILURE = 2;
1778
1779    // NAN OTA failures
1780    PROTOCOL_FAILURE = 3;
1781
1782    // The publish/subscribe discovery session id is invalid
1783    INVALID_SESSION_ID = 4;
1784
1785    // Out of resources to fufill request
1786    NO_RESOURCES_AVAILABLE = 5;
1787
1788    // Invalid arguments passed
1789    INVALID_ARGS = 6;
1790
1791    // Invalid peer id
1792    INVALID_PEER_ID = 7;
1793
1794    // Invalid NAN data-path (ndp) id
1795    INVALID_NDP_ID = 8;
1796
1797    // Attempting to enable NAN when not available, e.g. wifi is disabled
1798    NAN_NOT_ALLOWED = 9;
1799
1800    // Over the air ACK not received
1801    NO_OTA_ACK = 10;
1802
1803    // Attempting to enable NAN when already enabled
1804    ALREADY_ENABLED = 11;
1805
1806    // Can't queue tx followup message foor transmission
1807    FOLLOWUP_TX_QUEUE_FULL = 12;
1808
1809    // Unsupported concurrency of NAN and another feature - NAN disabled
1810    UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 13;
1811
1812    // Unknown NanStatusType
1813    UNKNOWN_HAL_STATUS = 14;
1814  }
1815
1816  // Histogram bucket for Wi-Fi Aware (NAN) status.
1817  message NanStatusHistogramBucket {
1818    // status type defining the bucket
1819    optional NanStatusTypeEnum nan_status_type = 1;
1820
1821    // number of samples in the bucket
1822    optional int32 count = 2;
1823  }
1824
1825  enum NdpRequestTypeEnum {
1826    // Unknown Type
1827    NETWORK_SPECIFIER_TYPE_UNKNOWN = 0;
1828
1829    // TYPE: in band, specific peer: role, client_id, session_id, peer_id, pmk/passphrase optional
1830    NETWORK_SPECIFIER_TYPE_IB = 1;
1831
1832    // TYPE: in band, any peer: role, client_id, session_id, pmk/passphrase optional
1833    NETWORK_SPECIFIER_TYPE_IB_ANY_PEER = 2;
1834
1835    //TYPE: out-of-band: role, client_id, peer_mac, pmk/passphrase optional
1836    NETWORK_SPECIFIER_TYPE_OOB = 3;
1837
1838    //TYPE: out-of-band, any peer: role, client_id, pmk/passphrase optional
1839    NETWORK_SPECIFIER_TYPE_OOB_ANY_PEER = 4;
1840
1841  }
1842
1843  message NdpRequestTypeHistogramBucket {
1844    // request type defining the bucket
1845    optional NdpRequestTypeEnum ndp_request_type = 1;
1846    // number of samples in the bucket
1847    optional int32 count = 2;
1848
1849  }
1850}
1851
1852// Data point used to build 'Number of Connectable Network' histograms
1853message NumConnectableNetworksBucket {
1854  // Number of connectable networks seen in a scan result
1855  optional int32 num_connectable_networks = 1 [default = 0];
1856
1857  // Number of scan results with num_connectable_networks
1858  optional int32 count = 2 [default = 0];
1859}
1860
1861// Pno scan metrics
1862// Here "Pno Scan" refers to the session of offloaded scans, these metrics count the result of a
1863// single session, and not the individual scans within that session.
1864message PnoScanMetrics {
1865  // Total number of attempts to offload pno scans
1866  optional int32 num_pno_scan_attempts = 1;
1867
1868  // Total number of pno scans failed
1869  optional int32 num_pno_scan_failed = 2;
1870
1871  // Number of pno scans started successfully over offload
1872  optional int32 num_pno_scan_started_over_offload = 3;
1873
1874  // Number of pno scans failed over offload
1875  optional int32 num_pno_scan_failed_over_offload = 4;
1876
1877  // Total number of pno scans that found any network
1878  optional int32 num_pno_found_network_events = 5;
1879}
1880
1881// Number of occurrences for a particular "Connect to Network" Notification or
1882// notification Action.
1883message ConnectToNetworkNotificationAndActionCount {
1884
1885  // "Connect to Network" notifications
1886  enum Notification {
1887
1888    // Default
1889    NOTIFICATION_UNKNOWN = 0;
1890
1891    // Initial notification with a recommended network.
1892    NOTIFICATION_RECOMMEND_NETWORK = 1;
1893
1894    // Notification when connecting to the recommended network.
1895    NOTIFICATION_CONNECTING_TO_NETWORK = 2;
1896
1897    // Notification when successfully connected to the network.
1898    NOTIFICATION_CONNECTED_TO_NETWORK = 3;
1899
1900    // Notification when failed to connect to network.
1901    NOTIFICATION_FAILED_TO_CONNECT = 4;
1902  }
1903
1904  // "Connect to Network" notification actions
1905  enum Action {
1906
1907    // Default
1908    ACTION_UNKNOWN = 0;
1909
1910    // User dismissed the "Connect to Network" notification.
1911    ACTION_USER_DISMISSED_NOTIFICATION = 1;
1912
1913    // User tapped action button to connect to recommended network.
1914    ACTION_CONNECT_TO_NETWORK = 2;
1915
1916    // User tapped action button to open Wi-Fi Settings.
1917    ACTION_PICK_WIFI_NETWORK = 3;
1918
1919    // User tapped "Failed to connect" notification to open Wi-Fi Settings.
1920    ACTION_PICK_WIFI_NETWORK_AFTER_CONNECT_FAILURE = 4;
1921  }
1922
1923  // Recommenders of the "Connect to Network" notification
1924  enum Recommender {
1925
1926    // Default.
1927    RECOMMENDER_UNKNOWN = 0;
1928
1929    // Open Network Available recommender.
1930    RECOMMENDER_OPEN = 1;
1931  }
1932
1933  // Notification Type.
1934  optional Notification notification = 1;
1935
1936  // Action Type.
1937  optional Action action = 2;
1938
1939  // Recommender Type.
1940  optional Recommender recommender = 3;
1941
1942  // Occurrences of this action.
1943  optional int32 count = 4;
1944}
1945
1946// SoftAP event tracking sessions and client counts
1947message SoftApConnectedClientsEvent {
1948
1949  // Soft AP event Types
1950  enum SoftApEventType {
1951
1952    // Soft AP in single AP mode is Up and ready for use.
1953    // The sequence of the events in single AP mode:
1954    // SOFT_AP_UP -> ... (ex:NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
1955    SOFT_AP_UP = 0;
1956
1957    // Soft AP in single/dual AP mode is Down.
1958    SOFT_AP_DOWN = 1;
1959
1960    // Number of connected soft AP clients has changed.
1961    NUM_CLIENTS_CHANGED = 2;
1962
1963    // Soft AP in dual AP mode is Up and ready for use.
1964    // There are two DUAL_AP_BOTH_INSTANCES_UP events in dual AP mode for
1965    // storing each instance information.
1966    // The sequence of the events in dual AP mode:
1967    // DUAL_AP_BOTH_INSTANCES_UP -> DUAL_AP_BOTH_INSTANCES_UP
1968    // ... (ex: DUAL_AP_ONE_INSTANCE_DOWN or NUM_CLIENTS_CHANGED) -> SOFT_AP_DOWN
1969    DUAL_AP_BOTH_INSTANCES_UP = 3;
1970
1971    // One of the dual AP instance is Down.
1972    DUAL_AP_ONE_INSTANCE_DOWN = 4;
1973  }
1974
1975  // Soft AP channel bandwidth types
1976  enum ChannelBandwidth {
1977
1978    BANDWIDTH_INVALID = 0;
1979
1980    BANDWIDTH_20_NOHT = 1;
1981
1982    BANDWIDTH_20 = 2;
1983
1984    BANDWIDTH_40 = 3;
1985
1986    BANDWIDTH_80 = 4;
1987
1988    BANDWIDTH_80P80 = 5;
1989
1990    BANDWIDTH_160 = 6;
1991  }
1992
1993  // The operational mode  of the Soft AP.
1994  enum Generation {
1995
1996    WIFI_STANDARD_UNKNOWN = 0;
1997
1998    WIFI_STANDARD_LEGACY = 1;
1999
2000    WIFI_STANDARD_11N = 4;
2001
2002    WIFI_STANDARD_11AC = 5;
2003
2004    WIFI_STANDARD_11AX = 6;
2005  }
2006
2007  // Type of event being recorded
2008  optional SoftApEventType event_type = 1;
2009
2010  // Time passed since last boot in milliseconds
2011  optional int64 time_stamp_millis = 2;
2012
2013  // Number of connected clients if event_type is NUM_CLIENTS_CHANGED, otherwise zero.
2014  optional int32 num_connected_clients = 3;
2015
2016  // Channel frequency used for Soft AP
2017  optional int32 channel_frequency = 4;
2018
2019  // Channel bandwidth used for Soft AP
2020  optional ChannelBandwidth channel_bandwidth = 5;
2021
2022  // Maximum number of client setting in SoftApConfiguration
2023  optional int32 max_num_clients_setting_in_softap_configuration = 6;
2024
2025  // Maximum number of client setting in SoftApCapability
2026  optional int32 max_num_clients_setting_in_softap_capability = 7;
2027
2028  // Auto shutdown timeout setting in SoftApConfiguration
2029  optional int64 shutdown_timeout_setting_in_softap_configuration = 8;
2030
2031  // Framework default auto shutdown timeout setting
2032  optional int64 default_shutdown_timeout_setting = 9;
2033
2034  // Indicates if user enabled the client_control
2035  optional bool client_control_is_enabled = 10;
2036
2037  // The operational mode of the AP
2038  optional Generation generation = 11;
2039
2040  // Number of connected clients on current frequency if event_type is NUM_CLIENTS_CHANGED,
2041  // otherwise zero. On dual AP, it may be different from num_connected_clients
2042  // because there are two instances and num_connected_clients is used to record
2043  // total number of the clients. But num_connected_clients_on_current_frequency
2044  // is used to record the number of the clients on specific instance. (depends
2045  // on channel_frequency)
2046  optional int32 num_connected_clients_on_current_frequency = 12;
2047}
2048
2049// Power stats for Wifi
2050message WifiPowerStats {
2051
2052  // Duration of log (ms)
2053  optional int64 logging_duration_ms = 1;
2054
2055  // Energy consumed by wifi (mAh)
2056  optional double energy_consumed_mah = 2;
2057
2058  // Amount of time wifi is in idle (ms)
2059  optional int64 idle_time_ms = 3;
2060
2061  // Amount of time wifi is in rx (ms)
2062  optional int64 rx_time_ms = 4;
2063
2064  // Amount of time wifi is in tx (ms)
2065  optional int64 tx_time_ms = 5;
2066
2067  // Amount of time kernel is active because of wifi data (ms)
2068  optional int64 wifi_kernel_active_time_ms = 6;
2069
2070  // Number of packets sent (tx)
2071  optional int64 num_packets_tx = 7;
2072
2073  // Number of bytes sent (tx)
2074  optional int64 num_bytes_tx = 8;
2075
2076  // Number of packets received (rx)
2077  optional int64 num_packets_rx = 9;
2078
2079  // Number of bytes sent (rx)
2080  optional int64 num_bytes_rx = 10;
2081
2082  // Amount of time wifi is in sleep (ms)
2083  optional int64 sleep_time_ms = 11;
2084
2085  // Amount of time wifi is scanning (ms)
2086  optional int64 scan_time_ms = 12;
2087
2088  // Actual monitored rail energy consumed by wifi (mAh)
2089  optional double monitored_rail_energy_consumed_mah = 13;
2090}
2091
2092// Metrics for Wifi Wake
2093message WifiWakeStats {
2094  // An individual session for Wifi Wake
2095  message Session {
2096    // A Wifi Wake lifecycle event
2097    message Event {
2098      // Elapsed time in milliseconds since start of session.
2099      optional int64 elapsed_time_millis = 1;
2100
2101      // Number of scans that have occurred since start of session.
2102      optional int32 elapsed_scans = 2;
2103    }
2104
2105    // Start time of session in milliseconds.
2106    optional int64 start_time_millis = 1;
2107
2108    // The number of networks the lock was provided with at start.
2109    optional int32 locked_networks_at_start = 2;
2110
2111    // The number of networks in the lock at the time of the initialize event. Only valid if
2112    // initialize_event is recorded.
2113    optional int32 locked_networks_at_initialize = 6;
2114
2115    // Event for fully initializing the WakeupLock (i.e. WakeupLock is "locked").
2116    optional Event initialize_event = 7;
2117
2118    // Event for unlocking the WakeupLock. Does not occur if lock was initialized with 0 networks.
2119    optional Event unlock_event = 3;
2120
2121    // Event for triggering wakeup.
2122    optional Event wakeup_event = 4;
2123
2124    // Event for WifiWake reset event. This event marks the end of a session.
2125    optional Event reset_event = 5;
2126  }
2127
2128  // Total number of sessions for Wifi Wake.
2129  optional int32 num_sessions = 1;
2130
2131  // Session information for every Wifi Wake session (up to a maximum of 10).
2132  repeated Session sessions = 2;
2133
2134  // Number of ignored calls to start (due to WakeupController already being active).
2135  optional int32 num_ignored_starts = 3;
2136
2137  // Number of Wifi Wake sessions that have recorded wakeup events.
2138  optional int32 num_wakeups = 4;
2139}
2140
2141// Metrics for Wi-Fi RTT
2142message WifiRttLog {
2143  // Number of RTT request API calls
2144  optional int32 num_requests = 1;
2145
2146  // Histogram of RTT operation overall status
2147  repeated RttOverallStatusHistogramBucket histogram_overall_status = 2;
2148
2149  // RTT to Access Points metrics
2150  optional RttToPeerLog rtt_to_ap = 3;
2151
2152  // RTT to Wi-Fi Aware peers metrics
2153  optional RttToPeerLog rtt_to_aware = 4;
2154
2155  // Histogram of how long a measurement with only AP take.
2156  repeated HistogramBucket histogram_measurement_duration_ap_only = 5;
2157
2158  // Histogram of how long a measurement with aware peer included take.
2159  repeated HistogramBucket histogram_measurement_duration_with_aware = 6;
2160
2161  // Metrics for a RTT to Peer (peer = AP or Wi-Fi Aware)
2162  message RttToPeerLog {
2163    // Total number of API calls
2164    optional int32 num_requests = 1;
2165
2166    // Total number of individual requests
2167    optional int32 num_individual_requests = 2;
2168
2169    // Total number of apps which requested RTT
2170    optional int32 num_apps = 3;
2171
2172    // Histogram of total number of RTT requests by an app (WifiRttManager#startRanging)
2173    repeated HistogramBucket histogram_num_requests_per_app = 4;
2174
2175    // Histogram of number of peers in a single RTT request (RangingRequest entries)
2176    repeated HistogramBucket histogram_num_peers_per_request = 5;
2177
2178    // Histogram of status of individual RTT operations (RangingResult entries)
2179    repeated RttIndividualStatusHistogramBucket histogram_individual_status = 6;
2180
2181    // Histogram of measured distances (RangingResult entries)
2182    repeated HistogramBucket histogram_distance = 7;
2183
2184    // Histogram of interval of RTT requests by an app (WifiRttManager#startRanging)
2185    repeated HistogramBucket histogram_request_interval_ms = 8;
2186  }
2187
2188  // Histogram bucket for Wi-Fi RTT logs. Range is [start, end)
2189  message HistogramBucket {
2190    // lower range of the bucket (inclusive)
2191    optional int64 start = 1;
2192
2193    // upper range of the bucket (exclusive)
2194    optional int64 end = 2;
2195
2196    // number of samples in the bucket
2197    optional int32 count = 3;
2198  }
2199
2200  // Status codes for overall RTT operation
2201  enum RttOverallStatusTypeEnum {
2202    // constant to be used by proto
2203    OVERALL_UNKNOWN = 0;
2204
2205    // RTT operation succeeded (individual results may still fail)
2206    OVERALL_SUCCESS = 1;
2207
2208    // RTT operation failed (unspecified reason)
2209    OVERALL_FAIL = 2;
2210
2211    // RTT operation failed since RTT was not available (e.g. Airplane mode)
2212    OVERALL_RTT_NOT_AVAILABLE = 3;
2213
2214    // RTT operation timed-out: didn't receive response from HAL in expected time
2215    OVERALL_TIMEOUT = 4;
2216
2217    // RTT operation aborted since the app is spamming the service
2218    OVERALL_THROTTLE = 5;
2219
2220    // RTT request to HAL received immediate failure
2221    OVERALL_HAL_FAILURE = 6;
2222
2223    // RTT to Wi-Fi Aware peer using PeerHandle failed to get a MAC address translation
2224    OVERALL_AWARE_TRANSLATION_FAILURE = 7;
2225
2226    // RTT operation failed due to missing Location permission (post execution)
2227    OVERALL_LOCATION_PERMISSION_MISSING = 8;
2228  }
2229
2230  // Status codes for individual RTT operation
2231  enum RttIndividualStatusTypeEnum {
2232    // constant to be used by proto
2233    UNKNOWN = 0;
2234
2235    // RTT operation succeeded
2236    SUCCESS = 1;
2237
2238    // RTT failure: generic reason (no further information)
2239    FAILURE = 2;
2240
2241    // Target STA does not respond to request
2242    FAIL_NO_RSP = 3;
2243
2244    // Request rejected. Applies to 2-sided RTT only
2245    FAIL_REJECTED = 4;
2246
2247    // Operation not scheduled
2248    FAIL_NOT_SCHEDULED_YET = 5;
2249
2250    // Timing measurement times out
2251    FAIL_TM_TIMEOUT = 6;
2252
2253    // Target on different channel, cannot range
2254    FAIL_AP_ON_DIFF_CHANNEL = 7;
2255
2256    // Ranging not supported
2257    FAIL_NO_CAPABILITY = 8;
2258
2259    // Request aborted for unknown reason
2260    ABORTED = 9;
2261
2262    // Invalid T1-T4 timestamp
2263    FAIL_INVALID_TS = 10;
2264
2265    // 11mc protocol failed
2266    FAIL_PROTOCOL = 11;
2267
2268    // Request could not be scheduled
2269    FAIL_SCHEDULE = 12;
2270
2271    // Responder cannot collaborate at time of request
2272    FAIL_BUSY_TRY_LATER = 13;
2273
2274    // Bad request args
2275    INVALID_REQ = 14;
2276
2277    // WiFi not enabled
2278    NO_WIFI = 15;
2279
2280    // Responder overrides param info, cannot range with new params
2281    FAIL_FTM_PARAM_OVERRIDE = 16;
2282
2283    // HAL did not provide a result to a framework request
2284    MISSING_RESULT = 17;
2285  }
2286
2287  // Histogram bucket for Wi-Fi RTT overall operation status
2288  message RttOverallStatusHistogramBucket {
2289    // status type defining the bucket
2290    optional RttOverallStatusTypeEnum status_type = 1;
2291
2292    // number of samples in the bucket
2293    optional int32 count = 2;
2294  }
2295
2296  // Histogram bucket for Wi-Fi RTT individual operation status
2297  message RttIndividualStatusHistogramBucket {
2298    // status type defining the bucket
2299    optional RttIndividualStatusTypeEnum status_type = 1;
2300
2301    // number of samples in the bucket
2302    optional int32 count = 2;
2303  }
2304}
2305
2306// Usage data for the wifi radio while device is running on battery.
2307message WifiRadioUsage {
2308  // Duration of log (ms)
2309  optional int64 logging_duration_ms = 1;
2310
2311  // Total time for which the radio is awake due to scan.
2312  optional int64 scan_time_ms = 2;
2313}
2314
2315message ExperimentValues {
2316  reserved 1;
2317  reserved "wifi_is_unusable_logging_enabled";
2318
2319  // Minimum number of txBad to trigger a data stall
2320  optional int32 wifi_data_stall_min_tx_bad = 2;
2321
2322  // Minimum number of txSuccess to trigger a data stall
2323  // when rxSuccess is 0
2324  optional int32 wifi_data_stall_min_tx_success_without_rx = 3;
2325
2326  // Indicates if we are logging LinkSpeedCount in metrics
2327  optional bool link_speed_counts_logging_enabled = 4;
2328
2329  // Duration for evaluating Wifi condition to trigger a data stall
2330  // measured in milliseconds
2331  optional int32 data_stall_duration_ms = 5;
2332
2333  // Threshold of Tx throughput below which to trigger a data stall
2334  // measured in Kbps
2335  optional int32 data_stall_tx_tput_thr_kbps = 6;
2336
2337  // Threshold of Rx throughput below which to trigger a data stall
2338  // measured in Kbps
2339  optional int32 data_stall_rx_tput_thr_kbps = 7;
2340
2341  // Threshold of Tx packet error rate above which to trigger a data stall
2342  // in percentage
2343  optional int32 data_stall_tx_per_thr = 8;
2344
2345  // Threshold of CCA level above which to trigger a data stall in percentage
2346  optional int32 data_stall_cca_level_thr = 9;
2347
2348  // Health monitor RSSI poll valid time in ms
2349  optional int32 health_monitor_rssi_poll_valid_time_ms = 10;
2350}
2351
2352message BssidBlocklistStats {
2353  // Distributions of number of blocked BSSIDs filtered out from network selection.
2354  repeated Int32Count network_selection_filtered_bssid_count = 1;
2355
2356  // If this is enabled, then network connections in high movement state will be skipped unless
2357  // we find a candidate BSSID with similar RSSI in 2 scans sufficiently far apart.
2358  optional bool high_movement_multiple_scans_feature_enabled = 2;
2359
2360  // Number of times connection is skipped in the high movement state
2361  // only relevant if high_movement_multiple_scans_feature_enabled=true
2362  optional int32 num_high_movement_connection_skipped = 3;
2363
2364  // Number of times connection is initiated in the high movement state
2365  // only relevant if high_movement_multiple_scans_feature_enabled=true
2366  optional int32 num_high_movement_connection_started = 4;
2367
2368  // Histogram corresponding to the number of times BSSIDs are blocked per
2369  // WifiBlocklistMonitor.FailureReason.
2370  repeated Int32Count bssid_blocklist_per_reason_count = 5;
2371
2372  // Histogram corresponding to the number of times WifiConfigurations are blocked per
2373  // WifiConfiguration.NetworkSelectionStatus.NetworkSelectionDisableReason.
2374  repeated Int32Count wifi_config_blocklist_per_reason_count = 6;
2375}
2376
2377message WifiIsUnusableEvent {
2378  enum TriggerType {
2379    // Default/Invalid event
2380    TYPE_UNKNOWN = 0;
2381
2382    // There is a data stall from tx failures
2383    TYPE_DATA_STALL_BAD_TX = 1;
2384
2385    // There is a data stall from rx failures
2386    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;
2387
2388    // There is a data stall from both tx and rx failures
2389    TYPE_DATA_STALL_BOTH = 3;
2390
2391    // Firmware generated an alert
2392    TYPE_FIRMWARE_ALERT = 4;
2393
2394    // IP Manager lost reachability to network neighbors
2395    TYPE_IP_REACHABILITY_LOST = 5;
2396  }
2397
2398  // What event triggered WifiIsUnusableEvent.
2399  optional TriggerType type = 1;
2400
2401  // The timestamp at which this event occurred.
2402  // Measured in milliseconds that have elapsed since the device booted.
2403  optional int64 start_time_millis = 2;
2404
2405  // NetworkAgent score of connected wifi.
2406  // Defaults to -1 if the score was never set.
2407  optional int32 last_score = 3 [default = -1];
2408
2409  // Delta of successfully transmitted (ACKed) unicast data packets
2410  // between the last two WifiLinkLayerStats.
2411  optional int64 tx_success_delta = 4;
2412
2413  // Delta of transmitted unicast data retry packets
2414  // between the last two WifiLinkLayerStats.
2415  optional int64 tx_retries_delta = 5;
2416
2417  // Delta of lost (not ACKed) transmitted unicast data packets
2418  // between the last two WifiLinkLayerStats.
2419  optional int64 tx_bad_delta = 6;
2420
2421  // Delta of received unicast data packets
2422  // between the last two WifiLinkLayerStats.
2423  optional int64 rx_success_delta = 7;
2424
2425  // Time in millisecond between the last two WifiLinkLayerStats.
2426  optional int64 packet_update_time_delta = 8;
2427
2428  // The timestamp at which the last WifiLinkLayerStats was updated.
2429  // Measured in milliseconds that have elapsed since the device booted.
2430  optional int64 last_link_layer_stats_update_time = 9;
2431
2432  // Firmware alert code. Only valid when the event was triggered by a firmware alert, otherwise -1.
2433  optional int32 firmware_alert_code = 10 [default = -1];
2434
2435  // NetworkAgent wifi usability score of connected wifi.
2436  // Defaults to -1 if the score was never set.
2437  optional int32 last_wifi_usability_score = 11 [default = -1];
2438
2439  // Prediction horizon (in second) of Wifi usability score provided by external
2440  // system app
2441  optional int32 last_prediction_horizon_sec = 12 [default = -1];
2442
2443  // Whether screen status is on when WifiIsUnusableEvent happens.
2444  optional bool screen_on = 13 [default = false];
2445
2446  // Number of bytes transmitted across mobile networks since device boot.
2447  optional int64 mobile_tx_bytes = 14 [default = -1];
2448
2449  // // Number of bytes received across mobile networks since device boot.
2450  optional int64 mobile_rx_bytes = 15 [default = -1];
2451
2452  // Number of bytes transmitted since device boot.
2453  optional int64 total_tx_bytes = 16 [default = -1];
2454
2455  // Number of bytes received since device boot.
2456  optional int64 total_rx_bytes = 17 [default = -1];
2457}
2458
2459message PasspointProfileTypeCount {
2460  enum EapMethod {
2461    // Unknown Type
2462    TYPE_UNKNOWN = 0;
2463
2464    // EAP_TLS (13)
2465    TYPE_EAP_TLS = 1;
2466
2467    // EAP_TTLS (21)
2468    TYPE_EAP_TTLS = 2;
2469
2470    // EAP_SIM (18)
2471    TYPE_EAP_SIM = 3;
2472
2473    // EAP_AKA (23)
2474    TYPE_EAP_AKA = 4;
2475
2476    // EAP_AKA_PRIME (50)
2477    TYPE_EAP_AKA_PRIME = 5;
2478  }
2479
2480  // Eap method type set in Passpoint profile
2481  optional EapMethod eap_method_type = 1;
2482
2483  // Num of installed Passpoint profile with same eap method
2484  optional int32 count = 2;
2485}
2486
2487message WifiLinkLayerUsageStats {
2488  // Total logging duration in ms.
2489  optional int64 logging_duration_ms = 1;
2490
2491  // Total time the wifi radio is on in ms over the logging duration.
2492  optional int64 radio_on_time_ms = 2;
2493
2494  // Total time the wifi radio is doing tx in ms over the logging duration.
2495  optional int64 radio_tx_time_ms = 3;
2496
2497  // Total time the wifi radio is doing rx in ms over the logging duration.
2498  optional int64 radio_rx_time_ms = 4;
2499
2500  // Total time the wifi radio is scanning in ms over the logging duration.
2501  optional int64 radio_scan_time_ms = 5;
2502
2503  // Total time the wifi radio spent doing nan scans in ms over the logging duration.
2504  optional int64 radio_nan_scan_time_ms = 6;
2505
2506  // Total time the wifi radio spent doing background scans in ms over the logging duration.
2507  optional int64 radio_background_scan_time_ms = 7;
2508
2509  // Total time the wifi radio spent doing roam scans in ms over the logging duration.
2510  optional int64 radio_roam_scan_time_ms = 8;
2511
2512  // Total time the wifi radio spent doing pno scans in ms over the logging duration.
2513  optional int64 radio_pno_scan_time_ms = 9;
2514
2515  // Total time the wifi radio spent doing hotspot 2.0 scans and GAS exchange
2516  // in ms over the logging duration.
2517  optional int64 radio_hs20_scan_time_ms = 10;
2518
2519  // Radio stats from all the radios
2520  repeated RadioStats radio_stats = 11;
2521}
2522
2523message WifiUsabilityStatsEntry {
2524  // Status codes for link probe status
2525  enum LinkProbeStatus {
2526    // Link probe status is unknown
2527    PROBE_STATUS_UNKNOWN = 0;
2528
2529    // Link probe is not triggered
2530    PROBE_STATUS_NO_PROBE = 1;
2531
2532    // Link probe is triggered and the result is success
2533    PROBE_STATUS_SUCCESS = 2;
2534
2535    // Link probe is triggered and the result is failure
2536    PROBE_STATUS_FAILURE = 3;
2537  }
2538
2539  // Codes for cellular data network type
2540  enum CellularDataNetworkType {
2541    // Unknown network
2542    NETWORK_TYPE_UNKNOWN = 0;
2543
2544    // GSM network
2545    NETWORK_TYPE_GSM = 1;
2546
2547    // CDMA network
2548    NETWORK_TYPE_CDMA = 2;
2549
2550    // CDMA EVDO network
2551    NETWORK_TYPE_EVDO_0 = 3;
2552
2553    // WCDMA network
2554    NETWORK_TYPE_UMTS = 4;
2555
2556    // TDSCDMA network
2557    NETWORK_TYPE_TD_SCDMA = 5;
2558
2559    // LTE network
2560    NETWORK_TYPE_LTE = 6;
2561
2562    // NR network
2563    NETWORK_TYPE_NR = 7;
2564  }
2565
2566  // Absolute milliseconds from device boot when these stats were sampled
2567  optional int64 time_stamp_ms = 1;
2568
2569  // The RSSI at the sample time
2570  optional int32 rssi = 2;
2571
2572  // Link speed at the sample time in Mbps
2573  optional int32 link_speed_mbps = 3;
2574
2575  // The total number of tx success counted from the last radio chip reset
2576  optional int64 total_tx_success = 4;
2577
2578  // The total number of MPDU data packet retries counted from the last radio chip reset
2579  optional int64 total_tx_retries = 5;
2580
2581  // The total number of tx bad counted from the last radio chip reset
2582  optional int64 total_tx_bad = 6;
2583
2584  // The total number of rx success counted from the last radio chip reset
2585  optional int64 total_rx_success = 7;
2586
2587  // The total time the wifi radio is on in ms counted from the last radio chip reset
2588  optional int64 total_radio_on_time_ms = 8;
2589
2590  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
2591  optional int64 total_radio_tx_time_ms = 9;
2592
2593  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
2594  optional int64 total_radio_rx_time_ms = 10;
2595
2596  // The total time spent on all types of scans in ms counted from the last radio chip reset
2597  optional int64 total_scan_time_ms = 11;
2598
2599  // The total time spent on nan scans in ms counted from the last radio chip reset
2600  optional int64 total_nan_scan_time_ms = 12;
2601
2602  // The total time spent on background scans in ms counted from the last radio chip reset
2603  optional int64 total_background_scan_time_ms = 13;
2604
2605  // The total time spent on roam scans in ms counted from the last radio chip reset
2606  optional int64 total_roam_scan_time_ms = 14;
2607
2608  // The total time spent on pno scans in ms counted from the last radio chip reset
2609  optional int64 total_pno_scan_time_ms = 15;
2610
2611  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
2612  // chip reset
2613  optional int64 total_hotspot_2_scan_time_ms = 16;
2614
2615  // Internal framework Wifi score
2616  optional int32 wifi_score = 17;
2617
2618  // Wifi usability score provided by external system app
2619  optional int32 wifi_usability_score = 18;
2620
2621  // Sequence number from external system app to framework
2622  optional int32 seq_num_to_framework = 19;
2623
2624  // The total time CCA is on busy status on the current frequency in ms
2625  // counted from the last radio chip reset
2626  optional int64 total_cca_busy_freq_time_ms = 20;
2627
2628  // The total radio on time of the current frequency from the last radio
2629  // chip reset
2630  optional int64 total_radio_on_freq_time_ms = 21;
2631
2632  // The total number of beacons received from the last radio chip reset
2633  optional int64 total_beacon_rx = 22;
2634
2635  // Prediction horizon (in second) of Wifi usability score provided by external
2636  // system app
2637  optional int32 prediction_horizon_sec = 23;
2638
2639  // The link probe status since last stats update
2640  optional LinkProbeStatus probe_status_since_last_update = 24;
2641
2642  // The elapsed time of the most recent link probe since last stats update;
2643  optional int32 probe_elapsed_time_since_last_update_ms = 25;
2644
2645  // The MCS rate of the most recent link probe since last stats update
2646  optional int32 probe_mcs_rate_since_last_update = 26;
2647
2648  // Rx link speed at the sample time in Mbps
2649  optional int32 rx_link_speed_mbps = 27;
2650
2651  // Sequence number generated by framework
2652  optional int32 seq_num_inside_framework = 28;
2653
2654  // Whether current entry is for the same BSSID on the same frequency compared
2655  // to last entry
2656  optional bool is_same_bssid_and_freq = 29;
2657
2658  // Cellular data network type currently in use on the device for data transmission
2659  optional CellularDataNetworkType cellular_data_network_type = 30;
2660
2661  // Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
2662  // CDMA: Rssi, EVDO: Rssi, GSM: Rssi
2663  optional int32 cellular_signal_strength_dbm = 31;
2664
2665  // Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
2666  // CDMA: Ecio, EVDO: SNR, GSM: invalid */
2667  optional int32 cellular_signal_strength_db = 32;
2668
2669  // Whether the primary registered cell of current entry is same as that of previous entry
2670  optional bool is_same_registered_cell = 33;
2671
2672  // The device mobility state
2673  optional DeviceMobilityStatePnoScanStats.DeviceMobilityState
2674          device_mobility_state = 34;
2675
2676  // Duty cycle of the connection.
2677  // if this connection is being served using time slicing on a radio with one or more interfaces
2678  // (i.e MCC), then this field contains the duty cycle assigned to this interface in percent.
2679  // If no concurrency or not using time slicing during concurrency (i.e SCC or DBS), set to 100.
2680  optional int32 time_slice_duty_cycle_in_percent = 35;
2681
2682  // WME data packet contention time statistics for all four categories: BE, BK, VI, VO
2683  repeated ContentionTimeStats contention_time_stats = 36;
2684
2685  // The channel utilization ratio (value) in the range of
2686  // [BssLoad.MIN_CHANNEL_UTILIZATION, BssLoad.MAX_CHANNEL_UTILIZATION], where MIN_CHANNEL_UTILIZATION
2687  // corresponds to ratio 0%, MAX_CHANNEL_UTILIZATION corresponds to ratio 100%,
2688  // see {@link com.android.server.wifi.util.InformationElementUtil}
2689  optional int32 channel_utilization_ratio = 37;
2690
2691  // Indicate whether current link layer throughput is sufficient, see {@link WifiDataStall#isThroughputSufficient()}.
2692  optional bool is_throughput_sufficient = 38;
2693
2694  // Indicate whether Wi-Fi scoring is enabled by the user, see {@link WifiManager#setWifiScoringEnabled(boolean)}.
2695  optional bool is_wifi_scoring_enabled = 39;
2696
2697  // Indicate whether Cellular data is available, see {@link WifiDataStall#isCellularDataAvailable()}.
2698  optional bool is_cellular_data_available = 40;
2699
2700  // Rate statistics, including number of successful packets, retries, etc.,
2701  // indexed by preamble, bandwidth, number of spatial streams, MCS.
2702  repeated RateStats rate_stats = 41;
2703
2704  // Number of stations associated with current AP.
2705  optional int32 sta_count = 42;
2706
2707  // Channel utilization at current AP in the range of [0, 255].
2708  optional int32 channel_utilization = 43;
2709
2710  // Link layer radio stats for all the radios
2711  repeated RadioStats radio_stats = 44;
2712}
2713
2714message ContentionTimeStats {
2715  enum AccessCategory {
2716    // WME Best Effort Access Category
2717    WME_ACCESS_CATEGORY_BE = 0;
2718
2719    // WME Background Access Category
2720    WME_ACCESS_CATEGORY_BK = 1;
2721
2722    // WME Video Access Category
2723    WME_ACCESS_CATEGORY_VI = 2;
2724
2725    // WME Voice Access Category
2726    WME_ACCESS_CATEGORY_VO = 3;
2727  }
2728
2729  // WME access category
2730  optional AccessCategory access_category = 1;
2731
2732  // Data packet min contention time in microseconds
2733  optional int64 contention_time_min_micros = 2;
2734
2735  // Data packet max contention time in microseconds
2736  optional int64 contention_time_max_micros = 3;
2737
2738  // Data packet average contention time in microseconds
2739  optional int64 contention_time_avg_micros = 4;
2740
2741  // Number of data packets used for contention statistics
2742  optional int64 contention_num_samples = 5;
2743}
2744
2745message RateStats {
2746  enum WifiPreambleType {
2747    // Preamble type for IEEE 802.11a/g, IEEE Std 802.11-2020, Section 17
2748    WIFI_PREAMBLE_OFDM = 0;
2749    // Preamble type for IEEE 802.11b, IEEE Std 802.11-2020, Section 16
2750    WIFI_PREAMBLE_CCK = 1;
2751    // Preamble type for IEEE 802.11n, IEEE Std 802.11-2020, Section 19
2752    WIFI_PREAMBLE_HT = 2;
2753    // Preamble type for IEEE 802.11ac, IEEE Std 802.11-2020, Section 21
2754    WIFI_PREAMBLE_VHT = 3;
2755    // Preamble type for IEEE 802.11ax, IEEE Std 802.11-2020, Section 27
2756    WIFI_PREAMBLE_HE = 5;
2757    // Invalid
2758    WIFI_PREAMBLE_INVALID = -1;
2759  }
2760
2761  enum WifiSpatialStreams {
2762    // Single stream, 1x1
2763    WIFI_SPATIAL_STREAMS_ONE = 0;
2764    // Dual streams, 2x2
2765    WIFI_SPATIAL_STREAMS_TWO = 1;
2766    // Three streams, 3x3
2767    WIFI_SPATIAL_STREAMS_THREE = 2;
2768    // Four streams, 4x4
2769    WIFI_SPATIAL_STREAMS_FOUR = 3;
2770    // Invalid
2771    WIFI_SPATIAL_STREAMS_INVALID = -1;
2772  }
2773
2774  enum WifiChannelBandwidth {
2775    // Channel bandwidth: 20MHz
2776    WIFI_BANDWIDTH_20_MHZ = 0;
2777    // Channel bandwidth: 40MHz
2778    WIFI_BANDWIDTH_40_MHZ = 1;
2779    // Channel bandwidth: 80MHz
2780    WIFI_BANDWIDTH_80_MHZ = 2;
2781    // Channel bandwidth: 160MHz
2782    WIFI_BANDWIDTH_160_MHZ = 3;
2783    // Channel bandwidth: 80MHz + 80MHz
2784    WIFI_BANDWIDTH_80P80_MHZ = 4;
2785    // Channel bandwidth: 5MHz
2786    WIFI_BANDWIDTH_5_MHZ = 5;
2787    // Channel bandwidth: 10MHz
2788    WIFI_BANDWIDTH_10_MHZ = 6;
2789    // Invalid channel bandwidth
2790    WIFI_BANDWIDTH_INVALID = -1;
2791  }
2792
2793  // Preamble information.
2794  optional WifiPreambleType preamble = 1;
2795
2796  // Number of spatial streams.
2797  optional WifiSpatialStreams nss = 2;
2798
2799  // Bandwidth information.
2800  optional WifiChannelBandwidth bw = 3;
2801
2802  // MCS index. OFDM/CCK rate code would be as per IEEE std in the units of 0.5Mbps.
2803  // HT/VHT/HE: it would be MCS index.
2804  optional int32 rate_mcs_idx = 4;
2805
2806  // Bitrate in units of 100 Kbps.
2807  optional int32 bit_rate_in_kbps = 5;
2808
2809  // Number of successfully transmitted data packets (ACK received).
2810  optional int32 tx_mpdu = 6;
2811
2812  // Number of received data packets.
2813  optional int32 rx_mpdu = 7;
2814
2815  // Number of data packet losses (no ACK).
2816  optional int32 mpdu_lost = 8;
2817
2818  // Number of data packet retries.
2819  optional int32 retries = 9;
2820}
2821
2822message RadioStats {
2823  // The Radio ID
2824  optional int32 radio_id = 1;
2825  // The total time the wifi radio is on in ms counted from the last radio chip reset
2826  optional int64 total_radio_on_time_ms = 2;
2827
2828  // The total time the wifi radio is doing tx in ms counted from the last radio chip reset
2829  optional int64 total_radio_tx_time_ms = 3;
2830
2831  // The total time the wifi radio is doing rx in ms counted from the last radio chip reset
2832  optional int64 total_radio_rx_time_ms = 4;
2833
2834  // The total time spent on all types of scans in ms counted from the last radio chip reset
2835  optional int64 total_scan_time_ms = 5;
2836
2837  // The total time spent on nan scans in ms counted from the last radio chip reset
2838  optional int64 total_nan_scan_time_ms = 6;
2839
2840  // The total time spent on background scans in ms counted from the last radio chip reset
2841  optional int64 total_background_scan_time_ms = 7;
2842
2843  // The total time spent on roam scans in ms counted from the last radio chip reset
2844  optional int64 total_roam_scan_time_ms = 8;
2845
2846  // The total time spent on pno scans in ms counted from the last radio chip reset
2847  optional int64 total_pno_scan_time_ms = 9;
2848
2849  // The total time spent on hotspot2.0 scans and GAS exchange in ms counted from the last radio
2850  // chip reset
2851  optional int64 total_hotspot_2_scan_time_ms = 10;
2852}
2853
2854message WifiUsabilityStats {
2855  enum Label {
2856    // Default label
2857    LABEL_UNKNOWN = 0;
2858
2859    // Wifi is usable
2860    LABEL_GOOD = 1;
2861
2862    // Wifi is unusable
2863    LABEL_BAD = 2;
2864  }
2865
2866  enum UsabilityStatsTriggerType {
2867    // Default/Invalid event
2868    TYPE_UNKNOWN = 0;
2869
2870    // There is a data stall from tx failures
2871    TYPE_DATA_STALL_BAD_TX = 1;
2872
2873    // There is a data stall from rx failures
2874    TYPE_DATA_STALL_TX_WITHOUT_RX = 2;
2875
2876    // There is a data stall from both tx and rx failures
2877    TYPE_DATA_STALL_BOTH = 3;
2878
2879    // Firmware generated an alert
2880    TYPE_FIRMWARE_ALERT = 4;
2881
2882    // IP Manager lost reachability to network neighbors
2883    TYPE_IP_REACHABILITY_LOST = 5;
2884  }
2885
2886  // The current wifi usability state
2887  optional Label label = 1;
2888
2889  // The list of timestamped wifi usability stats
2890  repeated WifiUsabilityStatsEntry stats = 2;
2891
2892  // What event triggered WifiUsabilityStats.
2893  optional UsabilityStatsTriggerType trigger_type = 3;
2894
2895  // Firmware alert code. Only valid when the stats was triggered by a firmware
2896  // alert, otherwise -1.
2897  optional int32 firmware_alert_code = 4 [default = -1];
2898
2899  // Absolute milliseconds from device boot when these stats were sampled
2900  optional int64 time_stamp_ms = 5;
2901}
2902
2903message DeviceMobilityStatePnoScanStats {
2904  // see WifiManager.DEVICE_MOBILITY_STATE_* constants
2905  enum DeviceMobilityState {
2906    // Unknown mobility
2907    UNKNOWN = 0;
2908
2909    // High movement
2910    HIGH_MVMT = 1;
2911
2912    // Low movement
2913    LOW_MVMT = 2;
2914
2915    // Stationary
2916    STATIONARY = 3;
2917  }
2918
2919  // The device mobility state
2920  optional DeviceMobilityState device_mobility_state = 1;
2921
2922  // The number of times that this state was entered
2923  optional int32 num_times_entered_state = 2;
2924
2925  // The total duration elapsed while in this mobility state, in ms
2926  optional int64 total_duration_ms = 3;
2927
2928  // the total duration elapsed while in this mobility state with PNO scans running, in ms
2929  optional int64 pno_duration_ms = 4;
2930}
2931
2932// The information about the Wifi P2p events.
2933message WifiP2pStats {
2934
2935  // Group event list tracking sessions and client counts in tethered mode.
2936  repeated GroupEvent group_event = 1;
2937
2938  // Session information that gets logged for every Wifi P2p connection.
2939  repeated P2pConnectionEvent connection_event = 2;
2940
2941  // Number of persistent group in the user profile.
2942  optional int32 num_persistent_group = 3;
2943
2944  // Number of peer scan.
2945  optional int32 num_total_peer_scans = 4;
2946
2947  // Number of service scan.
2948  optional int32 num_total_service_scans = 5;
2949}
2950
2951message P2pConnectionEvent {
2952
2953  enum ConnectionType {
2954
2955    // fresh new connection.
2956    CONNECTION_FRESH = 0;
2957
2958    // reinvoke a group.
2959    CONNECTION_REINVOKE = 1;
2960
2961    // create a group with the current device as the group owner locally.
2962    CONNECTION_LOCAL = 2;
2963
2964    // create a group or join a group with config.
2965    CONNECTION_FAST = 3;
2966  }
2967
2968  enum ConnectivityLevelFailure {
2969
2970    // Failure is unknown.
2971    CLF_UNKNOWN = 0;
2972
2973    // No failure.
2974    CLF_NONE = 1;
2975
2976    // Timeout for current connecting request.
2977    CLF_TIMEOUT = 2;
2978
2979    // The connecting request is canceled by the user.
2980    CLF_CANCEL = 3;
2981
2982    // Provision discovery failure, e.g. no pin code, timeout, rejected by the peer.
2983    CLF_PROV_DISC_FAIL = 4;
2984
2985    // Invitation failure, e.g. rejected by the peer.
2986    CLF_INVITATION_FAIL = 5;
2987
2988    // Incoming request is rejected by the user.
2989    CLF_USER_REJECT = 6;
2990
2991    // New connection request is issued before ending previous connecting request.
2992    CLF_NEW_CONNECTION_ATTEMPT = 7;
2993
2994    // Group has been removed
2995    CLF_GROUP_REMOVED = 8;
2996
2997    // Creating group failed
2998    CLF_CREATE_GROUP_FAILED = 9;
2999  }
3000
3001  // WPS method.
3002  enum WpsMethod {
3003    // WPS is skipped for Group Reinvoke.
3004    WPS_NA = -1;
3005
3006    // Push button configuration.
3007    WPS_PBC = 0;
3008
3009    // Display pin method configuration - pin is generated and displayed on device.
3010    WPS_DISPLAY = 1;
3011
3012    // Keypad pin method configuration - pin is entered on device.
3013    WPS_KEYPAD = 2;
3014
3015    // Label pin method configuration - pin is labelled on device.
3016    WPS_LABEL = 3;
3017  }
3018
3019  enum GroupBand {
3020    // Unknown band/frequency
3021    BAND_UNKNOWN = 0;
3022    // With any band
3023    BAND_AUTO = 1;
3024    // With 2G band
3025    BAND_2G = 2;
3026    // With 5G band
3027    BAND_5G = 3;
3028    // With 6G band
3029    BAND_6G = 4;
3030    // With a specific frequency
3031    BAND_FREQUENCY = 5;
3032  }
3033
3034  // Start time of the connection.
3035  optional int64 start_time_millis = 1;
3036
3037  // Type of the connection.
3038  optional ConnectionType connection_type = 2;
3039
3040  // WPS method.
3041  optional WpsMethod wps_method = 3 [default = WPS_NA];
3042
3043  // Duration to connect.
3044  optional int32 duration_taken_to_connect_millis = 4;
3045
3046  // Failures that happen at the connectivity layer.
3047  optional ConnectivityLevelFailure connectivity_level_failure_code = 5;
3048
3049  // Group role. This could be unknown with connect() call when the WifiConfig doesn't have the
3050  // credential.
3051  optional GroupEvent.GroupRole group_role = 6;
3052
3053  // Group band preference
3054  optional GroupBand band = 7;
3055
3056  // Group frequency in MHz if positive. Otherwise, no frequency preference.
3057  optional int32 frequency_mhz = 8;
3058
3059  // STA mode channel frequency. 0 means unknown.
3060  optional int32 sta_frequency_mhz = 9;
3061
3062  // The uid of the app that initiates the connection.
3063  optional int32 uid = 10;
3064
3065  // if the country code is in the world mode
3066  optional bool is_country_code_world_mode = 11;
3067
3068  // fallback to negotiation if device receives invitation response status code "information is
3069  // currently unavailable"
3070  optional bool fallback_to_negotiation_on_invite_status_info_unavailable = 12;
3071
3072  // The try count of connection
3073  optional int32 try_count = 13;
3074
3075  // The Attribution tag to identify the caller
3076  optional string attribution_tag = 14;
3077}
3078
3079// GroupEvent tracking group information from GroupStarted to GroupRemoved.
3080message GroupEvent {
3081
3082  enum GroupRole {
3083
3084    GROUP_OWNER = 0;
3085
3086    GROUP_CLIENT = 1;
3087
3088    GROUP_UNKNOWN = 2;
3089  }
3090
3091  // The ID of network in supplicant for this group.
3092  optional int32 net_id = 1;
3093
3094  // Start time of the group.
3095  optional int64 start_time_millis = 2;
3096
3097  // Channel frequency used for Group.
3098  optional int32 channel_frequency = 3;
3099
3100  // Is group owner or group client.
3101  optional GroupRole group_role = 5;
3102
3103  // Number of connected clients.
3104  optional int32 num_connected_clients = 6;
3105
3106  // Cumulative number of connected clients.
3107  optional int32 num_cumulative_clients = 7;
3108
3109  // The session duration.
3110  optional int32 session_duration_millis = 8;
3111
3112  // The idle duration. A group without any client is in idle.
3113  optional int32 idle_duration_millis = 9;
3114}
3115
3116// Easy Connect (DPP)
3117message WifiDppLog {
3118  reserved 6;
3119
3120  // Number of Configurator-Initiator requests
3121  optional int32 num_dpp_configurator_initiator_requests = 1;
3122
3123  // Number of Enrollee-Initiator requests
3124  optional int32 num_dpp_enrollee_initiator_requests = 2;
3125
3126  // Easy Connect (DPP) Enrollee success
3127  optional int32 num_dpp_enrollee_success = 3;
3128
3129  // Easy Connect (DPP) Configurator success code bucket
3130  repeated DppConfiguratorSuccessStatusHistogramBucket dpp_configurator_success_code = 4;
3131
3132  // Easy Connect (DPP) failure code bucket
3133  repeated DppFailureStatusHistogramBucket dpp_failure_code = 5;
3134
3135  // Easy Connect (DPP) operation time bucket
3136  repeated HistogramBucketInt32 dpp_operation_time = 7;
3137
3138  // Number of Enrollee-Responder peer devices supporting DPP protocol version 1
3139  optional int32 num_dpp_r1_capable_enrollee_responder_devices = 8;
3140
3141  // Number of Enrollee-Responder peer devices supporting DPP protocol version 2
3142  optional int32 num_dpp_r2_capable_enrollee_responder_devices = 9;
3143
3144  // Number of Enrollee-Responder incompatible configurations found in DPP R2 compatibility check.
3145  optional int32 num_dpp_r2_enrollee_responder_incompatible_configuration = 10;
3146
3147  // Number of Enrollee-Responder requests
3148  optional int32 num_dpp_enrollee_responder_requests = 11;
3149
3150  // Number of Enrollee-Responder success
3151  optional int32 num_dpp_enrollee_responder_success = 12;
3152
3153  // Histogram bucket for Wi-Fi DPP configurator success
3154  message DppConfiguratorSuccessStatusHistogramBucket {
3155    // status type defining the bucket
3156    optional DppConfiguratorSuccessCode dpp_status_type = 1;
3157
3158    // number of samples in the bucket
3159    optional int32 count = 2;
3160  }
3161
3162  // Histogram bucket for Wi-Fi DPP failures
3163  message DppFailureStatusHistogramBucket {
3164    // status type defining the bucket
3165    optional DppFailureCode dpp_status_type = 1;
3166
3167    // number of samples in the bucket
3168    optional int32 count = 2;
3169  }
3170
3171  enum DppConfiguratorSuccessCode {
3172    // Unknown success code
3173    EASY_CONNECT_EVENT_SUCCESS_UNKNOWN = 0;
3174
3175    // Easy Connect Configurator success event: Configuration sent to enrollee
3176    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 1;
3177
3178    // Easy Connect Configurator success event: Configuration applied by enrollee
3179    EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 2;
3180  }
3181
3182  enum DppFailureCode {
3183    // Unknown failure
3184    EASY_CONNECT_EVENT_FAILURE_UNKNOWN = 0;
3185
3186    // Easy Connect Failure event: Scanned QR code is either not a Easy Connect URI, or the Easy
3187    // Connect URI has errors.
3188    EASY_CONNECT_EVENT_FAILURE_INVALID_URI = 1;
3189
3190    // Easy Connect Failure event: Bootstrapping/Authentication initialization process failure.
3191    EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = 2;
3192
3193    // Easy Connect Failure event: Both devices are implementing the same role and are
3194    // incompatible.
3195    EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = 3;
3196
3197    // Easy Connect Failure event: Configuration process has failed due to malformed message.
3198    EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = 4;
3199
3200    // Easy Connect Failure event: Easy Connect request while in another Easy Connect exchange.
3201    EASY_CONNECT_EVENT_FAILURE_BUSY = 5;
3202
3203    // Easy Connect Failure event: No response from the peer.
3204    EASY_CONNECT_EVENT_FAILURE_TIMEOUT = 6;
3205
3206    // Easy Connect Failure event: General protocol failure.
3207    EASY_CONNECT_EVENT_FAILURE_GENERIC = 7;
3208
3209    // Easy Connect Failure event: Feature or option is not supported.
3210    EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = 8;
3211
3212    // Easy Connect Failure event: Invalid network provided to Easy Connect configurator.
3213    // Network must either be WPA3-Personal (SAE) or WPA2-Personal (PSK).
3214    EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = 9;
3215
3216    // Easy Connect R2 Failure event: Enrollee cannot find the network.
3217    EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK = 10;
3218
3219    // Easy Connect R2 Failure event: Enrollee failed to authenticate with the network.
3220    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION = 11;
3221
3222    // Easy Connect R2 Failure event: Enrollee rejected the configuration.
3223    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION = 12;
3224
3225    // Easy Connect Failure event: System failed to generate DPP URI.
3226    EASY_CONNECT_EVENT_FAILURE_URI_GENERATION = 13;
3227
3228    // Easy Connect Failure event: Enrollee didn't scan the network's operating channel.
3229    EASY_CONNECT_EVENT_FAILURE_ENROLLEE_FAILED_TO_SCAN_NETWORK_CHANNEL = 14;
3230  }
3231}
3232
3233// WifiConfigStore read/write metrics.
3234message WifiConfigStoreIO {
3235  // Histogram of config store read durations.
3236  repeated DurationBucket read_durations = 1;
3237
3238  // Histogram of config store write durations.
3239  repeated DurationBucket write_durations = 2;
3240
3241  // Total Number of instances of write/read duration in this duration bucket.
3242  message DurationBucket {
3243    // Bucket covers duration : [range_start_ms, range_end_ms)
3244    // The (inclusive) lower bound of read/write duration represented by this bucket
3245    optional int32 range_start_ms = 1;
3246
3247    // The (exclusive) upper bound of read/write duration represented by this bucket
3248    optional int32 range_end_ms = 2;
3249
3250    // Number of read/write durations that fit into this bucket
3251    optional int32 count = 3;
3252  }
3253}
3254
3255// Histogram bucket counting with int32. Range is [start, end)
3256message HistogramBucketInt32 {
3257  // lower range of the bucket (inclusive)
3258  optional int32 start = 1;
3259
3260  // upper range of the bucket (exclusive)
3261  optional int32 end = 2;
3262
3263  // number of samples in the bucket
3264  optional int32 count = 3;
3265}
3266
3267// Counts occurrences of a int32 key
3268message Int32Count {
3269  // the key
3270  optional int32 key = 1;
3271
3272  // the count
3273  optional int32 count = 2;
3274}
3275
3276message LinkProbeStats {
3277  enum LinkProbeFailureReason {
3278    // unknown reason
3279    LINK_PROBE_FAILURE_REASON_UNKNOWN = 0;
3280
3281    // Specified MCS rate when it is unsupported by the driver.
3282    LINK_PROBE_FAILURE_REASON_MCS_UNSUPPORTED = 1;
3283
3284    // Driver reported that no ACK was received for the transmitted probe.
3285    LINK_PROBE_FAILURE_REASON_NO_ACK = 2;
3286
3287    // Driver failed to report on the status of the transmitted probe within the timeout.
3288    LINK_PROBE_FAILURE_REASON_TIMEOUT = 3;
3289
3290    // An existing link probe is in progress.
3291    LINK_PROBE_FAILURE_REASON_ALREADY_STARTED = 4;
3292  }
3293
3294  // Counts the number of failures for each failure reason.
3295  message LinkProbeFailureReasonCount {
3296    // The failure reason.
3297    optional LinkProbeFailureReason failure_reason = 1;
3298
3299    // The number of occurrences for this failure reason.
3300    optional int32 count = 2;
3301  }
3302
3303  // Counts the number of link probes for each experiment.
3304  message ExperimentProbeCounts {
3305    // The experiment ID.
3306    optional string experiment_id = 1;
3307
3308    // The number of link probes triggered for this experiment.
3309    optional int32 probe_count = 2;
3310  }
3311
3312  // Counts the occurrences of RSSI values when a link probe succeeds.
3313  repeated Int32Count success_rssi_counts = 1;
3314
3315  // Counts the occurrences of RSSI values when a link probe fails.
3316  repeated Int32Count failure_rssi_counts = 2;
3317
3318  // Counts the occurrences of Link Speed values when a link probe succeeds.
3319  repeated Int32Count success_link_speed_counts = 3;
3320
3321  // Counts the occurrences of Link Speed values when a link probe fails.
3322  repeated Int32Count failure_link_speed_counts = 4;
3323
3324  // Histogram for the number of seconds since the last TX success when a link probe succeeds.
3325  repeated HistogramBucketInt32 success_seconds_since_last_tx_success_histogram = 5;
3326
3327  // Histogram for the number of seconds since the last TX success when a link probe fails.
3328  repeated HistogramBucketInt32 failure_seconds_since_last_tx_success_histogram = 6;
3329
3330  // Histogram for the elapsed time of successful link probes, in ms.
3331  repeated HistogramBucketInt32 success_elapsed_time_ms_histogram = 7;
3332
3333  // Counts the occurrences of error codes for failed link probes.
3334  repeated LinkProbeFailureReasonCount failure_reason_counts = 8;
3335
3336  // Counts the number of link probes for each experiment.
3337  repeated ExperimentProbeCounts experiment_probe_counts = 9;
3338}
3339
3340// Stores the decisions that were made by a experiment when compared against another experiment
3341message NetworkSelectionExperimentDecisions {
3342  // the id of one experiment
3343  optional int32 experiment1_id = 1;
3344
3345  // the id of the other experiment
3346  optional int32 experiment2_id = 2;
3347
3348  // Counts occurrences of the number of network choices there were when experiment1 makes the
3349  // same network selection as experiment2.
3350  // The keys are the number of network choices, and the values are the number of occurrences of
3351  // this number of network choices when exp1 and exp2 make the same network selection.
3352  repeated Int32Count same_selection_num_choices_counter = 3;
3353
3354  // Counts occurrences of the number of network choices there were when experiment1 makes the
3355  // same network selection as experiment2.
3356  // The keys are the number of network choices, and the values are the number of occurrences of
3357  // this number of network choices when exp1 and exp2 make different network selections.
3358  // Note that it is possible for the network selection to be different even when there only exists
3359  // a single network choice, since choosing not to connect to that network is a valid choice.
3360  repeated Int32Count different_selection_num_choices_counter = 4;
3361}
3362
3363// NetworkRequest API metrics.
3364message WifiNetworkRequestApiLog {
3365  // Number of requests via this API surface.
3366  optional int32 num_request = 1;
3367
3368  // Histogram of requests via this API surface to number of networks matched in scan results.
3369  repeated HistogramBucketInt32 network_match_size_histogram = 2;
3370
3371  // Number of requests via this API surface that bypassed user approval.
3372  optional int32 num_user_approval_bypass = 4;
3373
3374  // Number of requests via this API surface that was rejected by the user.
3375  optional int32 num_user_reject = 5;
3376
3377  // Number of unique apps using this API surface.
3378  optional int32 num_apps = 6;
3379
3380  // Number of connections on primary iface.
3381  optional int32 num_connect_on_primary_iface = 7;
3382
3383  // Number of successful network connection from this API.
3384  optional int32 num_connect_success_on_primary_iface = 3;
3385
3386  // Histogram of connection durations in seconds using this API surface.
3387  repeated HistogramBucketInt32 connection_duration_sec_on_primary_iface_histogram = 8;
3388
3389  // Number of connections on secondary iface (STA + STA)
3390  optional int32 num_connect_on_secondary_iface = 9;
3391
3392  // Number of connection success on secondary iface (STA + STA)
3393  optional int32 num_connect_success_on_secondary_iface = 10;
3394
3395  // Histogram of connection durations in seconds on secondary iface using this API surface.
3396  repeated HistogramBucketInt32 connection_duration_sec_on_secondary_iface_histogram = 11;
3397
3398  // Number of times there were concurrent connections (STA + STA):
3399  // - on a primary iface (internet) and
3400  // - on a secondary iface (using this API surface)
3401  optional int32 num_concurrent_connection = 12;
3402
3403  // Histogram of concurrent connection durations in seconds using this API surface (STA + STA).
3404  repeated HistogramBucketInt32 concurrent_connection_duration_sec_histogram = 13;
3405}
3406
3407// NetworkSuggestion API metrics.
3408message WifiNetworkSuggestionApiLog {
3409  enum SuggestionAppTypeCode {
3410    // UNKNOWN type suggestion app.
3411    TYPE_UNKNOWN = 0;
3412    // Suggestion app with carrier privilege.
3413    TYPE_CARRIER_PRIVILEGED = 1;
3414    // Suggestion app with network provisioning permission(NETWORK_CARRIER_PROVISIONING).
3415    TYPE_NETWORK_PROVISIONING = 2;
3416    // Suggestion app without special privilege.
3417    TYPE_NON_PRIVILEGED = 3;
3418  }
3419
3420  message SuggestionAppCount {
3421    // Suggestion app type.
3422    optional SuggestionAppTypeCode app_type = 1;
3423    // Num of app in this type.
3424    optional int32 count = 2;
3425  }
3426
3427  // Number of modifications to their suggestions by apps.
3428  optional int32 num_modification = 1;
3429
3430  // Number of successful network connection from app suggestions.
3431  optional int32 num_connect_success = 2;
3432
3433  // Number of network connection failures from app suggestions.
3434  optional int32 num_connect_failure = 3;
3435
3436  // Histogram for size of the network lists provided by various apps on the device.
3437  repeated HistogramBucketInt32 network_list_size_histogram = 4;
3438
3439  // Count of app using suggestion API with different privilege.
3440  repeated SuggestionAppCount app_count_per_type = 5;
3441
3442  // Number of user revoke app's permission from settings or disallowed from UI.
3443  optional int32 user_revoke_app_suggestion_permission = 6;
3444
3445  // Number of priority groups configured on the device, excluding the default priority group.
3446  optional int32 num_priority_groups = 7;
3447
3448  // Number of times when a ScanResult matched more than one suggestions.
3449  optional int32 num_multiple_suggestions = 8;
3450
3451  // Number of saved profiles which also have at least one suggestion (for the same network)
3452  // provisioned on the device.
3453  optional int32 num_saved_networks_with_configured_suggestion = 9;
3454}
3455
3456// WifiLock metrics
3457message WifiLockStats {
3458    // Amount of time wifi is actively in HIGH_PERF mode (ms)
3459    // This means the lock takes effect and the device takes the actions required for this mode
3460    optional int64 high_perf_active_time_ms = 1;
3461
3462    // Amount of time wifi is actively in LOW_LATENCY mode (ms)
3463    // This means the lock takes effect and the device takes the actions required for this mode
3464    optional int64 low_latency_active_time_ms = 2;
3465
3466    // Histogram of HIGH_PERF lock acquisition duration (seconds)
3467    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
3468    repeated HistogramBucketInt32 high_perf_lock_acq_duration_sec_histogram = 3;
3469
3470    // Histogram of LOW_LATENCY lock acquisition duration (seconds)
3471    // Note that acquiring the lock does not necessarily mean that device is actively in that mode
3472    repeated HistogramBucketInt32 low_latency_lock_acq_duration_sec_histogram = 4;
3473
3474    // Histogram of HIGH_PERF active session duration (seconds)
3475    // This means the lock takes effect and the device takes the actions required for this mode
3476    repeated HistogramBucketInt32 high_perf_active_session_duration_sec_histogram = 5;
3477
3478    // Histogram of LOW_LATENCY active session duration (seconds)
3479    // This means the lock takes effect and the device takes the actions required for this mode
3480    repeated HistogramBucketInt32 low_latency_active_session_duration_sec_histogram = 6;
3481}
3482
3483// Stats on number of times Wi-Fi is turned on/off though the WifiManager#setWifiEnabled API
3484message WifiToggleStats {
3485  // Number of time Wi-Fi is turned on by privileged apps
3486  optional int32 num_toggle_on_privileged = 1;
3487
3488  // Number of time Wi-Fi is turned off by privileged apps
3489  optional int32 num_toggle_off_privileged = 2;
3490
3491  // Number of time Wi-Fi is turned on by normal apps
3492  optional int32 num_toggle_on_normal = 3;
3493
3494  // Number of time Wi-Fi is turned off by normal apps
3495  optional int32 num_toggle_off_normal = 4;
3496}
3497
3498// Information about the Passpoint provision metrics.
3499message PasspointProvisionStats {
3500  enum ProvisionFailureCode {
3501    // provisioning failure for unknown reason.
3502    OSU_FAILURE_UNKNOWN = 0;
3503
3504    // The reason code for Provisioning Failure due to connection failure to OSU AP.
3505    OSU_FAILURE_AP_CONNECTION = 1;
3506
3507    // The reason code for invalid server URL address.
3508    OSU_FAILURE_SERVER_URL_INVALID = 2;
3509
3510    // The reason code for provisioning failure due to connection failure to the server.
3511    OSU_FAILURE_SERVER_CONNECTION = 3;
3512
3513    // The reason code for provisioning failure due to invalid server certificate.
3514    OSU_FAILURE_SERVER_VALIDATION = 4;
3515
3516    // The reason code for provisioning failure due to invalid service provider.
3517    OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5;
3518
3519    // The reason code for provisioning failure when a provisioning flow is aborted.
3520    OSU_FAILURE_PROVISIONING_ABORTED = 6;
3521
3522    // The reason code for provisioning failure when a provisioning flow is not possible.
3523    OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;
3524
3525    // The reason code for provisioning failure due to invalid web url format for an OSU web page.
3526    OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8;
3527
3528    // The reason code for provisioning failure when a command received is not the expected command
3529    // type.
3530    OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9;
3531
3532    // The reason code for provisioning failure when a SOAP message is not the expected message
3533    // type.
3534    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10;
3535
3536    // The reason code for provisioning failure when a SOAP message exchange fails.
3537    OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11;
3538
3539    // The reason code for provisioning failure when a redirect listener fails to start.
3540    OSU_FAILURE_START_REDIRECT_LISTENER = 12;
3541
3542    // The reason code for provisioning failure when a redirect listener timed out to receive a HTTP
3543    // redirect response.
3544    OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13;
3545
3546    // The reason code for provisioning failure when there is no OSU activity to listen to intent.
3547    OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14;
3548
3549    // The reason code for provisioning failure when the status of a SOAP message is not the
3550    // expected message status.
3551    OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15;
3552
3553    // The reason code for provisioning failure when there is no PPS MO.
3554    OSU_FAILURE_NO_PPS_MO = 16;
3555
3556    // The reason code for provisioning failure when there is no AAAServerTrustRoot node in a PPS
3557    // MO.
3558    OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17;
3559
3560    // The reason code for provisioning failure when there is no TrustRoot node for remediation
3561    // server in a PPS MO.
3562    OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18;
3563
3564    // The reason code for provisioning failure when there is no TrustRoot node for policy server in
3565    // a PPS MO.
3566    OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19;
3567
3568    // The reason code for provisioning failure when failing to retrieve trust root certificates
3569    // used for validating server certificate for AAA, Remediation and Policy server.
3570    OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20;
3571
3572    // The reason code for provisioning failure when there is no trust root certificate for AAA
3573    // server.
3574    OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21;
3575
3576    // The reason code for provisioning failure when a {@link PasspointConfiguration} is failed to
3577    // install.
3578    OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22;
3579
3580    // The reason code for provisioning failure when an {@link OsuProvider} is not found for
3581    // provisioning.
3582    OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23;
3583  }
3584
3585  // Number of passpoint provisioning success
3586  optional int32 num_provision_success = 1;
3587
3588  // Count for passpoint provisioning failure
3589  repeated ProvisionFailureCount provision_failure_count = 2;
3590
3591  // Number of occurrences of a specific passpoint provision failure code
3592  message ProvisionFailureCount {
3593    // Failure code
3594    optional ProvisionFailureCode failure_code = 1;
3595
3596    // Number of failure for the failure_code.
3597    optional int32 count = 2;
3598  }
3599}
3600
3601// Counts number of networks on the device that are metered.
3602message MeteredNetworkStats {
3603  // Number of networks that are set or detected as metered.
3604  optional int32 num_metered = 1 [default = 0];
3605
3606  // Number of networks that are set or detected as unmetered.
3607  optional int32 num_unmetered = 2;
3608
3609  // Number of networks that have meteredOverride set to metered.
3610  optional int32 num_override_metered = 3;
3611
3612  // Number of networks that have meteredOverride set to unmetered.
3613  optional int32 num_override_unmetered = 4;
3614}
3615
3616// An event capturing user action on wifi
3617message UserActionEvent {
3618  enum EventType {
3619    // The default and unused event
3620    EVENT_UNKNOWN = 0;
3621    // User forgets the network
3622    EVENT_FORGET_WIFI = 1;
3623    // User manually triggers disconnect
3624    EVENT_DISCONNECT_WIFI = 2;
3625    // User changes the metered setting to "metered"
3626    EVENT_CONFIGURE_METERED_STATUS_METERED = 3;
3627    // User changes the metered setting to "unmetered"
3628    EVENT_CONFIGURE_METERED_STATUS_UNMETERED = 4;
3629    // User changes the mac randomization setting to use random MAC
3630    EVENT_CONFIGURE_MAC_RANDOMIZATION_ON = 5;
3631    // User changes the mac randomization setting to use factory MAC
3632    EVENT_CONFIGURE_MAC_RANDOMIZATION_OFF = 6;
3633    // User sets auto-connect to on
3634    EVENT_CONFIGURE_AUTO_CONNECT_ON = 7;
3635    // User sets auto-connect to off
3636    EVENT_CONFIGURE_AUTO_CONNECT_OFF = 8;
3637    // User toggles wifi on
3638    EVENT_TOGGLE_WIFI_ON = 9;
3639    // User toggles wifi off
3640    EVENT_TOGGLE_WIFI_OFF = 10;
3641    // User manually connects to a network
3642    EVENT_MANUAL_CONNECT = 11;
3643    // User changes the metered setting to "detect automatically"
3644    EVENT_CONFIGURE_METERED_STATUS_AUTO = 12;
3645    // User adds a new network or updates configurations for an existing network.
3646    EVENT_ADD_OR_UPDATE_NETWORK = 13;
3647    // User sets the adaptive connectivity to on
3648    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_ON = 14;
3649    // User sets the adaptive connectivity to off
3650    EVENT_CONFIGURE_ADAPTIVE_CONNECTIVITY_OFF = 15;
3651    // User restarts wifi subsystem
3652    EVENT_RESTART_WIFI_SUB_SYSTEM = 16;
3653  }
3654
3655  // The type of user action
3656  optional EventType event_type = 1;
3657
3658  // The start time of the event in milliseconds since boot.
3659  optional int64 start_time_millis = 2;
3660
3661  // Additional information on the target network for the action. This is not applicable and will
3662  // be null for some actions such as EVENT_TOGGLE_WIFI_ON.
3663  optional TargetNetworkInfo target_network_info = 3;
3664
3665  // Information about the currently connected network.
3666  optional WifiStatus wifi_status = 4;
3667
3668  // Reasons why the network applicable for this user action is disabled.
3669  // Normally this should be referring to the currently connected network.
3670  // For a manual connection, this is referring to the user selected networks.
3671  optional NetworkDisableReason network_disable_reason = 5;
3672}
3673
3674message WifiStatus {
3675  // Wifi is connected.
3676  optional bool is_connected = 1;
3677
3678  // Wifi is validated
3679  optional bool is_validated = 2;
3680
3681  // The last observed RSSI
3682  optional sint32 last_rssi = 3;
3683
3684  // Estimated TX
3685  optional int32 estimated_tx_kbps = 4;
3686
3687  // Estimated RX
3688  optional int32 estimated_rx_kbps = 5;
3689
3690  // There is another candidate with better score, but user connect choice is preventing the switch.
3691  optional bool is_stuck_due_to_user_connect_choice = 6;
3692}
3693
3694// Additional information on a network
3695message TargetNetworkInfo {
3696  // Whether the network is an ephemeral network.
3697  optional bool is_ephemeral = 1;
3698
3699  // Whether the target is a passpoint network.
3700  optional bool is_passpoint = 2;
3701}
3702
3703// Reasons why a configuration or BSSID is disabled.
3704message NetworkDisableReason {
3705  enum DisableReason {
3706    // Default value, should not be used.
3707    REASON_UNKNOWN = 0;
3708    // AP unable to accept more clients, a special kind of association rejection failure.
3709    REASON_AP_UNABLE_TO_HANDLE_NEW_STA = 1;
3710    // No internet
3711    REASON_NETWORK_VALIDATION_FAILURE = 2;
3712    // Password is incorrect, a special kind of authentication failure.
3713    REASON_WRONG_PASSWORD = 3;
3714    // Incorrect EAP credentials.
3715    REASON_EAP_FAILURE = 4;
3716    // Other association rejection failures.
3717    REASON_ASSOCIATION_REJECTION = 5;
3718    // Associated timeout failures.
3719    REASON_ASSOCIATION_TIMEOUT = 6;
3720    // Other authentication failures.
3721    REASON_AUTHENTICATION_FAILURE = 7;
3722    // DHCP failures.
3723    REASON_DHCP_FAILURE = 8;
3724    // Device disconnected shortly after connection.
3725    REASON_ABNORMAL_DISCONNECT = 9;
3726    // AP initiated disconnect for a given duration.
3727    REASON_FRAMEWORK_DISCONNECT_MBO_OCE = 10;
3728    // Avoid connecting to the failed AP when trying to reconnect on other available candidates.
3729    REASON_FRAMEWORK_DISCONNECT_FAST_RECONNECT = 11;
3730    // The connected scorer has disconnected this network.
3731    REASON_FRAMEWORK_DISCONNECT_CONNECTED_SCORE = 12;
3732    // The network is disabled due to absence of user credentials
3733    REASON_AUTHENTICATION_NO_CREDENTIALS = 13;
3734    // The network is disabled because service is not subscribed, a special kind of EAP failure.
3735    REASON_AUTHENTICATION_NO_SUBSCRIPTION = 14;
3736    // User disabled auto-join for this network.
3737    REASON_AUTO_JOIN_DISABLED = 15;
3738  }
3739
3740  // The reason for disabling a network.
3741  optional DisableReason disable_reason = 1;
3742
3743  // The configuration is temporarily disabled.
3744  optional bool config_temporarily_disabled = 2;
3745
3746  // The configuration is disabled until the user manually re-enables it.
3747  optional bool config_permanently_disabled = 3;
3748
3749  // Reasons why 1 or more BSSIDs are temporarily disabled.
3750  repeated DisableReason bssid_disable_reasons = 4;
3751}
3752
3753// Number of networks with a large change of connection/disconnection
3754// failure rate or high failure rate at high RSSI
3755message HealthMonitorFailureStats {
3756  // Number of networks with a large change of (or high) association rejection rate
3757  optional int32 cnt_assoc_rejection = 1;
3758  // Number of networks with a large change of (or high) association timeout rate
3759  optional int32 cnt_assoc_timeout = 2;
3760  // Number of networks with a large change of (or high) auth failure rate
3761  optional int32 cnt_auth_failure = 3;
3762  // Number of networks with a large change of (or high) connection failure rate
3763  optional int32 cnt_connection_failure = 4;
3764  // Number of networks with a large change of (or high) nonlocal disconnection rate
3765  optional int32 cnt_disconnection_nonlocal = 5;
3766  // Number of networks with a large change of (or high) short disconnection rate
3767  optional int32 cnt_short_connection_nonlocal = 6;
3768  // Number of networks with a large change of (or high) disconnection-during-connecting rate
3769  optional int32 cnt_disconnection_nonlocal_connecting = 7;
3770}
3771
3772// Metrics collected by health monitor
3773message HealthMonitorMetrics {
3774  // Number of networks with a large increase (compared to stats of previous build) of
3775  // connection/disconnection failure rate
3776  optional HealthMonitorFailureStats failure_stats_increase = 1;
3777  // Number of networks with a large decrease (compared to stats of previous build) of
3778  // connection/disconnection failure rate
3779  optional HealthMonitorFailureStats failure_stats_decrease = 2;
3780  // Number of networks with high connection/disconnection failure rate for
3781  // current build but without sufficient connection attempts for previous build
3782  optional HealthMonitorFailureStats failure_stats_high = 3;
3783  // Number of networks with sufficient connection attempts for current build
3784  // but without suffcient connection attempts for previous build
3785  optional int32 num_network_sufficient_recent_stats_only = 4;
3786  // Number of networks with sufficient connection attempts for both current and previous builds
3787  optional int32 num_network_sufficient_recent_prev_stats = 5;
3788}
3789
3790// Connection duration statistics collected under various health conditions
3791// while Wifi link layer stats report are on
3792message ConnectionDurationStats {
3793  // Total time with sufficient Wifi throughput and with cellular data on
3794  optional int32 total_time_sufficient_throughput_ms = 1;
3795  // Total time with insufficient Wifi throughput and with cellular data on
3796  optional int32 total_time_insufficient_throughput_ms = 2;
3797  // Total time with cellular data off
3798  optional int32 total_time_cellular_data_off_ms = 3;
3799  // Total time with insufficient Wifi throughput and with cellular data on
3800  // while wifi is the default network
3801  optional int32 total_time_insufficient_throughput_default_wifi_ms = 4;
3802}
3803
3804// Wi-Fi off metrics
3805// Keeps track of Wi-Fi off stats
3806message WifiOffMetrics {
3807  // Total number of Wi-Fi off
3808  optional int32 num_wifi_off = 1;
3809
3810  // Total number of Wi-Fi off with deferring
3811  optional int32 num_wifi_off_deferring = 2;
3812
3813  // Total number of Wi-Fi off deferring timeout
3814  optional int32 num_wifi_off_deferring_timeout = 3;
3815
3816  // Histogram of wifi off deferring time
3817  repeated Int32Count wifi_off_deferring_time_histogram = 4;
3818}
3819
3820// SoftAp Config  Limitation Metrics
3821message SoftApConfigLimitationMetrics {
3822  // Total number of softap security configuration reset to default because
3823  // hardware limitation when restore configuration from cloud
3824  optional int32 num_security_type_reset_to_default = 1;
3825
3826  // Total number of softap max client setting reset to default because
3827  // hardware limitation when restore configuration from cloud
3828  optional int32 num_max_client_setting_reset_to_default = 2;
3829
3830  // Total number of softap client control by user reset to default because
3831  // hardware limitation when restore configuration from cloud
3832  optional int32 num_client_control_by_user_reset_to_default = 3;
3833
3834  // Histogram of max client count when client connection fail because
3835  // setting limitation
3836  repeated Int32Count max_client_setting_when_reach_histogram = 4;
3837}
3838
3839// Channel utilization histogram
3840// The valid utilization range is between 0 and 255 corresponding to
3841// utilization ratio between 0 and 1
3842message ChannelUtilizationHistogram {
3843  // Histogram at 2G
3844  repeated HistogramBucketInt32 utilization_2g = 1;
3845  // Histogram above 2G
3846  repeated HistogramBucketInt32 utilization_above_2g = 2;
3847}
3848
3849// Throughput histogram
3850message ThroughputMbpsHistogram {
3851  // Tx histogram at 2G
3852  repeated HistogramBucketInt32 tx_2g = 1;
3853  // Tx histogram above 2G
3854  repeated HistogramBucketInt32 tx_above_2g = 2;
3855  // Rx histogram at 2G
3856  repeated HistogramBucketInt32 rx_2g = 3;
3857  // Rx histogram above 2G
3858  repeated HistogramBucketInt32 rx_above_2g = 4;
3859}
3860
3861// Initial Partial Scan stats
3862message InitPartialScanStats {
3863  // Total number of partial scans
3864  optional int32 num_scans = 1;
3865
3866  // Number of instances a partial scan results in finding a network
3867  optional int32 num_success_scans = 2;
3868
3869  // Number of instances a patial scan does not result in finding a network
3870  // and a follow up full scan finds a network.
3871  optional int32 num_failure_scans = 3;
3872
3873  // Histogram of number of channels used in a successful partial scan
3874  repeated HistogramBucketInt32 successful_scan_channel_count_histogram = 4;
3875
3876  // Histogram of number of channels used in a failed partial scan
3877  repeated HistogramBucketInt32 failed_scan_channel_count_histogram = 5;
3878}
3879
3880// User reaction to the carrier IMSI protection exemption UI
3881message UserReactionToApprovalUiEvent {
3882  enum UserActionCode {
3883    // UNKNOWN user action.
3884    ACTION_UNKNOWN = 0;
3885    // Action user allowed.
3886    ACTION_ALLOWED = 1;
3887    // Action user disallowed.
3888    ACTION_DISALLOWED = 2;
3889    // Action user dismiss.
3890    ACTION_DISMISS = 3;
3891  }
3892  message UserReaction {
3893    // User action to the UI.
3894    optional UserActionCode user_action = 1;
3895    // Is UI a dialog or notification.
3896    optional bool is_dialog = 2;
3897  }
3898
3899  // Event of user reaction to the app approval UI.
3900  repeated UserReaction user_approval_app_ui_reaction = 1;
3901
3902  // Event of user reaction to the carrier approval UI.
3903  repeated UserReaction user_approval_carrier_ui_reaction = 2;
3904}
3905
3906message CarrierWifiMetrics {
3907  // Number of successful network connection using Carrier ID
3908  optional int32 num_connection_success = 1;
3909  // Number of failed authentication from network connection using Carrier ID
3910  optional int32 num_connection_auth_failure = 2;
3911  optional int32 num_connection_non_auth_failure = 3;
3912}
3913
3914message FirstConnectAfterBootStats {
3915  message Attempt {
3916    // The attempt completion timestamp, in milliseconds since boot.
3917    optional int64 timestamp_since_boot_millis = 1;
3918
3919    // whether the attempt was successful.
3920    optional bool is_success = 2;
3921  }
3922
3923  // Info about whether Wifi was enabled at boot time.
3924  // `is_success` is true if Wifi is toggled ON at boot, false otherwise.
3925  // This field will never be null.
3926  optional Attempt wifi_enabled_at_boot = 1;
3927
3928  // Info about the first network selection attempt for auto-join.
3929  // `is_success` is true if a network candidate was found, false otherwise.
3930  // This field is null if `wifi_enabled_at_boot.is_success` is false.
3931  optional Attempt first_network_selection = 2;
3932
3933  // Info about the first successful L2 connection.
3934  // `is_success` is true if the L2 connection was successfully established, false otherwise.
3935  // This field is null if `first_network_selection.is_success` is false.
3936  optional Attempt first_l2_connection = 3;
3937
3938  // Info about the first successful L3 connection.
3939  // `is_success` is true if the L3 connection was successfully established, false otherwise.
3940  // This field is null if `first_l2_connection.is_success` is false.
3941  optional Attempt first_l3_connection = 4;
3942}
3943
3944// Stats for Autojoin switches between Wifi networks. Does not include user/app-initiated switches.
3945message WifiToWifiSwitchStats {
3946  // Whether Make Before Break is supported by the hardware and enabled.
3947  optional bool is_make_before_break_supported = 1;
3948
3949  // Number of times Wifi to Wifi switch was triggered. This includes Make Before Break and Break
3950  // Before Make.
3951  optional int32 wifi_to_wifi_switch_trigger_count = 2;
3952
3953  // Number of times Wifi to Wifi switch was triggered using Make Before Break (MBB).
3954  // Note that MBB may not always be used for various reasons e.g. no additional iface available due
3955  // to ongoing SoftAP, both old and new network have MAC randomization disabled, etc.
3956  // TODO(b/180974604): also add metrics for the various reasons to not use MBB even when it is
3957  //  supported by the device.
3958  optional int32 make_before_break_trigger_count = 3;
3959
3960  // TODO(b/180974604): add metrics for L2 failure and L3 failure
3961
3962  // Number of times Make Before Break was aborted due to the new network not having internet.
3963  optional int32 make_before_break_no_internet_count = 4;
3964
3965  // Number of times where, for some reason, Make Before Break resulted in the loss of the primary
3966  // ClientModeManager, and we needed to recover by making one of the SECONDARY_TRANSIENT
3967  // ClientModeManagers primary.
3968  optional int32 make_before_break_recover_primary_count = 5;
3969
3970  // Number of times the new network in Make Before Break had its internet connection validated.
3971  optional int32 make_before_break_internet_validated_count = 6;
3972
3973  // Number of times the new network was made primary in Make Before Break.
3974  // TODO(b/180974604): add metrics for the various ways this could fail.
3975  optional int32 make_before_break_success_count = 7;
3976
3977  // Number of times the old network in Make Before Break completed lingering and was disconnected.
3978  optional int32 make_before_break_linger_completed_count = 8;
3979
3980  // Histogram of lingering duration caused by make before break in seconds.
3981  repeated Int32Count make_before_break_linger_duration_seconds = 9;
3982}
3983
3984// Network layer bandwidth estimator stats
3985message BandwidthEstimatorStats {
3986  // Bandwidth stats of each signal level
3987  message PerLevel {
3988    // Signal level derived by RssiUtil.calculateSignalLevel based on RSSI
3989    optional uint32 signal_level = 1;
3990    // Accumulated bandwidth sample count
3991    optional uint32 count = 2;
3992    // Average network layer bandwidth in kbps based on TrafficStats byte count and radio on time
3993    // of link layer stats.
3994    optional uint32 avg_bandwidth_kbps = 3;
3995    // Error of layer 2 link bandwidth in percent
3996    optional uint32 l2_error_percent = 4;
3997    // Error of network layer bandwidth estimation in percent
3998    optional uint32 bandwidth_est_error_percent = 5;
3999  }
4000
4001  // Bandwidth stats of each link
4002  message PerLink {
4003    repeated PerLevel level = 1;
4004  }
4005
4006  // Bandwidth stats of each band
4007  message PerBand {
4008    // Tx bandwidth stats
4009    optional PerLink tx = 1;
4010    // Rx bandwidth stats
4011    optional PerLink rx = 2;
4012  }
4013
4014  // Stats of 2g band
4015  optional PerBand stats_2g = 1;
4016  // Stats of above-2g band
4017  optional PerBand stats_above_2g = 2;
4018}
4019
4020