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