• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 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 android.os.statsd.wifi;
20
21import "frameworks/proto_logging/stats/atom_field_options.proto";
22import "frameworks/proto_logging/stats/atoms.proto";
23import "frameworks/proto_logging/stats/enums/stats/connectivity/network_stack.proto";
24import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
25import "frameworks/proto_logging/stats/attribution_node.proto";
26
27option java_package = "com.android.os.wifi";
28option java_multiple_files = true;
29
30extend Atom {
31    // Push metrics
32    optional WifiAwareNdpReported wifi_aware_ndp_reported = 638 [(module) = "wifi"];
33    optional WifiAwareAttachReported wifi_aware_attach_reported = 639 [(module) = "wifi"];
34    optional WifiSelfRecoveryTriggered wifi_self_recovery_triggered = 661 [(module) = "wifi"];
35    optional SoftApStarted soft_ap_started = 680 [(module) = "wifi"];
36    optional SoftApStopped soft_ap_stopped = 681 [(module) = "wifi"];
37    optional WifiLockReleased wifi_lock_released = 687 [(module) = "wifi"];
38    optional WifiLockDeactivated wifi_lock_deactivated = 688 [(module) = "wifi"];
39    optional WifiConfigSaved wifi_config_saved = 689 [(module) = "wifi"];
40    optional WifiAwareResourceUsingChanged wifi_aware_resource_using_changed
41        = 690 [(module) = "wifi"];
42    optional WifiAwareHalApiCalled wifi_aware_hal_api_called = 691 [(module) = "wifi"];
43    optional WifiLocalOnlyRequestReceived wifi_local_only_request_received
44        = 692 [(module) = "wifi"];
45    optional WifiLocalOnlyRequestScanTriggered wifi_local_only_request_scan_triggered
46        = 693 [(module) = "wifi"];
47    optional WifiThreadTaskExecuted wifi_thread_task_executed = 694 [(module) = "wifi"];
48    optional WifiStateChanged wifi_state_changed = 700 [(module) = "wifi"];
49    optional PnoScanStarted pno_scan_started = 719 [(module) = "wifi"];
50    optional PnoScanStopped pno_scan_stopped = 720 [(module) = "wifi"];
51    optional WifiIsUnusableReported wifi_is_unusable_reported = 722 [(module) = "wifi"];
52    optional WifiApCapabilitiesReported wifi_ap_capabilities_reported= 723 [(module) = "wifi"];
53    optional SoftApStateChanged soft_ap_state_changed = 805 [(module) = "wifi"];
54    optional ScorerPredictionResultReported scorer_prediction_result_reported = 884 [(module) = "wifi"];
55    optional WifiSoftApCallbackOnClientsDisconnected wifi_soft_ap_callback_on_clients_disconnected
56        = 1010 [(module) = "wifi"];
57
58    // Pull metrics
59    optional WifiAwareCapabilities wifi_aware_capabilities = 10190 [(module) = "wifi"];
60    optional WifiModuleInfo wifi_module_info = 10193 [(module) = "wifi"];
61    optional WifiSettingInfo wifi_setting_info = 10194 [(module) = "wifi"];
62    optional WifiComplexSettingInfo wifi_complex_setting_info = 10195 [(module) = "wifi"];
63    optional WifiConfiguredNetworkInfo wifi_configured_network_info = 10198 [(module) = "wifi"];
64}
65
66/**
67 * Pulled atom for tracking wifi version number.
68 */
69message WifiModuleInfo {
70    enum BuildType {
71        TYPE_UNKNOWN = 0;
72        TYPE_BUILT_FROM_SOURCE = 1;
73        TYPE_PREBUILT = 2;
74    }
75    // Version number of the wifi module
76    optional int32 version_number = 1;
77    // The type of the wifi module
78    optional BuildType build_type = 2;
79}
80
81
82/**
83 * Logged when wifi aware data path is completed
84 */
85message WifiAwareNdpReported {
86    enum Role {
87        ROLE_UNKNOWN = 0;
88        ROLE_INITIATOR = 1;
89        ROLE_RESPONDER = 2;
90    }
91    // Role of data path
92    optional Role role = 1;
93    // If it is over out-of-band
94    optional bool is_out_of_band = 2;
95    // Status of NDP
96    optional android.net.wifi.AwareStatus status = 3;
97    // Duration to create NDP in millis.
98    optional int32 ndp_latency_ms= 4;
99    // The latency of discovery + NDP in millis.
100    optional int32 discovery_ndp_latency_ms= 5;
101    // Channel frequency in MHz, 0 if unavailable, >= 2400 otherwise.
102    optional int32 channel_frequency_mhz= 6;
103    // If the instant mode is enabled
104    optional bool is_instant_mode = 7;
105    // The caller type of the NDP request
106    optional android.net.wifi.WifiCallerType caller_type = 8;
107    // The Attribution tag to identify the caller
108    optional string attribution_tag = 9;
109    // The uid of the caller
110    optional int32 uid = 10 [(is_uid) = true];
111}
112
113/**
114 * Logged when wifi aware attach is completed
115 */
116message WifiAwareAttachReported {
117    // Status of attach
118    optional android.net.wifi.AwareStatus status = 1;
119    // The caller type of the attach
120    optional android.net.wifi.WifiCallerType caller_type = 2;
121    // The Attribution tag to identify the caller
122    optional string attribution_tag = 3;
123    // The uid of the caller
124    optional int32 uid = 4 [(is_uid) = true];
125}
126
127/**
128 * Logged when wifi self recovery triggered
129 */
130message WifiSelfRecoveryTriggered {
131    enum Reason {
132        REASON_UNKNOWN = 0;
133        REASON_LAST_RESORT_WDOG = 1;
134        REASON_WIFINATIVE_FAILURE = 2;
135        REASON_STA_IFACE_DOWN = 3;
136        REASON_API_CALL = 4;
137        REASON_SUBSYSTEM_RESTART = 5;
138        REASON_IFACE_ADDED = 6;
139    }
140    enum Result {
141        RES_UNSPECIFIED = 0;
142        RES_RESTART_SUCCESS = 1;
143        RES_INVALID_REASON = 2;
144        RES_IFACE_DOWN = 3;
145        RES_IFACE_ADD_DISABLED = 4;
146        RES_RETRY_DISABLED = 5;
147        RES_ABOVE_MAX_RETRY = 6;
148        RES_RESTART_FAILURE = 7;
149        RES_RESTART_STARTED_INTERNAL_RECOVERY = 8;
150        RES_RESTART_STARTED_INTERNAL_RECOVERY_BY_NATIVE_CALLBACK = 9;
151    }
152
153    // Trigger reason
154    optional Reason reason = 1;
155    // Self recovery result
156    optional Result result = 2;
157    // Record time elapsed from last trigger event
158    optional int64 time_elapsed_from_last_millis = 3;
159}
160
161/**
162 * Logged when SoftAp is started or stopped.
163 */
164message SoftApStateChanged {
165    enum HotspotState {
166        // Unknown - reserved field for invalid data
167        STATE_UNKNOWN = 0;
168
169        // SoftAp is on
170        STATE_OFF = 1;
171
172        // SoftAp is off
173        STATE_ON = 2;
174    }
175
176    // New hotspot state.
177    optional HotspotState hotspot_on = 1 [
178        (state_field_option).exclusive_state = true,
179        (state_field_option).nested = false
180    ];
181}
182
183/**
184 * Logged when Soft AP is started
185 */
186message SoftApStarted {
187    /**
188     * Result of starting Soft AP
189     */
190    enum StartResult {
191        // Unknown
192        START_RESULT_UNKNOWN = 0;
193        // Successful start
194        START_RESULT_SUCCESS = 1;
195        // General failure
196        START_RESULT_FAILURE_GENERAL = 2;
197        // Failed due to no channel available
198        START_RESULT_FAILURE_NO_CHANNEL = 3;
199        // Failed due to config being unsupported
200        START_RESULT_FAILURE_UNSUPPORTED_CONFIG = 4;
201        // Failed to start the HAL
202        START_RESULT_FAILURE_START_HAL = 5;
203        // Failed to start hostapd
204        START_RESULT_FAILURE_START_HOSTAPD = 6;
205        // Failed due to interface conflict with user rejection
206        START_RESULT_FAILURE_INTERFACE_CONFLICT_USER_REJECTED = 7;
207        // Failed due to interface conflict
208        START_RESULT_FAILURE_INTERFACE_CONFLICT = 8;
209        // Failed to create interface in vendor HAL
210        START_RESULT_FAILURE_CREATE_INTERFACE = 9;
211        // Failed to set country code
212        START_RESULT_FAILURE_SET_COUNTRY_CODE = 10;
213        // Failed to set mac address
214        START_RESULT_FAILURE_SET_MAC_ADDRESS = 11;
215        // Failed to register AP callback with hostapd
216        START_RESULT_FAILURE_REGISTER_AP_CALLBACK_HOSTAPD = 12;
217        // Failed to register AP callback with wificond
218        START_RESULT_FAILURE_REGISTER_AP_CALLBACK_WIFICOND = 13;
219        // Failed to add AP to hostapd
220        START_RESULT_FAILURE_ADD_AP_HOSTAPD = 14;
221    }
222    // Result of the start event
223    optional StartResult result = 1;
224    // Role of the Soft AP
225    optional android.net.wifi.SoftApRole role = 2;
226    // First band bitmask indexed by WifiBandBucket
227    optional int32 band1 = 3;
228    // Second band bitmask indexed by WifiBandBucket
229    optional int32 band2 = 4;
230    // Whether DBS is supported or not
231    optional bool dbs_supported = 5;
232    // STA + AP concurrency capability of the device
233    optional android.net.wifi.StaApConcurrency sta_ap_concurrency = 6;
234    // STA connection status at the time of starting
235    optional android.net.wifi.StaStatus sta_status = 7;
236    // Authentication type of the Soft AP
237    optional android.net.wifi.WifiAuthType auth_type = 8;
238    // The uid of the caller
239    optional int32 uid = 9 [(is_uid) = true];
240}
241
242/**
243 * Logged when Soft AP is stopped
244 */
245message SoftApStopped {
246    /**
247     * Type of Soft AP stop event
248     */
249    enum StopEvent {
250        // Unknown
251        STOP_EVENT_UNKNOWN = 0;
252        // Stopped by the user
253        STOP_EVENT_STOPPED = 1;
254        // Stopped due to interface down
255        STOP_EVENT_INTERFACE_DOWN = 2;
256        // Stopped due to interface destroyed
257        STOP_EVENT_INTERFACE_DESTROYED = 3;
258        // Stopped due to hostapd failure
259        STOP_EVENT_HOSTAPD_FAILURE = 4;
260        // Stopped due to no usage timeout
261        STOP_EVENT_NO_USAGE_TIMEOUT = 5;
262    }
263    // Soft AP stop event
264    optional StopEvent stop_event = 1;
265    // Role of the Soft AP
266    optional android.net.wifi.SoftApRole role = 2;
267    // Band of the Soft AP at the time of stopping
268    optional int32 band = 3;
269    // Whether the Soft AP is DBS
270    optional bool is_dbs = 4;
271    // STA + AP concurrency capability of the device
272    optional android.net.wifi.StaApConcurrency sta_ap_concurrency = 5;
273    // STA connection status at the time of stopping
274    optional android.net.wifi.StaStatus sta_status = 6;
275    // Whether or not the no usage timeout is enabled
276    optional bool is_timeout_enabled = 7;
277    // Duration of the session in seconds
278    optional int32 session_duration_seconds = 8;
279    // Authentication type of the Soft AP
280    optional android.net.wifi.WifiAuthType auth_type = 9;
281    // Wi-Fi standard of the Soft AP
282    optional android.net.wifi.WifiStandard standard = 10;
283    // Max num of associated clients for the entire session
284    optional int32 max_clients = 11;
285    // Whether or not the opportunistic no usage timeout for DBS is enabled
286    optional bool is_dbs_timeout_enabled = 12;
287    // Band of the DBS instance that failed, if any
288    optional int32 dbs_instance_failure_band = 13;
289    // Band of the DBS instance that timed out, if any
290    optional int32 dbs_instance_timeout_band = 14;
291    // Upstream transport type at the time of stopping
292    optional android.stats.connectivity.TransportType upstream_transport = 15;
293}
294
295/**
296 * Logged when wifi lock is released
297 */
298message WifiLockReleased {
299    // The AttributionNode to identify the caller
300    repeated AttributionNode attribution_node = 1;
301    // Permission model of the caller
302    optional android.net.wifi.WifiCallerType caller_type = 2;
303    // Lock mode
304    optional android.net.wifi.WifiModeEnum mode = 3;
305    // For how long the lock is acquired in milliseconds
306    optional int64 acquired_duration_ms = 4;
307    // Whether power save disable is allowed during lock acquire
308    optional bool is_powersave_disable_allowed = 5;
309    // Whether the application which acquired the lock is exempted from screen ON
310    optional bool is_app_exempted_from_screen_on = 6;
311    // Whether the application which acquired the lock is exempted from being foreground
312    optional bool is_app_exempted_from_foreground = 7;
313}
314
315/**
316 * Logged when wifi lock is deactivated
317 */
318message WifiLockDeactivated {
319    // The AttributionNode to identify the caller
320    repeated AttributionNode attribution_node = 1;
321    // Lock mode
322    optional android.net.wifi.WifiModeEnum mode = 2;
323    // For how long the lock is activated in milliseconds
324    optional int64 activated_duration_ms = 3;
325    // Whether power save disable is allowed during the lock activation
326    optional bool is_powersave_disable_allowed = 4;
327    // Whether the application which activated the lock is exempted from screen ON
328    optional bool is_exempted_from_screen_on = 5;
329    // Whether the application which activated the lock is exempted from being foreground
330    optional bool is_exempted_from_foreground = 6;
331}
332
333/**
334 * Pull metrics for the Wifi Aware capabilities supported by the device
335 */
336message WifiAwareCapabilities {
337    // If instant mode supported
338    optional bool is_instant_mode_supported = 1;
339    // If pairing supported
340    optional bool is_pairing_supported = 2;
341    // If suspension supported
342    optional bool is_suspension_supported = 3;
343    // Supported cipher suites
344    optional int32 cipher_suites = 4;
345    // Max number of the NDI
346    optional int32 ndi_number = 5;
347    // Max number of the NDP
348    optional int32 ndp_number = 6;
349    // Max number of the discovery session
350    optional int32 discovery_session_number = 7;
351}
352
353// Logged when the Wifi Aware resources is used by Apps
354message WifiAwareResourceUsingChanged {
355    optional int32 ndp_num = 1;
356    optional int32 discovery_session_num = 2;
357}
358
359/**
360 * Logged when Aware HAL API is called and send response
361 */
362message WifiAwareHalApiCalled {
363    // The API name
364    optional android.net.wifi.AwareHalApi command = 1;
365    // Status of the API call
366    optional android.net.wifi.AwareStatus status = 2;
367    // The time for this API call to execute
368    optional int32 running_time_ms = 3;
369}
370
371/**
372 * Logged when local-only request received
373 */
374message WifiLocalOnlyRequestReceived {
375    enum UserAction {
376        USER_UNSPECIFIED = 0;
377        USER_BYPASS = 1;
378        USER_ACCEPT = 2;
379        USER_REJECT = 3;
380    }
381    // The AttributionNode to identify the caller
382    repeated AttributionNode attribution_node = 1;
383    // User action on the local-only request
384    optional UserAction action = 2;
385    // The caller type of the request
386    optional android.net.wifi.WifiCallerType caller_type = 3;
387}
388
389// Logged when matched scan result received for local only request
390message WifiLocalOnlyRequestScanTriggered {
391    // The AttributionNode to identify the caller
392    repeated AttributionNode attribution_node = 1;
393    // How many channel specified in the request
394    optional int32 number_channel_specified = 2;
395    // Scan time to get a match
396    optional int32 match_delay_ms = 3;
397    // The caller type of the request
398    optional android.net.wifi.WifiCallerType caller_type = 4;
399}
400
401// Logged when a task on the Wifi thread is executed
402message WifiThreadTaskExecuted {
403    // How long does it take to execute the task
404    optional int32 running_time_ms = 1;
405    // How long does it take to start execute the task
406    optional int32 blocking_time_ms = 2;
407    // The name of the internal task running on Wifi Thread
408    optional string task_name = 3;
409}
410
411// Logged when Wifi config save to storage triggered
412message WifiConfigSaved {
413    // How long does it cost to save all config
414    optional int32 running_time_ms = 1;
415}
416
417// Logged when Wi-Fi state change happens.
418message WifiStateChanged {
419    // If Wi-Fi was enabled
420    optional bool wifi_enabled = 1;
421    // If Wi-Fi Wake feature was enabled
422    optional bool wifi_wake_enabled = 2;
423    // If the state change was due to Wi-Fi Wake
424    optional bool enabled_by_wifi_wake = 3;
425}
426
427// Logged when a PNO scan is started.
428message PnoScanStarted {
429    // Whether this scan includes Passpoint SSIDs
430    optional bool includes_passpoint_ssids = 1;
431}
432
433// Logged when a PNO scan is stopped.
434message PnoScanStopped {
435    enum StopReason {
436        UNSPECIFIED = 0;
437        SCAN_FAILED = 1;
438        FOUND_RESULTS = 2;
439    }
440
441    enum FailureCode {
442        // Default value. Error is unknown
443        UNSPECIFIED_FAILURE = 0;
444        // No error occurred
445        NO_FAILURE = 1;
446        // Wificond scan returned a failure
447        WIFICOND_SCAN_FAILURE = 2;
448        // An error occurred while requesting the wificond scan
449        WIFICOND_REQUEST_FAILURE = 3;
450        // WifiScanningService returned a failure
451        WIFI_SCANNING_SERVICE_FAILURE = 4;
452    }
453
454    // Reason that this scan stopped
455    optional StopReason stop_reason = 1;
456    // Number of results found by this scan
457    optional int32 num_results = 2;
458    // Whether we were scanning for Passpoint SSIDs
459    optional bool scanned_for_passpoint_ssids = 3;
460    // Whether any Passpoint results were found
461    optional bool includes_passpoint_results = 4;
462    // Whether this scan led to the selection of a connection candidate
463    optional bool candidate_selected = 5;
464    // Whether the connection candidate is a Passpoint network
465    optional bool candidate_is_passpoint = 6;
466    // Failure code if this scan stopped due to a failure
467    optional FailureCode failure_code = 7;
468}
469
470/**
471 * Pulled to indicate a single boolean Wifi setting.
472 */
473message WifiSettingInfo {
474    enum SettingName {
475        UNSPECIFIED = 0;
476        WIFI_SCAN_ALWAYS_AVAILABLE = 1;
477        WIFI_SCAN_THROTTLE = 2;
478        WIFI_SCORING = 3;
479        WIFI_PASSPOINT = 4;
480        WIFI_WAKE = 5;
481        WIFI_ENHANCED_MAC_RANDOMIZATION = 6;
482        WIFI_NETWORKS_AVAILABLE_NOTIFICATION = 7;
483        LOCATION_MODE = 8;
484        // A flag controlled by DeviceConfig to dry run external scorer or not.
485        EXTERNAL_SCORER_DRY_RUN = 9;
486    }
487
488    // Name of the Wifi setting
489    optional SettingName setting_name = 1;
490    // Whether the setting is enabled
491    optional bool enabled = 2;
492}
493
494/**
495 * Pulled to indicate a single non-boolean Wifi setting.
496 */
497message WifiComplexSettingInfo {
498    enum MultiInternetMode {
499        // Default value. Mode is unknown.
500        MULTI_INTERNET_MODE_UNSPECIFIED = 0;
501        // Simultaneous connection to multiple APs is disabled
502        MULTI_INTERNET_MODE_DISABLED = 1;
503        // Enabled but restricted to a single network on multiple bands
504        MULTI_INTERNET_MODE_DBS_AP = 2;
505        // Enabled and allowed to connect to multiple APs using different bands
506        MULTI_INTERNET_MODE_MULTI_AP = 3;
507    }
508
509    // Wifi multi-internet mode
510    optional MultiInternetMode multi_internet_mode = 1;
511}
512
513/**
514 * Logged for every Wi-Fi unusable event.
515 */
516message WifiIsUnusableReported {
517   enum ReportType {
518      // Default/Invalid
519      TYPE_UNKNOWN = 0;
520      // There is a data stall from tx failures
521      TYPE_DATA_STALL_BAD_TX = 1;
522      // There is a data stall from rx failures
523      TYPE_DATA_STALL_TX_WITHOUT_RX = 2;
524      // There is a data stall from both tx and rx failures
525      TYPE_DATA_STALL_BOTH = 3;
526      // Firmware generated an alert
527      TYPE_FIRMWARE_ALERT = 4;
528      // IP Manager lost reachability to network neighbors
529      TYPE_IP_REACHABILITY_LOST = 5;
530   }
531   // Type of this report
532   optional ReportType type = 1;
533   // External scorer UID if external scorer is enabled. Otherwise WIFI_UID for
534   // AOSP scorer.
535   optional int32 scorer_uid = 2 [(is_uid) = true];
536   // Whether or not Wi-Fi is predicted as usable by the scorer
537   // Note: 'is_wifi_predicted_as_usable' is deprectaed by 'wifi_predicted_usability_state'.
538   optional bool is_wifi_predicted_as_usable = 3;
539   // Wi-Fi usability state as predicted by the scorer
540   optional android.net.wifi.WifiPredictedUsabilityState wifi_predicted_usability_state = 4;
541}
542
543/**
544 * AP capabilities logged for every Wi-Fi connection
545 */
546message WifiApCapabilitiesReported {
547    /**
548     * Online certificate status protocol stapling type
549     */
550    enum OcspType {
551        TYPE_OCSP_UNKNOWN = 0;
552        // Do not use OCSP stapling
553        TYPE_OCSP_NONE = 1;
554        // Try to use OCSP stapling, but not require response
555        TYPE_OCSP_REQUEST_CERT_STATUS = 2;
556        // Require valid OCSP stapling response
557        TYPE_OCSP_REQUIRE_CERT_STATUS = 3;
558        // Require valid OCSP stapling response for all not-trusted certificates
559        // in the server certificate chain
560        TYPE_OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 4;
561    }
562
563    /**
564     * 6 GHz AP type as encoded in 'HE operation -> 6 GHz operation info -> Control ->
565     * Regulatory info'
566     */
567    enum ApType6GHz {
568       AP_TYPE_6HZ_UNKNOWN = 0;
569       AP_TYPE_6GHZ_INDOOR = 1;
570       AP_TYPE_6GHZ_STANDARD_POWER = 2;
571       AP_TYPE_6GHZ_LOW_POWER_INDOOR = 3;
572       AP_TYPE_6GHZ_VERY_LOW_POWER = 4;
573    }
574
575    // Whether roaming is initiated by the framework to connect this AP
576    optional bool is_framework_initiated_roaming = 1;
577    // The center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the
578    // connection was made.
579    optional int32 channel_frequency_mhz = 2;
580    // Band of the channel_frequency_mhz
581    optional android.net.wifi.WifiBandBucket band_mhz = 3;
582    // The DTIM period (in beacon periods) of the AP
583    optional int32 dtimPeriod = 4;
584    // Security mode of the connection
585    optional android.net.wifi.SecurityMode connected_security_mode = 5;
586    // Whether AP is hidden
587    optional bool is_hidden = 6;
588    // Whether the AP is configured incorrectly as hidden by the user
589    optional bool is_incorrectly_configured_as_hidden = 7;
590    // Wi-Fi standard of the connection
591    optional android.net.wifi.WifiStandard standard = 8;
592    // Whether IEEE 802.11b supported by the AP
593    optional bool is_11b_supported = 9;
594    // EAP type used by the AP
595    optional android.net.wifi.EapType eap_type = 10;
596    // EAP inner method used by the AP
597    optional android.net.wifi.EapInnerMethod eap_inner_method = 11;
598    // OCSP used by the AP
599    optional OcspType ocsp_type = 12;
600    // Whether the AP enabled PMK caching
601    optional bool is_pmk_caching_enabled = 13;
602    // Whether AP supports MBO
603    optional bool is_mbo_supported = 14;
604    // Whether AP supports OCE
605    optional bool is_oce_supported = 15;
606    // Whether the AP supports FILS
607    optional bool is_fils_supported = 16;
608    // Whether AP requires TWT support (individual or broadcast)
609    optional bool is_twt_required = 17;
610    // Whether the AP supports individual TWT agreements
611    optional bool is_individual_twt_supported = 18;
612    // Whether the AP supports broadcast TWT agreements
613    optional bool is_broadcast_twt_supported = 19;
614    // Whether the AP supports restricted TWT agreements
615    optional bool is_restricted_twt_supported = 20;
616    // Whether the AP supports IEEE 802.11mc
617    optional bool is_11mc_supported = 21;
618    // Whether the AP supports IEEE 802.11az
619    optional bool is_11az_supported = 22;
620    // Passpoint release version if a Passpoint connection, otherwise PassPointRelease.UNKNOWN
621    optional android.net.wifi.PasspointRelease passpoint_release = 23;
622    // If the Passpoint connection is provided by the Home provider or Roaming/visited network
623    optional bool is_passpoint_home_provider = 24;
624    // 6 GHz AP type
625    optional ApType6GHz ap_type_6ghz = 25;
626    // Whether AP supports ECPS priority access
627    optional bool is_ecps_priority_access_supported = 26;
628    // AP channel width for the connection
629    optional android.net.wifi.WifiChannelWidth channel_width_mhz = 27;
630}
631
632/*
633 * Pulled to indicate a single configured network on the device.
634 */
635message WifiConfiguredNetworkInfo {
636    enum MacRandomization {
637        // Default value. Mode is unknown
638        MAC_RANDOMIZATION_UNSPECIFIED = 0;
639        // Factory MAC is used when connecting to this network
640        MAC_RANDOMIZATION_NONE = 1;
641        // Randomized MAC is generated once and reused for all connections to this network
642        MAC_RANDOMIZATION_PERSISTENT = 2;
643        // Randomized MAC is used and is not persisted across connections to this network
644        MAC_RANDOMIZATION_NON_PERSISTENT = 3;
645        // Framework decides on the MAC randomization strategy
646        MAC_RANDOMIZATION_AUTO = 4;
647    }
648
649    enum MeteredOverride {
650        // Default value. Mode is unknown
651        METERED_OVERRIDE_UNSPECIFIED = 0;
652        // No metered override
653        METERED_OVERRIDE_NONE = 1;
654        // Override network to be metered
655        METERED_OVERRIDE_METERED = 2;
656        // Override network to be unmetered
657        METERED_OVERRIDE_NOT_METERED = 3;
658    }
659
660    enum TofuConfiguration {
661        // Default value.
662        TOFU_CONFIGURATION_UNSPECIFIED = 0;
663        // TOFU is not enabled on the enterprise config.
664        TOFU_CONFIGURATION_NOT_ENABLED = 1;
665        // TOFU is enabled pre-connection.
666        TOFU_CONFIGURATION_ENABLED_PRE_CONNECTION = 2;
667        // Root CA was configured post-TOFU connection.
668        TOFU_CONFIGURATION_CONFIGURE_ROOT_CA = 3;
669        // Certificate pinning was used post-TOFU connection.
670        TOFU_CONFIGURATION_CERT_PINNING = 4;
671    }
672
673    enum TofuDialogState {
674        // Default value.
675        TOFU_DIALOG_STATE_UNSPECIFIED = 0;
676        // Dialog was rejected by the user.
677        TOFU_DIALOG_STATE_REJECTED = 1;
678        // Dialog was accepted by the user.
679        TOFU_DIALOG_STATE_ACCEPTED = 2;
680    }
681
682    // Unique ID for this network
683    optional int64 network_id = 1;
684    // Whether this is an Enterprise network
685    optional bool is_enterprise = 2;
686    // Whether this is a hidden network
687    optional bool is_hidden = 3;
688    // Whether this is a Passpoint network
689    optional bool is_passpoint = 4;
690    // Whether this is a suggestion network
691    optional bool is_suggestion = 5;
692    // Whether this network has a UTF-8 SSID
693    optional bool is_utf_8_ssid = 6;
694    // Whether the SSID translation feature is enabled
695    optional bool is_ssid_translation_enabled = 7;
696    // Whether this network was configured using TOFU
697    optional bool configured_using_tofu = 8;
698    // Whether this network has encountered a captive portal
699    optional bool encountered_captive_portal = 9;
700    // Whether this network has auto-join enabled
701    optional bool auto_join_enabled = 10;
702    // Security mode used by this network
703    optional android.net.wifi.SecurityMode connected_security_mode = 11;
704    // MAC randomization setting used by this network
705    optional MacRandomization mac_randomization = 12;
706    // Metered override setting used by this network
707    optional MeteredOverride metered_override = 13;
708    // EAP type used by this network
709    optional android.net.wifi.EapType eap_type = 14;
710    // EAP inner authentication method used by this network
711    optional android.net.wifi.EapInnerMethod eap_inner_auth_method = 15;
712    // Whether this network supports free OpenRoaming
713    optional bool free_open_roaming_supported = 16;
714    // Whether this network supports settled OpenRoaming
715    optional bool settled_open_roaming_supported = 17;
716    // Trust On First Use (TOFU) configuration for this network
717    optional TofuConfiguration tofu_configuration = 18;
718    // Whether the user accepted the TOFU dialog
719    optional TofuDialogState tofu_dialog_state = 19;
720}
721
722/**
723 * Logged after each scorer prediction interval is completed.
724 */
725message ScorerPredictionResultReported {
726    enum UnusableEvent {
727        EVENT_UNKNOWN = 0;
728        EVENT_NONE = 1;
729        EVENT_FRAMEWORK_DATA_STALL = 2;
730        EVENT_IP_REACHABILITY_LOST = 3;
731        EVENT_FIRMWARE_ALERT = 4;
732        EVENT_OTHERS = 5;
733    }
734    enum DeviceState {
735        STATE_UNKNOWN = 0;
736        STATE_NO_CELLULAR_MODEM = 1; // Cellular modem not available
737        STATE_NO_SIM_INSERTED = 2; // SIM not inserted
738        STATE_SCORING_DISABLED = 3; // Measures theoretical performance. Collected when adaptive connectivity is toggled off on Pixel, or scoring is disabled.
739        STATE_CELLULAR_OFF = 4; // Cellular data is disabled.
740        STATE_CELLULAR_UNAVAILABLE = 5; // Measures actual performance based on a subset of data collected cellular data is toggled on, but unavailable.
741        STATE_OTHERS = 6;
742    }
743    enum WifiFrameworkState {
744        FRAMEWORK_STATE_UNKNOWN = 0;
745        FRAMEWORK_STATE_AWAKENING = 1; // WiFi framework just woke up and this is the first RSSI poll.
746        FRAMEWORK_STATE_CONNECTED = 2; // Normal operation (most of the time is spent in this state).
747        FRAMEWORK_STATE_LINGERING = 3; // We are in the lingering period. i.e. We have recommended a switch to cellular but have not forecefully closed the WiFi connection yet.
748    }
749    enum TrueFalseUnknown {
750        UNKNOWN = 0;
751        TRUE = 1;
752        FALSE = 2;
753    }
754    // The AttributionNode to identify the caller
755    repeated AttributionNode attribution_node = 1;
756    // The scorer's prediction of the current Wi-Fi state
757    optional android.net.wifi.WifiPredictedUsabilityState wifi_predicted_usability_state = 2;
758    // The type of unusable event happened during this prediction interval
759    optional UnusableEvent unusable_event = 3;
760    // Whether Wi-Fi is evaluated as sufficient by the end of the current prediction interval
761    optional bool is_wifi_sufficient = 4;
762    // The status of the device
763    optional DeviceState device_state = 5;
764    // RSSI polling interval, which affects the scorer's prediction interval.
765    optional int32 rssi_polling_interval_ms = 6;
766    // Current state of the WiFi framework.
767    optional WifiFrameworkState wifi_framework_state = 7;
768    // NetworkCapabilities calculated link speed is sufficient in the downstream direction.
769    optional TrueFalseUnknown speed_sufficient_network_capabilities_ds = 8;
770    // NetworkCapabilities calculated link speed is sufficient in the upstream direction.
771    optional TrueFalseUnknown speed_sufficient_network_capabilities_us = 9;
772    // ThroughputPredictor calculated link speed is sufficient in the downstream direction.
773    optional TrueFalseUnknown speed_sufficient_throughput_predictor_ds = 10;
774    // ThroughputPredictor calculated link speed is sufficient in the upstream direction.
775    optional TrueFalseUnknown speed_sufficient_throughput_predictor_us = 11;
776}
777
778/**
779 * Logged when clients disconnect from a soft AP instance.
780 */
781message WifiSoftApCallbackOnClientsDisconnected {
782    /**
783     * Reason for disconnection.
784     * @see: packages/modules/Wifi/framework/java/android/net/wifi/DeauthenticationReasonCode.java
785     */
786    enum DisconnectReason {
787        UNKNOWN = 0;
788        UNSPECIFIED = 1;
789        PREV_AUTH_NOT_VALID = 2;
790        DEAUTH_LEAVING = 3;
791        DISASSOC_DUE_TO_INACTIVITY = 4;
792        DISASSOC_AP_BUSY = 5;
793        CLASS2_FRAME_FROM_NONAUTH_STA = 6;
794        CLASS3_FRAME_FROM_NONASSOC_STA = 7;
795        DISASSOC_STA_HAS_LEFT = 8;
796        STA_REQ_ASSOC_WITHOUT_AUTH = 9;
797        PWR_CAPABILITY_NOT_VALID = 10;
798        SUPPORTED_CHANNEL_NOT_VALID = 11;
799        BSS_TRANSITION_DISASSOC = 12;
800        INVALID_IE = 13;
801        MICHAEL_MIC_FAILURE = 14;
802        FOURWAY_HANDSHAKE_TIMEOUT = 15;
803        GROUP_KEY_UPDATE_TIMEOUT = 16;
804        IE_IN_4WAY_DIFFERS = 17;
805        GROUP_CIPHER_NOT_VALID = 18;
806        PAIRWISE_CIPHER_NOT_VALID = 19;
807        AKMP_NOT_VALID = 20;
808        UNSUPPORTED_RSN_IE_VERSION = 21;
809        INVALID_RSN_IE_CAPAB = 22;
810        IEEE_802_1X_AUTH_FAILED = 23;
811        CIPHER_SUITE_REJECTED = 24;
812        TDLS_TEARDOWN_UNREACHABLE = 25;
813        TDLS_TEARDOWN_UNSPECIFIED = 26;
814        SSP_REQUESTED_DISASSOC = 27;
815        NO_SSP_ROAMING_AGREEMENT = 28;
816        BAD_CIPHER_OR_AKM = 29;
817        NOT_AUTHORIZED_THIS_LOCATION = 30;
818        SERVICE_CHANGE_PRECLUDES_TS = 31;
819        UNSPECIFIED_QOS_REASON = 32;
820        NOT_ENOUGH_BANDWIDTH = 33;
821        DISASSOC_LOW_ACK = 34;
822        EXCEEDED_TXOP = 35;
823        STA_LEAVING = 36;
824        END_TS_BA_DLS = 37;
825        UNKNOWN_TS_BA = 38;
826        TIMEOUT = 39;
827        PEERKEY_MISMATCH = 45;
828        AUTHORIZED_ACCESS_LIMIT_REACHED = 46;
829        EXTERNAL_SERVICE_REQUIREMENTS = 47;
830        INVALID_FT_ACTION_FRAME_COUNT = 48;
831        INVALID_PMKID = 49;
832        INVALID_MDE = 50;
833        INVALID_FTE = 51;
834        MESH_PEERING_CANCELLED = 52;
835        MESH_MAX_PEERS = 53;
836        MESH_CONFIG_POLICY_VIOLATION = 54;
837        MESH_CLOSE_RCVD = 55;
838        MESH_MAX_RETRIES = 56;
839        MESH_CONFIRM_TIMEOUT = 57;
840        MESH_INVALID_GTK = 58;
841        MESH_INCONSISTENT_PARAMS = 59;
842        MESH_INVALID_SECURITY_CAP = 60;
843        MESH_PATH_ERROR_NO_PROXY_INFO = 61;
844        MESH_PATH_ERROR_NO_FORWARDING_INFO = 62;
845        MESH_PATH_ERROR_DEST_UNREACHABLE = 63;
846        MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64;
847        MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65;
848        MESH_CHANNEL_SWITCH_UNSPECIFIED = 66;
849    }
850    // Disconnect reason from WifiClient
851    optional DisconnectReason disconnect_reason = 1;
852    // The uid of the SoftAp creator
853    optional int32 uid = 2 [(is_uid) = true];
854}
855