blob: 1151741109f06280622a2fdd6b011c690d81fafc [file] [log] [blame]
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
package android.os.statsd.wifi;
import "frameworks/proto_logging/stats/atom_field_options.proto";
import "frameworks/proto_logging/stats/atoms.proto";
import "frameworks/proto_logging/stats/enums/wifi/enums.proto";
import "frameworks/proto_logging/stats/attribution_node.proto";
option java_package = "com.android.os.wifi";
option java_multiple_files = true;
extend Atom {
// Push metrics
optional WifiAwareNdpReported wifi_aware_ndp_reported = 638 [(module) = "wifi"];
optional WifiAwareAttachReported wifi_aware_attach_reported = 639 [(module) = "wifi"];
optional WifiSelfRecoveryTriggered wifi_self_recovery_triggered = 661 [(module) = "wifi"];
optional SoftApStarted soft_ap_started = 680 [(module) = "wifi"];
optional SoftApStopped soft_ap_stopped = 681 [(module) = "wifi"];
optional WifiLockReleased wifi_lock_released = 687 [(module) = "wifi"];
optional WifiLockDeactivated wifi_lock_deactivated = 688 [(module) = "wifi"];
optional WifiConfigSaved wifi_config_saved = 689 [(module) = "wifi"];
optional WifiAwareResourceUsingChanged wifi_aware_resource_using_changed
= 690 [(module) = "wifi"];
optional WifiAwareHalApiCalled wifi_aware_hal_api_called = 691 [(module) = "wifi"];
optional WifiLocalOnlyRequestReceived wifi_local_only_request_received
= 692 [(module) = "wifi"];
optional WifiLocalOnlyRequestScanTriggered wifi_local_only_request_scan_triggered
= 693 [(module) = "wifi"];
optional WifiThreadTaskExecuted wifi_thread_task_executed = 694 [(module) = "wifi"];
optional WifiStateChanged wifi_state_changed = 700 [(module) = "wifi"];
// Pull metrics
optional WifiAwareCapabilities wifi_aware_capabilities = 10190 [(module) = "wifi"];
optional WifiModuleInfo wifi_module_info = 10193 [(module) = "wifi"];
}
/**
* Pulled atom for tracking wifi version number.
*/
message WifiModuleInfo {
enum BuildType {
TYPE_UNKNOWN = 0;
TYPE_BUILT_FROM_SOURCE = 1;
TYPE_PREBUILT = 2;
}
// Version number of the wifi module
optional int32 version_number = 1;
// The type of the wifi module
optional BuildType build_type = 2;
}
/**
* Logged when wifi aware data path is completed
*/
message WifiAwareNdpReported {
enum Role {
ROLE_UNKNOWN = 0;
ROLE_INITIATOR = 1;
ROLE_RESPONDER = 2;
}
// Role of data path
optional Role role = 1;
// If it is over out-of-band
optional bool is_out_of_band = 2;
// Status of NDP
optional android.net.wifi.AwareStatus status = 3;
// Duration to create NDP in millis.
optional int32 ndp_latency_ms= 4;
// The latency of discovery + NDP in millis.
optional int32 discovery_ndp_latency_ms= 5;
// Channel frequency in MHz, 0 if unavailable, >= 2400 otherwise.
optional int32 channel_frequency_mhz= 6;
// If the instant mode is enabled
optional bool is_instant_mode = 7;
// The caller type of the NDP request
optional android.net.wifi.WifiCallerType caller_type = 8;
// The Attribution tag to identify the caller
optional string attribution_tag = 9;
// The uid of the caller
optional int32 uid = 10;
}
/**
* Logged when wifi aware attach is completed
*/
message WifiAwareAttachReported {
// Status of attach
optional android.net.wifi.AwareStatus status = 1;
// The caller type of the attach
optional android.net.wifi.WifiCallerType caller_type = 2;
// The Attribution tag to identify the caller
optional string attribution_tag = 3;
// The uid of the caller
optional int32 uid = 4;
}
/**
* Logged when wifi self recovery triggered
*/
message WifiSelfRecoveryTriggered {
enum Reason {
REASON_UNKNOWN = 0;
REASON_LAST_RESORT_WDOG = 1;
REASON_WIFINATIVE_FAILURE = 2;
REASON_STA_IFACE_DOWN = 3;
REASON_API_CALL = 4;
REASON_SUBSYSTEM_RESTART = 5;
REASON_IFACE_ADDED = 6;
}
enum Result {
RES_UNSPECIFIED = 0;
RES_RESTART_SUCCESS = 1;
RES_INVALID_REASON = 2;
RES_IFACE_DOWN = 3;
RES_IFACE_ADD_DISABLED = 4;
RES_RETRY_DISABLED = 5;
RES_ABOVE_MAX_RETRY = 6;
RES_RESTART_FAILURE = 7;
}
// Trigger reason
optional Reason reason = 1;
// Self recovery result
optional Result result = 2;
// Record time elapsed from last trigger event
optional int64 time_elapsed_from_last_millis = 3;
}
/**
* Logged when Soft AP is started
*/
message SoftApStarted {
/**
* Result of starting Soft AP
*/
enum StartResult {
// Unknown
START_RESULT_UNKNOWN = 0;
// Successful start
START_RESULT_SUCCESS = 1;
// General failure
START_RESULT_FAILURE_GENERAL = 2;
// Failed due to no channel available
START_RESULT_FAILURE_NO_CHANNEL = 3;
// Failed due to config being unsupported
START_RESULT_FAILURE_UNSUPPORTED_CONFIG = 4;
// Failed to start the HAL
START_RESULT_FAILURE_START_HAL = 5;
// Failed to start hostapd
START_RESULT_FAILURE_START_HOSTAPD = 6;
// Failed due to interface conflict with user rejection
START_RESULT_FAILURE_INTERFACE_CONFLICT_USER_REJECTED = 7;
// Failed due to interface conflict
START_RESULT_FAILURE_INTERFACE_CONFLICT = 8;
// Failed to create interface in vendor HAL
START_RESULT_FAILURE_CREATE_INTERFACE = 9;
// Failed to set country code
START_RESULT_FAILURE_SET_COUNTRY_CODE = 10;
// Failed to set mac address
START_RESULT_FAILURE_SET_MAC_ADDRESS = 11;
// Failed to register AP callback with hostapd
START_RESULT_FAILURE_REGISTER_AP_CALLBACK_HOSTAPD = 12;
// Failed to register AP callback with wificond
START_RESULT_FAILURE_REGISTER_AP_CALLBACK_WIFICOND = 13;
// Failed to add AP to hostapd
START_RESULT_FAILURE_ADD_AP_HOSTAPD = 14;
}
// Result of the start event
optional StartResult result = 1;
// Role of the Soft AP
optional android.net.wifi.SoftApRole role = 2;
// First band bitmask indexed by WifiBandBucket
optional int32 band1 = 3;
// Second band bitmask indexed by WifiBandBucket
optional int32 band2 = 4;
// Whether DBS is supported or not
optional bool dbs_supported = 5;
// STA + AP concurrency capability of the device
optional android.net.wifi.StaApConcurrency sta_ap_concurrency = 6;
// STA connection status at the time of starting
optional android.net.wifi.StaStatus sta_status = 7;
// Authentication type of the Soft AP
optional android.net.wifi.WifiAuthType auth_type = 8;
}
/**
* Logged when Soft AP is stopped
*/
message SoftApStopped {
/**
* Type of Soft AP stop event
*/
enum StopEvent {
// Unknown
STOP_EVENT_UNKNOWN = 0;
// Stopped by the user
STOP_EVENT_STOPPED = 1;
// Stopped due to interface down
STOP_EVENT_INTERFACE_DOWN = 2;
// Stopped due to interface destroyed
STOP_EVENT_INTERFACE_DESTROYED = 3;
// Stopped due to hostapd failure
STOP_EVENT_HOSTAPD_FAILURE = 4;
// Stopped due to no usage timeout
STOP_EVENT_NO_USAGE_TIMEOUT = 5;
// Single DBS instance stopped due to no usage timeout
STOP_EVENT_NO_USAGE_TIMEOUT_ONE_INSTANCE = 6;
// Single DBS instance stopped due to failure
STOP_EVENT_INSTANCE_FAILURE = 7;
}
// Soft AP stop event
optional StopEvent stop_event = 1;
// Role of the Soft AP
optional android.net.wifi.SoftApRole role = 2;
// Band of the Soft AP at the time of stopping
optional int32 band = 3;
// Whether the Soft AP is DBS
optional bool is_dbs = 4;
// STA + AP concurrency capability of the device
optional android.net.wifi.StaApConcurrency sta_ap_concurrency = 5;
// STA connection status at the time of stopping
optional android.net.wifi.StaStatus sta_status = 6;
// Whether or not the no usage timeout is enabled
optional bool is_timeout_enabled = 7;
// Duration of the session in seconds
optional int32 session_duration_seconds = 8;
// Authentication type of the Soft AP
optional android.net.wifi.WifiAuthType auth_type = 9;
// Wi-Fi standard of the Soft AP
optional android.net.wifi.WifiStandard standard = 10;
// Max num of associated clients for the entire session
optional int32 max_clients = 11;
}
/**
* Logged when wifi lock is released
*/
message WifiLockReleased {
// Attribution tag of the caller
optional string attribution_tag = 1;
// UID of the caller
optional int32 uid = 2;
// Permission model of the caller
optional android.net.wifi.WifiCallerType caller_type = 3;
// Lock mode
optional android.net.wifi.WifiModeEnum mode = 4;
// For how long the lock is acquired in milliseconds
optional int32 acquired_duration = 5;
// Whether power save disable is allowed during lock acquire
optional bool is_powersave_disable_allowed = 6;
// Whether the application which acquired the lock is exempted from screen ON
optional bool is_app_exempted_from_screen_on = 7;
// Whether the application which acquired the lock is exempted from being foreground
optional bool is_app_exempted_from_foreground = 8;
}
/**
* Logged when wifi lock is deactivated
*/
message WifiLockDeactivated {
// Attribution tag of the caller
optional string attribution_tag = 1;
// UID of the caller
optional int32 uid = 2;
// Permission model of the caller
optional android.net.wifi.WifiCallerType caller_type = 3;
// Lock mode
optional android.net.wifi.WifiModeEnum mode = 4;
// For how long the lock is activated in milliseconds
optional int32 activated_duration = 5;
// Whether power save disable is allowed during the lock activation
optional bool is_powersave_disable_allowed = 6;
// Whether the application which activated the lock is exempted from screen ON
optional bool is_exempted_from_screen_on = 7;
// Whether the application which activated the lock is exempted from being foreground
optional bool is_exempted_from_foreground = 8;
}
/**
* Pull metrics for the Wifi Aware capabilities supported by the device
*/
message WifiAwareCapabilities {
// If instant mode supported
optional bool is_instant_mode_supported = 1;
// If pairing supported
optional bool is_pairing_supported = 2;
// If suspension supported
optional bool is_suspension_supported = 3;
// Supported cipher suites
optional int32 cipher_suites = 4;
// Max number of the NDI
optional int32 ndi_number = 5;
// Max number of the NDP
optional int32 ndp_number = 6;
// Max number of the discovery session
optional int32 discovery_session_number = 7;
}
// Logged when the Wifi Aware resources is used by Apps
message WifiAwareResourceUsingChanged {
optional int32 ndp_num = 1;
optional int32 discovery_session_num = 2;
}
/**
* Logged when Aware HAL API is called and send response
*/
message WifiAwareHalApiCalled {
// The API name
optional android.net.wifi.AwareHalApi command = 1;
// Status of the API call
optional android.net.wifi.AwareStatus status = 2;
// The time for this API call to execute
optional int32 running_time_ms = 3;
}
/**
* Logged when local-only request received
*/
message WifiLocalOnlyRequestReceived {
enum UserAction {
USER_UNSPECIFIED = 0;
USER_BYPASS = 1;
USER_ACCEPT = 2;
USER_REJECT = 3;
}
// The AttributionNode to identify the caller
repeated AttributionNode attribution_node = 1;
// User action on the local-only request
optional UserAction action = 2;
// The caller type of the request
optional android.net.wifi.WifiCallerType caller_type = 3;
}
// Logged when matched scan result received for local only request
message WifiLocalOnlyRequestScanTriggered {
// The AttributionNode to identify the caller
repeated AttributionNode attribution_node = 1;
// How many channel specified in the request
optional int32 number_channel_specified = 2;
// Scan time to get a match
optional int32 match_delay_ms = 3;
// The caller type of the request
optional android.net.wifi.WifiCallerType caller_type = 4;
}
// Logged when a task on the Wifi thread is executed
message WifiThreadTaskExecuted {
// How long does it take to execute the task
optional int32 running_time_ms = 1;
// How long does it take to start execute the task
optional int32 blocking_time_ms = 2;
// The name of the internal task running on Wifi Thread
optional string task_name = 3;
}
// Logged when Wifi config save to storage triggered
message WifiConfigSaved {
// How long does it cost to save all config
optional int32 running_time_ms = 1;
}
// Logged when Wi-Fi state change happens.
message WifiStateChanged {
// If Wi-Fi was enabled
optional bool wifi_enabled = 1;
// If Wi-Fi Wake feature was enabled
optional bool wifi_wake_enabled = 2;
// If the state change was due to Wi-Fi Wake
optional bool enabled_by_wifi_wake = 3;
}