blob: 71dd4dd49d8eba6ea69bf087cb6cf82198168cd0 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 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";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070027import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080028import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080029import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080030import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080031import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080032import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080033import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080034import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080035import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080038import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080039import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080040import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080041import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080043import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080044import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080045import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070048import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080049import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070050import "frameworks/base/core/proto/android/stats/enums.proto";
51import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070052import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070053import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080054import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070055import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000056import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080057import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050058import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080059import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080060import "frameworks/base/core/proto/android/telephony/enums.proto";
61import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080062import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010063import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070064import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080065
Yao Chend54f9dd2017-10-17 17:37:48 +000066/**
Stefan Lafonae2df012017-11-14 09:17:21 -080067 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000068 * raw stats log events from the Android system, also known as "atoms."
69 *
70 * This field contains a single oneof with all of the available messages.
71 * The stats-log-api-gen tool runs as part of the Android build and
72 * generates the android.util.StatsLog class, which contains the constants
73 * and methods that Android uses to log.
74 *
Stefan Lafonae2df012017-11-14 09:17:21 -080075 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000076 * Instead, statsd on Android constructs these messages synthetically,
77 * in the format defined here and in stats_log.proto.
78 */
Stefan Lafonae2df012017-11-14 09:17:21 -080079message Atom {
80 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070081 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070082 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070083 BleScanStateChanged ble_scan_state_changed = 2
84 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080085 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080086 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070087 SensorStateChanged sensor_state_changed =
88 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080089 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070090 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
91 ScheduledJobStateChanged scheduled_job_state_changed =
92 8 [(module) = "framework", (module) = "statsdtest"];
93 ScreenBrightnessChanged screen_brightness_changed =
94 9 [(module) = "framework", (module) = "statsdtest"];
95 WakelockStateChanged wakelock_state_changed =
96 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080097 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
98 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070099 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
100 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
102 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
103 14 [(module) = "framework"];
104 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
105 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
106 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
107 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800108 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700109 BatterySaverModeStateChanged battery_saver_mode_state_changed =
110 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800111 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
112 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700113 AudioStateChanged audio_state_changed =
114 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800115 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
116 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
117 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700118 UidProcessStateChanged uid_process_state_changed =
119 27 [(module) = "framework", (module) = "statsdtest"];
120 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
121 28 [(module) = "framework", (module) = "statsdtest"];
122 ScreenStateChanged screen_state_changed =
123 29 [(module) = "framework", (module) = "statsdtest"];
124 BatteryLevelChanged battery_level_changed =
125 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800127 PluggedStateChanged plugged_state_changed = 32
128 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800130 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
132 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800133 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
134 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
135 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700136 PhoneSignalStrengthChanged phone_signal_strength_changed =
137 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 SettingChanged setting_changed = 41 [(module) = "framework"];
139 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700140 42 [(module) = "framework", (module) = "statsdtest"];
141 IsolatedUidChanged isolated_uid_changed =
142 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
144 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800145 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800147 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700148 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
150 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800153 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800154 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800155 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
156 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800157 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800158 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700159 OverlayStateChanged overlay_state_changed =
160 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800161 ForegroundServiceStateChanged foreground_service_state_changed
162 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700163 CallStateChanged call_state_changed =
164 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800165 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
166 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
167 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 AppDied app_died = 65 [(module) = "framework"];
169 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
170 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800171 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
172 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
174 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800175 SpeakerImpedanceReported speaker_impedance_reported = 71;
176 HardwareFailed hardware_failed = 72;
177 PhysicalDropDetected physical_drop_detected = 73;
178 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800179 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
180 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800181 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700182 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800183 ANROccurred anr_occurred = 79 [(module) = "framework"];
184 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
185 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700186 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800187 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800188 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
190 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700191 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
193 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
194 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
195 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700196 BatteryHealthSnapshot battery_health_snapshot = 91;
197 SlowIo slow_io = 92;
198 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800199 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
200 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100201 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800202 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800203 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700204 // TODO: service state change is very noisy shortly after boot, as well
205 // as at other transitions - coming out of doze, device plugged in, etc.
206 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
208 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
209 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800210 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800211 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800212 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
213 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
214 105 [(module) = "docsui"];
215 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
216 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
217 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
218 108 [(module) = "docsui"];
219 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
220 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
221 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
222 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800224 WifiRunningStateChanged wifi_running_state_changed = 114
225 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800227 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800228 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800229 117 [(module) = "docsui"];
230 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
231 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
232 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
233 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800234 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
235 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
236 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800237 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
238 125 [(module) = "bluetooth"];
239 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
240 126 [(module) = "bluetooth"];
241 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
242 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800243 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000244 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800245 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
246 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
247 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800248 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800249 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
250 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
251 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
252 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
253 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
254 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800255 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
256 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800257 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
258 142 [(module) = "framework"];
259 AttentionManagerServiceResultReported attention_manager_service_result_reported =
260 143 [(module) = "framework"];
261 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800262 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800264 WatchdogRollbackOccurred watchdog_rollback_occurred =
265 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
267 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800268 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800269 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
270 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800271 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
272 151 [(module) = "bluetooth"];
273 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
274 152 [(module) = "bluetooth"];
275 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
276 153 [(module) = "bluetooth"];
277 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
278 154 [(module) = "bluetooth"];
279 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
280 155 [(module) = "bluetooth"];
281 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
282 156 [(module) = "bluetooth"];
283 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
284 157 [(module) = "bluetooth"];
285 BluetoothDeviceFailedContactCounterReported
286 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
287 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
288 159 [(module) = "bluetooth"];
289 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
290 160 [(module) = "bluetooth"];
291 BluetoothQualityReportReported bluetooth_quality_report_reported =
292 161 [(module) = "bluetooth"];
293 BluetoothDeviceInfoReported bluetooth_device_info_reported =
294 162 [(module) = "bluetooth"];
295 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
296 163 [(module) = "bluetooth"];
297 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
298 164 [(module) = "bluetooth"];
299 BluetoothBondStateChanged bluetooth_bond_state_changed =
300 165 [(module) = "bluetooth"];
301 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
302 166 [(module) = "bluetooth"];
303 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
304 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
306 168 [(module) = "framework"];
307 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700308 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800309 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800310 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800311 DeviceIdentifierAccessDenied device_identifier_access_denied =
312 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800314 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
315 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
316 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
318 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800319 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700320 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800321 180 [(module) = "permissioncontroller"];
322 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
323 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800324 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800325 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
326 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
327 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
328 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800329 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
330 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700331 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800332 188 [(module) = "intelligence"];
333 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
334 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800335 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800336 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800337 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
338 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
339 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
340 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
341 MediametricsCodecReported mediametrics_codec_reported = 195;
342 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
343 MediametricsExtractorReported mediametrics_extractor_reported = 197;
344 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
345 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
346 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700347 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800348 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
349 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800350 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
352 206 [(module) = "framework"];
353 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
354 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
355 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
356 LocationManagerApiUsageReported location_manager_api_usage_reported =
357 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100358 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100360 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100362 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100364 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100366 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800367 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100368 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800369 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100370 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800371 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100372 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800373 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
375 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
376 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
377 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800378 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800379 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700380 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
381 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800382 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100383 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800384 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800386 VmsClientConnectionStateChanged vms_client_connection_state_changed =
387 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100388 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
389 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
390 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100392 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
393 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800394 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800395 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
396 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
397 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
398 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800399 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800400 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000401 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800402 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500403 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
404 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800405 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
406 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800407 CellBroadcastMessageReported cb_message_reported =
408 249 [(module) = "cellbroadcast"];
409 CellBroadcastMessageError cb_message_error =
410 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700411 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
412 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
413 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800414 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000415 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800416 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
417 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800418 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800419 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500420 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
421 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700422 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800423 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700424 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800425 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
426 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800427 AccessibilityShortcutReported accessibility_shortcut_reported =
428 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800429 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700430 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700431 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700432 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
433 270 [(module) = "permissioncontroller"];
434 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
435 271 [(module) = "permissioncontroller"];
436 AutoRevokedAppInteraction auto_revoked_app_interaction =
437 272 [(module) = "permissioncontroller", (module) = "settings"];
438 AppPermissionGroupsFragmentAutoRevokeAction
439 app_permission_groups_fragment_auto_revoke_action =
440 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700441 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000442 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700443
444 // StatsdStats tracks platform atoms with ids upto 500.
445 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000446 }
David Chenc8a43242017-10-17 16:23:28 -0700447
David Chen6e3e6cb2018-01-03 16:14:06 -0800448 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700449 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700450 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
452 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700453 MobileBytesTransfer mobile_bytes_transfer =
454 10002 [(module) = "framework", (truncate_timestamp) = true];
455 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
456 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
458 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700459 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800460 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700461 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800462 CpuTimePerUidFreq cpu_time_per_uid_freq =
463 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800464 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
465 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
466 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
467 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
468 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700469 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700470 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700471 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700472 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800473 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
474 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700475 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800476 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800477 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800478 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800479 DiskStats disk_stats = 10025 [(module) = "framework"];
480 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
481 AppSize app_size = 10027 [(module) = "framework"];
482 CategorySize category_size = 10028 [(module) = "framework"];
483 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800484 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
486 DiskIo disk_io = 10032 [(module) = "framework"];
487 PowerProfile power_profile = 10033 [(module) = "framework"];
488 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
489 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
490 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700491 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800492 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
493 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
494 10040 [(module) = "framework"];
495 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
496 10041 [(module) = "framework"];
497 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800498 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800499 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800500 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800501 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
502 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
503 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
504 RoleHolder role_holder = 10049 [(module) = "framework"];
505 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800506 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
508 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800509 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
510 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800511 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
512 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
513 FaceSettings face_settings = 10058 [(module) = "framework"];
514 CoolingDevice cooling_device = 10059 [(module) = "framework"];
515 AppOps app_ops = 10060 [(module) = "framework"];
516 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700517 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
518 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800519 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800520 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800521 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
522 DangerousPermissionStateSampled dangerous_permission_state_sampled =
523 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400524 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000525 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000526 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200527 PackageNotificationPreferences package_notification_preferences =
528 10071 [(module) = "framework"];
529 PackageNotificationChannelPreferences package_notification_channel_preferences =
530 10072 [(module) = "framework"];
531 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
532 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800533 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800534 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700535 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
536 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
537 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
538 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800539 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700540 }
yroa1fe77c2018-02-26 14:22:54 -0800541
Bookatz76aafcf2018-09-17 16:17:10 -0700542 // DO NOT USE field numbers above 100,000 in AOSP.
543 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
544 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100545
546 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700547}
548
Yao Chend54f9dd2017-10-17 17:37:48 +0000549/**
Yangster-mac20877162017-12-22 17:19:39 -0800550 * This proto represents a node of an attribution chain.
551 * Note: All attribution chains are represented as a repeated field of type
552 * AttributionNode. It is understood that in such arrays, the order is that
553 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000554 */
Yangster-mac20877162017-12-22 17:19:39 -0800555message AttributionNode {
556 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800557 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800558
Yangster-mac20877162017-12-22 17:19:39 -0800559 // The (optional) string tag for an element in the attribution chain. If the
560 // element has no tag, it is encoded as an empty string.
561 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700562}
563
Yangster-mac48b3d622018-08-18 12:38:11 -0700564message KeyValuePair {
565 optional int32 key = 1;
566 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700567 int32 value_int = 2;
568 int64 value_long = 3;
569 string value_str = 4;
570 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700571 }
572}
573
574message KeyValuePairsAtom {
575 optional int32 uid = 1;
576 repeated KeyValuePair pairs = 2;
577}
578
Yao Chend54f9dd2017-10-17 17:37:48 +0000579/*
580 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800581 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000582 *
583 * RULES:
584 * - The field ids for each atom must start at 1, and count upwards by 1.
585 * Skipping field ids is not allowed.
586 * - These form an API, so renaming, renumbering or removing fields is
587 * not allowed between android releases. (This is not currently enforced,
588 * but there will be a tool to enforce this restriction).
589 * - The types must be built-in protocol buffer types, namely, no sub-messages
590 * are allowed (yet). The bytes type is also not allowed.
591 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800592 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000593 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800594 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 * - A field that is a uid should be a string field, tagged with the [xxx]
596 * annotation. The generated code on android will be represented by UIDs,
597 * and those UIDs will be translated in xxx to those strings.
598 *
599 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700600 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000601 * - If there is a UID, it goes first. Think in an object-oriented fashion.
602 * *****************************************************************************
603 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700604
Yao Chend54f9dd2017-10-17 17:37:48 +0000605/**
Tej Singha72344992019-04-17 18:55:08 -0700606 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700607 * Logs when the Thermal service HAL notifies the throttling start/stop events.
608 *
609 * Logged from:
610 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
611 */
612message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700613 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700614 optional android.os.TemperatureTypeEnum sensor_type = 1;
615
Maggie White442b6312019-04-05 16:26:44 -0700616 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700617 enum State {
618 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700619 START = 1; // START indicated that throttling was triggered.
620 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700621 }
Yangster-mace16189a2018-08-26 12:20:16 -0700622 optional State state = 2;
623
624 optional float temperature = 3;
625}
626
627/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000628 * Logs when the screen state changes.
629 *
630 * Logged from:
631 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
632 */
633message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800634 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800635 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700636 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700637}
Yao Chend54f9dd2017-10-17 17:37:48 +0000638
639/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700640 * Logs that the process state of the uid, as determined by ActivityManager
641 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000642 *
643 * Logged from:
644 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
645 */
Bookatzc1a050a2017-10-10 15:49:28 -0700646message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700647 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000648
Bookatzdb026a22018-01-10 19:01:56 -0800649 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800650 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700651 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000652}
653
654/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700655 * Logs process state change of a process, as per the activity manager.
656 *
657 * Logged from:
658 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
659 */
660message ProcessStateChanged {
661 optional int32 uid = 1;
662 optional string process_name = 2;
663 optional string package_name = 3;
664 // TODO: remove this when validation is done
665 optional int64 version = 5;
666 // The state, from frameworks/base/core/proto/android/app/enums.proto.
667 optional android.app.ProcessStateEnum state = 4;
668}
669
670/**
671 * Logs when ActivityManagerService sleep state is changed.
672 *
673 * Logged from:
674 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
675 */
676message ActivityManagerSleepStateChanged {
677 // TODO: import frameworks proto
678 enum State {
679 UNKNOWN = 0;
680 ASLEEP = 1;
681 AWAKE = 2;
682 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700683 optional State state = 1
684 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700685}
686
687/**
688 * Logs when system memory state changes.
689 *
690 * Logged from:
691 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
692 */
693message MemoryFactorStateChanged {
694 // TODO: import frameworks proto
695 enum State {
696 MEMORY_UNKNOWN = 0;
697 NORMAL = 1; // normal.
698 MODERATE = 2; // moderate memory pressure.
699 LOW = 3; // low memory.
700 CRITICAL = 4; // critical memory.
701
702 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700703 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700704}
705
706/**
707 * Logs when app is using too much cpu, according to ActivityManagerService.
708 *
709 * Logged from:
710 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
711 */
712message ExcessiveCpuUsageReported {
713 optional int32 uid = 1;
714 optional string process_name = 2;
715 optional string package_name = 3;
716 // package version. TODO: remove this when validation is done
717 optional int64 version = 4;
718}
719
720/**
721 * Logs when a cached process is killed, along with its pss.
722 *
723 * Logged from:
724 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
725 */
726message CachedKillReported {
727 optional int32 uid = 1;
728 optional string process_name = 2;
729 optional string package_name = 3;
730 // TODO: remove this when validation is done
731 optional int64 version = 5;
732 optional int64 pss = 4;
733}
734
735/**
xshu2c3d9e42019-09-26 17:54:02 -0700736 * Logs the change in wifi health.
737 *
738 * Logged from:
739 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
740 */
741message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800742 enum Band {
743 UNKNOWN = 0;
744 // All of 2.4GHz band
745 BAND_2G = 1;
746 // Frequencies in the range of [5150, 5250) GHz
747 BAND_5G_LOW = 2;
748 // Frequencies in the range of [5250, 5725) GHz
749 BAND_5G_MIDDLE = 3;
750 // Frequencies in the range of [5725, 5850) GHz
751 BAND_5G_HIGH = 4;
752 // Frequencies in the range of [5925, 6425) GHz
753 BAND_6G_LOW = 5;
754 // Frequencies in the range of [6425, 6875) GHz
755 BAND_6G_MIDDLE = 6;
756 // Frequencies in the range of [6875, 7125) GHz
757 BAND_6G_HIGH = 7;
758 }
xshu2c3d9e42019-09-26 17:54:02 -0700759 // duration this stat is obtained over in milliseconds
760 optional int32 duration_millis = 1;
761 // whether wifi is classified as sufficient for the user's data traffic, determined
762 // by whether the calculated throughput exceeds the average demand within |duration_millis|
763 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700764 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800765 optional bool is_cell_data_available = 3;
766 // the Band bucket the connected network is on
767 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700768}
769
770/**
771 * Logged when wifi detects a significant change in connection failure rate.
772 *
773 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
774 *
775 */
776message WifiFailureStatReported {
777 enum AbnormalityType {
778 UNKNOWN = 0;
779 SIGNIFICANT_INCREASE = 1;
780 SIGNIFICANT_DECREASE = 2;
781 SIMPLY_HIGH = 3;
782 }
783 enum FailureType {
784 FAILURE_UNKNOWN = 0;
785 FAILURE_CONNECTION = 1;
786 FAILURE_ASSOCIATION_REJECTION = 2;
787 FAILURE_ASSOCIATION_TIMEOUT = 3;
788 FAILURE_AUTHENTICATION = 4;
789 FAILURE_NON_LOCAL_DISCONNECTION = 5;
790 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
791 }
792 // Reason for uploading this stat
793 optional AbnormalityType abnormality_type = 1;
794 // The particular type of failure
795 optional FailureType failure_type = 2;
796 // How many times we have encountered this combination of AbnormalityType and FailureType
797 optional int32 failure_count = 3;
798}
799
800/**
801 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
802 *
803 * Logged from:
804 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
805 */
806message WifiConnectionResultReported {
807 enum FailureCode {
808 FAILURE_UNKNOWN = 0;
809 FAILURE_ASSOCIATION_TIMEOUT = 1;
810 FAILURE_ASSOCIATION_REJECTION = 2;
811 FAILURE_AUTHENTICATION_GENERAL = 3;
812 FAILURE_AUTHENTICATION_EAP = 4;
813 FAILURE_DHCP = 5;
814 FAILURE_NETWORK_DISCONNECTION = 6;
815 FAILURE_ROAM_TIMEOUT = 7;
816 }
817 // true represents a successful connection
818 optional bool connection_result = 1;
819 // reason for the connection failure
820 optional FailureCode failure_code = 2;
821 // scan rssi before the connection attempt
822 optional int32 rssi = 3;
823}
824
825/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700826 * Logs when memory stats of a process is reported.
827 *
828 * Logged from:
829 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
830 */
831message ProcessMemoryStatReported {
832 optional int32 uid = 1;
833 optional string process_name = 2;
834 optional string package_name = 3;
835 //TODO: remove this when validation is done
836 optional int64 version = 9;
837 optional int64 pss = 4;
838 optional int64 uss = 5;
839 optional int64 rss = 6;
840 enum Type {
841 ADD_PSS_INTERNAL_SINGLE = 0;
842 ADD_PSS_INTERNAL_ALL_MEM = 1;
843 ADD_PSS_INTERNAL_ALL_POLL = 2;
844 ADD_PSS_EXTERNAL = 3;
845 ADD_PSS_EXTERNAL_SLOW = 4;
846 }
847 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800848 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700849}
850
851/**
Bookatzc1a050a2017-10-10 15:49:28 -0700852 * Logs that a process started, finished, crashed, or ANRed.
853 *
854 * Logged from:
855 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
856 */
857message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700858 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700859
David Chen0b5c90c2018-01-25 16:51:49 -0800860 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800861 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700862
Bookatzddccf0a2017-11-28 16:48:14 -0800863 // What lifecycle state the process changed to.
864 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800865 enum State {
866 FINISHED = 0;
867 STARTED = 1;
868 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800869 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800870 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700871}
872
Bookatzc1a050a2017-10-10 15:49:28 -0700873/**
874 * Logs when the ble scan state changes.
875 *
876 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700877 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700878 */
879message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800880 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700881 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 enum State {
884 OFF = 0;
885 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700886 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
887 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700888 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800889 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700890 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800891 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700892 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800893 (state_field_option).nested = true
894 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700895
Bookatze5ec0b42018-03-26 13:34:56 -0700896 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700897 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700898 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700899 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700900 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700901 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700902}
903
904/**
905 * Logs reporting of a ble scan finding results.
906 *
907 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700908 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700909 */
Bookatzae6738e2018-09-13 11:38:56 -0700910// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700911message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800912 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
914 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800915 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700916}
917
918/**
919 * Logs when a sensor state changes.
920 *
921 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700922 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700923 */
924message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800925 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700926
Bookatzc1a050a2017-10-10 15:49:28 -0700927 // The id (int) of the sensor.
928 optional int32 sensor_id = 2;
929
930 enum State {
931 OFF = 0;
932 ON = 1;
933 }
934 optional State state = 3;
935}
936
Bookatzc1a050a2017-10-10 15:49:28 -0700937/**
938 * Logs when GPS state changes.
939 *
940 * Logged from:
941 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
942 */
943message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945
946 enum State {
947 OFF = 0;
948 ON = 1;
949 }
950 optional State state = 2;
951}
952
Bookatz48d362e2018-11-06 15:49:08 -0800953/**
954 * Logs when GPS signal quality.
955 *
956 * Logged from:
957 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
958 */
959message GpsSignalQualityChanged {
960 optional android.server.location.GpsSignalQualityEnum level = 1;
961}
962
Bookatzc1a050a2017-10-10 15:49:28 -0700963
964/**
965 * Logs when a sync manager sync state changes.
966 *
967 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700968 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700969 */
970message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800971 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700972
David Chen0b5c90c2018-01-25 16:51:49 -0800973 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800974 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700975
976 enum State {
977 OFF = 0;
978 ON = 1;
979 }
980 optional State state = 3;
981}
982
Yangster-mac96353002018-09-05 11:18:55 -0700983/*
984 * Deferred job stats.
985 *
986 * Logged from:
987 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
988*/
989message DeferredJobStatsReported {
990 repeated AttributionNode attribution_node = 1;
991
992 // Number of jobs deferred.
993 optional int32 num_jobs_deferred = 2;
994
995 // Time since the last job runs.
996 optional int64 time_since_last_job_millis = 3;
997}
998
Bookatzc1a050a2017-10-10 15:49:28 -0700999/**
1000 * Logs when a job scheduler job state changes.
1001 *
1002 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001003 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001004 */
1005message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001006 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001007
1008 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001009 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001010
1011 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001012 FINISHED = 0;
1013 STARTED = 1;
1014 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001015 }
1016 optional State state = 3;
1017
Tej Singh33a412b2018-03-16 18:43:59 -07001018 // The reason a job has stopped.
1019 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001020 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001021 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001022
1023 // The standby bucket of the app that scheduled the job. These match the framework constants
1024 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1025 // already assigned 0.
1026 enum Bucket {
1027 UNKNOWN = -1;
1028 ACTIVE = 0;
1029 WORKING_SET = 1;
1030 FREQUENT = 2;
1031 RARE = 3;
1032 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001033 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001034 }
1035 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1036
1037 // The job id (as assigned by the app).
1038 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001039
1040 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1041 // constraints as they are always assumed to be set.
1042 optional bool has_charging_constraint = 7;
1043 optional bool has_battery_not_low_constraint = 8;
1044 optional bool has_storage_not_low_constraint = 9;
1045 optional bool has_timing_delay_constraint = 10;
1046 optional bool has_deadline_constraint = 11;
1047 optional bool has_idle_constraint = 12;
1048 optional bool has_connectivity_constraint = 13;
1049 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001050}
1051
1052/**
1053 * Logs when the audio state changes.
1054 *
1055 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001056 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001057 */
1058message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001059 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001060
1061 enum State {
1062 OFF = 0;
1063 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001064 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1065 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001066 }
1067 optional State state = 2;
1068}
1069
1070/**
1071 * Logs when the video codec state changes.
1072 *
1073 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001074 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001075 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001076message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001077 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001078
1079 enum State {
1080 OFF = 0;
1081 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001082 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1083 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001084 }
1085 optional State state = 2;
1086}
1087
1088/**
1089 * Logs when the flashlight state changes.
1090 *
1091 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001092 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001093 */
1094message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001095 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001096
1097 enum State {
1098 OFF = 0;
1099 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001100 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1101 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001102 }
1103 optional State state = 2;
1104}
1105
1106/**
1107 * Logs when the camera state changes.
1108 *
1109 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001110 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001111 */
1112message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001113 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001114
1115 enum State {
1116 OFF = 0;
1117 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001118 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1119 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001120 }
1121 optional State state = 2;
1122}
1123
1124/**
1125 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001126 *
1127 * Logged from:
1128 * TODO
1129 */
Bookatzd6746242017-10-24 18:39:35 -07001130message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001131 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001132 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001133
Bookatz1a1b0462018-01-12 11:47:03 -08001134 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1135 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001136 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001137
1138 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001139 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001140
1141 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001142 RELEASE = 0;
1143 ACQUIRE = 1;
1144 CHANGE_RELEASE = 2;
1145 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001146 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001147 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001148 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001149 (state_field_option).default_state_value = 0,
1150 (state_field_option).nested = true
1151 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001152}
1153
1154/**
Bookatzc1a050a2017-10-10 15:49:28 -07001155 * Logs when a partial wakelock is considered 'long' (over 1 min).
1156 *
1157 * Logged from:
1158 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1159 */
1160message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001161 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001162
Yao Chend54f9dd2017-10-17 17:37:48 +00001163 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1164 optional string tag = 2;
1165
Bookatzc1a050a2017-10-10 15:49:28 -07001166 // TODO: I have no idea what this is.
1167 optional string history_tag = 3;
1168
1169 enum State {
1170 OFF = 0;
1171 ON = 1;
1172 }
1173 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001174}
1175
Bookatzc1a050a2017-10-10 15:49:28 -07001176/**
Bookatza66083f2018-09-20 17:24:00 -07001177 * Logs when the device is interactive, according to the PowerManager Notifier.
1178 *
1179 * Logged from:
1180 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1181 */
1182message InteractiveStateChanged {
1183 enum State {
1184 OFF = 0;
1185 ON = 1;
1186 }
1187 optional State state = 1;
1188}
1189
1190/**
Bookatzc1a050a2017-10-10 15:49:28 -07001191 * Logs Battery Saver state change.
1192 *
1193 * Logged from:
1194 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1195 */
1196message BatterySaverModeStateChanged {
1197 enum State {
1198 OFF = 0;
1199 ON = 1;
1200 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001201 optional State state = 1
1202 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001203}
1204
1205/**
1206 * Logs Doze mode state change.
1207 *
1208 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001209 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001210 */
1211message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001212 optional android.server.DeviceIdleModeEnum state = 1
1213 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001214}
1215
1216
1217/**
1218 * Logs state change of Doze mode including maintenance windows.
1219 *
1220 * Logged from:
1221 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1222 */
1223message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001224 optional android.server.DeviceIdleModeEnum state = 1
1225 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001226}
1227
1228/**
1229 * Logs screen brightness level.
1230 *
1231 * Logged from:
1232 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1233 */
1234message ScreenBrightnessChanged {
1235 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1236 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001237}
1238
1239/**
1240 * Logs battery level (percent full, from 0 to 100).
1241 *
1242 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001243 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001244 */
1245message BatteryLevelChanged {
1246 // Battery level. Should be in [0, 100].
1247 optional int32 battery_level = 1;
1248}
1249
1250/**
1251 * Logs change in charging status of the device.
1252 *
1253 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001254 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001255 */
1256message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001257 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1258 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001259}
1260
1261/**
1262 * Logs whether the device is plugged in, and what power source it is using.
1263 *
1264 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001265 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001266 */
1267message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001268 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001269 optional android.os.BatteryPluggedStateEnum state = 1
1270 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001271}
1272
Bookatz8c6571b2017-10-24 15:04:41 -07001273/**
1274 * Logs when an app's wakeup alarm fires.
1275 *
1276 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001277 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001278 */
1279message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001280 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001281
1282 // Name of the wakeup alarm.
1283 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001284
1285 // Name of source package (for historical reasons, since BatteryStats tracked it).
1286 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001287
Ben Murdoch3389f1522019-05-21 15:05:34 +01001288 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001289 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001290}
1291
1292/**
1293 * Logs when an an app causes the mobile radio to change state.
1294 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1295 *
1296 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001297 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001298 */
1299message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001300 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001301
Bookatz1a1b0462018-01-12 11:47:03 -08001302 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1303 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001304}
1305
1306/**
1307 * Logs when an an app causes the wifi radio to change state.
1308 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1309 *
1310 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001311 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001312 */
1313message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001314 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001315
Bookatz1a1b0462018-01-12 11:47:03 -08001316 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1317 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001318}
1319
1320/**
1321 * Logs kernel wakeup reasons and aborts.
1322 *
1323 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001324 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001325 */
1326message KernelWakeupReported {
1327 // Name of the kernel wakeup reason (or abort).
1328 optional string wakeup_reason_name = 1;
1329
1330 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001331 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001332}
1333
1334/**
Bookatzda1798c2018-12-13 14:16:00 -08001335 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001336 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001337 *
1338 * Logged from:
1339 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1340 */
1341message WifiEnabledStateChanged {
1342 enum State {
1343 OFF = 0;
1344 ON = 1;
1345 }
1346 optional State state = 1;
1347}
1348
1349/**
tsaichristinececebdc2020-02-04 14:05:56 -08001350 * This atom is deprecated starting in R.
1351 *
Bookatzda1798c2018-12-13 14:16:00 -08001352 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
Bookatza0a1f8a2018-12-17 12:28:32 -08001353 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1354 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001355 *
1356 * Logged from:
1357 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1358 */
1359message WifiRunningStateChanged {
1360 repeated AttributionNode attribution_node = 1;
1361
1362 enum State {
1363 OFF = 0;
1364 ON = 1;
1365 }
1366 optional State state = 2;
1367}
1368
1369/**
Bookatze5885242017-10-24 20:10:31 -07001370 * Logs wifi locks held by an app.
1371 *
1372 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001373 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001374 */
1375message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001376 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001377
1378 enum State {
1379 OFF = 0;
1380 ON = 1;
1381 }
1382 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001383
1384 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1385 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001386}
1387
1388/**
1389 * Logs wifi signal strength changes.
1390 *
1391 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001392 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001393 */
1394message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001395 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1396 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001397}
1398
1399/**
1400 * Logs wifi scans performed by an app.
1401 *
1402 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001403 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001404 */
1405message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001406 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001407
1408 enum State {
1409 OFF = 0;
1410 ON = 1;
1411 }
1412 optional State state = 2;
1413}
1414
1415/**
Tej Singh4503e102018-01-04 14:35:01 -08001416 * Logs wifi multicast locks held by an app
1417 *
1418 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001419 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001420 */
1421message WifiMulticastLockStateChanged {
1422 repeated AttributionNode attribution_node = 1;
1423
1424 enum State {
1425 OFF = 0;
1426 ON = 1;
1427 }
1428 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001429
1430 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001431}
1432
1433/**
Tej Singh1ea42892018-01-19 09:27:00 -08001434 * Logs shutdown reason and duration on next boot.
1435 *
1436 * Logged from:
1437 * frameworks/base/core/java/com/android/server/BootReceiver.java
1438 */
1439message ShutdownSequenceReported {
1440 // True if shutdown is for a reboot. Default: false if we do not know.
1441 optional bool reboot = 1;
1442
1443 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1444 optional string reason = 2;
1445
1446 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1447 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001448 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001449
1450 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001451 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001452}
1453
Tej Singh6483ea42018-01-25 17:45:49 -08001454
1455/**
1456 * Logs boot reason and duration.
1457 *
1458 * Logged from:
1459 * system/core/bootstat/bootstat.cpp
1460 */
1461message BootSequenceReported {
1462 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1463 // Default: "<EMPTY>" if not available.
1464 optional string bootloader_reason = 1;
1465
1466 // Reason for system boot. Eg. bootloader, reboot,userrequested
1467 // Default: "<EMPTY>" if not available.
1468 optional string system_reason = 2;
1469
1470 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001471 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001472
1473 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001474 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001475
1476 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001477 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001478
1479 // Time since last boot in ms. Default: 0 if not available.
1480 optional int64 time_since_last_boot = 6;
1481}
1482
Tej Singhc477d9c2018-02-05 18:31:39 -08001483
1484/**
1485 * Logs call state and disconnect cause (if applicable).
1486 *
1487 * Logged from:
1488 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1489 */
1490message CallStateChanged {
1491 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1492 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1493 optional android.telecom.CallStateEnum call_state = 1;
1494
1495 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1496 // This value is only applicable when the call_state is DISCONNECTED, and
1497 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1498 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1499 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1500
1501 // True if the call is self-managed, which are apps that use the
1502 // telecom infrastructure to make their own calls.
1503 optional bool self_managed = 3;
1504
1505 // True if call is external. External calls are calls on connected Wear
1506 // devices but show up in Telecom so the user can pull them onto the device.
1507 optional bool external_call = 4;
1508}
1509
Tej Singh1ea42892018-01-19 09:27:00 -08001510/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001511 * Logs keyguard state. The keyguard is the lock screen.
1512 *
1513 * Logged from:
1514 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1515 */
1516message KeyguardStateChanged {
1517 enum State {
1518 UNKNOWN = 0;
1519 // The keyguard is hidden when the phone is unlocked.
1520 HIDDEN = 1;
1521 // The keyguard is shown when the phone is locked (screen turns off).
1522 SHOWN= 2;
1523 // The keyguard is occluded when something is overlaying the keyguard.
1524 // Eg. Opening the camera while on the lock screen.
1525 OCCLUDED = 3;
1526 }
1527 optional State state = 1;
1528}
1529
1530/**
1531 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1532 * prompts the user to enter a password (pattern, pin, etc).
1533 *
1534 * Logged from:
1535 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1536 */
1537
1538message KeyguardBouncerStateChanged {
1539 enum State {
1540 UNKNOWN = 0;
1541 // Bouncer is hidden, either as a result of successfully entering the
1542 // password, screen timing out, or user going back to lock screen.
1543 HIDDEN = 1;
1544 // This is when the user is being prompted to enter the password.
1545 SHOWN = 2;
1546 }
1547 optional State state = 1;
1548}
1549
1550/**
1551 * Logs the result of entering a password into the keyguard bouncer.
1552 *
1553 * Logged from:
1554 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1555 */
1556message KeyguardBouncerPasswordEntered {
1557 enum BouncerResult {
1558 UNKNOWN = 0;
1559 // The password entered was incorrect.
1560 FAILURE = 1;
1561 // The password entered was correct.
1562 SUCCESS = 2;
1563 }
1564 optional BouncerResult result = 1;
1565}
1566
Tej Singha883b372018-02-15 11:30:01 -08001567/*
1568 * Logs changes to the configuration of the device. The configuration is defined
1569 * in frameworks/base/core/java/android/content/res/Configuration.java
1570 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1571 * Please go there to interpret the possible values each field can be.
1572 *
1573 * Logged from:
1574 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1575 */
1576message ResourceConfigurationChanged {
1577 // Bit mask of color capabilities of the screen.
1578 // Contains information about the color gamut and hdr mode of the screen.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // The target screen density being rendered to.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001584 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001585
1586 // Current user preference for the scaling factor for fonts,
1587 // relative to the base density scaling.
1588 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001589 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001590
1591 // Flag indicating whether the hard keyboard is hidden.
1592 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001593 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001594
1595 // The type of keyboard attached to the device.
1596 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1597 optional int32 keyboard = 5;
1598
1599 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1600 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001601 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001602
1603 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1604 // 0 if undefined.
1605 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1606 optional int32 mcc = 7;
1607
1608 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1609 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1610 // MNC_ZERO symbol defined in Configuration.java.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1612 optional int32 mnc = 8;
1613
1614 // The kind of navigation available on the device.
1615 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1616 optional int32 navigation = 9;
1617
1618 // Flag indicating whether the navigation is available.
1619 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001620 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001621
1622 // Overall orientation of the screen.
1623 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1624 optional int32 orientation = 11;
1625
1626 // The current height of the available screen space, in dp units.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001628 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001629
1630 // Bit mask of overall layout of the screen.
1631 // Contains information about screen size, whether the screen is wider/taller
1632 // than normal, whether the screen layout is right-tl-left or left-to-right,
1633 // and whether the screen has a rounded shape.
1634 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001635 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001636
1637 // Current width of the available screen space, in dp units.
1638 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001639 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001640
1641 // The smallest screen size an application will see in normal operation.
1642 // This is the smallest value of both screenWidthDp and screenHeightDp
1643 // in portrait and landscape.
1644 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001645 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001646
1647 // The type of touch screen attached to the device.
1648 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1649 optional int32 touchscreen = 16;
1650
1651 // Bit mask of the ui mode.
1652 // Contains information about the overall ui mode of the device.
1653 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1654 // Also contains information about whether the device is in night mode.
1655 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001656 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001657}
1658
Tej Singheee317b2018-03-07 19:28:05 -08001659
1660/**
1661 * Logs changes in the connection state of the mobile radio.
1662 *
1663 * Logged from:
1664 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1665 */
1666message MobileConnectionStateChanged {
1667 // States are from the state machine DataConnection.java.
1668 enum State {
1669 UNKNOWN = 0;
1670 // The connection is inactive, or disconnected.
1671 INACTIVE = 1;
1672 // The connection is being activated, or connecting.
1673 ACTIVATING = 2;
1674 // The connection is active, or connected.
1675 ACTIVE = 3;
1676 // The connection is disconnecting.
1677 DISCONNECTING = 4;
1678 // The connection is disconnecting after creating a connection.
1679 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1680 }
1681 optional State state = 1;
1682 // For multi-sim phones, this distinguishes between the sim cards.
1683 optional int32 sim_slot_index = 2;
1684 // Used to identify the connection. Starts at 0 and increments by 1 for
1685 // every new network created. Resets whenever the device reboots.
1686 optional int32 data_connection_id = 3;
1687 // A bitmask for the capabilities of this connection.
1688 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1689 // Default value (if we have no information): 0
1690 optional int64 capabilities = 4;
1691 // If this connection has internet.
1692 // This just checks if the DEFAULT bit of capabilities is set.
1693 optional bool has_internet = 5;
1694}
1695
1696/**
1697 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1698 *
1699 * Logged from:
1700 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1701 */
1702message MobileRadioTechnologyChanged {
1703 optional android.telephony.NetworkTypeEnum state = 1;
1704 // For multi-sim phones, this distinguishes between the sim cards.
1705 optional int32 sim_slot_index = 2;
1706}
1707
Andrew Chantb56388b2018-03-22 21:07:33 -07001708/**
1709 * Logs the VID and PID of any connected USB devices.
1710 *
1711 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1712 *
1713 * Logged by Vendor.
1714 */
1715message UsbDeviceAttached {
1716 optional int32 vid = 1;
1717 optional int32 pid = 2;
1718 optional bool has_audio = 3;
1719 optional bool has_hid = 4;
1720 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001721 enum State {
1722 STATE_DISCONNECTED = 0;
1723 STATE_CONNECTED = 1;
1724 }
1725 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001726 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001727}
1728
Tej Singheee317b2018-03-07 19:28:05 -08001729
Tej Singhdd7bd352018-02-09 19:33:15 -08001730/**
Tej Singh5d991e12018-03-09 19:48:11 -08001731 * Logs when Bluetooth is enabled and disabled.
1732 *
1733 * Logged from:
1734 * services/core/java/com/android/server/BluetoothManagerService.java
1735 */
1736message BluetoothEnabledStateChanged {
1737 repeated AttributionNode attribution_node = 1;
1738 // Whether or not bluetooth is enabled on the device.
1739 enum State {
1740 UNKNOWN = 0;
1741 ENABLED = 1;
1742 DISABLED = 2;
1743 }
1744 optional State state = 2;
1745 // The reason for being enabled/disabled.
1746 // Eg. Airplane mode, crash, application request.
1747 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1748 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001749 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001750}
1751
1752/**
Jack Hed9837c82019-01-09 01:19:13 -08001753 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001754 *
1755 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001756 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1757 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001758 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001759 */
1760message BluetoothConnectionStateChanged {
1761 // The state of the connection.
1762 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1763 optional android.bluetooth.ConnectionStateEnum state = 1;
1764 // An identifier that can be used to match connect and disconnect events.
1765 // Currently is last two bytes of a hash of a device level ID and
1766 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001767 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001768 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001769 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1770 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001771 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001772 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001779 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001780 // An identifier that can be used to match events for this device.
1781 // The incremental identifier is locally generated and guaranteed not derived
1782 // from any globally unique hardware id.
1783 // For paired devices, it stays consistent between Bluetooth toggling for the
1784 // same remote device.
1785 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1786 // session for the same remote device.
1787 // Default: 0 if the device's metric id is unknown.
1788 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001789}
1790
1791/**
1792 * Logs when a Bluetooth device connects and disconnects over ACL
1793 *
1794 * Logged from:
1795 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1796 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001797 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001798 */
1799message BluetoothAclConnectionStateChanged {
1800 // An identifier that can be used to match events for this device.
1801 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1802 // Salt: Randomly generated 256 bit value
1803 // Hash algorithm: HMAC-SHA256
1804 // Size: 32 byte
1805 // Default: null or empty if the device identifier is not known
1806 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1807 // The state of the connection.
1808 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1809 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001810 // An identifier that can be used to match events for this device.
1811 // The incremental identifier is locally generated and guaranteed not derived
1812 // from any globally unique hardware id.
1813 // For paired devices, it stays consistent between Bluetooth toggling for the
1814 // same remote device.
1815 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1816 // session for the same remote device.
1817 // Default: 0 if the device's metric id is unknown.
1818 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001819}
1820
1821/**
1822 * Logs when a Bluetooth device connects and disconnects over SCO
1823 *
1824 * Logged from:
1825 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1826 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1827 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001828 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001829 */
1830message BluetoothScoConnectionStateChanged {
1831 // An identifier that can be used to match events for this device.
1832 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1833 // Salt: Randomly generated 256 bit value
1834 // Hash algorithm: HMAC-SHA256
1835 // Size: 32 byte
1836 // Default: null or empty if the device identifier is not known
1837 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1838 // The state of the connection.
1839 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1840 optional android.bluetooth.ConnectionStateEnum state = 2;
1841 // Codec used for this SCO connection
1842 // Default: UNKNOWN
1843 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001844 // An identifier that can be used to match events for this device.
1845 // The incremental identifier is locally generated and guaranteed not derived
1846 // from any globally unique hardware id.
1847 // For paired devices, it stays consistent between Bluetooth toggling for the
1848 // same remote device.
1849 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1850 // session for the same remote device.
1851 // Default: 0 if the device's metric id is unknown.
1852 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001853}
1854
Jack Hec27040a2019-01-09 20:54:41 -08001855/**
1856 * Logged when active device of a profile changes
1857 *
1858 * Logged from:
1859 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1860 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1861 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1862 */
1863message BluetoothActiveDeviceChanged {
1864 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1865 // From android.bluetooth.BluetoothProfile
1866 optional int32 bt_profile = 1;
1867 // An identifier that can be used to match events for this new active device.
1868 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1869 // Salt: Randomly generated 256 bit value
1870 // Hash algorithm: HMAC-SHA256
1871 // Size: 32 byte
1872 // Default: null or empty if there is no active device for this profile
1873 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001874 // An identifier that can be used to match events for this device.
1875 // The incremental identifier is locally generated and guaranteed not derived
1876 // from any globally unique hardware id.
1877 // For paired devices, it stays consistent between Bluetooth toggling for the
1878 // same remote device.
1879 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1880 // session for the same remote device.
1881 // Default: 0 if the device's metric id is unknown.
1882 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001883}
1884
Jack Heab86dbd22018-12-18 15:43:27 -08001885// Logs when there is an event affecting Bluetooth device's link layer connection.
1886// - This event is triggered when there is a related HCI command or event
1887// - Users of this metrics can deduce Bluetooth device's connection state from these events
1888// - HCI commands are logged before the command is sent, after receiving command status, and after
1889// receiving command complete
1890// - HCI events are logged when they arrive
1891//
1892// Low level log from system/bt
1893//
1894// Bluetooth classic commands:
1895// - CMD_CREATE_CONNECTION
1896// - CMD_DISCONNECT
1897// - CMD_CREATE_CONNECTION_CANCEL
1898// - CMD_ACCEPT_CONNECTION_REQUEST
1899// - CMD_REJECT_CONNECTION_REQUEST
1900// - CMD_SETUP_ESCO_CONNECTION
1901// - CMD_ACCEPT_ESCO_CONNECTION
1902// - CMD_REJECT_ESCO_CONNECTION
1903// - CMD_ENH_SETUP_ESCO_CONNECTION
1904// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1905//
1906// Bluetooth low energy commands:
1907// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1908// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1909// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1910// - CMD_BLE_CLEAR_WHITE_LIST
1911// - CMD_BLE_ADD_WHITE_LIST
1912// - CMD_BLE_REMOVE_WHITE_LIST
1913//
1914// Bluetooth classic events:
1915// - EVT_CONNECTION_COMP
1916// - EVT_CONNECTION_REQUEST
1917// - EVT_DISCONNECTION_COMP
1918// - EVT_ESCO_CONNECTION_COMP
1919// - EVT_ESCO_CONNECTION_CHANGED
1920//
1921// Bluetooth low energy meta events:
1922// - BLE_EVT_CONN_COMPLETE_EVT
1923// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1924//
1925// Next tag: 10
1926message BluetoothLinkLayerConnectionEvent {
1927 // An identifier that can be used to match events for this device.
1928 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1929 // Salt: Randomly generated 256 bit value
1930 // Hash algorithm: HMAC-SHA256
1931 // Size: 32 byte
1932 // Default: null or empty if the device identifier is not known
1933 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1934 // Connection handle of this connection if available
1935 // Range: 0x0000 - 0x0EFF (12 bits)
1936 // Default: 0xFFFF if the handle is unknown
1937 optional int32 connection_handle = 2;
1938 // Direction of the link
1939 // Default: DIRECTION_UNKNOWN
1940 optional android.bluetooth.DirectionEnum direction = 3;
1941 // Type of this link
1942 // Default: LINK_TYPE_UNKNOWN
1943 optional android.bluetooth.LinkTypeEnum type = 4;
1944
1945 // Reason metadata for this link layer connection event, rules for interpretation:
1946 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1947 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1948 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1949 // set and valid, ignore hci_ble_event
1950
1951 // HCI command associated with this event
1952 // Default: CMD_UNKNOWN
1953 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1954 // HCI event associated with this event
1955 // Default: EVT_UNKNOWN
1956 optional android.bluetooth.hci.EventEnum hci_event = 6;
1957 // HCI BLE meta event associated with this event
1958 // Default: BLE_EVT_UNKNOWN
1959 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1960 // HCI command status code if this is triggerred by hci_cmd
1961 // Default: STATUS_UNKNOWN
1962 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1963 // HCI reason code associated with this event
1964 // Default: STATUS_UNKNOWN
1965 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001966 // An identifier that can be used to match events for this device.
1967 // The incremental identifier is locally generated and guaranteed not derived
1968 // from any globally unique hardware id.
1969 // For paired devices, it stays consistent between Bluetooth toggling for the
1970 // same remote device.
1971 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1972 // session for the same remote device.
1973 // Default: 0 if the device's metric id is unknown.
1974 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001975}
1976
Howard Roe103fe22019-01-17 16:52:16 -08001977/**
1978 * Logs when a module is rolled back by Watchdog.
1979 *
1980 * Logged from: Rollback Manager
1981 */
1982message WatchdogRollbackOccurred {
1983 enum RollbackType {
1984 UNKNOWN = 0;
1985 ROLLBACK_INITIATE = 1;
1986 ROLLBACK_SUCCESS = 2;
1987 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001988 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001989 }
1990 optional RollbackType rollback_type = 1;
1991
1992 optional string package_name = 2;
1993
1994 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001995
1996 enum RollbackReasonType {
1997 REASON_UNKNOWN = 0;
1998 REASON_NATIVE_CRASH = 1;
1999 REASON_EXPLICIT_HEALTH_CHECK = 2;
2000 REASON_APP_CRASH = 3;
2001 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002002 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002003 }
2004 optional RollbackReasonType rollback_reason = 4;
2005
2006 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2007 // is initiated. Empty if the package is unknown.
2008 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002009
2010 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002011}
2012
Jack Hec27040a2019-01-09 20:54:41 -08002013/**
2014 * Logs when there is a change in Bluetooth A2DP playback state
2015 *
2016 * Logged from:
2017 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2018 */
2019message BluetoothA2dpPlaybackStateChanged {
2020 // An identifier that can be used to match events for this device.
2021 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2022 // Salt: Randomly generated 256 bit value
2023 // Hash algorithm: HMAC-SHA256
2024 // Size: 32 byte
2025 // Default: null or empty if the device identifier is not known
2026 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2027 // Current playback state
2028 // Default: PLAYBACK_STATE_UNKNOWN
2029 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2030 // Current audio coding mode
2031 // Default: AUDIO_CODING_MODE_UNKNOWN
2032 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002033 // An identifier that can be used to match events for this device.
2034 // The incremental identifier is locally generated and guaranteed not derived
2035 // from any globally unique hardware id.
2036 // For paired devices, it stays consistent between Bluetooth toggling for the
2037 // same remote device.
2038 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2039 // session for the same remote device.
2040 // Default: 0 if the device's metric id is unknown.
2041 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002042}
2043
2044/**
2045 * Logs when there is a change in A2DP codec config for a particular remote device
2046 *
2047 * Logged from:
2048 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2049 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2050 */
2051message BluetoothA2dpCodecConfigChanged {
2052 // An identifier that can be used to match events for this device.
2053 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2054 // Salt: Randomly generated 256 bit value
2055 // Hash algorithm: HMAC-SHA256
2056 // Size: 32 byte
2057 // Default: null or empty if the device identifier is not known
2058 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2059 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2060 // Default SOURCE_CODEC_TYPE_INVALID
2061 optional int32 codec_type = 2;
2062 // Codec priroity, the higher the more preferred, -1 for disabled
2063 // Default: CODEC_PRIORITY_DEFAULT
2064 optional int32 codec_priority = 3;
2065 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2066 // Default: SAMPLE_RATE_NONE
2067 optional int32 sample_rate = 4;
2068 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2069 // Default: BITS_PER_SAMPLE_NONE
2070 optional int32 bits_per_sample = 5;
2071 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2072 // Default: CHANNEL_MODE_NONE
2073 optional int32 channel_mode = 6;
2074 // Codec specific values
2075 // Default 0
2076 optional int64 codec_specific_1 = 7;
2077 optional int64 codec_specific_2 = 8;
2078 optional int64 codec_specific_3 = 9;
2079 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002080 // An identifier that can be used to match events for this device.
2081 // The incremental identifier is locally generated and guaranteed not derived
2082 // from any globally unique hardware id.
2083 // For paired devices, it stays consistent between Bluetooth toggling for the
2084 // same remote device.
2085 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2086 // session for the same remote device.
2087 // Default: 0 if the device's metric id is unknown.
2088 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002089}
2090
2091/**
2092 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2093 * Each codec's capability is logged separately due to statsd restriction
2094 *
2095 * Logged from:
2096 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2097 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2098 */
2099message BluetoothA2dpCodecCapabilityChanged {
2100 // An identifier that can be used to match events for this device.
2101 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2102 // Salt: Randomly generated 256 bit value
2103 // Hash algorithm: HMAC-SHA256
2104 // Size: 32 byte
2105 // Default: null or empty if the device identifier is not known
2106 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2107 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2108 // Default SOURCE_CODEC_TYPE_INVALID
2109 optional int32 codec_type = 2;
2110 // Codec priroity, the higher the more preferred, -1 for disabled
2111 // Default: CODEC_PRIORITY_DEFAULT
2112 optional int32 codec_priority = 3;
2113 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2114 // in BluetoothCodecConfig
2115 // Default: empty and SAMPLE_RATE_NONE for individual item
2116 optional int32 sample_rate = 4;
2117 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2118 // in BluetoothCodecConfig
2119 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2120 optional int32 bits_per_sample = 5;
2121 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2122 // BluetoothCodecConfig
2123 // Default: empty and CHANNEL_MODE_NONE for individual item
2124 optional int32 channel_mode = 6;
2125 // Codec specific values
2126 // Default 0
2127 optional int64 codec_specific_1 = 7;
2128 optional int64 codec_specific_2 = 8;
2129 optional int64 codec_specific_3 = 9;
2130 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002131 // An identifier that can be used to match events for this device.
2132 // The incremental identifier is locally generated and guaranteed not derived
2133 // from any globally unique hardware id.
2134 // For paired devices, it stays consistent between Bluetooth toggling for the
2135 // same remote device.
2136 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2137 // session for the same remote device.
2138 // Default: 0 if the device's metric id is unknown.
2139 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002140}
2141
2142/**
2143 * Logs when A2DP failed to read from PCM source.
2144 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2145 *
2146 * Logged from:
2147 * system/bt
2148 */
2149message BluetoothA2dpAudioUnderrunReported {
2150 // An identifier that can be used to match events for this device.
2151 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2152 // Salt: Randomly generated 256 bit value
2153 // Hash algorithm: HMAC-SHA256
2154 // Size: 32 byte
2155 // Default: null or empty if the device identifier is not known
2156 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2157 // Encoding interval in nanoseconds
2158 // Default: 0
2159 optional int64 encoding_interval_nanos = 2;
2160 // Number of bytes of PCM data that could not be read from the source
2161 // Default: 0
2162 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002163 // An identifier that can be used to match events for this device.
2164 // The incremental identifier is locally generated and guaranteed not derived
2165 // from any globally unique hardware id.
2166 // For paired devices, it stays consistent between Bluetooth toggling for the
2167 // same remote device.
2168 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2169 // session for the same remote device.
2170 // Default: 0 if the device's metric id is unknown.
2171 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002172}
2173
2174/**
2175 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2176 * buffer queue is full and we have to drop data
2177 *
2178 * Logged from:
2179 * system/bt
2180 */
2181message BluetoothA2dpAudioOverrunReported {
2182 // An identifier that can be used to match events for this device.
2183 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2184 // Salt: Randomly generated 256 bit value
2185 // Hash algorithm: HMAC-SHA256
2186 // Size: 32 byte
2187 // Default: null or empty if the device identifier is not known
2188 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2189 // Encoding interval in nanoseconds
2190 // Default: 0
2191 optional int64 encoding_interval_nanos = 2;
2192 // Number of buffers dropped in this event
2193 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2194 // Default: 0
2195 optional int32 num_dropped_buffers = 3;
2196 // Number of encoded buffers dropped in this event
2197 // Default 0
2198 optional int32 num_dropped_encoded_frames = 4;
2199 // Number of encoded bytes dropped in this event
2200 // Default: 0
2201 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002202 // An identifier that can be used to match events for this device.
2203 // The incremental identifier is locally generated and guaranteed not derived
2204 // from any globally unique hardware id.
2205 // For paired devices, it stays consistent between Bluetooth toggling for the
2206 // same remote device.
2207 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2208 // session for the same remote device.
2209 // Default: 0 if the device's metric id is unknown.
2210 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002211}
2212
2213/**
2214 * Logs when we receive reports regarding a device's RSSI value
2215 *
2216 * Logged from:
2217 * system/bt
2218 */
2219message BluetoothDeviceRssiReported {
2220 // An identifier that can be used to match events for this device.
2221 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2222 // Salt: Randomly generated 256 bit value
2223 // Hash algorithm: HMAC-SHA256
2224 // Size: 32 byte
2225 // Default: null or empty if the device identifier is not known
2226 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2227 // Connection handle of this connection if available
2228 // Range: 0x0000 - 0x0EFF (12 bits)
2229 // Default: 0xFFFF if the handle is unknown
2230 optional int32 connection_handle = 2;
2231 // HCI command status code if this is triggerred by hci_cmd
2232 // Default: STATUS_UNKNOWN
2233 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2234 // BR/EDR
2235 // Range: -128 ≤ N ≤ 127 (signed integer)
2236 // Units: dB
2237 // LE:
2238 // Range: -127 to 20, 127 (signed integer)
2239 // Units: dBm
2240 // Invalid when an out of range value is reported
2241 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002242 // An identifier that can be used to match events for this device.
2243 // The incremental identifier is locally generated and guaranteed not derived
2244 // from any globally unique hardware id.
2245 // For paired devices, it stays consistent between Bluetooth toggling for the
2246 // same remote device.
2247 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2248 // session for the same remote device.
2249 // Default: 0 if the device's metric id is unknown.
2250 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002251}
2252
2253/**
2254 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2255 *
2256 * Logged from:
2257 * system/bt
2258 */
2259message BluetoothDeviceFailedContactCounterReported {
2260 // An identifier that can be used to match events for this device.
2261 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2262 // Salt: Randomly generated 256 bit value
2263 // Hash algorithm: HMAC-SHA256
2264 // Size: 32 byte
2265 // Default: null or empty if the device identifier is not known
2266 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2267 // Connection handle of this connection if available
2268 // Range: 0x0000 - 0x0EFF (12 bits)
2269 // Default: 0xFFFF if the handle is unknown
2270 optional int32 connection_handle = 2;
2271 // HCI command status code if this is triggerred by hci_cmd
2272 // Default: STATUS_UNKNOWN
2273 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2274 // Number of consecutive failed contacts for a connection corresponding to the Handle
2275 // Range: uint16_t, 0-0xFFFF
2276 // Default: 0xFFFFF
2277 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002278 // An identifier that can be used to match events for this device.
2279 // The incremental identifier is locally generated and guaranteed not derived
2280 // from any globally unique hardware id.
2281 // For paired devices, it stays consistent between Bluetooth toggling for the
2282 // same remote device.
2283 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2284 // session for the same remote device.
2285 // Default: 0 if the device's metric id is unknown.
2286 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002287}
2288
2289/**
2290 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2291 *
2292 * Logged from:
2293 * system/bt
2294 */
2295message BluetoothDeviceTxPowerLevelReported {
2296 // An identifier that can be used to match events for this device.
2297 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2298 // Salt: Randomly generated 256 bit value
2299 // Hash algorithm: HMAC-SHA256
2300 // Size: 32 byte
2301 // Default: null or empty if the device identifier is not known
2302 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2303 // Connection handle of this connection if available
2304 // Range: 0x0000 - 0x0EFF (12 bits)
2305 // Default: 0xFFFF if the handle is unknown
2306 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002307 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002308 // Default: STATUS_UNKNOWN
2309 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2310 // Range: -30 ≤ N ≤ 20
2311 // Units: dBm
2312 // Invalid when an out of range value is reported
2313 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002314 // An identifier that can be used to match events for this device.
2315 // The incremental identifier is locally generated and guaranteed not derived
2316 // from any globally unique hardware id.
2317 // For paired devices, it stays consistent between Bluetooth toggling for the
2318 // same remote device.
2319 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2320 // session for the same remote device.
2321 // Default: 0 if the device's metric id is unknown.
2322 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002323}
Jack Heab86dbd22018-12-18 15:43:27 -08002324
Tej Singh5d991e12018-03-09 19:48:11 -08002325/**
Jack He1021a612019-01-20 21:22:46 -08002326 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2327 * receiving an HCI command from the host
2328 *
2329 * Logged from: system/bt
2330 */
2331message BluetoothHciTimeoutReported {
2332 // HCI command associated with this event
2333 // Default: CMD_UNKNOWN
2334 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2335}
2336
2337/**
2338 * Logs when we receive Bluetooth Link Quality Report event from the controller
2339 * See Android Bluetooth HCI specification for more details
2340 *
2341 * Note: all count and bytes field are counted since last event
2342 *
2343 * Logged from: system/bt
2344 */
2345message BluetoothQualityReportReported {
2346 // Quality report ID
2347 // Original type: uint8_t
2348 // Default: BQR_ID_UNKNOWN
2349 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2350 // Packet type of the connection
2351 // Original type: uint8_t
2352 // Default: BQR_PACKET_TYPE_UNKNOWN
2353 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2354 // Connection handle of the connection
2355 // Original type: uint16_t
2356 optional int32 connection_handle = 3;
2357 // Performing Role for the connection
2358 // Original type: uint8_t
2359 optional int32 connection_role = 4;
2360 // Current Transmit Power Level for the connection. This value is the same as the controller's
2361 // response to the HCI_Read_Transmit_Power_Level HCI command
2362 // Original type: uint8_t
2363 optional int32 tx_power_level = 5;
2364 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2365 // absolute receiver signal strength value
2366 // Original type: int8_t
2367 optional int32 rssi = 6;
2368 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2369 // channels used by the link currently
2370 // Original type: uint8_t
2371 optional int32 snr = 7;
2372 // Indicates the number of unused channels in AFH_channel_map
2373 // Original type: uint8_t
2374 optional int32 unused_afh_channel_count = 8;
2375 // Indicates the number of the channels which are interfered and quality is bad but are still
2376 // selected for AFH
2377 // Original type: uint8_t
2378 optional int32 afh_select_unideal_channel_count = 9;
2379 // Current Link Supervision Timeout Setting
2380 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2381 // Original type: uint16_t
2382 optional int32 lsto = 10;
2383 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2384 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2385 // 0x01 (Piconet Clock)
2386 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2387 // Original type: uint32_t
2388 optional int64 connection_piconet_clock = 11;
2389 // The count of retransmission
2390 // Original type: uint32_t
2391 optional int64 retransmission_count = 12;
2392 // The count of no RX
2393 // Original type: uint32_t
2394 optional int64 no_rx_count = 13;
2395 // The count of NAK (Negative Acknowledge)
2396 // Original type: uint32_t
2397 optional int64 nak_count = 14;
2398 // Controller timestamp of last TX ACK
2399 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2400 // Original type: uint32_t
2401 optional int64 last_tx_ack_timestamp = 15;
2402 // The count of Flow-off (STOP)
2403 // Original type: uint32_t
2404 optional int64 flow_off_count = 16;
2405 // Controller timestamp of last Flow-on (GO)
2406 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2407 // Original type: uint32_t
2408 optional int64 last_flow_on_timestamp = 17;
2409 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2410 // Original type: uint32_t
2411 optional int64 buffer_overflow_bytes = 18;
2412 // Buffer underflow count (in byte) since last event
2413 // Original type: uint32_t
2414 optional int64 buffer_underflow_bytes = 19;
2415}
2416
2417/**
2418 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2419 *
2420 * Notes:
2421 * - Each event can be partially filled as we might learn different pieces of device
2422 * information at different time
2423 * - Multiple device info events can be combined to give more complete picture
2424 * - When multiple device info events tries to describe the same information, the
2425 * later one wins
2426 *
2427 * Logged from:
2428 * packages/apps/Bluetooth
2429 */
Jack Heaea26982019-04-04 11:19:48 -07002430message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002431 // An identifier that can be used to match events for this device.
2432 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2433 // Salt: Randomly generated 256 bit value
2434 // Hash algorithm: HMAC-SHA256
2435 // Size: 32 byte
2436 // Default: null or empty if the device identifier is not known
2437 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2438 // Where is this device info obtained from
2439 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2440 // Name of the data source
2441 // For EXTERNAL: package name of the data source
2442 // For INTERNAL: null for general case, component name otherwise
2443 optional string source_name = 3;
2444 // Name of the manufacturer of this device
2445 optional string manufacturer = 4;
2446 // Model of this device
2447 optional string model = 5;
2448 // Hardware version of this device
2449 optional string hardware_version = 6;
2450 // Software version of this device
2451 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002452 // An identifier that can be used to match events for this device.
2453 // The incremental identifier is locally generated and guaranteed not derived
2454 // from any globally unique hardware id.
2455 // For paired devices, it stays consistent between Bluetooth toggling for the
2456 // same remote device.
2457 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2458 // session for the same remote device.
2459 // Default: 0 if the device's metric id is unknown.
2460 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002461}
2462
2463/**
2464 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2465 * device, as documented by the Bluetooth Core HCI specification
2466 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2467 * Vol 2, Part E, Page 1118
2468 *
2469 * Logged from:
2470 * system/bt
2471 */
2472message BluetoothRemoteVersionInfoReported {
2473 // Connection handle of the connection
2474 // Original type: uint16_t
2475 optional int32 connection_handle = 1;
2476 // HCI command status code
2477 // Default: STATUS_UNKNOWN
2478 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2479 // 1 byte Version of current LMP in the remote controller
2480 optional int32 lmp_version = 3;
2481 // 2 bytes LMP manufacturer code of the remote controller
2482 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2483 optional int32 lmp_manufacturer_code = 4;
2484 // 4 bytes subversion of the LMP in the remote controller
2485 optional int32 lmp_subversion = 5;
2486}
2487
2488/**
2489 * Logs when certain Bluetooth SDP attributes are discovered
2490 * Constant definitions are from:
2491 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2492 *
2493 * Current logged attributes:
2494 * - BluetoothProfileDescriptorList
2495 * - Supported Features Bitmask
2496 *
2497 * Logged from:
2498 * system/bt
2499 */
2500message BluetoothSdpAttributeReported {
2501 // An identifier that can be used to match events for this device.
2502 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2503 // Salt: Randomly generated 256 bit value
2504 // Hash algorithm: HMAC-SHA256
2505 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2506 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2507 // Original type: uint16_t
2508 optional int32 protocol_uuid = 2;
2509 // Short form UUIDs used to identify Bluetooth SDP attribute types
2510 // Original type: uint16_t
2511 optional int32 attribute_id = 3;
2512 // Attribute value for the particular attribute
2513 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002514 // An identifier that can be used to match events for this device.
2515 // The incremental identifier is locally generated and guaranteed not derived
2516 // from any globally unique hardware id.
2517 // For paired devices, it stays consistent between Bluetooth toggling for the
2518 // same remote device.
2519 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2520 // session for the same remote device.
2521 // Default: 0 if the device's metric id is unknown.
2522 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002523}
2524
2525/**
2526 * Logs when bond state of a Bluetooth device changes
2527 *
2528 * Logged from:
2529 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2530 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2531 */
2532message BluetoothBondStateChanged {
2533 // An identifier that can be used to match events for this device.
2534 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2535 // Salt: Randomly generated 256 bit value
2536 // Hash algorithm: HMAC-SHA256
2537 // Size: 32 byte
2538 // Default: null or empty if the device identifier is not known
2539 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2540 // Preferred transport type to remote dual mode device
2541 // Default: TRANSPORT_AUTO means no preference
2542 optional android.bluetooth.TransportTypeEnum transport = 2;
2543 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2544 // Default: UNKNOWN
2545 optional android.bluetooth.DeviceTypeEnum type = 3;
2546 // Current bond state (NONE, BONDING, BONDED)
2547 // Default: BOND_STATE_UNKNOWN
2548 optional android.bluetooth.BondStateEnum bond_state = 4;
2549 // Bonding sub state
2550 // Default: BOND_SUB_STATE_UNKNOWN
2551 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2552 // Unbond Reason
2553 // Default: UNBOND_REASON_UNKNOWN
2554 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002555 // An identifier that can be used to match events for this device.
2556 // The incremental identifier is locally generated and guaranteed not derived
2557 // from any globally unique hardware id.
2558 // For paired devices, it stays consistent between Bluetooth toggling for the
2559 // same remote device.
2560 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2561 // session for the same remote device.
2562 // Default: 0 if the device's metric id is unknown.
2563 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002564}
2565
2566/**
2567 * Logs there is an event related Bluetooth classic pairing
2568 *
2569 * Logged from:
2570 * system/bt
2571 */
2572message BluetoothClassicPairingEventReported {
2573 // An identifier that can be used to match events for this device.
2574 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2575 // Salt: Randomly generated 256 bit value
2576 // Hash algorithm: HMAC-SHA256
2577 // Size: 32 byte
2578 // Default: null or empty if the device identifier is not known
2579 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2580 // Connection handle of this connection if available
2581 // Range: 0x0000 - 0x0EFF (12 bits)
2582 // Default: 0xFFFF if the handle is unknown
2583 optional int32 connection_handle = 2;
2584 // HCI command associated with this event
2585 // Default: CMD_UNKNOWN
2586 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2587 // HCI event associated with this event
2588 // Default: EVT_UNKNOWN
2589 optional android.bluetooth.hci.EventEnum hci_event = 4;
2590 // HCI command status code if this is triggerred by hci_cmd
2591 // Default: STATUS_UNKNOWN
2592 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2593 // HCI reason code associated with this event
2594 // Default: STATUS_UNKNOWN
2595 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002596 // A status value related to this specific event
2597 // Default: 0
2598 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002599 // An identifier that can be used to match events for this device.
2600 // The incremental identifier is locally generated and guaranteed not derived
2601 // from any globally unique hardware id.
2602 // For paired devices, it stays consistent between Bluetooth toggling for the
2603 // same remote device.
2604 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2605 // session for the same remote device.
2606 // Default: 0 if the device's metric id is unknown.
2607 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002608}
2609
2610/**
2611 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2612 *
2613 * Logged from:
2614 * system/bt
2615 */
2616message BluetoothSmpPairingEventReported {
2617 // An identifier that can be used to match events for this device.
2618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2619 // Salt: Randomly generated 256 bit value
2620 // Hash algorithm: HMAC-SHA256
2621 // Size: 32 byte
2622 // Default: null or empty if the device identifier is not known
2623 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2624 // SMP command sent or received over L2CAP
2625 // Default: CMD_UNKNOWN
2626 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2627 // Whether this command is sent or received
2628 // Default: DIRECTION_UNKNOWN
2629 optional android.bluetooth.DirectionEnum direction = 3;
2630 // SMP failure reason code
2631 // Default: PAIRING_FAIL_REASON_DEFAULT
2632 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002633 // An identifier that can be used to match events for this device.
2634 // The incremental identifier is locally generated and guaranteed not derived
2635 // from any globally unique hardware id.
2636 // For paired devices, it stays consistent between Bluetooth toggling for the
2637 // same remote device.
2638 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2639 // session for the same remote device.
2640 // Default: 0 if the device's metric id is unknown.
2641 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002642}
2643
2644/**
Jack He815cdba2019-01-30 17:24:55 -08002645 * Logs when a Bluetooth socket’s connection state changed
2646 *
2647 * Logged from:
2648 * system/bt
2649 */
2650message BluetoothSocketConnectionStateChanged {
2651 // An identifier that can be used to match events for this device.
2652 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2653 // Salt: Randomly generated 256 bit value
2654 // Hash algorithm: HMAC-SHA256
2655 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002656 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002657 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002658 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002659 // Default 0 when unknown or don't care
2660 optional int32 port = 2;
2661 // Socket type as mentioned in
2662 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2663 // Default: SOCKET_TYPE_UNKNOWN
2664 optional android.bluetooth.SocketTypeEnum type = 3;
2665 // Socket connection state
2666 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2667 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2668 // Number of bytes sent to remote device during this connection
2669 optional int64 tx_bytes = 5;
2670 // Number of bytes received from remote device during this connection
2671 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002672 // Socket owner's UID
2673 optional int32 uid = 7 [(is_uid) = true];
2674 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2675 // |port| must be spawned by |server_port|
2676 // Default 0 when unknown or don't care
2677 optional int32 server_port = 8;
2678 // Whether this is a server listener socket
2679 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002680 // An identifier that can be used to match events for this device.
2681 // The incremental identifier is locally generated and guaranteed not derived
2682 // from any globally unique hardware id.
2683 // For paired devices, it stays consistent between Bluetooth toggling for the
2684 // same remote device.
2685 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2686 // session for the same remote device.
2687 // Default: 0 if the device's metric id is unknown.
2688 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002689}
2690
2691/**
Jack He71426802019-04-02 13:32:52 -07002692 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2693 *
2694 * Logged from:
2695 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2696 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2697 *
2698 */
2699message BluetoothClassOfDeviceReported {
2700 // An identifier that can be used to match events for this device.
2701 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2702 // Salt: Randomly generated 256 bit value
2703 // Hash algorithm: HMAC-SHA256
2704 // Size: 32 byte
2705 // Default: null or empty if this is a server listener socket
2706 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2707 // Class of Device (CoD) value including both Major, Minor device class and service class
2708 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2709 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2710 // Default: 0
2711 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002712 // An identifier that can be used to match events for this device.
2713 // The incremental identifier is locally generated and guaranteed not derived
2714 // from any globally unique hardware id.
2715 // For paired devices, it stays consistent between Bluetooth toggling for the
2716 // same remote device.
2717 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2718 // session for the same remote device.
2719 // Default: 0 if the device's metric id is unknown.
2720 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002721}
2722
2723/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002724 * Logs when something is plugged into or removed from the USB-C connector.
2725 *
2726 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002727 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002728 */
2729message UsbConnectorStateChanged {
2730 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002731 STATE_DISCONNECTED = 0;
2732 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002733 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002734 optional State state = 1
2735 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2736 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002737 // Last active session in ms.
2738 // 0 when the port is in connected state.
2739 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002740}
2741
2742/**
2743 * Logs the reported speaker impedance.
2744 *
2745 * Logged from:
2746 * Vendor audio implementation.
2747 */
2748message SpeakerImpedanceReported {
2749 optional int32 speaker_location = 1;
2750 optional int32 impedance = 2;
2751}
2752
2753/**
2754 * Logs the report of a failed hardware.
2755 *
2756 * Logged from:
2757 * Vendor HALs.
2758 *
2759 */
2760message HardwareFailed {
2761 enum HardwareType {
2762 HARDWARE_FAILED_UNKNOWN = 0;
2763 HARDWARE_FAILED_MICROPHONE = 1;
2764 HARDWARE_FAILED_CODEC = 2;
2765 HARDWARE_FAILED_SPEAKER = 3;
2766 HARDWARE_FAILED_FINGERPRINT = 4;
2767 }
2768 optional HardwareType hardware_type = 1;
2769
Maggie White6dcd8572019-01-31 14:11:50 -08002770 /**
2771 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002772 * the same hardware_type. The specific locations are vendor defined integers,
2773 * referring to board-specific numbering schemes.
2774 */
2775 optional int32 hardware_location = 2;
2776
Maggie White6dcd8572019-01-31 14:11:50 -08002777 /**
2778 * failure_code is specific to the HardwareType of the failed hardware.
2779 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002780 */
Maggie White6dcd8572019-01-31 14:11:50 -08002781 enum HardwareErrorCode {
2782 UNKNOWN = 0;
2783 COMPLETE = 1;
2784 SPEAKER_HIGH_Z = 2;
2785 SPEAKER_SHORT = 3;
2786 FINGERPRINT_SENSOR_BROKEN = 4;
2787 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002788 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002789 }
2790 optional int32 failure_code = 3;
2791}
2792
2793/**
2794 * Log an event when the device has been physically dropped.
2795 * Reported from the /vendor partition.
2796 */
2797message PhysicalDropDetected {
2798 // Confidence that the event was actually a drop, 0 -> 100
2799 optional int32 confidence_pctg = 1;
2800 // Peak acceleration of the drop, in 1/1000s of a g.
2801 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002802 // Duration of freefall in ms
2803 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002804}
2805
2806/**
2807 * Log bucketed battery charge cycles.
2808 *
2809 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002810 * a given charge point. For example, if 10 cycle buckets are
2811 * initialized, bucket 1 is the lowest 1/10th of the battery,
2812 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002813 *
2814 * Logged from:
2815 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2816 */
2817message ChargeCyclesReported {
2818 optional int32 cycle_bucket_1 = 1;
2819 optional int32 cycle_bucket_2 = 2;
2820 optional int32 cycle_bucket_3 = 3;
2821 optional int32 cycle_bucket_4 = 4;
2822 optional int32 cycle_bucket_5 = 5;
2823 optional int32 cycle_bucket_6 = 6;
2824 optional int32 cycle_bucket_7 = 7;
2825 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002826 optional int32 cycle_bucket_9 = 9;
2827 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002828}
2829
2830/**
Howard Roa46b6582018-09-18 16:45:02 -07002831 * Log battery health snapshot.
2832 *
2833 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2834 * are snapshotted periodically over 24hrs.
2835 */
2836message BatteryHealthSnapshot {
2837 enum BatterySnapshotType {
2838 UNKNOWN = 0;
2839 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2840 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2841 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2842 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2843 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2844 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2845 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2846 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2847 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2848 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2849 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2850 }
2851 optional BatterySnapshotType type = 1;
2852 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002853 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002854 // Voltage Battery Voltage, in microVolts.
2855 optional int32 voltage_micro_volt = 3;
2856 // Current Battery current, in microAmps.
2857 optional int32 current_micro_amps = 4;
2858 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2859 optional int32 open_circuit_micro_volt = 5;
2860 // Resistance Battery Resistance, in microOhms.
2861 optional int32 resistance_micro_ohm = 6;
2862 // Level Battery Level, as % of full.
2863 optional int32 level_percent = 7;
2864}
2865
2866/**
2867 * Log slow I/O operations on the primary storage.
2868 */
2869message SlowIo {
2870 // Classifications of IO Operations.
2871 enum IoOperation {
2872 UNKNOWN = 0;
2873 READ = 1;
2874 WRITE = 2;
2875 UNMAP = 3;
2876 SYNC = 4;
2877 }
2878 optional IoOperation operation = 1;
2879
2880 // The number of slow IO operations of this type over 24 hours.
2881 optional int32 count = 2;
2882}
2883
2884/**
2885 * Log battery caused shutdown with the last recorded voltage.
2886 */
2887message BatteryCausedShutdown {
2888 // The last recorded battery voltage prior to shutdown.
2889 optional int32 last_recorded_micro_volt = 1;
2890}
2891
2892/**
Tej Singha72344992019-04-17 18:55:08 -07002893 * Logs when ThermalService receives throttling events.
2894 *
2895 * Logged from:
2896 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2897 */
2898message ThermalThrottlingSeverityStateChanged {
2899 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2900 optional android.os.TemperatureTypeEnum sensor_type = 1;
2901
2902 // The name of the temperature source. Eg. CPU0
2903 optional string sensor_name = 2;
2904
2905 // Temperature in tenths of a degree C.
2906 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2907 optional int32 temperature_deci_celsius = 3;
2908
2909 // Relative severity of the throttling, see enum definition.
2910 optional android.os.ThrottlingSeverityEnum severity = 4;
2911}
2912
2913/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002914 * Logs the duration of a davey (jank of >=700ms) when it occurs
2915 *
2916 * Logged from:
2917 * frameworks/base/libs/hwui/JankTracker.cpp
2918 */
2919message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002920 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002921 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002922
Tej Singhbb8554a2018-01-26 11:59:14 -08002923 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002924 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002925}
2926
2927/**
Bookatze5885242017-10-24 20:10:31 -07002928 * Logs phone signal strength changes.
2929 *
2930 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002931 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002932 */
2933message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002934 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2935 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002936}
2937
Yangster4ccebea2018-10-09 17:09:02 -07002938
2939/**
2940 * Logs when the phone state, sim state or signal strength changes
2941 *
2942 * Logged from:
2943 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2944 */
2945message PhoneServiceStateChanged {
2946 optional android.telephony.ServiceStateEnum state = 1;
2947 optional android.telephony.SimStateEnum sim_state = 2;
2948 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2949}
2950
2951/**
2952 * Logs when the phone becomes on or off.
2953 *
2954 * Logged from:
2955 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2956 */
2957message PhoneStateChanged {
2958 enum State {
2959 OFF = 0;
2960 ON = 1;
2961 }
2962 optional State state = 1;
2963}
2964
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002965message BackGesture {
2966 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002967 DEFAULT_BACK_TYPE = 0;
2968 COMPLETED = 1;
2969 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2970 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2971 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2972 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2973 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2974 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2975 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002976 }
2977 optional BackType type = 1;
2978
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002979 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2980 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2981 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2982 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2983 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2984 optional int32 left_boundary = 8; // left edge width + left inset
2985 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2986
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002987 enum WindowHorizontalLocation {
2988 DEFAULT_LOCATION = 0;
2989 LEFT = 1;
2990 RIGHT = 2;
2991 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002992 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002993}
2994
2995message ExclusionRectStateChanged {
2996 optional string component_name = 1; // if not available, simply packageName
2997 optional int32 requested_height = 2; // px
2998 optional int32 rejected_height = 3; // px
2999
3000 enum WindowHorizontalLocation {
3001 DEFAULT_LOCATION = 0;
3002 LEFT = 1;
3003 RIGHT = 2;
3004 }
3005 optional WindowHorizontalLocation x_location = 4;
3006 optional bool landscape = 5;
3007 optional bool splitscreen = 6;
3008 optional int32 duration_millis = 7;
3009}
3010
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003011/**
3012 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3013 *
3014 * Logged from:
3015 * packages/apps/Launcher3
3016 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003017message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003018 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003019 optional android.stats.launcher.LauncherState src_state = 2;
3020 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003021 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3022 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3023
3024 // The event id (e.g., app launch, drag and drop, long press)
3025 optional int32 event_id = 6;
3026 // The event's source or target id (e.g., icon, task, button)
3027 optional int32 target_id = 7;
3028 // If the target needs to be tracked, use this id field
3029 optional int32 instance_id = 8;
3030 optional int32 uid = 9 [(is_uid) = true];
3031 optional string package_name = 10;
3032 optional string component_name = 11;
3033
3034 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003035 optional int32 grid_x = 12 [default = -1];
3036 optional int32 grid_y = 13 [default = -1];
3037 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003038
3039 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003040 optional int32 grid_x_parent = 15 [default = -1];
3041 optional int32 grid_y_parent = 16 [default = -1];
3042 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003043
3044 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3045 optional int32 hierarchy = 18;
3046
3047 optional bool is_work_profile = 19;
3048
3049 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003050 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003051
3052 // e.g., folderLabelState can be captured in the following two fields
3053 optional int32 from_state = 21;
3054 optional int32 to_state = 22;
3055
3056 // e.g., autofilled or suggested texts that are not user entered
3057 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003058
3059 // e.g., number of contents inside a container (e.g., icons inside a folder)
3060 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003061}
3062
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003063/**
3064 * Used for snapshot of the HomeScreen UI elements
3065 *
3066 * Logged from:
3067 * packages/apps/Launcher3
3068 */
3069message LauncherStaticLayout {
3070 // The event id (e.g., snapshot, drag and drop)
3071 optional int32 event_id = 1;
3072 // The event's source or target id (e.g., icon, shortcut, widget)
3073 optional int32 target_id = 2;
3074 // If the target needs to be tracked, use this id field
3075 optional int32 instance_id = 3;
3076 optional int32 uid = 4 [(is_uid) = true];
3077 optional string package_name = 5;
3078 optional string component_name = 6;
3079
3080 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003081 optional int32 grid_x = 7 [default = -1];
3082 optional int32 grid_y = 8 [default = -1];
3083 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003084
3085 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003086 // e.g., when used with widgets target, use these values for (span_x, span_y)
3087 optional int32 grid_x_parent = 10 [default = -1];
3088 optional int32 grid_y_parent = 11 [default = -1];
3089 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003090
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003091 // UNKNOWN = 0
3092 // HOTSEAT = 1
3093 // WORKSPACE = 2
3094 // FOLDER_HOTSEAT = 3
3095 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003096 optional int32 hierarchy = 13;
3097
3098 optional bool is_work_profile = 14;
3099
3100 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3101 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003102
3103 // e.g., number of icons inside a folder
3104 optional int32 cardinality = 16;
3105
3106 // e.g., (x, y) span of the widget inside homescreen grid system
3107 optional int32 span_x = 17 [default = 1];
3108 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003109}
3110
3111/**
3112 * Logs when Wallpaper or ThemePicker UI has changed.
3113 *
3114 * Logged from:
3115 * packages/apps/ThemePicker
3116 * packages/apps/WallpaperPicker2
3117 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003118message StyleUIChanged {
3119 optional android.stats.style.Action action = 1;
3120 optional int32 color_package_hash = 2;
3121 optional int32 font_package_hash = 3;
3122 optional int32 shape_package_hash = 4;
3123 optional int32 clock_package_hash = 5;
3124 optional int32 launcher_grid = 6;
3125 optional int32 wallpaper_category_hash = 7;
3126 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003127 optional int32 color_preference = 9;
3128 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003129}
3130
David Chenc28b2bb2017-10-24 12:52:52 -07003131/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003132 * Logs when Settings UI has changed.
3133 *
3134 * Logged from:
3135 * packages/apps/Settings
3136 */
3137message SettingsUIChanged {
3138 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003139 * Where this SettingsUIChange event comes from. For example, if
3140 * it's a PAGE_VISIBLE event, where the page is opened from.
3141 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003142 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003143
3144 /**
3145 * What the UI action is.
3146 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003147 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003148
3149 /**
3150 * Where the action is happening
3151 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003152 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003153
3154 /**
3155 * What preference changed in this event.
3156 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003157 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003158
3159 /**
3160 * The new value of the changed preference.
3161 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003162 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003163}
3164
3165/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003166 * Logs basic timing information about touch events.
3167 * Reported at most every 5 minutes while device is being interacted with.
3168 *
3169 * Logged from:
3170 * frameworks/native/services/inputflinger
3171 */
3172message TouchEventReported {
3173 /**
3174 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003175 * and the standard deviation of the time spent processing touchscreen events
3176 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003177 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003178 * On supported devices, the starting point is taken during the hard interrupt inside the
3179 * kernel touch driver. On all other devices, the starting point is taken inside
3180 * the kernel's input event subsystem upon receipt of the input event.
3181 * The ending point is taken inside InputDispatcher, just after the input event
3182 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003183 */
3184 // Minimum value
3185 optional float latency_min_micros = 1;
3186 // Maximum value
3187 optional float latency_max_micros = 2;
3188 // Average value
3189 optional float latency_mean_micros = 3;
3190 // Standard deviation
3191 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003192 // Number of touch events (input_event) in this report
3193 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003194}
3195
3196/**
Philip Quinn0eded622019-01-29 12:46:28 -08003197 * Logs gesture classification and timing information for touch events.
3198 *
3199 * Logged from:
3200 * frameworks/base/core/java/android/view/GestureDetector.java
3201 * frameworks/base/core/java/android/view/View.java
3202 */
3203message TouchGestureClassified {
3204 // The source of the classification (e.g. Java class name).
3205 optional string source = 1;
3206
3207 enum Classification {
3208 UNKNOWN_CLASSIFICATION = 0;
3209 SINGLE_TAP = 1;
3210 DOUBLE_TAP = 2;
3211 LONG_PRESS = 3;
3212 DEEP_PRESS = 4;
3213 SCROLL = 5;
3214 }
3215 // The classification of the gesture.
3216 optional Classification classification = 2;
3217
3218 // The interval from the start of a touch event stream until the
3219 // classification was made.
3220 optional int32 latency_millis = 3;
3221
3222 // The distance from the location of the first touch event to the
3223 // location of the touch event when the classification was made.
3224 optional float displacement_px = 4;
3225}
3226
3227/**
David Chenc28b2bb2017-10-24 12:52:52 -07003228 * Logs that a setting was updated.
3229 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003230 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003231 * The tag and is_default allow resetting of settings to default values based on the specified
3232 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3233 */
3234message SettingChanged {
3235 // The name of the setting.
3236 optional string setting = 1;
3237
3238 // The change being imposed on this setting. May represent a number, eg "3".
3239 optional string value = 2;
3240
3241 // The new value of this setting. For most settings, this is same as value. For some settings,
3242 // value is +X or -X where X represents an element in a set. For example, if the previous value
3243 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3244 // The +/- feature is currently only used for location_providers_allowed.
3245 optional string new_value = 3;
3246
3247 // The previous value of this setting.
3248 optional string prev_value = 4;
3249
3250 // The tag used with the is_default for resetting sets of settings. This is generally null.
3251 optional string tag = 5;
3252
Bookatz90867622018-01-31 15:05:57 -08003253 // True if this setting with tag should be resettable.
3254 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003255
David Chenbd789912018-03-16 17:19:55 -07003256 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003257 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003258
3259 enum ChangeReason {
3260 UPDATED = 1; // Updated can be an insertion or an update.
3261 DELETED = 2;
3262 }
3263 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003264}
Chenjie Yub3dda412017-10-24 13:41:59 -07003265
Chenjie Yu05013b32017-11-21 10:21:41 -08003266/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003267 * Logs activity going to foreground or background
3268 *
3269 * Logged from:
3270 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3271 */
3272message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003273 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003274 optional string pkg_name = 2;
3275 optional string class_name = 3;
3276
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003277 enum State {
3278 BACKGROUND = 0;
3279 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003280 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003281 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003282}
David Chenc8a43242017-10-17 16:23:28 -07003283
3284/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003285 * Logs when a volume entered low Storage state.
3286 * Logged from:
3287 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3288 */
3289message LowStorageStateChanged {
3290 // Volume that ran out of storage.
3291 optional string volume_description = 1;
3292
3293 enum State {
3294 UNKNOWN = 0;
3295 OFF = 1;
3296 ON = 2;
3297 }
3298 optional State state = 2;
3299}
3300
3301/**
3302 * Logs when an app is downgraded.
3303 * Logged from:
3304 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3305 */
3306message AppDowngraded {
3307 optional string package_name = 1;
3308 // Size of the package (all data) before being downgraded.
3309 optional int64 size_in_bytes_before = 2;
3310 // Size of the package (all data) after being downgraded.
3311 optional int64 size_in_bytes_after = 3;
3312
3313 optional bool aggressive = 4;
3314}
3315
3316/**
3317 * Logs when an app is optimized after being downgraded.
3318 * Logged from:
3319 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3320 */
3321message AppOptimizedAfterDowngraded {
3322 optional string package_name = 1;
3323}
3324
3325/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003326 * Logs whenever an app is installed on external storage.
3327 * Logged from:
3328 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3329 */
3330message AppInstallOnExternalStorageReported {
3331 // The type of external storage.
3332 optional android.stats.storage.ExternalStorageType storage_type = 1;
3333 // The name of the package that is installed on the sd card.
3334 optional string package_name = 2;
3335}
3336
3337/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003338 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003339 * Logged from:
3340 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3341 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003342message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003343 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003344
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003345 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003346
3347 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003349 optional string process_name = 3;
3350
3351 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003352 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003353
3354 optional string package_name = 5;
3355
3356 enum InstantApp {
3357 UNAVAILABLE = 0;
3358 FALSE = 1;
3359 TRUE = 2;
3360 }
3361 optional InstantApp is_instant_app = 6;
3362
3363 enum ForegroundState {
3364 UNKNOWN = 0;
3365 BACKGROUND = 1;
3366 FOREGROUND = 2;
3367 }
3368 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003369
3370 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003371}
David Chen9e3808c2017-11-20 17:25:34 -08003372
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003373/**
3374 * Logs when a WTF (What a Terrible Failure) happened.
3375 * Logged from:
3376 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3377 */
3378message WTFOccurred {
3379 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003380
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003382
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383 // The name of the process.
3384 // system_server if it is not by an app
3385 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003386
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003387 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003388 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003389
3390 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003391}
3392
3393/**
3394 * Logs when system server reports low memory.
3395 * Logged from:
3396 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3397 */
3398message LowMemReported {
3399}
3400
3401/**
3402 * Logs when an app ANR (App Not Responding) occurs.
3403 * Logged from:
3404 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3405 */
3406message ANROccurred {
3407 optional int32 uid = 1 [(is_uid) = true];
3408
3409 optional string process_name = 2;
3410
3411 optional string short_component_name = 3;
3412
3413 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003414
3415 enum InstantApp {
3416 UNAVAILABLE = 0;
3417 FALSE = 1;
3418 TRUE = 2;
3419 }
3420 optional InstantApp is_instant_app = 5;
3421
3422 enum ForegroundState {
3423 UNKNOWN = 0;
3424 BACKGROUND = 1;
3425 FOREGROUND = 2;
3426 }
3427 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003428
3429 optional android.server.ErrorSource error_source = 7;
3430
3431 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003432}
3433
Bookatza7020bd2018-08-28 16:29:35 -07003434/**
3435 * Logs when the vibrator state changes.
3436 * Logged from:
3437 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3438 */
3439message VibratorStateChanged {
3440 repeated AttributionNode attribution_node = 1;
3441
3442 enum State {
3443 OFF = 0;
3444 ON = 1;
3445 }
3446 optional State state = 2;
3447
3448 // Duration (in milliseconds) requested to keep the vibrator on.
3449 // Only applicable for State == ON.
3450 optional int64 duration_millis = 3;
3451}
3452
David Chen0a368b22017-12-06 16:28:16 -08003453/*
3454 * Allows other apps to push events into statsd.
3455 * Logged from:
3456 * frameworks/base/core/java/android/util/StatsLog.java
3457 */
David Chen0b5c90c2018-01-25 16:51:49 -08003458message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003459 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003460 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003461
3462 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3463 optional int32 label = 2;
3464
3465 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3466 // predicates for the metrics).
3467 enum State {
3468 UNKNOWN = 0;
3469 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3470 STOP = 2;
3471 START = 3;
3472 }
3473 optional State state = 3;
3474}
3475
David Chen9e3808c2017-11-20 17:25:34 -08003476/**
Bookatz7948c872018-09-04 12:58:33 -07003477 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3478 * For example, this could be due to the user manually changing the time.
3479 *
3480 * Logged from:
3481 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3482 */
3483message WallClockTimeShifted {
3484 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3485 optional int64 wall_clock_timestamp_millis = 1;
3486}
3487
3488/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003489 * Logs when statsd detects an anomaly.
3490 *
3491 * Logged from:
3492 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3493 */
3494message AnomalyDetected {
3495 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003496 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003497
Yangster-mac94e197c2018-01-02 16:03:03 -08003498 // Id of the config whose anomaly detection alert fired.
3499 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003500
Yangster-mac94e197c2018-01-02 16:03:03 -08003501 // Id of the alert (i.e. name of the anomaly that was detected).
3502 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003503}
3504
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003505message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003506 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003507 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003508
3509 // The app package name.
3510 optional string pkg_name = 2;
3511
3512 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003513 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003514 WARM = 1;
3515 HOT = 2;
3516 COLD = 3;
3517 }
3518 // The transition type.
3519 optional TransitionType type = 3;
3520
3521 // The activity name.
3522 optional string activity_name = 4;
3523
3524 // The name of the calling app. Empty if not set.
3525 optional string calling_pkg_name = 5;
3526
3527 // Whether the app is an instant app.
3528 optional bool is_instant_app = 6;
3529
3530 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003531 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003532
Bookatz80d11a02018-01-16 10:46:35 -08003533 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003534
David Chen0b5c90c2018-01-25 16:51:49 -08003535 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003536 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003537 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003539 optional int32 bind_application_delay_millis = 11;
3540 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003541
3542 // Empty if not set.
3543 optional string launch_token = 13;
3544
Calin Juravle759fbda2018-02-20 19:52:30 +00003545 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003546 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003547
3548 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003549 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003550}
3551
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003552message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003553 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003554 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003555
3556 // The app package name.
3557 optional string pkg_name = 2;
3558
3559 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003560 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003561 WARM = 1;
3562 HOT = 2;
3563 COLD = 3;
3564 }
3565 // The transition type.
3566 optional TransitionType type = 3;
3567
3568 // The activity name.
3569 optional string activity_name = 4;
3570}
3571
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003572message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003573 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003574 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003575
3576 // The app package name.
3577 optional string pkg_name = 2;
3578
3579 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003580 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003581 WITH_BUNDLE = 1;
3582 WITHOUT_BUNDLE = 2;
3583 }
3584 // The transition type.
3585 optional TransitionType type = 3;
3586
3587 // The activity name.
3588 optional string activity_name = 4;
3589
3590 optional bool transition_process_running = 5;
3591
3592 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003593 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003594}
3595
Bookatz8fcd09a2017-12-18 13:01:10 -08003596/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003597 * Logs a picture-in-picture action
3598 * Logged from:
3599 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3600 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3601 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3602 */
3603message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003604 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003605 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003606
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003607 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003608
Chenjie Yu52cacc62017-12-08 18:11:45 -08003609 enum State {
3610 ENTERED = 1;
3611 EXPANDED_TO_FULL_SCREEN = 2;
3612 MINIMIZED = 3;
3613 DISMISSED = 4;
3614 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003615 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003616}
3617
3618/**
Chenjie Yue8904192017-12-08 19:12:57 -08003619 * Logs overlay action
3620 * Logged from:
3621 * services/core/java/com/android/server/wm/Session.java
3622 */
3623message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003624 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003625
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003626 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003627
3628 optional bool using_alert_window = 3;
3629
3630 enum State {
3631 ENTERED = 1;
3632 EXITED = 2;
3633 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003634 optional State state = 4
3635 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003636}
3637
Adam Bookatz38767932020-02-05 12:13:40 -08003638/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003639 * Logs foreground service starts and stops.
3640 * Note that this is not when a service starts or stops, but when it is
3641 * considered foreground.
3642 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003643 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003644 */
3645message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003646 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003647 // package_name + "/" + class_name
3648 optional string short_name = 2;
3649
3650 enum State {
3651 ENTER = 1;
3652 EXIT = 2;
3653 }
3654 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003655
3656 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3657 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3658 optional bool allow_while_in_use_permission = 4;
3659}
3660
3661/**
3662 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3663 * A foreground service session is any continuous period during which the uid holds at least one
3664 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3665 * Accesses initiated while the uid is in the TOP state are ignored.
3666 * Sessions with no attempted accesses are not logged.
3667 * Logged from
3668 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3669 */
3670message ForegroundServiceAppOpSessionEnded {
3671 optional int32 uid = 1 [(is_uid) = true];
3672
3673 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003674 // Only following four ops are logged
3675 // COARSE_LOCATION = 0
3676 // FINE_LOCATION = 1
3677 // CAMERA = 26
3678 // RECORD_AUDIO = 27
3679 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003680
3681 // The uid's permission mode for accessing the AppOp during this fgs session.
3682 enum Mode {
3683 MODE_UNKNOWN = 0;
3684 MODE_ALLOWED = 1; // Always allowed
3685 MODE_IGNORED = 2; // Denied
3686 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3687 }
3688 optional Mode app_op_mode = 3;
3689
3690 // Number of times this AppOp was requested and allowed.
3691 optional int32 count_ops_accepted = 4;
3692 // Number of times this AppOp was requested but denied.
3693 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003694}
3695
Chenjie Yue8904192017-12-08 19:12:57 -08003696/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003697 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3698 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3699 * attributed back to the parent (host) uid. One example is Chrome.
3700 *
3701 * Logged from:
3702 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3703 */
3704message IsolatedUidChanged {
3705 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003706 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003707 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003708 optional int32 parent_uid = 1;
3709
3710 optional int32 isolated_uid = 2;
3711
3712 // We expect an isolated uid to be removed before if it's used for another parent uid.
3713 enum Event {
3714 REMOVED = 0;
3715 CREATED = 1;
3716 }
3717 optional Event event = 3;
3718}
3719
3720/*
3721 * Logs the reception of an incoming network packet causing the main system to wake up for
3722 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3723 * and processed by WakeupController.cpp.
3724 */
3725message PacketWakeupOccurred {
3726 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3727 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003728 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003729 // The interface name on which the packet was received.
3730 optional string iface = 2;
3731 // The ethertype value of the packet.
3732 optional int32 ethertype = 3;
3733 // String representation of the destination MAC address of the packet.
3734 optional string destination_hardware_address = 4;
3735 // String representation of the source address of the packet if this was an IP packet.
3736 optional string source_ip = 5;
3737 // String representation of the destination address of the packet if this was an IP packet.
3738 optional string destination_ip = 6;
3739 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3740 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3741 // families.
3742 optional int32 ip_next_header = 7;
3743 // The source port if this was a TCP or UDP packet.
3744 optional int32 source_port = 8;
3745 // The destination port if this was a TCP or UDP packet.
3746 optional int32 destination_port = 9;
3747}
3748
3749/*
3750 * Logs the memory stats for an app on startup.
3751 * Logged from:
3752 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3753 */
3754message AppStartMemoryStateCaptured {
3755 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003756 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003757
3758 // The process name.
3759 optional string process_name = 2;
3760
3761 // The activity name.
3762 optional string activity_name = 3;
3763
3764 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003765 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003766
3767 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003768 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003769
3770 // RSS
3771 optional int64 rss_in_bytes = 6;
3772
3773 // CACHE
3774 optional int64 cache_in_bytes = 7;
3775
3776 // SWAP
3777 optional int64 swap_in_bytes = 8;
3778}
3779
3780/*
3781 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3782 * for LMK event.
3783 * Logged from:
3784 * system/core/lmkd/lmkd.c
3785 */
3786message LmkStateChanged {
3787 enum State {
3788 UNKNOWN = 0;
3789 START = 1;
3790 STOP = 2;
3791 }
3792 optional State state = 1;
3793}
3794
3795/*
3796 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3797 * Logged from:
3798 * system/core/lmkd/lmkd.c
3799 */
3800message LmkKillOccurred {
3801 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003802 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003803
3804 // The process name.
3805 optional string process_name = 2;
3806
3807 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003808 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003809
3810 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003811 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003812
3813 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003814 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003815
3816 // RSS
3817 optional int64 rss_in_bytes = 6;
3818
3819 // CACHE
3820 optional int64 cache_in_bytes = 7;
3821
3822 // SWAP
3823 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003824
3825 // The elapsed real time of start of the process.
3826 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003827
3828 // Min oom adj score considered by lmkd.
3829 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003830}
3831
Rajeev Kumar51b54602018-03-01 12:18:26 -08003832/*
3833 * Logs when the ActivityManagerService detects that an app died.
3834 *
3835 * Logged from:
3836 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3837 */
3838message AppDied {
3839 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003840 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003841}
3842
Howard Ro21a039c2018-08-06 14:55:47 -07003843/**
3844 * An atom for generic metrics logging. Available from Android Q.
3845 */
3846message GenericAtom {
3847 // The uid of the application that sent this custom atom.
3848 optional int32 uid = 1 [(is_uid) = true];
3849
3850 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003851 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003852}
3853
Tej Singhd6d6d772018-09-05 17:41:25 -07003854/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003855 * Atom for simple logging of user interaction and impression events, such as "the user touched
3856 * this button" or "this dialog was displayed".
3857 * Keep the UI event stream clean: don't use for system or background events.
3858 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003859 *
3860 * Logged from:
3861 * frameworks/base/services/core/java/com/android/server/
3862 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003863 */
3864message UiEventReported {
3865 // The event_id.
3866 optional int32 event_id = 1;
3867 // The event's source or target uid and package, if applicable.
3868 // For example, the package posting a notification, or the destination package of a share.
3869 optional int32 uid = 2 [(is_uid) = true];
3870 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003871 // An identifier used to disambiguate which logs refer to a particular instance of some
3872 // UI element. Useful when there might be multiple instances simultaneously active.
3873 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003874}
3875
3876/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003877 * Reports a notification was created or updated.
3878 *
3879 * Logged from:
3880 * frameworks/base/services/core/java/com/android/server/notification/
3881 */
3882message NotificationReported {
3883 // The event_id (as for UiEventReported).
3884 optional int32 event_id = 1;
3885 // The notifying app's uid and package.
3886 optional int32 uid = 2 [(is_uid) = true];
3887 optional string package_name = 3;
3888 // A small system-assigned identifier for the notification.
3889 // Locally probably-unique, but expect collisions across users and/or days.
3890 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003891 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3892 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003893
3894 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003895 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3896 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3897 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003898
3899 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003900 optional string category = 10; // App-assigned notification category (API-defined strings)
3901 optional int32 style = 11; // App-assigned notification style
3902 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003903
3904 // Ordering, importance and interruptiveness
3905
Will Brockman7614f6962020-02-10 19:43:03 -05003906 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003907
Will Brockman7614f6962020-02-10 19:43:03 -05003908 optional android.stats.sysui.NotificationImportance importance = 14;
3909 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003910
3911 enum NotificationImportanceExplanation {
3912 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3913 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3914 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3915 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3916 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3917 // Like _APP, but based on pre-channels priority signal.
3918 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3919 }
3920
Will Brockman7614f6962020-02-10 19:43:03 -05003921 optional NotificationImportanceExplanation importance_source = 16;
3922 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3923 optional NotificationImportanceExplanation importance_initial_source = 18;
3924 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3925 optional int32 assistant_hash = 20;
3926 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003927}
3928
3929message Notification {
3930 // The notifying app's uid and package.
3931 optional int32 uid = 1 [(is_uid) = true];
3932 optional string package_name = 2;
3933 // A small system-assigned identifier for the notification.
3934 optional int32 instance_id = 3;
3935
3936 // Grouping information.
3937 optional int32 group_instance_id = 4;
3938 optional bool is_group_summary = 5;
3939
3940 // The section of the shade that the notification is in.
3941 // See NotificationSectionsManager.PriorityBucket.
3942 enum NotificationSection {
3943 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003944 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003945 SECTION_MEDIA_CONTROLS = 2;
3946 SECTION_PEOPLE = 3;
3947 SECTION_ALERTING = 4;
3948 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003949 }
3950 optional NotificationSection section = 6;
3951}
3952
3953message NotificationList {
3954 repeated Notification notifications = 1; // An ordered sequence of notifications.
3955}
3956
3957/**
3958 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3959 *
3960 * Logged from:
3961 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3962 */
3963message NotificationPanelReported {
3964 // The event_id (as for UiEventReported).
3965 optional int32 event_id = 1;
3966 optional int32 num_notifications = 2;
3967 // The notifications in the panel, in the order that they appear there.
3968 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3969}
3970
3971/**
3972 * Reports a notification channel, or channel group, was created, updated, or deleted.
3973 *
3974 * Logged from:
3975 * frameworks/base/services/core/java/com/android/server/notification/
3976 */
3977message NotificationChannelModified {
3978 // The event_id (as for UiEventReported).
3979 optional int32 event_id = 1;
3980 // The notifying app's uid and package.
3981 optional int32 uid = 2 [(is_uid) = true];
3982 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003983 // Hash of app-assigned notification channel ID or channel-group ID
3984 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003985 // Previous importance setting, if applicable
3986 optional android.stats.sysui.NotificationImportance old_importance = 5;
3987 // New importance setting
3988 optional android.stats.sysui.NotificationImportance importance = 6;
3989}
3990
3991
3992/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003993 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003994 *
3995 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003996 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003997 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003998message BiometricAcquired {
3999 // Biometric modality that was acquired.
4000 optional android.hardware.biometrics.ModalityEnum modality = 1;
4001 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4002 optional int32 user = 2;
4003 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4004 optional bool is_crypto = 3;
4005 // Action that the device is performing. Acquired messages are only expected for enroll and
4006 // authenticate. Other actions may indicate an error.
4007 optional android.hardware.biometrics.ActionEnum action = 4;
4008 // The client that this acquisition was received for.
4009 optional android.hardware.biometrics.ClientEnum client = 5;
4010 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4011 optional int32 acquire_info = 6;
4012 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4013 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004014 // Dictates if this message should trigger additional debugging.
4015 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004016}
4017
4018/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004019 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004020 *
4021 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004022 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004023 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004024message BiometricAuthenticated {
4025 // Biometric modality that was used.
4026 optional android.hardware.biometrics.ModalityEnum modality = 1;
4027 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4028 optional int32 user = 2;
4029 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4030 // storage.
4031 optional bool is_crypto = 3;
4032 // The client that this acquisition was received for.
4033 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004034 // If authentication requires user confirmation. See BiometricPrompt's
4035 // setRequireConfirmation(bool) method.
4036 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004037
Kevin Chyn1741a072019-01-17 11:54:40 -08004038 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004039 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004040 REJECTED = 1;
4041 PENDING_CONFIRMATION = 2;
4042 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004043 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004044
4045 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004046 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004047 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4048 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4049 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4050 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004051 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004052 // Dictates if this message should trigger additional debugging.
4053 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004054}
4055
4056/**
4057 * Logs when a biometric error occurs.
4058 *
4059 * Logged from:
4060 * frameworks/base/services/core/java/com/android/server/biometrics
4061 */
4062message BiometricErrorOccurred {
4063 // Biometric modality that was used.
4064 optional android.hardware.biometrics.ModalityEnum modality = 1;
4065 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4066 optional int32 user = 2;
4067 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4068 optional bool is_crypto = 3;
4069 // Action that the device is performing.
4070 optional android.hardware.biometrics.ActionEnum action = 4;
4071 // The client that this acquisition was received for.
4072 optional android.hardware.biometrics.ClientEnum client = 5;
4073 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4074 // are unique to modality.
4075 optional int32 error_info = 6;
4076 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4077 // by the vendor and not specified by the HIDL interface.
4078 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004079 // Dictates if this message should trigger additional debugging.
4080 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004081 // Time spent during the authentication attempt.
4082 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004083}
4084
4085/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004086 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004087 * Logged from:
4088 * frameworks/base/services/core/java/com/android/server/biometrics
4089 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004090message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004091 // Biometric modality.
4092 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004093 // Type of issue detected.
4094 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004095 // Dictates if this message should trigger additional debugging.
4096 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004097}
Howard Ro688ae182018-09-25 00:09:36 -07004098
joshmccloskey6f952b22019-03-25 20:59:35 -07004099/**
4100 * Logs when a biometric enrollment occurs.
4101 *
4102 * Logged from:
4103 * frameworks/base/services/core/java/com/android/server/biometrics
4104 */
4105message BiometricEnrolled {
4106 // Biometric modality that was used.
4107 optional android.hardware.biometrics.ModalityEnum modality = 1;
4108 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4109 optional int32 user = 2;
4110 // The amount of time the enrollment took in milliseconds.
4111 optional int64 latency_millis = 3;
4112 // Whether or not the enrollment was successful.
4113 optional bool success = 4;
4114}
4115
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004116/*
Tej Singh0d176952019-01-16 19:10:54 -08004117 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004118 */
Tej Singh0d176952019-01-16 19:10:54 -08004119message FlagFlipUpdateOccurred {
4120 // If the event is from a flag config package, specify the package name.
4121 optional string flag_flip_package_name = 1;
4122
4123 // The order id of the package
4124 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004125}
4126
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004127/**
4128 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004129 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004130 */
4131message TrainExperimentIds {
4132 repeated int64 experiment_id = 1;
4133}
4134
Yangster-macb89807e2018-11-15 21:10:57 -08004135/*
4136 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004137 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004138 */
4139message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004140 // Name of the train.
4141 optional string train_name = 1;
4142 // Version code for a "train" of packages that need to be installed atomically
4143 optional int64 train_version_code = 2;
4144 // After installation of this package, device requires a restart.
4145 optional bool requires_staging = 3;
4146 // Rollback should be enabled for this install.
4147 optional bool rollback_enabled = 4;
4148 // Requires low latency monitoring if possible.
4149 optional bool requires_low_latency_monitor = 5;
4150
Yangster-macb89807e2018-11-15 21:10:57 -08004151 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004152 UNKNOWN = 0;
4153 INSTALL_REQUESTED = 1;
4154 INSTALL_STARTED = 2;
4155 INSTALL_STAGED_NOT_READY = 3;
4156 INSTALL_STAGED_READY = 4;
4157 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004158 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4159 // and INSTALL_FAILURE_COMMIT.
4160 INSTALL_FAILURE = 6 [deprecated = true];
4161 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004162 INSTALL_CANCELLED = 7;
4163 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004164 INSTALLER_ROLLBACK_INITIATED = 9;
4165 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4166 INSTALLER_ROLLBACK_STAGED = 11;
4167 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4168 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4169 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4170 INSTALLER_ROLLBACK_SUCCESS = 15;
4171 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004172 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4173 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4174 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4175 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4176 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4177 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004178 INSTALL_FAILURE_DOWNLOAD = 23;
4179 INSTALL_FAILURE_STATE_MISMATCH = 24;
4180 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004181 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004182 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004183 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004184 // Possible experiment ids for monitoring this push.
4185 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4186 // user id
4187 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004188 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004189 // Whether or not this is a rollback event
4190 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004191}
4192
Tej Singhc9203082019-05-03 13:42:23 -07004193/* Test atom, is not logged anywhere */
4194message TestAtomReported {
4195 repeated AttributionNode attribution_node = 1;
4196 optional int32 int_field = 2;
4197 optional int64 long_field = 3;
4198 optional float float_field = 4;
4199 optional string string_field = 5;
4200 optional bool boolean_field = 6;
4201 enum State {
4202 UNKNOWN = 0;
4203 OFF = 1;
4204 ON = 2;
4205 }
4206 optional State state = 7;
4207 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4208}
4209
Maggie Whitefc1aa592018-11-28 21:55:23 -08004210/** Represents USB port overheat event. */
4211message UsbPortOverheatEvent {
4212 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4213 optional int32 plug_temperature_deci_c = 1;
4214
4215 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4216 optional int32 max_temperature_deci_c = 2;
4217
4218 /* Time between USB plug event and overheat threshold trip, in seconds. */
4219 optional int32 time_to_overheat_secs = 3;
4220
4221 /* Time between overheat threshold trip and hysteresis, in seconds. */
4222 optional int32 time_to_hysteresis_secs = 4;
4223
4224 /* Time between hysteresis and active mitigation ending, in seconds. */
4225 optional int32 time_to_inactive_secs = 5;
4226};
4227
Maggie White8735b852019-01-18 11:40:49 -08004228/**
4229 * Logs total effective full charge and discharge cycles on a battery.
4230 * Here are some examples of one effective cycle:
4231 * 1) the battery charges from 0% to 100% and drains back to 0%,
4232 * 2) charging from 50% to 100% and draining back to 50% twice.
4233 * Pulled from:
4234 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4235 */
4236message BatteryCycleCount {
4237 /* Number of total charge and discharge cycles on the system battery. */
4238 optional int32 cycle_count = 1;
4239}
4240
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004241/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004242 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4243 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004244 * Pulled from:
4245 * StatsCompanionService
4246 */
4247
Carmen Agimof12dec122019-03-06 16:14:38 +00004248message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004249
Carmen Agimof12dec122019-03-06 16:14:38 +00004250 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004251 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004252 PUBLIC = 1;
4253 PRIVATE = 2;
4254 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004255 }
4256
Carmen Agimof12dec122019-03-06 16:14:38 +00004257 // The type of external storage.
4258 optional android.stats.storage.ExternalStorageType storage_type = 1;
4259 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4260 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004261 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004262 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004263}
4264
Yangster-macb89807e2018-11-15 21:10:57 -08004265/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004266 * Logs when a connection becomes available and lost.
4267 * Logged in StatsCompanionService.java
4268 */
4269message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004270 // Id of the network.
4271 optional int32 net_id = 1;
4272
4273 enum State {
4274 UNKNOWN = 0;
4275 CONNECTED = 1;
4276 DISCONNECTED = 2;
4277 }
4278 // Connected state of a network.
4279 optional State state = 2;
4280}
4281
4282/**
4283 * Logs when a service starts and stops.
4284 * Logged from:
4285 * services/core/java/com/android/server/am/ActiveServices.java
4286 */
4287message ServiceStateChanged {
4288
4289 optional int32 uid = 1 [(is_uid) = true];
4290
4291 optional string package_name = 2;
4292
4293 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004294
4295 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004296 START = 1;
4297 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004298 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004299
4300 optional State state = 4;
4301}
4302
4303/**
4304 * Logs when a service is launched.
4305 * Logged from:
4306 * services/core/java/com/android/server/am/ActiveServices.java
4307 */
4308message ServiceLaunchReported {
4309
4310 optional int32 uid = 1 [(is_uid) = true];
4311
4312 optional string package_name = 2;
4313
4314 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004315}
Howard Ro688ae182018-09-25 00:09:36 -07004316
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004317/**
4318 * Logs when a hidden API is used.
4319 *
4320 * Logged from:
4321 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4322 */
4323message HiddenApiUsed {
4324 // The uid of the app making the hidden access.
4325 optional int32 uid = 1 [(is_uid) = true];
4326
4327 // Signature of the method or field accessed.
4328 optional string signature = 2;
4329
4330 enum AccessMethod {
4331 NONE = 0;
4332 REFLECTION = 1;
4333 JNI = 2;
4334 LINKING = 3;
4335 }
4336
4337 // Type of access.
4338 optional AccessMethod access_method = 3;
4339
4340 // Whether the access was prevented or not.
4341 optional bool access_denied = 4;
4342}
4343
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004344/**
4345 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4346 * - When user sees privacy chip
4347 * - When user clicks privacy chip
4348 * - How does the user exit the Privacy Dialog
4349 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004350 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4351 */
4352message PrivacyIndicatorsInteracted {
4353
4354 enum Type {
4355 UNKNOWN = 0;
4356 CHIP_VIEWED = 1;
4357 CHIP_CLICKED = 2;
4358 DIALOG_PRIVACY_SETTINGS = 3;
4359 DIALOG_DISMISS = 4;
4360 DIALOG_LINE_ITEM = 5;
4361 }
4362
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004363 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004364
4365 // Used if the type is LINE_ITEM
4366 optional string package_name = 2;
4367}
4368
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004369/**
4370 * Logs information about a package that is moved from the internal to external storage and vice
4371 * versa.
4372 * It logs the package name, the type of the external storage where the package is installed
4373 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4374 * and the move type: if it's from internal to external or the other way around.
4375 *
4376 * Logged from:
4377 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4378 */
4379message AppMovedStorageReported {
4380 enum MoveType {
4381 UNKNOWN = 0;
4382 TO_EXTERNAL = 1;
4383 TO_INTERNAL = 2;
4384 }
4385 // The type of the external storage.
4386 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4387 // The type of move.
4388 optional MoveType move_type = 2;
4389 // The name of the package that was moved.
4390 optional string package_name = 3;
4391}
4392
jianjin8f2dee02019-03-29 14:03:08 -07004393/**
4394 * Logs when system server watchdog occurs.
4395 * Logged from:
4396 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4397 */
4398message SystemServerWatchdogOccurred {
4399 optional string subject = 1;
4400}
4401
4402/**
4403 * Logs when new file added to tombstones.
4404 * Logged from:
4405 * frameworks/base/core/java/com/android/server/BootReceiver.java
4406 */
4407message TombStoneOccurred {
4408}
4409
Hai Zhang5d3328d2019-04-13 21:25:06 +08004410/*
4411 * Information about a role request
4412 *
4413 * Logged from:
4414 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4415 */
4416message RoleRequestResultReported {
4417 // UID of application requesting the role
4418 optional int32 requesting_uid = 1;
4419
4420 // Package name of application requesting the role
4421 optional string requesting_package_name = 2;
4422
4423 // The role to be granted
4424 optional string role_name = 3;
4425
4426 // The count of applications qualifying for the role
4427 optional int32 qualifying_count = 4;
4428
4429 // UID of application current granted the role
4430 optional int32 current_uid = 5;
4431
4432 // Package name of application current granted the role
4433 optional string current_package_name = 6;
4434
4435 // UID of another application that user chose to grant the role to, instead of the requesting
4436 // application
4437 optional int32 granted_another_uid = 7;
4438
4439 // Package name of another application that user chose to grant the role to, instead of the
4440 // requesting application
4441 optional string granted_another_package_name = 8;
4442
4443 enum Result {
4444 UNDEFINED = 0;
4445 // role request was ignored
4446 IGNORED = 1;
4447 // role request was ignored because it's already granted
4448 IGNORED_ALREADY_GRANTED = 2;
4449 // role request was ignored because the application isn't qualified
4450 IGNORED_NOT_QUALIFIED = 3;
4451 // role request was ignored because user said it should be always denied
4452 IGNORED_USER_ALWAYS_DENIED = 4;
4453 // role was granted by user action
4454 USER_GRANTED = 5;
4455 // role was denied by user action
4456 USER_DENIED = 6;
4457 // role was denied by user granting another application the role
4458 USER_DENIED_GRANTED_ANOTHER = 7;
4459 // role was denied and set to be always denied by the user
4460 USER_DENIED_WITH_ALWAYS = 8;
4461 }
4462 // The result of the role request
4463 optional Result result = 9;
4464}
4465
Mark Tabrya824a642019-11-05 12:26:12 -08004466/**
4467 * Logs when a Vehicle Maps Service client's connection state has changed
4468 *
4469 * Logged from:
4470 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4471 */
4472message VmsClientConnectionStateChanged {
4473 // The UID of the VMS client app
4474 optional int32 uid = 1 [(is_uid) = true];
4475
4476 enum State {
4477 UNKNOWN = 0;
4478 // Attempting to connect to the client
4479 CONNECTING = 1;
4480 // Client connection established
4481 CONNECTED = 2;
4482 // Client connection closed unexpectedly
4483 DISCONNECTED = 3;
4484 // Client connection closed by VMS
4485 TERMINATED = 4;
4486 // Error establishing the client connection
4487 CONNECTION_ERROR = 5;
4488 }
4489
4490 optional State state = 2;
4491}
4492
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004493/**
4494 * Logs when MediaProvider has successfully finished scanning a storage volume.
4495 *
4496 * Logged from:
4497 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4498 */
shafik43825842020-04-02 17:30:24 +01004499message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004500 enum Reason {
4501 // Scan triggered due to unknown reason
4502 UNKNOWN = 0;
4503 // Scan triggered due to storage volume being mounted
4504 MOUNTED = 1;
4505 // Scan triggered due to explicit user action or app request
4506 DEMAND = 2;
4507 // Scan triggered due to idle maintenance
4508 IDLE = 3;
4509 }
4510
4511 // Volume type that this event pertains to
4512 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4513 // Reason why this scan was triggered
4514 optional Reason reason = 2;
4515 // Total number of files scanned
4516 optional int64 item_count = 3;
4517 // Duration of scan, normalized per file
4518 optional float normalized_duration_millis = 4;
4519 // Number of database inserts, normalized per file
4520 optional float normalized_insert_count = 5;
4521 // Number of database updates, normalized per file
4522 optional float normalized_update_count = 6;
4523 // Number of database deletes, normalized per file
4524 optional float normalized_delete_count = 7;
4525}
4526
4527/**
4528 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4529 *
4530 * Logged from:
4531 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4532 */
shafik43825842020-04-02 17:30:24 +01004533message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004534 // Volume type that this event pertains to
4535 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004536 // UID of app that requested deletion
4537 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004538 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004539 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004540}
4541
4542/**
4543 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4544 *
4545 * Logged from:
4546 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4547 */
shafik43825842020-04-02 17:30:24 +01004548message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004549 enum Result {
4550 UNKNOWN = 0;
4551 USER_GRANTED = 1;
4552 AUTO_GRANTED = 2;
4553 USER_DENIED = 3;
4554 USER_DENIED_WITH_PREJUDICE = 4;
4555 AUTO_DENIED = 5;
4556 }
4557
4558 // Volume type that this event pertains to
4559 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004560 // UID of app that requested permission
4561 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004562 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004563 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004564 // Result of this request
shafik43825842020-04-02 17:30:24 +01004565 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004566}
4567
4568/**
4569 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4570 *
4571 * Logged from:
4572 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4573 */
shafik43825842020-04-02 17:30:24 +01004574message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004575 // Volume type that this event pertains to
4576 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4577 // Old database version code
4578 optional int32 version_from = 2;
4579 // New database version code
4580 optional int32 version_to = 3;
4581 // Total number of files in database
4582 optional int64 item_count = 4;
4583 // Duration of schema change, normalized per file
4584 optional float normalized_duration_millis = 5;
4585}
4586
4587/**
4588 * Logs when MediaProvider has finished an idle maintenance job.
4589 *
4590 * Logged from:
4591 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4592 */
shafik43825842020-04-02 17:30:24 +01004593message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004594 // Volume type that this event pertains to
4595 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4596
4597 // Total number of files in database
4598 optional int64 item_count = 2;
4599 // Duration of idle maintenance, normalized per file
4600 optional float normalized_duration_millis = 3;
4601 // Number of thumbnails found to be stale, normalized per file
4602 optional float normalized_stale_thumbnails = 4;
4603 // Number of items found to be expired, normalized per file
4604 optional float normalized_expired_media = 5;
4605}
4606
Keun young Park3e033cb2019-12-18 11:27:35 -08004607/**
4608 * Represents boot time event with duration in ms.
4609 *
4610 * Logged from: bootstat and various system server components. Check each enums for details.
4611 */
4612message BootTimeEventDuration {
4613 enum DurationEvent {
4614 UNKNOWN = 0;
4615 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4616 ABSOLUTE_BOOT_TIME = 1;
4617 // Bootloader's 1st stage execution time.
4618 // Logged from bootstat.
4619 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4620 // Bootloader's 1st stage loading time.
4621 // Logged from bootstat.
4622 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4623 // Bootloader's kernel loading time.
4624 // Logged from bootstat.
4625 BOOTLOADER_KERNEL_LOAD = 4;
4626 // Bootloader's 2nd stage execution time.
4627 // Logged from bootstat.
4628 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4629 // Bootloader's 2nd stage loading time.
4630 // Logged from bootstat.
4631 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4632 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4633 // for locked device.
4634 // Logged from bootstat.
4635 BOOTLOADER_UI_WAIT = 7;
4636 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4637 // Logged from bootstat.
4638 BOOTLOADER_TOTAL = 8;
4639 // Shutdown duration inside init for the reboot before the current boot up.
4640 // Logged from f/b/services/.../BootReceiver.java.
4641 SHUTDOWN_DURATION = 9;
4642 // Total time for mounting of disk devices during bootup.
4643 // Logged from f/b/services/.../BootReceiver.java.
4644 MOUNT_DEFAULT_DURATION = 10;
4645 // Total time for early stage mounting of disk devices during bootup.
4646 // Logged from f/b/services/.../BootReceiver.java.
4647 MOUNT_EARLY_DURATION = 11;
4648 // Total time for late stage mounting of disk devices during bootup.
4649 // Logged from f/b/services/.../BootReceiver.java.
4650 MOUNT_LATE_DURATION = 12;
4651 // Average time to scan non-system app after OTA
4652 // Logged from f/b/services/.../PackageManagerService.java
4653 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4654 // Time to initialize Package manager after OTA
4655 // Logged from f/b/services/.../PackageManagerService.java
4656 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4657 // Time to scan all system app from Package manager after OTA
4658 // Logged from f/b/services/.../PackageManagerService.java
4659 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4660 // Init's total time for cold boot stage.
4661 // Logged from bootstat.
4662 COLDBOOT_WAIT = 16;
4663 // Init's total time for initializing selinux.
4664 // Logged from bootstat.
4665 SELINUX_INIT = 17;
4666 // Time since last factory reset.
4667 // Logged from bootstat.
4668 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004669 // Init's total time spent for completing the 1st stage.
4670 // Logged from bootstat.
4671 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004672 }
4673
4674 // Type of the event.
4675 optional DurationEvent event = 1;
4676 // Duration of the event in ms.
4677 optional int64 duration_millis = 2;
4678}
4679
4680/**
4681 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4682 * since boot-up.
4683 *
4684 * Logged from: bootstat and various system server components. Check each enums for details.
4685 */
4686message BootTimeEventElapsedTime {
4687 enum ElapsedTimeEvent {
4688 UNKNOWN = 0;
4689 // Time when init starts 1st stage. Logged from bootstat.
4690 ANDROID_INIT_STAGE_1 = 1;
4691 // Time when sys.boot_completed prop is set.
4692 // Logged from bootstat.
4693 BOOT_COMPLETE = 2;
4694 // BOOT_COMPLETE for encrypted device.
4695 BOOT_COMPLETE_ENCRYPTION = 3;
4696 // BOOT_COMPLETE for device with no encryption.
4697 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4698 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004699 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004700 // BOOT_COMPLETE after factory reset.
4701 FACTORY_RESET_BOOT_COMPLETE = 6;
4702 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4703 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004704 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4705 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004706 // BOOT_COMPLETE after OTA.
4707 OTA_BOOT_COMPLETE = 9;
4708 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4709 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004710 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4711 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004712 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4713 // Logged from f/b/services/.../UserController.java
4714 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4715 // Time when the system starts sending BOOT_COMPLETED broadcast.
4716 // Logged from f/b/services/.../UserController.java
4717 FRAMEWORK_BOOT_COMPLETED = 13;
4718 // Time when the package manager starts init.
4719 // Logged from f/b/services/.../SystemServer.java
4720 PACKAGE_MANAGER_INIT_START = 14;
4721 // Time when package manager is ready
4722 // Logged from f/b/services/.../SystemServer.java
4723 PACKAGE_MANAGER_INIT_READY = 15;
4724 // Represents the time when user has entered unlock credential for system with user pin.
4725 // Logged from bootstat.
4726 POST_DECRYPT = 16;
4727 // Represents the start of zygote's init.
4728 // Logged from zygote itself.
4729 ZYGOTE_INIT_START = 17;
4730 // Represents the start of secondary zygote's init.
4731 // TODO: add logging to zygote
4732 SECONDARY_ZYGOTE_INIT_START = 18;
4733 // Represents the start of system server's init.
4734 // Logged from f/b/services/.../SystemServer.java
4735 SYSTEM_SERVER_INIT_START = 19;
4736 // Represents the completion of system server's init.
4737 // Logged from f/b/services/.../SystemServer.java
4738 SYSTEM_SERVER_READY = 20;
4739 // Represents the start of launcher during boot-up.
4740 // TODO: add logging
4741 LAUNCHER_START = 21;
4742 // Represents the completion of launcher's initial rendering. User can use other apps from
4743 // launcher from this point.
4744 // TODO: add logging
4745 LAUNCHER_SHOWN = 22;
4746 }
4747
4748 // Type of the event.
4749 optional ElapsedTimeEvent event = 1;
4750 // Time since bootup for the event.
4751 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4752 optional int64 time_millis = 2;
4753}
4754
4755/**
4756 * Boot time events with UTC time.
4757 *
4758 * Logged from: bootstat and various system server components. Check each enums for details.
4759 */
4760message BootTimeEventUtcTime {
4761 enum UtcTimeEvent {
4762 UNKNOWN = 0;
4763 // Time of the bootstat's marking of 1st boot after the last factory reset.
4764 // Logged from bootstat.
4765 FACTORY_RESET_RESET_TIME = 1;
4766 // The time when bootstat records FACTORY_RESET_* events. This is close to
4767 // BOOT_COMPLETE time for the current bootup.
4768 // Logged from bootstat.
4769 FACTORY_RESET_CURRENT_TIME = 2;
4770 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4771 // Logged from bootstat.
4772 FACTORY_RESET_RECORD_VALUE = 3;
4773 }
4774
4775 // Type of the event.
4776 optional UtcTimeEvent event = 1;
4777 // UTC time for the event.
4778 optional int64 utc_time_secs = 2;
4779}
4780
4781/**
4782 * Boot time events representing specific error code during bootup.
4783 * Meaning of error code can be different per each event type.
4784 *
4785 * Logged from: bootstat and various system server components. Check each enums for details.
4786 */
4787message BootTimeEventErrorCode {
4788 enum ErrorCodeEvent {
4789 UNKNOWN = 0;
4790 // Linux error code for time() call to get the current UTC time.
4791 // Logged from bootstat.
4792 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4793 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4794 // as UMOUNT_STAT_* from init/reboot.cpp.
4795 // Logged from f/b/services/.../BootReceiver.java.
4796 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004797 // Reprepsents fie system mounting error code of /data partition for the current boot.
4798 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004799 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004800 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004801 }
4802
4803 // Type of the event.
4804 optional ErrorCodeEvent event = 1;
4805 // error code defined per each event type.
4806 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4807 // FS_MGR_FS_STAT.
4808 optional int32 error_code = 2;
4809}
4810
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004811/**
4812 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4813 * after an OTA.
4814 *
4815 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004816 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004817 */
4818message SnapshotMergeReported {
4819 // Keep in sync with
4820 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4821 enum UpdateState {
4822 // No update or merge is in progress.
4823 NONE = 0;
4824 // An update is applying; snapshots may already exist.
4825 INITIATED = 1;
4826 // An update is pending, but has not been successfully booted yet.
4827 UNVERIFIED = 2;
4828 // The kernel is merging in the background.
4829 MERGING = 3;
4830 // Post-merge cleanup steps could not be completed due to a transient
4831 // error, but the next reboot will finish any pending operations.
4832 MERGE_NEEDS_REBOOT = 4;
4833 // Merging is complete, and needs to be acknowledged.
4834 MERGE_COMPLETED = 5;
4835 // Merging failed due to an unrecoverable error.
4836 MERGE_FAILED = 6;
4837 // The update was implicitly cancelled, either by a rollback or a flash
4838 // operation via fastboot. This state can only be returned by WaitForMerge.
4839 CANCELLED = 7;
4840 };
4841
4842 // Status of the update after the merge attempts.
4843 optional UpdateState final_state = 1;
4844
4845 // Time to complete a merge operation in milliseconds.
4846 // A negative value corresponds to the case in which the merge operation
4847 // was interrupted and resumed (e.g. in case of a system reboot during the
4848 // merge).
4849 optional int64 duration_millis = 2;
4850
4851 // Number of reboots that occurred after issuing and before completing the
4852 // merge of all the snapshot devices.
4853 optional int32 intermediate_reboots = 3;
4854}
4855
Chenjie Yubbcbc602018-02-05 16:51:52 -08004856//////////////////////////////////////////////////////////////////////
4857// Pulled atoms below this line //
4858//////////////////////////////////////////////////////////////////////
4859
4860/**
David Chenc8a43242017-10-17 16:23:28 -07004861 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4862 *
4863 * Pulled from:
4864 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4865 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004866message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004867 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004868
4869 optional int64 rx_bytes = 2;
4870
4871 optional int64 rx_packets = 3;
4872
4873 optional int64 tx_bytes = 4;
4874
4875 optional int64 tx_packets = 5;
4876}
4877
4878/**
4879 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4880 *
4881 * Pulled from:
4882 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4883 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004884message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004885 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004886
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004887 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4888 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004889
4890 optional int64 rx_bytes = 3;
4891
4892 optional int64 rx_packets = 4;
4893
4894 optional int64 tx_bytes = 5;
4895
4896 optional int64 tx_packets = 6;
4897}
4898
4899/**
4900 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4901 *
4902 * Pulled from:
4903 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4904 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004905message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004906 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004907
4908 optional int64 rx_bytes = 2;
4909
4910 optional int64 rx_packets = 3;
4911
4912 optional int64 tx_bytes = 4;
4913
4914 optional int64 tx_packets = 5;
4915}
4916
4917/**
4918 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4919 *
4920 * Pulled from:
4921 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4922 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004923message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004924 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004925
Yao Chenc40a19d2018-03-15 16:48:25 -07004926 // 1 denotes foreground and 0 denotes background. This is called Set in
4927 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004928 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004929
4930 optional int64 rx_bytes = 3;
4931
4932 optional int64 rx_packets = 4;
4933
4934 optional int64 tx_bytes = 5;
4935
4936 optional int64 tx_packets = 6;
4937}
4938
4939/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004940 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4941 *
4942 * Pulled from:
4943 * StatsCompanionService
4944 */
4945message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004946 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004947
4948 optional int64 rx_bytes = 2;
4949
4950 optional int64 tx_bytes = 3;
4951}
4952
4953/**
David Chenc8a43242017-10-17 16:23:28 -07004954 * Pulls the kernel wakelock durations. This atom is adapted from
4955 * android/internal/os/KernelWakelockStats.java
4956 *
4957 * Pulled from:
4958 * StatsCompanionService using KernelWakelockReader.
4959 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004960message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004961 optional string name = 1;
4962
4963 optional int32 count = 2;
4964
4965 optional int32 version = 3;
4966
Yangster-maca8a30442018-10-13 23:46:34 -07004967 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004968}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004969
Chenjie Yu05013b32017-11-21 10:21:41 -08004970/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004971 * Pulls low power state information. If power.stats HAL is not available, this
4972 * includes platform and subsystem sleep state information,
4973 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4974 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004975 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004976 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004977 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4978 * as defined in:
4979 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004980 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004981message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004982 // Subsystem name
4983 optional string subsystem_name = 1;
4984 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4985 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004986 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4987 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004988 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004989 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004990 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004991 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004992 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004993}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004994
Chenjie Yu05013b32017-11-21 10:21:41 -08004995/**
Bookatz92da2832018-11-01 18:10:03 -07004996 * Pulls on-device power measurement information.
4997 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4998 * Pulled from:
4999 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5000 */
5001message OnDevicePowerMeasurement {
5002 // Name of the subsystem (to which the rail belongs).
5003 optional string subsystem_name = 1;
5004
5005 // Rail name. The rail lies within the subsystem.
5006 optional string rail_name = 2;
5007
5008 // Time (in ms since boot) at which the rail energy value was measured.
5009 // This may differ slightly from the time that statsd logs this information.
5010 optional uint64 measurement_timestamp_millis = 3;
5011
5012 // Accumulated energy used via the rail since device boot in uWs.
5013 optional uint64 energy_microwatt_secs = 4;
5014}
5015
5016/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005017 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005018 * Pulls the time the cpu spend on the frequency index. Frequency index
5019 * starts from highest to lowest. The value should be monotonically
5020 * increasing since boot. However, if there is a cpu
5021 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005022 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005023message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005024 optional uint32 cluster = 1;
5025 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005026 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005027}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005028
Chenjie Yu05013b32017-11-21 10:21:41 -08005029/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005030 * Pulls Cpu Time Per Uid.
5031 * Note that isolated process uid time should be attributed to host uids.
5032 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005033message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005034 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005035 optional uint64 user_time_micros = 2;
5036 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005037}
5038
5039/**
5040 * Pulls Cpu Time Per Uid per frequency.
5041 * Note that isolated process uid time should be attributed to host uids.
5042 * For each uid, we order the time by descending frequencies.
5043 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005044message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005045 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005046 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005047 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005048}
Hugo Benichi884970e2017-11-14 22:42:46 +09005049
Chenjie Yu05013b32017-11-21 10:21:41 -08005050/**
5051 * Pulls Wifi Controller Activity Energy Info
5052 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005053message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005054 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005055 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005056 // stack reported state
5057 // TODO: replace this with proto enum
5058 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005059 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005060 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005061 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005062 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005063 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005064 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005065 // product of current(mA), voltage(V) and time(ms)
5066 optional uint64 controller_energy_used = 6;
5067}
5068
5069/**
5070 * Pulls Modem Activity Energy Info
5071 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005072message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005073 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005074 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005075 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005076 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005077 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005078 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005079 /**
5080 * Tx power index
5081 * index 0 = tx_power < 0dBm
5082 * index 1 = 0dBm < tx_power < 5dBm
5083 * index 2 = 5dBm < tx_power < 15dBm
5084 * index 3 = 15dBm < tx_power < 20dBm
5085 * index 4 = tx_power > 20dBm
5086 */
5087 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005088 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005089 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005091 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005092 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005093 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005094 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005095 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005096 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005097 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005098 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005099 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005100 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005101}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005102
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005103/**
5104 * Pulls Bluetooth Activity Energy Info
5105 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5106 */
5107message BluetoothActivityInfo {
5108 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005109 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005110 // bluetooth stack state
5111 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005112 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005113 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005114 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005115 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005116 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005117 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005118 // product of current(mA), voltage(V) and time(ms)
5119 optional uint64 energy_used = 6;
5120}
5121
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005122/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005123 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005124 *
5125 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005126 */
5127message ProcessMemoryState {
5128 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005129 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005130
5131 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005132 // Usually package name, "system" for system server.
5133 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005134 optional string process_name = 2;
5135
Rafal Slawikda51b932018-12-13 16:31:33 +00005136 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005137 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005138
5139 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005140 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005141
5142 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005143 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005144
Rajeev Kumar90235992018-01-29 11:06:48 -08005145 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005146 // Value is read from memory.stat, field total_rss if per-app memory
5147 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005148 optional int64 rss_in_bytes = 6;
5149
5150 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005151 // Value is read from memory.stat, field total_cache if per-app memory
5152 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005153 optional int64 cache_in_bytes = 7;
5154
5155 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005156 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005157 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005158 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005159
Rafal Slawik203c3db2019-09-25 19:53:01 +01005160 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005161 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005162
Rafal Slawik203c3db2019-09-25 19:53:01 +01005163 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5164 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005165
Rafal Slawik203c3db2019-09-25 19:53:01 +01005166 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5167 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005168}
5169
5170/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005171 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005172 *
5173 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5174 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005175 *
5176 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005177 */
5178message ProcessMemoryHighWaterMark {
5179 // The uid if available. -1 means not available.
5180 optional int32 uid = 1 [(is_uid) = true];
5181
Rafal Slawikda51b932018-12-13 16:31:33 +00005182 // The process name.
5183 // Usually package name or process cmdline.
5184 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005185 optional string process_name = 2;
5186
Rafal Slawik239b6802019-09-09 18:46:01 +01005187 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5188 // computed by converting kilobytes to bytes.
5189 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5190
Rafal Slawik3bea8952018-11-15 12:39:33 +00005191 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5192 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005193 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005194}
5195
5196/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005197 * Logs the memory stats for a process.
5198 *
5199 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5200 * and for selected native processes.
5201 */
5202message ProcessMemorySnapshot {
5203 // The uid if available. -1 means not available.
5204 optional int32 uid = 1 [(is_uid) = true];
5205
5206 // The process name.
5207 // Usually package name or process cmdline.
5208 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5209 optional string process_name = 2;
5210
5211 // The pid of the process.
5212 // Allows to disambiguate instances of the process.
5213 optional int32 pid = 3;
5214
5215 // The current OOM score adjustment value.
5216 // Read from ProcessRecord for managed processes.
5217 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5218 optional int32 oom_score_adj = 4;
5219
5220 // The current RSS of the process.
5221 // VmRSS from /proc/pid/status.
5222 optional int32 rss_in_kilobytes = 5;
5223
5224 // The current anon RSS of the process.
5225 // RssAnon from /proc/pid/status.
5226 optional int32 anon_rss_in_kilobytes = 6;
5227
5228 // The current swap size of the process.
5229 // VmSwap from /proc/pid/status.
5230 optional int32 swap_in_kilobytes = 7;
5231
5232 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5233 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5234}
5235
5236/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005237 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005238 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005239message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005240 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005241}
5242
5243/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005244 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005245 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005246message SystemUptime {
5247 // Milliseconds since the system was booted.
5248 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5249 // for external input).
5250 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005251 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005252}
5253
5254/*
5255 * Reads from /proc/uid_concurrent_active_time which has the format:
5256 * active: X (X is # cores)
5257 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5258 * [uid1]: [time-0] [time-1] [time-2] ... ...
5259 * ...
5260 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5261 * The file contains a monotonically increasing count of time for a single boot.
5262 */
5263message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005264 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005265 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005266}
5267
5268/**
5269 * Reads from /proc/uid_concurrent_policy_time which has the format:
5270 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5271 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5272 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5273 * ...
5274 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5275 * The file contains a monotonically increasing count of time for a single boot.
5276 */
5277message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005278 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005279 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005280 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005281}
5282
5283/*
5284 * Pulls free disk space, for data, system partition and temporary directory.
5285 */
5286message DiskSpace {
5287 // available bytes in data partition
5288 optional uint64 data_available_bytes = 1;
5289 // available bytes in system partition
5290 optional uint64 system_available_bytes = 2;
5291 // available bytes in download cache or temp directories
5292 optional uint64 temp_available_bytes = 3;
5293}
Tej Singhbf972d92018-01-10 20:51:13 -08005294
5295/**
5296 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005297 *
5298 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005299 */
5300message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005301 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005302}
5303
5304/**
5305 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005306 * Pulled from:
5307 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005308 */
5309message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005310 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005311}
5312
5313/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005314 * Pulls battery voltage.
5315 * Pulled from:
5316 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5317 */
5318message BatteryVoltage {
5319 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005320 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005321}
5322
5323/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005324 * Pulls battery level (percent full, from 0 to 100).
5325 *
5326 * Pulled from:
5327 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5328 */
5329message BatteryLevel {
5330 // Battery level. Should be in [0, 100].
5331 optional int32 battery_level = 1;
5332}
5333
5334/**
Tej Singhd89137e2018-03-26 14:51:40 -07005335 * Pulls the temperature of various parts of the device.
5336 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005337 *
Maggie White442b6312019-04-05 16:26:44 -07005338 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005339 */
5340message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005341 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005342 optional android.os.TemperatureTypeEnum sensor_location = 1;
5343
5344 // The name of the temperature source. Eg. CPU0
5345 optional string sensor_name = 2;
5346
Tej Singhd89137e2018-03-26 14:51:40 -07005347 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005348 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005349 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005350
5351 // Relative severity of the throttling, see enum definition.
5352 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005353}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005354
5355/**
5356 * Pulls the statistics of calls to Binder.
5357 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005358 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5359 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005360 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005361 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005362 */
5363message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005364 // UID of the process responsible for the binder transaction. It will be set if the process
5365 // executing the binder transaction attribute the transaction to another uid using
5366 // Binder.setThreadWorkSource().
5367 //
5368 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005369 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005370 // UID of the process executing the binder transaction.
5371 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005372 // Fully qualified class name of the API call.
5373 //
5374 // This is a system server class name.
5375 //
5376 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5377 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5378 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5379 // commonly used APIs.
5380 optional string service_class_name = 2;
5381 // Method name of the API call. It can also be a transaction code if we cannot
5382 // resolve it to a name. See Binder#getTransactionName.
5383 //
5384 // This is a system server method name.
5385 optional string service_method_name = 3;
5386 // Total number of API calls.
5387 optional int64 call_count = 4;
5388 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5389 optional bool screen_interactive = 13;
5390 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5391 // call_count will be equal to recorded_call_count.
5392 //
5393 // If recorded_call_count is different than call_count, it means data collection has been
5394 // sampled. All the fields below will be sampled in this case.
5395 optional int64 recorded_call_count = 12;
5396 // Number of exceptions thrown by the API.
5397 optional int64 recorded_exception_count = 5;
5398 // Total latency of all API calls.
5399 // Average can be computed using total_latency_micros / recorded_call_count.
5400 optional int64 recorded_total_latency_micros = 6;
5401 // Maximum latency of one API call.
5402 optional int64 recorded_max_latency_micros = 7;
5403 // Total CPU usage of all API calls.
5404 // Average can be computed using total_cpu_micros / recorded_call_count.
5405 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5406 optional int64 recorded_total_cpu_micros = 8;
5407 // Maximum CPU usage of one API call.
5408 optional int64 recorded_max_cpu_micros = 9;
5409 // Maximum parcel reply size of one API call.
5410 optional int64 recorded_max_reply_size_bytes = 10;
5411 // Maximum parcel request size of one API call.
5412 optional int64 recorded_max_request_size_bytes = 11;
5413}
5414
5415/**
5416 * Pulls the statistics of exceptions during calls to Binder.
5417 *
5418 * Binder stats are cumulative from boot unless somebody reset the data using
5419 * > adb shell dumpsys binder_calls_stats --reset
5420 */
5421message BinderCallsExceptions {
5422 // Exception class name, e.g. java.lang.IllegalArgumentException.
5423 //
5424 // This is an exception class name thrown by the system server.
5425 optional string exception_class_name = 1;
5426 // Total number of exceptions.
5427 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005428}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005429
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005430/**
5431 * Pulls the statistics of message dispatching on HandlerThreads.
5432 *
5433 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5434 * config on the device.
5435 *
5436 * Next tag: 11
5437 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005438message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005439 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005440 optional int32 uid = 1 [(is_uid) = true];
5441
5442 // Fully qualified class name of the handler target class.
5443 //
5444 // This field does not contain PII. This is a system server class name.
5445 optional string handler_class_name = 2;
5446
5447 // The name of the thread that runs the Looper.
5448 //
5449 // This field does not contain PII. This is a system server thread name.
5450 optional string looper_thread_name = 3;
5451
5452 // The name of the dispatched message.
5453 //
5454 // This field does not contain PII. This is a system server constant or class
5455 // name.
5456 optional string message_name = 4;
5457
5458 // Total number of successfully dispatched messages.
5459 optional int64 message_count = 5;
5460
5461 // Total number of messages that failed dispatching.
5462 optional int64 exception_count = 6;
5463
5464 // Total number of processed messages we have data recorded for. If we
5465 // collected data for all the messages, message_count will be equal to
5466 // recorded_message_count.
5467 //
5468 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005469 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005470 optional int64 recorded_message_count = 7;
5471
5472 // Total latency of all processed messages.
5473 // Average can be computed using recorded_total_latency_micros /
5474 // recorded_message_count.
5475 optional int64 recorded_total_latency_micros = 8;
5476
5477 // Total CPU usage of all processed message.
5478 // Average can be computed using recorded_total_cpu_micros /
5479 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005480 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005481 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005482
5483 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5484 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005485
5486 // Max recorded CPU usage of all processed messages.
5487 optional int64 recorded_max_cpu_micros = 11;
5488
5489 // Max recorded latency of all processed messages.
5490 optional int64 recorded_max_latency_micros = 12;
5491
5492 // Total number of messages we tracked the dispatching delay for. If we
5493 // collected data for all the messages, message_count will be equal to
5494 // recorded_delay_message_count.
5495 //
5496 // If recorded_delay_message_count is different than message_count, it means data
5497 // collection has been sampled or/and not all messages specified the target dispatch time.
5498 // The fields below will be sampled in this case.
5499 optional int64 recorded_delay_message_count = 13;
5500
5501 // Total dispatching delay of all processed messages.
5502 // Calculated as a difference between the target dispatching time (Message.when)
5503 // and the actual dispatching time.
5504 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5505 optional int64 recorded_total_delay_millis = 14;
5506
5507 // Max dispatching delay of all processed messages.
5508 // Calculated as a difference between the target dispatching time (Message.when)
5509 // and the actual dispatching time.
5510 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005511}
Tej Singh86dc9db2018-09-06 00:39:57 +00005512
5513/**
5514 * Pulls disk information, such as write speed and latency.
5515 */
5516message DiskStats {
5517 // Time taken to open, write 512B to, and close a file.
5518 // -1 if error performing the check.
5519 optional int64 data_write_latency_millis = 1;
5520
5521 optional bool file_based_encryption = 2;
5522
5523 // Recent disk write speed in kB/s.
5524 // -1 if error querying storageed.
5525 // 0 if data is unavailable.
5526 optional int32 recent_disk_write_speed = 3;
5527}
5528
5529
5530/**
5531 * Free and total bytes of the Data, Cache, and System partition.
5532 */
5533message DirectoryUsage {
5534 enum Directory {
5535 UNKNOWN = 0;
5536 DATA = 1;
5537 CACHE = 2;
5538 SYSTEM = 3;
5539 }
5540 optional Directory directory = 1;
5541 optional int64 free_bytes = 2;
5542 optional int64 total_bytes = 3;
5543}
5544
5545
5546/**
5547 * Size of an application: apk size, data size, and cache size.
5548 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5549 * Information is only reported for apps with the primary user (user 0).
5550 * Sizes are aggregated by package name.
5551 */
5552message AppSize {
5553 // Including uids will involve modifying diskstats logic.
5554 optional string package_name = 1;
5555 // App size in bytes. -1 if unavailable.
5556 optional int64 app_size_bytes = 2;
5557 // App data size in bytes. -1 if unavailable.
5558 optional int64 app_data_size_bytes = 3;
5559 // App cache size in bytes. -1 if unavailable.
5560 optional int64 app_cache_size_bytes = 4;
5561 // Time that the cache file was produced.
5562 // Uses System.currentTimeMillis(), which is wall clock time.
5563 optional int64 cache_time_millis = 5;
5564}
5565
5566
5567/**
5568 * Size of a particular category. Eg: photos, videos.
5569 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5570 */
5571message CategorySize {
5572 enum Category {
5573 UNKNOWN = 0;
5574 APP_SIZE = 1;
5575 APP_DATA_SIZE = 2;
5576 APP_CACHE_SIZE = 3;
5577 PHOTOS = 4;
5578 VIDEOS = 5;
5579 AUDIO = 6;
5580 DOWNLOADS = 7;
5581 SYSTEM = 8;
5582 OTHER = 9;
5583 }
5584 optional Category category = 1;
5585 // Category size in bytes.
5586 optional int64 size_bytes = 2;
5587 // Time that the cache file was produced.
5588 // Uses System.currentTimeMillis(), which is wall clock time.
5589 optional int64 cache_time_millis = 3;
5590}
Tej Singhd6d6d772018-09-05 17:41:25 -07005591
5592/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005593 * Pulls per uid I/O stats. The stats are cumulative since boot.
5594 *
5595 * Read/write bytes are I/O events from a storage device
5596 * Read/write chars are data requested by read/write syscalls, and can be
5597 * satisfied by caching.
5598 *
5599 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5600 */
5601message DiskIo {
5602 optional int32 uid = 1 [(is_uid) = true];
5603 optional int64 fg_chars_read = 2;
5604 optional int64 fg_chars_write = 3;
5605 optional int64 fg_bytes_read = 4;
5606 optional int64 fg_bytes_write = 5;
5607 optional int64 bg_chars_read = 6;
5608 optional int64 bg_chars_write = 7;
5609 optional int64 bg_bytes_read = 8;
5610 optional int64 bg_bytes_write = 9;
5611 optional int64 fg_fsync = 10;
5612 optional int64 bg_fsync= 11;
5613}
5614
5615
5616/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005617 * Pulls the number of fingerprints for each user.
5618 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005619 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005620 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005621message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005622 // The associated user. Eg: 0 for owners, 10+ for others.
5623 // Defined in android/os/UserHandle.java
5624 optional int32 user = 1;
5625 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005626 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005627}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005628
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005629/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005630 * Pulls the number of faces for each user.
5631 *
5632 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5633 */
5634message NumFacesEnrolled {
5635 // The associated user. Eg: 0 for owners, 10+ for others.
5636 // Defined in android/os/UserHandle.java
5637 optional int32 user = 1;
5638 // Number of faces registered to that user.
5639 optional int32 num_faces_enrolled = 2;
5640}
5641/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005642 * A mapping of role holder -> role
5643 */
5644message RoleHolder {
5645 // uid of the role holder
5646 optional int32 uid = 1 [(is_uid) = true];
5647
5648 // package name of the role holder
5649 optional string package_name = 2;
5650
5651 // the role held
5652 optional string role = 3;
5653}
5654
Yangsteraf9aee72018-10-12 09:26:16 -07005655message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005656 // These are all in byte resolution.
5657 optional int64 min = 1 [deprecated = true];
5658 optional int64 average = 2 [deprecated = true];
5659 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005660
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005661 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5662 // int64 fields.
5663 optional int32 mean_kb = 4;
5664 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005665}
5666
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005667// A reduced subset of process states; reducing the number of possible states allows more
5668// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5669enum ProcessStateAggregated {
5670 PROCESS_STATE_UNKNOWN = 0;
5671 // Persistent system process.
5672 PROCESS_STATE_PERSISTENT = 1;
5673 // Top activity; actually any visible activity.
5674 PROCESS_STATE_TOP = 2;
5675 // Process binding to top or a foreground service.
5676 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5677 // Processing running a foreground service.
5678 PROCESS_STATE_FGS = 4;
5679 // Important foreground process (ime, wallpaper, etc).
5680 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5681 // Important background process.
5682 PROCESS_STATE_BACKGROUND = 6;
5683 // Process running a receiver.
5684 PROCESS_STATE_RECEIVER = 7;
5685 // All kinds of cached processes.
5686 PROCESS_STATE_CACHED = 8;
5687}
5688
5689// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005690message ProcessStatsStateProto {
5691 optional android.service.procstats.ScreenState screen_state = 1;
5692
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005693 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005694
5695 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5696 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005697 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5698
5699 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005700
5701 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005702 optional int64 duration_millis = 4 [deprecated = true];
5703 // Same as above, but with minute resolution so it fits into an int32.
5704 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005705
5706 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005707 optional int64 realtime_duration_millis = 9 [deprecated = true];
5708 // Same as above, but with minute resolution so it fits into an int32.
5709 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005710
5711 // # of samples taken
5712 optional int32 sample_size = 5;
5713
5714 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005715 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005716
5717 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005718 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005719
5720 // RSS is memory resident for this process
5721 optional AggStats rss = 8;
5722}
5723
Jing Ji060d6862020-04-13 19:36:31 -07005724// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005725message ProcessStatsProto {
5726 // Name of process.
5727 optional string process = 1;
5728
5729 // Uid of the process.
5730 optional int32 uid = 2;
5731
5732 // Information about how often kills occurred
5733 message Kill {
5734 // Count of excessive CPU kills
5735 optional int32 cpu = 1;
5736
5737 // Count of kills when cached
5738 optional int32 cached = 2;
5739
5740 // PSS stats during cached kill
5741 optional AggStats cached_pss = 3;
5742 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005743 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005744
5745 // Time and memory spent in various states.
5746 repeated ProcessStatsStateProto states = 5;
5747
5748 // Total time process has been running... screen_state, memory_state, and process_state
5749 // will not be set.
5750 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005751
5752 // Association data for this process in this state;
5753 // each entry here is one association.
5754 repeated ProcessStatsAssociationProto assocs = 7;
5755}
5756
5757// Next Tag: 5
5758message ProcessStatsAssociationProto {
5759 // Procss Name of the associated process (client process of service binding)
5760 optional string assoc_process_name = 1;
5761
5762 // Package Name of the associated package (client package of service binding)
5763 optional string assoc_package_name = 2;
5764
5765 // Total count of the times this association (service binding) appeared.
5766 optional int32 total_count = 3;
5767
5768 // Uptime total duration in seconds this association (service binding) was around.
5769 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005770}
5771
5772message PackageServiceOperationStatsProto {
5773 // Operate enum: Started, Foreground, Bound, Executing
5774 optional android.service.procstats.ServiceOperationState operation = 1;
5775
5776 // Number of times the service was in this operation.
5777 optional int32 count = 2;
5778
5779 // Information about a state the service can be in.
5780 message StateStats {
5781 // Screen state enum.
5782 optional android.service.procstats.ScreenState screen_state = 1;
5783 // Memory state enum.
5784 optional android.service.procstats.MemoryState memory_state = 2;
5785
5786 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005787 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005788 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005789 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005790 }
5791 repeated StateStats state_stats = 3;
5792}
5793
5794message PackageServiceStatsProto {
5795 // Name of service component.
5796 optional string service_name = 1;
5797
5798 // The operation stats.
5799 // The package_name, package_uid, package_version, service_name will not be set to save space.
5800 repeated PackageServiceOperationStatsProto operation_stats = 2;
5801}
5802
5803message PackageAssociationSourceProcessStatsProto {
5804 // Uid of the process.
5805 optional int32 process_uid = 1;
5806 // Process name.
5807 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005808 // Package name.
5809 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005810 // Total count of the times this association appeared.
5811 optional int32 total_count = 3;
5812
5813 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005814 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005815
5816 // Total count of the times this association became actively impacting its target process.
5817 optional int32 active_count = 5;
5818
5819 // Information on one source in this association.
5820 message StateStats {
5821 // Process state enum.
5822 optional android.service.procstats.ProcessState process_state = 1;
5823 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005824 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005825 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005826 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005827 }
5828 repeated StateStats active_state_stats = 6;
5829}
5830
5831message PackageAssociationProcessStatsProto {
5832 // Name of the target component.
5833 optional string component_name = 1;
5834 // Information on one source in this association.
5835 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5836}
5837
5838
5839message ProcessStatsPackageProto {
5840 // Name of package.
5841 optional string package = 1;
5842
5843 // Uid of the package.
5844 optional int32 uid = 2;
5845
5846 // Version of the package.
5847 optional int64 version = 3;
5848
5849 // Stats for each process running with the package loaded in to it.
5850 repeated ProcessStatsProto process_stats = 4;
5851
5852 // Stats for each of the package's services.
5853 repeated PackageServiceStatsProto service_stats = 5;
5854
5855 // Stats for each association with the package.
5856 repeated PackageAssociationProcessStatsProto association_stats = 6;
5857}
5858
5859message ProcessStatsSectionProto {
5860 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005861 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005862
5863 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005864 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005865
5866 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005867 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005868
5869 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005870 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005871
5872 // System runtime library. e.g. "libdvm.so", "libart.so".
5873 optional string runtime = 5;
5874
5875 // whether kernel reports swapped pss.
5876 optional bool has_swapped_pss = 6;
5877
5878 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5879 enum Status {
5880 STATUS_UNKNOWN = 0;
5881 STATUS_COMPLETE = 1;
5882 STATUS_PARTIAL = 2;
5883 STATUS_SHUTDOWN = 3;
5884 STATUS_SYSPROPS = 4;
5885 }
5886 repeated Status status = 7;
5887
Chenjie Yub2ecc792019-01-17 10:27:26 -08005888 // Number of pages available of various types and sizes, representation fragmentation.
5889 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5890
Yangsteraf9aee72018-10-12 09:26:16 -07005891 // Stats for each process.
5892 repeated ProcessStatsProto process_stats = 8;
5893
5894 // Stats for each package.
5895 repeated ProcessStatsPackageProto package_stats = 9;
5896}
5897
Chenjie Yub2ecc792019-01-17 10:27:26 -08005898message ProcessStatsAvailablePagesProto {
5899 // Node these pages are in (as per /proc/pagetypeinfo)
5900 optional int32 node = 1;
5901
5902 // Zone these pages are in (as per /proc/pagetypeinfo)
5903 optional string zone = 2;
5904
5905 // Label for the type of these pages (as per /proc/pagetypeinfo)
5906 optional string label = 3;
5907
5908 // Distribution of number of pages available by order size. First entry in array is
5909 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5910 repeated int32 pages_per_order = 4;
5911}
5912
Chenjie Yu12e5e672018-09-14 15:54:59 -07005913/**
5914 * Pulled from ProcessStatsService.java
5915 */
5916message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005917 optional ProcessStatsSectionProto proc_stats_section = 1;
5918}
5919
Chenjie Yuf910b7802019-01-11 16:08:20 -08005920/**
5921 * Pulled from ProcessStatsService.java
5922 */
5923message ProcStatsPkgProc {
5924 optional ProcessStatsSectionProto proc_stats_section = 1;
5925}
5926
Chris Wrencdea3b72019-11-22 16:58:17 -05005927// Next Tag: 2
5928message PackageRemoteViewInfoProto {
5929 optional string package_name = 1;
5930 // add per-package additional info here (like channels)
5931}
5932
5933// Next Tag: 2
5934message NotificationRemoteViewsProto {
5935 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5936}
5937
5938/**
5939 * Pulled from NotificationManagerService.java
5940 */
5941message NotificationRemoteViews {
5942 optional NotificationRemoteViewsProto notification_remote_views = 1;
5943}
5944
Yotam Aron74299972020-01-16 16:20:58 +02005945/**
5946 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5947 */
5948message PackageNotificationPreferences {
5949 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005950 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005951 // Notification importance, which specifies when and how a notification is displayed.
5952 // Specified under core/java/android/app/NotificationManager.java.
5953 optional int32 importance = 2;
5954 // Lockscreen visibility as set by the user.
5955 optional int32 visibility = 3;
5956 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5957 // PreferencesHelper.java)
5958 optional int32 user_locked_fields = 4;
5959}
5960
5961/**
5962 * Atom that contains a list of a package's channel preferences, pulled from
5963 * NotificationManagerService.java.
5964 */
5965message PackageNotificationChannelPreferences {
5966 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005967 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005968 // Channel's ID. Should always be available.
5969 optional string channel_id = 2;
5970 // Channel's name. Should always be available.
5971 optional string channel_name = 3;
5972 // Channel's description. Optionally set by the channel creator.
5973 optional string description = 4;
5974 // Notification importance, which specifies when and how a notification is displayed. Specified
5975 // under core/java/android/app/NotificationManager.java.
5976 optional int32 importance = 5;
5977 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5978 // at core/java/android/app/NotificationChannel.java
5979 optional int32 user_locked_fields = 6;
5980 // Indicates if the channel was deleted by the app.
5981 optional bool is_deleted = 7;
5982}
5983
5984/**
5985 * Atom that contains a list of a package's channel group preferences, pulled from
5986 * NotificationManagerService.java.
5987 */
5988message PackageNotificationChannelGroupPreferences {
5989 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005990 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005991 // Channel Group's ID. Should always be available.
5992 optional string group_id = 2;
5993 // Channel Group's name. Should always be available.
5994 optional string group_name = 3;
5995 // Channel Group's description. Optionally set by group creator.
5996 optional string description = 4;
5997 // Indicates if notifications from this channel group are blocked.
5998 optional bool is_blocked = 5;
5999 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6000 // at core/java/android/app/NotificationChannelGroup.java
6001 optional int32 user_locked_fields = 6;
6002}
6003
Yangsteraf9aee72018-10-12 09:26:16 -07006004message PowerProfileProto {
6005 optional double cpu_suspend = 1;
6006
6007 optional double cpu_idle = 2;
6008
6009 optional double cpu_active = 3;
6010
6011 message CpuCluster {
6012 optional int32 id = 1;
6013 optional double cluster_power = 2;
6014 optional int32 cores = 3;
6015 repeated int64 speed = 4;
6016 repeated double core_power = 5;
6017 }
6018
6019 repeated CpuCluster cpu_cluster = 40;
6020
6021 optional double wifi_scan = 4;
6022
6023 optional double wifi_on = 5;
6024
6025 optional double wifi_active = 6;
6026
6027 optional double wifi_controller_idle = 7;
6028
6029 optional double wifi_controller_rx = 8;
6030
6031 optional double wifi_controller_tx = 9;
6032
6033 repeated double wifi_controller_tx_levels = 10;
6034
6035 optional double wifi_controller_operating_voltage = 11;
6036
6037 optional double bluetooth_controller_idle = 12;
6038
6039 optional double bluetooth_controller_rx = 13;
6040
6041 optional double bluetooth_controller_tx = 14;
6042
6043 optional double bluetooth_controller_operating_voltage = 15;
6044
6045 optional double modem_controller_sleep = 16;
6046
6047 optional double modem_controller_idle = 17;
6048
6049 optional double modem_controller_rx = 18;
6050
6051 repeated double modem_controller_tx = 19;
6052
6053 optional double modem_controller_operating_voltage = 20;
6054
6055 optional double gps_on = 21;
6056
6057 repeated double gps_signal_quality_based = 22;
6058
6059 optional double gps_operating_voltage = 23;
6060
6061 optional double bluetooth_on = 24;
6062
6063 optional double bluetooth_active = 25;
6064
6065 optional double bluetooth_at_cmd = 26;
6066
6067 optional double ambient_display = 27;
6068
6069 optional double screen_on = 28;
6070
6071 optional double radio_on = 29;
6072
6073 optional double radio_scanning = 30;
6074
6075 optional double radio_active = 31;
6076
6077 optional double screen_full = 32;
6078
6079 optional double audio = 33;
6080
6081 optional double video = 34;
6082
6083 optional double flashlight = 35;
6084
6085 optional double memory = 36;
6086
6087 optional double camera = 37;
6088
6089 optional double wifi_batched_scan = 38;
6090
6091 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006092}
Chenjie Yuab530202018-09-26 12:39:20 -07006093
6094/**
6095 * power_profile.xml and other constants for power model calculations.
6096 * Pulled from PowerProfile.java
6097 */
6098message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006099 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006100}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006101
6102/**
arangelovd5db50e2018-10-12 20:24:39 +01006103 * Logs when a user restriction was added or removed.
6104 *
6105 * Logged from:
6106 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6107 */
6108message UserRestrictionChanged {
6109 // The raw string of the user restriction as defined in UserManager.
6110 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6111 optional string restriction = 1;
6112 // Whether the restriction is enabled or disabled.
6113 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006114}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006115
6116/**
6117 * Pulls process user time and system time. Puller takes a snapshot of all pids
6118 * in the system and returns cpu stats for those that are working at the time.
6119 * Dead pids will be dropped. Kernel processes are excluded.
6120 * Min cool-down is 5 sec.
6121 */
6122message ProcessCpuTime {
6123 optional int32 uid = 1 [(is_uid) = true];
6124
6125 optional string process_name = 2;
6126 // Process cpu time in user space, cumulative from boot/process start
6127 optional int64 user_time_millis = 3;
6128 // Process cpu time in system space, cumulative from boot/process start
6129 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006130}
Misha Wagner5a51e002018-10-03 15:04:09 +01006131
6132/**
6133 * Pulls the CPU usage for each thread.
6134 *
6135 * Read from /proc/$PID/task/$TID/time_in_state files.
6136 *
6137 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6138 * time_in_state files not being present on some phones, have not been addressed. These should be
6139 * considered before a public release.
6140 */
6141message CpuTimePerThreadFreq {
6142 // UID that owns the process.
6143 optional int32 uid = 1 [(is_uid) = true];
6144 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006145 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006146 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006147 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006148 // Name of the process taken from `/proc/$PID/cmdline`.
6149 optional string process_name = 4;
6150 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6151 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006152
6153 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6154 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6155 // frequencies are given here as the alternative is sending eight separate atoms. This method
6156 // significantly reduces the amount of data created
6157 optional int32 frequency1_khz = 6;
6158 optional int32 time1_millis = 7;
6159 optional int32 frequency2_khz = 8;
6160 optional int32 time2_millis = 9;
6161 optional int32 frequency3_khz = 10;
6162 optional int32 time3_millis = 11;
6163 optional int32 frequency4_khz = 12;
6164 optional int32 time4_millis = 13;
6165 optional int32 frequency5_khz = 14;
6166 optional int32 time5_millis = 15;
6167 optional int32 frequency6_khz = 16;
6168 optional int32 time6_millis = 17;
6169 optional int32 frequency7_khz = 18;
6170 optional int32 time7_millis = 19;
6171 optional int32 frequency8_khz = 20;
6172 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006173}
Bookatz75ee60422018-11-09 12:27:37 -08006174
6175/**
Bookatz366a4432018-11-20 09:42:33 -08006176 * Pulls information about the device's build.
6177 */
6178message BuildInformation {
6179 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6180 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6181 optional string fingerprint = 1;
6182
6183 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6184 optional string brand = 2;
6185
6186 // Build.PRODUCT. The name of the overall product.
6187 optional string product = 3;
6188
6189 // Build.DEVICE. The name of the industrial design.
6190 optional string device = 4;
6191
6192 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6193 optional string version_release = 5;
6194
6195 // Build.ID. E.g. a label like "M4-rc20".
6196 optional string id = 6;
6197
6198 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6199 // represent this build.
6200 optional string version_incremental = 7;
6201
6202 // Build.TYPE. The type of build, like "user" or "eng".
6203 optional string type = 8;
6204
6205 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6206 optional string tags = 9;
6207}
6208
6209/**
Adam He420947c2019-01-23 15:59:09 -08006210 * Logs information about mismatched caller for content capture.
6211 *
6212 * Logged from:
6213 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6214 */
6215message ContentCaptureCallerMismatchReported {
6216 optional string intended_package = 1;
6217 optional string calling_package = 2;
6218}
6219
6220/**
6221 * Logs information about content capture service events.
6222 *
6223 * Logged from:
6224 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6225 */
6226message ContentCaptureServiceEvents {
6227 // The type of event.
6228 enum Event {
6229 UNKNOWN = 0;
6230 ON_CONNECTED = 1;
6231 ON_DISCONNECTED = 2;
6232 SET_WHITELIST = 3;
6233 SET_DISABLED = 4;
6234 ON_USER_DATA_REMOVED = 5;
6235 }
6236 optional Event event = 1;
6237 // component/package of content capture service.
6238 optional string service_info = 2;
6239 // component/package of target.
6240 // it's a concatenated list of component/package for SET_WHITELIST event
6241 // separated by " ".
6242 optional string target_info = 3;
6243}
6244
6245/**
6246 * Logs information about content capture session events.
6247 *
6248 * Logged from:
6249 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6250 */
6251message ContentCaptureSessionEvents {
6252 // The type of event.
6253 enum Event {
6254 UNKNOWN = 0;
6255 ON_SESSION_STARTED = 1;
6256 ON_SESSION_FINISHED = 2;
6257 SESSION_NOT_CREATED = 3;
6258 }
6259 optional int32 session_id = 1;
6260 optional Event event = 2;
6261 // (n/a on session finished)
6262 optional int32 state_flags = 3;
6263 // component/package of content capture service.
6264 optional string service_info = 4;
6265 // component/package of app.
6266 // (n/a on session finished)
6267 optional string app_info = 5;
6268 optional bool is_child_session = 6;
6269}
6270
6271/**
6272 * Logs information about session being flushed.
6273 *
6274 * Logged from:
6275 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6276 */
6277message ContentCaptureFlushed {
6278 optional int32 session_id = 1;
6279 // component/package of content capture service.
6280 optional string service_info = 2;
6281 // component/package of app.
6282 optional string app_info = 3;
6283 // session start/finish events
6284 optional int32 child_session_started = 4;
6285 optional int32 child_session_finished = 5;
6286 // count of view events.
6287 optional int32 view_appeared_count = 6;
6288 optional int32 view_disappeared_count = 7;
6289 optional int32 view_text_changed_count = 8;
6290
6291 // Flush stats.
6292 optional int32 max_events = 9;
6293 optional int32 idle_flush_freq = 10;
6294 optional int32 text_flush_freq = 11;
6295 optional int32 flush_reason = 12;
6296}
6297
6298/**
Bookatz75ee60422018-11-09 12:27:37 -08006299 * Pulls on-device BatteryStats power use calculations for the overall device.
6300 */
6301message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006302 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6303 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6304 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6305 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006306}
6307
6308/**
6309 * Pulls on-device BatteryStats power use calculations broken down by uid.
6310 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6311 * that is attributed to non-uid items. They must all be included to get the total power use.
6312 */
6313message DeviceCalculatedPowerBlameUid {
6314 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6315 optional int32 uid = 1 [(is_uid) = true];
6316
Bookatz3dbc13a2018-12-21 12:16:51 -08006317 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6318 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6319 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006320}
6321
6322/**
6323 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6324 * drain type.
6325 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6326 * is attributed uids. They must all be included to get the total power use.
6327 */
6328message DeviceCalculatedPowerBlameOther {
6329 // The type of item whose power use is being reported.
6330 enum DrainType {
6331 AMBIENT_DISPLAY = 0;
6332 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6333 BLUETOOTH = 2;
6334 CAMERA = 3;
6335 // Cell-standby
6336 CELL = 4;
6337 FLASHLIGHT = 5;
6338 IDLE = 6;
6339 MEMORY = 7;
6340 // Amount that total computed drain exceeded the drain estimated using the
6341 // battery level changes and capacity.
6342 OVERCOUNTED = 8;
6343 PHONE = 9;
6344 SCREEN = 10;
6345 // Amount that total computed drain was below the drain estimated using the
6346 // battery level changes and capacity.
6347 UNACCOUNTED = 11;
6348 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6349 WIFI = 13;
6350 }
6351 optional DrainType drain_type = 1;
6352
Bookatz3dbc13a2018-12-21 12:16:51 -08006353 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6354 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6355 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006356}
arangelov4e994062018-11-13 16:12:38 +00006357
6358/**
6359 * Logs device policy features.
6360 *
6361 * Logged from:
6362 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6363 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6364 */
6365message DevicePolicyEvent {
6366 // The event id - unique for each event.
6367 optional android.stats.devicepolicy.EventId event_id = 1;
6368 // The admin package name.
6369 optional string admin_package_name = 2;
6370 // A generic integer parameter.
6371 optional int32 integer_value = 3;
6372 // A generic boolean parameter.
6373 optional bool boolean_value = 4;
6374 // A parameter specifying a time period in milliseconds.
6375 optional uint64 time_period_millis = 5;
6376 // A parameter specifying a list of package names, bundle extras or string parameters.
6377 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6378}
shawnlinea5b66b2018-11-13 15:05:29 +08006379
6380/**
6381 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6382 *
6383 * Logged from:
6384 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6385 */
6386message DocsUILaunchReported {
6387 optional android.stats.docsui.LaunchAction launch_action = 1;
6388 optional bool has_initial_uri = 2;
6389 optional android.stats.docsui.MimeType mime_type = 3;
6390 optional android.stats.docsui.Root initial_root = 4;
6391}
6392
6393/**
6394 * Logs root/app visited event in file managers/picker. Call this when the user
6395 * taps on root/app in hamburger menu.
6396 *
6397 * Logged from:
6398 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6399 */
6400message DocsUIRootVisitedReported {
6401 optional android.stats.docsui.ContextScope scope = 1;
6402 optional android.stats.docsui.Root root = 2;
6403}
6404
6405/**
6406 * Logs file operation stats. Call this when a file operation has completed.
6407 *
6408 * Logged from:
6409 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6410 */
6411message DocsUIFileOperationReported {
6412 optional android.stats.docsui.Provider provider = 1;
6413 optional android.stats.docsui.FileOperation file_op = 2;
6414}
6415
6416/**
6417 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6418 * mode.
6419 *
6420 * Logged from:
6421 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6422 */
6423message DocsUIFileOperationCopyMoveModeReported {
6424 optional android.stats.docsui.FileOperation file_op = 1;
6425 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6426}
6427
6428
6429/**
6430 * Logs file sub operation stats. Call this when a file operation has failed.
6431 *
6432 * Logged from:
6433 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6434 */
6435message DocsUIFileOperationFailureReported {
6436 optional android.stats.docsui.Authority authority = 1;
6437 optional android.stats.docsui.SubFileOperation sub_op = 2;
6438}
6439
6440/**
6441* Logs the cancellation of a file operation. Call this when a job is canceled
6442*
6443* Logged from:
6444* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6445*/
6446message DocsUIFileOperationCanceledReported {
6447 optional android.stats.docsui.FileOperation file_op = 1;
6448}
6449
6450/**
6451 * Logs startup time in milliseconds.
6452 *
6453 * Logged from:
6454 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6455 */
6456message DocsUIStartupMsReported {
6457 optional int32 startup_millis = 1;
6458}
6459
6460/**
6461 * Logs the action that was started by user.
6462 *
6463 * Logged from:
6464 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6465 */
6466message DocsUIUserActionReported {
6467 optional android.stats.docsui.UserAction action = 1;
6468}
6469
6470/**
6471 * Logs the invalid type when invalid scoped access is requested.
6472 *
6473 * Logged from:
6474 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6475 */
6476message DocsUIInvalidScopedAccessRequestReported {
6477 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006478}
Ben Murdochbab399f2018-12-06 11:01:38 +00006479
6480/**
shawnlina75e82d2019-01-07 10:31:12 +08006481 * Logs the package name that launches docsui picker mode.
6482 *
6483 * Logged from:
6484 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6485 */
6486message DocsUIPickerLaunchedFromReported {
6487 optional string package_name = 1;
6488}
6489
6490/**
6491 * Logs the search type.
6492 *
6493 * Logged from:
6494 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6495 */
6496message DocsUISearchTypeReported {
6497 optional android.stats.docsui.SearchType search_type = 1;
6498}
6499
6500/**
6501 * Logs the search mode.
6502 *
6503 * Logged from:
6504 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6505 */
6506message DocsUISearchModeReported {
6507 optional android.stats.docsui.SearchMode search_mode = 1;
6508}
6509
6510/**
6511 * Logs the pick result information.
6512 *
6513 * Logged from:
6514 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6515 */
6516message DocsUIPickResultReported {
6517 optional int32 total_action_count = 1;
6518 optional int64 duration_millis = 2;
6519 optional int32 file_count= 3;
6520 optional bool is_searching = 4;
6521 optional android.stats.docsui.Root picked_from = 5;
6522 optional android.stats.docsui.MimeType mime_type = 6;
6523 optional int32 repeatedly_pick_times = 7;
6524}
6525
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006526/** Logs the drag and drop of files.
6527
6528 * Logged from:
6529 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6530 */
6531message DocsUIDragAndDropReported {
6532 optional bool drag_initiated_from_docsui = 1;
6533}
6534
shawnlina75e82d2019-01-07 10:31:12 +08006535/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006536 * Logs when an app's memory is compacted.
6537 *
6538 * Logged from:
6539 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6540 */
6541message AppCompacted {
6542 // The pid of the process being compacted.
6543 optional int32 pid = 1;
6544
6545 // The name of the process being compacted.
6546 optional string process_name = 2;
6547
6548 // The type of compaction.
6549 enum Action {
6550 UNKNOWN = 0;
6551 SOME = 1;
6552 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006553 PERSISTENT = 3;
6554 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006555 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006556 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006557
6558 // Total RSS in kilobytes consumed by the process prior to compaction.
6559 optional int64 before_rss_total_kilobytes = 4;
6560
6561 // File RSS in kilobytes consumed by the process prior to compaction.
6562 optional int64 before_rss_file_kilobytes = 5;
6563
6564 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6565 optional int64 before_rss_anon_kilobytes = 6;
6566
6567 // Swap in kilobytes consumed by the process prior to compaction.
6568 optional int64 before_swap_kilobytes = 7;
6569
6570 // Total RSS in kilobytes consumed by the process after compaction.
6571 optional int64 after_rss_total_kilobytes = 8;
6572
6573 // File RSS in kilobytes consumed by the process after compaction.
6574 optional int64 after_rss_file_kilobytes = 9;
6575
6576 // Anonymous RSS in kilobytes consumed by the process after compaction.
6577 optional int64 after_rss_anon_kilobytes = 10;
6578
6579 // Swap in kilobytes consumed by the process after compaction.
6580 optional int64 after_swap_kilobytes = 11;
6581
6582 // The time taken to perform compaction in milliseconds.
6583 optional int64 time_to_compact_millis = 12;
6584
6585 // The last compaction action performed for this app.
6586 optional Action last_action = 13;
6587
Ben Murdoch01720b82018-12-19 18:03:44 +00006588 // The last time that compaction was attempted on this process in milliseconds
6589 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6590 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006591
Ben Murdoch885c21b2019-03-15 18:02:04 +00006592 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006593 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006594
6595 // The process state at the time of compaction.
6596 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006597
6598 // Free ZRAM in kilobytes before compaction.
6599 optional int64 before_zram_free_kilobytes = 17;
6600
6601 // Free ZRAM in kilobytes after compaction.
6602 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006603}
lifr157fc552018-12-12 16:38:04 +08006604
6605/**
lifrb6b90b62019-03-29 00:40:17 +08006606 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6607 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6608 *
lifr1f74b052019-04-16 22:16:30 +08006609 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6610 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6611 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6612 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006613 */
6614message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006615 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006616
lifr1f74b052019-04-16 22:16:30 +08006617 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006618
6619 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006620 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006621
lifr1f74b052019-04-16 22:16:30 +08006622 // Only valid for event_type = EVENT_GETADDRINFO.
6623 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006624
lifr1f74b052019-04-16 22:16:30 +08006625 // Flags passed to android_res_nsend() defined in multinetwork.h
6626 // Only valid for event_type = EVENT_RESNSEND.
6627 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006628
lifrad9becc2019-05-20 11:04:41 +08006629 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006630
6631 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006632 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006633
6634 // Additional pass-through fields opaque to statsd.
6635 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006636 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006637
6638 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6639 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006640}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006641
6642/**
6643 * Logs when a data stall event occurs.
6644 *
6645 * Log from:
6646 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6647 */
6648message DataStallEvent {
6649 // Data stall evaluation type.
6650 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6651 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6652 optional int32 evaluation_type = 1;
6653 // See definition in data_stall_event.proto.
6654 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6655 // See definition in data_stall_event.proto.
6656 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6657 // See definition in data_stall_event.proto.
6658 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6659 // See definition in data_stall_event.proto.
6660 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6661 // See definition in data_stall_event.proto.
6662 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6663}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006664
6665/*
6666 * Logs when RescueParty resets some set of experiment flags.
6667 *
6668 * Logged from:
6669 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6670 */
6671message RescuePartyResetReported {
6672 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6673 optional int32 rescue_level = 1;
6674}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006675
6676/**
6677 * Logs when signed config is received from an APK, and if that config was applied successfully.
6678 * Logged from:
6679 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6680 */
6681message SignedConfigReported {
6682 enum Type {
6683 UNKNOWN_TYPE = 0;
6684 GLOBAL_SETTINGS = 1;
6685 }
6686 optional Type type = 1;
6687
6688 // The final status of the signed config received.
6689 enum Status {
6690 UNKNOWN_STATUS = 0;
6691 APPLIED = 1;
6692 BASE64_FAILURE_CONFIG = 2;
6693 BASE64_FAILURE_SIGNATURE = 3;
6694 SECURITY_EXCEPTION = 4;
6695 INVALID_CONFIG = 5;
6696 OLD_CONFIG = 6;
6697 SIGNATURE_CHECK_FAILED = 7;
6698 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006699 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006700 }
6701 optional Status status = 2;
6702
6703 // The version of the signed config processed.
6704 optional int32 version = 3;
6705
6706 // The package name that the config was extracted from.
6707 optional string from_package = 4;
6708
6709 enum Key {
6710 NO_KEY = 0;
6711 DEBUG = 1;
6712 PRODUCTION = 2;
6713 }
6714 // Which key was used to verify the config.
6715 optional Key verified_with = 5;
6716}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006717
6718/*
6719 * Logs GNSS Network-Initiated (NI) location events.
6720 *
6721 * Logged from:
6722 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6723 */
6724message GnssNiEventReported {
6725 // The type of GnssNiEvent.
6726 enum EventType {
6727 UNKNOWN = 0;
6728 NI_REQUEST = 1;
6729 NI_RESPONSE = 2;
6730 }
6731 optional EventType event_type = 1;
6732
6733 // An ID generated by HAL to associate NI notifications and UI responses.
6734 optional int32 notification_id = 2;
6735
6736 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006737 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006738
6739 // NI requires notification.
6740 optional bool need_notify = 4;
6741
6742 // NI requires verification.
6743 optional bool need_verify = 5;
6744
6745 // NI requires privacy override, no notification/minimal trace.
6746 optional bool privacy_override = 6;
6747
6748 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6749 // seconds.
6750 optional int32 timeout = 7;
6751
6752 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006753 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006754
6755 // String representing the requester of the network inititated location request.
6756 optional string requestor_id = 9;
6757
6758 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6759 // network initiated location request.
6760 optional string text = 10;
6761
6762 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006763 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006764
6765 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006766 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006767
6768 // True if SUPL ES is enabled.
6769 optional bool is_supl_es_enabled = 13;
6770
6771 // True if GNSS location is enabled.
6772 optional bool is_location_enabled = 14;
6773
6774 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006775 optional android.server.location.GnssUserResponseType user_response = 15;
6776}
6777
6778/**
6779 * Logs GNSS non-framework (NFW) location notification.
6780 *
6781 * Logged from:
6782 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6783 */
6784message GnssNfwNotificationReported {
6785 // Package name of the Android proxy application representing the non-framework entity that
6786 // requested location. Set to empty string if unknown.
6787 optional string proxy_app_package_name = 1;
6788
6789 // Protocol stack that initiated the non-framework location request.
6790 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6791
6792 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6793 // set to empty string. This field is opaque to the framework and used for logging purposes.
6794 optional string other_protocol_stack_name = 3;
6795
6796 // Source initiating/receiving the location information.
6797 optional android.server.location.NfwRequestor requestor = 4;
6798
6799 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6800 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6801 // and used for logging purposes.
6802 optional string requestor_id = 5;
6803
6804 // Indicates whether location information was provided for this request.
6805 optional android.server.location.NfwResponseType response_type = 6;
6806
6807 // True if the device is in user initiated emergency session.
6808 optional bool in_emergency_mode = 7;
6809
6810 // True if cached location is provided.
6811 optional bool is_cached_location = 8;
6812
6813 // True if proxy app permission mismatch between framework and GNSS HAL.
6814 optional bool is_permission_mismatched = 9;
6815}
6816
6817/**
6818 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6819 *
6820 * Logged from:
6821 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6822 */
6823message GnssConfigurationReported {
6824 // SUPL host name.
6825 optional string supl_host = 1;
6826
6827 // SUPL port number.
6828 optional int32 supl_port = 2;
6829
6830 // C2K host name.
6831 optional string c2k_host = 3;
6832
6833 // C2K port number.
6834 optional int32 c2k_port = 4;
6835
6836 // The SUPL version requested by Carrier.
6837 optional int32 supl_ver = 5;
6838
6839 // The SUPL mode.
6840 optional android.server.location.SuplMode supl_mode = 6;
6841
6842 // True if NI emergency SUPL restrictions is enabled.
6843 optional bool supl_es = 7;
6844
6845 // LTE Positioning Profile settings
6846 optional android.server.location.LppProfile lpp_profile = 8;
6847
6848 // Positioning protocol on A-Glonass system.
6849 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6850
6851 // True if emergency PDN is used. Otherwise, regular PDN is used.
6852 optional bool use_emergency_pdn_for_emergency_supl= 10;
6853
6854 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6855 optional android.server.location.GpsLock gps_lock = 11;
6856
6857 // Number of seconds to extend the emergency session duration post emergency call.
6858 optional int32 es_extension_sec = 12;
6859
6860 // The full list of package names of proxy Android applications representing the non-framework
6861 // location access entities (on/off the device) for which the framework user has granted
6862 // non-framework location access permission. The package names are concatenated in one string
6863 // with spaces as separators.
6864 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006865}
Jack Yu95b64f32018-12-13 18:26:11 +08006866
6867/**
6868 * Logs when a NFC device's error occurred.
6869 * Logged from:
6870 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6871 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6872 */
6873message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006874 enum Type {
6875 UNKNOWN = 0;
6876 CMD_TIMEOUT = 1;
6877 ERROR_NOTIFICATION = 2;
6878 AID_OVERFLOW = 3;
6879 }
6880 optional Type type = 1;
6881 // If it's nci cmd timeout, log the timeout command.
6882 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006883
Alex Salod7c3eef2019-01-25 14:43:27 -08006884 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006885}
6886
6887/**
6888 * Logs when a NFC device's state changed event
6889 * Logged from:
6890 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6891 */
6892message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006893 enum State {
6894 UNKNOWN = 0;
6895 OFF = 1;
6896 ON = 2;
6897 ON_LOCKED = 3; // Secure Nfc enabled.
6898 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6899 }
6900 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006901}
6902
6903/**
6904 * Logs when a NFC Beam Transaction occurred.
6905 * Logged from:
6906 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6907 */
6908message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006909 enum Operation {
6910 UNKNOWN = 0;
6911 SEND = 1;
6912 RECEIVE = 2;
6913 }
6914 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006915}
6916
6917/**
6918 * Logs when a NFC Card Emulation Transaction occurred.
6919 * Logged from:
6920 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6921 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6922 */
6923message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006924 enum Category {
6925 UNKNOWN = 0;
6926 HCE_PAYMENT = 1;
6927 HCE_OTHER = 2;
6928 OFFHOST = 3;
6929 }
6930 // Transaction belongs to HCE payment or HCE other category, or offhost.
6931 optional Category category = 1;
6932 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6933 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006934}
6935
6936/**
6937 * Logs when a NFC Tag event occurred.
6938 * Logged from:
6939 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6940 */
6941message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006942 enum Type {
6943 UNKNOWN = 0;
6944 URL = 1;
6945 BT_PAIRING = 2;
6946 PROVISION = 3;
6947 WIFI_CONNECT = 4;
6948 APP_LAUNCH = 5;
6949 OTHERS = 6;
6950 }
6951 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006952}
6953
6954/**
6955 * Logs when Hce transaction triggered
6956 * Logged from:
6957 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6958 */
6959message NfcHceTransactionOccurred {
6960 // The latency period(in microseconds) it took for the first HCE data
6961 // exchange.
6962 optional uint32 latency_micros = 1;
6963}
6964
6965/**
6966 * Logs when SecureElement state event changed
6967 * Logged from:
6968 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6969 */
6970message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006971 enum State {
6972 UNKNOWN = 0;
6973 INITIALIZED = 1;
6974 DISCONNECTED = 2;
6975 CONNECTED = 3;
6976 HALCRASH = 4;
6977 }
6978 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006979
Alex Salod7c3eef2019-01-25 14:43:27 -08006980 optional string state_change_reason = 2;
6981 // SIMx or eSEx.
6982 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006983}
6984
6985/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006986 * Information about a permission grant request
6987 */
6988message PermissionGrantRequestResultReported {
6989 // unique value identifying an API call. A API call might result in multiple of these atoms
6990 optional int64 request_id = 1;
6991
6992 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006993 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006994
6995 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006996 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006997
6998 // The permission to be granted
6999 optional string permission_name = 4;
7000
7001 // If the permission was explicitly requested via the API or added by the system
7002 optional bool is_implicit = 5;
7003
7004 enum Result {
7005 UNDEFINED = 0;
7006 // permission request was ignored
7007 IGNORED = 1;
7008 // permission request was ignored because it was user fixed
7009 IGNORED_USER_FIXED = 2;
7010 // permission request was ignored because it was policy fixed
7011 IGNORED_POLICY_FIXED = 3;
7012 // permission was granted by user action
7013 USER_GRANTED = 4;
7014 // permission was automatically granted
7015 AUTO_GRANTED = 5;
7016 // permission was denied by user action
7017 USER_DENIED = 6;
7018 // permission was denied with prejudice by the user
7019 USER_DENIED_WITH_PREJUDICE = 7;
7020 // permission was automatically denied
7021 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007022 // permission request was ignored because permission is restricted
7023 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007024 // one time permission was granted by user action
7025 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007026 // user ignored request by leaving the request screen without choosing any option
7027 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007028 // user granted the permission after being linked to settings
7029 USER_GRANTED_IN_SETTINGS = 12;
7030 // user denied the permission after being linked to settings
7031 USER_DENIED_IN_SETTINGS = 13;
7032 // user denied the permission with prejudice after being linked to settings
7033 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7034 // permission was automatically revoked after one-time permission expired
7035 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007036 // permission was automatically revoked for unused app
7037 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007038 }
7039 // The result of the permission grant
7040 optional Result result = 6;
7041}
7042
7043/**
Jack Yu95b64f32018-12-13 18:26:11 +08007044 * Logs when Omapi API used
7045 * Logged from:
7046 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7047 */
7048message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007049 enum Operation {
7050 UNKNOWN = 0;
7051 OPEN_CHANNEL = 1;
7052 }
7053 optional Operation operation = 1;
7054 // SIMx or eSEx.
7055 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007056
Alex Salod7c3eef2019-01-25 14:43:27 -08007057 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007058}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007059
7060/**
Alex Saloa060aee2019-01-21 14:36:41 -08007061 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7062 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007063 * Logged from:
7064 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7065 */
7066message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007067 optional int64 dispatch_latency_millis = 1;
7068}
7069
7070/**
7071 * Logs AttentionManagerService attention check result.
7072 *
7073 * Logged from:
7074 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7075 */
7076message AttentionManagerServiceResultReported {
7077 // See core/java/android/service/attention/AttentionService.java
7078 enum AttentionCheckResult {
7079 UNKNOWN = 20;
7080 ATTENTION_SUCCESS_ABSENT = 0;
7081 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007082 ATTENTION_FAILURE_UNKNOWN = 2;
7083 ATTENTION_FAILURE_CANCELLED = 3;
7084 ATTENTION_FAILURE_PREEMPTED = 4;
7085 ATTENTION_FAILURE_TIMED_OUT = 5;
7086 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007087 }
7088 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007089}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007090
7091/**
7092 * Logs when an adb connection changes state.
7093 *
7094 * Logged from:
7095 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7096 */
7097message AdbConnectionChanged {
7098 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7099 // previously selected for this system.
7100 optional int64 last_connection_time_millis = 1;
7101
7102 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7103 // to reconnect via adb without user interaction.
7104 optional int64 auth_window_millis = 2;
7105
7106 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7107 optional android.debug.AdbConnectionStateEnum state = 3;
7108
7109 // True if the 'always allow' option was selected for this system.
7110 optional bool always_allow = 4;
7111}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007112
7113/*
7114 * Logs the reported speech DSP status.
7115 *
7116 * Logged from:
7117 * Vendor audio implementation.
7118 */
7119message SpeechDspStatReported {
7120 // The total Speech DSP uptime in milliseconds.
7121 optional int32 total_uptime_millis = 1;
7122 // The total Speech DSP downtime in milliseconds.
7123 optional int32 total_downtime_millis = 2;
7124 optional int32 total_crash_count = 3;
7125 optional int32 total_recover_count = 4;
7126}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007127
7128/**
7129 * Logs USB connector contaminant status.
7130 *
7131 * Logged from: USB Service.
7132 */
7133message UsbContaminantReported {
7134 optional string id = 1;
7135 optional android.service.usb.ContaminantPresenceStatus status = 2;
7136}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007137
7138/**
7139 * This atom is for debugging purpose.
7140 */
7141message DebugElapsedClock {
7142 // Monotically increasing value for each pull.
7143 optional int64 pull_count = 1;
7144 // Time from System.elapsedRealtime.
7145 optional int64 elapsed_clock_millis = 2;
7146 // Time from System.elapsedRealtime.
7147 optional int64 same_elapsed_clock_millis = 3;
7148 // Diff between current elapsed time and elapsed time from previous pull.
7149 optional int64 elapsed_clock_diff_millis = 4;
7150
7151 enum Type {
7152 TYPE_UNKNOWN = 0;
7153 ALWAYS_PRESENT = 1;
7154 PRESENT_ON_ODD_PULLS = 2;
7155 }
7156 // Type of behavior for the pulled data.
7157 optional Type type = 5;
7158}
7159
7160/**
7161 * This atom is for debugging purpose.
7162 */
7163message DebugFailingElapsedClock {
7164 // Monotically increasing value for each pull.
7165 optional int64 pull_count = 1;
7166 // Time from System.elapsedRealtime.
7167 optional int64 elapsed_clock_millis = 2;
7168 // Time from System.elapsedRealtime.
7169 optional int64 same_elapsed_clock_millis = 3;
7170 // Diff between current elapsed time and elapsed time from previous pull.
7171 optional int64 elapsed_clock_diff_millis = 4;
7172}
Steven Wuacef6bb2019-01-23 14:21:17 -05007173
7174/** Logs System UI bubbles event changed.
7175 *
7176 * Logged from:
7177 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7178 */
7179message BubbleUIChanged {
7180
7181 // The app package that is posting the bubble.
7182 optional string package_name = 1;
7183
7184 // The notification channel that is posting the bubble.
7185 optional string notification_channel = 2;
7186
7187 // The notification id associated with the posted bubble.
7188 optional int32 notification_id = 3;
7189
7190 // The position of the bubble within the bubble stack.
7191 optional int32 position = 4;
7192
7193 // The total number of bubbles within the bubble stack.
7194 optional int32 total_number = 5;
7195
7196 // User interactions with the bubble.
7197 enum Action {
7198 UNKNOWN = 0;
7199 POSTED = 1;
7200 UPDATED = 2;
7201 EXPANDED = 3;
7202 COLLAPSED = 4;
7203 DISMISSED = 5;
7204 STACK_DISMISSED = 6;
7205 STACK_MOVED = 7;
7206 HEADER_GO_TO_APP = 8;
7207 HEADER_GO_TO_SETTINGS = 9;
7208 PERMISSION_OPT_IN = 10;
7209 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007210 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007211 SWIPE_LEFT = 13;
7212 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007213 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007214 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007215 }
7216 optional Action action = 6;
7217
7218 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7219 optional float normalized_x_position = 7;
7220 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007221
7222 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7223 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007224
7225 // Whether the bubble is an on-going one.
7226 optional bool is_ongoing = 10;
7227
7228 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007229 // This is deprecated and the value should be ignored.
7230 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007231}
Kweku Adams8845d012018-12-11 20:06:45 -08007232
7233/**
Steven Wu552f63f2019-02-05 13:41:36 -05007234 * Logs System UI bubbles developer errors.
7235 *
7236 * Logged from:
7237 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7238 */
7239message BubbleDeveloperErrorReported {
7240
7241 // The app package that is posting the bubble.
7242 optional string package_name = 1;
7243
7244 // Bubble developer error type enums.
7245 enum Error {
7246 UNKNOWN = 0;
7247 ACTIVITY_INFO_MISSING = 1;
7248 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7249 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7250 }
7251 optional Error error = 2 [default = UNKNOWN];
7252}
7253
7254/**
Kweku Adams8845d012018-12-11 20:06:45 -08007255 * Logs that a constraint for a scheduled job has changed.
7256 *
7257 * Logged from:
7258 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7259 */
7260message ScheduledJobConstraintChanged {
7261 repeated AttributionNode attribution_node = 1;
7262
7263 // Name of the job.
7264 optional string job_name = 2;
7265
7266 optional com.android.server.job.ConstraintEnum constraint = 3;
7267
7268 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007269 UNKNOWN = 0;
7270 UNSATISFIED = 1;
7271 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007272 }
7273 optional State state = 4;
7274}
Alex Salod7c3eef2019-01-25 14:43:27 -08007275
7276/**
7277 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7278 * returns true.
7279 *
7280 * Logged from:
7281 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7282 */
7283message ScreenTimeoutExtensionReported {
7284 // Describes how many times in a row did the power manager reset the screen off timeout.
7285 optional uint32 consecutive_timeout_extended_count = 1;
7286}
Hui Yu885aca12019-01-10 17:11:34 -08007287
7288/*
7289* Logs number of milliseconds it takes to start a process.
7290* The definition of app process start time is from the app launch time to
7291* the time that Zygote finished forking the app process and loaded the
7292* application package's java classes.
7293
7294* This metric is different from AppStartOccurred which is for foreground
7295* activity only.
7296
7297* ProcessStartTime can report all processes (both foreground and background)
7298* start time.
7299*
7300* Logged from:
7301* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7302*/
7303message ProcessStartTime {
7304 // The uid of the ProcessRecord.
7305 optional int32 uid = 1 [(is_uid) = true];
7306
7307 // The process pid.
7308 optional int32 pid = 2;
7309
7310 // The process name.
7311 // Usually package name, "system" for system server.
7312 // Provided by ActivityManagerService.
7313 optional string process_name = 3;
7314
7315 enum StartType {
7316 UNKNOWN = 0;
7317 WARM = 1;
7318 HOT = 2;
7319 COLD = 3;
7320 }
7321
7322 // The start type.
7323 optional StartType type = 4;
7324
7325 // The elapsed realtime at the start of the process.
7326 optional int64 process_start_time_millis = 5;
7327
7328 // Number of milliseconds it takes to reach bind application.
7329 optional int32 bind_application_delay_millis = 6;
7330
7331 // Number of milliseconds it takes to finish start of the process.
7332 optional int32 process_start_delay_millis = 7;
7333
7334 // hostingType field in ProcessRecord, the component type such as "activity",
7335 // "service", "content provider", "broadcast" or other strings.
7336 optional string hosting_type = 8;
7337
7338 // hostingNameStr field in ProcessRecord. The component class name that runs
7339 // in this process.
7340 optional string hosting_name = 9;
7341}
7342
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007343/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007344 * Track Media Codec usage
7345 * Logged from:
7346 * frameworks/av/media/libstagefright/MediaCodec.cpp
7347 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7348 */
7349message MediametricsCodecReported {
7350 optional int64 timestamp_nanos = 1;
7351 optional string package_name = 2;
7352 optional int64 package_version_code = 3;
7353 optional int64 media_apex_version = 4;
7354
7355 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7356}
7357
7358/**
7359 * Track Media Extractor (pulling video/audio streams out of containers) usage
7360 * Logged from:
7361 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7362 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7363 */
7364message MediametricsExtractorReported {
7365 optional int64 timestamp_nanos = 1;
7366 optional string package_name = 2;
7367 optional int64 package_version_code = 3;
7368 optional int64 media_apex_version = 4;
7369
7370 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7371}
7372
7373/**
7374 * Track how we arbitrate between microphone/input requests.
7375 * Logged from
7376 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7377 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7378 */
7379message MediametricsAudiopolicyReported {
7380 optional int64 timestamp_nanos = 1;
7381 optional string package_name = 2;
7382 optional int64 package_version_code = 3;
7383 optional int64 media_apex_version = 4;
7384
7385 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7386}
7387
7388/**
7389 * Track how we arbitrate between microphone requests.
7390 * Logged from
7391 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7392 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7393 */
7394message MediametricsAudiorecordReported {
7395 optional int64 timestamp_nanos = 1;
7396 optional string package_name = 2;
7397 optional int64 package_version_code = 3;
7398 optional int64 media_apex_version = 4;
7399
7400 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7401}
7402
7403/**
7404 * Track how we arbitrate between microphone/input requests.
7405 * Logged from
7406 * frameworks/av/media/libnblog/ReportPerformance.cpp
7407 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7408 */
7409message MediametricsAudiothreadReported {
7410 optional int64 timestamp_nanos = 1;
7411 optional string package_name = 2;
7412 optional int64 package_version_code = 3;
7413 optional int64 media_apex_version = 4;
7414
7415 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7416}
7417
7418/**
7419 * Track how we arbitrate between microphone/input requests.
7420 * Logged from
7421 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7422 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7423 */
7424message MediametricsAudiotrackReported {
7425 optional int64 timestamp_nanos = 1;
7426 optional string package_name = 2;
7427 optional int64 package_version_code = 3;
7428 optional int64 media_apex_version = 4;
7429
7430 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7431}
7432
7433/**
7434 * Track information about DRM framework performance
7435 * Logged from
7436 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7437 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7438 */
7439message MediametricsMediadrmReported {
7440 optional int64 timestamp_nanos = 1;
7441 optional string package_name = 2;
7442 optional int64 package_version_code = 3;
7443 optional int64 media_apex_version = 4;
7444
7445 // vendor+description tell about which DRM plugin is in use on this device
7446 optional string vendor = 5;
7447 optional string description = 6;
7448 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7449 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7450}
7451
7452/**
7453 * Track information about the widevine DRM plugin performance
7454 * Logged from
7455 * vendor/widevine/libwvdrmengine/cdm/metrics
7456 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7457 */
7458message MediametricsDrmWidevineReported {
7459 optional int64 timestamp_nanos = 1;
7460 optional string package_name = 2;
7461 optional int64 package_version_code = 3;
7462 optional int64 media_apex_version = 4;
7463
7464 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7465}
7466
7467/**
7468 * Track information about recordings (e.g. camcorder)
7469 * Logged from
7470 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7471 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7472 */
7473message MediametricsRecorderReported {
7474 optional int64 timestamp_nanos = 1;
7475 optional string package_name = 2;
7476 optional int64 package_version_code = 3;
7477 optional int64 media_apex_version = 4;
7478
7479 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7480}
7481
7482/**
7483 * Track Media Player usage
7484 * Logged from:
7485 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7486 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7487 */
7488message MediametricsNuPlayerReported {
7489 optional int64 timestamp_nanos = 1;
7490 optional string package_name = 2;
7491 optional int64 package_version_code = 3;
7492 optional int64 media_apex_version = 4;
7493
7494 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7495}
7496
7497/**
Robert Shiha4beed32019-08-19 14:15:23 -07007498 * Track Legacy DRM usage
7499 * Logged from
7500 * frameworks/av/drm/drmserver/DrmManager.cpp
7501 */
7502message MediametricsDrmManagerReported {
7503 optional int64 timestamp_nanos = 1;
7504 optional string package_name = 2;
7505 optional int64 package_version_code = 3;
7506 optional int64 media_apex_version = 4;
7507
7508 enum Method {
7509 METHOD_NOT_FOUND = -1;
7510 GET_CONSTRAINTS = 0;
7511 GET_METADATA = 1;
7512 CAN_HANDLE = 2;
7513 PROCESS_DRM_INFO = 3;
7514 ACQUIRE_DRM_INFO = 4;
7515 SAVE_RIGHTS = 5;
7516 GET_ORIGINAL_MIME_TYPE = 6;
7517 GET_DRM_OBJECT_TYPE = 7;
7518 CHECK_RIGHTS_STATUS = 8;
7519 REMOVE_RIGHTS = 9;
7520 REMOVE_ALL_RIGHTS = 10;
7521 OPEN_CONVERT_SESSION = 11;
7522 OPEN_DECRYPT_SESSION = 12;
7523 }
7524
7525 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7526 optional string plugin_id = 5;
7527 optional string description = 6;
7528 optional Method method = 7;
7529 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007530
7531 optional int64 get_constraints_count = 9;
7532 optional int64 get_metadata_count = 10;
7533 optional int64 can_handle_count = 11;
7534 optional int64 process_drm_info_count = 12;
7535 optional int64 acquire_drm_info_count = 13;
7536 optional int64 save_rights_count = 14;
7537 optional int64 get_original_mime_type_count = 15;
7538 optional int64 get_drm_object_type_count = 16;
7539 optional int64 check_rights_status_count = 17;
7540 optional int64 remove_rights_count = 18;
7541 optional int64 remove_all_rights_count = 19;
7542 optional int64 open_convert_session_count = 20;
7543 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007544}
7545
7546/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007547 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007548 * Pulled from: StatsCompanionService
7549*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007550message DangerousPermissionState {
7551 // Name of the permission
7552 optional string permission_name = 1;
7553
7554 // Uid of the package
7555 optional int32 uid = 2 [(is_uid) = true];
7556
7557 // Package requesting the permission
7558 optional string package_name = 3;
7559
7560 // If the permission is granted to the uid
7561 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007562
7563 // Permission flags as per android.content.pm.PermissionFlags
7564 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007565}
7566
Michael Groover4a0ca942019-01-24 17:41:25 -08007567/**
7568 * Logs when a package is denied access to a device identifier based on the new access requirements.
7569 *
7570 * Logged from:
7571 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7572 */
7573message DeviceIdentifierAccessDenied {
7574 // The name of the package denied access to the requested device identifier.
7575 optional string package_name = 1;
7576
7577 // The name of the device identifier method the package attempted to invoke.
7578 optional string method_name = 2;
7579
7580 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007581 // Starting from Android 11, this boolean is not set and will always be false.
7582 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007583
7584 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007585 // Starting from Android 11, this boolean is not set and will always be false.
7586 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007587}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007588
7589/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007590 * Pulls the ongoing mainline install train version code.
7591 * Pulled from StatsCompanionService
7592 */
7593message TrainInfo {
7594 optional int64 train_version_code = 1;
7595
7596 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007597
7598 optional string train_name = 3;
7599
7600 enum Status {
7601 UNKNOWN = 0;
7602 INSTALL_REQUESTED = 1;
7603 INSTALL_STARTED = 2;
7604 INSTALL_STAGED_NOT_READY = 3;
7605 INSTALL_STAGED_READY = 4;
7606 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007607 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7608 // and INSTALL_FAILURE_COMMIT.
7609 INSTALL_FAILURE = 6 [deprecated = true];
7610 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007611 INSTALL_CANCELLED = 7;
7612 INSTALLER_ROLLBACK_REQUESTED = 8;
7613 INSTALLER_ROLLBACK_INITIATED = 9;
7614 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7615 INSTALLER_ROLLBACK_STAGED = 11;
7616 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7617 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7618 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7619 INSTALLER_ROLLBACK_SUCCESS = 15;
7620 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007621 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7622 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7623 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7624 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7625 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7626 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007627 INSTALL_FAILURE_DOWNLOAD = 23;
7628 INSTALL_FAILURE_STATE_MISMATCH = 24;
7629 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007630 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007631 }
7632 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007633}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007634
7635/**
7636 * Logs the gesture stage changed event.
7637 *
7638 * Logged from:
7639 * frameworks/base/packages/SystemUI/
7640 */
7641message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007642 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007643}
7644
7645/**
7646 * Logs the feedback type.
7647 *
7648 * Logged from:
7649 * frameworks/base/packages/SystemUI/
7650 */
7651message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007652 // Whether or not the gesture was used.
7653 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007654}
7655
7656/**
7657 * Logs the progress.
7658 *
7659 * Logged from:
7660 * frameworks/base/packages/SystemUI/
7661 */
7662message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007663 // [0,100] progress for the assist gesture.
7664 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007665}
Neil Fullerdb14b482019-02-05 19:44:44 +00007666
7667/*
7668 * Information about the time zone data on a device.
7669 */
7670message TimeZoneDataInfo {
7671 // A version identifier for the data set on device. e.g. "2018i"
7672 optional string tzdb_version = 1;
7673}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007674
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007675/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007676 * Logs the GPU stats global health information.
7677 *
7678 * Logged from:
7679 * frameworks/native/services/gpuservice/gpustats/
7680 */
7681message GpuStatsGlobalInfo {
7682 // Package name of the gpu driver.
7683 optional string driver_package_name = 1;
7684
7685 // Version name of the gpu driver.
7686 optional string driver_version_name = 2;
7687
7688 // Version code of the gpu driver.
7689 optional int64 driver_version_code = 3;
7690
7691 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7692 optional int64 driver_build_time = 4;
7693
7694 // Total count of the gl driver gets loaded.
7695 optional int64 gl_loading_count = 5;
7696
7697 // Total count of the gl driver fails to be loaded.
7698 optional int64 gl_loading_failure_count = 6;
7699
7700 // Total count of the Vulkan driver gets loaded.
7701 optional int64 vk_loading_count = 7;
7702
7703 // Total count of the Vulkan driver fails to be loaded.
7704 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007705
7706 // Api version of the system Vulkan driver.
7707 optional int32 vulkan_version = 9;
7708
7709 // Api version of the system CPU Vulkan driver.
7710 optional int32 cpu_vulkan_version = 10;
7711
7712 // Api version of the system GLES driver.
7713 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007714
7715 // Total count of the angle driver gets loaded.
7716 optional int64 angle_loading_count = 12;
7717
7718 // Total count of the angle driver fails to be loaded.
7719 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007720}
7721
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007722/**
7723 * GPU driver loading time info.
7724 */
7725message GpuDriverLoadingTime {
7726 // List of all the driver loading times for this app. The list size is
7727 // capped at 50.
7728 repeated int64 driver_loading_time = 1;
7729}
7730
7731/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007732 * Logs the GPU stats per app health information.
7733 *
7734 * Logged from:
7735 * frameworks/native/services/gpuservice/gpustats/
7736 */
7737message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007738 // Package name of the application that loads the gpu driver. Total number
7739 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007740 optional string app_package_name = 1;
7741
7742 // Version code of the gpu driver this app loads.
7743 optional int64 driver_version_code = 2;
7744
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007745 // gl driver loading time info.
7746 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7747 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007748
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007749 // Vulkan driver loading time info.
7750 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7751 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007752
7753 // Angle driver loading time info.
7754 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7755 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007756
7757 // CPU Vulkan implementation is in use.
7758 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007759
7760 // App is not doing pre-rotation correctly.
7761 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007762
7763 // App creates GLESv1 context.
7764 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007765}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007766
7767/*
7768 * Logs the size of the system ion heap.
7769 *
7770 * Pulled from StatsCompanionService.
7771 */
7772message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007773 // Deprecated due to limited support of ion stats in debugfs.
7774 // Use `IonHeapSize` instead.
7775 option deprecated = true;
7776
Rafal Slawikd4e87572019-03-12 13:08:38 +00007777 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007778 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007779 optional int64 size_in_bytes = 1;
7780}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007781
Rafal Slawik77987ed2019-06-17 12:28:23 +01007782/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007783 * Logs the total size of the ion heap.
7784 *
7785 * Pulled from StatsCompanionService.
7786 */
7787message IonHeapSize {
7788 // Total size of all ion heaps in kilobytes.
7789 // Read from: /sys/kernel/ion/total_heaps_kb.
7790 optional int32 total_size_kb = 1;
7791}
7792
7793/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007794 * Logs the per-process size of the system ion heap.
7795 *
7796 * Pulled from StatsCompanionService.
7797 */
7798message ProcessSystemIonHeapSize {
7799 // The uid if available. -1 means not available.
7800 optional int32 uid = 1 [(is_uid) = true];
7801
7802 // The process name (from /proc/PID/cmdline).
7803 optional string process_name = 2;
7804
7805 // Sum of sizes of all allocations.
7806 optional int32 total_size_in_kilobytes = 3;
7807
7808 // Number of allocations.
7809 optional int32 allocation_count = 4;
7810
7811 // Size of the largest allocation.
7812 optional int32 max_size_in_kilobytes = 5;
7813}
7814
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007815/**
7816 * Push network stack events.
7817 *
7818 * Log from:
7819 * frameworks/base/packages/NetworkStack/
7820 */
7821message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007822 // The id that indicates the event reported from NetworkStack.
7823 optional int32 event_id = 1;
7824 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007825 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7826}
Carmen Agimofa769c152019-03-04 14:39:14 +00007827
7828/**
7829 * Logs the apps that are installed on the external storage.
7830 * Pulled from:
7831 * StatsCompanionService
7832 */
7833message AppsOnExternalStorageInfo {
7834 // The type of the external storage.
7835 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7836 // The name of the package that is installed on the external storage.
7837 optional string package_name = 2;
7838}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007839
7840/**
7841 * Logs the settings related to Face.
7842 * Logged from:
7843 * frameworks/base/services/core/java/com/android/server/stats
7844 */
7845message FaceSettings {
7846 // Whether or not face unlock is allowed on Keyguard.
7847 optional bool unlock_keyguard_enabled = 1;
7848 // Whether or not face unlock dismisses the Keyguard.
7849 optional bool unlock_dismisses_keyguard = 2;
7850 // Whether or not face unlock requires attention.
7851 optional bool unlock_attention_required = 3;
7852 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7853 optional bool unlock_app_enabled = 4;
7854 // Whether or not face unlock always requires user confirmation.
7855 optional bool unlock_always_require_confirmation = 5;
7856 // Whether or not a diverse set of poses are required during enrollment.
7857 optional bool unlock_diversity_required = 6;
7858}
Maggie White442b6312019-04-05 16:26:44 -07007859
7860/**
7861 * Logs cooling devices maintained by the kernel.
7862 *
7863 * Pulled from StatsCompanionService.java
7864 */
7865message CoolingDevice {
7866 // The type of cooling device being reported. Eg. CPU, GPU...
7867 optional android.os.CoolingTypeEnum device_location = 1;
7868 // The name of the cooling device source. Eg. CPU0
7869 optional string device_name = 2;
7870 // Current throttle state of the cooling device. The value can any unsigned
7871 // integer between 0 and max_state defined in its driver. 0 means device is
7872 // not in throttling, higher value means deeper throttling.
7873 optional int32 state = 3;
7874}
Ben Blount763a5d52019-04-10 11:48:58 -07007875
7876/**
7877 * Intelligence has several counter-type events that don't warrant a
7878 * full separate atom. These are primarily API call counters but also include
7879 * counters for feature usage and specific failure modes.
7880 *
7881 * Logged from the Intelligence mainline module.
7882 */
7883message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007884 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007885 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007886 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007887 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007888 // How many times the event occured (to report a batch of high frequency events).
7889 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007890 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007891 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007892}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007893
7894/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007895 * Logs when Car Power state changed.
7896 *
7897 * Logged from:
7898 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7899 */
7900message CarPowerStateChanged {
7901 // States come from CpmsState in CarPowerManagementService.java.
7902 enum State {
7903 WAIT_FOR_VHAL = 0;
7904 ON = 1;
7905 SHUTDOWN_PREPARE = 2;
7906 WAIT_FOR_FINISH = 3;
7907 SUSPEND = 4;
7908 SIMULATE_SLEEP = 5;
7909 }
7910 optional State state = 1;
7911}
7912
7913/**
7914 * Logs whether GarageMode is entered.
7915 *
7916 * Logged from:
7917 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7918 */
7919message GarageModeInfo {
7920 // Whether GarageMode is entered.
7921 optional bool is_garage_mode = 1;
7922}
Martijn Coenencd95d462019-04-25 17:09:45 +02007923
7924/**
7925 * Historical app ops data per package.
7926 */
7927message AppOps {
7928 // Uid of the package requesting the op
7929 optional int32 uid = 1 [(is_uid) = true];
7930
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007931 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007932 optional string package_name = 2;
7933
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007934 // operation id
7935 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007936
7937 // The number of times the op was granted while the app was in the
7938 // foreground (only for trusted requests)
7939 optional int64 trusted_foreground_granted_count = 4;
7940
7941 // The number of times the op was granted while the app was in the
7942 // background (only for trusted requests)
7943 optional int64 trusted_background_granted_count = 5;
7944
7945 // The number of times the op was rejected while the app was in the
7946 // foreground (only for trusted requests)
7947 optional int64 trusted_foreground_rejected_count = 6;
7948
7949 // The number of times the op was rejected while the app was in the
7950 // background (only for trusted requests)
7951 optional int64 trusted_background_rejected_count = 7;
7952
7953 // For long-running operations, total duration of the operation
7954 // while the app was in the foreground (only for trusted requests)
7955 optional int64 trusted_foreground_duration_millis = 8;
7956
7957 // For long-running operations, total duration of the operation
7958 // while the app was in the background (only for trusted requests)
7959 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007960
7961 // Whether AppOps is guarded by Runtime permission
7962 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007963}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007964
7965/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007966 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007967 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007968message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007969 // Uid of the package requesting the op
7970 optional int32 uid = 1 [(is_uid) = true];
7971
7972 // Name of the package performing the op
7973 optional string package_name = 2;
7974
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007975 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7976 // Attributions must be provided through manifest using <attribution> tag available in R and
7977 // above.
7978 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007979
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007980 // operation id
7981 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007982
7983 // The number of times the op was granted while the app was in the
7984 // foreground (only for trusted requests)
7985 optional int64 trusted_foreground_granted_count = 5;
7986
7987 // The number of times the op was granted while the app was in the
7988 // background (only for trusted requests)
7989 optional int64 trusted_background_granted_count = 6;
7990
7991 // The number of times the op was rejected while the app was in the
7992 // foreground (only for trusted requests)
7993 optional int64 trusted_foreground_rejected_count = 7;
7994
7995 // The number of times the op was rejected while the app was in the
7996 // background (only for trusted requests)
7997 optional int64 trusted_background_rejected_count = 8;
7998
7999 // For long-running operations, total duration of the operation
8000 // while the app was in the foreground (only for trusted requests)
8001 optional int64 trusted_foreground_duration_millis = 9;
8002
8003 // For long-running operations, total duration of the operation
8004 // while the app was in the background (only for trusted requests)
8005 optional int64 trusted_background_duration_millis = 10;
8006
8007 // Whether AppOps is guarded by Runtime permission
8008 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008009
8010 // Sampling rate used on device, from 0 to 100
8011 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008012}
8013
8014/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008015 * Location Manager API Usage information(e.g. API under usage,
8016 * API call's parameters).
8017 * Logged from:
8018 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8019 */
8020message LocationManagerApiUsageReported {
8021
8022 // Indicating if usage starts or usage ends.
8023 optional android.stats.location.UsageState state = 1;
8024
8025 // LocationManagerService's API in use.
8026 // We can identify which API from LocationManager is
8027 // invoking current LMS API by the combination of
8028 // API parameter(e.g. is_listener_null, is_intent_null,
8029 // is_location_request_null)
8030 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8031
8032 // Name of the package calling the API.
8033 optional string calling_package_name = 3;
8034
8035 // Type of the location provider.
8036 optional android.stats.location.ProviderType provider = 4;
8037
8038 // Quality of the location request
8039 optional android.stats.location.LocationRequestQuality quality = 5;
8040
8041 // The desired interval for active location updates, in milliseconds.
8042 // Bucketized to reduce cardinality.
8043 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8044
8045 // Minimum distance between location updates, in meters.
8046 // Bucketized to reduce cardinality.
8047 optional android.stats.location.SmallestDisplacementBucket
8048 bucketized_smallest_displacement = 7;
8049
8050 // The number of location updates.
8051 optional int64 num_updates = 8;
8052
8053 // The request expiration time, in millisecond since boot.
8054 // Bucketized to reduce cardinality.
8055 optional android.stats.location.ExpirationBucket
8056 bucketized_expire_in = 9;
8057
8058 // Type of Callback passed in for this API.
8059 optional android.stats.location.CallbackType callback_type = 10;
8060
8061 // The radius of the central point of the alert
8062 // region, in meters. Only for API REQUEST_GEOFENCE.
8063 // Bucketized to reduce cardinality.
8064 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8065
8066 // Activity Importance of API caller.
8067 // Categorized to 3 types that are interesting from location's perspective.
8068 optional android.stats.location.ActivityImportance activiy_importance = 12;
8069}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008070
8071/**
8072 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8073 */
8074message ReviewPermissionsFragmentResultReported {
8075 // unique value identifying a permission group change. A permission group change might result
8076 // in multiple of these atoms
8077 optional int64 change_id = 1;
8078
8079 // UID of package the permission belongs to
8080 optional int32 uid = 2 [(is_uid) = true];
8081
8082 // Name of package the permission belongs to
8083 optional string package_name = 3;
8084
8085 // The permission to be granted
8086 optional string permission_name = 4;
8087
8088 // The result of the permission grant
8089 optional bool permission_granted = 5;
8090}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008091
8092/**
8093* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8094* Logged from: RuntimePermissionUpdgradeController
8095*/
8096message RuntimePermissionsUpgradeResult {
8097 // Permission granted as result of upgrade
8098 optional string permission_name = 1;
8099
8100 // UID of package granted permission
8101 optional int32 uid = 2 [(is_uid) = true];
8102
8103 // Name of package granted permission
8104 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008105}
8106
8107/**
8108* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8109*/
8110message GrantPermissionsActivityButtonActions {
8111 // Permission granted as result of upgrade
8112 optional string permission_group_name = 1;
8113
8114 // UID of package granted permission
8115 optional int32 uid = 2 [(is_uid) = true];
8116
8117 // Name of package requesting permission
8118 optional string package_name = 3;
8119
8120 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8121 // LABEL_ constants in GrantPermissionActivity.java
8122 optional int32 buttons_presented = 4;
8123
8124 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8125 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008126
8127 // id which identifies single session of user interacting with permission controller
8128 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008129}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008130
8131/**
8132 * Information about LocationAccessCheck notification presented to user
8133 */
8134message LocationAccessCheckNotificationAction {
8135
8136 // id which identifies single session of user interacting with permission controller
8137 optional int64 session_id = 1;
8138
8139 // Uid of package for which location access check is presented
8140 optional int32 package_uid = 2;
8141
8142 // Name of package for which location access check is presented
8143 optional string package_name = 3;
8144
8145 enum Result {
8146 UNDEFINED = 0;
8147 // notification was presented to the user
8148 NOTIFICATION_PRESENTED = 1;
8149 // notification was declined by the user
8150 NOTIFICATION_DECLINED = 2;
8151 // notification was clicked by the user
8152 NOTIFICATION_CLICKED = 3;
8153 }
8154
8155 // View / interaction recorded
8156 optional Result result = 4;
8157}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008158
8159/**
8160 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8161 */
8162message AppPermissionFragmentActionReported {
8163 // id which identifies single session of user interacting with permission controller
8164 optional int64 session_id = 1;
8165
8166 // unique value identifying a permission group change. A permission group change might result
8167 // in multiple of these atoms
8168 optional int64 change_id = 2;
8169
8170 // UID of package the permission belongs to
8171 optional int32 uid = 3 [(is_uid) = true];
8172
8173 // Name of package the permission belongs to
8174 optional string package_name = 4;
8175
8176 // The permission to be granted
8177 optional string permission_name = 5;
8178
8179 // The result of the permission grant
8180 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008181
8182 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8183 optional int32 permission_flags = 7;
8184
8185 enum Button {
8186 UNDEFINED = 0;
8187 // Allow button
8188 ALLOW = 1;
8189 // Deny button
8190 DENY = 2;
8191 // Ask every time button
8192 ASK_EVERY_TIME = 3;
8193 // Allow all the time button
8194 ALLOW_ALWAYS = 4;
8195 // Allow only while using the app button
8196 ALLOW_FOREGROUND = 5;
8197 // Same is Deny button but shown in while in use dialog
8198 DENY_FOREGROUND = 6;
8199 }
8200
8201 // Button pressed in the dialog
8202 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008203}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008204
8205/**
8206* Information about a AppPermissionFragment viewed by user
8207*/
8208message AppPermissionFragmentViewed {
8209 // id which identifies single session of user interacting with permission controller
8210 optional int64 session_id = 1;
8211
8212 // UID of package for which permissions are viewed
8213 optional int32 uid = 2 [(is_uid) = true];
8214
8215 // Name of package for which permissions are viewed
8216 optional string package_name = 3;
8217
8218 // Permission group viewed
8219 optional string permission_group_name = 4;
8220}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008221
8222/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008223* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8224* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008225*/
8226message AppPermissionsFragmentViewed {
8227 // id which identifies single session of user interacting with permission controller
8228 optional int64 session_id = 1;
8229
8230 // id which identifies single view as every view might have several logging records
8231 // with different package information attached
8232 optional int64 view_id = 2;
8233
8234 // Permission group viewed
8235 optional string permission_group_name = 3;
8236
8237 // UID of package for which permissions are viewed
8238 optional int32 uid = 4 [(is_uid) = true];
8239
8240 // Name of package for which permissions are viewed
8241 optional string package_name = 5;
8242
8243 // Category in which permission is included
8244 enum Category {
8245 UNDEFINED = 0;
8246 ALLOWED = 1;
8247 ALLOWED_FOREGROUND = 2;
8248 DENIED = 3;
8249 }
8250 optional Category category = 6;
8251}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008252/**
8253* Information about a PermissionAppsFragment viewed by user.
8254* Logged from ui/handheld/PermissionAppsFragment.java
8255*/
8256message PermissionAppsFragmentViewed {
8257 // id which identifies single session of user interacting with permission controller
8258 optional int64 session_id = 1;
8259
8260 // id which identifies single view as every view might have several logging records
8261 // with different package information attached
8262 optional int64 view_id = 2;
8263
8264 // Permission group viewed
8265 optional string permission_group_name = 3;
8266
8267 // UID of package for which permissions are viewed
8268 optional int32 uid = 4 [(is_uid) = true];
8269
8270 // Name of package for which permissions are viewed
8271 optional string package_name = 5;
8272
8273 // Category in which app is included
8274 enum Category {
8275 UNDEFINED = 0;
8276 ALLOWED = 1;
8277 ALLOWED_FOREGROUND = 2;
8278 DENIED = 3;
8279 }
8280 optional Category category = 6;
8281}
Tony Make2b1b672019-07-29 16:59:47 +01008282
8283/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008284* Log that the Auto Revoke notification has been clicked
8285* Logged from ui/ManagePermissionsActivity
8286*/
8287message AutoRevokeNotificationClicked {
8288 // id which identifies single session of user interacting with permission controller
8289 optional int64 session_id = 1;
8290}
8291
8292/**
8293* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8294* auto revoked for it.
8295* Logged from ui/handheld/AutoRevokeFragment
8296*/
8297message AutoRevokeFragmentAppViewed {
8298 // id which identifies single session of user interacting with permission controller
8299 optional int64 session_id = 1;
8300
8301 // UID of package for which permissions are viewed
8302 optional int32 uid = 2 [(is_uid) = true];
8303
8304 // Name of package for which permissions are viewed
8305 optional string package_name = 3;
8306
8307 // The name of a permission group that has been revoked
8308 optional string permission_group_name = 4;
8309
8310 // The age of the app- more than three months old, or more than six months
8311 enum Age {
8312 UNDEFINED = 0;
8313 NEWER_BUCKET = 1;
8314 OLDER_BUCKET = 2;
8315 }
8316
8317 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8318 optional Age age = 5;
8319}
8320
8321/**
8322* Log that the user has interacted with an app on the auto revoke fragment
8323* Logged from ui/handheld/AutoRevokeFragment
8324*/
8325message AutoRevokedAppInteraction {
8326 // id which identifies single session of user interacting with permission controller
8327 optional int64 session_id = 1;
8328
8329 // UID of package for which permissions are viewed
8330 optional int32 uid = 2 [(is_uid) = true];
8331
8332 // Name of package for which permissions are viewed
8333 optional string package_name = 3;
8334
8335 enum Action {
8336 UNDEFINED = 0;
8337 REMOVE = 1;
8338 OPEN = 2;
8339 APP_INFO = 3;
8340 PERMISSIONS = 4;
8341 REMOVE_IN_SETTINGS = 5;
8342 OPEN_IN_SETTINGS = 6;
8343 }
8344
8345 // The action the user took to interact with the app
8346 optional Action action = 4;
8347}
8348
8349/**
8350* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8351* auto revoke, or that the auto revoke switch has been changed
8352* Logged from ui/handheld/AppPermissionGroupsFragment
8353 */
8354message AppPermissionGroupsFragmentAutoRevokeAction {
8355 // id which identifies single session of user interacting with permission controller
8356 optional int64 session_id = 1;
8357
8358 // UID of package for which permissions are viewed
8359 optional int32 uid = 2 [(is_uid) = true];
8360
8361 // Name of package for which permissions are viewed
8362 optional string package_name = 3;
8363
8364 enum Action {
8365 UNDEFINED = 0;
8366 OPENED_FOR_AUTO_REVOKE = 1;
8367 OPENED_FROM_INTENT = 2;
8368 SWITCH_ENABLED = 3;
8369 SWITCH_DISABLED = 4;
8370 }
8371
8372 // The action the user took to interact with the fragment
8373 optional Action action = 4;
8374}
8375
8376/**
Tony Make2b1b672019-07-29 16:59:47 +01008377 * Logs when there is a smart selection related event.
8378 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8379 * Logged from: TextClassifierEventLogger.java
8380 */
8381message TextSelectionEvent {
8382 // A session ID.
8383 optional string session_id = 1;
8384
8385 // Event type of this event.
8386 optional android.stats.textclassifier.EventType event_type = 2;
8387
Tony Mak9c84bd22019-12-09 07:27:25 +00008388 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008389 optional string model_name = 3;
8390
8391 // Type of widget that was involved in triggering this event.
8392 optional android.stats.textclassifier.WidgetType widget_type = 4;
8393
8394 // Index of this event in a session.
8395 optional int32 event_index = 5;
8396
8397 // Entity type that is involved.
8398 optional string entity_type = 6;
8399
8400 // Relative word index of the start of the selection.
8401 optional int32 relative_word_start_index = 7;
8402
8403 // Relative word (exclusive) index of the end of the selection.
8404 optional int32 relative_word_end_index = 8;
8405
8406 // Relative word index of the start of the smart selection.
8407 optional int32 relative_suggested_word_start_index = 9;
8408
8409 // Relative word (exclusive) index of the end of the smart selection.
8410 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008411
8412 // Name of source package.
8413 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008414
8415 // Name of the LangID model that is involved in this event.
8416 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008417}
8418
8419/**
8420 * Logs when there is a smart linkify related event.
8421 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8422 * Logged from: TextClassifierEventLogger.java
8423 */
8424message TextLinkifyEvent {
8425 // A session ID.
8426 optional string session_id = 1;
8427
8428 // Event type of this event.
8429 optional android.stats.textclassifier.EventType event_type = 2;
8430
Tony Mak9c84bd22019-12-09 07:27:25 +00008431 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008432 optional string model_name = 3;
8433
8434 // Type of widget that was involved in triggering this event.
8435 optional android.stats.textclassifier.WidgetType widget_type = 4;
8436
8437 // Index of this event in a session.
8438 optional int32 event_index = 5;
8439
8440 // Entity type that is involved.
8441 optional string entity_type = 6;
8442
8443 // Number of links detected.
8444 optional int32 num_links = 7;
8445
8446 // The total length of all links.
8447 optional int32 linked_text_length = 8;
8448
8449 // Length of input text.
8450 optional int32 text_length = 9;
8451
8452 // Time spent on generating links in ms.
8453 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008454
8455 // Name of source package.
8456 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008457
8458 // Name of the LangID model that is involved in this event.
8459 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008460}
8461
8462/**
8463 * Logs when there is a conversation actions related event.
8464 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8465 * Logged from: TextClassifierEventLogger.java
8466 */
8467message ConversationActionsEvent {
8468 // A session ID.
8469 optional string session_id = 1;
8470
8471 // Event type of this event.
8472 optional android.stats.textclassifier.EventType event_type = 2;
8473
Tony Mak9c84bd22019-12-09 07:27:25 +00008474 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008475 optional string model_name = 3;
8476
8477 // Type of widget that was involved in triggering this event.
8478 optional android.stats.textclassifier.WidgetType widget_type = 4;
8479
8480 // The first entity type that is involved.
8481 optional string first_entity_type = 5;
8482
8483 // The second entity type that is involved.
8484 optional string second_entity_type = 6;
8485
8486 // The third entity type that is involved.
8487 optional string third_entity_type = 7;
8488
8489 // The score of the first entity type.
8490 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008491
8492 // Name of source package.
8493 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008494
8495 // Name of the annotator model that is involved in this event.
8496 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008497
8498 // Name of the LangID model that is involved in this event.
8499 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008500}
8501
8502/**
8503 * Logs when there is a language detection related event.
8504 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8505 * Logged from: TextClassifierEventLogger.java
8506 */
8507message LanguageDetectionEvent {
8508 // A session ID.
8509 optional string session_id = 1;
8510
8511 // Event type of this event.
8512 optional android.stats.textclassifier.EventType event_type = 2;
8513
Tony Mak9c84bd22019-12-09 07:27:25 +00008514 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008515 optional string model_name = 3;
8516
8517 // Type of widget that was involved in triggering this event.
8518 optional android.stats.textclassifier.WidgetType widget_type = 4;
8519
8520 // Detected language.
8521 optional string language_tag = 5;
8522
8523 // Score of the detected language.
8524 optional float score = 6;
8525
8526 // Position of this action.
8527 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008528
8529 // Name of source package.
8530 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008531}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008532
8533/**
8534 * Information about an OTA update attempt by update_engine.
8535 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8536 */
8537message UpdateEngineUpdateAttemptReported {
8538 // The number of attempts for the update engine to apply a given payload.
8539 optional int32 attempt_number = 1;
8540
8541 optional android.stats.otaupdate.PayloadType payload_type = 2;
8542
8543 // The total time in minutes for the update engine to apply a given payload.
8544 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8545 // it's increased when the system is sleeping.
8546 optional int32 duration_boottime_in_minutes = 3;
8547
8548 // The total time in minutes for the update engine to apply a given payload.
8549 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8550 // and it's not increased when the system is sleeping.
8551 optional int32 duration_monotonic_in_minutes = 4;
8552
8553 // The size of the payload in MiBs.
8554 optional int32 payload_size_mib = 5;
8555
8556 // The attempt result reported by the update engine for an OTA update.
8557 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8558
8559 // The error code reported by the update engine after an OTA update attempt
8560 // on A/B devices.
8561 optional android.stats.otaupdate.ErrorCode error_code = 7;
8562
8563 // The build fingerprint of the source system. The value is read from a
8564 // system property when the device takes the update. e.g.
8565 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8566 optional string source_fingerprint = 8;
8567}
8568
8569/**
8570 * Information about all the attempts the device make before finishing the
8571 * successful update.
8572 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8573 */
8574message UpdateEngineSuccessfulUpdateReported {
8575 // The number of attempts for the update engine to apply the payload for a
8576 // successful update.
8577 optional int32 attempt_count = 1;
8578
8579 optional android.stats.otaupdate.PayloadType payload_type = 2;
8580
8581 optional int32 payload_size_mib = 3;
8582
8583 // The total number of bytes downloaded by update_engine since the last
8584 // successful update.
8585 optional int32 total_bytes_downloaded_mib = 4;
8586
8587 // The ratio in percentage of the over-downloaded bytes compared to the
8588 // total bytes needed to successfully install the update. e.g. 200 if we
8589 // download 200MiB in total for a 100MiB package.
8590 optional int32 download_overhead_percentage = 5;
8591
8592 // The total time in minutes for the update engine to apply the payload for a
8593 // successful update.
8594 optional int32 total_duration_minutes = 6;
8595
8596 // The number of reboot of the device during a successful update.
8597 optional int32 reboot_count = 7;
8598}
Alec Mourie088e762019-07-02 13:10:55 -07008599
8600/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008601 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8602 * key to indicate whether it was successful or not.
8603 *
8604 * Logged from:
8605 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8606 */
8607message RebootEscrowRecoveryReported {
8608 optional bool successful = 1;
8609}
8610
8611/**
Alec Mourie088e762019-07-02 13:10:55 -07008612 * Global display pipeline metrics reported by SurfaceFlinger.
8613 * Pulled from:
8614 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8615 */
8616message SurfaceflingerStatsGlobalInfo {
8617 // Total number of frames presented during the tracing period
8618 optional int64 total_frames = 1;
8619 // Total number of frames missed
8620 optional int64 missed_frames = 2;
8621 // Total number of frames that fell back to client composition
8622 optional int64 client_composition_frames = 3;
8623 // Total time the display was turned on
8624 optional int64 display_on_millis = 4;
8625 // Total time that was spent performing animations.
8626 // This is derived from the present-to-present layer histogram
8627 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008628 // Total number of event connections tracked by SurfaceFlinger at the time
8629 // of this pull. If this number grows prohibitively large, then this can
8630 // cause jank due to resource contention.
8631 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008632 // Set of timings measured from when SurfaceFlinger began compositing a
8633 // frame, until the frame was requested to be presented to the display. This
8634 // measures SurfaceFlinger's total CPU walltime on the critical path per
8635 // frame.
8636 optional FrameTimingHistogram frame_duration = 7
8637 [(android.os.statsd.log_mode) = MODE_BYTES];
8638 // Set of timings measured from when SurfaceFlinger first began using the
8639 // GPU to composite a frame, until the GPU has finished compositing that
8640 // frame. This measures the total additional time SurfaceFlinger needed to
8641 // perform due to falling back into GPU composition.
8642 optional FrameTimingHistogram render_engine_timing = 8
8643 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008644}
8645
8646/**
8647 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8648 * The number of layers uploaded will be restricted due to size limitations.
8649 * Pulled from:
8650 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8651 */
8652message SurfaceflingerStatsLayerInfo {
8653 // The layer for this set of metrics
8654 // For now we can infer that the package name is included in the layer
8655 // name.
8656 optional string layer_name = 1;
8657 // Total number of frames presented
8658 optional int64 total_frames = 2;
8659 // Total number of dropped frames while latching a buffer for this layer.
8660 optional int64 dropped_frames = 3;
8661 // Set of timings measured between successive presentation timestamps.
8662 optional FrameTimingHistogram present_to_present = 4
8663 [(android.os.statsd.log_mode) = MODE_BYTES];
8664 // Set of timings measured from when an app queued a buffer for
8665 // presentation, until the buffer was actually presented to the
8666 // display.
8667 optional FrameTimingHistogram post_to_present = 5
8668 [(android.os.statsd.log_mode) = MODE_BYTES];
8669 // Set of timings measured from when a buffer is ready to be presented,
8670 // until the buffer was actually presented to the display.
8671 optional FrameTimingHistogram acquire_to_present = 6
8672 [(android.os.statsd.log_mode) = MODE_BYTES];
8673 // Set of timings measured from when a buffer was latched by
8674 // SurfaceFlinger, until the buffer was presented to the display
8675 optional FrameTimingHistogram latch_to_present = 7
8676 [(android.os.statsd.log_mode) = MODE_BYTES];
8677 // Set of timings measured from the desired presentation to the actual
8678 // presentation time
8679 optional FrameTimingHistogram desired_to_present = 8
8680 [(android.os.statsd.log_mode) = MODE_BYTES];
8681 // Set of timings measured from when an app queued a buffer for
8682 // presentation, until the buffer was ready to be presented.
8683 optional FrameTimingHistogram post_to_acquire = 9
8684 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008685 // Frames missed latch because the acquire fence didn't fire
8686 optional int64 late_acquire_frames = 10;
8687 // Frames latched early because the desired present time was bad
8688 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008689}
8690
8691/**
8692 * Histogram of frame counts bucketed by time in milliseconds.
8693 * Because of size limitations, we hard-cap the number of buckets, with
8694 * buckets for corresponding to larger milliseconds being less precise.
8695 */
8696message FrameTimingHistogram {
8697 // Timings in milliseconds that describes a set of histogram buckets
8698 repeated int32 time_millis_buckets = 1;
8699 // Number of frames that match to each time_millis, i.e. the bucket
8700 // contents
8701 // It's required that len(time_millis) == len(frame_count)
8702 repeated int64 frame_counts = 2;
8703}
Emilian Peev6729f372019-08-29 09:14:09 -07008704
Emilian Peev6729f372019-08-29 09:14:09 -07008705/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008706 * Janky event as reported by SurfaceFlinger.
8707 * This event is intended to be consumed by a Perfetto subscriber for
8708 * automated trace collection.
8709 *
8710 * Logged from:
8711 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8712 */
8713message DisplayJankReported {
8714 // Informational field for how long the janky event lasted in milliseconds
8715 optional int64 event_duration_millis = 1;
8716 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8717 // the display on time.
8718 optional int32 present_deadlines_missed = 2;
8719}
8720
8721/**
Emilian Peev6729f372019-08-29 09:14:09 -07008722 * Information about camera facing and API level usage.
8723 * Logged from:
8724 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8725 */
8726message CameraActionEvent {
8727 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008728 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008729
8730 // Camera API level used
8731 optional int32 api_level = 2;
8732
8733 // Name of client package
8734 optional string package_name = 3;
8735
8736 // Camera facing
8737 enum Facing {
8738 UNKNOWN = 0;
8739 BACK = 1;
8740 FRONT = 2;
8741 EXTERNAL = 3;
8742 }
8743 optional Facing facing = 4;
8744}
atrost01a20932019-08-28 15:40:37 +01008745
8746/**
8747 * Logs when a compatibility change is affecting an app.
8748 *
8749 * Logged from:
8750 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8751 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8752 */
8753message AppCompatibilityChangeReported {
8754 // The UID of the app being affected by the compatibilty change.
8755 optional int32 uid = 1 [(is_uid) = true];
8756
8757 // The ID of the change affecting the app.
8758 optional int64 change_id = 2;
8759
8760 enum State {
8761 UNKNOWN_STATE = 0;
8762 ENABLED = 1;
8763 DISABLED = 2;
8764 LOGGED = 3;
8765 }
8766
8767 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8768 // logged otherwise.
8769 optional State state = 3;
8770
8771 enum Source {
8772 UNKNOWN_SOURCE = 0;
8773 APP_PROCESS = 1;
8774 SYSTEM_SERVER = 2;
8775 }
8776
8777 // Where it was logged from.
8778 optional Source source = 4;
8779
8780}
Hector Dearman40579f62019-11-01 13:19:30 +00008781
8782/**
8783 * Logged from
8784 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8785 */
8786message PerfettoUploaded {
8787 enum Event {
8788 PERFETTO_UNDEFINED = 0;
8789 PERFETTO_TRACE_BEGIN = 1;
8790 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8791 PERFETTO_ON_CONNECT = 3;
8792 PERFETTO_ON_TRACING_DISABLED = 4;
8793 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8794 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8795 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8796 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8797 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8798 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8799 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8800 PERFETTO_TRIGGER_BEGIN = 12;
8801 PERFETTO_TRIGGER_SUCCESS = 13;
8802 PERFETTO_TRIGGER_FAILURE = 14;
8803 PERFETTO_HIT_GUARDRAILS = 15;
8804 PERFETTO_ON_TIMEOUT = 16;
8805 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8806 }
8807
8808 // Which stage of the pipeline we are reporting from.
8809 optional Event event = 1;
8810
8811 // UUID matching the one set inside the SystemInfo trace packet.
8812 optional int64 trace_uuid_lsb = 2;
8813 optional int64 trace_uuid_msb = 3;
8814}
Mark Tabrya824a642019-11-05 12:26:12 -08008815
8816/**
8817 * Pulls client metrics on data transferred via Vehicle Maps Service.
8818 * Metrics are keyed by uid + layer.
8819 *
8820 * Pulled from:
8821 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8822 */
8823message VmsClientStats {
8824 // UID of the VMS client app
8825 optional int32 uid = 1 [(is_uid) = true];
8826
8827 // VMS layer definition
8828 optional int32 layer_type = 2;
8829 optional int32 layer_channel = 3;
8830 optional int32 layer_version = 4;
8831
8832 // Bytes and packets sent by the client for the layer
8833 optional int64 tx_bytes = 5;
8834 optional int64 tx_packets = 6;
8835
8836 // Bytes and packets received by the client for the layer
8837 optional int64 rx_bytes = 7;
8838 optional int64 rx_packets = 8;
8839
8840 // Bytes and packets dropped due to client error
8841 optional int64 dropped_bytes = 9;
8842 optional int64 dropped_packets = 10;
8843}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008844
8845/**
8846 * State of a dangerous permission requested by a package - sampled
8847 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8848*/
8849message DangerousPermissionStateSampled {
8850 // Name of the permission
8851 optional string permission_name = 1;
8852
8853 // Uid of the package
8854 optional int32 uid = 2 [(is_uid) = true];
8855
8856 // If the permission is granted to the uid
8857 optional bool is_granted = 3;
8858
8859 // Permission flags as per android.content.pm.PermissionFlags
8860 optional int32 permission_flags = 4;
8861}
8862
Stan Iliev637ba5e2019-08-16 13:43:08 -04008863/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008864 * HWUI stats for a given app.
8865 */
8866message GraphicsStats {
8867 // The package name of the app
8868 optional string package_name = 1;
8869
8870 // The version code of the app
8871 optional int64 version_code = 2;
8872
8873 // The start & end timestamps in UTC as
8874 // milliseconds since January 1, 1970
8875 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008876 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008877
Stan Ilievb6517192020-02-18 10:12:42 -05008878 optional int64 end_millis = 4;
8879
8880 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8881 enum PipelineType {
8882 UNKNOWN = 0;
8883 GL = 1;
8884 VULKAN = 2;
8885 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008886
8887 // HWUI renders pipeline type: GL or Vulkan.
8888 optional PipelineType pipeline = 5;
8889
8890 // Distinct frame count.
8891 optional int32 total_frames = 6;
8892
8893 // Number of "missed vsync" events.
8894 optional int32 missed_vsync_count = 7;
8895
8896 // Number of frames in triple-buffering scenario (high input latency)
8897 optional int32 high_input_latency_count = 8;
8898
8899 // Number of "slow UI thread" events.
8900 optional int32 slow_ui_thread_count = 9;
8901
8902 // Number of "slow bitmap upload" events.
8903 optional int32 slow_bitmap_upload_count = 10;
8904
8905 // Number of "slow draw" events.
8906 optional int32 slow_draw_count = 11;
8907
8908 // Number of frames that missed their deadline (aka, visibly janked)
8909 optional int32 missed_deadline_count = 12;
8910
8911 // The frame time histogram for the package
8912 optional FrameTimingHistogram cpu_histogram = 13
8913 [(android.os.statsd.log_mode) = MODE_BYTES];
8914
8915 // The gpu frame time histogram for the package
8916 optional FrameTimingHistogram gpu_histogram = 14
8917 [(android.os.statsd.log_mode) = MODE_BYTES];
8918
8919 // UI mainline module version.
8920 optional int64 version_ui_module = 15;
8921
8922 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8923 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8924 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8925 // more apps are running / rendering.
8926 optional bool is_today = 16;
8927}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008928
8929/**
8930 * Message related to dangerous (runtime) app ops access
8931 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008932message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008933 // Uid of the package accessing app op
8934 optional int32 uid = 1 [(is_uid) = true];
8935
8936 // Name of the package accessing app op
8937 optional string package_name = 2;
8938
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008939 // deprecated - set to empty string
8940 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008941
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008942 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008943 // API. Attributions must be provided through manifest using <attribution> tag available in R
8944 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008945 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008946
8947 // message related to app op access, limited to 600 chars by API
8948 optional string message = 5;
8949
8950 enum SamplingStrategy {
8951 DEFAULT = 0;
8952 UNIFORM = 1;
8953 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008954 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008955 }
8956
8957 // sampling strategy used to collect this message
8958 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008959
8960 // operation id
8961 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008962}
8963
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008964/*
8965 * Logs userspace reboot outcome and duration.
8966 *
8967 * Logged from:
8968 * frameworks/base/core/java/com/android/server/BootReceiver.java
8969 */
8970message UserspaceRebootReported {
8971 // Possible outcomes of userspace reboot.
8972 enum Outcome {
8973 // Default value in case platform failed to determine the outcome.
8974 OUTCOME_UNKNOWN = 0;
8975 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8976 SUCCESS = 1;
8977 // Userspace reboot shutdown sequence was aborted.
8978 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8979 // Remounting userdata into checkpointing mode failed.
8980 FAILED_USERDATA_REMOUNT = 3;
8981 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8982 // reboot.
8983 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8984 }
8985 // Outcome of userspace reboot. Always set.
8986 optional Outcome outcome = 1;
8987 // Duration of userspace reboot in case it has a successful outcome.
8988 // Duration is measured as time between userspace reboot was initiated and until boot completed
8989 // (e.g. sys.boot_completed=1).
8990 optional int64 duration_millis = 2;
8991 // State of primary user's (user0) credential encryption storage.
8992 enum UserEncryptionState {
8993 // Default value.
8994 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8995 // Credential encrypted storage is unlocked.
8996 UNLOCKED = 1;
8997 // Credential encrypted storage is locked.
8998 LOCKED = 2;
8999 }
9000 // State of primary user's encryption storage at the moment boot completed. Always set.
9001 optional UserEncryptionState user_encryption_state = 3;
9002}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009003
9004/*
9005 * Logs integrity check information during each install.
9006 *
9007 * Logged from:
9008 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9009 */
9010message IntegrityCheckResultReported {
9011 optional string package_name = 1;
9012 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009013 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009014 optional string installer_package_name = 4;
9015 enum Response {
9016 UNKNOWN = 0;
9017 ALLOWED = 1;
9018 REJECTED = 2;
9019 FORCE_ALLOWED = 3;
9020 }
9021 optional Response response = 5;
9022 // An estimate on the cause of the response. This will only be populated for
9023 // REJECTED and FORCE_ALLOWED
9024 optional bool caused_by_app_cert_rule = 6;
9025 optional bool caused_by_installer_rule = 7;
9026}
9027
9028/**
9029 * Logs the information about the rules and the provider whenever rules are
9030 * pushed into AppIntegrityManager.
9031 *
9032 * Logged from:
9033 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9034 */
9035message IntegrityRulesPushed {
9036 optional bool success = 1;
9037 // Package name of the app that pushed the rules.
9038 optional string rule_provider = 2;
9039 // Version string of arbitrary format provided by the rule provider to
9040 // identify the rules.
9041 optional string rule_version = 3;
9042}
Jordan Liubedfa702019-12-20 15:08:45 -08009043
9044/**
9045 * Logs when a cell broadcast message is received on the device.
9046 *
9047 * Logged from CellBroadcastService module:
9048 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9049 */
9050message CellBroadcastMessageReported {
9051 // The type of Cell Broadcast message
9052 enum CbType {
9053 UNKNOWN_TYPE = 0;
9054 GSM = 1;
9055 CDMA = 2;
9056 CDMA_SPC = 3;
9057 }
9058
9059 // GSM, CDMA, CDMA-SCP
9060 optional CbType type = 1;
9061}
9062
9063/**
9064 * Logs when an error occurs while handling a cell broadcast message;
9065 *
9066 * Logged from CellBroadcastService module:
9067 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9068 */
9069message CellBroadcastMessageError {
9070 // The type of error raised when trying to handle a cell broadcast message
9071 enum ErrorType {
9072 UNKNOWN_TYPE = 0;
9073 CDMA_DECODING_ERROR = 1;
9074 CDMA_SCP_EMPTY = 2;
9075 CDMA_SCP_HANDLING_ERROR = 3;
9076 GSM_INVALID_HEADER_LENGTH = 4;
9077 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9078 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9079 GSM_INVALID_PDU = 7;
9080 GSM_INVALID_GEO_FENCING_DATA = 8;
9081 GSM_UMTS_INVALID_WAC = 9;
9082 FAILED_TO_INSERT_TO_DB = 10;
9083 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9084 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9085 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9086 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9087 }
9088
9089 // What kind of error occurred
9090 optional ErrorType type = 1;
9091
9092 // Exception message (or log message) associated with the error (max 1000 chars)
9093 optional string exception_message = 2;
9094}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009095
9096/**
9097 * Logs when the SDK Extensions test app has polled the current version.
9098 * This is atom ID 354.
9099 *
9100 * Logged from:
9101 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
9102 */
9103message SdkExtensionStatus {
9104 enum ApiCallStatus {
9105 CALL_NOT_ATTEMPTED = 0;
9106 CALL_SUCCESSFUL = 1;
9107 CALL_FAILED = 2;
9108 }
9109
9110 optional ApiCallStatus result = 1;
9111
9112 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9113 optional int32 r_extension_version = 2;
9114
9115 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9116 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9117 optional int32 failed_call_symbol = 3;
9118}
Marco Ballesio497aff42020-01-24 08:39:42 -08009119
9120/**
9121 * Logs when an app is frozen or unfrozen.
9122 *
9123 * Logged from:
9124 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9125 */
9126message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009127 // The type of event.
9128 enum Action {
9129 UNKNOWN = 0;
9130 FREEZE_APP = 1;
9131 UNFREEZE_APP = 2;
9132 }
9133 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009134
Blake Kragten6ce382a2020-01-16 20:20:46 -08009135 // Pid of the process being frozen.
9136 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009137
Blake Kragten6ce382a2020-01-16 20:20:46 -08009138 // Name of the process being frozen.
9139 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009140
Blake Kragten6ce382a2020-01-16 20:20:46 -08009141 // Time since last unfrozen.
9142 optional int64 time_unfrozen_millis = 4;
9143}
9144
9145/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009146 * Pulls information for a single voice call.
9147 *
9148 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9149 *
9150 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009151 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009152 */
9153message VoiceCallSession {
9154 // Bearer (IMS or CS) when the call started.
9155 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9156
9157 // Bearer (IMS or CS) when the call ended.
9158 // The bearer may change during the call, e.g. due to SRVCC.
9159 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9160
9161 // Direction of the call (incoming or outgoing).
9162 optional android.telephony.CallDirectionEnum direction = 3;
9163
9164 // Time spent setting up the call.
9165 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9166
9167 // Whether the call ended before the setup was completed.
9168 optional bool setup_failed = 5;
9169
9170 // IMS reason code or CS disconnect cause.
9171 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9172 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9173 optional int32 disconnect_reason_code = 6;
9174
9175 // IMS extra code or CS precise disconnect cause.
9176 // For IMS, this code is vendor-specific
9177 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9178 optional int32 disconnect_extra_code = 7;
9179
9180 // IMS extra message or CS vendor cause.
9181 optional string disconnect_extra_message = 8;
9182
9183 // Radio access technology (RAT) used when call started.
9184 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9185
9186 // Radio access technology (RAT) used when call terminated.
9187 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9188
9189 // Number of times RAT changed during the call.
9190 optional int64 rat_switch_count = 11;
9191
9192 // A bitmask of all codecs used during the call.
9193 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9194 optional int64 codec_bitmask = 12;
9195
9196 // Number of other calls going on during call setup, for the same SIM slot.
9197 optional int32 concurrent_call_count_at_start = 13;
9198
9199 // Number of other calls going on during call termination, for the same SIM slot.
9200 optional int32 concurrent_call_count_at_end = 14;
9201
9202 // Index of the SIM is used, 0 for single-SIM devices.
9203 optional int32 sim_slot_index = 15;
9204
9205 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9206 optional bool is_multi_sim = 16;
9207
9208 // Whether the call was made with an eSIM profile.
9209 optional bool is_esim = 17;
9210
9211 // Carrier ID of the SIM card.
9212 // See https://source.android.com/devices/tech/config/carrierid.
9213 optional int32 carrier_id = 18;
9214
Chi Zhangba1b03a2020-04-21 17:17:56 -07009215 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009216 optional bool srvcc_completed = 19;
9217
9218 // Number of SRVCC failures.
9219 optional int64 srvcc_failure_count = 20;
9220
9221 // Number of SRVCC cancellations.
9222 optional int64 srvcc_cancellation_count = 21;
9223
Chi Zhangba1b03a2020-04-21 17:17:56 -07009224 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9225 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009226 optional bool rtt_enabled = 22;
9227
9228 // Whether this was an emergency call.
9229 optional bool is_emergency = 23;
9230
9231 // Whether the call was performed while roaming.
9232 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009233
9234 // A random number used as the dimension field to pull multiple atoms.
9235 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009236}
9237
9238/**
9239 * Pulls voice call radio access technology (RAT) usage.
9240 *
9241 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9242 * time. The atom will be skipped if not enough data is available.
9243 *
9244 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009245 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009246 */
9247message VoiceCallRatUsage {
9248 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9249 optional int32 carrier_id = 1;
9250
9251 // Radio access technology.
9252 optional android.telephony.NetworkTypeEnum rat = 2;
9253
9254 // Total duration that voice calls spent on this carrier and RAT.
9255 optional int64 total_duration_seconds = 3;
9256
9257 // Total number of calls using this carrier and RAT.
9258 // A call is counted once even if it used the RAT multiple times.
9259 optional int64 call_count = 4;
9260}
9261
9262/**
9263 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9264 *
9265 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009266 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009267 */
9268message SimSlotState {
9269 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9270 optional int32 active_slot_count = 1;
9271
9272 // Number of SIM cards (both physical and active eSIM profiles).
9273 // This number is always equal to or less than the number of active SIM slots.
9274 optional int32 sim_count = 2;
9275
9276 // Number of active eSIM profiles.
9277 // This number is always equal to or less than the number of SIMs.
9278 optional int32 esim_count = 3;
9279}
9280
9281/**
9282 * Pulls supported cellular radio access technologies.
9283 *
9284 * This atom reports the capabilities of the device, rather than the network it has access to.
9285 *
9286 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009287 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009288 */
9289message SupportedRadioAccessFamily {
9290 // A bitmask of supported radio technologies.
9291 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9292 optional int64 network_type_bitmask = 1;
9293}
9294
9295/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009296 * Logs gnss stats from location service provider
9297 *
9298 * Pulled from:
9299 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9300 */
9301
9302message GnssStats {
9303 // Number of location reports since boot
9304 optional int64 location_reports = 1;
9305
9306 // Total pulled reports of Location failures since boot
9307 optional int64 location_failure_reports = 2;
9308
9309 // Number of time to first fix reports since boot
9310 optional int64 time_to_first_fix_reports = 3;
9311
9312 // Total pulled reported time to first fix (in milli-seconds) since boot
9313 optional int64 time_to_first_fix_milli_s = 4;
9314
9315 // Number of position accuracy reports since boot
9316 optional int64 position_accuracy_reports = 5;
9317
9318 // Total pulled reported position accuracy (in meters) since boot
9319 optional int64 position_accuracy_meters = 6;
9320
9321 // Number of top 4 average CN0 reports since boot
9322 optional int64 top_four_average_cn0_reports = 7;
9323
9324 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9325 optional int64 top_four_average_cn0_db_mhz = 8;
9326
9327 // Number of l5 top 4 average CN0 reports since boot
9328 optional int64 l5_top_four_average_cn0_reports = 9;
9329
9330 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9331 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9332
9333 // Total number of sv status messages reports since boot
9334 optional int64 sv_status_reports = 11;
9335
9336 // Total number of sv status messages reports, where sv is used in fix since boot
9337 optional int64 sv_status_reports_used_in_fix = 12;
9338
9339 // Total number of L5 sv status messages reports since boot
9340 optional int64 l5_sv_status_reports = 13;
9341
9342 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9343 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009344}
Kweku Adams12752132020-02-18 15:36:48 -08009345
9346/**
9347 * Logs when an app is moved to a different standby bucket.
9348 *
9349 * Logged from:
9350 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9351 */
9352message AppStandbyBucketChanged {
9353 optional string package_name = 1;
9354
9355 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9356 optional int32 user_id = 2;
9357
9358 // These enum values match the constants defined in UsageStatsManager.java.
9359 enum Bucket {
9360 BUCKET_UNKNOWN = 0;
9361 BUCKET_EXEMPTED = 5;
9362 BUCKET_ACTIVE = 10;
9363 BUCKET_WORKING_SET = 20;
9364 BUCKET_FREQUENT = 30;
9365 BUCKET_RARE = 40;
9366 BUCKET_RESTRICTED = 45;
9367 BUCKET_NEVER = 50;
9368 }
9369 optional Bucket bucket = 3;
9370
9371 enum MainReason {
9372 MAIN_UNKNOWN = 0;
9373 MAIN_DEFAULT = 0x0100;
9374 MAIN_TIMEOUT = 0x0200;
9375 MAIN_USAGE = 0x0300;
9376 MAIN_FORCED_BY_USER = 0x0400;
9377 MAIN_PREDICTED = 0x0500;
9378 MAIN_FORCED_BY_SYSTEM = 0x0600;
9379 }
9380 optional MainReason main_reason = 4;
9381
9382 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9383 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9384 // UsageStatsManager.java.
9385 optional int32 sub_reason = 5;
9386}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009387
9388/**
9389* Reports a started sharesheet transaction.
9390*
9391* Logged from:
9392* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9393*/
9394message SharesheetStarted {
9395 // The event_id (as for UiEventReported).
9396 optional int32 event_id = 1;
9397 // The calling app's package name.
9398 optional string package_name = 2;
9399 // An identifier to tie together multiple logs relating to the same share event
9400 optional int32 instance_id = 3;
9401 // The mime type of the share
9402 optional string mime_type = 4;
9403 // The number of direct targets the calling app is providing that will be shown.
9404 optional int32 num_app_provided_direct_targets = 5;
9405 // The number of app targets the calling app is providing that will be shown.
9406 optional int32 num_app_provided_app_targets = 6;
9407 // True if the share originates from the workprofile
9408 optional bool is_workprofile = 7;
9409
9410 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009411 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009412 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9413 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9414 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9415 }
9416 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009417 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009418
9419 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9420 INTENT_DEFAULT = 0;
9421 INTENT_ACTION_VIEW = 1;
9422 INTENT_ACTION_EDIT = 2;
9423 INTENT_ACTION_SEND = 3;
9424 INTENT_ACTION_SENDTO = 4;
9425 INTENT_ACTION_SEND_MULTIPLE = 5;
9426 INTENT_ACTION_IMAGE_CAPTURE = 6;
9427 INTENT_ACTION_MAIN = 7;
9428 }
9429 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009430 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009431}
9432
9433/**
9434 * Reports a ranking selection event.
9435 *
9436 * Logged from:
9437 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9438 */
9439message RankingSelected {
9440 // The event_id (as for UiEventReported).
9441 optional int32 event_id = 1;
9442 // The relevant app's package name (can be source or picked package).
9443 optional string package_name = 2;
9444 // An identifier to tie together multiple logs relating to the same share event.
9445 optional int32 instance_id = 3;
9446 // Which of the ranked targets got picked, default starting position 0.
9447 optional int32 position_picked = 4;
9448}
Raff Tsaiea4db182020-03-06 07:45:43 +08009449
9450/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009451 * Logs when TvSettings UI is interacted at.
9452 *
9453 * Logged from: packages/apps/TvSettings
9454 */
9455message TvSettingsUIInteracted {
9456
9457 /** The UI action category */
9458 optional android.app.tvsettings.Action action = 1;
9459
9460 /** The ID of the entry that the users actioned on */
9461 optional android.app.tvsettings.ItemId item_id = 2;
9462
9463 /** Additional information (e.g., navigation direction on page focused) */
9464 optional string additional_info = 3;
9465}
9466
9467/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009468 * Logs information about a package installation using package installer V2 APIs.
9469 *
9470 * Logged from:
9471 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9472 */
9473message PackageInstallerV2Reported {
9474 // Whether this installation uses Incremental File System
9475 optional bool is_incremental = 1;
9476 // Name of the package that is intended to be installed
9477 optional string package_name = 2;
9478 // The duration between when the install was requested to when the install has completed
9479 optional int64 duration_millis = 3;
9480 // Installation result in final integer, which are SystemApi's.
9481 // Return_code 1 indicates success.
9482 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9483 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009484 // Total size of the APKs installed for this package
9485 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009486}
9487
9488/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009489 * Logs settings provider values.
9490 *
9491 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9492 * then write the value to proto.
9493 *
9494 */
9495message SettingSnapshot {
9496
9497 // Setting key
9498 optional string name = 1;
9499
9500 enum SettingsValueType {
9501 NOTASSIGNED = 0;
9502 ASSIGNED_BOOL_TYPE = 1;
9503 ASSIGNED_INT_TYPE = 2;
9504 ASSIGNED_FLOAT_TYPE = 3;
9505 ASSIGNED_STRING_TYPE = 4;
9506 };
9507 // Setting value type
9508 optional SettingsValueType type = 2;
9509
9510 optional bool bool_value = 3;
9511
9512 optional int32 int_value = 4;
9513
9514 optional float float_value = 5;
9515
9516 optional string str_value = 6;
9517
9518 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9519 optional int32 user_id = 7;
9520}
Varun Shahacb56342019-12-18 11:45:38 -08009521
9522/**
9523 * An event logged to indicate that a user journey is about to be performed. This atom includes
9524 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9525 * will immediately follow this atom which will describe the event(s) and its state.
9526 *
9527 * Logged from:
9528 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9529 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9530 */
9531message UserLifecycleJourneyReported {
9532 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9533 // UserLifecycleEventOccurred atom)
9534 optional int64 session_id = 1;
9535
9536 // Indicates what type of user journey this session is related to
9537 enum Journey {
9538 UNKNOWN = 0; // Undefined user lifecycle journey
9539 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9540 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9541 USER_START = 3; // A user start journey
9542 USER_CREATE = 4; // A user creation journey
9543 }
9544 optional Journey journey = 2;
9545 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9546 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9547 optional int32 origin_user = 3;
9548 // Which user the journey is targeting
9549 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9550 optional int32 target_user = 4;
9551
9552 // What is the user type of the target user
9553 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9554 enum UserType {
9555 TYPE_UNKNOWN = 0;
9556 FULL_SYSTEM = 1;
9557 FULL_SECONDARY = 2;
9558 FULL_GUEST = 3;
9559 FULL_DEMO = 4;
9560 FULL_RESTRICTED = 5;
9561 PROFILE_MANAGED = 6;
9562 SYSTEM_HEADLESS = 7;
9563 }
9564 optional UserType user_type = 5;
9565 // What are the flags attached to the target user
9566 optional int32 user_flags = 6;
9567}
9568
9569/**
9570 * An event logged when a specific user lifecycle event is performed. These events should be
9571 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9572 * Note: journeys can span over multiple events, hence some events may share a single session id.
9573 *
9574 * Logged from:
9575 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9576 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9577 */
9578message UserLifecycleEventOccurred {
9579 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9580 optional int64 session_id = 1;
9581 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9582 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9583 optional int32 user_id = 2;
9584
9585 enum Event {
9586 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9587 SWITCH_USER = 1; // Indicates that this is a user switch event
9588 START_USER = 2; // Indicates that this is a user start event
9589 CREATE_USER = 3; // Indicates that this is a user create event
9590 }
9591 optional Event event = 3;
9592
9593 enum State {
9594 NONE = 0; // Indicates the associated event has no start/end defined
9595 BEGIN = 1;
9596 FINISH = 2;
9597 }
9598 optional State state = 4; // Represents the state of an event (beginning/ending)
9599}
jasonwshsu81173e32020-03-27 15:22:03 +08009600
9601/**
9602 * Logs when accessibility shortcut clicked.
9603 *
9604 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009605 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009606 */
9607message AccessibilityShortcutReported {
9608 // The accessibility feature(including installed a11y service, framework a11y feature,
9609 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9610 optional string package_name = 1;
9611
9612 // The definition of the accessibility shortcut.
9613 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9614 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9615
9616 // The definition of the service status.
9617 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9618 optional android.stats.accessibility.ServiceStatus service_status = 3;
9619}
9620
9621/**
9622 * Logs when accessibility service status changed.
9623 *
9624 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009625 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009626 */
9627message AccessibilityServiceReported {
9628 // The accessibility service package name.
9629 optional string package_name = 1;
9630
9631 // The definition of the service status.
9632 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9633 optional android.stats.accessibility.ServiceStatus service_status = 2;
9634}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009635
9636/**
9637 * Logs app usage events.
9638 */
9639message AppUsageEventOccurred {
9640 optional int32 uid = 1 [(is_uid) = true];
9641 optional string package_name = 2;
9642 optional string class_name = 3;
9643
9644 enum EventType {
9645 NONE = 0;
9646 MOVE_TO_FOREGROUND = 1;
9647 MOVE_TO_BACKGROUND = 2;
9648 }
9649 optional EventType event_type = 4;
9650}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009651
9652/*
9653 * Quality metrics logged when EVS cameras are active.
9654 *
9655 * Logged from:
9656 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9657 */
9658message EvsUsageStatsReported {
9659
9660 // Camera identifier to distinguish the source camera device. This is not
9661 // globally unique and therefore cannot be used to identify the user and/or
9662 // the device.
9663 optional int32 device_id = 1;
9664
9665 // Peak number of clients during the service
9666 optional int32 peak_num_clients = 2;
9667
9668 // Number of erroneous events during the service
9669 optional int32 num_errors = 3;
9670
9671 // Round trip latency of the very first frame
9672 optional int64 first_latency_millis = 4;
9673
9674 // Average frame round trip latency
9675 optional float avg_latency_millis = 5;
9676
9677 // Peak frame round trip latency
9678 optional int64 peak_latency_millis = 6;
9679
9680 // Total number of frames received
9681 optional int64 total_frames = 7;
9682
9683 // Number of frames ignored
9684 optional int64 ignored_frames = 8;
9685
9686 // Number of dropped frames to synchronize camera devices
9687 optional int64 dropped_frames_to_sync = 9;
9688
9689 // The duration of the service
9690 optional int64 duration_millis = 10;
9691}