blob: 1f505b9a1abf77db4b6268d62f6c6035aab9e110 [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"];
Robert Leecccdc152020-04-23 13:22:46 +0800442 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000443 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700444
445 // StatsdStats tracks platform atoms with ids upto 500.
446 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 }
David Chenc8a43242017-10-17 16:23:28 -0700448
David Chen6e3e6cb2018-01-03 16:14:06 -0800449 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700450 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700451 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
453 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700454 MobileBytesTransfer mobile_bytes_transfer =
455 10002 [(module) = "framework", (truncate_timestamp) = true];
456 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
457 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
459 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700460 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700462 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800463 CpuTimePerUidFreq cpu_time_per_uid_freq =
464 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
466 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
467 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
468 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
469 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700470 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700471 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700472 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700473 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
475 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700476 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800477 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800478 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800479 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 DiskStats disk_stats = 10025 [(module) = "framework"];
481 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
482 AppSize app_size = 10027 [(module) = "framework"];
483 CategorySize category_size = 10028 [(module) = "framework"];
484 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800485 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
487 DiskIo disk_io = 10032 [(module) = "framework"];
488 PowerProfile power_profile = 10033 [(module) = "framework"];
489 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
490 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
491 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700492 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800493 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
494 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
495 10040 [(module) = "framework"];
496 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
497 10041 [(module) = "framework"];
498 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800499 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800500 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800501 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
503 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
504 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
505 RoleHolder role_holder = 10049 [(module) = "framework"];
506 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800507 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800508 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
509 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800510 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
511 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800512 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
513 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
514 FaceSettings face_settings = 10058 [(module) = "framework"];
515 CoolingDevice cooling_device = 10059 [(module) = "framework"];
516 AppOps app_ops = 10060 [(module) = "framework"];
517 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700518 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
519 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800520 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800521 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800522 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
523 DangerousPermissionStateSampled dangerous_permission_state_sampled =
524 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400525 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000526 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000527 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200528 PackageNotificationPreferences package_notification_preferences =
529 10071 [(module) = "framework"];
530 PackageNotificationChannelPreferences package_notification_channel_preferences =
531 10072 [(module) = "framework"];
532 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
533 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800534 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800535 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700536 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
537 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
538 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
539 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800540 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800541 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800542 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700543 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
544 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700545 }
yroa1fe77c2018-02-26 14:22:54 -0800546
Bookatz76aafcf2018-09-17 16:17:10 -0700547 // DO NOT USE field numbers above 100,000 in AOSP.
548 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
549 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100550
551 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700552}
553
Yao Chend54f9dd2017-10-17 17:37:48 +0000554/**
Yangster-mac20877162017-12-22 17:19:39 -0800555 * This proto represents a node of an attribution chain.
556 * Note: All attribution chains are represented as a repeated field of type
557 * AttributionNode. It is understood that in such arrays, the order is that
558 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000559 */
Yangster-mac20877162017-12-22 17:19:39 -0800560message AttributionNode {
561 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800562 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800563
Yangster-mac20877162017-12-22 17:19:39 -0800564 // The (optional) string tag for an element in the attribution chain. If the
565 // element has no tag, it is encoded as an empty string.
566 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700567}
568
Yangster-mac48b3d622018-08-18 12:38:11 -0700569message KeyValuePair {
570 optional int32 key = 1;
571 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700572 int32 value_int = 2;
573 int64 value_long = 3;
574 string value_str = 4;
575 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700576 }
577}
578
579message KeyValuePairsAtom {
580 optional int32 uid = 1;
581 repeated KeyValuePair pairs = 2;
582}
583
Yao Chend54f9dd2017-10-17 17:37:48 +0000584/*
585 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800586 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000587 *
588 * RULES:
589 * - The field ids for each atom must start at 1, and count upwards by 1.
590 * Skipping field ids is not allowed.
591 * - These form an API, so renaming, renumbering or removing fields is
592 * not allowed between android releases. (This is not currently enforced,
593 * but there will be a tool to enforce this restriction).
594 * - The types must be built-in protocol buffer types, namely, no sub-messages
595 * are allowed (yet). The bytes type is also not allowed.
596 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800597 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000598 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800599 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000600 * - A field that is a uid should be a string field, tagged with the [xxx]
601 * annotation. The generated code on android will be represented by UIDs,
602 * and those UIDs will be translated in xxx to those strings.
603 *
604 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700605 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 * - If there is a UID, it goes first. Think in an object-oriented fashion.
607 * *****************************************************************************
608 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700609
Yao Chend54f9dd2017-10-17 17:37:48 +0000610/**
Tej Singha72344992019-04-17 18:55:08 -0700611 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700612 * Logs when the Thermal service HAL notifies the throttling start/stop events.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
616 */
617message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700618 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700619 optional android.os.TemperatureTypeEnum sensor_type = 1;
620
Maggie White442b6312019-04-05 16:26:44 -0700621 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700622 enum State {
623 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700624 START = 1; // START indicated that throttling was triggered.
625 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700626 }
Yangster-mace16189a2018-08-26 12:20:16 -0700627 optional State state = 2;
628
629 optional float temperature = 3;
630}
631
632/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000633 * Logs when the screen state changes.
634 *
635 * Logged from:
636 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
637 */
638message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800639 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800640 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700641 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700642}
Yao Chend54f9dd2017-10-17 17:37:48 +0000643
644/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700645 * Logs that the process state of the uid, as determined by ActivityManager
646 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000647 *
648 * Logged from:
649 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
650 */
Bookatzc1a050a2017-10-10 15:49:28 -0700651message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700652 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000653
Bookatzdb026a22018-01-10 19:01:56 -0800654 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800655 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700656 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000657}
658
659/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700660 * Logs process state change of a process, as per the activity manager.
661 *
662 * Logged from:
663 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
664 */
665message ProcessStateChanged {
666 optional int32 uid = 1;
667 optional string process_name = 2;
668 optional string package_name = 3;
669 // TODO: remove this when validation is done
670 optional int64 version = 5;
671 // The state, from frameworks/base/core/proto/android/app/enums.proto.
672 optional android.app.ProcessStateEnum state = 4;
673}
674
675/**
676 * Logs when ActivityManagerService sleep state is changed.
677 *
678 * Logged from:
679 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
680 */
681message ActivityManagerSleepStateChanged {
682 // TODO: import frameworks proto
683 enum State {
684 UNKNOWN = 0;
685 ASLEEP = 1;
686 AWAKE = 2;
687 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700688 optional State state = 1
689 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700690}
691
692/**
693 * Logs when system memory state changes.
694 *
695 * Logged from:
696 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
697 */
698message MemoryFactorStateChanged {
699 // TODO: import frameworks proto
700 enum State {
701 MEMORY_UNKNOWN = 0;
702 NORMAL = 1; // normal.
703 MODERATE = 2; // moderate memory pressure.
704 LOW = 3; // low memory.
705 CRITICAL = 4; // critical memory.
706
707 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700708 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700709}
710
711/**
712 * Logs when app is using too much cpu, according to ActivityManagerService.
713 *
714 * Logged from:
715 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
716 */
717message ExcessiveCpuUsageReported {
718 optional int32 uid = 1;
719 optional string process_name = 2;
720 optional string package_name = 3;
721 // package version. TODO: remove this when validation is done
722 optional int64 version = 4;
723}
724
725/**
726 * Logs when a cached process is killed, along with its pss.
727 *
728 * Logged from:
729 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
730 */
731message CachedKillReported {
732 optional int32 uid = 1;
733 optional string process_name = 2;
734 optional string package_name = 3;
735 // TODO: remove this when validation is done
736 optional int64 version = 5;
737 optional int64 pss = 4;
738}
739
740/**
xshu2c3d9e42019-09-26 17:54:02 -0700741 * Logs the change in wifi health.
742 *
743 * Logged from:
744 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
745 */
746message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800747 enum Band {
748 UNKNOWN = 0;
749 // All of 2.4GHz band
750 BAND_2G = 1;
751 // Frequencies in the range of [5150, 5250) GHz
752 BAND_5G_LOW = 2;
753 // Frequencies in the range of [5250, 5725) GHz
754 BAND_5G_MIDDLE = 3;
755 // Frequencies in the range of [5725, 5850) GHz
756 BAND_5G_HIGH = 4;
757 // Frequencies in the range of [5925, 6425) GHz
758 BAND_6G_LOW = 5;
759 // Frequencies in the range of [6425, 6875) GHz
760 BAND_6G_MIDDLE = 6;
761 // Frequencies in the range of [6875, 7125) GHz
762 BAND_6G_HIGH = 7;
763 }
xshu2c3d9e42019-09-26 17:54:02 -0700764 // duration this stat is obtained over in milliseconds
765 optional int32 duration_millis = 1;
766 // whether wifi is classified as sufficient for the user's data traffic, determined
767 // by whether the calculated throughput exceeds the average demand within |duration_millis|
768 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700769 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800770 optional bool is_cell_data_available = 3;
771 // the Band bucket the connected network is on
772 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700773}
774
775/**
776 * Logged when wifi detects a significant change in connection failure rate.
777 *
778 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
779 *
780 */
781message WifiFailureStatReported {
782 enum AbnormalityType {
783 UNKNOWN = 0;
784 SIGNIFICANT_INCREASE = 1;
785 SIGNIFICANT_DECREASE = 2;
786 SIMPLY_HIGH = 3;
787 }
788 enum FailureType {
789 FAILURE_UNKNOWN = 0;
790 FAILURE_CONNECTION = 1;
791 FAILURE_ASSOCIATION_REJECTION = 2;
792 FAILURE_ASSOCIATION_TIMEOUT = 3;
793 FAILURE_AUTHENTICATION = 4;
794 FAILURE_NON_LOCAL_DISCONNECTION = 5;
795 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
796 }
797 // Reason for uploading this stat
798 optional AbnormalityType abnormality_type = 1;
799 // The particular type of failure
800 optional FailureType failure_type = 2;
801 // How many times we have encountered this combination of AbnormalityType and FailureType
802 optional int32 failure_count = 3;
803}
804
805/**
806 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
807 *
808 * Logged from:
809 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
810 */
811message WifiConnectionResultReported {
812 enum FailureCode {
813 FAILURE_UNKNOWN = 0;
814 FAILURE_ASSOCIATION_TIMEOUT = 1;
815 FAILURE_ASSOCIATION_REJECTION = 2;
816 FAILURE_AUTHENTICATION_GENERAL = 3;
817 FAILURE_AUTHENTICATION_EAP = 4;
818 FAILURE_DHCP = 5;
819 FAILURE_NETWORK_DISCONNECTION = 6;
820 FAILURE_ROAM_TIMEOUT = 7;
821 }
822 // true represents a successful connection
823 optional bool connection_result = 1;
824 // reason for the connection failure
825 optional FailureCode failure_code = 2;
826 // scan rssi before the connection attempt
827 optional int32 rssi = 3;
828}
829
830/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700831 * Logs when memory stats of a process is reported.
832 *
833 * Logged from:
834 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
835 */
836message ProcessMemoryStatReported {
837 optional int32 uid = 1;
838 optional string process_name = 2;
839 optional string package_name = 3;
840 //TODO: remove this when validation is done
841 optional int64 version = 9;
842 optional int64 pss = 4;
843 optional int64 uss = 5;
844 optional int64 rss = 6;
845 enum Type {
846 ADD_PSS_INTERNAL_SINGLE = 0;
847 ADD_PSS_INTERNAL_ALL_MEM = 1;
848 ADD_PSS_INTERNAL_ALL_POLL = 2;
849 ADD_PSS_EXTERNAL = 3;
850 ADD_PSS_EXTERNAL_SLOW = 4;
851 }
852 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800853 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700854}
855
856/**
Bookatzc1a050a2017-10-10 15:49:28 -0700857 * Logs that a process started, finished, crashed, or ANRed.
858 *
859 * Logged from:
860 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
861 */
862message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700863 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700864
David Chen0b5c90c2018-01-25 16:51:49 -0800865 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800866 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700867
Bookatzddccf0a2017-11-28 16:48:14 -0800868 // What lifecycle state the process changed to.
869 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800870 enum State {
871 FINISHED = 0;
872 STARTED = 1;
873 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800874 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700876}
877
Bookatzc1a050a2017-10-10 15:49:28 -0700878/**
879 * Logs when the ble scan state changes.
880 *
881 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700882 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700883 */
884message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800885 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700886 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700887
888 enum State {
889 OFF = 0;
890 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700891 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
892 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700893 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800894 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700895 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800896 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700897 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800898 (state_field_option).nested = true
899 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700900
Bookatze5ec0b42018-03-26 13:34:56 -0700901 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700902 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700903 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700904 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700905 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700906 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700907}
908
909/**
910 * Logs reporting of a ble scan finding results.
911 *
912 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700913 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700914 */
Bookatzae6738e2018-09-13 11:38:56 -0700915// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700916message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700918
919 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800920 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700921}
922
923/**
924 * Logs when a sensor state changes.
925 *
926 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700927 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700928 */
929message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800930 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700931
Bookatzc1a050a2017-10-10 15:49:28 -0700932 // The id (int) of the sensor.
933 optional int32 sensor_id = 2;
934
935 enum State {
936 OFF = 0;
937 ON = 1;
938 }
939 optional State state = 3;
940}
941
Bookatzc1a050a2017-10-10 15:49:28 -0700942/**
943 * Logs when GPS state changes.
944 *
945 * Logged from:
946 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
947 */
948message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800949 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700950
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 2;
956}
957
Bookatz48d362e2018-11-06 15:49:08 -0800958/**
959 * Logs when GPS signal quality.
960 *
961 * Logged from:
962 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
963 */
964message GpsSignalQualityChanged {
965 optional android.server.location.GpsSignalQualityEnum level = 1;
966}
967
Bookatzc1a050a2017-10-10 15:49:28 -0700968
969/**
970 * Logs when a sync manager sync state changes.
971 *
972 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700973 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700974 */
975message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800976 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700977
David Chen0b5c90c2018-01-25 16:51:49 -0800978 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800979 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
981 enum State {
982 OFF = 0;
983 ON = 1;
984 }
985 optional State state = 3;
986}
987
Yangster-mac96353002018-09-05 11:18:55 -0700988/*
989 * Deferred job stats.
990 *
991 * Logged from:
992 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
993*/
994message DeferredJobStatsReported {
995 repeated AttributionNode attribution_node = 1;
996
997 // Number of jobs deferred.
998 optional int32 num_jobs_deferred = 2;
999
1000 // Time since the last job runs.
1001 optional int64 time_since_last_job_millis = 3;
1002}
1003
Bookatzc1a050a2017-10-10 15:49:28 -07001004/**
1005 * Logs when a job scheduler job state changes.
1006 *
1007 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001008 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001009 */
1010message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001012
1013 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001014 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001015
1016 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001017 FINISHED = 0;
1018 STARTED = 1;
1019 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001020 }
1021 optional State state = 3;
1022
Tej Singh33a412b2018-03-16 18:43:59 -07001023 // The reason a job has stopped.
1024 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001025 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001026 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001027
1028 // The standby bucket of the app that scheduled the job. These match the framework constants
1029 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1030 // already assigned 0.
1031 enum Bucket {
1032 UNKNOWN = -1;
1033 ACTIVE = 0;
1034 WORKING_SET = 1;
1035 FREQUENT = 2;
1036 RARE = 3;
1037 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001038 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001039 }
1040 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1041
1042 // The job id (as assigned by the app).
1043 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001044
1045 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1046 // constraints as they are always assumed to be set.
1047 optional bool has_charging_constraint = 7;
1048 optional bool has_battery_not_low_constraint = 8;
1049 optional bool has_storage_not_low_constraint = 9;
1050 optional bool has_timing_delay_constraint = 10;
1051 optional bool has_deadline_constraint = 11;
1052 optional bool has_idle_constraint = 12;
1053 optional bool has_connectivity_constraint = 13;
1054 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001055}
1056
1057/**
1058 * Logs when the audio state changes.
1059 *
1060 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001061 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001062 */
1063message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001064 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001065
1066 enum State {
1067 OFF = 0;
1068 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001069 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1070 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001071 }
1072 optional State state = 2;
1073}
1074
1075/**
1076 * Logs when the video codec state changes.
1077 *
1078 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001079 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001080 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001081message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001082 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001083
1084 enum State {
1085 OFF = 0;
1086 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001087 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1088 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001089 }
1090 optional State state = 2;
1091}
1092
1093/**
1094 * Logs when the flashlight state changes.
1095 *
1096 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001097 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001098 */
1099message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001100 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001101
1102 enum State {
1103 OFF = 0;
1104 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001105 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1106 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001107 }
1108 optional State state = 2;
1109}
1110
1111/**
1112 * Logs when the camera state changes.
1113 *
1114 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001115 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001116 */
1117message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001118 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001119
1120 enum State {
1121 OFF = 0;
1122 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001123 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1124 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001125 }
1126 optional State state = 2;
1127}
1128
1129/**
1130 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001131 *
1132 * Logged from:
1133 * TODO
1134 */
Bookatzd6746242017-10-24 18:39:35 -07001135message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001136 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001137 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001138
Bookatz1a1b0462018-01-12 11:47:03 -08001139 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1140 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001141 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001142
1143 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001144 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001145
1146 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001147 RELEASE = 0;
1148 ACQUIRE = 1;
1149 CHANGE_RELEASE = 2;
1150 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001151 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001152 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001153 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001154 (state_field_option).default_state_value = 0,
1155 (state_field_option).nested = true
1156 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001157}
1158
1159/**
Bookatzc1a050a2017-10-10 15:49:28 -07001160 * Logs when a partial wakelock is considered 'long' (over 1 min).
1161 *
1162 * Logged from:
1163 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1164 */
1165message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001166 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001167
Yao Chend54f9dd2017-10-17 17:37:48 +00001168 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1169 optional string tag = 2;
1170
Bookatzc1a050a2017-10-10 15:49:28 -07001171 // TODO: I have no idea what this is.
1172 optional string history_tag = 3;
1173
1174 enum State {
1175 OFF = 0;
1176 ON = 1;
1177 }
1178 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001179}
1180
Bookatzc1a050a2017-10-10 15:49:28 -07001181/**
Bookatza66083f2018-09-20 17:24:00 -07001182 * Logs when the device is interactive, according to the PowerManager Notifier.
1183 *
1184 * Logged from:
1185 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1186 */
1187message InteractiveStateChanged {
1188 enum State {
1189 OFF = 0;
1190 ON = 1;
1191 }
1192 optional State state = 1;
1193}
1194
1195/**
Bookatzc1a050a2017-10-10 15:49:28 -07001196 * Logs Battery Saver state change.
1197 *
1198 * Logged from:
1199 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1200 */
1201message BatterySaverModeStateChanged {
1202 enum State {
1203 OFF = 0;
1204 ON = 1;
1205 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001206 optional State state = 1
1207 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001208}
1209
1210/**
1211 * Logs Doze mode state change.
1212 *
1213 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001214 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001215 */
1216message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001217 optional android.server.DeviceIdleModeEnum state = 1
1218 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001219}
1220
1221
1222/**
1223 * Logs state change of Doze mode including maintenance windows.
1224 *
1225 * Logged from:
1226 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1227 */
1228message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001229 optional android.server.DeviceIdleModeEnum state = 1
1230 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001231}
1232
1233/**
1234 * Logs screen brightness level.
1235 *
1236 * Logged from:
1237 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1238 */
1239message ScreenBrightnessChanged {
1240 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1241 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001242}
1243
1244/**
1245 * Logs battery level (percent full, from 0 to 100).
1246 *
1247 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001248 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001249 */
1250message BatteryLevelChanged {
1251 // Battery level. Should be in [0, 100].
1252 optional int32 battery_level = 1;
1253}
1254
1255/**
1256 * Logs change in charging status of the device.
1257 *
1258 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001259 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001260 */
1261message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001262 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001263 optional android.os.BatteryStatusEnum state = 1
1264 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001265}
1266
1267/**
1268 * Logs whether the device is plugged in, and what power source it is using.
1269 *
1270 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001271 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001272 */
1273message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001274 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001275 optional android.os.BatteryPluggedStateEnum state = 1
1276 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001277}
1278
Bookatz8c6571b2017-10-24 15:04:41 -07001279/**
1280 * Logs when an app's wakeup alarm fires.
1281 *
1282 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001283 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001284 */
1285message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001286 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001287
1288 // Name of the wakeup alarm.
1289 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001290
1291 // Name of source package (for historical reasons, since BatteryStats tracked it).
1292 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001293
Ben Murdoch3389f1522019-05-21 15:05:34 +01001294 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001295 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001296}
1297
1298/**
1299 * Logs when an an app causes the mobile radio to change state.
1300 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1301 *
1302 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001303 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001304 */
1305message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001306 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001307
Bookatz1a1b0462018-01-12 11:47:03 -08001308 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1309 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001310}
1311
1312/**
1313 * Logs when an an app causes the wifi radio to change state.
1314 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1315 *
1316 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001317 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001318 */
1319message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001320 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001321
Bookatz1a1b0462018-01-12 11:47:03 -08001322 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1323 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001324}
1325
1326/**
1327 * Logs kernel wakeup reasons and aborts.
1328 *
1329 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001330 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001331 */
1332message KernelWakeupReported {
1333 // Name of the kernel wakeup reason (or abort).
1334 optional string wakeup_reason_name = 1;
1335
1336 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001337 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001338}
1339
1340/**
Bookatzda1798c2018-12-13 14:16:00 -08001341 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001342 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001343 *
1344 * Logged from:
1345 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1346 */
1347message WifiEnabledStateChanged {
1348 enum State {
1349 OFF = 0;
1350 ON = 1;
1351 }
1352 optional State state = 1;
1353}
1354
1355/**
tsaichristinececebdc2020-02-04 14:05:56 -08001356 * This atom is deprecated starting in R.
1357 *
Bookatzda1798c2018-12-13 14:16:00 -08001358 * 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 -08001359 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1360 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001361 *
1362 * Logged from:
1363 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1364 */
1365message WifiRunningStateChanged {
1366 repeated AttributionNode attribution_node = 1;
1367
1368 enum State {
1369 OFF = 0;
1370 ON = 1;
1371 }
1372 optional State state = 2;
1373}
1374
1375/**
Bookatze5885242017-10-24 20:10:31 -07001376 * Logs wifi locks held by an app.
1377 *
1378 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001379 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001380 */
1381message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001382 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001383
1384 enum State {
1385 OFF = 0;
1386 ON = 1;
1387 }
1388 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001389
1390 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1391 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001392}
1393
1394/**
1395 * Logs wifi signal strength changes.
1396 *
1397 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001398 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001399 */
1400message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001401 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1402 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001403}
1404
1405/**
1406 * Logs wifi scans performed by an app.
1407 *
1408 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001409 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001410 */
1411message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001412 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001413
1414 enum State {
1415 OFF = 0;
1416 ON = 1;
1417 }
1418 optional State state = 2;
1419}
1420
1421/**
Tej Singh4503e102018-01-04 14:35:01 -08001422 * Logs wifi multicast locks held by an app
1423 *
1424 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001425 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001426 */
1427message WifiMulticastLockStateChanged {
1428 repeated AttributionNode attribution_node = 1;
1429
1430 enum State {
1431 OFF = 0;
1432 ON = 1;
1433 }
1434 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001435
1436 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001437}
1438
1439/**
Tej Singh1ea42892018-01-19 09:27:00 -08001440 * Logs shutdown reason and duration on next boot.
1441 *
1442 * Logged from:
1443 * frameworks/base/core/java/com/android/server/BootReceiver.java
1444 */
1445message ShutdownSequenceReported {
1446 // True if shutdown is for a reboot. Default: false if we do not know.
1447 optional bool reboot = 1;
1448
1449 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1450 optional string reason = 2;
1451
1452 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1453 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001454 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001455
1456 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001457 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001458}
1459
Tej Singh6483ea42018-01-25 17:45:49 -08001460
1461/**
1462 * Logs boot reason and duration.
1463 *
1464 * Logged from:
1465 * system/core/bootstat/bootstat.cpp
1466 */
1467message BootSequenceReported {
1468 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1469 // Default: "<EMPTY>" if not available.
1470 optional string bootloader_reason = 1;
1471
1472 // Reason for system boot. Eg. bootloader, reboot,userrequested
1473 // Default: "<EMPTY>" if not available.
1474 optional string system_reason = 2;
1475
1476 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001477 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001478
1479 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001480 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001481
1482 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001483 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001484
1485 // Time since last boot in ms. Default: 0 if not available.
1486 optional int64 time_since_last_boot = 6;
1487}
1488
Tej Singhc477d9c2018-02-05 18:31:39 -08001489
1490/**
1491 * Logs call state and disconnect cause (if applicable).
1492 *
1493 * Logged from:
1494 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1495 */
1496message CallStateChanged {
1497 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1498 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1499 optional android.telecom.CallStateEnum call_state = 1;
1500
1501 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1502 // This value is only applicable when the call_state is DISCONNECTED, and
1503 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1504 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1505 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1506
1507 // True if the call is self-managed, which are apps that use the
1508 // telecom infrastructure to make their own calls.
1509 optional bool self_managed = 3;
1510
1511 // True if call is external. External calls are calls on connected Wear
1512 // devices but show up in Telecom so the user can pull them onto the device.
1513 optional bool external_call = 4;
1514}
1515
Tej Singh1ea42892018-01-19 09:27:00 -08001516/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001517 * Logs keyguard state. The keyguard is the lock screen.
1518 *
1519 * Logged from:
1520 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1521 */
1522message KeyguardStateChanged {
1523 enum State {
1524 UNKNOWN = 0;
1525 // The keyguard is hidden when the phone is unlocked.
1526 HIDDEN = 1;
1527 // The keyguard is shown when the phone is locked (screen turns off).
1528 SHOWN= 2;
1529 // The keyguard is occluded when something is overlaying the keyguard.
1530 // Eg. Opening the camera while on the lock screen.
1531 OCCLUDED = 3;
1532 }
1533 optional State state = 1;
1534}
1535
1536/**
1537 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1538 * prompts the user to enter a password (pattern, pin, etc).
1539 *
1540 * Logged from:
1541 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1542 */
1543
1544message KeyguardBouncerStateChanged {
1545 enum State {
1546 UNKNOWN = 0;
1547 // Bouncer is hidden, either as a result of successfully entering the
1548 // password, screen timing out, or user going back to lock screen.
1549 HIDDEN = 1;
1550 // This is when the user is being prompted to enter the password.
1551 SHOWN = 2;
1552 }
1553 optional State state = 1;
1554}
1555
1556/**
1557 * Logs the result of entering a password into the keyguard bouncer.
1558 *
1559 * Logged from:
1560 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1561 */
1562message KeyguardBouncerPasswordEntered {
1563 enum BouncerResult {
1564 UNKNOWN = 0;
1565 // The password entered was incorrect.
1566 FAILURE = 1;
1567 // The password entered was correct.
1568 SUCCESS = 2;
1569 }
1570 optional BouncerResult result = 1;
1571}
1572
Tej Singha883b372018-02-15 11:30:01 -08001573/*
1574 * Logs changes to the configuration of the device. The configuration is defined
1575 * in frameworks/base/core/java/android/content/res/Configuration.java
1576 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1577 * Please go there to interpret the possible values each field can be.
1578 *
1579 * Logged from:
1580 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1581 */
1582message ResourceConfigurationChanged {
1583 // Bit mask of color capabilities of the screen.
1584 // Contains information about the color gamut and hdr mode of the screen.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001586 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001587
1588 // The target screen density being rendered to.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // Current user preference for the scaling factor for fonts,
1593 // relative to the base density scaling.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001595 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001596
1597 // Flag indicating whether the hard keyboard is hidden.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001600
1601 // The type of keyboard attached to the device.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1603 optional int32 keyboard = 5;
1604
1605 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001608
1609 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1610 // 0 if undefined.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1612 optional int32 mcc = 7;
1613
1614 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1615 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1616 // MNC_ZERO symbol defined in Configuration.java.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1618 optional int32 mnc = 8;
1619
1620 // The kind of navigation available on the device.
1621 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1622 optional int32 navigation = 9;
1623
1624 // Flag indicating whether the navigation is available.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001626 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001627
1628 // Overall orientation of the screen.
1629 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1630 optional int32 orientation = 11;
1631
1632 // The current height of the available screen space, in dp units.
1633 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001634 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001635
1636 // Bit mask of overall layout of the screen.
1637 // Contains information about screen size, whether the screen is wider/taller
1638 // than normal, whether the screen layout is right-tl-left or left-to-right,
1639 // and whether the screen has a rounded shape.
1640 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001641 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001642
1643 // Current width of the available screen space, in dp units.
1644 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001645 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001646
1647 // The smallest screen size an application will see in normal operation.
1648 // This is the smallest value of both screenWidthDp and screenHeightDp
1649 // in portrait and landscape.
1650 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001651 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001652
1653 // The type of touch screen attached to the device.
1654 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1655 optional int32 touchscreen = 16;
1656
1657 // Bit mask of the ui mode.
1658 // Contains information about the overall ui mode of the device.
1659 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1660 // Also contains information about whether the device is in night mode.
1661 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001662 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001663}
1664
Tej Singheee317b2018-03-07 19:28:05 -08001665
1666/**
1667 * Logs changes in the connection state of the mobile radio.
1668 *
1669 * Logged from:
1670 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1671 */
1672message MobileConnectionStateChanged {
1673 // States are from the state machine DataConnection.java.
1674 enum State {
1675 UNKNOWN = 0;
1676 // The connection is inactive, or disconnected.
1677 INACTIVE = 1;
1678 // The connection is being activated, or connecting.
1679 ACTIVATING = 2;
1680 // The connection is active, or connected.
1681 ACTIVE = 3;
1682 // The connection is disconnecting.
1683 DISCONNECTING = 4;
1684 // The connection is disconnecting after creating a connection.
1685 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1686 }
1687 optional State state = 1;
1688 // For multi-sim phones, this distinguishes between the sim cards.
1689 optional int32 sim_slot_index = 2;
1690 // Used to identify the connection. Starts at 0 and increments by 1 for
1691 // every new network created. Resets whenever the device reboots.
1692 optional int32 data_connection_id = 3;
1693 // A bitmask for the capabilities of this connection.
1694 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1695 // Default value (if we have no information): 0
1696 optional int64 capabilities = 4;
1697 // If this connection has internet.
1698 // This just checks if the DEFAULT bit of capabilities is set.
1699 optional bool has_internet = 5;
1700}
1701
1702/**
1703 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1704 *
1705 * Logged from:
1706 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1707 */
1708message MobileRadioTechnologyChanged {
1709 optional android.telephony.NetworkTypeEnum state = 1;
1710 // For multi-sim phones, this distinguishes between the sim cards.
1711 optional int32 sim_slot_index = 2;
1712}
1713
Andrew Chantb56388b2018-03-22 21:07:33 -07001714/**
1715 * Logs the VID and PID of any connected USB devices.
1716 *
1717 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1718 *
1719 * Logged by Vendor.
1720 */
1721message UsbDeviceAttached {
1722 optional int32 vid = 1;
1723 optional int32 pid = 2;
1724 optional bool has_audio = 3;
1725 optional bool has_hid = 4;
1726 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001727 enum State {
1728 STATE_DISCONNECTED = 0;
1729 STATE_CONNECTED = 1;
1730 }
1731 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001732 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001733}
1734
Tej Singheee317b2018-03-07 19:28:05 -08001735
Tej Singhdd7bd352018-02-09 19:33:15 -08001736/**
Tej Singh5d991e12018-03-09 19:48:11 -08001737 * Logs when Bluetooth is enabled and disabled.
1738 *
1739 * Logged from:
1740 * services/core/java/com/android/server/BluetoothManagerService.java
1741 */
1742message BluetoothEnabledStateChanged {
1743 repeated AttributionNode attribution_node = 1;
1744 // Whether or not bluetooth is enabled on the device.
1745 enum State {
1746 UNKNOWN = 0;
1747 ENABLED = 1;
1748 DISABLED = 2;
1749 }
1750 optional State state = 2;
1751 // The reason for being enabled/disabled.
1752 // Eg. Airplane mode, crash, application request.
1753 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1754 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001755 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001756}
1757
1758/**
Jack Hed9837c82019-01-09 01:19:13 -08001759 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001760 *
1761 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001762 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1763 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001764 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001765 */
1766message BluetoothConnectionStateChanged {
1767 // The state of the connection.
1768 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1769 optional android.bluetooth.ConnectionStateEnum state = 1;
1770 // An identifier that can be used to match connect and disconnect events.
1771 // Currently is last two bytes of a hash of a device level ID and
1772 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001773 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001774 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001775 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1776 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001777 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001778 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001779 // An identifier that can be used to match events for this device.
1780 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1781 // Salt: Randomly generated 256 bit value
1782 // Hash algorithm: HMAC-SHA256
1783 // Size: 32 byte
1784 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001785 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001786 // An identifier that can be used to match events for this device.
1787 // The incremental identifier is locally generated and guaranteed not derived
1788 // from any globally unique hardware id.
1789 // For paired devices, it stays consistent between Bluetooth toggling for the
1790 // same remote device.
1791 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1792 // session for the same remote device.
1793 // Default: 0 if the device's metric id is unknown.
1794 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001795}
1796
1797/**
1798 * Logs when a Bluetooth device connects and disconnects over ACL
1799 *
1800 * Logged from:
1801 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1802 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001803 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001804 */
1805message BluetoothAclConnectionStateChanged {
1806 // An identifier that can be used to match events for this device.
1807 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1808 // Salt: Randomly generated 256 bit value
1809 // Hash algorithm: HMAC-SHA256
1810 // Size: 32 byte
1811 // Default: null or empty if the device identifier is not known
1812 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1813 // The state of the connection.
1814 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1815 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001816 // An identifier that can be used to match events for this device.
1817 // The incremental identifier is locally generated and guaranteed not derived
1818 // from any globally unique hardware id.
1819 // For paired devices, it stays consistent between Bluetooth toggling for the
1820 // same remote device.
1821 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1822 // session for the same remote device.
1823 // Default: 0 if the device's metric id is unknown.
1824 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001825}
1826
1827/**
1828 * Logs when a Bluetooth device connects and disconnects over SCO
1829 *
1830 * Logged from:
1831 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1832 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1833 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001834 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001835 */
1836message BluetoothScoConnectionStateChanged {
1837 // An identifier that can be used to match events for this device.
1838 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1839 // Salt: Randomly generated 256 bit value
1840 // Hash algorithm: HMAC-SHA256
1841 // Size: 32 byte
1842 // Default: null or empty if the device identifier is not known
1843 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1844 // The state of the connection.
1845 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1846 optional android.bluetooth.ConnectionStateEnum state = 2;
1847 // Codec used for this SCO connection
1848 // Default: UNKNOWN
1849 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001850 // An identifier that can be used to match events for this device.
1851 // The incremental identifier is locally generated and guaranteed not derived
1852 // from any globally unique hardware id.
1853 // For paired devices, it stays consistent between Bluetooth toggling for the
1854 // same remote device.
1855 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1856 // session for the same remote device.
1857 // Default: 0 if the device's metric id is unknown.
1858 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001859}
1860
Jack Hec27040a2019-01-09 20:54:41 -08001861/**
1862 * Logged when active device of a profile changes
1863 *
1864 * Logged from:
1865 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1866 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1867 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1868 */
1869message BluetoothActiveDeviceChanged {
1870 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1871 // From android.bluetooth.BluetoothProfile
1872 optional int32 bt_profile = 1;
1873 // An identifier that can be used to match events for this new active device.
1874 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1875 // Salt: Randomly generated 256 bit value
1876 // Hash algorithm: HMAC-SHA256
1877 // Size: 32 byte
1878 // Default: null or empty if there is no active device for this profile
1879 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001880 // An identifier that can be used to match events for this device.
1881 // The incremental identifier is locally generated and guaranteed not derived
1882 // from any globally unique hardware id.
1883 // For paired devices, it stays consistent between Bluetooth toggling for the
1884 // same remote device.
1885 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1886 // session for the same remote device.
1887 // Default: 0 if the device's metric id is unknown.
1888 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001889}
1890
Jack Heab86dbd22018-12-18 15:43:27 -08001891// Logs when there is an event affecting Bluetooth device's link layer connection.
1892// - This event is triggered when there is a related HCI command or event
1893// - Users of this metrics can deduce Bluetooth device's connection state from these events
1894// - HCI commands are logged before the command is sent, after receiving command status, and after
1895// receiving command complete
1896// - HCI events are logged when they arrive
1897//
1898// Low level log from system/bt
1899//
1900// Bluetooth classic commands:
1901// - CMD_CREATE_CONNECTION
1902// - CMD_DISCONNECT
1903// - CMD_CREATE_CONNECTION_CANCEL
1904// - CMD_ACCEPT_CONNECTION_REQUEST
1905// - CMD_REJECT_CONNECTION_REQUEST
1906// - CMD_SETUP_ESCO_CONNECTION
1907// - CMD_ACCEPT_ESCO_CONNECTION
1908// - CMD_REJECT_ESCO_CONNECTION
1909// - CMD_ENH_SETUP_ESCO_CONNECTION
1910// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1911//
1912// Bluetooth low energy commands:
1913// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1914// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1915// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1916// - CMD_BLE_CLEAR_WHITE_LIST
1917// - CMD_BLE_ADD_WHITE_LIST
1918// - CMD_BLE_REMOVE_WHITE_LIST
1919//
1920// Bluetooth classic events:
1921// - EVT_CONNECTION_COMP
1922// - EVT_CONNECTION_REQUEST
1923// - EVT_DISCONNECTION_COMP
1924// - EVT_ESCO_CONNECTION_COMP
1925// - EVT_ESCO_CONNECTION_CHANGED
1926//
1927// Bluetooth low energy meta events:
1928// - BLE_EVT_CONN_COMPLETE_EVT
1929// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1930//
1931// Next tag: 10
1932message BluetoothLinkLayerConnectionEvent {
1933 // An identifier that can be used to match events for this device.
1934 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1935 // Salt: Randomly generated 256 bit value
1936 // Hash algorithm: HMAC-SHA256
1937 // Size: 32 byte
1938 // Default: null or empty if the device identifier is not known
1939 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1940 // Connection handle of this connection if available
1941 // Range: 0x0000 - 0x0EFF (12 bits)
1942 // Default: 0xFFFF if the handle is unknown
1943 optional int32 connection_handle = 2;
1944 // Direction of the link
1945 // Default: DIRECTION_UNKNOWN
1946 optional android.bluetooth.DirectionEnum direction = 3;
1947 // Type of this link
1948 // Default: LINK_TYPE_UNKNOWN
1949 optional android.bluetooth.LinkTypeEnum type = 4;
1950
1951 // Reason metadata for this link layer connection event, rules for interpretation:
1952 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1953 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1954 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1955 // set and valid, ignore hci_ble_event
1956
1957 // HCI command associated with this event
1958 // Default: CMD_UNKNOWN
1959 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1960 // HCI event associated with this event
1961 // Default: EVT_UNKNOWN
1962 optional android.bluetooth.hci.EventEnum hci_event = 6;
1963 // HCI BLE meta event associated with this event
1964 // Default: BLE_EVT_UNKNOWN
1965 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1966 // HCI command status code if this is triggerred by hci_cmd
1967 // Default: STATUS_UNKNOWN
1968 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1969 // HCI reason code associated with this event
1970 // Default: STATUS_UNKNOWN
1971 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001972 // An identifier that can be used to match events for this device.
1973 // The incremental identifier is locally generated and guaranteed not derived
1974 // from any globally unique hardware id.
1975 // For paired devices, it stays consistent between Bluetooth toggling for the
1976 // same remote device.
1977 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1978 // session for the same remote device.
1979 // Default: 0 if the device's metric id is unknown.
1980 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001981}
1982
Howard Roe103fe22019-01-17 16:52:16 -08001983/**
1984 * Logs when a module is rolled back by Watchdog.
1985 *
1986 * Logged from: Rollback Manager
1987 */
1988message WatchdogRollbackOccurred {
1989 enum RollbackType {
1990 UNKNOWN = 0;
1991 ROLLBACK_INITIATE = 1;
1992 ROLLBACK_SUCCESS = 2;
1993 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001994 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001995 }
1996 optional RollbackType rollback_type = 1;
1997
1998 optional string package_name = 2;
1999
2000 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002001
2002 enum RollbackReasonType {
2003 REASON_UNKNOWN = 0;
2004 REASON_NATIVE_CRASH = 1;
2005 REASON_EXPLICIT_HEALTH_CHECK = 2;
2006 REASON_APP_CRASH = 3;
2007 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002008 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002009 }
2010 optional RollbackReasonType rollback_reason = 4;
2011
2012 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2013 // is initiated. Empty if the package is unknown.
2014 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002015
2016 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002017}
2018
Jack Hec27040a2019-01-09 20:54:41 -08002019/**
2020 * Logs when there is a change in Bluetooth A2DP playback state
2021 *
2022 * Logged from:
2023 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2024 */
2025message BluetoothA2dpPlaybackStateChanged {
2026 // An identifier that can be used to match events for this device.
2027 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2028 // Salt: Randomly generated 256 bit value
2029 // Hash algorithm: HMAC-SHA256
2030 // Size: 32 byte
2031 // Default: null or empty if the device identifier is not known
2032 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2033 // Current playback state
2034 // Default: PLAYBACK_STATE_UNKNOWN
2035 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2036 // Current audio coding mode
2037 // Default: AUDIO_CODING_MODE_UNKNOWN
2038 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002039 // An identifier that can be used to match events for this device.
2040 // The incremental identifier is locally generated and guaranteed not derived
2041 // from any globally unique hardware id.
2042 // For paired devices, it stays consistent between Bluetooth toggling for the
2043 // same remote device.
2044 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2045 // session for the same remote device.
2046 // Default: 0 if the device's metric id is unknown.
2047 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002048}
2049
2050/**
2051 * Logs when there is a change in A2DP codec config for a particular remote device
2052 *
2053 * Logged from:
2054 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2055 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2056 */
2057message BluetoothA2dpCodecConfigChanged {
2058 // An identifier that can be used to match events for this device.
2059 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2060 // Salt: Randomly generated 256 bit value
2061 // Hash algorithm: HMAC-SHA256
2062 // Size: 32 byte
2063 // Default: null or empty if the device identifier is not known
2064 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2065 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2066 // Default SOURCE_CODEC_TYPE_INVALID
2067 optional int32 codec_type = 2;
2068 // Codec priroity, the higher the more preferred, -1 for disabled
2069 // Default: CODEC_PRIORITY_DEFAULT
2070 optional int32 codec_priority = 3;
2071 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2072 // Default: SAMPLE_RATE_NONE
2073 optional int32 sample_rate = 4;
2074 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2075 // Default: BITS_PER_SAMPLE_NONE
2076 optional int32 bits_per_sample = 5;
2077 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2078 // Default: CHANNEL_MODE_NONE
2079 optional int32 channel_mode = 6;
2080 // Codec specific values
2081 // Default 0
2082 optional int64 codec_specific_1 = 7;
2083 optional int64 codec_specific_2 = 8;
2084 optional int64 codec_specific_3 = 9;
2085 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002086 // An identifier that can be used to match events for this device.
2087 // The incremental identifier is locally generated and guaranteed not derived
2088 // from any globally unique hardware id.
2089 // For paired devices, it stays consistent between Bluetooth toggling for the
2090 // same remote device.
2091 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2092 // session for the same remote device.
2093 // Default: 0 if the device's metric id is unknown.
2094 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002095}
2096
2097/**
2098 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2099 * Each codec's capability is logged separately due to statsd restriction
2100 *
2101 * Logged from:
2102 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2103 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2104 */
2105message BluetoothA2dpCodecCapabilityChanged {
2106 // An identifier that can be used to match events for this device.
2107 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2108 // Salt: Randomly generated 256 bit value
2109 // Hash algorithm: HMAC-SHA256
2110 // Size: 32 byte
2111 // Default: null or empty if the device identifier is not known
2112 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2113 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2114 // Default SOURCE_CODEC_TYPE_INVALID
2115 optional int32 codec_type = 2;
2116 // Codec priroity, the higher the more preferred, -1 for disabled
2117 // Default: CODEC_PRIORITY_DEFAULT
2118 optional int32 codec_priority = 3;
2119 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2120 // in BluetoothCodecConfig
2121 // Default: empty and SAMPLE_RATE_NONE for individual item
2122 optional int32 sample_rate = 4;
2123 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2124 // in BluetoothCodecConfig
2125 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2126 optional int32 bits_per_sample = 5;
2127 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2128 // BluetoothCodecConfig
2129 // Default: empty and CHANNEL_MODE_NONE for individual item
2130 optional int32 channel_mode = 6;
2131 // Codec specific values
2132 // Default 0
2133 optional int64 codec_specific_1 = 7;
2134 optional int64 codec_specific_2 = 8;
2135 optional int64 codec_specific_3 = 9;
2136 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002137 // An identifier that can be used to match events for this device.
2138 // The incremental identifier is locally generated and guaranteed not derived
2139 // from any globally unique hardware id.
2140 // For paired devices, it stays consistent between Bluetooth toggling for the
2141 // same remote device.
2142 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2143 // session for the same remote device.
2144 // Default: 0 if the device's metric id is unknown.
2145 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002146}
2147
2148/**
2149 * Logs when A2DP failed to read from PCM source.
2150 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2151 *
2152 * Logged from:
2153 * system/bt
2154 */
2155message BluetoothA2dpAudioUnderrunReported {
2156 // An identifier that can be used to match events for this device.
2157 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2158 // Salt: Randomly generated 256 bit value
2159 // Hash algorithm: HMAC-SHA256
2160 // Size: 32 byte
2161 // Default: null or empty if the device identifier is not known
2162 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2163 // Encoding interval in nanoseconds
2164 // Default: 0
2165 optional int64 encoding_interval_nanos = 2;
2166 // Number of bytes of PCM data that could not be read from the source
2167 // Default: 0
2168 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002169 // An identifier that can be used to match events for this device.
2170 // The incremental identifier is locally generated and guaranteed not derived
2171 // from any globally unique hardware id.
2172 // For paired devices, it stays consistent between Bluetooth toggling for the
2173 // same remote device.
2174 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2175 // session for the same remote device.
2176 // Default: 0 if the device's metric id is unknown.
2177 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002178}
2179
2180/**
2181 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2182 * buffer queue is full and we have to drop data
2183 *
2184 * Logged from:
2185 * system/bt
2186 */
2187message BluetoothA2dpAudioOverrunReported {
2188 // An identifier that can be used to match events for this device.
2189 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2190 // Salt: Randomly generated 256 bit value
2191 // Hash algorithm: HMAC-SHA256
2192 // Size: 32 byte
2193 // Default: null or empty if the device identifier is not known
2194 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2195 // Encoding interval in nanoseconds
2196 // Default: 0
2197 optional int64 encoding_interval_nanos = 2;
2198 // Number of buffers dropped in this event
2199 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2200 // Default: 0
2201 optional int32 num_dropped_buffers = 3;
2202 // Number of encoded buffers dropped in this event
2203 // Default 0
2204 optional int32 num_dropped_encoded_frames = 4;
2205 // Number of encoded bytes dropped in this event
2206 // Default: 0
2207 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002208 // An identifier that can be used to match events for this device.
2209 // The incremental identifier is locally generated and guaranteed not derived
2210 // from any globally unique hardware id.
2211 // For paired devices, it stays consistent between Bluetooth toggling for the
2212 // same remote device.
2213 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2214 // session for the same remote device.
2215 // Default: 0 if the device's metric id is unknown.
2216 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002217}
2218
2219/**
2220 * Logs when we receive reports regarding a device's RSSI value
2221 *
2222 * Logged from:
2223 * system/bt
2224 */
2225message BluetoothDeviceRssiReported {
2226 // An identifier that can be used to match events for this device.
2227 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2228 // Salt: Randomly generated 256 bit value
2229 // Hash algorithm: HMAC-SHA256
2230 // Size: 32 byte
2231 // Default: null or empty if the device identifier is not known
2232 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2233 // Connection handle of this connection if available
2234 // Range: 0x0000 - 0x0EFF (12 bits)
2235 // Default: 0xFFFF if the handle is unknown
2236 optional int32 connection_handle = 2;
2237 // HCI command status code if this is triggerred by hci_cmd
2238 // Default: STATUS_UNKNOWN
2239 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2240 // BR/EDR
2241 // Range: -128 ≤ N ≤ 127 (signed integer)
2242 // Units: dB
2243 // LE:
2244 // Range: -127 to 20, 127 (signed integer)
2245 // Units: dBm
2246 // Invalid when an out of range value is reported
2247 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002248 // An identifier that can be used to match events for this device.
2249 // The incremental identifier is locally generated and guaranteed not derived
2250 // from any globally unique hardware id.
2251 // For paired devices, it stays consistent between Bluetooth toggling for the
2252 // same remote device.
2253 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2254 // session for the same remote device.
2255 // Default: 0 if the device's metric id is unknown.
2256 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002257}
2258
2259/**
2260 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2261 *
2262 * Logged from:
2263 * system/bt
2264 */
2265message BluetoothDeviceFailedContactCounterReported {
2266 // An identifier that can be used to match events for this device.
2267 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2268 // Salt: Randomly generated 256 bit value
2269 // Hash algorithm: HMAC-SHA256
2270 // Size: 32 byte
2271 // Default: null or empty if the device identifier is not known
2272 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2273 // Connection handle of this connection if available
2274 // Range: 0x0000 - 0x0EFF (12 bits)
2275 // Default: 0xFFFF if the handle is unknown
2276 optional int32 connection_handle = 2;
2277 // HCI command status code if this is triggerred by hci_cmd
2278 // Default: STATUS_UNKNOWN
2279 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2280 // Number of consecutive failed contacts for a connection corresponding to the Handle
2281 // Range: uint16_t, 0-0xFFFF
2282 // Default: 0xFFFFF
2283 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002284 // An identifier that can be used to match events for this device.
2285 // The incremental identifier is locally generated and guaranteed not derived
2286 // from any globally unique hardware id.
2287 // For paired devices, it stays consistent between Bluetooth toggling for the
2288 // same remote device.
2289 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2290 // session for the same remote device.
2291 // Default: 0 if the device's metric id is unknown.
2292 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002293}
2294
2295/**
2296 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2297 *
2298 * Logged from:
2299 * system/bt
2300 */
2301message BluetoothDeviceTxPowerLevelReported {
2302 // An identifier that can be used to match events for this device.
2303 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2304 // Salt: Randomly generated 256 bit value
2305 // Hash algorithm: HMAC-SHA256
2306 // Size: 32 byte
2307 // Default: null or empty if the device identifier is not known
2308 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2309 // Connection handle of this connection if available
2310 // Range: 0x0000 - 0x0EFF (12 bits)
2311 // Default: 0xFFFF if the handle is unknown
2312 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002313 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002314 // Default: STATUS_UNKNOWN
2315 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2316 // Range: -30 ≤ N ≤ 20
2317 // Units: dBm
2318 // Invalid when an out of range value is reported
2319 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002320 // An identifier that can be used to match events for this device.
2321 // The incremental identifier is locally generated and guaranteed not derived
2322 // from any globally unique hardware id.
2323 // For paired devices, it stays consistent between Bluetooth toggling for the
2324 // same remote device.
2325 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2326 // session for the same remote device.
2327 // Default: 0 if the device's metric id is unknown.
2328 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002329}
Jack Heab86dbd22018-12-18 15:43:27 -08002330
Tej Singh5d991e12018-03-09 19:48:11 -08002331/**
Jack He1021a612019-01-20 21:22:46 -08002332 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2333 * receiving an HCI command from the host
2334 *
2335 * Logged from: system/bt
2336 */
2337message BluetoothHciTimeoutReported {
2338 // HCI command associated with this event
2339 // Default: CMD_UNKNOWN
2340 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2341}
2342
2343/**
2344 * Logs when we receive Bluetooth Link Quality Report event from the controller
2345 * See Android Bluetooth HCI specification for more details
2346 *
2347 * Note: all count and bytes field are counted since last event
2348 *
2349 * Logged from: system/bt
2350 */
2351message BluetoothQualityReportReported {
2352 // Quality report ID
2353 // Original type: uint8_t
2354 // Default: BQR_ID_UNKNOWN
2355 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2356 // Packet type of the connection
2357 // Original type: uint8_t
2358 // Default: BQR_PACKET_TYPE_UNKNOWN
2359 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2360 // Connection handle of the connection
2361 // Original type: uint16_t
2362 optional int32 connection_handle = 3;
2363 // Performing Role for the connection
2364 // Original type: uint8_t
2365 optional int32 connection_role = 4;
2366 // Current Transmit Power Level for the connection. This value is the same as the controller's
2367 // response to the HCI_Read_Transmit_Power_Level HCI command
2368 // Original type: uint8_t
2369 optional int32 tx_power_level = 5;
2370 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2371 // absolute receiver signal strength value
2372 // Original type: int8_t
2373 optional int32 rssi = 6;
2374 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2375 // channels used by the link currently
2376 // Original type: uint8_t
2377 optional int32 snr = 7;
2378 // Indicates the number of unused channels in AFH_channel_map
2379 // Original type: uint8_t
2380 optional int32 unused_afh_channel_count = 8;
2381 // Indicates the number of the channels which are interfered and quality is bad but are still
2382 // selected for AFH
2383 // Original type: uint8_t
2384 optional int32 afh_select_unideal_channel_count = 9;
2385 // Current Link Supervision Timeout Setting
2386 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2387 // Original type: uint16_t
2388 optional int32 lsto = 10;
2389 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2390 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2391 // 0x01 (Piconet Clock)
2392 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2393 // Original type: uint32_t
2394 optional int64 connection_piconet_clock = 11;
2395 // The count of retransmission
2396 // Original type: uint32_t
2397 optional int64 retransmission_count = 12;
2398 // The count of no RX
2399 // Original type: uint32_t
2400 optional int64 no_rx_count = 13;
2401 // The count of NAK (Negative Acknowledge)
2402 // Original type: uint32_t
2403 optional int64 nak_count = 14;
2404 // Controller timestamp of last TX ACK
2405 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2406 // Original type: uint32_t
2407 optional int64 last_tx_ack_timestamp = 15;
2408 // The count of Flow-off (STOP)
2409 // Original type: uint32_t
2410 optional int64 flow_off_count = 16;
2411 // Controller timestamp of last Flow-on (GO)
2412 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2413 // Original type: uint32_t
2414 optional int64 last_flow_on_timestamp = 17;
2415 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2416 // Original type: uint32_t
2417 optional int64 buffer_overflow_bytes = 18;
2418 // Buffer underflow count (in byte) since last event
2419 // Original type: uint32_t
2420 optional int64 buffer_underflow_bytes = 19;
2421}
2422
2423/**
2424 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2425 *
2426 * Notes:
2427 * - Each event can be partially filled as we might learn different pieces of device
2428 * information at different time
2429 * - Multiple device info events can be combined to give more complete picture
2430 * - When multiple device info events tries to describe the same information, the
2431 * later one wins
2432 *
2433 * Logged from:
2434 * packages/apps/Bluetooth
2435 */
Jack Heaea26982019-04-04 11:19:48 -07002436message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002437 // An identifier that can be used to match events for this device.
2438 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2439 // Salt: Randomly generated 256 bit value
2440 // Hash algorithm: HMAC-SHA256
2441 // Size: 32 byte
2442 // Default: null or empty if the device identifier is not known
2443 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2444 // Where is this device info obtained from
2445 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2446 // Name of the data source
2447 // For EXTERNAL: package name of the data source
2448 // For INTERNAL: null for general case, component name otherwise
2449 optional string source_name = 3;
2450 // Name of the manufacturer of this device
2451 optional string manufacturer = 4;
2452 // Model of this device
2453 optional string model = 5;
2454 // Hardware version of this device
2455 optional string hardware_version = 6;
2456 // Software version of this device
2457 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002458 // An identifier that can be used to match events for this device.
2459 // The incremental identifier is locally generated and guaranteed not derived
2460 // from any globally unique hardware id.
2461 // For paired devices, it stays consistent between Bluetooth toggling for the
2462 // same remote device.
2463 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2464 // session for the same remote device.
2465 // Default: 0 if the device's metric id is unknown.
2466 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002467}
2468
2469/**
2470 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2471 * device, as documented by the Bluetooth Core HCI specification
2472 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2473 * Vol 2, Part E, Page 1118
2474 *
2475 * Logged from:
2476 * system/bt
2477 */
2478message BluetoothRemoteVersionInfoReported {
2479 // Connection handle of the connection
2480 // Original type: uint16_t
2481 optional int32 connection_handle = 1;
2482 // HCI command status code
2483 // Default: STATUS_UNKNOWN
2484 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2485 // 1 byte Version of current LMP in the remote controller
2486 optional int32 lmp_version = 3;
2487 // 2 bytes LMP manufacturer code of the remote controller
2488 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2489 optional int32 lmp_manufacturer_code = 4;
2490 // 4 bytes subversion of the LMP in the remote controller
2491 optional int32 lmp_subversion = 5;
2492}
2493
2494/**
2495 * Logs when certain Bluetooth SDP attributes are discovered
2496 * Constant definitions are from:
2497 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2498 *
2499 * Current logged attributes:
2500 * - BluetoothProfileDescriptorList
2501 * - Supported Features Bitmask
2502 *
2503 * Logged from:
2504 * system/bt
2505 */
2506message BluetoothSdpAttributeReported {
2507 // An identifier that can be used to match events for this device.
2508 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2509 // Salt: Randomly generated 256 bit value
2510 // Hash algorithm: HMAC-SHA256
2511 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2512 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2513 // Original type: uint16_t
2514 optional int32 protocol_uuid = 2;
2515 // Short form UUIDs used to identify Bluetooth SDP attribute types
2516 // Original type: uint16_t
2517 optional int32 attribute_id = 3;
2518 // Attribute value for the particular attribute
2519 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002520 // An identifier that can be used to match events for this device.
2521 // The incremental identifier is locally generated and guaranteed not derived
2522 // from any globally unique hardware id.
2523 // For paired devices, it stays consistent between Bluetooth toggling for the
2524 // same remote device.
2525 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2526 // session for the same remote device.
2527 // Default: 0 if the device's metric id is unknown.
2528 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002529}
2530
2531/**
2532 * Logs when bond state of a Bluetooth device changes
2533 *
2534 * Logged from:
2535 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2536 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2537 */
2538message BluetoothBondStateChanged {
2539 // An identifier that can be used to match events for this device.
2540 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2541 // Salt: Randomly generated 256 bit value
2542 // Hash algorithm: HMAC-SHA256
2543 // Size: 32 byte
2544 // Default: null or empty if the device identifier is not known
2545 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2546 // Preferred transport type to remote dual mode device
2547 // Default: TRANSPORT_AUTO means no preference
2548 optional android.bluetooth.TransportTypeEnum transport = 2;
2549 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2550 // Default: UNKNOWN
2551 optional android.bluetooth.DeviceTypeEnum type = 3;
2552 // Current bond state (NONE, BONDING, BONDED)
2553 // Default: BOND_STATE_UNKNOWN
2554 optional android.bluetooth.BondStateEnum bond_state = 4;
2555 // Bonding sub state
2556 // Default: BOND_SUB_STATE_UNKNOWN
2557 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2558 // Unbond Reason
2559 // Default: UNBOND_REASON_UNKNOWN
2560 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002561 // An identifier that can be used to match events for this device.
2562 // The incremental identifier is locally generated and guaranteed not derived
2563 // from any globally unique hardware id.
2564 // For paired devices, it stays consistent between Bluetooth toggling for the
2565 // same remote device.
2566 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2567 // session for the same remote device.
2568 // Default: 0 if the device's metric id is unknown.
2569 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002570}
2571
2572/**
2573 * Logs there is an event related Bluetooth classic pairing
2574 *
2575 * Logged from:
2576 * system/bt
2577 */
2578message BluetoothClassicPairingEventReported {
2579 // An identifier that can be used to match events for this device.
2580 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2581 // Salt: Randomly generated 256 bit value
2582 // Hash algorithm: HMAC-SHA256
2583 // Size: 32 byte
2584 // Default: null or empty if the device identifier is not known
2585 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2586 // Connection handle of this connection if available
2587 // Range: 0x0000 - 0x0EFF (12 bits)
2588 // Default: 0xFFFF if the handle is unknown
2589 optional int32 connection_handle = 2;
2590 // HCI command associated with this event
2591 // Default: CMD_UNKNOWN
2592 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2593 // HCI event associated with this event
2594 // Default: EVT_UNKNOWN
2595 optional android.bluetooth.hci.EventEnum hci_event = 4;
2596 // HCI command status code if this is triggerred by hci_cmd
2597 // Default: STATUS_UNKNOWN
2598 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2599 // HCI reason code associated with this event
2600 // Default: STATUS_UNKNOWN
2601 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002602 // A status value related to this specific event
2603 // Default: 0
2604 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002605 // An identifier that can be used to match events for this device.
2606 // The incremental identifier is locally generated and guaranteed not derived
2607 // from any globally unique hardware id.
2608 // For paired devices, it stays consistent between Bluetooth toggling for the
2609 // same remote device.
2610 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2611 // session for the same remote device.
2612 // Default: 0 if the device's metric id is unknown.
2613 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002614}
2615
2616/**
2617 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2618 *
2619 * Logged from:
2620 * system/bt
2621 */
2622message BluetoothSmpPairingEventReported {
2623 // An identifier that can be used to match events for this device.
2624 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2625 // Salt: Randomly generated 256 bit value
2626 // Hash algorithm: HMAC-SHA256
2627 // Size: 32 byte
2628 // Default: null or empty if the device identifier is not known
2629 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2630 // SMP command sent or received over L2CAP
2631 // Default: CMD_UNKNOWN
2632 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2633 // Whether this command is sent or received
2634 // Default: DIRECTION_UNKNOWN
2635 optional android.bluetooth.DirectionEnum direction = 3;
2636 // SMP failure reason code
2637 // Default: PAIRING_FAIL_REASON_DEFAULT
2638 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002639 // An identifier that can be used to match events for this device.
2640 // The incremental identifier is locally generated and guaranteed not derived
2641 // from any globally unique hardware id.
2642 // For paired devices, it stays consistent between Bluetooth toggling for the
2643 // same remote device.
2644 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2645 // session for the same remote device.
2646 // Default: 0 if the device's metric id is unknown.
2647 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002648}
2649
2650/**
Jack He815cdba2019-01-30 17:24:55 -08002651 * Logs when a Bluetooth socket’s connection state changed
2652 *
2653 * Logged from:
2654 * system/bt
2655 */
2656message BluetoothSocketConnectionStateChanged {
2657 // An identifier that can be used to match events for this device.
2658 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2659 // Salt: Randomly generated 256 bit value
2660 // Hash algorithm: HMAC-SHA256
2661 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002662 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002663 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002664 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002665 // Default 0 when unknown or don't care
2666 optional int32 port = 2;
2667 // Socket type as mentioned in
2668 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2669 // Default: SOCKET_TYPE_UNKNOWN
2670 optional android.bluetooth.SocketTypeEnum type = 3;
2671 // Socket connection state
2672 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2673 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2674 // Number of bytes sent to remote device during this connection
2675 optional int64 tx_bytes = 5;
2676 // Number of bytes received from remote device during this connection
2677 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002678 // Socket owner's UID
2679 optional int32 uid = 7 [(is_uid) = true];
2680 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2681 // |port| must be spawned by |server_port|
2682 // Default 0 when unknown or don't care
2683 optional int32 server_port = 8;
2684 // Whether this is a server listener socket
2685 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002686 // An identifier that can be used to match events for this device.
2687 // The incremental identifier is locally generated and guaranteed not derived
2688 // from any globally unique hardware id.
2689 // For paired devices, it stays consistent between Bluetooth toggling for the
2690 // same remote device.
2691 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2692 // session for the same remote device.
2693 // Default: 0 if the device's metric id is unknown.
2694 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002695}
2696
2697/**
Jack He71426802019-04-02 13:32:52 -07002698 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2699 *
2700 * Logged from:
2701 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2702 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2703 *
2704 */
2705message BluetoothClassOfDeviceReported {
2706 // An identifier that can be used to match events for this device.
2707 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2708 // Salt: Randomly generated 256 bit value
2709 // Hash algorithm: HMAC-SHA256
2710 // Size: 32 byte
2711 // Default: null or empty if this is a server listener socket
2712 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2713 // Class of Device (CoD) value including both Major, Minor device class and service class
2714 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2715 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2716 // Default: 0
2717 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002718 // An identifier that can be used to match events for this device.
2719 // The incremental identifier is locally generated and guaranteed not derived
2720 // from any globally unique hardware id.
2721 // For paired devices, it stays consistent between Bluetooth toggling for the
2722 // same remote device.
2723 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2724 // session for the same remote device.
2725 // Default: 0 if the device's metric id is unknown.
2726 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002727}
2728
2729/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002730 * Logs when something is plugged into or removed from the USB-C connector.
2731 *
2732 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002733 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002734 */
2735message UsbConnectorStateChanged {
2736 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002737 STATE_DISCONNECTED = 0;
2738 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002739 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002740 optional State state = 1
2741 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2742 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002743 // Last active session in ms.
2744 // 0 when the port is in connected state.
2745 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002746}
2747
2748/**
2749 * Logs the reported speaker impedance.
2750 *
2751 * Logged from:
2752 * Vendor audio implementation.
2753 */
2754message SpeakerImpedanceReported {
2755 optional int32 speaker_location = 1;
2756 optional int32 impedance = 2;
2757}
2758
2759/**
2760 * Logs the report of a failed hardware.
2761 *
2762 * Logged from:
2763 * Vendor HALs.
2764 *
2765 */
2766message HardwareFailed {
2767 enum HardwareType {
2768 HARDWARE_FAILED_UNKNOWN = 0;
2769 HARDWARE_FAILED_MICROPHONE = 1;
2770 HARDWARE_FAILED_CODEC = 2;
2771 HARDWARE_FAILED_SPEAKER = 3;
2772 HARDWARE_FAILED_FINGERPRINT = 4;
2773 }
2774 optional HardwareType hardware_type = 1;
2775
Maggie White6dcd8572019-01-31 14:11:50 -08002776 /**
2777 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002778 * the same hardware_type. The specific locations are vendor defined integers,
2779 * referring to board-specific numbering schemes.
2780 */
2781 optional int32 hardware_location = 2;
2782
Maggie White6dcd8572019-01-31 14:11:50 -08002783 /**
2784 * failure_code is specific to the HardwareType of the failed hardware.
2785 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002786 */
Maggie White6dcd8572019-01-31 14:11:50 -08002787 enum HardwareErrorCode {
2788 UNKNOWN = 0;
2789 COMPLETE = 1;
2790 SPEAKER_HIGH_Z = 2;
2791 SPEAKER_SHORT = 3;
2792 FINGERPRINT_SENSOR_BROKEN = 4;
2793 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002794 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002795 }
2796 optional int32 failure_code = 3;
2797}
2798
2799/**
2800 * Log an event when the device has been physically dropped.
2801 * Reported from the /vendor partition.
2802 */
2803message PhysicalDropDetected {
2804 // Confidence that the event was actually a drop, 0 -> 100
2805 optional int32 confidence_pctg = 1;
2806 // Peak acceleration of the drop, in 1/1000s of a g.
2807 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002808 // Duration of freefall in ms
2809 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002810}
2811
2812/**
2813 * Log bucketed battery charge cycles.
2814 *
2815 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002816 * a given charge point. For example, if 10 cycle buckets are
2817 * initialized, bucket 1 is the lowest 1/10th of the battery,
2818 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002819 *
2820 * Logged from:
2821 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2822 */
2823message ChargeCyclesReported {
2824 optional int32 cycle_bucket_1 = 1;
2825 optional int32 cycle_bucket_2 = 2;
2826 optional int32 cycle_bucket_3 = 3;
2827 optional int32 cycle_bucket_4 = 4;
2828 optional int32 cycle_bucket_5 = 5;
2829 optional int32 cycle_bucket_6 = 6;
2830 optional int32 cycle_bucket_7 = 7;
2831 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002832 optional int32 cycle_bucket_9 = 9;
2833 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002834}
2835
2836/**
Howard Roa46b6582018-09-18 16:45:02 -07002837 * Log battery health snapshot.
2838 *
2839 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2840 * are snapshotted periodically over 24hrs.
2841 */
2842message BatteryHealthSnapshot {
2843 enum BatterySnapshotType {
2844 UNKNOWN = 0;
2845 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2846 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2847 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2848 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2849 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2850 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2851 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2852 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2853 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2854 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2855 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2856 }
2857 optional BatterySnapshotType type = 1;
2858 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002859 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002860 // Voltage Battery Voltage, in microVolts.
2861 optional int32 voltage_micro_volt = 3;
2862 // Current Battery current, in microAmps.
2863 optional int32 current_micro_amps = 4;
2864 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2865 optional int32 open_circuit_micro_volt = 5;
2866 // Resistance Battery Resistance, in microOhms.
2867 optional int32 resistance_micro_ohm = 6;
2868 // Level Battery Level, as % of full.
2869 optional int32 level_percent = 7;
2870}
2871
2872/**
2873 * Log slow I/O operations on the primary storage.
2874 */
2875message SlowIo {
2876 // Classifications of IO Operations.
2877 enum IoOperation {
2878 UNKNOWN = 0;
2879 READ = 1;
2880 WRITE = 2;
2881 UNMAP = 3;
2882 SYNC = 4;
2883 }
2884 optional IoOperation operation = 1;
2885
2886 // The number of slow IO operations of this type over 24 hours.
2887 optional int32 count = 2;
2888}
2889
2890/**
2891 * Log battery caused shutdown with the last recorded voltage.
2892 */
2893message BatteryCausedShutdown {
2894 // The last recorded battery voltage prior to shutdown.
2895 optional int32 last_recorded_micro_volt = 1;
2896}
2897
2898/**
Tej Singha72344992019-04-17 18:55:08 -07002899 * Logs when ThermalService receives throttling events.
2900 *
2901 * Logged from:
2902 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2903 */
2904message ThermalThrottlingSeverityStateChanged {
2905 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2906 optional android.os.TemperatureTypeEnum sensor_type = 1;
2907
2908 // The name of the temperature source. Eg. CPU0
2909 optional string sensor_name = 2;
2910
2911 // Temperature in tenths of a degree C.
2912 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2913 optional int32 temperature_deci_celsius = 3;
2914
2915 // Relative severity of the throttling, see enum definition.
2916 optional android.os.ThrottlingSeverityEnum severity = 4;
2917}
2918
2919/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002920 * Logs the duration of a davey (jank of >=700ms) when it occurs
2921 *
2922 * Logged from:
2923 * frameworks/base/libs/hwui/JankTracker.cpp
2924 */
2925message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002926 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002927 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002928
Tej Singhbb8554a2018-01-26 11:59:14 -08002929 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002930 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002931}
2932
2933/**
Bookatze5885242017-10-24 20:10:31 -07002934 * Logs phone signal strength changes.
2935 *
2936 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002937 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002938 */
2939message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002940 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2941 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002942}
2943
Yangster4ccebea2018-10-09 17:09:02 -07002944
2945/**
2946 * Logs when the phone state, sim state or signal strength changes
2947 *
2948 * Logged from:
2949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2950 */
2951message PhoneServiceStateChanged {
2952 optional android.telephony.ServiceStateEnum state = 1;
2953 optional android.telephony.SimStateEnum sim_state = 2;
2954 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2955}
2956
2957/**
2958 * Logs when the phone becomes on or off.
2959 *
2960 * Logged from:
2961 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2962 */
2963message PhoneStateChanged {
2964 enum State {
2965 OFF = 0;
2966 ON = 1;
2967 }
2968 optional State state = 1;
2969}
2970
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002971message BackGesture {
2972 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002973 DEFAULT_BACK_TYPE = 0;
2974 COMPLETED = 1;
2975 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2976 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2977 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2978 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2979 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2980 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2981 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002982 }
2983 optional BackType type = 1;
2984
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002985 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2986 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2987 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2988 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2989 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2990 optional int32 left_boundary = 8; // left edge width + left inset
2991 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2992
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002993 enum WindowHorizontalLocation {
2994 DEFAULT_LOCATION = 0;
2995 LEFT = 1;
2996 RIGHT = 2;
2997 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002998 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002999}
3000
3001message ExclusionRectStateChanged {
3002 optional string component_name = 1; // if not available, simply packageName
3003 optional int32 requested_height = 2; // px
3004 optional int32 rejected_height = 3; // px
3005
3006 enum WindowHorizontalLocation {
3007 DEFAULT_LOCATION = 0;
3008 LEFT = 1;
3009 RIGHT = 2;
3010 }
3011 optional WindowHorizontalLocation x_location = 4;
3012 optional bool landscape = 5;
3013 optional bool splitscreen = 6;
3014 optional int32 duration_millis = 7;
3015}
3016
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003017/**
3018 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3019 *
3020 * Logged from:
3021 * packages/apps/Launcher3
3022 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003023message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003024 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003025 optional android.stats.launcher.LauncherState src_state = 2;
3026 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003027 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3028 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3029
3030 // The event id (e.g., app launch, drag and drop, long press)
3031 optional int32 event_id = 6;
3032 // The event's source or target id (e.g., icon, task, button)
3033 optional int32 target_id = 7;
3034 // If the target needs to be tracked, use this id field
3035 optional int32 instance_id = 8;
3036 optional int32 uid = 9 [(is_uid) = true];
3037 optional string package_name = 10;
3038 optional string component_name = 11;
3039
3040 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003041 optional int32 grid_x = 12 [default = -1];
3042 optional int32 grid_y = 13 [default = -1];
3043 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003044
3045 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003046 optional int32 grid_x_parent = 15 [default = -1];
3047 optional int32 grid_y_parent = 16 [default = -1];
3048 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003049
3050 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3051 optional int32 hierarchy = 18;
3052
3053 optional bool is_work_profile = 19;
3054
3055 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003056 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003057
3058 // e.g., folderLabelState can be captured in the following two fields
3059 optional int32 from_state = 21;
3060 optional int32 to_state = 22;
3061
3062 // e.g., autofilled or suggested texts that are not user entered
3063 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003064
3065 // e.g., number of contents inside a container (e.g., icons inside a folder)
3066 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003067}
3068
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003069/**
3070 * Used for snapshot of the HomeScreen UI elements
3071 *
3072 * Logged from:
3073 * packages/apps/Launcher3
3074 */
3075message LauncherStaticLayout {
3076 // The event id (e.g., snapshot, drag and drop)
3077 optional int32 event_id = 1;
3078 // The event's source or target id (e.g., icon, shortcut, widget)
3079 optional int32 target_id = 2;
3080 // If the target needs to be tracked, use this id field
3081 optional int32 instance_id = 3;
3082 optional int32 uid = 4 [(is_uid) = true];
3083 optional string package_name = 5;
3084 optional string component_name = 6;
3085
3086 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003087 optional int32 grid_x = 7 [default = -1];
3088 optional int32 grid_y = 8 [default = -1];
3089 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003090
3091 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003092 // e.g., when used with widgets target, use these values for (span_x, span_y)
3093 optional int32 grid_x_parent = 10 [default = -1];
3094 optional int32 grid_y_parent = 11 [default = -1];
3095 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003096
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003097 // UNKNOWN = 0
3098 // HOTSEAT = 1
3099 // WORKSPACE = 2
3100 // FOLDER_HOTSEAT = 3
3101 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003102 optional int32 hierarchy = 13;
3103
3104 optional bool is_work_profile = 14;
3105
3106 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3107 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003108
3109 // e.g., number of icons inside a folder
3110 optional int32 cardinality = 16;
3111
3112 // e.g., (x, y) span of the widget inside homescreen grid system
3113 optional int32 span_x = 17 [default = 1];
3114 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003115}
3116
3117/**
3118 * Logs when Wallpaper or ThemePicker UI has changed.
3119 *
3120 * Logged from:
3121 * packages/apps/ThemePicker
3122 * packages/apps/WallpaperPicker2
3123 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003124message StyleUIChanged {
3125 optional android.stats.style.Action action = 1;
3126 optional int32 color_package_hash = 2;
3127 optional int32 font_package_hash = 3;
3128 optional int32 shape_package_hash = 4;
3129 optional int32 clock_package_hash = 5;
3130 optional int32 launcher_grid = 6;
3131 optional int32 wallpaper_category_hash = 7;
3132 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003133 optional int32 color_preference = 9;
3134 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003135}
3136
David Chenc28b2bb2017-10-24 12:52:52 -07003137/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003138 * Logs when Settings UI has changed.
3139 *
3140 * Logged from:
3141 * packages/apps/Settings
3142 */
3143message SettingsUIChanged {
3144 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003145 * Where this SettingsUIChange event comes from. For example, if
3146 * it's a PAGE_VISIBLE event, where the page is opened from.
3147 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003148 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003149
3150 /**
3151 * What the UI action is.
3152 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003153 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003154
3155 /**
3156 * Where the action is happening
3157 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003158 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003159
3160 /**
3161 * What preference changed in this event.
3162 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003163 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003164
3165 /**
3166 * The new value of the changed preference.
3167 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003168 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003169}
3170
3171/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003172 * Logs basic timing information about touch events.
3173 * Reported at most every 5 minutes while device is being interacted with.
3174 *
3175 * Logged from:
3176 * frameworks/native/services/inputflinger
3177 */
3178message TouchEventReported {
3179 /**
3180 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003181 * and the standard deviation of the time spent processing touchscreen events
3182 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003183 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003184 * On supported devices, the starting point is taken during the hard interrupt inside the
3185 * kernel touch driver. On all other devices, the starting point is taken inside
3186 * the kernel's input event subsystem upon receipt of the input event.
3187 * The ending point is taken inside InputDispatcher, just after the input event
3188 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003189 */
3190 // Minimum value
3191 optional float latency_min_micros = 1;
3192 // Maximum value
3193 optional float latency_max_micros = 2;
3194 // Average value
3195 optional float latency_mean_micros = 3;
3196 // Standard deviation
3197 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003198 // Number of touch events (input_event) in this report
3199 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003200}
3201
3202/**
Philip Quinn0eded622019-01-29 12:46:28 -08003203 * Logs gesture classification and timing information for touch events.
3204 *
3205 * Logged from:
3206 * frameworks/base/core/java/android/view/GestureDetector.java
3207 * frameworks/base/core/java/android/view/View.java
3208 */
3209message TouchGestureClassified {
3210 // The source of the classification (e.g. Java class name).
3211 optional string source = 1;
3212
3213 enum Classification {
3214 UNKNOWN_CLASSIFICATION = 0;
3215 SINGLE_TAP = 1;
3216 DOUBLE_TAP = 2;
3217 LONG_PRESS = 3;
3218 DEEP_PRESS = 4;
3219 SCROLL = 5;
3220 }
3221 // The classification of the gesture.
3222 optional Classification classification = 2;
3223
3224 // The interval from the start of a touch event stream until the
3225 // classification was made.
3226 optional int32 latency_millis = 3;
3227
3228 // The distance from the location of the first touch event to the
3229 // location of the touch event when the classification was made.
3230 optional float displacement_px = 4;
3231}
3232
3233/**
David Chenc28b2bb2017-10-24 12:52:52 -07003234 * Logs that a setting was updated.
3235 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003236 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003237 * The tag and is_default allow resetting of settings to default values based on the specified
3238 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3239 */
3240message SettingChanged {
3241 // The name of the setting.
3242 optional string setting = 1;
3243
3244 // The change being imposed on this setting. May represent a number, eg "3".
3245 optional string value = 2;
3246
3247 // The new value of this setting. For most settings, this is same as value. For some settings,
3248 // value is +X or -X where X represents an element in a set. For example, if the previous value
3249 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3250 // The +/- feature is currently only used for location_providers_allowed.
3251 optional string new_value = 3;
3252
3253 // The previous value of this setting.
3254 optional string prev_value = 4;
3255
3256 // The tag used with the is_default for resetting sets of settings. This is generally null.
3257 optional string tag = 5;
3258
Bookatz90867622018-01-31 15:05:57 -08003259 // True if this setting with tag should be resettable.
3260 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003261
David Chenbd789912018-03-16 17:19:55 -07003262 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003263 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003264
3265 enum ChangeReason {
3266 UPDATED = 1; // Updated can be an insertion or an update.
3267 DELETED = 2;
3268 }
3269 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003270}
Chenjie Yub3dda412017-10-24 13:41:59 -07003271
Chenjie Yu05013b32017-11-21 10:21:41 -08003272/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003273 * Logs activity going to foreground or background
3274 *
3275 * Logged from:
3276 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3277 */
3278message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003279 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003280 optional string pkg_name = 2;
3281 optional string class_name = 3;
3282
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003283 enum State {
3284 BACKGROUND = 0;
3285 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003286 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003287 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003288}
David Chenc8a43242017-10-17 16:23:28 -07003289
3290/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003291 * Logs when a volume entered low Storage state.
3292 * Logged from:
3293 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3294 */
3295message LowStorageStateChanged {
3296 // Volume that ran out of storage.
3297 optional string volume_description = 1;
3298
3299 enum State {
3300 UNKNOWN = 0;
3301 OFF = 1;
3302 ON = 2;
3303 }
3304 optional State state = 2;
3305}
3306
3307/**
3308 * Logs when an app is downgraded.
3309 * Logged from:
3310 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3311 */
3312message AppDowngraded {
3313 optional string package_name = 1;
3314 // Size of the package (all data) before being downgraded.
3315 optional int64 size_in_bytes_before = 2;
3316 // Size of the package (all data) after being downgraded.
3317 optional int64 size_in_bytes_after = 3;
3318
3319 optional bool aggressive = 4;
3320}
3321
3322/**
3323 * Logs when an app is optimized after being downgraded.
3324 * Logged from:
3325 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3326 */
3327message AppOptimizedAfterDowngraded {
3328 optional string package_name = 1;
3329}
3330
3331/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003332 * Logs whenever an app is installed on external storage.
3333 * Logged from:
3334 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3335 */
3336message AppInstallOnExternalStorageReported {
3337 // The type of external storage.
3338 optional android.stats.storage.ExternalStorageType storage_type = 1;
3339 // The name of the package that is installed on the sd card.
3340 optional string package_name = 2;
3341}
3342
3343/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003344 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003345 * Logged from:
3346 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3347 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003349 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003350
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003351 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003352
3353 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003355 optional string process_name = 3;
3356
3357 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003358 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003359
3360 optional string package_name = 5;
3361
3362 enum InstantApp {
3363 UNAVAILABLE = 0;
3364 FALSE = 1;
3365 TRUE = 2;
3366 }
3367 optional InstantApp is_instant_app = 6;
3368
3369 enum ForegroundState {
3370 UNKNOWN = 0;
3371 BACKGROUND = 1;
3372 FOREGROUND = 2;
3373 }
3374 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003375
3376 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003377}
David Chen9e3808c2017-11-20 17:25:34 -08003378
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003379/**
3380 * Logs when a WTF (What a Terrible Failure) happened.
3381 * Logged from:
3382 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3383 */
3384message WTFOccurred {
3385 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003386
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003387 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003388
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003389 // The name of the process.
3390 // system_server if it is not by an app
3391 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003392
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003393 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003394 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003395
3396 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003397}
3398
3399/**
3400 * Logs when system server reports low memory.
3401 * Logged from:
3402 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3403 */
3404message LowMemReported {
3405}
3406
3407/**
3408 * Logs when an app ANR (App Not Responding) occurs.
3409 * Logged from:
3410 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3411 */
3412message ANROccurred {
3413 optional int32 uid = 1 [(is_uid) = true];
3414
3415 optional string process_name = 2;
3416
3417 optional string short_component_name = 3;
3418
3419 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003420
3421 enum InstantApp {
3422 UNAVAILABLE = 0;
3423 FALSE = 1;
3424 TRUE = 2;
3425 }
3426 optional InstantApp is_instant_app = 5;
3427
3428 enum ForegroundState {
3429 UNKNOWN = 0;
3430 BACKGROUND = 1;
3431 FOREGROUND = 2;
3432 }
3433 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003434
3435 optional android.server.ErrorSource error_source = 7;
3436
3437 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003438}
3439
Bookatza7020bd2018-08-28 16:29:35 -07003440/**
3441 * Logs when the vibrator state changes.
3442 * Logged from:
3443 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3444 */
3445message VibratorStateChanged {
3446 repeated AttributionNode attribution_node = 1;
3447
3448 enum State {
3449 OFF = 0;
3450 ON = 1;
3451 }
3452 optional State state = 2;
3453
3454 // Duration (in milliseconds) requested to keep the vibrator on.
3455 // Only applicable for State == ON.
3456 optional int64 duration_millis = 3;
3457}
3458
David Chen0a368b22017-12-06 16:28:16 -08003459/*
3460 * Allows other apps to push events into statsd.
3461 * Logged from:
3462 * frameworks/base/core/java/android/util/StatsLog.java
3463 */
David Chen0b5c90c2018-01-25 16:51:49 -08003464message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003465 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003466 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003467
3468 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3469 optional int32 label = 2;
3470
3471 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3472 // predicates for the metrics).
3473 enum State {
3474 UNKNOWN = 0;
3475 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3476 STOP = 2;
3477 START = 3;
3478 }
3479 optional State state = 3;
3480}
3481
David Chen9e3808c2017-11-20 17:25:34 -08003482/**
Bookatz7948c872018-09-04 12:58:33 -07003483 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3484 * For example, this could be due to the user manually changing the time.
3485 *
3486 * Logged from:
3487 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3488 */
3489message WallClockTimeShifted {
3490 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3491 optional int64 wall_clock_timestamp_millis = 1;
3492}
3493
3494/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003495 * Logs when statsd detects an anomaly.
3496 *
3497 * Logged from:
3498 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3499 */
3500message AnomalyDetected {
3501 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003502 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003503
Yangster-mac94e197c2018-01-02 16:03:03 -08003504 // Id of the config whose anomaly detection alert fired.
3505 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003506
Yangster-mac94e197c2018-01-02 16:03:03 -08003507 // Id of the alert (i.e. name of the anomaly that was detected).
3508 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003509}
3510
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003511message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003512 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003513 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003514
3515 // The app package name.
3516 optional string pkg_name = 2;
3517
3518 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003519 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003520 WARM = 1;
3521 HOT = 2;
3522 COLD = 3;
3523 }
3524 // The transition type.
3525 optional TransitionType type = 3;
3526
3527 // The activity name.
3528 optional string activity_name = 4;
3529
3530 // The name of the calling app. Empty if not set.
3531 optional string calling_pkg_name = 5;
3532
3533 // Whether the app is an instant app.
3534 optional bool is_instant_app = 6;
3535
3536 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003537 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538
Bookatz80d11a02018-01-16 10:46:35 -08003539 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003540
David Chen0b5c90c2018-01-25 16:51:49 -08003541 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003542 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003543 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003545 optional int32 bind_application_delay_millis = 11;
3546 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003547
3548 // Empty if not set.
3549 optional string launch_token = 13;
3550
Calin Juravle759fbda2018-02-20 19:52:30 +00003551 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003552 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003553
3554 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003555 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003556}
3557
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003558message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003559 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003560 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003561
3562 // The app package name.
3563 optional string pkg_name = 2;
3564
3565 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003566 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567 WARM = 1;
3568 HOT = 2;
3569 COLD = 3;
3570 }
3571 // The transition type.
3572 optional TransitionType type = 3;
3573
3574 // The activity name.
3575 optional string activity_name = 4;
3576}
3577
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003578message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003579 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003580 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003581
3582 // The app package name.
3583 optional string pkg_name = 2;
3584
3585 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003586 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003587 WITH_BUNDLE = 1;
3588 WITHOUT_BUNDLE = 2;
3589 }
3590 // The transition type.
3591 optional TransitionType type = 3;
3592
3593 // The activity name.
3594 optional string activity_name = 4;
3595
3596 optional bool transition_process_running = 5;
3597
3598 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003599 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003600}
3601
Bookatz8fcd09a2017-12-18 13:01:10 -08003602/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003603 * Logs a picture-in-picture action
3604 * Logged from:
3605 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3606 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3607 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3608 */
3609message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003610 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003611 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003612
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003613 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003614
Chenjie Yu52cacc62017-12-08 18:11:45 -08003615 enum State {
3616 ENTERED = 1;
3617 EXPANDED_TO_FULL_SCREEN = 2;
3618 MINIMIZED = 3;
3619 DISMISSED = 4;
3620 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003621 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003622}
3623
3624/**
Chenjie Yue8904192017-12-08 19:12:57 -08003625 * Logs overlay action
3626 * Logged from:
3627 * services/core/java/com/android/server/wm/Session.java
3628 */
3629message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003630 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003631
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003632 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003633
3634 optional bool using_alert_window = 3;
3635
3636 enum State {
3637 ENTERED = 1;
3638 EXITED = 2;
3639 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003640 optional State state = 4
3641 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003642}
3643
Adam Bookatz38767932020-02-05 12:13:40 -08003644/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003645 * Logs foreground service starts and stops.
3646 * Note that this is not when a service starts or stops, but when it is
3647 * considered foreground.
3648 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003649 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003650 */
3651message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003652 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003653 // package_name + "/" + class_name
3654 optional string short_name = 2;
3655
3656 enum State {
3657 ENTER = 1;
3658 EXIT = 2;
3659 }
3660 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003661
3662 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3663 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3664 optional bool allow_while_in_use_permission = 4;
3665}
3666
3667/**
3668 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3669 * A foreground service session is any continuous period during which the uid holds at least one
3670 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3671 * Accesses initiated while the uid is in the TOP state are ignored.
3672 * Sessions with no attempted accesses are not logged.
3673 * Logged from
3674 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3675 */
3676message ForegroundServiceAppOpSessionEnded {
3677 optional int32 uid = 1 [(is_uid) = true];
3678
3679 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003680 // Only following four ops are logged
3681 // COARSE_LOCATION = 0
3682 // FINE_LOCATION = 1
3683 // CAMERA = 26
3684 // RECORD_AUDIO = 27
3685 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003686
3687 // The uid's permission mode for accessing the AppOp during this fgs session.
3688 enum Mode {
3689 MODE_UNKNOWN = 0;
3690 MODE_ALLOWED = 1; // Always allowed
3691 MODE_IGNORED = 2; // Denied
3692 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3693 }
3694 optional Mode app_op_mode = 3;
3695
3696 // Number of times this AppOp was requested and allowed.
3697 optional int32 count_ops_accepted = 4;
3698 // Number of times this AppOp was requested but denied.
3699 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003700}
3701
Chenjie Yue8904192017-12-08 19:12:57 -08003702/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003703 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3704 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3705 * attributed back to the parent (host) uid. One example is Chrome.
3706 *
3707 * Logged from:
3708 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3709 */
3710message IsolatedUidChanged {
3711 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003712 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003713 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003714 optional int32 parent_uid = 1;
3715
3716 optional int32 isolated_uid = 2;
3717
3718 // We expect an isolated uid to be removed before if it's used for another parent uid.
3719 enum Event {
3720 REMOVED = 0;
3721 CREATED = 1;
3722 }
3723 optional Event event = 3;
3724}
3725
3726/*
3727 * Logs the reception of an incoming network packet causing the main system to wake up for
3728 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3729 * and processed by WakeupController.cpp.
3730 */
3731message PacketWakeupOccurred {
3732 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3733 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003734 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003735 // The interface name on which the packet was received.
3736 optional string iface = 2;
3737 // The ethertype value of the packet.
3738 optional int32 ethertype = 3;
3739 // String representation of the destination MAC address of the packet.
3740 optional string destination_hardware_address = 4;
3741 // String representation of the source address of the packet if this was an IP packet.
3742 optional string source_ip = 5;
3743 // String representation of the destination address of the packet if this was an IP packet.
3744 optional string destination_ip = 6;
3745 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3746 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3747 // families.
3748 optional int32 ip_next_header = 7;
3749 // The source port if this was a TCP or UDP packet.
3750 optional int32 source_port = 8;
3751 // The destination port if this was a TCP or UDP packet.
3752 optional int32 destination_port = 9;
3753}
3754
3755/*
3756 * Logs the memory stats for an app on startup.
3757 * Logged from:
3758 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3759 */
3760message AppStartMemoryStateCaptured {
3761 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003763
3764 // The process name.
3765 optional string process_name = 2;
3766
3767 // The activity name.
3768 optional string activity_name = 3;
3769
3770 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003771 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772
3773 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003775
3776 // RSS
3777 optional int64 rss_in_bytes = 6;
3778
3779 // CACHE
3780 optional int64 cache_in_bytes = 7;
3781
3782 // SWAP
3783 optional int64 swap_in_bytes = 8;
3784}
3785
3786/*
3787 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3788 * for LMK event.
3789 * Logged from:
3790 * system/core/lmkd/lmkd.c
3791 */
3792message LmkStateChanged {
3793 enum State {
3794 UNKNOWN = 0;
3795 START = 1;
3796 STOP = 2;
3797 }
3798 optional State state = 1;
3799}
3800
3801/*
3802 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3803 * Logged from:
3804 * system/core/lmkd/lmkd.c
3805 */
3806message LmkKillOccurred {
3807 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003808 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003809
3810 // The process name.
3811 optional string process_name = 2;
3812
3813 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003814 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003815
3816 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003817 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818
3819 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003820 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003821
3822 // RSS
3823 optional int64 rss_in_bytes = 6;
3824
3825 // CACHE
3826 optional int64 cache_in_bytes = 7;
3827
3828 // SWAP
3829 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003830
3831 // The elapsed real time of start of the process.
3832 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003833
3834 // Min oom adj score considered by lmkd.
3835 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003836}
3837
Rajeev Kumar51b54602018-03-01 12:18:26 -08003838/*
3839 * Logs when the ActivityManagerService detects that an app died.
3840 *
3841 * Logged from:
3842 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3843 */
3844message AppDied {
3845 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003846 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003847}
3848
Howard Ro21a039c2018-08-06 14:55:47 -07003849/**
3850 * An atom for generic metrics logging. Available from Android Q.
3851 */
3852message GenericAtom {
3853 // The uid of the application that sent this custom atom.
3854 optional int32 uid = 1 [(is_uid) = true];
3855
3856 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003857 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003858}
3859
Tej Singhd6d6d772018-09-05 17:41:25 -07003860/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003861 * Atom for simple logging of user interaction and impression events, such as "the user touched
3862 * this button" or "this dialog was displayed".
3863 * Keep the UI event stream clean: don't use for system or background events.
3864 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003865 *
3866 * Logged from:
3867 * frameworks/base/services/core/java/com/android/server/
3868 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003869 */
3870message UiEventReported {
3871 // The event_id.
3872 optional int32 event_id = 1;
3873 // The event's source or target uid and package, if applicable.
3874 // For example, the package posting a notification, or the destination package of a share.
3875 optional int32 uid = 2 [(is_uid) = true];
3876 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003877 // An identifier used to disambiguate which logs refer to a particular instance of some
3878 // UI element. Useful when there might be multiple instances simultaneously active.
3879 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003880}
3881
3882/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003883 * Reports a notification was created or updated.
3884 *
3885 * Logged from:
3886 * frameworks/base/services/core/java/com/android/server/notification/
3887 */
3888message NotificationReported {
3889 // The event_id (as for UiEventReported).
3890 optional int32 event_id = 1;
3891 // The notifying app's uid and package.
3892 optional int32 uid = 2 [(is_uid) = true];
3893 optional string package_name = 3;
3894 // A small system-assigned identifier for the notification.
3895 // Locally probably-unique, but expect collisions across users and/or days.
3896 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003897 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3898 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003899
3900 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003901 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3902 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3903 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003904
3905 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003906 optional string category = 10; // App-assigned notification category (API-defined strings)
3907 optional int32 style = 11; // App-assigned notification style
3908 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003909
3910 // Ordering, importance and interruptiveness
3911
Will Brockman7614f6962020-02-10 19:43:03 -05003912 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003913
Will Brockman7614f6962020-02-10 19:43:03 -05003914 optional android.stats.sysui.NotificationImportance importance = 14;
3915 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003916
3917 enum NotificationImportanceExplanation {
3918 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3919 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3920 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3921 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3922 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3923 // Like _APP, but based on pre-channels priority signal.
3924 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3925 }
3926
Will Brockman7614f6962020-02-10 19:43:03 -05003927 optional NotificationImportanceExplanation importance_source = 16;
3928 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3929 optional NotificationImportanceExplanation importance_initial_source = 18;
3930 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3931 optional int32 assistant_hash = 20;
3932 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003933}
3934
3935message Notification {
3936 // The notifying app's uid and package.
3937 optional int32 uid = 1 [(is_uid) = true];
3938 optional string package_name = 2;
3939 // A small system-assigned identifier for the notification.
3940 optional int32 instance_id = 3;
3941
3942 // Grouping information.
3943 optional int32 group_instance_id = 4;
3944 optional bool is_group_summary = 5;
3945
3946 // The section of the shade that the notification is in.
3947 // See NotificationSectionsManager.PriorityBucket.
3948 enum NotificationSection {
3949 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003950 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003951 SECTION_MEDIA_CONTROLS = 2;
3952 SECTION_PEOPLE = 3;
3953 SECTION_ALERTING = 4;
3954 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003955 }
3956 optional NotificationSection section = 6;
3957}
3958
3959message NotificationList {
3960 repeated Notification notifications = 1; // An ordered sequence of notifications.
3961}
3962
3963/**
3964 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3965 *
3966 * Logged from:
3967 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3968 */
3969message NotificationPanelReported {
3970 // The event_id (as for UiEventReported).
3971 optional int32 event_id = 1;
3972 optional int32 num_notifications = 2;
3973 // The notifications in the panel, in the order that they appear there.
3974 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3975}
3976
3977/**
3978 * Reports a notification channel, or channel group, was created, updated, or deleted.
3979 *
3980 * Logged from:
3981 * frameworks/base/services/core/java/com/android/server/notification/
3982 */
3983message NotificationChannelModified {
3984 // The event_id (as for UiEventReported).
3985 optional int32 event_id = 1;
3986 // The notifying app's uid and package.
3987 optional int32 uid = 2 [(is_uid) = true];
3988 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003989 // Hash of app-assigned notification channel ID or channel-group ID
3990 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003991 // Previous importance setting, if applicable
3992 optional android.stats.sysui.NotificationImportance old_importance = 5;
3993 // New importance setting
3994 optional android.stats.sysui.NotificationImportance importance = 6;
3995}
3996
3997
3998/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003999 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004000 *
4001 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004002 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004003 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004004message BiometricAcquired {
4005 // Biometric modality that was acquired.
4006 optional android.hardware.biometrics.ModalityEnum modality = 1;
4007 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4008 optional int32 user = 2;
4009 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4010 optional bool is_crypto = 3;
4011 // Action that the device is performing. Acquired messages are only expected for enroll and
4012 // authenticate. Other actions may indicate an error.
4013 optional android.hardware.biometrics.ActionEnum action = 4;
4014 // The client that this acquisition was received for.
4015 optional android.hardware.biometrics.ClientEnum client = 5;
4016 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4017 optional int32 acquire_info = 6;
4018 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4019 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004020 // Dictates if this message should trigger additional debugging.
4021 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004022}
4023
4024/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004025 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004026 *
4027 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004028 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004029 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004030message BiometricAuthenticated {
4031 // Biometric modality that was used.
4032 optional android.hardware.biometrics.ModalityEnum modality = 1;
4033 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4034 optional int32 user = 2;
4035 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4036 // storage.
4037 optional bool is_crypto = 3;
4038 // The client that this acquisition was received for.
4039 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004040 // If authentication requires user confirmation. See BiometricPrompt's
4041 // setRequireConfirmation(bool) method.
4042 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004043
Kevin Chyn1741a072019-01-17 11:54:40 -08004044 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004045 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004046 REJECTED = 1;
4047 PENDING_CONFIRMATION = 2;
4048 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004049 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004050
4051 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004052 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004053 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4054 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4055 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4056 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004057 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004058 // Dictates if this message should trigger additional debugging.
4059 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004060}
4061
4062/**
4063 * Logs when a biometric error occurs.
4064 *
4065 * Logged from:
4066 * frameworks/base/services/core/java/com/android/server/biometrics
4067 */
4068message BiometricErrorOccurred {
4069 // Biometric modality that was used.
4070 optional android.hardware.biometrics.ModalityEnum modality = 1;
4071 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4072 optional int32 user = 2;
4073 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4074 optional bool is_crypto = 3;
4075 // Action that the device is performing.
4076 optional android.hardware.biometrics.ActionEnum action = 4;
4077 // The client that this acquisition was received for.
4078 optional android.hardware.biometrics.ClientEnum client = 5;
4079 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4080 // are unique to modality.
4081 optional int32 error_info = 6;
4082 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4083 // by the vendor and not specified by the HIDL interface.
4084 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004085 // Dictates if this message should trigger additional debugging.
4086 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004087 // Time spent during the authentication attempt.
4088 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004089}
4090
4091/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004092 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004093 * Logged from:
4094 * frameworks/base/services/core/java/com/android/server/biometrics
4095 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004096message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004097 // Biometric modality.
4098 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004099 // Type of issue detected.
4100 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004101 // Dictates if this message should trigger additional debugging.
4102 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004103}
Howard Ro688ae182018-09-25 00:09:36 -07004104
joshmccloskey6f952b22019-03-25 20:59:35 -07004105/**
4106 * Logs when a biometric enrollment occurs.
4107 *
4108 * Logged from:
4109 * frameworks/base/services/core/java/com/android/server/biometrics
4110 */
4111message BiometricEnrolled {
4112 // Biometric modality that was used.
4113 optional android.hardware.biometrics.ModalityEnum modality = 1;
4114 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4115 optional int32 user = 2;
4116 // The amount of time the enrollment took in milliseconds.
4117 optional int64 latency_millis = 3;
4118 // Whether or not the enrollment was successful.
4119 optional bool success = 4;
4120}
4121
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004122/*
Tej Singh0d176952019-01-16 19:10:54 -08004123 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004124 */
Tej Singh0d176952019-01-16 19:10:54 -08004125message FlagFlipUpdateOccurred {
4126 // If the event is from a flag config package, specify the package name.
4127 optional string flag_flip_package_name = 1;
4128
4129 // The order id of the package
4130 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004131}
4132
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004133/**
4134 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004135 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004136 */
4137message TrainExperimentIds {
4138 repeated int64 experiment_id = 1;
4139}
4140
Yangster-macb89807e2018-11-15 21:10:57 -08004141/*
4142 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004143 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004144 */
4145message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004146 // Name of the train.
4147 optional string train_name = 1;
4148 // Version code for a "train" of packages that need to be installed atomically
4149 optional int64 train_version_code = 2;
4150 // After installation of this package, device requires a restart.
4151 optional bool requires_staging = 3;
4152 // Rollback should be enabled for this install.
4153 optional bool rollback_enabled = 4;
4154 // Requires low latency monitoring if possible.
4155 optional bool requires_low_latency_monitor = 5;
4156
Yangster-macb89807e2018-11-15 21:10:57 -08004157 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004158 UNKNOWN = 0;
4159 INSTALL_REQUESTED = 1;
4160 INSTALL_STARTED = 2;
4161 INSTALL_STAGED_NOT_READY = 3;
4162 INSTALL_STAGED_READY = 4;
4163 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004164 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4165 // and INSTALL_FAILURE_COMMIT.
4166 INSTALL_FAILURE = 6 [deprecated = true];
4167 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004168 INSTALL_CANCELLED = 7;
4169 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004170 INSTALLER_ROLLBACK_INITIATED = 9;
4171 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4172 INSTALLER_ROLLBACK_STAGED = 11;
4173 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4174 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4175 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4176 INSTALLER_ROLLBACK_SUCCESS = 15;
4177 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004178 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4179 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4180 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4181 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4182 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4183 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004184 INSTALL_FAILURE_DOWNLOAD = 23;
4185 INSTALL_FAILURE_STATE_MISMATCH = 24;
4186 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004187 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004188 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004189 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004190 // Possible experiment ids for monitoring this push.
4191 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4192 // user id
4193 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004194 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004195 // Whether or not this is a rollback event
4196 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004197}
4198
Tej Singhc9203082019-05-03 13:42:23 -07004199/* Test atom, is not logged anywhere */
4200message TestAtomReported {
4201 repeated AttributionNode attribution_node = 1;
4202 optional int32 int_field = 2;
4203 optional int64 long_field = 3;
4204 optional float float_field = 4;
4205 optional string string_field = 5;
4206 optional bool boolean_field = 6;
4207 enum State {
4208 UNKNOWN = 0;
4209 OFF = 1;
4210 ON = 2;
4211 }
4212 optional State state = 7;
4213 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4214}
4215
Maggie Whitefc1aa592018-11-28 21:55:23 -08004216/** Represents USB port overheat event. */
4217message UsbPortOverheatEvent {
4218 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4219 optional int32 plug_temperature_deci_c = 1;
4220
4221 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4222 optional int32 max_temperature_deci_c = 2;
4223
4224 /* Time between USB plug event and overheat threshold trip, in seconds. */
4225 optional int32 time_to_overheat_secs = 3;
4226
4227 /* Time between overheat threshold trip and hysteresis, in seconds. */
4228 optional int32 time_to_hysteresis_secs = 4;
4229
4230 /* Time between hysteresis and active mitigation ending, in seconds. */
4231 optional int32 time_to_inactive_secs = 5;
4232};
4233
Maggie White8735b852019-01-18 11:40:49 -08004234/**
4235 * Logs total effective full charge and discharge cycles on a battery.
4236 * Here are some examples of one effective cycle:
4237 * 1) the battery charges from 0% to 100% and drains back to 0%,
4238 * 2) charging from 50% to 100% and draining back to 50% twice.
4239 * Pulled from:
4240 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4241 */
4242message BatteryCycleCount {
4243 /* Number of total charge and discharge cycles on the system battery. */
4244 optional int32 cycle_count = 1;
4245}
4246
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004247/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004248 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4249 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004250 * Pulled from:
4251 * StatsCompanionService
4252 */
4253
Carmen Agimof12dec122019-03-06 16:14:38 +00004254message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004255
Carmen Agimof12dec122019-03-06 16:14:38 +00004256 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004257 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004258 PUBLIC = 1;
4259 PRIVATE = 2;
4260 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004261 }
4262
Carmen Agimof12dec122019-03-06 16:14:38 +00004263 // The type of external storage.
4264 optional android.stats.storage.ExternalStorageType storage_type = 1;
4265 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4266 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004267 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004268 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004269}
4270
Yangster-macb89807e2018-11-15 21:10:57 -08004271/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004272 * Logs when a connection becomes available and lost.
4273 * Logged in StatsCompanionService.java
4274 */
4275message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004276 // Id of the network.
4277 optional int32 net_id = 1;
4278
4279 enum State {
4280 UNKNOWN = 0;
4281 CONNECTED = 1;
4282 DISCONNECTED = 2;
4283 }
4284 // Connected state of a network.
4285 optional State state = 2;
4286}
4287
4288/**
4289 * Logs when a service starts and stops.
4290 * Logged from:
4291 * services/core/java/com/android/server/am/ActiveServices.java
4292 */
4293message ServiceStateChanged {
4294
4295 optional int32 uid = 1 [(is_uid) = true];
4296
4297 optional string package_name = 2;
4298
4299 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004300
4301 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004302 START = 1;
4303 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004304 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004305
4306 optional State state = 4;
4307}
4308
4309/**
4310 * Logs when a service is launched.
4311 * Logged from:
4312 * services/core/java/com/android/server/am/ActiveServices.java
4313 */
4314message ServiceLaunchReported {
4315
4316 optional int32 uid = 1 [(is_uid) = true];
4317
4318 optional string package_name = 2;
4319
4320 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004321}
Howard Ro688ae182018-09-25 00:09:36 -07004322
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004323/**
4324 * Logs when a hidden API is used.
4325 *
4326 * Logged from:
4327 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4328 */
4329message HiddenApiUsed {
4330 // The uid of the app making the hidden access.
4331 optional int32 uid = 1 [(is_uid) = true];
4332
4333 // Signature of the method or field accessed.
4334 optional string signature = 2;
4335
4336 enum AccessMethod {
4337 NONE = 0;
4338 REFLECTION = 1;
4339 JNI = 2;
4340 LINKING = 3;
4341 }
4342
4343 // Type of access.
4344 optional AccessMethod access_method = 3;
4345
4346 // Whether the access was prevented or not.
4347 optional bool access_denied = 4;
4348}
4349
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004350/**
4351 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4352 * - When user sees privacy chip
4353 * - When user clicks privacy chip
4354 * - How does the user exit the Privacy Dialog
4355 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004356 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4357 */
4358message PrivacyIndicatorsInteracted {
4359
4360 enum Type {
4361 UNKNOWN = 0;
4362 CHIP_VIEWED = 1;
4363 CHIP_CLICKED = 2;
4364 DIALOG_PRIVACY_SETTINGS = 3;
4365 DIALOG_DISMISS = 4;
4366 DIALOG_LINE_ITEM = 5;
4367 }
4368
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004369 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004370
4371 // Used if the type is LINE_ITEM
4372 optional string package_name = 2;
4373}
4374
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004375/**
4376 * Logs information about a package that is moved from the internal to external storage and vice
4377 * versa.
4378 * It logs the package name, the type of the external storage where the package is installed
4379 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4380 * and the move type: if it's from internal to external or the other way around.
4381 *
4382 * Logged from:
4383 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4384 */
4385message AppMovedStorageReported {
4386 enum MoveType {
4387 UNKNOWN = 0;
4388 TO_EXTERNAL = 1;
4389 TO_INTERNAL = 2;
4390 }
4391 // The type of the external storage.
4392 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4393 // The type of move.
4394 optional MoveType move_type = 2;
4395 // The name of the package that was moved.
4396 optional string package_name = 3;
4397}
4398
jianjin8f2dee02019-03-29 14:03:08 -07004399/**
4400 * Logs when system server watchdog occurs.
4401 * Logged from:
4402 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4403 */
4404message SystemServerWatchdogOccurred {
4405 optional string subject = 1;
4406}
4407
4408/**
4409 * Logs when new file added to tombstones.
4410 * Logged from:
4411 * frameworks/base/core/java/com/android/server/BootReceiver.java
4412 */
4413message TombStoneOccurred {
4414}
4415
Hai Zhang5d3328d2019-04-13 21:25:06 +08004416/*
4417 * Information about a role request
4418 *
4419 * Logged from:
4420 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4421 */
4422message RoleRequestResultReported {
4423 // UID of application requesting the role
4424 optional int32 requesting_uid = 1;
4425
4426 // Package name of application requesting the role
4427 optional string requesting_package_name = 2;
4428
4429 // The role to be granted
4430 optional string role_name = 3;
4431
4432 // The count of applications qualifying for the role
4433 optional int32 qualifying_count = 4;
4434
4435 // UID of application current granted the role
4436 optional int32 current_uid = 5;
4437
4438 // Package name of application current granted the role
4439 optional string current_package_name = 6;
4440
4441 // UID of another application that user chose to grant the role to, instead of the requesting
4442 // application
4443 optional int32 granted_another_uid = 7;
4444
4445 // Package name of another application that user chose to grant the role to, instead of the
4446 // requesting application
4447 optional string granted_another_package_name = 8;
4448
4449 enum Result {
4450 UNDEFINED = 0;
4451 // role request was ignored
4452 IGNORED = 1;
4453 // role request was ignored because it's already granted
4454 IGNORED_ALREADY_GRANTED = 2;
4455 // role request was ignored because the application isn't qualified
4456 IGNORED_NOT_QUALIFIED = 3;
4457 // role request was ignored because user said it should be always denied
4458 IGNORED_USER_ALWAYS_DENIED = 4;
4459 // role was granted by user action
4460 USER_GRANTED = 5;
4461 // role was denied by user action
4462 USER_DENIED = 6;
4463 // role was denied by user granting another application the role
4464 USER_DENIED_GRANTED_ANOTHER = 7;
4465 // role was denied and set to be always denied by the user
4466 USER_DENIED_WITH_ALWAYS = 8;
4467 }
4468 // The result of the role request
4469 optional Result result = 9;
4470}
4471
Mark Tabrya824a642019-11-05 12:26:12 -08004472/**
4473 * Logs when a Vehicle Maps Service client's connection state has changed
4474 *
4475 * Logged from:
4476 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4477 */
4478message VmsClientConnectionStateChanged {
4479 // The UID of the VMS client app
4480 optional int32 uid = 1 [(is_uid) = true];
4481
4482 enum State {
4483 UNKNOWN = 0;
4484 // Attempting to connect to the client
4485 CONNECTING = 1;
4486 // Client connection established
4487 CONNECTED = 2;
4488 // Client connection closed unexpectedly
4489 DISCONNECTED = 3;
4490 // Client connection closed by VMS
4491 TERMINATED = 4;
4492 // Error establishing the client connection
4493 CONNECTION_ERROR = 5;
4494 }
4495
4496 optional State state = 2;
4497}
4498
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004499/**
4500 * Logs when MediaProvider has successfully finished scanning a storage volume.
4501 *
4502 * Logged from:
4503 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4504 */
shafik43825842020-04-02 17:30:24 +01004505message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004506 enum Reason {
4507 // Scan triggered due to unknown reason
4508 UNKNOWN = 0;
4509 // Scan triggered due to storage volume being mounted
4510 MOUNTED = 1;
4511 // Scan triggered due to explicit user action or app request
4512 DEMAND = 2;
4513 // Scan triggered due to idle maintenance
4514 IDLE = 3;
4515 }
4516
4517 // Volume type that this event pertains to
4518 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4519 // Reason why this scan was triggered
4520 optional Reason reason = 2;
4521 // Total number of files scanned
4522 optional int64 item_count = 3;
4523 // Duration of scan, normalized per file
4524 optional float normalized_duration_millis = 4;
4525 // Number of database inserts, normalized per file
4526 optional float normalized_insert_count = 5;
4527 // Number of database updates, normalized per file
4528 optional float normalized_update_count = 6;
4529 // Number of database deletes, normalized per file
4530 optional float normalized_delete_count = 7;
4531}
4532
4533/**
4534 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4535 *
4536 * Logged from:
4537 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4538 */
shafik43825842020-04-02 17:30:24 +01004539message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004540 // Volume type that this event pertains to
4541 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004542 // UID of app that requested deletion
4543 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004544 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004545 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004546}
4547
4548/**
4549 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4550 *
4551 * Logged from:
4552 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4553 */
shafik43825842020-04-02 17:30:24 +01004554message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004555 enum Result {
4556 UNKNOWN = 0;
4557 USER_GRANTED = 1;
4558 AUTO_GRANTED = 2;
4559 USER_DENIED = 3;
4560 USER_DENIED_WITH_PREJUDICE = 4;
4561 AUTO_DENIED = 5;
4562 }
4563
4564 // Volume type that this event pertains to
4565 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004566 // UID of app that requested permission
4567 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004568 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004569 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004570 // Result of this request
shafik43825842020-04-02 17:30:24 +01004571 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004572}
4573
4574/**
4575 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4576 *
4577 * Logged from:
4578 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4579 */
shafik43825842020-04-02 17:30:24 +01004580message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004581 // Volume type that this event pertains to
4582 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4583 // Old database version code
4584 optional int32 version_from = 2;
4585 // New database version code
4586 optional int32 version_to = 3;
4587 // Total number of files in database
4588 optional int64 item_count = 4;
4589 // Duration of schema change, normalized per file
4590 optional float normalized_duration_millis = 5;
4591}
4592
4593/**
4594 * Logs when MediaProvider has finished an idle maintenance job.
4595 *
4596 * Logged from:
4597 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4598 */
shafik43825842020-04-02 17:30:24 +01004599message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004600 // Volume type that this event pertains to
4601 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4602
4603 // Total number of files in database
4604 optional int64 item_count = 2;
4605 // Duration of idle maintenance, normalized per file
4606 optional float normalized_duration_millis = 3;
4607 // Number of thumbnails found to be stale, normalized per file
4608 optional float normalized_stale_thumbnails = 4;
4609 // Number of items found to be expired, normalized per file
4610 optional float normalized_expired_media = 5;
4611}
4612
Keun young Park3e033cb2019-12-18 11:27:35 -08004613/**
4614 * Represents boot time event with duration in ms.
4615 *
4616 * Logged from: bootstat and various system server components. Check each enums for details.
4617 */
4618message BootTimeEventDuration {
4619 enum DurationEvent {
4620 UNKNOWN = 0;
4621 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4622 ABSOLUTE_BOOT_TIME = 1;
4623 // Bootloader's 1st stage execution time.
4624 // Logged from bootstat.
4625 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4626 // Bootloader's 1st stage loading time.
4627 // Logged from bootstat.
4628 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4629 // Bootloader's kernel loading time.
4630 // Logged from bootstat.
4631 BOOTLOADER_KERNEL_LOAD = 4;
4632 // Bootloader's 2nd stage execution time.
4633 // Logged from bootstat.
4634 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4635 // Bootloader's 2nd stage loading time.
4636 // Logged from bootstat.
4637 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4638 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4639 // for locked device.
4640 // Logged from bootstat.
4641 BOOTLOADER_UI_WAIT = 7;
4642 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4643 // Logged from bootstat.
4644 BOOTLOADER_TOTAL = 8;
4645 // Shutdown duration inside init for the reboot before the current boot up.
4646 // Logged from f/b/services/.../BootReceiver.java.
4647 SHUTDOWN_DURATION = 9;
4648 // Total time for mounting of disk devices during bootup.
4649 // Logged from f/b/services/.../BootReceiver.java.
4650 MOUNT_DEFAULT_DURATION = 10;
4651 // Total time for early stage mounting of disk devices during bootup.
4652 // Logged from f/b/services/.../BootReceiver.java.
4653 MOUNT_EARLY_DURATION = 11;
4654 // Total time for late stage mounting of disk devices during bootup.
4655 // Logged from f/b/services/.../BootReceiver.java.
4656 MOUNT_LATE_DURATION = 12;
4657 // Average time to scan non-system app after OTA
4658 // Logged from f/b/services/.../PackageManagerService.java
4659 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4660 // Time to initialize Package manager after OTA
4661 // Logged from f/b/services/.../PackageManagerService.java
4662 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4663 // Time to scan all system app from Package manager after OTA
4664 // Logged from f/b/services/.../PackageManagerService.java
4665 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4666 // Init's total time for cold boot stage.
4667 // Logged from bootstat.
4668 COLDBOOT_WAIT = 16;
4669 // Init's total time for initializing selinux.
4670 // Logged from bootstat.
4671 SELINUX_INIT = 17;
4672 // Time since last factory reset.
4673 // Logged from bootstat.
4674 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004675 // Init's total time spent for completing the 1st stage.
4676 // Logged from bootstat.
4677 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004678 }
4679
4680 // Type of the event.
4681 optional DurationEvent event = 1;
4682 // Duration of the event in ms.
4683 optional int64 duration_millis = 2;
4684}
4685
4686/**
4687 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4688 * since boot-up.
4689 *
4690 * Logged from: bootstat and various system server components. Check each enums for details.
4691 */
4692message BootTimeEventElapsedTime {
4693 enum ElapsedTimeEvent {
4694 UNKNOWN = 0;
4695 // Time when init starts 1st stage. Logged from bootstat.
4696 ANDROID_INIT_STAGE_1 = 1;
4697 // Time when sys.boot_completed prop is set.
4698 // Logged from bootstat.
4699 BOOT_COMPLETE = 2;
4700 // BOOT_COMPLETE for encrypted device.
4701 BOOT_COMPLETE_ENCRYPTION = 3;
4702 // BOOT_COMPLETE for device with no encryption.
4703 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4704 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004705 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004706 // BOOT_COMPLETE after factory reset.
4707 FACTORY_RESET_BOOT_COMPLETE = 6;
4708 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4709 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004710 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4711 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004712 // BOOT_COMPLETE after OTA.
4713 OTA_BOOT_COMPLETE = 9;
4714 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4715 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004716 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4717 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004718 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4719 // Logged from f/b/services/.../UserController.java
4720 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4721 // Time when the system starts sending BOOT_COMPLETED broadcast.
4722 // Logged from f/b/services/.../UserController.java
4723 FRAMEWORK_BOOT_COMPLETED = 13;
4724 // Time when the package manager starts init.
4725 // Logged from f/b/services/.../SystemServer.java
4726 PACKAGE_MANAGER_INIT_START = 14;
4727 // Time when package manager is ready
4728 // Logged from f/b/services/.../SystemServer.java
4729 PACKAGE_MANAGER_INIT_READY = 15;
4730 // Represents the time when user has entered unlock credential for system with user pin.
4731 // Logged from bootstat.
4732 POST_DECRYPT = 16;
4733 // Represents the start of zygote's init.
4734 // Logged from zygote itself.
4735 ZYGOTE_INIT_START = 17;
4736 // Represents the start of secondary zygote's init.
4737 // TODO: add logging to zygote
4738 SECONDARY_ZYGOTE_INIT_START = 18;
4739 // Represents the start of system server's init.
4740 // Logged from f/b/services/.../SystemServer.java
4741 SYSTEM_SERVER_INIT_START = 19;
4742 // Represents the completion of system server's init.
4743 // Logged from f/b/services/.../SystemServer.java
4744 SYSTEM_SERVER_READY = 20;
4745 // Represents the start of launcher during boot-up.
4746 // TODO: add logging
4747 LAUNCHER_START = 21;
4748 // Represents the completion of launcher's initial rendering. User can use other apps from
4749 // launcher from this point.
4750 // TODO: add logging
4751 LAUNCHER_SHOWN = 22;
4752 }
4753
4754 // Type of the event.
4755 optional ElapsedTimeEvent event = 1;
4756 // Time since bootup for the event.
4757 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4758 optional int64 time_millis = 2;
4759}
4760
4761/**
4762 * Boot time events with UTC time.
4763 *
4764 * Logged from: bootstat and various system server components. Check each enums for details.
4765 */
4766message BootTimeEventUtcTime {
4767 enum UtcTimeEvent {
4768 UNKNOWN = 0;
4769 // Time of the bootstat's marking of 1st boot after the last factory reset.
4770 // Logged from bootstat.
4771 FACTORY_RESET_RESET_TIME = 1;
4772 // The time when bootstat records FACTORY_RESET_* events. This is close to
4773 // BOOT_COMPLETE time for the current bootup.
4774 // Logged from bootstat.
4775 FACTORY_RESET_CURRENT_TIME = 2;
4776 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4777 // Logged from bootstat.
4778 FACTORY_RESET_RECORD_VALUE = 3;
4779 }
4780
4781 // Type of the event.
4782 optional UtcTimeEvent event = 1;
4783 // UTC time for the event.
4784 optional int64 utc_time_secs = 2;
4785}
4786
4787/**
4788 * Boot time events representing specific error code during bootup.
4789 * Meaning of error code can be different per each event type.
4790 *
4791 * Logged from: bootstat and various system server components. Check each enums for details.
4792 */
4793message BootTimeEventErrorCode {
4794 enum ErrorCodeEvent {
4795 UNKNOWN = 0;
4796 // Linux error code for time() call to get the current UTC time.
4797 // Logged from bootstat.
4798 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4799 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4800 // as UMOUNT_STAT_* from init/reboot.cpp.
4801 // Logged from f/b/services/.../BootReceiver.java.
4802 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004803 // Reprepsents fie system mounting error code of /data partition for the current boot.
4804 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004805 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004806 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004807 }
4808
4809 // Type of the event.
4810 optional ErrorCodeEvent event = 1;
4811 // error code defined per each event type.
4812 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4813 // FS_MGR_FS_STAT.
4814 optional int32 error_code = 2;
4815}
4816
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004817/**
4818 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4819 * after an OTA.
4820 *
4821 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004822 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004823 */
4824message SnapshotMergeReported {
4825 // Keep in sync with
4826 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4827 enum UpdateState {
4828 // No update or merge is in progress.
4829 NONE = 0;
4830 // An update is applying; snapshots may already exist.
4831 INITIATED = 1;
4832 // An update is pending, but has not been successfully booted yet.
4833 UNVERIFIED = 2;
4834 // The kernel is merging in the background.
4835 MERGING = 3;
4836 // Post-merge cleanup steps could not be completed due to a transient
4837 // error, but the next reboot will finish any pending operations.
4838 MERGE_NEEDS_REBOOT = 4;
4839 // Merging is complete, and needs to be acknowledged.
4840 MERGE_COMPLETED = 5;
4841 // Merging failed due to an unrecoverable error.
4842 MERGE_FAILED = 6;
4843 // The update was implicitly cancelled, either by a rollback or a flash
4844 // operation via fastboot. This state can only be returned by WaitForMerge.
4845 CANCELLED = 7;
4846 };
4847
4848 // Status of the update after the merge attempts.
4849 optional UpdateState final_state = 1;
4850
4851 // Time to complete a merge operation in milliseconds.
4852 // A negative value corresponds to the case in which the merge operation
4853 // was interrupted and resumed (e.g. in case of a system reboot during the
4854 // merge).
4855 optional int64 duration_millis = 2;
4856
4857 // Number of reboots that occurred after issuing and before completing the
4858 // merge of all the snapshot devices.
4859 optional int32 intermediate_reboots = 3;
4860}
4861
Chenjie Yubbcbc602018-02-05 16:51:52 -08004862//////////////////////////////////////////////////////////////////////
4863// Pulled atoms below this line //
4864//////////////////////////////////////////////////////////////////////
4865
4866/**
David Chenc8a43242017-10-17 16:23:28 -07004867 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4868 *
4869 * Pulled from:
4870 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4871 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004872message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004873 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004874
4875 optional int64 rx_bytes = 2;
4876
4877 optional int64 rx_packets = 3;
4878
4879 optional int64 tx_bytes = 4;
4880
4881 optional int64 tx_packets = 5;
4882}
4883
4884/**
4885 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4886 *
4887 * Pulled from:
4888 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4889 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004890message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004891 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004892
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004893 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4894 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004895
4896 optional int64 rx_bytes = 3;
4897
4898 optional int64 rx_packets = 4;
4899
4900 optional int64 tx_bytes = 5;
4901
4902 optional int64 tx_packets = 6;
4903}
4904
4905/**
4906 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4907 *
4908 * Pulled from:
4909 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4910 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004911message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004912 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004913
4914 optional int64 rx_bytes = 2;
4915
4916 optional int64 rx_packets = 3;
4917
4918 optional int64 tx_bytes = 4;
4919
4920 optional int64 tx_packets = 5;
4921}
4922
4923/**
4924 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4925 *
4926 * Pulled from:
4927 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4928 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004929message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004930 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004931
Yao Chenc40a19d2018-03-15 16:48:25 -07004932 // 1 denotes foreground and 0 denotes background. This is called Set in
4933 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004934 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004935
4936 optional int64 rx_bytes = 3;
4937
4938 optional int64 rx_packets = 4;
4939
4940 optional int64 tx_bytes = 5;
4941
4942 optional int64 tx_packets = 6;
4943}
4944
4945/**
junyulai8d1a6092020-05-07 13:38:15 +08004946 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
4947 * Note that data is expected to be sliced into more dimensions in future. In other words,
4948 * the caller must not assume the data is unique when filtering with a set of matching conditions.
4949 * Thus, as the dimension grows, the caller will not be affected.
4950 *
4951 * Pulled from:
4952 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4953 */
4954message DataUsageBytesTransfer {
4955 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4956 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4957 // states combined, not including debug states. See NetworkStats#SET_*.
4958 optional int32 state = 1;
4959
4960 optional int64 rx_bytes = 2;
4961
4962 optional int64 rx_packets = 3;
4963
4964 optional int64 tx_bytes = 4;
4965
4966 optional int64 tx_packets = 5;
4967
4968 // Radio Access Technology (RAT) type of this record, should be one of
4969 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4970 // the record is for all rat types combined.
4971 optional int32 rat_type = 6;
4972
4973 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
4974 // record is combined regardless of subscription.
4975 optional string sim_mcc = 7;
4976 optional string sim_mnc = 8;
4977
4978 // Enumeration of opportunistic states with an additional ALL state indicates the record is
4979 // combined regardless of the boolean value in its field.
4980 enum DataSubscriptionState {
4981 ALL = 1;
4982 OPPORTUNISTIC = 2;
4983 NOT_OPPORTUNISTIC = 3;
4984 }
4985 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
4986 // record is combined regardless of opportunistic data subscription.
4987 // See {@link SubscriptionManager#setOpportunistic}.
4988 optional DataSubscriptionState opportunistic_data_sub = 9;
4989}
4990
4991/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004992 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4993 *
4994 * Pulled from:
4995 * StatsCompanionService
4996 */
4997message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004998 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004999
5000 optional int64 rx_bytes = 2;
5001
5002 optional int64 tx_bytes = 3;
5003}
5004
5005/**
David Chenc8a43242017-10-17 16:23:28 -07005006 * Pulls the kernel wakelock durations. This atom is adapted from
5007 * android/internal/os/KernelWakelockStats.java
5008 *
5009 * Pulled from:
5010 * StatsCompanionService using KernelWakelockReader.
5011 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005012message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005013 optional string name = 1;
5014
5015 optional int32 count = 2;
5016
5017 optional int32 version = 3;
5018
Yangster-maca8a30442018-10-13 23:46:34 -07005019 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005020}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005021
Chenjie Yu05013b32017-11-21 10:21:41 -08005022/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005023 * Pulls low power state information. If power.stats HAL is not available, this
5024 * includes platform and subsystem sleep state information,
5025 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5026 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005027 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005028 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005029 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5030 * as defined in:
5031 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005032 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005033message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005034 // Subsystem name
5035 optional string subsystem_name = 1;
5036 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5037 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005038 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5039 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005040 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005041 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005042 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005043 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005044 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005045}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005046
Chenjie Yu05013b32017-11-21 10:21:41 -08005047/**
Bookatz92da2832018-11-01 18:10:03 -07005048 * Pulls on-device power measurement information.
5049 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5050 * Pulled from:
5051 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5052 */
5053message OnDevicePowerMeasurement {
5054 // Name of the subsystem (to which the rail belongs).
5055 optional string subsystem_name = 1;
5056
5057 // Rail name. The rail lies within the subsystem.
5058 optional string rail_name = 2;
5059
5060 // Time (in ms since boot) at which the rail energy value was measured.
5061 // This may differ slightly from the time that statsd logs this information.
5062 optional uint64 measurement_timestamp_millis = 3;
5063
5064 // Accumulated energy used via the rail since device boot in uWs.
5065 optional uint64 energy_microwatt_secs = 4;
5066}
5067
5068/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005069 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005070 * Pulls the time the cpu spend on the frequency index. Frequency index
5071 * starts from highest to lowest. The value should be monotonically
5072 * increasing since boot. However, if there is a cpu
5073 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005074 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005075message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005076 optional uint32 cluster = 1;
5077 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005078 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005079}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005080
Chenjie Yu05013b32017-11-21 10:21:41 -08005081/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005082 * Pulls Cpu Time Per Uid.
5083 * Note that isolated process uid time should be attributed to host uids.
5084 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005085message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005086 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005087 optional uint64 user_time_micros = 2;
5088 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005089}
5090
5091/**
5092 * Pulls Cpu Time Per Uid per frequency.
5093 * Note that isolated process uid time should be attributed to host uids.
5094 * For each uid, we order the time by descending frequencies.
5095 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005096message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005097 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005098 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005099 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005100}
Hugo Benichi884970e2017-11-14 22:42:46 +09005101
Chenjie Yu05013b32017-11-21 10:21:41 -08005102/**
5103 * Pulls Wifi Controller Activity Energy Info
5104 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005105message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005106 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005107 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005108 // stack reported state
5109 // TODO: replace this with proto enum
5110 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005111 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005112 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005113 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005114 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005115 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005116 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005117 // product of current(mA), voltage(V) and time(ms)
5118 optional uint64 controller_energy_used = 6;
5119}
5120
5121/**
5122 * Pulls Modem Activity Energy Info
5123 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005124message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005125 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005126 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005127 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005128 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005129 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005130 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005131 /**
5132 * Tx power index
5133 * index 0 = tx_power < 0dBm
5134 * index 1 = 0dBm < tx_power < 5dBm
5135 * index 2 = 5dBm < tx_power < 15dBm
5136 * index 3 = 15dBm < tx_power < 20dBm
5137 * index 4 = tx_power > 20dBm
5138 */
5139 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005140 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005141 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005142 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005143 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005144 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005145 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005146 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005147 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005148 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005149 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005150 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005151 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005152 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005153}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005154
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005155/**
5156 * Pulls Bluetooth Activity Energy Info
5157 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5158 */
5159message BluetoothActivityInfo {
5160 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005161 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005162 // bluetooth stack state
5163 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005164 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005165 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005166 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005167 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005168 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005169 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005170 // product of current(mA), voltage(V) and time(ms)
5171 optional uint64 energy_used = 6;
5172}
5173
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005174/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005175 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005176 *
5177 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005178 */
5179message ProcessMemoryState {
5180 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005181 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005182
5183 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005184 // Usually package name, "system" for system server.
5185 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005186 optional string process_name = 2;
5187
Rafal Slawikda51b932018-12-13 16:31:33 +00005188 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005189 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005190
5191 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005192 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005193
5194 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005195 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005196
Rajeev Kumar90235992018-01-29 11:06:48 -08005197 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005198 // Value is read from memory.stat, field total_rss if per-app memory
5199 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005200 optional int64 rss_in_bytes = 6;
5201
5202 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005203 // Value is read from memory.stat, field total_cache if per-app memory
5204 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005205 optional int64 cache_in_bytes = 7;
5206
5207 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005208 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005209 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005210 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005211
Rafal Slawik203c3db2019-09-25 19:53:01 +01005212 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005213 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005214
Rafal Slawik203c3db2019-09-25 19:53:01 +01005215 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5216 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005217
Rafal Slawik203c3db2019-09-25 19:53:01 +01005218 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5219 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005220}
5221
5222/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005223 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005224 *
5225 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5226 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005227 *
5228 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005229 */
5230message ProcessMemoryHighWaterMark {
5231 // The uid if available. -1 means not available.
5232 optional int32 uid = 1 [(is_uid) = true];
5233
Rafal Slawikda51b932018-12-13 16:31:33 +00005234 // The process name.
5235 // Usually package name or process cmdline.
5236 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005237 optional string process_name = 2;
5238
Rafal Slawik239b6802019-09-09 18:46:01 +01005239 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5240 // computed by converting kilobytes to bytes.
5241 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5242
Rafal Slawik3bea8952018-11-15 12:39:33 +00005243 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5244 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005245 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005246}
5247
5248/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005249 * Logs the memory stats for a process.
5250 *
5251 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5252 * and for selected native processes.
5253 */
5254message ProcessMemorySnapshot {
5255 // The uid if available. -1 means not available.
5256 optional int32 uid = 1 [(is_uid) = true];
5257
5258 // The process name.
5259 // Usually package name or process cmdline.
5260 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5261 optional string process_name = 2;
5262
5263 // The pid of the process.
5264 // Allows to disambiguate instances of the process.
5265 optional int32 pid = 3;
5266
5267 // The current OOM score adjustment value.
5268 // Read from ProcessRecord for managed processes.
5269 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5270 optional int32 oom_score_adj = 4;
5271
5272 // The current RSS of the process.
5273 // VmRSS from /proc/pid/status.
5274 optional int32 rss_in_kilobytes = 5;
5275
5276 // The current anon RSS of the process.
5277 // RssAnon from /proc/pid/status.
5278 optional int32 anon_rss_in_kilobytes = 6;
5279
5280 // The current swap size of the process.
5281 // VmSwap from /proc/pid/status.
5282 optional int32 swap_in_kilobytes = 7;
5283
5284 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5285 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5286}
5287
5288/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005289 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005290 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005291message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005292 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005293}
5294
5295/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005296 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005297 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005298message SystemUptime {
5299 // Milliseconds since the system was booted.
5300 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5301 // for external input).
5302 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005303 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005304}
5305
5306/*
5307 * Reads from /proc/uid_concurrent_active_time which has the format:
5308 * active: X (X is # cores)
5309 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5310 * [uid1]: [time-0] [time-1] [time-2] ... ...
5311 * ...
5312 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5313 * The file contains a monotonically increasing count of time for a single boot.
5314 */
5315message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005316 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005317 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005318}
5319
5320/**
5321 * Reads from /proc/uid_concurrent_policy_time which has the format:
5322 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5323 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5324 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5325 * ...
5326 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5327 * The file contains a monotonically increasing count of time for a single boot.
5328 */
5329message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005330 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005331 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005332 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005333}
5334
5335/*
5336 * Pulls free disk space, for data, system partition and temporary directory.
5337 */
5338message DiskSpace {
5339 // available bytes in data partition
5340 optional uint64 data_available_bytes = 1;
5341 // available bytes in system partition
5342 optional uint64 system_available_bytes = 2;
5343 // available bytes in download cache or temp directories
5344 optional uint64 temp_available_bytes = 3;
5345}
Tej Singhbf972d92018-01-10 20:51:13 -08005346
5347/**
5348 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005349 *
5350 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005351 */
5352message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005353 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005354}
5355
5356/**
5357 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005358 * Pulled from:
5359 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005360 */
5361message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005362 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005363}
5364
5365/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005366 * Pulls battery voltage.
5367 * Pulled from:
5368 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5369 */
5370message BatteryVoltage {
5371 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005372 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005373}
5374
5375/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005376 * Pulls battery level (percent full, from 0 to 100).
5377 *
5378 * Pulled from:
5379 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5380 */
5381message BatteryLevel {
5382 // Battery level. Should be in [0, 100].
5383 optional int32 battery_level = 1;
5384}
5385
5386/**
Tej Singhd89137e2018-03-26 14:51:40 -07005387 * Pulls the temperature of various parts of the device.
5388 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005389 *
Maggie White442b6312019-04-05 16:26:44 -07005390 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005391 */
5392message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005393 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005394 optional android.os.TemperatureTypeEnum sensor_location = 1;
5395
5396 // The name of the temperature source. Eg. CPU0
5397 optional string sensor_name = 2;
5398
Tej Singhd89137e2018-03-26 14:51:40 -07005399 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005400 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005401 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005402
5403 // Relative severity of the throttling, see enum definition.
5404 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005405}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005406
5407/**
5408 * Pulls the statistics of calls to Binder.
5409 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005410 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5411 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005412 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005413 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005414 */
5415message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005416 // UID of the process responsible for the binder transaction. It will be set if the process
5417 // executing the binder transaction attribute the transaction to another uid using
5418 // Binder.setThreadWorkSource().
5419 //
5420 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005421 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005422 // UID of the process executing the binder transaction.
5423 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005424 // Fully qualified class name of the API call.
5425 //
5426 // This is a system server class name.
5427 //
5428 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5429 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5430 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5431 // commonly used APIs.
5432 optional string service_class_name = 2;
5433 // Method name of the API call. It can also be a transaction code if we cannot
5434 // resolve it to a name. See Binder#getTransactionName.
5435 //
5436 // This is a system server method name.
5437 optional string service_method_name = 3;
5438 // Total number of API calls.
5439 optional int64 call_count = 4;
5440 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5441 optional bool screen_interactive = 13;
5442 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5443 // call_count will be equal to recorded_call_count.
5444 //
5445 // If recorded_call_count is different than call_count, it means data collection has been
5446 // sampled. All the fields below will be sampled in this case.
5447 optional int64 recorded_call_count = 12;
5448 // Number of exceptions thrown by the API.
5449 optional int64 recorded_exception_count = 5;
5450 // Total latency of all API calls.
5451 // Average can be computed using total_latency_micros / recorded_call_count.
5452 optional int64 recorded_total_latency_micros = 6;
5453 // Maximum latency of one API call.
5454 optional int64 recorded_max_latency_micros = 7;
5455 // Total CPU usage of all API calls.
5456 // Average can be computed using total_cpu_micros / recorded_call_count.
5457 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5458 optional int64 recorded_total_cpu_micros = 8;
5459 // Maximum CPU usage of one API call.
5460 optional int64 recorded_max_cpu_micros = 9;
5461 // Maximum parcel reply size of one API call.
5462 optional int64 recorded_max_reply_size_bytes = 10;
5463 // Maximum parcel request size of one API call.
5464 optional int64 recorded_max_request_size_bytes = 11;
5465}
5466
5467/**
5468 * Pulls the statistics of exceptions during calls to Binder.
5469 *
5470 * Binder stats are cumulative from boot unless somebody reset the data using
5471 * > adb shell dumpsys binder_calls_stats --reset
5472 */
5473message BinderCallsExceptions {
5474 // Exception class name, e.g. java.lang.IllegalArgumentException.
5475 //
5476 // This is an exception class name thrown by the system server.
5477 optional string exception_class_name = 1;
5478 // Total number of exceptions.
5479 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005480}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005481
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005482/**
5483 * Pulls the statistics of message dispatching on HandlerThreads.
5484 *
5485 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5486 * config on the device.
5487 *
5488 * Next tag: 11
5489 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005490message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005491 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005492 optional int32 uid = 1 [(is_uid) = true];
5493
5494 // Fully qualified class name of the handler target class.
5495 //
5496 // This field does not contain PII. This is a system server class name.
5497 optional string handler_class_name = 2;
5498
5499 // The name of the thread that runs the Looper.
5500 //
5501 // This field does not contain PII. This is a system server thread name.
5502 optional string looper_thread_name = 3;
5503
5504 // The name of the dispatched message.
5505 //
5506 // This field does not contain PII. This is a system server constant or class
5507 // name.
5508 optional string message_name = 4;
5509
5510 // Total number of successfully dispatched messages.
5511 optional int64 message_count = 5;
5512
5513 // Total number of messages that failed dispatching.
5514 optional int64 exception_count = 6;
5515
5516 // Total number of processed messages we have data recorded for. If we
5517 // collected data for all the messages, message_count will be equal to
5518 // recorded_message_count.
5519 //
5520 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005521 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005522 optional int64 recorded_message_count = 7;
5523
5524 // Total latency of all processed messages.
5525 // Average can be computed using recorded_total_latency_micros /
5526 // recorded_message_count.
5527 optional int64 recorded_total_latency_micros = 8;
5528
5529 // Total CPU usage of all processed message.
5530 // Average can be computed using recorded_total_cpu_micros /
5531 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005532 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005533 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005534
5535 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5536 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005537
5538 // Max recorded CPU usage of all processed messages.
5539 optional int64 recorded_max_cpu_micros = 11;
5540
5541 // Max recorded latency of all processed messages.
5542 optional int64 recorded_max_latency_micros = 12;
5543
5544 // Total number of messages we tracked the dispatching delay for. If we
5545 // collected data for all the messages, message_count will be equal to
5546 // recorded_delay_message_count.
5547 //
5548 // If recorded_delay_message_count is different than message_count, it means data
5549 // collection has been sampled or/and not all messages specified the target dispatch time.
5550 // The fields below will be sampled in this case.
5551 optional int64 recorded_delay_message_count = 13;
5552
5553 // Total dispatching delay of all processed messages.
5554 // Calculated as a difference between the target dispatching time (Message.when)
5555 // and the actual dispatching time.
5556 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5557 optional int64 recorded_total_delay_millis = 14;
5558
5559 // Max dispatching delay of all processed messages.
5560 // Calculated as a difference between the target dispatching time (Message.when)
5561 // and the actual dispatching time.
5562 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005563}
Tej Singh86dc9db2018-09-06 00:39:57 +00005564
5565/**
5566 * Pulls disk information, such as write speed and latency.
5567 */
5568message DiskStats {
5569 // Time taken to open, write 512B to, and close a file.
5570 // -1 if error performing the check.
5571 optional int64 data_write_latency_millis = 1;
5572
5573 optional bool file_based_encryption = 2;
5574
5575 // Recent disk write speed in kB/s.
5576 // -1 if error querying storageed.
5577 // 0 if data is unavailable.
5578 optional int32 recent_disk_write_speed = 3;
5579}
5580
5581
5582/**
5583 * Free and total bytes of the Data, Cache, and System partition.
5584 */
5585message DirectoryUsage {
5586 enum Directory {
5587 UNKNOWN = 0;
5588 DATA = 1;
5589 CACHE = 2;
5590 SYSTEM = 3;
5591 }
5592 optional Directory directory = 1;
5593 optional int64 free_bytes = 2;
5594 optional int64 total_bytes = 3;
5595}
5596
5597
5598/**
5599 * Size of an application: apk size, data size, and cache size.
5600 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5601 * Information is only reported for apps with the primary user (user 0).
5602 * Sizes are aggregated by package name.
5603 */
5604message AppSize {
5605 // Including uids will involve modifying diskstats logic.
5606 optional string package_name = 1;
5607 // App size in bytes. -1 if unavailable.
5608 optional int64 app_size_bytes = 2;
5609 // App data size in bytes. -1 if unavailable.
5610 optional int64 app_data_size_bytes = 3;
5611 // App cache size in bytes. -1 if unavailable.
5612 optional int64 app_cache_size_bytes = 4;
5613 // Time that the cache file was produced.
5614 // Uses System.currentTimeMillis(), which is wall clock time.
5615 optional int64 cache_time_millis = 5;
5616}
5617
5618
5619/**
5620 * Size of a particular category. Eg: photos, videos.
5621 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5622 */
5623message CategorySize {
5624 enum Category {
5625 UNKNOWN = 0;
5626 APP_SIZE = 1;
5627 APP_DATA_SIZE = 2;
5628 APP_CACHE_SIZE = 3;
5629 PHOTOS = 4;
5630 VIDEOS = 5;
5631 AUDIO = 6;
5632 DOWNLOADS = 7;
5633 SYSTEM = 8;
5634 OTHER = 9;
5635 }
5636 optional Category category = 1;
5637 // Category size in bytes.
5638 optional int64 size_bytes = 2;
5639 // Time that the cache file was produced.
5640 // Uses System.currentTimeMillis(), which is wall clock time.
5641 optional int64 cache_time_millis = 3;
5642}
Tej Singhd6d6d772018-09-05 17:41:25 -07005643
5644/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005645 * Pulls per uid I/O stats. The stats are cumulative since boot.
5646 *
5647 * Read/write bytes are I/O events from a storage device
5648 * Read/write chars are data requested by read/write syscalls, and can be
5649 * satisfied by caching.
5650 *
5651 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5652 */
5653message DiskIo {
5654 optional int32 uid = 1 [(is_uid) = true];
5655 optional int64 fg_chars_read = 2;
5656 optional int64 fg_chars_write = 3;
5657 optional int64 fg_bytes_read = 4;
5658 optional int64 fg_bytes_write = 5;
5659 optional int64 bg_chars_read = 6;
5660 optional int64 bg_chars_write = 7;
5661 optional int64 bg_bytes_read = 8;
5662 optional int64 bg_bytes_write = 9;
5663 optional int64 fg_fsync = 10;
5664 optional int64 bg_fsync= 11;
5665}
5666
5667
5668/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005669 * Pulls the number of fingerprints for each user.
5670 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005671 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005672 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005673message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005674 // The associated user. Eg: 0 for owners, 10+ for others.
5675 // Defined in android/os/UserHandle.java
5676 optional int32 user = 1;
5677 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005678 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005679}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005680
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005681/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005682 * Pulls the number of faces for each user.
5683 *
5684 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5685 */
5686message NumFacesEnrolled {
5687 // The associated user. Eg: 0 for owners, 10+ for others.
5688 // Defined in android/os/UserHandle.java
5689 optional int32 user = 1;
5690 // Number of faces registered to that user.
5691 optional int32 num_faces_enrolled = 2;
5692}
5693/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005694 * A mapping of role holder -> role
5695 */
5696message RoleHolder {
5697 // uid of the role holder
5698 optional int32 uid = 1 [(is_uid) = true];
5699
5700 // package name of the role holder
5701 optional string package_name = 2;
5702
5703 // the role held
5704 optional string role = 3;
5705}
5706
Yangsteraf9aee72018-10-12 09:26:16 -07005707message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005708 // These are all in byte resolution.
5709 optional int64 min = 1 [deprecated = true];
5710 optional int64 average = 2 [deprecated = true];
5711 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005712
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005713 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5714 // int64 fields.
5715 optional int32 mean_kb = 4;
5716 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005717}
5718
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005719// A reduced subset of process states; reducing the number of possible states allows more
5720// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5721enum ProcessStateAggregated {
5722 PROCESS_STATE_UNKNOWN = 0;
5723 // Persistent system process.
5724 PROCESS_STATE_PERSISTENT = 1;
5725 // Top activity; actually any visible activity.
5726 PROCESS_STATE_TOP = 2;
5727 // Process binding to top or a foreground service.
5728 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5729 // Processing running a foreground service.
5730 PROCESS_STATE_FGS = 4;
5731 // Important foreground process (ime, wallpaper, etc).
5732 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5733 // Important background process.
5734 PROCESS_STATE_BACKGROUND = 6;
5735 // Process running a receiver.
5736 PROCESS_STATE_RECEIVER = 7;
5737 // All kinds of cached processes.
5738 PROCESS_STATE_CACHED = 8;
5739}
5740
5741// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005742message ProcessStatsStateProto {
5743 optional android.service.procstats.ScreenState screen_state = 1;
5744
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005745 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005746
5747 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5748 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005749 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5750
5751 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005752
5753 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005754 optional int64 duration_millis = 4 [deprecated = true];
5755 // Same as above, but with minute resolution so it fits into an int32.
5756 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005757
5758 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005759 optional int64 realtime_duration_millis = 9 [deprecated = true];
5760 // Same as above, but with minute resolution so it fits into an int32.
5761 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005762
5763 // # of samples taken
5764 optional int32 sample_size = 5;
5765
5766 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005767 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005768
5769 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005770 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005771
5772 // RSS is memory resident for this process
5773 optional AggStats rss = 8;
5774}
5775
Jing Ji060d6862020-04-13 19:36:31 -07005776// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005777message ProcessStatsProto {
5778 // Name of process.
5779 optional string process = 1;
5780
5781 // Uid of the process.
5782 optional int32 uid = 2;
5783
5784 // Information about how often kills occurred
5785 message Kill {
5786 // Count of excessive CPU kills
5787 optional int32 cpu = 1;
5788
5789 // Count of kills when cached
5790 optional int32 cached = 2;
5791
5792 // PSS stats during cached kill
5793 optional AggStats cached_pss = 3;
5794 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005795 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005796
5797 // Time and memory spent in various states.
5798 repeated ProcessStatsStateProto states = 5;
5799
5800 // Total time process has been running... screen_state, memory_state, and process_state
5801 // will not be set.
5802 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005803
5804 // Association data for this process in this state;
5805 // each entry here is one association.
5806 repeated ProcessStatsAssociationProto assocs = 7;
5807}
5808
5809// Next Tag: 5
5810message ProcessStatsAssociationProto {
5811 // Procss Name of the associated process (client process of service binding)
5812 optional string assoc_process_name = 1;
5813
5814 // Package Name of the associated package (client package of service binding)
5815 optional string assoc_package_name = 2;
5816
5817 // Total count of the times this association (service binding) appeared.
5818 optional int32 total_count = 3;
5819
5820 // Uptime total duration in seconds this association (service binding) was around.
5821 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005822}
5823
5824message PackageServiceOperationStatsProto {
5825 // Operate enum: Started, Foreground, Bound, Executing
5826 optional android.service.procstats.ServiceOperationState operation = 1;
5827
5828 // Number of times the service was in this operation.
5829 optional int32 count = 2;
5830
5831 // Information about a state the service can be in.
5832 message StateStats {
5833 // Screen state enum.
5834 optional android.service.procstats.ScreenState screen_state = 1;
5835 // Memory state enum.
5836 optional android.service.procstats.MemoryState memory_state = 2;
5837
5838 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005839 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005840 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005841 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005842 }
5843 repeated StateStats state_stats = 3;
5844}
5845
5846message PackageServiceStatsProto {
5847 // Name of service component.
5848 optional string service_name = 1;
5849
5850 // The operation stats.
5851 // The package_name, package_uid, package_version, service_name will not be set to save space.
5852 repeated PackageServiceOperationStatsProto operation_stats = 2;
5853}
5854
5855message PackageAssociationSourceProcessStatsProto {
5856 // Uid of the process.
5857 optional int32 process_uid = 1;
5858 // Process name.
5859 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005860 // Package name.
5861 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005862 // Total count of the times this association appeared.
5863 optional int32 total_count = 3;
5864
5865 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005866 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005867
5868 // Total count of the times this association became actively impacting its target process.
5869 optional int32 active_count = 5;
5870
5871 // Information on one source in this association.
5872 message StateStats {
5873 // Process state enum.
5874 optional android.service.procstats.ProcessState process_state = 1;
5875 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005876 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005877 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005878 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005879 }
5880 repeated StateStats active_state_stats = 6;
5881}
5882
5883message PackageAssociationProcessStatsProto {
5884 // Name of the target component.
5885 optional string component_name = 1;
5886 // Information on one source in this association.
5887 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5888}
5889
5890
5891message ProcessStatsPackageProto {
5892 // Name of package.
5893 optional string package = 1;
5894
5895 // Uid of the package.
5896 optional int32 uid = 2;
5897
5898 // Version of the package.
5899 optional int64 version = 3;
5900
5901 // Stats for each process running with the package loaded in to it.
5902 repeated ProcessStatsProto process_stats = 4;
5903
5904 // Stats for each of the package's services.
5905 repeated PackageServiceStatsProto service_stats = 5;
5906
5907 // Stats for each association with the package.
5908 repeated PackageAssociationProcessStatsProto association_stats = 6;
5909}
5910
5911message ProcessStatsSectionProto {
5912 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005913 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005914
5915 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005916 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005917
5918 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005919 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005920
5921 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005922 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005923
5924 // System runtime library. e.g. "libdvm.so", "libart.so".
5925 optional string runtime = 5;
5926
5927 // whether kernel reports swapped pss.
5928 optional bool has_swapped_pss = 6;
5929
5930 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5931 enum Status {
5932 STATUS_UNKNOWN = 0;
5933 STATUS_COMPLETE = 1;
5934 STATUS_PARTIAL = 2;
5935 STATUS_SHUTDOWN = 3;
5936 STATUS_SYSPROPS = 4;
5937 }
5938 repeated Status status = 7;
5939
Chenjie Yub2ecc792019-01-17 10:27:26 -08005940 // Number of pages available of various types and sizes, representation fragmentation.
5941 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5942
Yangsteraf9aee72018-10-12 09:26:16 -07005943 // Stats for each process.
5944 repeated ProcessStatsProto process_stats = 8;
5945
5946 // Stats for each package.
5947 repeated ProcessStatsPackageProto package_stats = 9;
5948}
5949
Chenjie Yub2ecc792019-01-17 10:27:26 -08005950message ProcessStatsAvailablePagesProto {
5951 // Node these pages are in (as per /proc/pagetypeinfo)
5952 optional int32 node = 1;
5953
5954 // Zone these pages are in (as per /proc/pagetypeinfo)
5955 optional string zone = 2;
5956
5957 // Label for the type of these pages (as per /proc/pagetypeinfo)
5958 optional string label = 3;
5959
5960 // Distribution of number of pages available by order size. First entry in array is
5961 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5962 repeated int32 pages_per_order = 4;
5963}
5964
Chenjie Yu12e5e672018-09-14 15:54:59 -07005965/**
5966 * Pulled from ProcessStatsService.java
5967 */
5968message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005969 optional ProcessStatsSectionProto proc_stats_section = 1;
5970}
5971
Chenjie Yuf910b7802019-01-11 16:08:20 -08005972/**
5973 * Pulled from ProcessStatsService.java
5974 */
5975message ProcStatsPkgProc {
5976 optional ProcessStatsSectionProto proc_stats_section = 1;
5977}
5978
Chris Wrencdea3b72019-11-22 16:58:17 -05005979// Next Tag: 2
5980message PackageRemoteViewInfoProto {
5981 optional string package_name = 1;
5982 // add per-package additional info here (like channels)
5983}
5984
5985// Next Tag: 2
5986message NotificationRemoteViewsProto {
5987 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5988}
5989
5990/**
5991 * Pulled from NotificationManagerService.java
5992 */
5993message NotificationRemoteViews {
5994 optional NotificationRemoteViewsProto notification_remote_views = 1;
5995}
5996
Yotam Aron74299972020-01-16 16:20:58 +02005997/**
5998 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5999 */
6000message PackageNotificationPreferences {
6001 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006002 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006003 // Notification importance, which specifies when and how a notification is displayed.
6004 // Specified under core/java/android/app/NotificationManager.java.
6005 optional int32 importance = 2;
6006 // Lockscreen visibility as set by the user.
6007 optional int32 visibility = 3;
6008 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6009 // PreferencesHelper.java)
6010 optional int32 user_locked_fields = 4;
6011}
6012
6013/**
6014 * Atom that contains a list of a package's channel preferences, pulled from
6015 * NotificationManagerService.java.
6016 */
6017message PackageNotificationChannelPreferences {
6018 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006019 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006020 // Channel's ID. Should always be available.
6021 optional string channel_id = 2;
6022 // Channel's name. Should always be available.
6023 optional string channel_name = 3;
6024 // Channel's description. Optionally set by the channel creator.
6025 optional string description = 4;
6026 // Notification importance, which specifies when and how a notification is displayed. Specified
6027 // under core/java/android/app/NotificationManager.java.
6028 optional int32 importance = 5;
6029 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6030 // at core/java/android/app/NotificationChannel.java
6031 optional int32 user_locked_fields = 6;
6032 // Indicates if the channel was deleted by the app.
6033 optional bool is_deleted = 7;
6034}
6035
6036/**
6037 * Atom that contains a list of a package's channel group preferences, pulled from
6038 * NotificationManagerService.java.
6039 */
6040message PackageNotificationChannelGroupPreferences {
6041 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006042 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006043 // Channel Group's ID. Should always be available.
6044 optional string group_id = 2;
6045 // Channel Group's name. Should always be available.
6046 optional string group_name = 3;
6047 // Channel Group's description. Optionally set by group creator.
6048 optional string description = 4;
6049 // Indicates if notifications from this channel group are blocked.
6050 optional bool is_blocked = 5;
6051 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6052 // at core/java/android/app/NotificationChannelGroup.java
6053 optional int32 user_locked_fields = 6;
6054}
6055
Yangsteraf9aee72018-10-12 09:26:16 -07006056message PowerProfileProto {
6057 optional double cpu_suspend = 1;
6058
6059 optional double cpu_idle = 2;
6060
6061 optional double cpu_active = 3;
6062
6063 message CpuCluster {
6064 optional int32 id = 1;
6065 optional double cluster_power = 2;
6066 optional int32 cores = 3;
6067 repeated int64 speed = 4;
6068 repeated double core_power = 5;
6069 }
6070
6071 repeated CpuCluster cpu_cluster = 40;
6072
6073 optional double wifi_scan = 4;
6074
6075 optional double wifi_on = 5;
6076
6077 optional double wifi_active = 6;
6078
6079 optional double wifi_controller_idle = 7;
6080
6081 optional double wifi_controller_rx = 8;
6082
6083 optional double wifi_controller_tx = 9;
6084
6085 repeated double wifi_controller_tx_levels = 10;
6086
6087 optional double wifi_controller_operating_voltage = 11;
6088
6089 optional double bluetooth_controller_idle = 12;
6090
6091 optional double bluetooth_controller_rx = 13;
6092
6093 optional double bluetooth_controller_tx = 14;
6094
6095 optional double bluetooth_controller_operating_voltage = 15;
6096
6097 optional double modem_controller_sleep = 16;
6098
6099 optional double modem_controller_idle = 17;
6100
6101 optional double modem_controller_rx = 18;
6102
6103 repeated double modem_controller_tx = 19;
6104
6105 optional double modem_controller_operating_voltage = 20;
6106
6107 optional double gps_on = 21;
6108
6109 repeated double gps_signal_quality_based = 22;
6110
6111 optional double gps_operating_voltage = 23;
6112
6113 optional double bluetooth_on = 24;
6114
6115 optional double bluetooth_active = 25;
6116
6117 optional double bluetooth_at_cmd = 26;
6118
6119 optional double ambient_display = 27;
6120
6121 optional double screen_on = 28;
6122
6123 optional double radio_on = 29;
6124
6125 optional double radio_scanning = 30;
6126
6127 optional double radio_active = 31;
6128
6129 optional double screen_full = 32;
6130
6131 optional double audio = 33;
6132
6133 optional double video = 34;
6134
6135 optional double flashlight = 35;
6136
6137 optional double memory = 36;
6138
6139 optional double camera = 37;
6140
6141 optional double wifi_batched_scan = 38;
6142
6143 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006144}
Chenjie Yuab530202018-09-26 12:39:20 -07006145
6146/**
6147 * power_profile.xml and other constants for power model calculations.
6148 * Pulled from PowerProfile.java
6149 */
6150message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006151 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006152}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006153
6154/**
arangelovd5db50e2018-10-12 20:24:39 +01006155 * Logs when a user restriction was added or removed.
6156 *
6157 * Logged from:
6158 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6159 */
6160message UserRestrictionChanged {
6161 // The raw string of the user restriction as defined in UserManager.
6162 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6163 optional string restriction = 1;
6164 // Whether the restriction is enabled or disabled.
6165 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006166}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006167
6168/**
6169 * Pulls process user time and system time. Puller takes a snapshot of all pids
6170 * in the system and returns cpu stats for those that are working at the time.
6171 * Dead pids will be dropped. Kernel processes are excluded.
6172 * Min cool-down is 5 sec.
6173 */
6174message ProcessCpuTime {
6175 optional int32 uid = 1 [(is_uid) = true];
6176
6177 optional string process_name = 2;
6178 // Process cpu time in user space, cumulative from boot/process start
6179 optional int64 user_time_millis = 3;
6180 // Process cpu time in system space, cumulative from boot/process start
6181 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006182}
Misha Wagner5a51e002018-10-03 15:04:09 +01006183
6184/**
6185 * Pulls the CPU usage for each thread.
6186 *
6187 * Read from /proc/$PID/task/$TID/time_in_state files.
6188 *
6189 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6190 * time_in_state files not being present on some phones, have not been addressed. These should be
6191 * considered before a public release.
6192 */
6193message CpuTimePerThreadFreq {
6194 // UID that owns the process.
6195 optional int32 uid = 1 [(is_uid) = true];
6196 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006197 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006198 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006199 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006200 // Name of the process taken from `/proc/$PID/cmdline`.
6201 optional string process_name = 4;
6202 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6203 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006204
6205 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6206 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6207 // frequencies are given here as the alternative is sending eight separate atoms. This method
6208 // significantly reduces the amount of data created
6209 optional int32 frequency1_khz = 6;
6210 optional int32 time1_millis = 7;
6211 optional int32 frequency2_khz = 8;
6212 optional int32 time2_millis = 9;
6213 optional int32 frequency3_khz = 10;
6214 optional int32 time3_millis = 11;
6215 optional int32 frequency4_khz = 12;
6216 optional int32 time4_millis = 13;
6217 optional int32 frequency5_khz = 14;
6218 optional int32 time5_millis = 15;
6219 optional int32 frequency6_khz = 16;
6220 optional int32 time6_millis = 17;
6221 optional int32 frequency7_khz = 18;
6222 optional int32 time7_millis = 19;
6223 optional int32 frequency8_khz = 20;
6224 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006225}
Bookatz75ee60422018-11-09 12:27:37 -08006226
6227/**
Bookatz366a4432018-11-20 09:42:33 -08006228 * Pulls information about the device's build.
6229 */
6230message BuildInformation {
6231 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6232 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6233 optional string fingerprint = 1;
6234
6235 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6236 optional string brand = 2;
6237
6238 // Build.PRODUCT. The name of the overall product.
6239 optional string product = 3;
6240
6241 // Build.DEVICE. The name of the industrial design.
6242 optional string device = 4;
6243
6244 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6245 optional string version_release = 5;
6246
6247 // Build.ID. E.g. a label like "M4-rc20".
6248 optional string id = 6;
6249
6250 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6251 // represent this build.
6252 optional string version_incremental = 7;
6253
6254 // Build.TYPE. The type of build, like "user" or "eng".
6255 optional string type = 8;
6256
6257 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6258 optional string tags = 9;
6259}
6260
6261/**
Adam He420947c2019-01-23 15:59:09 -08006262 * Logs information about mismatched caller for content capture.
6263 *
6264 * Logged from:
6265 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6266 */
6267message ContentCaptureCallerMismatchReported {
6268 optional string intended_package = 1;
6269 optional string calling_package = 2;
6270}
6271
6272/**
6273 * Logs information about content capture service events.
6274 *
6275 * Logged from:
6276 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6277 */
6278message ContentCaptureServiceEvents {
6279 // The type of event.
6280 enum Event {
6281 UNKNOWN = 0;
6282 ON_CONNECTED = 1;
6283 ON_DISCONNECTED = 2;
6284 SET_WHITELIST = 3;
6285 SET_DISABLED = 4;
6286 ON_USER_DATA_REMOVED = 5;
6287 }
6288 optional Event event = 1;
6289 // component/package of content capture service.
6290 optional string service_info = 2;
6291 // component/package of target.
6292 // it's a concatenated list of component/package for SET_WHITELIST event
6293 // separated by " ".
6294 optional string target_info = 3;
6295}
6296
6297/**
6298 * Logs information about content capture session events.
6299 *
6300 * Logged from:
6301 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6302 */
6303message ContentCaptureSessionEvents {
6304 // The type of event.
6305 enum Event {
6306 UNKNOWN = 0;
6307 ON_SESSION_STARTED = 1;
6308 ON_SESSION_FINISHED = 2;
6309 SESSION_NOT_CREATED = 3;
6310 }
6311 optional int32 session_id = 1;
6312 optional Event event = 2;
6313 // (n/a on session finished)
6314 optional int32 state_flags = 3;
6315 // component/package of content capture service.
6316 optional string service_info = 4;
6317 // component/package of app.
6318 // (n/a on session finished)
6319 optional string app_info = 5;
6320 optional bool is_child_session = 6;
6321}
6322
6323/**
6324 * Logs information about session being flushed.
6325 *
6326 * Logged from:
6327 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6328 */
6329message ContentCaptureFlushed {
6330 optional int32 session_id = 1;
6331 // component/package of content capture service.
6332 optional string service_info = 2;
6333 // component/package of app.
6334 optional string app_info = 3;
6335 // session start/finish events
6336 optional int32 child_session_started = 4;
6337 optional int32 child_session_finished = 5;
6338 // count of view events.
6339 optional int32 view_appeared_count = 6;
6340 optional int32 view_disappeared_count = 7;
6341 optional int32 view_text_changed_count = 8;
6342
6343 // Flush stats.
6344 optional int32 max_events = 9;
6345 optional int32 idle_flush_freq = 10;
6346 optional int32 text_flush_freq = 11;
6347 optional int32 flush_reason = 12;
6348}
6349
6350/**
Bookatz75ee60422018-11-09 12:27:37 -08006351 * Pulls on-device BatteryStats power use calculations for the overall device.
6352 */
6353message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006354 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6355 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6356 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6357 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006358}
6359
6360/**
6361 * Pulls on-device BatteryStats power use calculations broken down by uid.
6362 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6363 * that is attributed to non-uid items. They must all be included to get the total power use.
6364 */
6365message DeviceCalculatedPowerBlameUid {
6366 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6367 optional int32 uid = 1 [(is_uid) = true];
6368
Bookatz3dbc13a2018-12-21 12:16:51 -08006369 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6370 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6371 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006372}
6373
6374/**
6375 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6376 * drain type.
6377 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6378 * is attributed uids. They must all be included to get the total power use.
6379 */
6380message DeviceCalculatedPowerBlameOther {
6381 // The type of item whose power use is being reported.
6382 enum DrainType {
6383 AMBIENT_DISPLAY = 0;
6384 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6385 BLUETOOTH = 2;
6386 CAMERA = 3;
6387 // Cell-standby
6388 CELL = 4;
6389 FLASHLIGHT = 5;
6390 IDLE = 6;
6391 MEMORY = 7;
6392 // Amount that total computed drain exceeded the drain estimated using the
6393 // battery level changes and capacity.
6394 OVERCOUNTED = 8;
6395 PHONE = 9;
6396 SCREEN = 10;
6397 // Amount that total computed drain was below the drain estimated using the
6398 // battery level changes and capacity.
6399 UNACCOUNTED = 11;
6400 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6401 WIFI = 13;
6402 }
6403 optional DrainType drain_type = 1;
6404
Bookatz3dbc13a2018-12-21 12:16:51 -08006405 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6406 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6407 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006408}
arangelov4e994062018-11-13 16:12:38 +00006409
6410/**
6411 * Logs device policy features.
6412 *
6413 * Logged from:
6414 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6415 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6416 */
6417message DevicePolicyEvent {
6418 // The event id - unique for each event.
6419 optional android.stats.devicepolicy.EventId event_id = 1;
6420 // The admin package name.
6421 optional string admin_package_name = 2;
6422 // A generic integer parameter.
6423 optional int32 integer_value = 3;
6424 // A generic boolean parameter.
6425 optional bool boolean_value = 4;
6426 // A parameter specifying a time period in milliseconds.
6427 optional uint64 time_period_millis = 5;
6428 // A parameter specifying a list of package names, bundle extras or string parameters.
6429 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6430}
shawnlinea5b66b2018-11-13 15:05:29 +08006431
6432/**
6433 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6434 *
6435 * Logged from:
6436 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6437 */
6438message DocsUILaunchReported {
6439 optional android.stats.docsui.LaunchAction launch_action = 1;
6440 optional bool has_initial_uri = 2;
6441 optional android.stats.docsui.MimeType mime_type = 3;
6442 optional android.stats.docsui.Root initial_root = 4;
6443}
6444
6445/**
6446 * Logs root/app visited event in file managers/picker. Call this when the user
6447 * taps on root/app in hamburger menu.
6448 *
6449 * Logged from:
6450 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6451 */
6452message DocsUIRootVisitedReported {
6453 optional android.stats.docsui.ContextScope scope = 1;
6454 optional android.stats.docsui.Root root = 2;
6455}
6456
6457/**
6458 * Logs file operation stats. Call this when a file operation has completed.
6459 *
6460 * Logged from:
6461 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6462 */
6463message DocsUIFileOperationReported {
6464 optional android.stats.docsui.Provider provider = 1;
6465 optional android.stats.docsui.FileOperation file_op = 2;
6466}
6467
6468/**
6469 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6470 * mode.
6471 *
6472 * Logged from:
6473 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6474 */
6475message DocsUIFileOperationCopyMoveModeReported {
6476 optional android.stats.docsui.FileOperation file_op = 1;
6477 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6478}
6479
6480
6481/**
6482 * Logs file sub operation stats. Call this when a file operation has failed.
6483 *
6484 * Logged from:
6485 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6486 */
6487message DocsUIFileOperationFailureReported {
6488 optional android.stats.docsui.Authority authority = 1;
6489 optional android.stats.docsui.SubFileOperation sub_op = 2;
6490}
6491
6492/**
6493* Logs the cancellation of a file operation. Call this when a job is canceled
6494*
6495* Logged from:
6496* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6497*/
6498message DocsUIFileOperationCanceledReported {
6499 optional android.stats.docsui.FileOperation file_op = 1;
6500}
6501
6502/**
6503 * Logs startup time in milliseconds.
6504 *
6505 * Logged from:
6506 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6507 */
6508message DocsUIStartupMsReported {
6509 optional int32 startup_millis = 1;
6510}
6511
6512/**
6513 * Logs the action that was started by user.
6514 *
6515 * Logged from:
6516 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6517 */
6518message DocsUIUserActionReported {
6519 optional android.stats.docsui.UserAction action = 1;
6520}
6521
6522/**
6523 * Logs the invalid type when invalid scoped access is requested.
6524 *
6525 * Logged from:
6526 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6527 */
6528message DocsUIInvalidScopedAccessRequestReported {
6529 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006530}
Ben Murdochbab399f2018-12-06 11:01:38 +00006531
6532/**
shawnlina75e82d2019-01-07 10:31:12 +08006533 * Logs the package name that launches docsui picker mode.
6534 *
6535 * Logged from:
6536 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6537 */
6538message DocsUIPickerLaunchedFromReported {
6539 optional string package_name = 1;
6540}
6541
6542/**
6543 * Logs the search type.
6544 *
6545 * Logged from:
6546 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6547 */
6548message DocsUISearchTypeReported {
6549 optional android.stats.docsui.SearchType search_type = 1;
6550}
6551
6552/**
6553 * Logs the search mode.
6554 *
6555 * Logged from:
6556 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6557 */
6558message DocsUISearchModeReported {
6559 optional android.stats.docsui.SearchMode search_mode = 1;
6560}
6561
6562/**
6563 * Logs the pick result information.
6564 *
6565 * Logged from:
6566 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6567 */
6568message DocsUIPickResultReported {
6569 optional int32 total_action_count = 1;
6570 optional int64 duration_millis = 2;
6571 optional int32 file_count= 3;
6572 optional bool is_searching = 4;
6573 optional android.stats.docsui.Root picked_from = 5;
6574 optional android.stats.docsui.MimeType mime_type = 6;
6575 optional int32 repeatedly_pick_times = 7;
6576}
6577
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006578/** Logs the drag and drop of files.
6579
6580 * Logged from:
6581 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6582 */
6583message DocsUIDragAndDropReported {
6584 optional bool drag_initiated_from_docsui = 1;
6585}
6586
shawnlina75e82d2019-01-07 10:31:12 +08006587/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006588 * Logs when an app's memory is compacted.
6589 *
6590 * Logged from:
6591 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6592 */
6593message AppCompacted {
6594 // The pid of the process being compacted.
6595 optional int32 pid = 1;
6596
6597 // The name of the process being compacted.
6598 optional string process_name = 2;
6599
6600 // The type of compaction.
6601 enum Action {
6602 UNKNOWN = 0;
6603 SOME = 1;
6604 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006605 PERSISTENT = 3;
6606 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006607 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006608 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006609
6610 // Total RSS in kilobytes consumed by the process prior to compaction.
6611 optional int64 before_rss_total_kilobytes = 4;
6612
6613 // File RSS in kilobytes consumed by the process prior to compaction.
6614 optional int64 before_rss_file_kilobytes = 5;
6615
6616 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6617 optional int64 before_rss_anon_kilobytes = 6;
6618
6619 // Swap in kilobytes consumed by the process prior to compaction.
6620 optional int64 before_swap_kilobytes = 7;
6621
6622 // Total RSS in kilobytes consumed by the process after compaction.
6623 optional int64 after_rss_total_kilobytes = 8;
6624
6625 // File RSS in kilobytes consumed by the process after compaction.
6626 optional int64 after_rss_file_kilobytes = 9;
6627
6628 // Anonymous RSS in kilobytes consumed by the process after compaction.
6629 optional int64 after_rss_anon_kilobytes = 10;
6630
6631 // Swap in kilobytes consumed by the process after compaction.
6632 optional int64 after_swap_kilobytes = 11;
6633
6634 // The time taken to perform compaction in milliseconds.
6635 optional int64 time_to_compact_millis = 12;
6636
6637 // The last compaction action performed for this app.
6638 optional Action last_action = 13;
6639
Ben Murdoch01720b82018-12-19 18:03:44 +00006640 // The last time that compaction was attempted on this process in milliseconds
6641 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6642 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006643
Ben Murdoch885c21b2019-03-15 18:02:04 +00006644 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006645 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006646
6647 // The process state at the time of compaction.
6648 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006649
6650 // Free ZRAM in kilobytes before compaction.
6651 optional int64 before_zram_free_kilobytes = 17;
6652
6653 // Free ZRAM in kilobytes after compaction.
6654 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006655}
lifr157fc552018-12-12 16:38:04 +08006656
6657/**
lifrb6b90b62019-03-29 00:40:17 +08006658 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6659 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6660 *
lifr1f74b052019-04-16 22:16:30 +08006661 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6662 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6663 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6664 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006665 */
6666message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006667 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006668
lifr1f74b052019-04-16 22:16:30 +08006669 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006670
6671 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006672 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006673
lifr1f74b052019-04-16 22:16:30 +08006674 // Only valid for event_type = EVENT_GETADDRINFO.
6675 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006676
lifr1f74b052019-04-16 22:16:30 +08006677 // Flags passed to android_res_nsend() defined in multinetwork.h
6678 // Only valid for event_type = EVENT_RESNSEND.
6679 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006680
lifrad9becc2019-05-20 11:04:41 +08006681 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006682
6683 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006684 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006685
6686 // Additional pass-through fields opaque to statsd.
6687 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006688 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006689
6690 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6691 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006692}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006693
6694/**
6695 * Logs when a data stall event occurs.
6696 *
6697 * Log from:
6698 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6699 */
6700message DataStallEvent {
6701 // Data stall evaluation type.
6702 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6703 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6704 optional int32 evaluation_type = 1;
6705 // See definition in data_stall_event.proto.
6706 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6707 // See definition in data_stall_event.proto.
6708 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6709 // See definition in data_stall_event.proto.
6710 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6711 // See definition in data_stall_event.proto.
6712 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6713 // See definition in data_stall_event.proto.
6714 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6715}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006716
6717/*
6718 * Logs when RescueParty resets some set of experiment flags.
6719 *
6720 * Logged from:
6721 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6722 */
6723message RescuePartyResetReported {
6724 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6725 optional int32 rescue_level = 1;
6726}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006727
6728/**
6729 * Logs when signed config is received from an APK, and if that config was applied successfully.
6730 * Logged from:
6731 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6732 */
6733message SignedConfigReported {
6734 enum Type {
6735 UNKNOWN_TYPE = 0;
6736 GLOBAL_SETTINGS = 1;
6737 }
6738 optional Type type = 1;
6739
6740 // The final status of the signed config received.
6741 enum Status {
6742 UNKNOWN_STATUS = 0;
6743 APPLIED = 1;
6744 BASE64_FAILURE_CONFIG = 2;
6745 BASE64_FAILURE_SIGNATURE = 3;
6746 SECURITY_EXCEPTION = 4;
6747 INVALID_CONFIG = 5;
6748 OLD_CONFIG = 6;
6749 SIGNATURE_CHECK_FAILED = 7;
6750 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006751 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006752 }
6753 optional Status status = 2;
6754
6755 // The version of the signed config processed.
6756 optional int32 version = 3;
6757
6758 // The package name that the config was extracted from.
6759 optional string from_package = 4;
6760
6761 enum Key {
6762 NO_KEY = 0;
6763 DEBUG = 1;
6764 PRODUCTION = 2;
6765 }
6766 // Which key was used to verify the config.
6767 optional Key verified_with = 5;
6768}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006769
6770/*
6771 * Logs GNSS Network-Initiated (NI) location events.
6772 *
6773 * Logged from:
6774 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6775 */
6776message GnssNiEventReported {
6777 // The type of GnssNiEvent.
6778 enum EventType {
6779 UNKNOWN = 0;
6780 NI_REQUEST = 1;
6781 NI_RESPONSE = 2;
6782 }
6783 optional EventType event_type = 1;
6784
6785 // An ID generated by HAL to associate NI notifications and UI responses.
6786 optional int32 notification_id = 2;
6787
6788 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006789 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006790
6791 // NI requires notification.
6792 optional bool need_notify = 4;
6793
6794 // NI requires verification.
6795 optional bool need_verify = 5;
6796
6797 // NI requires privacy override, no notification/minimal trace.
6798 optional bool privacy_override = 6;
6799
6800 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6801 // seconds.
6802 optional int32 timeout = 7;
6803
6804 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006805 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006806
6807 // String representing the requester of the network inititated location request.
6808 optional string requestor_id = 9;
6809
6810 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6811 // network initiated location request.
6812 optional string text = 10;
6813
6814 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006815 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006816
6817 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006818 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006819
6820 // True if SUPL ES is enabled.
6821 optional bool is_supl_es_enabled = 13;
6822
6823 // True if GNSS location is enabled.
6824 optional bool is_location_enabled = 14;
6825
6826 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006827 optional android.server.location.GnssUserResponseType user_response = 15;
6828}
6829
6830/**
6831 * Logs GNSS non-framework (NFW) location notification.
6832 *
6833 * Logged from:
6834 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6835 */
6836message GnssNfwNotificationReported {
6837 // Package name of the Android proxy application representing the non-framework entity that
6838 // requested location. Set to empty string if unknown.
6839 optional string proxy_app_package_name = 1;
6840
6841 // Protocol stack that initiated the non-framework location request.
6842 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6843
6844 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6845 // set to empty string. This field is opaque to the framework and used for logging purposes.
6846 optional string other_protocol_stack_name = 3;
6847
6848 // Source initiating/receiving the location information.
6849 optional android.server.location.NfwRequestor requestor = 4;
6850
6851 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6852 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6853 // and used for logging purposes.
6854 optional string requestor_id = 5;
6855
6856 // Indicates whether location information was provided for this request.
6857 optional android.server.location.NfwResponseType response_type = 6;
6858
6859 // True if the device is in user initiated emergency session.
6860 optional bool in_emergency_mode = 7;
6861
6862 // True if cached location is provided.
6863 optional bool is_cached_location = 8;
6864
6865 // True if proxy app permission mismatch between framework and GNSS HAL.
6866 optional bool is_permission_mismatched = 9;
6867}
6868
6869/**
6870 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6871 *
6872 * Logged from:
6873 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6874 */
6875message GnssConfigurationReported {
6876 // SUPL host name.
6877 optional string supl_host = 1;
6878
6879 // SUPL port number.
6880 optional int32 supl_port = 2;
6881
6882 // C2K host name.
6883 optional string c2k_host = 3;
6884
6885 // C2K port number.
6886 optional int32 c2k_port = 4;
6887
6888 // The SUPL version requested by Carrier.
6889 optional int32 supl_ver = 5;
6890
6891 // The SUPL mode.
6892 optional android.server.location.SuplMode supl_mode = 6;
6893
6894 // True if NI emergency SUPL restrictions is enabled.
6895 optional bool supl_es = 7;
6896
6897 // LTE Positioning Profile settings
6898 optional android.server.location.LppProfile lpp_profile = 8;
6899
6900 // Positioning protocol on A-Glonass system.
6901 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6902
6903 // True if emergency PDN is used. Otherwise, regular PDN is used.
6904 optional bool use_emergency_pdn_for_emergency_supl= 10;
6905
6906 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6907 optional android.server.location.GpsLock gps_lock = 11;
6908
6909 // Number of seconds to extend the emergency session duration post emergency call.
6910 optional int32 es_extension_sec = 12;
6911
6912 // The full list of package names of proxy Android applications representing the non-framework
6913 // location access entities (on/off the device) for which the framework user has granted
6914 // non-framework location access permission. The package names are concatenated in one string
6915 // with spaces as separators.
6916 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006917}
Jack Yu95b64f32018-12-13 18:26:11 +08006918
6919/**
6920 * Logs when a NFC device's error occurred.
6921 * Logged from:
6922 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6923 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6924 */
6925message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006926 enum Type {
6927 UNKNOWN = 0;
6928 CMD_TIMEOUT = 1;
6929 ERROR_NOTIFICATION = 2;
6930 AID_OVERFLOW = 3;
6931 }
6932 optional Type type = 1;
6933 // If it's nci cmd timeout, log the timeout command.
6934 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006935
Alex Salod7c3eef2019-01-25 14:43:27 -08006936 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006937}
6938
6939/**
6940 * Logs when a NFC device's state changed event
6941 * Logged from:
6942 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6943 */
6944message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006945 enum State {
6946 UNKNOWN = 0;
6947 OFF = 1;
6948 ON = 2;
6949 ON_LOCKED = 3; // Secure Nfc enabled.
6950 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6951 }
6952 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006953}
6954
6955/**
6956 * Logs when a NFC Beam Transaction occurred.
6957 * Logged from:
6958 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6959 */
6960message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006961 enum Operation {
6962 UNKNOWN = 0;
6963 SEND = 1;
6964 RECEIVE = 2;
6965 }
6966 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006967}
6968
6969/**
6970 * Logs when a NFC Card Emulation Transaction occurred.
6971 * Logged from:
6972 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6973 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6974 */
6975message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006976 enum Category {
6977 UNKNOWN = 0;
6978 HCE_PAYMENT = 1;
6979 HCE_OTHER = 2;
6980 OFFHOST = 3;
6981 }
6982 // Transaction belongs to HCE payment or HCE other category, or offhost.
6983 optional Category category = 1;
6984 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6985 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006986}
6987
6988/**
6989 * Logs when a NFC Tag event occurred.
6990 * Logged from:
6991 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6992 */
6993message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006994 enum Type {
6995 UNKNOWN = 0;
6996 URL = 1;
6997 BT_PAIRING = 2;
6998 PROVISION = 3;
6999 WIFI_CONNECT = 4;
7000 APP_LAUNCH = 5;
7001 OTHERS = 6;
7002 }
7003 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007004}
7005
7006/**
7007 * Logs when Hce transaction triggered
7008 * Logged from:
7009 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7010 */
7011message NfcHceTransactionOccurred {
7012 // The latency period(in microseconds) it took for the first HCE data
7013 // exchange.
7014 optional uint32 latency_micros = 1;
7015}
7016
7017/**
7018 * Logs when SecureElement state event changed
7019 * Logged from:
7020 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7021 */
7022message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007023 enum State {
7024 UNKNOWN = 0;
7025 INITIALIZED = 1;
7026 DISCONNECTED = 2;
7027 CONNECTED = 3;
7028 HALCRASH = 4;
7029 }
7030 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007031
Alex Salod7c3eef2019-01-25 14:43:27 -08007032 optional string state_change_reason = 2;
7033 // SIMx or eSEx.
7034 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007035}
7036
7037/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007038 * Information about a permission grant request
7039 */
7040message PermissionGrantRequestResultReported {
7041 // unique value identifying an API call. A API call might result in multiple of these atoms
7042 optional int64 request_id = 1;
7043
7044 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007045 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007046
7047 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007048 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007049
7050 // The permission to be granted
7051 optional string permission_name = 4;
7052
7053 // If the permission was explicitly requested via the API or added by the system
7054 optional bool is_implicit = 5;
7055
7056 enum Result {
7057 UNDEFINED = 0;
7058 // permission request was ignored
7059 IGNORED = 1;
7060 // permission request was ignored because it was user fixed
7061 IGNORED_USER_FIXED = 2;
7062 // permission request was ignored because it was policy fixed
7063 IGNORED_POLICY_FIXED = 3;
7064 // permission was granted by user action
7065 USER_GRANTED = 4;
7066 // permission was automatically granted
7067 AUTO_GRANTED = 5;
7068 // permission was denied by user action
7069 USER_DENIED = 6;
7070 // permission was denied with prejudice by the user
7071 USER_DENIED_WITH_PREJUDICE = 7;
7072 // permission was automatically denied
7073 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007074 // permission request was ignored because permission is restricted
7075 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007076 // one time permission was granted by user action
7077 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007078 // user ignored request by leaving the request screen without choosing any option
7079 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007080 // user granted the permission after being linked to settings
7081 USER_GRANTED_IN_SETTINGS = 12;
7082 // user denied the permission after being linked to settings
7083 USER_DENIED_IN_SETTINGS = 13;
7084 // user denied the permission with prejudice after being linked to settings
7085 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7086 // permission was automatically revoked after one-time permission expired
7087 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007088 // permission was automatically revoked for unused app
7089 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007090 }
7091 // The result of the permission grant
7092 optional Result result = 6;
7093}
7094
7095/**
Jack Yu95b64f32018-12-13 18:26:11 +08007096 * Logs when Omapi API used
7097 * Logged from:
7098 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7099 */
7100message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007101 enum Operation {
7102 UNKNOWN = 0;
7103 OPEN_CHANNEL = 1;
7104 }
7105 optional Operation operation = 1;
7106 // SIMx or eSEx.
7107 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007108
Alex Salod7c3eef2019-01-25 14:43:27 -08007109 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007110}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007111
7112/**
Alex Saloa060aee2019-01-21 14:36:41 -08007113 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7114 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007115 * Logged from:
7116 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7117 */
7118message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007119 optional int64 dispatch_latency_millis = 1;
7120}
7121
7122/**
7123 * Logs AttentionManagerService attention check result.
7124 *
7125 * Logged from:
7126 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7127 */
7128message AttentionManagerServiceResultReported {
7129 // See core/java/android/service/attention/AttentionService.java
7130 enum AttentionCheckResult {
7131 UNKNOWN = 20;
7132 ATTENTION_SUCCESS_ABSENT = 0;
7133 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007134 ATTENTION_FAILURE_UNKNOWN = 2;
7135 ATTENTION_FAILURE_CANCELLED = 3;
7136 ATTENTION_FAILURE_PREEMPTED = 4;
7137 ATTENTION_FAILURE_TIMED_OUT = 5;
7138 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007139 }
7140 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007141}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007142
7143/**
7144 * Logs when an adb connection changes state.
7145 *
7146 * Logged from:
7147 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7148 */
7149message AdbConnectionChanged {
7150 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7151 // previously selected for this system.
7152 optional int64 last_connection_time_millis = 1;
7153
7154 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7155 // to reconnect via adb without user interaction.
7156 optional int64 auth_window_millis = 2;
7157
7158 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7159 optional android.debug.AdbConnectionStateEnum state = 3;
7160
7161 // True if the 'always allow' option was selected for this system.
7162 optional bool always_allow = 4;
7163}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007164
7165/*
7166 * Logs the reported speech DSP status.
7167 *
7168 * Logged from:
7169 * Vendor audio implementation.
7170 */
7171message SpeechDspStatReported {
7172 // The total Speech DSP uptime in milliseconds.
7173 optional int32 total_uptime_millis = 1;
7174 // The total Speech DSP downtime in milliseconds.
7175 optional int32 total_downtime_millis = 2;
7176 optional int32 total_crash_count = 3;
7177 optional int32 total_recover_count = 4;
7178}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007179
7180/**
7181 * Logs USB connector contaminant status.
7182 *
7183 * Logged from: USB Service.
7184 */
7185message UsbContaminantReported {
7186 optional string id = 1;
7187 optional android.service.usb.ContaminantPresenceStatus status = 2;
7188}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007189
7190/**
7191 * This atom is for debugging purpose.
7192 */
7193message DebugElapsedClock {
7194 // Monotically increasing value for each pull.
7195 optional int64 pull_count = 1;
7196 // Time from System.elapsedRealtime.
7197 optional int64 elapsed_clock_millis = 2;
7198 // Time from System.elapsedRealtime.
7199 optional int64 same_elapsed_clock_millis = 3;
7200 // Diff between current elapsed time and elapsed time from previous pull.
7201 optional int64 elapsed_clock_diff_millis = 4;
7202
7203 enum Type {
7204 TYPE_UNKNOWN = 0;
7205 ALWAYS_PRESENT = 1;
7206 PRESENT_ON_ODD_PULLS = 2;
7207 }
7208 // Type of behavior for the pulled data.
7209 optional Type type = 5;
7210}
7211
7212/**
7213 * This atom is for debugging purpose.
7214 */
7215message DebugFailingElapsedClock {
7216 // Monotically increasing value for each pull.
7217 optional int64 pull_count = 1;
7218 // Time from System.elapsedRealtime.
7219 optional int64 elapsed_clock_millis = 2;
7220 // Time from System.elapsedRealtime.
7221 optional int64 same_elapsed_clock_millis = 3;
7222 // Diff between current elapsed time and elapsed time from previous pull.
7223 optional int64 elapsed_clock_diff_millis = 4;
7224}
Steven Wuacef6bb2019-01-23 14:21:17 -05007225
7226/** Logs System UI bubbles event changed.
7227 *
7228 * Logged from:
7229 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7230 */
7231message BubbleUIChanged {
7232
7233 // The app package that is posting the bubble.
7234 optional string package_name = 1;
7235
7236 // The notification channel that is posting the bubble.
7237 optional string notification_channel = 2;
7238
7239 // The notification id associated with the posted bubble.
7240 optional int32 notification_id = 3;
7241
7242 // The position of the bubble within the bubble stack.
7243 optional int32 position = 4;
7244
7245 // The total number of bubbles within the bubble stack.
7246 optional int32 total_number = 5;
7247
7248 // User interactions with the bubble.
7249 enum Action {
7250 UNKNOWN = 0;
7251 POSTED = 1;
7252 UPDATED = 2;
7253 EXPANDED = 3;
7254 COLLAPSED = 4;
7255 DISMISSED = 5;
7256 STACK_DISMISSED = 6;
7257 STACK_MOVED = 7;
7258 HEADER_GO_TO_APP = 8;
7259 HEADER_GO_TO_SETTINGS = 9;
7260 PERMISSION_OPT_IN = 10;
7261 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007262 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007263 SWIPE_LEFT = 13;
7264 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007265 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007266 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007267 }
7268 optional Action action = 6;
7269
7270 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7271 optional float normalized_x_position = 7;
7272 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007273
7274 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7275 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007276
7277 // Whether the bubble is an on-going one.
7278 optional bool is_ongoing = 10;
7279
7280 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007281 // This is deprecated and the value should be ignored.
7282 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007283}
Kweku Adams8845d012018-12-11 20:06:45 -08007284
7285/**
Steven Wu552f63f2019-02-05 13:41:36 -05007286 * Logs System UI bubbles developer errors.
7287 *
7288 * Logged from:
7289 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7290 */
7291message BubbleDeveloperErrorReported {
7292
7293 // The app package that is posting the bubble.
7294 optional string package_name = 1;
7295
7296 // Bubble developer error type enums.
7297 enum Error {
7298 UNKNOWN = 0;
7299 ACTIVITY_INFO_MISSING = 1;
7300 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7301 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7302 }
7303 optional Error error = 2 [default = UNKNOWN];
7304}
7305
7306/**
Kweku Adams8845d012018-12-11 20:06:45 -08007307 * Logs that a constraint for a scheduled job has changed.
7308 *
7309 * Logged from:
7310 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7311 */
7312message ScheduledJobConstraintChanged {
7313 repeated AttributionNode attribution_node = 1;
7314
7315 // Name of the job.
7316 optional string job_name = 2;
7317
7318 optional com.android.server.job.ConstraintEnum constraint = 3;
7319
7320 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007321 UNKNOWN = 0;
7322 UNSATISFIED = 1;
7323 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007324 }
7325 optional State state = 4;
7326}
Alex Salod7c3eef2019-01-25 14:43:27 -08007327
7328/**
7329 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7330 * returns true.
7331 *
7332 * Logged from:
7333 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7334 */
7335message ScreenTimeoutExtensionReported {
7336 // Describes how many times in a row did the power manager reset the screen off timeout.
7337 optional uint32 consecutive_timeout_extended_count = 1;
7338}
Hui Yu885aca12019-01-10 17:11:34 -08007339
7340/*
7341* Logs number of milliseconds it takes to start a process.
7342* The definition of app process start time is from the app launch time to
7343* the time that Zygote finished forking the app process and loaded the
7344* application package's java classes.
7345
7346* This metric is different from AppStartOccurred which is for foreground
7347* activity only.
7348
7349* ProcessStartTime can report all processes (both foreground and background)
7350* start time.
7351*
7352* Logged from:
7353* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7354*/
7355message ProcessStartTime {
7356 // The uid of the ProcessRecord.
7357 optional int32 uid = 1 [(is_uid) = true];
7358
7359 // The process pid.
7360 optional int32 pid = 2;
7361
7362 // The process name.
7363 // Usually package name, "system" for system server.
7364 // Provided by ActivityManagerService.
7365 optional string process_name = 3;
7366
7367 enum StartType {
7368 UNKNOWN = 0;
7369 WARM = 1;
7370 HOT = 2;
7371 COLD = 3;
7372 }
7373
7374 // The start type.
7375 optional StartType type = 4;
7376
7377 // The elapsed realtime at the start of the process.
7378 optional int64 process_start_time_millis = 5;
7379
7380 // Number of milliseconds it takes to reach bind application.
7381 optional int32 bind_application_delay_millis = 6;
7382
7383 // Number of milliseconds it takes to finish start of the process.
7384 optional int32 process_start_delay_millis = 7;
7385
7386 // hostingType field in ProcessRecord, the component type such as "activity",
7387 // "service", "content provider", "broadcast" or other strings.
7388 optional string hosting_type = 8;
7389
7390 // hostingNameStr field in ProcessRecord. The component class name that runs
7391 // in this process.
7392 optional string hosting_name = 9;
7393}
7394
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007395/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007396 * Track Media Codec usage
7397 * Logged from:
7398 * frameworks/av/media/libstagefright/MediaCodec.cpp
7399 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7400 */
7401message MediametricsCodecReported {
7402 optional int64 timestamp_nanos = 1;
7403 optional string package_name = 2;
7404 optional int64 package_version_code = 3;
7405 optional int64 media_apex_version = 4;
7406
7407 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7408}
7409
7410/**
7411 * Track Media Extractor (pulling video/audio streams out of containers) usage
7412 * Logged from:
7413 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7414 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7415 */
7416message MediametricsExtractorReported {
7417 optional int64 timestamp_nanos = 1;
7418 optional string package_name = 2;
7419 optional int64 package_version_code = 3;
7420 optional int64 media_apex_version = 4;
7421
7422 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7423}
7424
7425/**
7426 * Track how we arbitrate between microphone/input requests.
7427 * Logged from
7428 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7429 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7430 */
7431message MediametricsAudiopolicyReported {
7432 optional int64 timestamp_nanos = 1;
7433 optional string package_name = 2;
7434 optional int64 package_version_code = 3;
7435 optional int64 media_apex_version = 4;
7436
7437 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7438}
7439
7440/**
7441 * Track how we arbitrate between microphone requests.
7442 * Logged from
7443 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7444 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7445 */
7446message MediametricsAudiorecordReported {
7447 optional int64 timestamp_nanos = 1;
7448 optional string package_name = 2;
7449 optional int64 package_version_code = 3;
7450 optional int64 media_apex_version = 4;
7451
7452 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7453}
7454
7455/**
7456 * Track how we arbitrate between microphone/input requests.
7457 * Logged from
7458 * frameworks/av/media/libnblog/ReportPerformance.cpp
7459 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7460 */
7461message MediametricsAudiothreadReported {
7462 optional int64 timestamp_nanos = 1;
7463 optional string package_name = 2;
7464 optional int64 package_version_code = 3;
7465 optional int64 media_apex_version = 4;
7466
7467 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7468}
7469
7470/**
7471 * Track how we arbitrate between microphone/input requests.
7472 * Logged from
7473 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7474 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7475 */
7476message MediametricsAudiotrackReported {
7477 optional int64 timestamp_nanos = 1;
7478 optional string package_name = 2;
7479 optional int64 package_version_code = 3;
7480 optional int64 media_apex_version = 4;
7481
7482 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7483}
7484
7485/**
7486 * Track information about DRM framework performance
7487 * Logged from
7488 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7489 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7490 */
7491message MediametricsMediadrmReported {
7492 optional int64 timestamp_nanos = 1;
7493 optional string package_name = 2;
7494 optional int64 package_version_code = 3;
7495 optional int64 media_apex_version = 4;
7496
7497 // vendor+description tell about which DRM plugin is in use on this device
7498 optional string vendor = 5;
7499 optional string description = 6;
7500 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7501 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7502}
7503
7504/**
7505 * Track information about the widevine DRM plugin performance
7506 * Logged from
7507 * vendor/widevine/libwvdrmengine/cdm/metrics
7508 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7509 */
7510message MediametricsDrmWidevineReported {
7511 optional int64 timestamp_nanos = 1;
7512 optional string package_name = 2;
7513 optional int64 package_version_code = 3;
7514 optional int64 media_apex_version = 4;
7515
7516 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7517}
7518
7519/**
7520 * Track information about recordings (e.g. camcorder)
7521 * Logged from
7522 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7523 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7524 */
7525message MediametricsRecorderReported {
7526 optional int64 timestamp_nanos = 1;
7527 optional string package_name = 2;
7528 optional int64 package_version_code = 3;
7529 optional int64 media_apex_version = 4;
7530
7531 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7532}
7533
7534/**
7535 * Track Media Player usage
7536 * Logged from:
7537 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7538 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7539 */
7540message MediametricsNuPlayerReported {
7541 optional int64 timestamp_nanos = 1;
7542 optional string package_name = 2;
7543 optional int64 package_version_code = 3;
7544 optional int64 media_apex_version = 4;
7545
7546 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7547}
7548
7549/**
Robert Shiha4beed32019-08-19 14:15:23 -07007550 * Track Legacy DRM usage
7551 * Logged from
7552 * frameworks/av/drm/drmserver/DrmManager.cpp
7553 */
7554message MediametricsDrmManagerReported {
7555 optional int64 timestamp_nanos = 1;
7556 optional string package_name = 2;
7557 optional int64 package_version_code = 3;
7558 optional int64 media_apex_version = 4;
7559
7560 enum Method {
7561 METHOD_NOT_FOUND = -1;
7562 GET_CONSTRAINTS = 0;
7563 GET_METADATA = 1;
7564 CAN_HANDLE = 2;
7565 PROCESS_DRM_INFO = 3;
7566 ACQUIRE_DRM_INFO = 4;
7567 SAVE_RIGHTS = 5;
7568 GET_ORIGINAL_MIME_TYPE = 6;
7569 GET_DRM_OBJECT_TYPE = 7;
7570 CHECK_RIGHTS_STATUS = 8;
7571 REMOVE_RIGHTS = 9;
7572 REMOVE_ALL_RIGHTS = 10;
7573 OPEN_CONVERT_SESSION = 11;
7574 OPEN_DECRYPT_SESSION = 12;
7575 }
7576
7577 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7578 optional string plugin_id = 5;
7579 optional string description = 6;
7580 optional Method method = 7;
7581 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007582
7583 optional int64 get_constraints_count = 9;
7584 optional int64 get_metadata_count = 10;
7585 optional int64 can_handle_count = 11;
7586 optional int64 process_drm_info_count = 12;
7587 optional int64 acquire_drm_info_count = 13;
7588 optional int64 save_rights_count = 14;
7589 optional int64 get_original_mime_type_count = 15;
7590 optional int64 get_drm_object_type_count = 16;
7591 optional int64 check_rights_status_count = 17;
7592 optional int64 remove_rights_count = 18;
7593 optional int64 remove_all_rights_count = 19;
7594 optional int64 open_convert_session_count = 20;
7595 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007596}
7597
7598/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007599 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007600 * Pulled from: StatsCompanionService
7601*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007602message DangerousPermissionState {
7603 // Name of the permission
7604 optional string permission_name = 1;
7605
7606 // Uid of the package
7607 optional int32 uid = 2 [(is_uid) = true];
7608
7609 // Package requesting the permission
7610 optional string package_name = 3;
7611
7612 // If the permission is granted to the uid
7613 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007614
7615 // Permission flags as per android.content.pm.PermissionFlags
7616 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007617}
7618
Michael Groover4a0ca942019-01-24 17:41:25 -08007619/**
7620 * Logs when a package is denied access to a device identifier based on the new access requirements.
7621 *
7622 * Logged from:
7623 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7624 */
7625message DeviceIdentifierAccessDenied {
7626 // The name of the package denied access to the requested device identifier.
7627 optional string package_name = 1;
7628
7629 // The name of the device identifier method the package attempted to invoke.
7630 optional string method_name = 2;
7631
7632 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007633 // Starting from Android 11, this boolean is not set and will always be false.
7634 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007635
7636 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007637 // Starting from Android 11, this boolean is not set and will always be false.
7638 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007639}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007640
7641/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007642 * Pulls the ongoing mainline install train version code.
7643 * Pulled from StatsCompanionService
7644 */
7645message TrainInfo {
7646 optional int64 train_version_code = 1;
7647
7648 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007649
7650 optional string train_name = 3;
7651
7652 enum Status {
7653 UNKNOWN = 0;
7654 INSTALL_REQUESTED = 1;
7655 INSTALL_STARTED = 2;
7656 INSTALL_STAGED_NOT_READY = 3;
7657 INSTALL_STAGED_READY = 4;
7658 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007659 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7660 // and INSTALL_FAILURE_COMMIT.
7661 INSTALL_FAILURE = 6 [deprecated = true];
7662 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007663 INSTALL_CANCELLED = 7;
7664 INSTALLER_ROLLBACK_REQUESTED = 8;
7665 INSTALLER_ROLLBACK_INITIATED = 9;
7666 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7667 INSTALLER_ROLLBACK_STAGED = 11;
7668 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7669 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7670 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7671 INSTALLER_ROLLBACK_SUCCESS = 15;
7672 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007673 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7674 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7675 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7676 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7677 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7678 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007679 INSTALL_FAILURE_DOWNLOAD = 23;
7680 INSTALL_FAILURE_STATE_MISMATCH = 24;
7681 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007682 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007683 }
7684 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007685}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007686
7687/**
7688 * Logs the gesture stage changed event.
7689 *
7690 * Logged from:
7691 * frameworks/base/packages/SystemUI/
7692 */
7693message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007694 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007695}
7696
7697/**
7698 * Logs the feedback type.
7699 *
7700 * Logged from:
7701 * frameworks/base/packages/SystemUI/
7702 */
7703message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007704 // Whether or not the gesture was used.
7705 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007706}
7707
7708/**
7709 * Logs the progress.
7710 *
7711 * Logged from:
7712 * frameworks/base/packages/SystemUI/
7713 */
7714message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007715 // [0,100] progress for the assist gesture.
7716 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007717}
Neil Fullerdb14b482019-02-05 19:44:44 +00007718
7719/*
7720 * Information about the time zone data on a device.
7721 */
7722message TimeZoneDataInfo {
7723 // A version identifier for the data set on device. e.g. "2018i"
7724 optional string tzdb_version = 1;
7725}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007726
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007727/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007728 * Logs the GPU stats global health information.
7729 *
7730 * Logged from:
7731 * frameworks/native/services/gpuservice/gpustats/
7732 */
7733message GpuStatsGlobalInfo {
7734 // Package name of the gpu driver.
7735 optional string driver_package_name = 1;
7736
7737 // Version name of the gpu driver.
7738 optional string driver_version_name = 2;
7739
7740 // Version code of the gpu driver.
7741 optional int64 driver_version_code = 3;
7742
7743 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7744 optional int64 driver_build_time = 4;
7745
7746 // Total count of the gl driver gets loaded.
7747 optional int64 gl_loading_count = 5;
7748
7749 // Total count of the gl driver fails to be loaded.
7750 optional int64 gl_loading_failure_count = 6;
7751
7752 // Total count of the Vulkan driver gets loaded.
7753 optional int64 vk_loading_count = 7;
7754
7755 // Total count of the Vulkan driver fails to be loaded.
7756 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007757
7758 // Api version of the system Vulkan driver.
7759 optional int32 vulkan_version = 9;
7760
7761 // Api version of the system CPU Vulkan driver.
7762 optional int32 cpu_vulkan_version = 10;
7763
7764 // Api version of the system GLES driver.
7765 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007766
7767 // Total count of the angle driver gets loaded.
7768 optional int64 angle_loading_count = 12;
7769
7770 // Total count of the angle driver fails to be loaded.
7771 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007772}
7773
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007774/**
7775 * GPU driver loading time info.
7776 */
7777message GpuDriverLoadingTime {
7778 // List of all the driver loading times for this app. The list size is
7779 // capped at 50.
7780 repeated int64 driver_loading_time = 1;
7781}
7782
7783/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007784 * Logs the GPU stats per app health information.
7785 *
7786 * Logged from:
7787 * frameworks/native/services/gpuservice/gpustats/
7788 */
7789message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007790 // Package name of the application that loads the gpu driver. Total number
7791 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007792 optional string app_package_name = 1;
7793
7794 // Version code of the gpu driver this app loads.
7795 optional int64 driver_version_code = 2;
7796
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007797 // gl driver loading time info.
7798 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7799 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007800
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007801 // Vulkan driver loading time info.
7802 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7803 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007804
7805 // Angle driver loading time info.
7806 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7807 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007808
7809 // CPU Vulkan implementation is in use.
7810 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007811
7812 // App is not doing pre-rotation correctly.
7813 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007814
7815 // App creates GLESv1 context.
7816 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007817}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007818
7819/*
7820 * Logs the size of the system ion heap.
7821 *
7822 * Pulled from StatsCompanionService.
7823 */
7824message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007825 // Deprecated due to limited support of ion stats in debugfs.
7826 // Use `IonHeapSize` instead.
7827 option deprecated = true;
7828
Rafal Slawikd4e87572019-03-12 13:08:38 +00007829 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007830 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007831 optional int64 size_in_bytes = 1;
7832}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007833
Rafal Slawik77987ed2019-06-17 12:28:23 +01007834/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007835 * Logs the total size of the ion heap.
7836 *
7837 * Pulled from StatsCompanionService.
7838 */
7839message IonHeapSize {
7840 // Total size of all ion heaps in kilobytes.
7841 // Read from: /sys/kernel/ion/total_heaps_kb.
7842 optional int32 total_size_kb = 1;
7843}
7844
7845/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007846 * Logs the per-process size of the system ion heap.
7847 *
7848 * Pulled from StatsCompanionService.
7849 */
7850message ProcessSystemIonHeapSize {
7851 // The uid if available. -1 means not available.
7852 optional int32 uid = 1 [(is_uid) = true];
7853
7854 // The process name (from /proc/PID/cmdline).
7855 optional string process_name = 2;
7856
7857 // Sum of sizes of all allocations.
7858 optional int32 total_size_in_kilobytes = 3;
7859
7860 // Number of allocations.
7861 optional int32 allocation_count = 4;
7862
7863 // Size of the largest allocation.
7864 optional int32 max_size_in_kilobytes = 5;
7865}
7866
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007867/**
7868 * Push network stack events.
7869 *
7870 * Log from:
7871 * frameworks/base/packages/NetworkStack/
7872 */
7873message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007874 // The id that indicates the event reported from NetworkStack.
7875 optional int32 event_id = 1;
7876 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007877 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7878}
Carmen Agimofa769c152019-03-04 14:39:14 +00007879
7880/**
7881 * Logs the apps that are installed on the external storage.
7882 * Pulled from:
7883 * StatsCompanionService
7884 */
7885message AppsOnExternalStorageInfo {
7886 // The type of the external storage.
7887 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7888 // The name of the package that is installed on the external storage.
7889 optional string package_name = 2;
7890}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007891
7892/**
7893 * Logs the settings related to Face.
7894 * Logged from:
7895 * frameworks/base/services/core/java/com/android/server/stats
7896 */
7897message FaceSettings {
7898 // Whether or not face unlock is allowed on Keyguard.
7899 optional bool unlock_keyguard_enabled = 1;
7900 // Whether or not face unlock dismisses the Keyguard.
7901 optional bool unlock_dismisses_keyguard = 2;
7902 // Whether or not face unlock requires attention.
7903 optional bool unlock_attention_required = 3;
7904 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7905 optional bool unlock_app_enabled = 4;
7906 // Whether or not face unlock always requires user confirmation.
7907 optional bool unlock_always_require_confirmation = 5;
7908 // Whether or not a diverse set of poses are required during enrollment.
7909 optional bool unlock_diversity_required = 6;
7910}
Maggie White442b6312019-04-05 16:26:44 -07007911
7912/**
7913 * Logs cooling devices maintained by the kernel.
7914 *
7915 * Pulled from StatsCompanionService.java
7916 */
7917message CoolingDevice {
7918 // The type of cooling device being reported. Eg. CPU, GPU...
7919 optional android.os.CoolingTypeEnum device_location = 1;
7920 // The name of the cooling device source. Eg. CPU0
7921 optional string device_name = 2;
7922 // Current throttle state of the cooling device. The value can any unsigned
7923 // integer between 0 and max_state defined in its driver. 0 means device is
7924 // not in throttling, higher value means deeper throttling.
7925 optional int32 state = 3;
7926}
Ben Blount763a5d52019-04-10 11:48:58 -07007927
7928/**
7929 * Intelligence has several counter-type events that don't warrant a
7930 * full separate atom. These are primarily API call counters but also include
7931 * counters for feature usage and specific failure modes.
7932 *
7933 * Logged from the Intelligence mainline module.
7934 */
7935message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007936 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007937 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007938 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007939 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007940 // How many times the event occured (to report a batch of high frequency events).
7941 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007942 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007943 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007944}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007945
7946/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007947 * Logs when Car Power state changed.
7948 *
7949 * Logged from:
7950 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7951 */
7952message CarPowerStateChanged {
7953 // States come from CpmsState in CarPowerManagementService.java.
7954 enum State {
7955 WAIT_FOR_VHAL = 0;
7956 ON = 1;
7957 SHUTDOWN_PREPARE = 2;
7958 WAIT_FOR_FINISH = 3;
7959 SUSPEND = 4;
7960 SIMULATE_SLEEP = 5;
7961 }
7962 optional State state = 1;
7963}
7964
7965/**
7966 * Logs whether GarageMode is entered.
7967 *
7968 * Logged from:
7969 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7970 */
7971message GarageModeInfo {
7972 // Whether GarageMode is entered.
7973 optional bool is_garage_mode = 1;
7974}
Martijn Coenencd95d462019-04-25 17:09:45 +02007975
7976/**
7977 * Historical app ops data per package.
7978 */
7979message AppOps {
7980 // Uid of the package requesting the op
7981 optional int32 uid = 1 [(is_uid) = true];
7982
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007983 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007984 optional string package_name = 2;
7985
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007986 // operation id
7987 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007988
7989 // The number of times the op was granted while the app was in the
7990 // foreground (only for trusted requests)
7991 optional int64 trusted_foreground_granted_count = 4;
7992
7993 // The number of times the op was granted while the app was in the
7994 // background (only for trusted requests)
7995 optional int64 trusted_background_granted_count = 5;
7996
7997 // The number of times the op was rejected while the app was in the
7998 // foreground (only for trusted requests)
7999 optional int64 trusted_foreground_rejected_count = 6;
8000
8001 // The number of times the op was rejected while the app was in the
8002 // background (only for trusted requests)
8003 optional int64 trusted_background_rejected_count = 7;
8004
8005 // For long-running operations, total duration of the operation
8006 // while the app was in the foreground (only for trusted requests)
8007 optional int64 trusted_foreground_duration_millis = 8;
8008
8009 // For long-running operations, total duration of the operation
8010 // while the app was in the background (only for trusted requests)
8011 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008012
8013 // Whether AppOps is guarded by Runtime permission
8014 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008015}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008016
8017/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008018 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008019 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008020message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008021 // Uid of the package requesting the op
8022 optional int32 uid = 1 [(is_uid) = true];
8023
8024 // Name of the package performing the op
8025 optional string package_name = 2;
8026
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008027 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8028 // Attributions must be provided through manifest using <attribution> tag available in R and
8029 // above.
8030 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008031
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008032 // operation id
8033 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008034
8035 // The number of times the op was granted while the app was in the
8036 // foreground (only for trusted requests)
8037 optional int64 trusted_foreground_granted_count = 5;
8038
8039 // The number of times the op was granted while the app was in the
8040 // background (only for trusted requests)
8041 optional int64 trusted_background_granted_count = 6;
8042
8043 // The number of times the op was rejected while the app was in the
8044 // foreground (only for trusted requests)
8045 optional int64 trusted_foreground_rejected_count = 7;
8046
8047 // The number of times the op was rejected while the app was in the
8048 // background (only for trusted requests)
8049 optional int64 trusted_background_rejected_count = 8;
8050
8051 // For long-running operations, total duration of the operation
8052 // while the app was in the foreground (only for trusted requests)
8053 optional int64 trusted_foreground_duration_millis = 9;
8054
8055 // For long-running operations, total duration of the operation
8056 // while the app was in the background (only for trusted requests)
8057 optional int64 trusted_background_duration_millis = 10;
8058
8059 // Whether AppOps is guarded by Runtime permission
8060 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008061
8062 // Sampling rate used on device, from 0 to 100
8063 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008064}
8065
8066/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008067 * Location Manager API Usage information(e.g. API under usage,
8068 * API call's parameters).
8069 * Logged from:
8070 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8071 */
8072message LocationManagerApiUsageReported {
8073
8074 // Indicating if usage starts or usage ends.
8075 optional android.stats.location.UsageState state = 1;
8076
8077 // LocationManagerService's API in use.
8078 // We can identify which API from LocationManager is
8079 // invoking current LMS API by the combination of
8080 // API parameter(e.g. is_listener_null, is_intent_null,
8081 // is_location_request_null)
8082 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8083
8084 // Name of the package calling the API.
8085 optional string calling_package_name = 3;
8086
8087 // Type of the location provider.
8088 optional android.stats.location.ProviderType provider = 4;
8089
8090 // Quality of the location request
8091 optional android.stats.location.LocationRequestQuality quality = 5;
8092
8093 // The desired interval for active location updates, in milliseconds.
8094 // Bucketized to reduce cardinality.
8095 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8096
8097 // Minimum distance between location updates, in meters.
8098 // Bucketized to reduce cardinality.
8099 optional android.stats.location.SmallestDisplacementBucket
8100 bucketized_smallest_displacement = 7;
8101
8102 // The number of location updates.
8103 optional int64 num_updates = 8;
8104
8105 // The request expiration time, in millisecond since boot.
8106 // Bucketized to reduce cardinality.
8107 optional android.stats.location.ExpirationBucket
8108 bucketized_expire_in = 9;
8109
8110 // Type of Callback passed in for this API.
8111 optional android.stats.location.CallbackType callback_type = 10;
8112
8113 // The radius of the central point of the alert
8114 // region, in meters. Only for API REQUEST_GEOFENCE.
8115 // Bucketized to reduce cardinality.
8116 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8117
8118 // Activity Importance of API caller.
8119 // Categorized to 3 types that are interesting from location's perspective.
8120 optional android.stats.location.ActivityImportance activiy_importance = 12;
8121}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008122
8123/**
8124 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8125 */
8126message ReviewPermissionsFragmentResultReported {
8127 // unique value identifying a permission group change. A permission group change might result
8128 // in multiple of these atoms
8129 optional int64 change_id = 1;
8130
8131 // UID of package the permission belongs to
8132 optional int32 uid = 2 [(is_uid) = true];
8133
8134 // Name of package the permission belongs to
8135 optional string package_name = 3;
8136
8137 // The permission to be granted
8138 optional string permission_name = 4;
8139
8140 // The result of the permission grant
8141 optional bool permission_granted = 5;
8142}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008143
8144/**
8145* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8146* Logged from: RuntimePermissionUpdgradeController
8147*/
8148message RuntimePermissionsUpgradeResult {
8149 // Permission granted as result of upgrade
8150 optional string permission_name = 1;
8151
8152 // UID of package granted permission
8153 optional int32 uid = 2 [(is_uid) = true];
8154
8155 // Name of package granted permission
8156 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008157}
8158
8159/**
8160* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8161*/
8162message GrantPermissionsActivityButtonActions {
8163 // Permission granted as result of upgrade
8164 optional string permission_group_name = 1;
8165
8166 // UID of package granted permission
8167 optional int32 uid = 2 [(is_uid) = true];
8168
8169 // Name of package requesting permission
8170 optional string package_name = 3;
8171
8172 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8173 // LABEL_ constants in GrantPermissionActivity.java
8174 optional int32 buttons_presented = 4;
8175
8176 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8177 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008178
8179 // id which identifies single session of user interacting with permission controller
8180 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008181}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008182
8183/**
8184 * Information about LocationAccessCheck notification presented to user
8185 */
8186message LocationAccessCheckNotificationAction {
8187
8188 // id which identifies single session of user interacting with permission controller
8189 optional int64 session_id = 1;
8190
8191 // Uid of package for which location access check is presented
8192 optional int32 package_uid = 2;
8193
8194 // Name of package for which location access check is presented
8195 optional string package_name = 3;
8196
8197 enum Result {
8198 UNDEFINED = 0;
8199 // notification was presented to the user
8200 NOTIFICATION_PRESENTED = 1;
8201 // notification was declined by the user
8202 NOTIFICATION_DECLINED = 2;
8203 // notification was clicked by the user
8204 NOTIFICATION_CLICKED = 3;
8205 }
8206
8207 // View / interaction recorded
8208 optional Result result = 4;
8209}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008210
8211/**
8212 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8213 */
8214message AppPermissionFragmentActionReported {
8215 // id which identifies single session of user interacting with permission controller
8216 optional int64 session_id = 1;
8217
8218 // unique value identifying a permission group change. A permission group change might result
8219 // in multiple of these atoms
8220 optional int64 change_id = 2;
8221
8222 // UID of package the permission belongs to
8223 optional int32 uid = 3 [(is_uid) = true];
8224
8225 // Name of package the permission belongs to
8226 optional string package_name = 4;
8227
8228 // The permission to be granted
8229 optional string permission_name = 5;
8230
8231 // The result of the permission grant
8232 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008233
8234 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8235 optional int32 permission_flags = 7;
8236
8237 enum Button {
8238 UNDEFINED = 0;
8239 // Allow button
8240 ALLOW = 1;
8241 // Deny button
8242 DENY = 2;
8243 // Ask every time button
8244 ASK_EVERY_TIME = 3;
8245 // Allow all the time button
8246 ALLOW_ALWAYS = 4;
8247 // Allow only while using the app button
8248 ALLOW_FOREGROUND = 5;
8249 // Same is Deny button but shown in while in use dialog
8250 DENY_FOREGROUND = 6;
8251 }
8252
8253 // Button pressed in the dialog
8254 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008255}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008256
8257/**
8258* Information about a AppPermissionFragment viewed by user
8259*/
8260message AppPermissionFragmentViewed {
8261 // id which identifies single session of user interacting with permission controller
8262 optional int64 session_id = 1;
8263
8264 // UID of package for which permissions are viewed
8265 optional int32 uid = 2 [(is_uid) = true];
8266
8267 // Name of package for which permissions are viewed
8268 optional string package_name = 3;
8269
8270 // Permission group viewed
8271 optional string permission_group_name = 4;
8272}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008273
8274/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008275* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8276* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008277*/
8278message AppPermissionsFragmentViewed {
8279 // id which identifies single session of user interacting with permission controller
8280 optional int64 session_id = 1;
8281
8282 // id which identifies single view as every view might have several logging records
8283 // with different package information attached
8284 optional int64 view_id = 2;
8285
8286 // Permission group viewed
8287 optional string permission_group_name = 3;
8288
8289 // UID of package for which permissions are viewed
8290 optional int32 uid = 4 [(is_uid) = true];
8291
8292 // Name of package for which permissions are viewed
8293 optional string package_name = 5;
8294
8295 // Category in which permission is included
8296 enum Category {
8297 UNDEFINED = 0;
8298 ALLOWED = 1;
8299 ALLOWED_FOREGROUND = 2;
8300 DENIED = 3;
8301 }
8302 optional Category category = 6;
8303}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008304/**
8305* Information about a PermissionAppsFragment viewed by user.
8306* Logged from ui/handheld/PermissionAppsFragment.java
8307*/
8308message PermissionAppsFragmentViewed {
8309 // id which identifies single session of user interacting with permission controller
8310 optional int64 session_id = 1;
8311
8312 // id which identifies single view as every view might have several logging records
8313 // with different package information attached
8314 optional int64 view_id = 2;
8315
8316 // Permission group viewed
8317 optional string permission_group_name = 3;
8318
8319 // UID of package for which permissions are viewed
8320 optional int32 uid = 4 [(is_uid) = true];
8321
8322 // Name of package for which permissions are viewed
8323 optional string package_name = 5;
8324
8325 // Category in which app is included
8326 enum Category {
8327 UNDEFINED = 0;
8328 ALLOWED = 1;
8329 ALLOWED_FOREGROUND = 2;
8330 DENIED = 3;
8331 }
8332 optional Category category = 6;
8333}
Tony Make2b1b672019-07-29 16:59:47 +01008334
8335/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008336* Log that the Auto Revoke notification has been clicked
8337* Logged from ui/ManagePermissionsActivity
8338*/
8339message AutoRevokeNotificationClicked {
8340 // id which identifies single session of user interacting with permission controller
8341 optional int64 session_id = 1;
8342}
8343
8344/**
8345* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8346* auto revoked for it.
8347* Logged from ui/handheld/AutoRevokeFragment
8348*/
8349message AutoRevokeFragmentAppViewed {
8350 // id which identifies single session of user interacting with permission controller
8351 optional int64 session_id = 1;
8352
8353 // UID of package for which permissions are viewed
8354 optional int32 uid = 2 [(is_uid) = true];
8355
8356 // Name of package for which permissions are viewed
8357 optional string package_name = 3;
8358
8359 // The name of a permission group that has been revoked
8360 optional string permission_group_name = 4;
8361
8362 // The age of the app- more than three months old, or more than six months
8363 enum Age {
8364 UNDEFINED = 0;
8365 NEWER_BUCKET = 1;
8366 OLDER_BUCKET = 2;
8367 }
8368
8369 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8370 optional Age age = 5;
8371}
8372
8373/**
8374* Log that the user has interacted with an app on the auto revoke fragment
8375* Logged from ui/handheld/AutoRevokeFragment
8376*/
8377message AutoRevokedAppInteraction {
8378 // id which identifies single session of user interacting with permission controller
8379 optional int64 session_id = 1;
8380
8381 // UID of package for which permissions are viewed
8382 optional int32 uid = 2 [(is_uid) = true];
8383
8384 // Name of package for which permissions are viewed
8385 optional string package_name = 3;
8386
8387 enum Action {
8388 UNDEFINED = 0;
8389 REMOVE = 1;
8390 OPEN = 2;
8391 APP_INFO = 3;
8392 PERMISSIONS = 4;
8393 REMOVE_IN_SETTINGS = 5;
8394 OPEN_IN_SETTINGS = 6;
8395 }
8396
8397 // The action the user took to interact with the app
8398 optional Action action = 4;
8399}
8400
8401/**
8402* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8403* auto revoke, or that the auto revoke switch has been changed
8404* Logged from ui/handheld/AppPermissionGroupsFragment
8405 */
8406message AppPermissionGroupsFragmentAutoRevokeAction {
8407 // id which identifies single session of user interacting with permission controller
8408 optional int64 session_id = 1;
8409
8410 // UID of package for which permissions are viewed
8411 optional int32 uid = 2 [(is_uid) = true];
8412
8413 // Name of package for which permissions are viewed
8414 optional string package_name = 3;
8415
8416 enum Action {
8417 UNDEFINED = 0;
8418 OPENED_FOR_AUTO_REVOKE = 1;
8419 OPENED_FROM_INTENT = 2;
8420 SWITCH_ENABLED = 3;
8421 SWITCH_DISABLED = 4;
8422 }
8423
8424 // The action the user took to interact with the fragment
8425 optional Action action = 4;
8426}
8427
8428/**
Tony Make2b1b672019-07-29 16:59:47 +01008429 * Logs when there is a smart selection related event.
8430 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8431 * Logged from: TextClassifierEventLogger.java
8432 */
8433message TextSelectionEvent {
8434 // A session ID.
8435 optional string session_id = 1;
8436
8437 // Event type of this event.
8438 optional android.stats.textclassifier.EventType event_type = 2;
8439
Tony Mak9c84bd22019-12-09 07:27:25 +00008440 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008441 optional string model_name = 3;
8442
8443 // Type of widget that was involved in triggering this event.
8444 optional android.stats.textclassifier.WidgetType widget_type = 4;
8445
8446 // Index of this event in a session.
8447 optional int32 event_index = 5;
8448
8449 // Entity type that is involved.
8450 optional string entity_type = 6;
8451
8452 // Relative word index of the start of the selection.
8453 optional int32 relative_word_start_index = 7;
8454
8455 // Relative word (exclusive) index of the end of the selection.
8456 optional int32 relative_word_end_index = 8;
8457
8458 // Relative word index of the start of the smart selection.
8459 optional int32 relative_suggested_word_start_index = 9;
8460
8461 // Relative word (exclusive) index of the end of the smart selection.
8462 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008463
8464 // Name of source package.
8465 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008466
8467 // Name of the LangID model that is involved in this event.
8468 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008469}
8470
8471/**
8472 * Logs when there is a smart linkify related event.
8473 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8474 * Logged from: TextClassifierEventLogger.java
8475 */
8476message TextLinkifyEvent {
8477 // A session ID.
8478 optional string session_id = 1;
8479
8480 // Event type of this event.
8481 optional android.stats.textclassifier.EventType event_type = 2;
8482
Tony Mak9c84bd22019-12-09 07:27:25 +00008483 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008484 optional string model_name = 3;
8485
8486 // Type of widget that was involved in triggering this event.
8487 optional android.stats.textclassifier.WidgetType widget_type = 4;
8488
8489 // Index of this event in a session.
8490 optional int32 event_index = 5;
8491
8492 // Entity type that is involved.
8493 optional string entity_type = 6;
8494
8495 // Number of links detected.
8496 optional int32 num_links = 7;
8497
8498 // The total length of all links.
8499 optional int32 linked_text_length = 8;
8500
8501 // Length of input text.
8502 optional int32 text_length = 9;
8503
8504 // Time spent on generating links in ms.
8505 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008506
8507 // Name of source package.
8508 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008509
8510 // Name of the LangID model that is involved in this event.
8511 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008512}
8513
8514/**
8515 * Logs when there is a conversation actions related event.
8516 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8517 * Logged from: TextClassifierEventLogger.java
8518 */
8519message ConversationActionsEvent {
8520 // A session ID.
8521 optional string session_id = 1;
8522
8523 // Event type of this event.
8524 optional android.stats.textclassifier.EventType event_type = 2;
8525
Tony Mak9c84bd22019-12-09 07:27:25 +00008526 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008527 optional string model_name = 3;
8528
8529 // Type of widget that was involved in triggering this event.
8530 optional android.stats.textclassifier.WidgetType widget_type = 4;
8531
8532 // The first entity type that is involved.
8533 optional string first_entity_type = 5;
8534
8535 // The second entity type that is involved.
8536 optional string second_entity_type = 6;
8537
8538 // The third entity type that is involved.
8539 optional string third_entity_type = 7;
8540
8541 // The score of the first entity type.
8542 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008543
8544 // Name of source package.
8545 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008546
8547 // Name of the annotator model that is involved in this event.
8548 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008549
8550 // Name of the LangID model that is involved in this event.
8551 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008552}
8553
8554/**
8555 * Logs when there is a language detection related event.
8556 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8557 * Logged from: TextClassifierEventLogger.java
8558 */
8559message LanguageDetectionEvent {
8560 // A session ID.
8561 optional string session_id = 1;
8562
8563 // Event type of this event.
8564 optional android.stats.textclassifier.EventType event_type = 2;
8565
Tony Mak9c84bd22019-12-09 07:27:25 +00008566 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008567 optional string model_name = 3;
8568
8569 // Type of widget that was involved in triggering this event.
8570 optional android.stats.textclassifier.WidgetType widget_type = 4;
8571
8572 // Detected language.
8573 optional string language_tag = 5;
8574
8575 // Score of the detected language.
8576 optional float score = 6;
8577
8578 // Position of this action.
8579 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008580
8581 // Name of source package.
8582 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008583}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008584
8585/**
8586 * Information about an OTA update attempt by update_engine.
8587 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8588 */
8589message UpdateEngineUpdateAttemptReported {
8590 // The number of attempts for the update engine to apply a given payload.
8591 optional int32 attempt_number = 1;
8592
8593 optional android.stats.otaupdate.PayloadType payload_type = 2;
8594
8595 // The total time in minutes for the update engine to apply a given payload.
8596 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8597 // it's increased when the system is sleeping.
8598 optional int32 duration_boottime_in_minutes = 3;
8599
8600 // The total time in minutes for the update engine to apply a given payload.
8601 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8602 // and it's not increased when the system is sleeping.
8603 optional int32 duration_monotonic_in_minutes = 4;
8604
8605 // The size of the payload in MiBs.
8606 optional int32 payload_size_mib = 5;
8607
8608 // The attempt result reported by the update engine for an OTA update.
8609 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8610
8611 // The error code reported by the update engine after an OTA update attempt
8612 // on A/B devices.
8613 optional android.stats.otaupdate.ErrorCode error_code = 7;
8614
8615 // The build fingerprint of the source system. The value is read from a
8616 // system property when the device takes the update. e.g.
8617 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8618 optional string source_fingerprint = 8;
8619}
8620
8621/**
8622 * Information about all the attempts the device make before finishing the
8623 * successful update.
8624 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8625 */
8626message UpdateEngineSuccessfulUpdateReported {
8627 // The number of attempts for the update engine to apply the payload for a
8628 // successful update.
8629 optional int32 attempt_count = 1;
8630
8631 optional android.stats.otaupdate.PayloadType payload_type = 2;
8632
8633 optional int32 payload_size_mib = 3;
8634
8635 // The total number of bytes downloaded by update_engine since the last
8636 // successful update.
8637 optional int32 total_bytes_downloaded_mib = 4;
8638
8639 // The ratio in percentage of the over-downloaded bytes compared to the
8640 // total bytes needed to successfully install the update. e.g. 200 if we
8641 // download 200MiB in total for a 100MiB package.
8642 optional int32 download_overhead_percentage = 5;
8643
8644 // The total time in minutes for the update engine to apply the payload for a
8645 // successful update.
8646 optional int32 total_duration_minutes = 6;
8647
8648 // The number of reboot of the device during a successful update.
8649 optional int32 reboot_count = 7;
8650}
Alec Mourie088e762019-07-02 13:10:55 -07008651
8652/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008653 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8654 * key to indicate whether it was successful or not.
8655 *
8656 * Logged from:
8657 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8658 */
8659message RebootEscrowRecoveryReported {
8660 optional bool successful = 1;
8661}
8662
8663/**
Alec Mourie088e762019-07-02 13:10:55 -07008664 * Global display pipeline metrics reported by SurfaceFlinger.
8665 * Pulled from:
8666 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8667 */
8668message SurfaceflingerStatsGlobalInfo {
8669 // Total number of frames presented during the tracing period
8670 optional int64 total_frames = 1;
8671 // Total number of frames missed
8672 optional int64 missed_frames = 2;
8673 // Total number of frames that fell back to client composition
8674 optional int64 client_composition_frames = 3;
8675 // Total time the display was turned on
8676 optional int64 display_on_millis = 4;
8677 // Total time that was spent performing animations.
8678 // This is derived from the present-to-present layer histogram
8679 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008680 // Total number of event connections tracked by SurfaceFlinger at the time
8681 // of this pull. If this number grows prohibitively large, then this can
8682 // cause jank due to resource contention.
8683 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008684 // Set of timings measured from when SurfaceFlinger began compositing a
8685 // frame, until the frame was requested to be presented to the display. This
8686 // measures SurfaceFlinger's total CPU walltime on the critical path per
8687 // frame.
8688 optional FrameTimingHistogram frame_duration = 7
8689 [(android.os.statsd.log_mode) = MODE_BYTES];
8690 // Set of timings measured from when SurfaceFlinger first began using the
8691 // GPU to composite a frame, until the GPU has finished compositing that
8692 // frame. This measures the total additional time SurfaceFlinger needed to
8693 // perform due to falling back into GPU composition.
8694 optional FrameTimingHistogram render_engine_timing = 8
8695 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008696}
8697
8698/**
8699 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8700 * The number of layers uploaded will be restricted due to size limitations.
8701 * Pulled from:
8702 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8703 */
8704message SurfaceflingerStatsLayerInfo {
8705 // The layer for this set of metrics
8706 // For now we can infer that the package name is included in the layer
8707 // name.
8708 optional string layer_name = 1;
8709 // Total number of frames presented
8710 optional int64 total_frames = 2;
8711 // Total number of dropped frames while latching a buffer for this layer.
8712 optional int64 dropped_frames = 3;
8713 // Set of timings measured between successive presentation timestamps.
8714 optional FrameTimingHistogram present_to_present = 4
8715 [(android.os.statsd.log_mode) = MODE_BYTES];
8716 // Set of timings measured from when an app queued a buffer for
8717 // presentation, until the buffer was actually presented to the
8718 // display.
8719 optional FrameTimingHistogram post_to_present = 5
8720 [(android.os.statsd.log_mode) = MODE_BYTES];
8721 // Set of timings measured from when a buffer is ready to be presented,
8722 // until the buffer was actually presented to the display.
8723 optional FrameTimingHistogram acquire_to_present = 6
8724 [(android.os.statsd.log_mode) = MODE_BYTES];
8725 // Set of timings measured from when a buffer was latched by
8726 // SurfaceFlinger, until the buffer was presented to the display
8727 optional FrameTimingHistogram latch_to_present = 7
8728 [(android.os.statsd.log_mode) = MODE_BYTES];
8729 // Set of timings measured from the desired presentation to the actual
8730 // presentation time
8731 optional FrameTimingHistogram desired_to_present = 8
8732 [(android.os.statsd.log_mode) = MODE_BYTES];
8733 // Set of timings measured from when an app queued a buffer for
8734 // presentation, until the buffer was ready to be presented.
8735 optional FrameTimingHistogram post_to_acquire = 9
8736 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008737 // Frames missed latch because the acquire fence didn't fire
8738 optional int64 late_acquire_frames = 10;
8739 // Frames latched early because the desired present time was bad
8740 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008741}
8742
8743/**
8744 * Histogram of frame counts bucketed by time in milliseconds.
8745 * Because of size limitations, we hard-cap the number of buckets, with
8746 * buckets for corresponding to larger milliseconds being less precise.
8747 */
8748message FrameTimingHistogram {
8749 // Timings in milliseconds that describes a set of histogram buckets
8750 repeated int32 time_millis_buckets = 1;
8751 // Number of frames that match to each time_millis, i.e. the bucket
8752 // contents
8753 // It's required that len(time_millis) == len(frame_count)
8754 repeated int64 frame_counts = 2;
8755}
Emilian Peev6729f372019-08-29 09:14:09 -07008756
Emilian Peev6729f372019-08-29 09:14:09 -07008757/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008758 * Janky event as reported by SurfaceFlinger.
8759 * This event is intended to be consumed by a Perfetto subscriber for
8760 * automated trace collection.
8761 *
8762 * Logged from:
8763 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8764 */
8765message DisplayJankReported {
8766 // Informational field for how long the janky event lasted in milliseconds
8767 optional int64 event_duration_millis = 1;
8768 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8769 // the display on time.
8770 optional int32 present_deadlines_missed = 2;
8771}
8772
8773/**
Emilian Peev6729f372019-08-29 09:14:09 -07008774 * Information about camera facing and API level usage.
8775 * Logged from:
8776 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8777 */
8778message CameraActionEvent {
8779 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008780 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008781
8782 // Camera API level used
8783 optional int32 api_level = 2;
8784
8785 // Name of client package
8786 optional string package_name = 3;
8787
8788 // Camera facing
8789 enum Facing {
8790 UNKNOWN = 0;
8791 BACK = 1;
8792 FRONT = 2;
8793 EXTERNAL = 3;
8794 }
8795 optional Facing facing = 4;
8796}
atrost01a20932019-08-28 15:40:37 +01008797
8798/**
8799 * Logs when a compatibility change is affecting an app.
8800 *
8801 * Logged from:
8802 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8803 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8804 */
8805message AppCompatibilityChangeReported {
8806 // The UID of the app being affected by the compatibilty change.
8807 optional int32 uid = 1 [(is_uid) = true];
8808
8809 // The ID of the change affecting the app.
8810 optional int64 change_id = 2;
8811
8812 enum State {
8813 UNKNOWN_STATE = 0;
8814 ENABLED = 1;
8815 DISABLED = 2;
8816 LOGGED = 3;
8817 }
8818
8819 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8820 // logged otherwise.
8821 optional State state = 3;
8822
8823 enum Source {
8824 UNKNOWN_SOURCE = 0;
8825 APP_PROCESS = 1;
8826 SYSTEM_SERVER = 2;
8827 }
8828
8829 // Where it was logged from.
8830 optional Source source = 4;
8831
8832}
Hector Dearman40579f62019-11-01 13:19:30 +00008833
8834/**
8835 * Logged from
8836 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8837 */
8838message PerfettoUploaded {
8839 enum Event {
8840 PERFETTO_UNDEFINED = 0;
8841 PERFETTO_TRACE_BEGIN = 1;
8842 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8843 PERFETTO_ON_CONNECT = 3;
8844 PERFETTO_ON_TRACING_DISABLED = 4;
8845 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8846 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8847 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8848 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8849 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8850 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8851 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8852 PERFETTO_TRIGGER_BEGIN = 12;
8853 PERFETTO_TRIGGER_SUCCESS = 13;
8854 PERFETTO_TRIGGER_FAILURE = 14;
8855 PERFETTO_HIT_GUARDRAILS = 15;
8856 PERFETTO_ON_TIMEOUT = 16;
8857 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8858 }
8859
8860 // Which stage of the pipeline we are reporting from.
8861 optional Event event = 1;
8862
8863 // UUID matching the one set inside the SystemInfo trace packet.
8864 optional int64 trace_uuid_lsb = 2;
8865 optional int64 trace_uuid_msb = 3;
8866}
Mark Tabrya824a642019-11-05 12:26:12 -08008867
8868/**
8869 * Pulls client metrics on data transferred via Vehicle Maps Service.
8870 * Metrics are keyed by uid + layer.
8871 *
8872 * Pulled from:
8873 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8874 */
8875message VmsClientStats {
8876 // UID of the VMS client app
8877 optional int32 uid = 1 [(is_uid) = true];
8878
8879 // VMS layer definition
8880 optional int32 layer_type = 2;
8881 optional int32 layer_channel = 3;
8882 optional int32 layer_version = 4;
8883
8884 // Bytes and packets sent by the client for the layer
8885 optional int64 tx_bytes = 5;
8886 optional int64 tx_packets = 6;
8887
8888 // Bytes and packets received by the client for the layer
8889 optional int64 rx_bytes = 7;
8890 optional int64 rx_packets = 8;
8891
8892 // Bytes and packets dropped due to client error
8893 optional int64 dropped_bytes = 9;
8894 optional int64 dropped_packets = 10;
8895}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008896
8897/**
8898 * State of a dangerous permission requested by a package - sampled
8899 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8900*/
8901message DangerousPermissionStateSampled {
8902 // Name of the permission
8903 optional string permission_name = 1;
8904
8905 // Uid of the package
8906 optional int32 uid = 2 [(is_uid) = true];
8907
8908 // If the permission is granted to the uid
8909 optional bool is_granted = 3;
8910
8911 // Permission flags as per android.content.pm.PermissionFlags
8912 optional int32 permission_flags = 4;
8913}
8914
Stan Iliev637ba5e2019-08-16 13:43:08 -04008915/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008916 * HWUI stats for a given app.
8917 */
8918message GraphicsStats {
8919 // The package name of the app
8920 optional string package_name = 1;
8921
8922 // The version code of the app
8923 optional int64 version_code = 2;
8924
8925 // The start & end timestamps in UTC as
8926 // milliseconds since January 1, 1970
8927 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008928 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008929
Stan Ilievb6517192020-02-18 10:12:42 -05008930 optional int64 end_millis = 4;
8931
8932 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8933 enum PipelineType {
8934 UNKNOWN = 0;
8935 GL = 1;
8936 VULKAN = 2;
8937 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008938
8939 // HWUI renders pipeline type: GL or Vulkan.
8940 optional PipelineType pipeline = 5;
8941
8942 // Distinct frame count.
8943 optional int32 total_frames = 6;
8944
8945 // Number of "missed vsync" events.
8946 optional int32 missed_vsync_count = 7;
8947
8948 // Number of frames in triple-buffering scenario (high input latency)
8949 optional int32 high_input_latency_count = 8;
8950
8951 // Number of "slow UI thread" events.
8952 optional int32 slow_ui_thread_count = 9;
8953
8954 // Number of "slow bitmap upload" events.
8955 optional int32 slow_bitmap_upload_count = 10;
8956
8957 // Number of "slow draw" events.
8958 optional int32 slow_draw_count = 11;
8959
8960 // Number of frames that missed their deadline (aka, visibly janked)
8961 optional int32 missed_deadline_count = 12;
8962
8963 // The frame time histogram for the package
8964 optional FrameTimingHistogram cpu_histogram = 13
8965 [(android.os.statsd.log_mode) = MODE_BYTES];
8966
8967 // The gpu frame time histogram for the package
8968 optional FrameTimingHistogram gpu_histogram = 14
8969 [(android.os.statsd.log_mode) = MODE_BYTES];
8970
8971 // UI mainline module version.
8972 optional int64 version_ui_module = 15;
8973
8974 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8975 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8976 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8977 // more apps are running / rendering.
8978 optional bool is_today = 16;
8979}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008980
8981/**
8982 * Message related to dangerous (runtime) app ops access
8983 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008984message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008985 // Uid of the package accessing app op
8986 optional int32 uid = 1 [(is_uid) = true];
8987
8988 // Name of the package accessing app op
8989 optional string package_name = 2;
8990
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008991 // deprecated - set to empty string
8992 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008993
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008994 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008995 // API. Attributions must be provided through manifest using <attribution> tag available in R
8996 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008997 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008998
8999 // message related to app op access, limited to 600 chars by API
9000 optional string message = 5;
9001
9002 enum SamplingStrategy {
9003 DEFAULT = 0;
9004 UNIFORM = 1;
9005 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009006 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009007 }
9008
9009 // sampling strategy used to collect this message
9010 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009011
9012 // operation id
9013 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009014}
9015
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009016/*
9017 * Logs userspace reboot outcome and duration.
9018 *
9019 * Logged from:
9020 * frameworks/base/core/java/com/android/server/BootReceiver.java
9021 */
9022message UserspaceRebootReported {
9023 // Possible outcomes of userspace reboot.
9024 enum Outcome {
9025 // Default value in case platform failed to determine the outcome.
9026 OUTCOME_UNKNOWN = 0;
9027 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9028 SUCCESS = 1;
9029 // Userspace reboot shutdown sequence was aborted.
9030 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9031 // Remounting userdata into checkpointing mode failed.
9032 FAILED_USERDATA_REMOUNT = 3;
9033 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9034 // reboot.
9035 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9036 }
9037 // Outcome of userspace reboot. Always set.
9038 optional Outcome outcome = 1;
9039 // Duration of userspace reboot in case it has a successful outcome.
9040 // Duration is measured as time between userspace reboot was initiated and until boot completed
9041 // (e.g. sys.boot_completed=1).
9042 optional int64 duration_millis = 2;
9043 // State of primary user's (user0) credential encryption storage.
9044 enum UserEncryptionState {
9045 // Default value.
9046 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9047 // Credential encrypted storage is unlocked.
9048 UNLOCKED = 1;
9049 // Credential encrypted storage is locked.
9050 LOCKED = 2;
9051 }
9052 // State of primary user's encryption storage at the moment boot completed. Always set.
9053 optional UserEncryptionState user_encryption_state = 3;
9054}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009055
9056/*
9057 * Logs integrity check information during each install.
9058 *
9059 * Logged from:
9060 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9061 */
9062message IntegrityCheckResultReported {
9063 optional string package_name = 1;
9064 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009065 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009066 optional string installer_package_name = 4;
9067 enum Response {
9068 UNKNOWN = 0;
9069 ALLOWED = 1;
9070 REJECTED = 2;
9071 FORCE_ALLOWED = 3;
9072 }
9073 optional Response response = 5;
9074 // An estimate on the cause of the response. This will only be populated for
9075 // REJECTED and FORCE_ALLOWED
9076 optional bool caused_by_app_cert_rule = 6;
9077 optional bool caused_by_installer_rule = 7;
9078}
9079
9080/**
9081 * Logs the information about the rules and the provider whenever rules are
9082 * pushed into AppIntegrityManager.
9083 *
9084 * Logged from:
9085 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9086 */
9087message IntegrityRulesPushed {
9088 optional bool success = 1;
9089 // Package name of the app that pushed the rules.
9090 optional string rule_provider = 2;
9091 // Version string of arbitrary format provided by the rule provider to
9092 // identify the rules.
9093 optional string rule_version = 3;
9094}
Jordan Liubedfa702019-12-20 15:08:45 -08009095
9096/**
9097 * Logs when a cell broadcast message is received on the device.
9098 *
9099 * Logged from CellBroadcastService module:
9100 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9101 */
9102message CellBroadcastMessageReported {
9103 // The type of Cell Broadcast message
9104 enum CbType {
9105 UNKNOWN_TYPE = 0;
9106 GSM = 1;
9107 CDMA = 2;
9108 CDMA_SPC = 3;
9109 }
9110
9111 // GSM, CDMA, CDMA-SCP
9112 optional CbType type = 1;
9113}
9114
9115/**
9116 * Logs when an error occurs while handling a cell broadcast message;
9117 *
9118 * Logged from CellBroadcastService module:
9119 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9120 */
9121message CellBroadcastMessageError {
9122 // The type of error raised when trying to handle a cell broadcast message
9123 enum ErrorType {
9124 UNKNOWN_TYPE = 0;
9125 CDMA_DECODING_ERROR = 1;
9126 CDMA_SCP_EMPTY = 2;
9127 CDMA_SCP_HANDLING_ERROR = 3;
9128 GSM_INVALID_HEADER_LENGTH = 4;
9129 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9130 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9131 GSM_INVALID_PDU = 7;
9132 GSM_INVALID_GEO_FENCING_DATA = 8;
9133 GSM_UMTS_INVALID_WAC = 9;
9134 FAILED_TO_INSERT_TO_DB = 10;
9135 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9136 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9137 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9138 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9139 }
9140
9141 // What kind of error occurred
9142 optional ErrorType type = 1;
9143
9144 // Exception message (or log message) associated with the error (max 1000 chars)
9145 optional string exception_message = 2;
9146}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009147
9148/**
9149 * Logs when the SDK Extensions test app has polled the current version.
9150 * This is atom ID 354.
9151 *
9152 * Logged from:
9153 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
9154 */
9155message SdkExtensionStatus {
9156 enum ApiCallStatus {
9157 CALL_NOT_ATTEMPTED = 0;
9158 CALL_SUCCESSFUL = 1;
9159 CALL_FAILED = 2;
9160 }
9161
9162 optional ApiCallStatus result = 1;
9163
9164 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9165 optional int32 r_extension_version = 2;
9166
9167 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9168 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9169 optional int32 failed_call_symbol = 3;
9170}
Marco Ballesio497aff42020-01-24 08:39:42 -08009171
9172/**
9173 * Logs when an app is frozen or unfrozen.
9174 *
9175 * Logged from:
9176 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9177 */
9178message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009179 // The type of event.
9180 enum Action {
9181 UNKNOWN = 0;
9182 FREEZE_APP = 1;
9183 UNFREEZE_APP = 2;
9184 }
9185 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009186
Blake Kragten6ce382a2020-01-16 20:20:46 -08009187 // Pid of the process being frozen.
9188 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009189
Blake Kragten6ce382a2020-01-16 20:20:46 -08009190 // Name of the process being frozen.
9191 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009192
Blake Kragten6ce382a2020-01-16 20:20:46 -08009193 // Time since last unfrozen.
9194 optional int64 time_unfrozen_millis = 4;
9195}
9196
9197/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009198 * Pulls information for a single voice call.
9199 *
9200 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9201 *
9202 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009203 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009204 */
9205message VoiceCallSession {
9206 // Bearer (IMS or CS) when the call started.
9207 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9208
9209 // Bearer (IMS or CS) when the call ended.
9210 // The bearer may change during the call, e.g. due to SRVCC.
9211 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9212
9213 // Direction of the call (incoming or outgoing).
9214 optional android.telephony.CallDirectionEnum direction = 3;
9215
9216 // Time spent setting up the call.
9217 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9218
9219 // Whether the call ended before the setup was completed.
9220 optional bool setup_failed = 5;
9221
9222 // IMS reason code or CS disconnect cause.
9223 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9224 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9225 optional int32 disconnect_reason_code = 6;
9226
9227 // IMS extra code or CS precise disconnect cause.
9228 // For IMS, this code is vendor-specific
9229 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9230 optional int32 disconnect_extra_code = 7;
9231
9232 // IMS extra message or CS vendor cause.
9233 optional string disconnect_extra_message = 8;
9234
9235 // Radio access technology (RAT) used when call started.
9236 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9237
9238 // Radio access technology (RAT) used when call terminated.
9239 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9240
9241 // Number of times RAT changed during the call.
9242 optional int64 rat_switch_count = 11;
9243
9244 // A bitmask of all codecs used during the call.
9245 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9246 optional int64 codec_bitmask = 12;
9247
9248 // Number of other calls going on during call setup, for the same SIM slot.
9249 optional int32 concurrent_call_count_at_start = 13;
9250
9251 // Number of other calls going on during call termination, for the same SIM slot.
9252 optional int32 concurrent_call_count_at_end = 14;
9253
9254 // Index of the SIM is used, 0 for single-SIM devices.
9255 optional int32 sim_slot_index = 15;
9256
9257 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9258 optional bool is_multi_sim = 16;
9259
9260 // Whether the call was made with an eSIM profile.
9261 optional bool is_esim = 17;
9262
9263 // Carrier ID of the SIM card.
9264 // See https://source.android.com/devices/tech/config/carrierid.
9265 optional int32 carrier_id = 18;
9266
Chi Zhangba1b03a2020-04-21 17:17:56 -07009267 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009268 optional bool srvcc_completed = 19;
9269
9270 // Number of SRVCC failures.
9271 optional int64 srvcc_failure_count = 20;
9272
9273 // Number of SRVCC cancellations.
9274 optional int64 srvcc_cancellation_count = 21;
9275
Chi Zhangba1b03a2020-04-21 17:17:56 -07009276 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9277 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009278 optional bool rtt_enabled = 22;
9279
9280 // Whether this was an emergency call.
9281 optional bool is_emergency = 23;
9282
9283 // Whether the call was performed while roaming.
9284 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009285
9286 // A random number used as the dimension field to pull multiple atoms.
9287 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009288}
9289
9290/**
9291 * Pulls voice call radio access technology (RAT) usage.
9292 *
9293 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9294 * time. The atom will be skipped if not enough data is available.
9295 *
9296 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009297 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009298 */
9299message VoiceCallRatUsage {
9300 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9301 optional int32 carrier_id = 1;
9302
9303 // Radio access technology.
9304 optional android.telephony.NetworkTypeEnum rat = 2;
9305
9306 // Total duration that voice calls spent on this carrier and RAT.
9307 optional int64 total_duration_seconds = 3;
9308
9309 // Total number of calls using this carrier and RAT.
9310 // A call is counted once even if it used the RAT multiple times.
9311 optional int64 call_count = 4;
9312}
9313
9314/**
9315 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9316 *
9317 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009318 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009319 */
9320message SimSlotState {
9321 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9322 optional int32 active_slot_count = 1;
9323
9324 // Number of SIM cards (both physical and active eSIM profiles).
9325 // This number is always equal to or less than the number of active SIM slots.
9326 optional int32 sim_count = 2;
9327
9328 // Number of active eSIM profiles.
9329 // This number is always equal to or less than the number of SIMs.
9330 optional int32 esim_count = 3;
9331}
9332
9333/**
9334 * Pulls supported cellular radio access technologies.
9335 *
9336 * This atom reports the capabilities of the device, rather than the network it has access to.
9337 *
9338 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009339 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009340 */
9341message SupportedRadioAccessFamily {
9342 // A bitmask of supported radio technologies.
9343 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9344 optional int64 network_type_bitmask = 1;
9345}
9346
9347/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009348 * Logs gnss stats from location service provider
9349 *
9350 * Pulled from:
9351 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9352 */
9353
9354message GnssStats {
9355 // Number of location reports since boot
9356 optional int64 location_reports = 1;
9357
9358 // Total pulled reports of Location failures since boot
9359 optional int64 location_failure_reports = 2;
9360
9361 // Number of time to first fix reports since boot
9362 optional int64 time_to_first_fix_reports = 3;
9363
9364 // Total pulled reported time to first fix (in milli-seconds) since boot
9365 optional int64 time_to_first_fix_milli_s = 4;
9366
9367 // Number of position accuracy reports since boot
9368 optional int64 position_accuracy_reports = 5;
9369
9370 // Total pulled reported position accuracy (in meters) since boot
9371 optional int64 position_accuracy_meters = 6;
9372
9373 // Number of top 4 average CN0 reports since boot
9374 optional int64 top_four_average_cn0_reports = 7;
9375
9376 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9377 optional int64 top_four_average_cn0_db_mhz = 8;
9378
9379 // Number of l5 top 4 average CN0 reports since boot
9380 optional int64 l5_top_four_average_cn0_reports = 9;
9381
9382 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9383 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9384
9385 // Total number of sv status messages reports since boot
9386 optional int64 sv_status_reports = 11;
9387
9388 // Total number of sv status messages reports, where sv is used in fix since boot
9389 optional int64 sv_status_reports_used_in_fix = 12;
9390
9391 // Total number of L5 sv status messages reports since boot
9392 optional int64 l5_sv_status_reports = 13;
9393
9394 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9395 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009396}
Kweku Adams12752132020-02-18 15:36:48 -08009397
9398/**
9399 * Logs when an app is moved to a different standby bucket.
9400 *
9401 * Logged from:
9402 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9403 */
9404message AppStandbyBucketChanged {
9405 optional string package_name = 1;
9406
9407 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9408 optional int32 user_id = 2;
9409
9410 // These enum values match the constants defined in UsageStatsManager.java.
9411 enum Bucket {
9412 BUCKET_UNKNOWN = 0;
9413 BUCKET_EXEMPTED = 5;
9414 BUCKET_ACTIVE = 10;
9415 BUCKET_WORKING_SET = 20;
9416 BUCKET_FREQUENT = 30;
9417 BUCKET_RARE = 40;
9418 BUCKET_RESTRICTED = 45;
9419 BUCKET_NEVER = 50;
9420 }
9421 optional Bucket bucket = 3;
9422
9423 enum MainReason {
9424 MAIN_UNKNOWN = 0;
9425 MAIN_DEFAULT = 0x0100;
9426 MAIN_TIMEOUT = 0x0200;
9427 MAIN_USAGE = 0x0300;
9428 MAIN_FORCED_BY_USER = 0x0400;
9429 MAIN_PREDICTED = 0x0500;
9430 MAIN_FORCED_BY_SYSTEM = 0x0600;
9431 }
9432 optional MainReason main_reason = 4;
9433
9434 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9435 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9436 // UsageStatsManager.java.
9437 optional int32 sub_reason = 5;
9438}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009439
9440/**
9441* Reports a started sharesheet transaction.
9442*
9443* Logged from:
9444* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9445*/
9446message SharesheetStarted {
9447 // The event_id (as for UiEventReported).
9448 optional int32 event_id = 1;
9449 // The calling app's package name.
9450 optional string package_name = 2;
9451 // An identifier to tie together multiple logs relating to the same share event
9452 optional int32 instance_id = 3;
9453 // The mime type of the share
9454 optional string mime_type = 4;
9455 // The number of direct targets the calling app is providing that will be shown.
9456 optional int32 num_app_provided_direct_targets = 5;
9457 // The number of app targets the calling app is providing that will be shown.
9458 optional int32 num_app_provided_app_targets = 6;
9459 // True if the share originates from the workprofile
9460 optional bool is_workprofile = 7;
9461
9462 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009463 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009464 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9465 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9466 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9467 }
9468 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009469 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009470
9471 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9472 INTENT_DEFAULT = 0;
9473 INTENT_ACTION_VIEW = 1;
9474 INTENT_ACTION_EDIT = 2;
9475 INTENT_ACTION_SEND = 3;
9476 INTENT_ACTION_SENDTO = 4;
9477 INTENT_ACTION_SEND_MULTIPLE = 5;
9478 INTENT_ACTION_IMAGE_CAPTURE = 6;
9479 INTENT_ACTION_MAIN = 7;
9480 }
9481 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009482 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009483}
9484
9485/**
9486 * Reports a ranking selection event.
9487 *
9488 * Logged from:
9489 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9490 */
9491message RankingSelected {
9492 // The event_id (as for UiEventReported).
9493 optional int32 event_id = 1;
9494 // The relevant app's package name (can be source or picked package).
9495 optional string package_name = 2;
9496 // An identifier to tie together multiple logs relating to the same share event.
9497 optional int32 instance_id = 3;
9498 // Which of the ranked targets got picked, default starting position 0.
9499 optional int32 position_picked = 4;
9500}
Raff Tsaiea4db182020-03-06 07:45:43 +08009501
9502/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009503 * Logs when TvSettings UI is interacted at.
9504 *
9505 * Logged from: packages/apps/TvSettings
9506 */
9507message TvSettingsUIInteracted {
9508
9509 /** The UI action category */
9510 optional android.app.tvsettings.Action action = 1;
9511
9512 /** The ID of the entry that the users actioned on */
9513 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009514}
9515
9516/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009517 * Logs information about a package installation using package installer V2 APIs.
9518 *
9519 * Logged from:
9520 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9521 */
9522message PackageInstallerV2Reported {
9523 // Whether this installation uses Incremental File System
9524 optional bool is_incremental = 1;
9525 // Name of the package that is intended to be installed
9526 optional string package_name = 2;
9527 // The duration between when the install was requested to when the install has completed
9528 optional int64 duration_millis = 3;
9529 // Installation result in final integer, which are SystemApi's.
9530 // Return_code 1 indicates success.
9531 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9532 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009533 // Total size of the APKs installed for this package
9534 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009535}
9536
9537/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009538 * Logs settings provider values.
9539 *
9540 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9541 * then write the value to proto.
9542 *
9543 */
9544message SettingSnapshot {
9545
9546 // Setting key
9547 optional string name = 1;
9548
9549 enum SettingsValueType {
9550 NOTASSIGNED = 0;
9551 ASSIGNED_BOOL_TYPE = 1;
9552 ASSIGNED_INT_TYPE = 2;
9553 ASSIGNED_FLOAT_TYPE = 3;
9554 ASSIGNED_STRING_TYPE = 4;
9555 };
9556 // Setting value type
9557 optional SettingsValueType type = 2;
9558
9559 optional bool bool_value = 3;
9560
9561 optional int32 int_value = 4;
9562
9563 optional float float_value = 5;
9564
9565 optional string str_value = 6;
9566
9567 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9568 optional int32 user_id = 7;
9569}
Varun Shahacb56342019-12-18 11:45:38 -08009570
9571/**
9572 * An event logged to indicate that a user journey is about to be performed. This atom includes
9573 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9574 * will immediately follow this atom which will describe the event(s) and its state.
9575 *
9576 * Logged from:
9577 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9578 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9579 */
9580message UserLifecycleJourneyReported {
9581 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9582 // UserLifecycleEventOccurred atom)
9583 optional int64 session_id = 1;
9584
9585 // Indicates what type of user journey this session is related to
9586 enum Journey {
9587 UNKNOWN = 0; // Undefined user lifecycle journey
9588 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9589 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9590 USER_START = 3; // A user start journey
9591 USER_CREATE = 4; // A user creation journey
9592 }
9593 optional Journey journey = 2;
9594 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9595 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9596 optional int32 origin_user = 3;
9597 // Which user the journey is targeting
9598 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9599 optional int32 target_user = 4;
9600
9601 // What is the user type of the target user
9602 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9603 enum UserType {
9604 TYPE_UNKNOWN = 0;
9605 FULL_SYSTEM = 1;
9606 FULL_SECONDARY = 2;
9607 FULL_GUEST = 3;
9608 FULL_DEMO = 4;
9609 FULL_RESTRICTED = 5;
9610 PROFILE_MANAGED = 6;
9611 SYSTEM_HEADLESS = 7;
9612 }
9613 optional UserType user_type = 5;
9614 // What are the flags attached to the target user
9615 optional int32 user_flags = 6;
9616}
9617
9618/**
9619 * An event logged when a specific user lifecycle event is performed. These events should be
9620 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9621 * Note: journeys can span over multiple events, hence some events may share a single session id.
9622 *
9623 * Logged from:
9624 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9625 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9626 */
9627message UserLifecycleEventOccurred {
9628 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9629 optional int64 session_id = 1;
9630 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9631 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9632 optional int32 user_id = 2;
9633
9634 enum Event {
9635 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9636 SWITCH_USER = 1; // Indicates that this is a user switch event
9637 START_USER = 2; // Indicates that this is a user start event
9638 CREATE_USER = 3; // Indicates that this is a user create event
9639 }
9640 optional Event event = 3;
9641
9642 enum State {
9643 NONE = 0; // Indicates the associated event has no start/end defined
9644 BEGIN = 1;
9645 FINISH = 2;
9646 }
9647 optional State state = 4; // Represents the state of an event (beginning/ending)
9648}
jasonwshsu81173e32020-03-27 15:22:03 +08009649
9650/**
9651 * Logs when accessibility shortcut clicked.
9652 *
9653 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009654 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009655 */
9656message AccessibilityShortcutReported {
9657 // The accessibility feature(including installed a11y service, framework a11y feature,
9658 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9659 optional string package_name = 1;
9660
9661 // The definition of the accessibility shortcut.
9662 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9663 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9664
9665 // The definition of the service status.
9666 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9667 optional android.stats.accessibility.ServiceStatus service_status = 3;
9668}
9669
9670/**
9671 * Logs when accessibility service status changed.
9672 *
9673 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009674 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009675 */
9676message AccessibilityServiceReported {
9677 // The accessibility service package name.
9678 optional string package_name = 1;
9679
9680 // The definition of the service status.
9681 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9682 optional android.stats.accessibility.ServiceStatus service_status = 2;
9683}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009684
Denny cy Lee57b31282020-04-17 10:08:52 +08009685message DisplayWakeReason {
9686 // Wake_up_reason code
9687 // If LOWORD(wake_up_reason) = 0
9688 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9689 // else reference wake_up_reason to
9690 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9691 optional int32 wake_up_reason = 1;
9692 // Count of wake up by reason
9693 optional int32 wake_times = 2;
9694}
9695
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009696/**
9697 * Logs app usage events.
9698 */
9699message AppUsageEventOccurred {
9700 optional int32 uid = 1 [(is_uid) = true];
9701 optional string package_name = 2;
9702 optional string class_name = 3;
9703
9704 enum EventType {
9705 NONE = 0;
9706 MOVE_TO_FOREGROUND = 1;
9707 MOVE_TO_BACKGROUND = 2;
9708 }
9709 optional EventType event_type = 4;
9710}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009711
9712/*
9713 * Quality metrics logged when EVS cameras are active.
9714 *
9715 * Logged from:
9716 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9717 */
9718message EvsUsageStatsReported {
9719
9720 // Camera identifier to distinguish the source camera device. This is not
9721 // globally unique and therefore cannot be used to identify the user and/or
9722 // the device.
9723 optional int32 device_id = 1;
9724
9725 // Peak number of clients during the service
9726 optional int32 peak_num_clients = 2;
9727
9728 // Number of erroneous events during the service
9729 optional int32 num_errors = 3;
9730
9731 // Round trip latency of the very first frame
9732 optional int64 first_latency_millis = 4;
9733
9734 // Average frame round trip latency
9735 optional float avg_latency_millis = 5;
9736
9737 // Peak frame round trip latency
9738 optional int64 peak_latency_millis = 6;
9739
9740 // Total number of frames received
9741 optional int64 total_frames = 7;
9742
9743 // Number of frames ignored
9744 optional int64 ignored_frames = 8;
9745
9746 // Number of dropped frames to synchronize camera devices
9747 optional int64 dropped_frames_to_sync = 9;
9748
9749 // The duration of the service
9750 optional int64 duration_millis = 10;
9751}
Robert Leecccdc152020-04-23 13:22:46 +08009752
9753/**
9754 * Logs audio power usage stats.
9755 *
9756 * Pushed from:
9757 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9758 */
9759message AudioPowerUsageDataReported {
9760 /**
9761 * Device used for input/output
9762 *
9763 * All audio devices please refer to below file:
9764 * system/media/audio/include/system/audio-base.h
9765 *
9766 * Define our own enum values because we don't report all audio devices.
9767 * Currently, we only report built-in audio devices such as handset, speaker,
9768 * built-in mics, common audio devices such as wired headset, usb headset
9769 * and bluetooth devices.
9770 */
9771 enum AudioDevice {
9772 OUTPUT_EARPIECE = 0x1; // handset
9773 OUTPUT_SPEAKER = 0x2; // dual speaker
9774 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9775 OUTPUT_USB_HEADSET = 0x8; // usb headset
9776 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9777 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9778 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9779
9780 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9781 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9782 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9783 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9784 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9785 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9786 }
9787 optional AudioDevice audio_device = 1;
9788
9789 // Duration of the audio in seconds
9790 optional int32 duration_secs = 2;
9791
9792 // Average volume (0 ... 1.0)
9793 optional float average_volume = 3;
9794
9795 enum AudioType {
9796 UNKNOWN_TYPE = 0;
9797 VOICE_CALL_TYPE = 1; // voice call
9798 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9799 MEDIA_TYPE = 3; // music and system sound
9800 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9801 ALARM_TYPE = 5; // alarm type
9802 // record type
9803 CAMCORDER_TYPE = 6; // camcorder
9804 RECORD_TYPE = 7; // other recording
9805 }
9806 optional AudioType type = 4;
9807}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009808
9809/**
9810 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9811 *
9812 * Pulled from:
9813 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9814 */
9815message BytesTransferByTagAndMetered {
9816 optional int32 uid = 1 [(is_uid) = true];
9817
9818 optional bool is_metered = 2;
9819
9820 optional int32 tag = 3;
9821
9822 optional int64 rx_bytes = 4;
9823
9824 optional int64 rx_packets = 5;
9825
9826 optional int64 tx_bytes = 6;
9827
9828 optional int64 tx_packets = 7;
9829}