blob: 9d8fa5f87246a44b1d0dc1cddbdbb9bd3f876da2 [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"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000430 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700431
432 // StatsdStats tracks platform atoms with ids upto 500.
433 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000434 }
David Chenc8a43242017-10-17 16:23:28 -0700435
David Chen6e3e6cb2018-01-03 16:14:06 -0800436 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700437 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700438 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
440 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700441 MobileBytesTransfer mobile_bytes_transfer =
442 10002 [(module) = "framework", (truncate_timestamp) = true];
443 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
444 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800445 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
446 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700447 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800450 CpuTimePerUidFreq cpu_time_per_uid_freq =
451 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
453 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
454 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
455 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
456 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700457 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700458 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700459 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
460 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800461 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
462 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700463 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800464 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800466 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 DiskStats disk_stats = 10025 [(module) = "framework"];
468 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
469 AppSize app_size = 10027 [(module) = "framework"];
470 CategorySize category_size = 10028 [(module) = "framework"];
471 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800472 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
474 DiskIo disk_io = 10032 [(module) = "framework"];
475 PowerProfile power_profile = 10033 [(module) = "framework"];
476 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
477 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
478 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700479 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
481 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
482 10040 [(module) = "framework"];
483 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
484 10041 [(module) = "framework"];
485 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800486 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800488 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
490 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
491 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
492 RoleHolder role_holder = 10049 [(module) = "framework"];
493 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800494 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
496 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800497 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
498 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800499 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
500 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
501 FaceSettings face_settings = 10058 [(module) = "framework"];
502 CoolingDevice cooling_device = 10059 [(module) = "framework"];
503 AppOps app_ops = 10060 [(module) = "framework"];
504 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700505 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
506 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800508 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
510 DangerousPermissionStateSampled dangerous_permission_state_sampled =
511 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400512 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000513 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000514 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200515 PackageNotificationPreferences package_notification_preferences =
516 10071 [(module) = "framework"];
517 PackageNotificationChannelPreferences package_notification_channel_preferences =
518 10072 [(module) = "framework"];
519 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
520 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800521 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800522 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700523 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
524 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
525 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
526 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800527 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700528 }
yroa1fe77c2018-02-26 14:22:54 -0800529
Bookatz76aafcf2018-09-17 16:17:10 -0700530 // DO NOT USE field numbers above 100,000 in AOSP.
531 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
532 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100533
534 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700535}
536
Yao Chend54f9dd2017-10-17 17:37:48 +0000537/**
Yangster-mac20877162017-12-22 17:19:39 -0800538 * This proto represents a node of an attribution chain.
539 * Note: All attribution chains are represented as a repeated field of type
540 * AttributionNode. It is understood that in such arrays, the order is that
541 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 */
Yangster-mac20877162017-12-22 17:19:39 -0800543message AttributionNode {
544 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800545 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800546
Yangster-mac20877162017-12-22 17:19:39 -0800547 // The (optional) string tag for an element in the attribution chain. If the
548 // element has no tag, it is encoded as an empty string.
549 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700550}
551
Yangster-mac48b3d622018-08-18 12:38:11 -0700552message KeyValuePair {
553 optional int32 key = 1;
554 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700555 int32 value_int = 2;
556 int64 value_long = 3;
557 string value_str = 4;
558 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700559 }
560}
561
562message KeyValuePairsAtom {
563 optional int32 uid = 1;
564 repeated KeyValuePair pairs = 2;
565}
566
Yao Chend54f9dd2017-10-17 17:37:48 +0000567/*
568 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800569 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000570 *
571 * RULES:
572 * - The field ids for each atom must start at 1, and count upwards by 1.
573 * Skipping field ids is not allowed.
574 * - These form an API, so renaming, renumbering or removing fields is
575 * not allowed between android releases. (This is not currently enforced,
576 * but there will be a tool to enforce this restriction).
577 * - The types must be built-in protocol buffer types, namely, no sub-messages
578 * are allowed (yet). The bytes type is also not allowed.
579 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800580 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000581 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800582 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 * - A field that is a uid should be a string field, tagged with the [xxx]
584 * annotation. The generated code on android will be represented by UIDs,
585 * and those UIDs will be translated in xxx to those strings.
586 *
587 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700588 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000589 * - If there is a UID, it goes first. Think in an object-oriented fashion.
590 * *****************************************************************************
591 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700592
Yao Chend54f9dd2017-10-17 17:37:48 +0000593/**
Tej Singha72344992019-04-17 18:55:08 -0700594 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700595 * Logs when the Thermal service HAL notifies the throttling start/stop events.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
599 */
600message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700601 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700602 optional android.os.TemperatureTypeEnum sensor_type = 1;
603
Maggie White442b6312019-04-05 16:26:44 -0700604 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700605 enum State {
606 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700607 START = 1; // START indicated that throttling was triggered.
608 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700609 }
Yangster-mace16189a2018-08-26 12:20:16 -0700610 optional State state = 2;
611
612 optional float temperature = 3;
613}
614
615/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 * Logs when the screen state changes.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
620 */
621message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800622 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800623 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700624 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700625}
Yao Chend54f9dd2017-10-17 17:37:48 +0000626
627/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700628 * Logs that the process state of the uid, as determined by ActivityManager
629 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
633 */
Bookatzc1a050a2017-10-10 15:49:28 -0700634message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700635 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000636
Bookatzdb026a22018-01-10 19:01:56 -0800637 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800638 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700639 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000640}
641
642/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700643 * Logs process state change of a process, as per the activity manager.
644 *
645 * Logged from:
646 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
647 */
648message ProcessStateChanged {
649 optional int32 uid = 1;
650 optional string process_name = 2;
651 optional string package_name = 3;
652 // TODO: remove this when validation is done
653 optional int64 version = 5;
654 // The state, from frameworks/base/core/proto/android/app/enums.proto.
655 optional android.app.ProcessStateEnum state = 4;
656}
657
658/**
659 * Logs when ActivityManagerService sleep state is changed.
660 *
661 * Logged from:
662 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
663 */
664message ActivityManagerSleepStateChanged {
665 // TODO: import frameworks proto
666 enum State {
667 UNKNOWN = 0;
668 ASLEEP = 1;
669 AWAKE = 2;
670 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700671 optional State state = 1
672 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700673}
674
675/**
676 * Logs when system memory state changes.
677 *
678 * Logged from:
679 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
680 */
681message MemoryFactorStateChanged {
682 // TODO: import frameworks proto
683 enum State {
684 MEMORY_UNKNOWN = 0;
685 NORMAL = 1; // normal.
686 MODERATE = 2; // moderate memory pressure.
687 LOW = 3; // low memory.
688 CRITICAL = 4; // critical memory.
689
690 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700691 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700692}
693
694/**
695 * Logs when app is using too much cpu, according to ActivityManagerService.
696 *
697 * Logged from:
698 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
699 */
700message ExcessiveCpuUsageReported {
701 optional int32 uid = 1;
702 optional string process_name = 2;
703 optional string package_name = 3;
704 // package version. TODO: remove this when validation is done
705 optional int64 version = 4;
706}
707
708/**
709 * Logs when a cached process is killed, along with its pss.
710 *
711 * Logged from:
712 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
713 */
714message CachedKillReported {
715 optional int32 uid = 1;
716 optional string process_name = 2;
717 optional string package_name = 3;
718 // TODO: remove this when validation is done
719 optional int64 version = 5;
720 optional int64 pss = 4;
721}
722
723/**
xshu2c3d9e42019-09-26 17:54:02 -0700724 * Logs the change in wifi health.
725 *
726 * Logged from:
727 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
728 */
729message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800730 enum Band {
731 UNKNOWN = 0;
732 // All of 2.4GHz band
733 BAND_2G = 1;
734 // Frequencies in the range of [5150, 5250) GHz
735 BAND_5G_LOW = 2;
736 // Frequencies in the range of [5250, 5725) GHz
737 BAND_5G_MIDDLE = 3;
738 // Frequencies in the range of [5725, 5850) GHz
739 BAND_5G_HIGH = 4;
740 // Frequencies in the range of [5925, 6425) GHz
741 BAND_6G_LOW = 5;
742 // Frequencies in the range of [6425, 6875) GHz
743 BAND_6G_MIDDLE = 6;
744 // Frequencies in the range of [6875, 7125) GHz
745 BAND_6G_HIGH = 7;
746 }
xshu2c3d9e42019-09-26 17:54:02 -0700747 // duration this stat is obtained over in milliseconds
748 optional int32 duration_millis = 1;
749 // whether wifi is classified as sufficient for the user's data traffic, determined
750 // by whether the calculated throughput exceeds the average demand within |duration_millis|
751 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700752 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800753 optional bool is_cell_data_available = 3;
754 // the Band bucket the connected network is on
755 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700756}
757
758/**
759 * Logged when wifi detects a significant change in connection failure rate.
760 *
761 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
762 *
763 */
764message WifiFailureStatReported {
765 enum AbnormalityType {
766 UNKNOWN = 0;
767 SIGNIFICANT_INCREASE = 1;
768 SIGNIFICANT_DECREASE = 2;
769 SIMPLY_HIGH = 3;
770 }
771 enum FailureType {
772 FAILURE_UNKNOWN = 0;
773 FAILURE_CONNECTION = 1;
774 FAILURE_ASSOCIATION_REJECTION = 2;
775 FAILURE_ASSOCIATION_TIMEOUT = 3;
776 FAILURE_AUTHENTICATION = 4;
777 FAILURE_NON_LOCAL_DISCONNECTION = 5;
778 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
779 }
780 // Reason for uploading this stat
781 optional AbnormalityType abnormality_type = 1;
782 // The particular type of failure
783 optional FailureType failure_type = 2;
784 // How many times we have encountered this combination of AbnormalityType and FailureType
785 optional int32 failure_count = 3;
786}
787
788/**
789 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
790 *
791 * Logged from:
792 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
793 */
794message WifiConnectionResultReported {
795 enum FailureCode {
796 FAILURE_UNKNOWN = 0;
797 FAILURE_ASSOCIATION_TIMEOUT = 1;
798 FAILURE_ASSOCIATION_REJECTION = 2;
799 FAILURE_AUTHENTICATION_GENERAL = 3;
800 FAILURE_AUTHENTICATION_EAP = 4;
801 FAILURE_DHCP = 5;
802 FAILURE_NETWORK_DISCONNECTION = 6;
803 FAILURE_ROAM_TIMEOUT = 7;
804 }
805 // true represents a successful connection
806 optional bool connection_result = 1;
807 // reason for the connection failure
808 optional FailureCode failure_code = 2;
809 // scan rssi before the connection attempt
810 optional int32 rssi = 3;
811}
812
813/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700814 * Logs when memory stats of a process is reported.
815 *
816 * Logged from:
817 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
818 */
819message ProcessMemoryStatReported {
820 optional int32 uid = 1;
821 optional string process_name = 2;
822 optional string package_name = 3;
823 //TODO: remove this when validation is done
824 optional int64 version = 9;
825 optional int64 pss = 4;
826 optional int64 uss = 5;
827 optional int64 rss = 6;
828 enum Type {
829 ADD_PSS_INTERNAL_SINGLE = 0;
830 ADD_PSS_INTERNAL_ALL_MEM = 1;
831 ADD_PSS_INTERNAL_ALL_POLL = 2;
832 ADD_PSS_EXTERNAL = 3;
833 ADD_PSS_EXTERNAL_SLOW = 4;
834 }
835 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800836 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700837}
838
839/**
Bookatzc1a050a2017-10-10 15:49:28 -0700840 * Logs that a process started, finished, crashed, or ANRed.
841 *
842 * Logged from:
843 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
844 */
845message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700846 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700847
David Chen0b5c90c2018-01-25 16:51:49 -0800848 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800849 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700850
Bookatzddccf0a2017-11-28 16:48:14 -0800851 // What lifecycle state the process changed to.
852 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853 enum State {
854 FINISHED = 0;
855 STARTED = 1;
856 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800857 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800858 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700859}
860
Bookatzc1a050a2017-10-10 15:49:28 -0700861/**
862 * Logs when the ble scan state changes.
863 *
864 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700865 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700866 */
867message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800868 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700869 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700870
871 enum State {
872 OFF = 0;
873 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700874 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
875 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700876 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800877 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700878 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800879 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700880 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800881 (state_field_option).nested = true
882 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700883
Bookatze5ec0b42018-03-26 13:34:56 -0700884 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700885 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700886 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700887 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700888 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700889 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700890}
891
892/**
893 * Logs reporting of a ble scan finding results.
894 *
895 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700896 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700897 */
Bookatzae6738e2018-09-13 11:38:56 -0700898// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700899message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800900 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700901
902 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800903 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700904}
905
906/**
907 * Logs when a sensor state changes.
908 *
909 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700910 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700911 */
912message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
Bookatzc1a050a2017-10-10 15:49:28 -0700915 // The id (int) of the sensor.
916 optional int32 sensor_id = 2;
917
918 enum State {
919 OFF = 0;
920 ON = 1;
921 }
922 optional State state = 3;
923}
924
Bookatzc1a050a2017-10-10 15:49:28 -0700925/**
926 * Logs when GPS state changes.
927 *
928 * Logged from:
929 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
930 */
931message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800932 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700933
934 enum State {
935 OFF = 0;
936 ON = 1;
937 }
938 optional State state = 2;
939}
940
Bookatz48d362e2018-11-06 15:49:08 -0800941/**
942 * Logs when GPS signal quality.
943 *
944 * Logged from:
945 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
946 */
947message GpsSignalQualityChanged {
948 optional android.server.location.GpsSignalQualityEnum level = 1;
949}
950
Bookatzc1a050a2017-10-10 15:49:28 -0700951
952/**
953 * Logs when a sync manager sync state changes.
954 *
955 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700956 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700957 */
958message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800959 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700960
David Chen0b5c90c2018-01-25 16:51:49 -0800961 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800962 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700963
964 enum State {
965 OFF = 0;
966 ON = 1;
967 }
968 optional State state = 3;
969}
970
Yangster-mac96353002018-09-05 11:18:55 -0700971/*
972 * Deferred job stats.
973 *
974 * Logged from:
975 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
976*/
977message DeferredJobStatsReported {
978 repeated AttributionNode attribution_node = 1;
979
980 // Number of jobs deferred.
981 optional int32 num_jobs_deferred = 2;
982
983 // Time since the last job runs.
984 optional int64 time_since_last_job_millis = 3;
985}
986
Bookatzc1a050a2017-10-10 15:49:28 -0700987/**
988 * Logs when a job scheduler job state changes.
989 *
990 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700991 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700992 */
993message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800994 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700995
996 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800997 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700998
999 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001000 FINISHED = 0;
1001 STARTED = 1;
1002 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001003 }
1004 optional State state = 3;
1005
Tej Singh33a412b2018-03-16 18:43:59 -07001006 // The reason a job has stopped.
1007 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001008 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001009 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001010
1011 // The standby bucket of the app that scheduled the job. These match the framework constants
1012 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1013 // already assigned 0.
1014 enum Bucket {
1015 UNKNOWN = -1;
1016 ACTIVE = 0;
1017 WORKING_SET = 1;
1018 FREQUENT = 2;
1019 RARE = 3;
1020 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001021 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001022 }
1023 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1024
1025 // The job id (as assigned by the app).
1026 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001027
1028 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1029 // constraints as they are always assumed to be set.
1030 optional bool has_charging_constraint = 7;
1031 optional bool has_battery_not_low_constraint = 8;
1032 optional bool has_storage_not_low_constraint = 9;
1033 optional bool has_timing_delay_constraint = 10;
1034 optional bool has_deadline_constraint = 11;
1035 optional bool has_idle_constraint = 12;
1036 optional bool has_connectivity_constraint = 13;
1037 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001038}
1039
1040/**
1041 * Logs when the audio state changes.
1042 *
1043 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001044 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001045 */
1046message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001048
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001052 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1053 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001054 }
1055 optional State state = 2;
1056}
1057
1058/**
1059 * Logs when the video codec state changes.
1060 *
1061 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001062 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001063 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001064message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001065 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001066
1067 enum State {
1068 OFF = 0;
1069 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001070 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1071 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001072 }
1073 optional State state = 2;
1074}
1075
1076/**
1077 * Logs when the flashlight state changes.
1078 *
1079 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001080 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001081 */
1082message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001083 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001084
1085 enum State {
1086 OFF = 0;
1087 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001088 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1089 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001090 }
1091 optional State state = 2;
1092}
1093
1094/**
1095 * Logs when the camera state changes.
1096 *
1097 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001098 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001099 */
1100message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001101 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001102
1103 enum State {
1104 OFF = 0;
1105 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001106 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1107 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001108 }
1109 optional State state = 2;
1110}
1111
1112/**
1113 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001114 *
1115 * Logged from:
1116 * TODO
1117 */
Bookatzd6746242017-10-24 18:39:35 -07001118message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001119 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001120 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001121
Bookatz1a1b0462018-01-12 11:47:03 -08001122 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1123 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001124 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001125
1126 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001127 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001128
1129 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001130 RELEASE = 0;
1131 ACQUIRE = 1;
1132 CHANGE_RELEASE = 2;
1133 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001134 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001135 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001136 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001137 (state_field_option).default_state_value = 0,
1138 (state_field_option).nested = true
1139 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001140}
1141
1142/**
Bookatzc1a050a2017-10-10 15:49:28 -07001143 * Logs when a partial wakelock is considered 'long' (over 1 min).
1144 *
1145 * Logged from:
1146 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1147 */
1148message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001149 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001150
Yao Chend54f9dd2017-10-17 17:37:48 +00001151 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1152 optional string tag = 2;
1153
Bookatzc1a050a2017-10-10 15:49:28 -07001154 // TODO: I have no idea what this is.
1155 optional string history_tag = 3;
1156
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001162}
1163
Bookatzc1a050a2017-10-10 15:49:28 -07001164/**
Bookatza66083f2018-09-20 17:24:00 -07001165 * Logs when the device is interactive, according to the PowerManager Notifier.
1166 *
1167 * Logged from:
1168 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1169 */
1170message InteractiveStateChanged {
1171 enum State {
1172 OFF = 0;
1173 ON = 1;
1174 }
1175 optional State state = 1;
1176}
1177
1178/**
Bookatzc1a050a2017-10-10 15:49:28 -07001179 * Logs Battery Saver state change.
1180 *
1181 * Logged from:
1182 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1183 */
1184message BatterySaverModeStateChanged {
1185 enum State {
1186 OFF = 0;
1187 ON = 1;
1188 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001189 optional State state = 1
1190 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001191}
1192
1193/**
1194 * Logs Doze mode state change.
1195 *
1196 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001197 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001198 */
1199message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001200 optional android.server.DeviceIdleModeEnum state = 1
1201 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001202}
1203
1204
1205/**
1206 * Logs state change of Doze mode including maintenance windows.
1207 *
1208 * Logged from:
1209 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1210 */
1211message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001212 optional android.server.DeviceIdleModeEnum state = 1
1213 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001214}
1215
1216/**
1217 * Logs screen brightness level.
1218 *
1219 * Logged from:
1220 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1221 */
1222message ScreenBrightnessChanged {
1223 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1224 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001225}
1226
1227/**
1228 * Logs battery level (percent full, from 0 to 100).
1229 *
1230 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001231 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001232 */
1233message BatteryLevelChanged {
1234 // Battery level. Should be in [0, 100].
1235 optional int32 battery_level = 1;
1236}
1237
1238/**
1239 * Logs change in charging status of the device.
1240 *
1241 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001242 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001243 */
1244message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001245 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1246 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001247}
1248
1249/**
1250 * Logs whether the device is plugged in, and what power source it is using.
1251 *
1252 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001253 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001254 */
1255message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001256 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001257 optional android.os.BatteryPluggedStateEnum state = 1
1258 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001259}
1260
Bookatz8c6571b2017-10-24 15:04:41 -07001261/**
1262 * Logs when an app's wakeup alarm fires.
1263 *
1264 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001265 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001266 */
1267message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001268 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001269
1270 // Name of the wakeup alarm.
1271 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001272
1273 // Name of source package (for historical reasons, since BatteryStats tracked it).
1274 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001275
Ben Murdoch3389f1522019-05-21 15:05:34 +01001276 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001277 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001278}
1279
1280/**
1281 * Logs when an an app causes the mobile radio to change state.
1282 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1283 *
1284 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001285 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001286 */
1287message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001288 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001289
Bookatz1a1b0462018-01-12 11:47:03 -08001290 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1291 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001292}
1293
1294/**
1295 * Logs when an an app causes the wifi radio to change state.
1296 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1297 *
1298 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001299 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001300 */
1301message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001302 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001303
Bookatz1a1b0462018-01-12 11:47:03 -08001304 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1305 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001306}
1307
1308/**
1309 * Logs kernel wakeup reasons and aborts.
1310 *
1311 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001312 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001313 */
1314message KernelWakeupReported {
1315 // Name of the kernel wakeup reason (or abort).
1316 optional string wakeup_reason_name = 1;
1317
1318 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001319 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001320}
1321
1322/**
Bookatzda1798c2018-12-13 14:16:00 -08001323 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001324 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001325 *
1326 * Logged from:
1327 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1328 */
1329message WifiEnabledStateChanged {
1330 enum State {
1331 OFF = 0;
1332 ON = 1;
1333 }
1334 optional State state = 1;
1335}
1336
1337/**
tsaichristinececebdc2020-02-04 14:05:56 -08001338 * This atom is deprecated starting in R.
1339 *
Bookatzda1798c2018-12-13 14:16:00 -08001340 * 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 -08001341 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1342 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001343 *
1344 * Logged from:
1345 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1346 */
1347message WifiRunningStateChanged {
1348 repeated AttributionNode attribution_node = 1;
1349
1350 enum State {
1351 OFF = 0;
1352 ON = 1;
1353 }
1354 optional State state = 2;
1355}
1356
1357/**
Bookatze5885242017-10-24 20:10:31 -07001358 * Logs wifi locks held by an app.
1359 *
1360 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001361 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001362 */
1363message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001364 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001365
1366 enum State {
1367 OFF = 0;
1368 ON = 1;
1369 }
1370 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001371
1372 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1373 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001374}
1375
1376/**
1377 * Logs wifi signal strength changes.
1378 *
1379 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001380 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001381 */
1382message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001383 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1384 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001385}
1386
1387/**
1388 * Logs wifi scans performed by an app.
1389 *
1390 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001391 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001392 */
1393message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001394 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001395
1396 enum State {
1397 OFF = 0;
1398 ON = 1;
1399 }
1400 optional State state = 2;
1401}
1402
1403/**
Tej Singh4503e102018-01-04 14:35:01 -08001404 * Logs wifi multicast locks held by an app
1405 *
1406 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001407 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001408 */
1409message WifiMulticastLockStateChanged {
1410 repeated AttributionNode attribution_node = 1;
1411
1412 enum State {
1413 OFF = 0;
1414 ON = 1;
1415 }
1416 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001417
1418 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001419}
1420
1421/**
Tej Singh1ea42892018-01-19 09:27:00 -08001422 * Logs shutdown reason and duration on next boot.
1423 *
1424 * Logged from:
1425 * frameworks/base/core/java/com/android/server/BootReceiver.java
1426 */
1427message ShutdownSequenceReported {
1428 // True if shutdown is for a reboot. Default: false if we do not know.
1429 optional bool reboot = 1;
1430
1431 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1432 optional string reason = 2;
1433
1434 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1435 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001436 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001437
1438 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001439 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001440}
1441
Tej Singh6483ea42018-01-25 17:45:49 -08001442
1443/**
1444 * Logs boot reason and duration.
1445 *
1446 * Logged from:
1447 * system/core/bootstat/bootstat.cpp
1448 */
1449message BootSequenceReported {
1450 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1451 // Default: "<EMPTY>" if not available.
1452 optional string bootloader_reason = 1;
1453
1454 // Reason for system boot. Eg. bootloader, reboot,userrequested
1455 // Default: "<EMPTY>" if not available.
1456 optional string system_reason = 2;
1457
1458 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001459 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001460
1461 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001462 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001463
1464 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001465 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001466
1467 // Time since last boot in ms. Default: 0 if not available.
1468 optional int64 time_since_last_boot = 6;
1469}
1470
Tej Singhc477d9c2018-02-05 18:31:39 -08001471
1472/**
1473 * Logs call state and disconnect cause (if applicable).
1474 *
1475 * Logged from:
1476 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1477 */
1478message CallStateChanged {
1479 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1480 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1481 optional android.telecom.CallStateEnum call_state = 1;
1482
1483 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1484 // This value is only applicable when the call_state is DISCONNECTED, and
1485 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1486 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1487 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1488
1489 // True if the call is self-managed, which are apps that use the
1490 // telecom infrastructure to make their own calls.
1491 optional bool self_managed = 3;
1492
1493 // True if call is external. External calls are calls on connected Wear
1494 // devices but show up in Telecom so the user can pull them onto the device.
1495 optional bool external_call = 4;
1496}
1497
Tej Singh1ea42892018-01-19 09:27:00 -08001498/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001499 * Logs keyguard state. The keyguard is the lock screen.
1500 *
1501 * Logged from:
1502 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1503 */
1504message KeyguardStateChanged {
1505 enum State {
1506 UNKNOWN = 0;
1507 // The keyguard is hidden when the phone is unlocked.
1508 HIDDEN = 1;
1509 // The keyguard is shown when the phone is locked (screen turns off).
1510 SHOWN= 2;
1511 // The keyguard is occluded when something is overlaying the keyguard.
1512 // Eg. Opening the camera while on the lock screen.
1513 OCCLUDED = 3;
1514 }
1515 optional State state = 1;
1516}
1517
1518/**
1519 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1520 * prompts the user to enter a password (pattern, pin, etc).
1521 *
1522 * Logged from:
1523 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1524 */
1525
1526message KeyguardBouncerStateChanged {
1527 enum State {
1528 UNKNOWN = 0;
1529 // Bouncer is hidden, either as a result of successfully entering the
1530 // password, screen timing out, or user going back to lock screen.
1531 HIDDEN = 1;
1532 // This is when the user is being prompted to enter the password.
1533 SHOWN = 2;
1534 }
1535 optional State state = 1;
1536}
1537
1538/**
1539 * Logs the result of entering a password into the keyguard bouncer.
1540 *
1541 * Logged from:
1542 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1543 */
1544message KeyguardBouncerPasswordEntered {
1545 enum BouncerResult {
1546 UNKNOWN = 0;
1547 // The password entered was incorrect.
1548 FAILURE = 1;
1549 // The password entered was correct.
1550 SUCCESS = 2;
1551 }
1552 optional BouncerResult result = 1;
1553}
1554
Tej Singha883b372018-02-15 11:30:01 -08001555/*
1556 * Logs changes to the configuration of the device. The configuration is defined
1557 * in frameworks/base/core/java/android/content/res/Configuration.java
1558 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1559 * Please go there to interpret the possible values each field can be.
1560 *
1561 * Logged from:
1562 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1563 */
1564message ResourceConfigurationChanged {
1565 // Bit mask of color capabilities of the screen.
1566 // Contains information about the color gamut and hdr mode of the screen.
1567 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001568 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001569
1570 // The target screen density being rendered to.
1571 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001572 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001573
1574 // Current user preference for the scaling factor for fonts,
1575 // relative to the base density scaling.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001578
1579 // Flag indicating whether the hard keyboard is hidden.
1580 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001581 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001582
1583 // The type of keyboard attached to the device.
1584 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1585 optional int32 keyboard = 5;
1586
1587 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1588 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001589 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001590
1591 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1592 // 0 if undefined.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1594 optional int32 mcc = 7;
1595
1596 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1597 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1598 // MNC_ZERO symbol defined in Configuration.java.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1600 optional int32 mnc = 8;
1601
1602 // The kind of navigation available on the device.
1603 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1604 optional int32 navigation = 9;
1605
1606 // Flag indicating whether the navigation is available.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001608 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001609
1610 // Overall orientation of the screen.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1612 optional int32 orientation = 11;
1613
1614 // The current height of the available screen space, in dp units.
1615 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001616 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001617
1618 // Bit mask of overall layout of the screen.
1619 // Contains information about screen size, whether the screen is wider/taller
1620 // than normal, whether the screen layout is right-tl-left or left-to-right,
1621 // and whether the screen has a rounded shape.
1622 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001623 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001624
1625 // Current width of the available screen space, in dp units.
1626 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001627 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001628
1629 // The smallest screen size an application will see in normal operation.
1630 // This is the smallest value of both screenWidthDp and screenHeightDp
1631 // in portrait and landscape.
1632 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001633 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001634
1635 // The type of touch screen attached to the device.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1637 optional int32 touchscreen = 16;
1638
1639 // Bit mask of the ui mode.
1640 // Contains information about the overall ui mode of the device.
1641 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1642 // Also contains information about whether the device is in night mode.
1643 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001644 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001645}
1646
Tej Singheee317b2018-03-07 19:28:05 -08001647
1648/**
1649 * Logs changes in the connection state of the mobile radio.
1650 *
1651 * Logged from:
1652 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1653 */
1654message MobileConnectionStateChanged {
1655 // States are from the state machine DataConnection.java.
1656 enum State {
1657 UNKNOWN = 0;
1658 // The connection is inactive, or disconnected.
1659 INACTIVE = 1;
1660 // The connection is being activated, or connecting.
1661 ACTIVATING = 2;
1662 // The connection is active, or connected.
1663 ACTIVE = 3;
1664 // The connection is disconnecting.
1665 DISCONNECTING = 4;
1666 // The connection is disconnecting after creating a connection.
1667 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1668 }
1669 optional State state = 1;
1670 // For multi-sim phones, this distinguishes between the sim cards.
1671 optional int32 sim_slot_index = 2;
1672 // Used to identify the connection. Starts at 0 and increments by 1 for
1673 // every new network created. Resets whenever the device reboots.
1674 optional int32 data_connection_id = 3;
1675 // A bitmask for the capabilities of this connection.
1676 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1677 // Default value (if we have no information): 0
1678 optional int64 capabilities = 4;
1679 // If this connection has internet.
1680 // This just checks if the DEFAULT bit of capabilities is set.
1681 optional bool has_internet = 5;
1682}
1683
1684/**
1685 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1686 *
1687 * Logged from:
1688 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1689 */
1690message MobileRadioTechnologyChanged {
1691 optional android.telephony.NetworkTypeEnum state = 1;
1692 // For multi-sim phones, this distinguishes between the sim cards.
1693 optional int32 sim_slot_index = 2;
1694}
1695
Andrew Chantb56388b2018-03-22 21:07:33 -07001696/**
1697 * Logs the VID and PID of any connected USB devices.
1698 *
1699 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1700 *
1701 * Logged by Vendor.
1702 */
1703message UsbDeviceAttached {
1704 optional int32 vid = 1;
1705 optional int32 pid = 2;
1706 optional bool has_audio = 3;
1707 optional bool has_hid = 4;
1708 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001709 enum State {
1710 STATE_DISCONNECTED = 0;
1711 STATE_CONNECTED = 1;
1712 }
1713 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001714 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001715}
1716
Tej Singheee317b2018-03-07 19:28:05 -08001717
Tej Singhdd7bd352018-02-09 19:33:15 -08001718/**
Tej Singh5d991e12018-03-09 19:48:11 -08001719 * Logs when Bluetooth is enabled and disabled.
1720 *
1721 * Logged from:
1722 * services/core/java/com/android/server/BluetoothManagerService.java
1723 */
1724message BluetoothEnabledStateChanged {
1725 repeated AttributionNode attribution_node = 1;
1726 // Whether or not bluetooth is enabled on the device.
1727 enum State {
1728 UNKNOWN = 0;
1729 ENABLED = 1;
1730 DISABLED = 2;
1731 }
1732 optional State state = 2;
1733 // The reason for being enabled/disabled.
1734 // Eg. Airplane mode, crash, application request.
1735 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1736 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001737 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001738}
1739
1740/**
Jack Hed9837c82019-01-09 01:19:13 -08001741 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001742 *
1743 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001744 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1745 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001746 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001747 */
1748message BluetoothConnectionStateChanged {
1749 // The state of the connection.
1750 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1751 optional android.bluetooth.ConnectionStateEnum state = 1;
1752 // An identifier that can be used to match connect and disconnect events.
1753 // Currently is last two bytes of a hash of a device level ID and
1754 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001755 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001756 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001757 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1758 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001759 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001760 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001761 // An identifier that can be used to match events for this device.
1762 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1763 // Salt: Randomly generated 256 bit value
1764 // Hash algorithm: HMAC-SHA256
1765 // Size: 32 byte
1766 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001767 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001768 // An identifier that can be used to match events for this device.
1769 // The incremental identifier is locally generated and guaranteed not derived
1770 // from any globally unique hardware id.
1771 // For paired devices, it stays consistent between Bluetooth toggling for the
1772 // same remote device.
1773 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1774 // session for the same remote device.
1775 // Default: 0 if the device's metric id is unknown.
1776 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001777}
1778
1779/**
1780 * Logs when a Bluetooth device connects and disconnects over ACL
1781 *
1782 * Logged from:
1783 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1784 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001785 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001786 */
1787message BluetoothAclConnectionStateChanged {
1788 // An identifier that can be used to match events for this device.
1789 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1790 // Salt: Randomly generated 256 bit value
1791 // Hash algorithm: HMAC-SHA256
1792 // Size: 32 byte
1793 // Default: null or empty if the device identifier is not known
1794 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1795 // The state of the connection.
1796 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1797 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001798 // An identifier that can be used to match events for this device.
1799 // The incremental identifier is locally generated and guaranteed not derived
1800 // from any globally unique hardware id.
1801 // For paired devices, it stays consistent between Bluetooth toggling for the
1802 // same remote device.
1803 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1804 // session for the same remote device.
1805 // Default: 0 if the device's metric id is unknown.
1806 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001807}
1808
1809/**
1810 * Logs when a Bluetooth device connects and disconnects over SCO
1811 *
1812 * Logged from:
1813 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1814 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1815 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001816 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001817 */
1818message BluetoothScoConnectionStateChanged {
1819 // An identifier that can be used to match events for this device.
1820 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1821 // Salt: Randomly generated 256 bit value
1822 // Hash algorithm: HMAC-SHA256
1823 // Size: 32 byte
1824 // Default: null or empty if the device identifier is not known
1825 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1826 // The state of the connection.
1827 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1828 optional android.bluetooth.ConnectionStateEnum state = 2;
1829 // Codec used for this SCO connection
1830 // Default: UNKNOWN
1831 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001832 // An identifier that can be used to match events for this device.
1833 // The incremental identifier is locally generated and guaranteed not derived
1834 // from any globally unique hardware id.
1835 // For paired devices, it stays consistent between Bluetooth toggling for the
1836 // same remote device.
1837 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1838 // session for the same remote device.
1839 // Default: 0 if the device's metric id is unknown.
1840 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001841}
1842
Jack Hec27040a2019-01-09 20:54:41 -08001843/**
1844 * Logged when active device of a profile changes
1845 *
1846 * Logged from:
1847 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1848 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1849 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1850 */
1851message BluetoothActiveDeviceChanged {
1852 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1853 // From android.bluetooth.BluetoothProfile
1854 optional int32 bt_profile = 1;
1855 // An identifier that can be used to match events for this new active device.
1856 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1857 // Salt: Randomly generated 256 bit value
1858 // Hash algorithm: HMAC-SHA256
1859 // Size: 32 byte
1860 // Default: null or empty if there is no active device for this profile
1861 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001862 // An identifier that can be used to match events for this device.
1863 // The incremental identifier is locally generated and guaranteed not derived
1864 // from any globally unique hardware id.
1865 // For paired devices, it stays consistent between Bluetooth toggling for the
1866 // same remote device.
1867 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1868 // session for the same remote device.
1869 // Default: 0 if the device's metric id is unknown.
1870 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001871}
1872
Jack Heab86dbd22018-12-18 15:43:27 -08001873// Logs when there is an event affecting Bluetooth device's link layer connection.
1874// - This event is triggered when there is a related HCI command or event
1875// - Users of this metrics can deduce Bluetooth device's connection state from these events
1876// - HCI commands are logged before the command is sent, after receiving command status, and after
1877// receiving command complete
1878// - HCI events are logged when they arrive
1879//
1880// Low level log from system/bt
1881//
1882// Bluetooth classic commands:
1883// - CMD_CREATE_CONNECTION
1884// - CMD_DISCONNECT
1885// - CMD_CREATE_CONNECTION_CANCEL
1886// - CMD_ACCEPT_CONNECTION_REQUEST
1887// - CMD_REJECT_CONNECTION_REQUEST
1888// - CMD_SETUP_ESCO_CONNECTION
1889// - CMD_ACCEPT_ESCO_CONNECTION
1890// - CMD_REJECT_ESCO_CONNECTION
1891// - CMD_ENH_SETUP_ESCO_CONNECTION
1892// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1893//
1894// Bluetooth low energy commands:
1895// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1896// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1897// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1898// - CMD_BLE_CLEAR_WHITE_LIST
1899// - CMD_BLE_ADD_WHITE_LIST
1900// - CMD_BLE_REMOVE_WHITE_LIST
1901//
1902// Bluetooth classic events:
1903// - EVT_CONNECTION_COMP
1904// - EVT_CONNECTION_REQUEST
1905// - EVT_DISCONNECTION_COMP
1906// - EVT_ESCO_CONNECTION_COMP
1907// - EVT_ESCO_CONNECTION_CHANGED
1908//
1909// Bluetooth low energy meta events:
1910// - BLE_EVT_CONN_COMPLETE_EVT
1911// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1912//
1913// Next tag: 10
1914message BluetoothLinkLayerConnectionEvent {
1915 // An identifier that can be used to match events for this device.
1916 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1917 // Salt: Randomly generated 256 bit value
1918 // Hash algorithm: HMAC-SHA256
1919 // Size: 32 byte
1920 // Default: null or empty if the device identifier is not known
1921 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1922 // Connection handle of this connection if available
1923 // Range: 0x0000 - 0x0EFF (12 bits)
1924 // Default: 0xFFFF if the handle is unknown
1925 optional int32 connection_handle = 2;
1926 // Direction of the link
1927 // Default: DIRECTION_UNKNOWN
1928 optional android.bluetooth.DirectionEnum direction = 3;
1929 // Type of this link
1930 // Default: LINK_TYPE_UNKNOWN
1931 optional android.bluetooth.LinkTypeEnum type = 4;
1932
1933 // Reason metadata for this link layer connection event, rules for interpretation:
1934 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1935 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1936 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1937 // set and valid, ignore hci_ble_event
1938
1939 // HCI command associated with this event
1940 // Default: CMD_UNKNOWN
1941 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1942 // HCI event associated with this event
1943 // Default: EVT_UNKNOWN
1944 optional android.bluetooth.hci.EventEnum hci_event = 6;
1945 // HCI BLE meta event associated with this event
1946 // Default: BLE_EVT_UNKNOWN
1947 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1948 // HCI command status code if this is triggerred by hci_cmd
1949 // Default: STATUS_UNKNOWN
1950 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1951 // HCI reason code associated with this event
1952 // Default: STATUS_UNKNOWN
1953 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001954 // An identifier that can be used to match events for this device.
1955 // The incremental identifier is locally generated and guaranteed not derived
1956 // from any globally unique hardware id.
1957 // For paired devices, it stays consistent between Bluetooth toggling for the
1958 // same remote device.
1959 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1960 // session for the same remote device.
1961 // Default: 0 if the device's metric id is unknown.
1962 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001963}
1964
Howard Roe103fe22019-01-17 16:52:16 -08001965/**
1966 * Logs when a module is rolled back by Watchdog.
1967 *
1968 * Logged from: Rollback Manager
1969 */
1970message WatchdogRollbackOccurred {
1971 enum RollbackType {
1972 UNKNOWN = 0;
1973 ROLLBACK_INITIATE = 1;
1974 ROLLBACK_SUCCESS = 2;
1975 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001976 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001977 }
1978 optional RollbackType rollback_type = 1;
1979
1980 optional string package_name = 2;
1981
1982 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001983
1984 enum RollbackReasonType {
1985 REASON_UNKNOWN = 0;
1986 REASON_NATIVE_CRASH = 1;
1987 REASON_EXPLICIT_HEALTH_CHECK = 2;
1988 REASON_APP_CRASH = 3;
1989 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001990 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001991 }
1992 optional RollbackReasonType rollback_reason = 4;
1993
1994 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1995 // is initiated. Empty if the package is unknown.
1996 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001997
1998 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001999}
2000
Jack Hec27040a2019-01-09 20:54:41 -08002001/**
2002 * Logs when there is a change in Bluetooth A2DP playback state
2003 *
2004 * Logged from:
2005 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2006 */
2007message BluetoothA2dpPlaybackStateChanged {
2008 // An identifier that can be used to match events for this device.
2009 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2010 // Salt: Randomly generated 256 bit value
2011 // Hash algorithm: HMAC-SHA256
2012 // Size: 32 byte
2013 // Default: null or empty if the device identifier is not known
2014 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2015 // Current playback state
2016 // Default: PLAYBACK_STATE_UNKNOWN
2017 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2018 // Current audio coding mode
2019 // Default: AUDIO_CODING_MODE_UNKNOWN
2020 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002021 // An identifier that can be used to match events for this device.
2022 // The incremental identifier is locally generated and guaranteed not derived
2023 // from any globally unique hardware id.
2024 // For paired devices, it stays consistent between Bluetooth toggling for the
2025 // same remote device.
2026 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2027 // session for the same remote device.
2028 // Default: 0 if the device's metric id is unknown.
2029 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002030}
2031
2032/**
2033 * Logs when there is a change in A2DP codec config for a particular remote device
2034 *
2035 * Logged from:
2036 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2037 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2038 */
2039message BluetoothA2dpCodecConfigChanged {
2040 // An identifier that can be used to match events for this device.
2041 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2042 // Salt: Randomly generated 256 bit value
2043 // Hash algorithm: HMAC-SHA256
2044 // Size: 32 byte
2045 // Default: null or empty if the device identifier is not known
2046 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2047 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2048 // Default SOURCE_CODEC_TYPE_INVALID
2049 optional int32 codec_type = 2;
2050 // Codec priroity, the higher the more preferred, -1 for disabled
2051 // Default: CODEC_PRIORITY_DEFAULT
2052 optional int32 codec_priority = 3;
2053 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2054 // Default: SAMPLE_RATE_NONE
2055 optional int32 sample_rate = 4;
2056 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2057 // Default: BITS_PER_SAMPLE_NONE
2058 optional int32 bits_per_sample = 5;
2059 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2060 // Default: CHANNEL_MODE_NONE
2061 optional int32 channel_mode = 6;
2062 // Codec specific values
2063 // Default 0
2064 optional int64 codec_specific_1 = 7;
2065 optional int64 codec_specific_2 = 8;
2066 optional int64 codec_specific_3 = 9;
2067 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002068 // An identifier that can be used to match events for this device.
2069 // The incremental identifier is locally generated and guaranteed not derived
2070 // from any globally unique hardware id.
2071 // For paired devices, it stays consistent between Bluetooth toggling for the
2072 // same remote device.
2073 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2074 // session for the same remote device.
2075 // Default: 0 if the device's metric id is unknown.
2076 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002077}
2078
2079/**
2080 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2081 * Each codec's capability is logged separately due to statsd restriction
2082 *
2083 * Logged from:
2084 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2085 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2086 */
2087message BluetoothA2dpCodecCapabilityChanged {
2088 // An identifier that can be used to match events for this device.
2089 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2090 // Salt: Randomly generated 256 bit value
2091 // Hash algorithm: HMAC-SHA256
2092 // Size: 32 byte
2093 // Default: null or empty if the device identifier is not known
2094 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2095 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2096 // Default SOURCE_CODEC_TYPE_INVALID
2097 optional int32 codec_type = 2;
2098 // Codec priroity, the higher the more preferred, -1 for disabled
2099 // Default: CODEC_PRIORITY_DEFAULT
2100 optional int32 codec_priority = 3;
2101 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2102 // in BluetoothCodecConfig
2103 // Default: empty and SAMPLE_RATE_NONE for individual item
2104 optional int32 sample_rate = 4;
2105 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2106 // in BluetoothCodecConfig
2107 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2108 optional int32 bits_per_sample = 5;
2109 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2110 // BluetoothCodecConfig
2111 // Default: empty and CHANNEL_MODE_NONE for individual item
2112 optional int32 channel_mode = 6;
2113 // Codec specific values
2114 // Default 0
2115 optional int64 codec_specific_1 = 7;
2116 optional int64 codec_specific_2 = 8;
2117 optional int64 codec_specific_3 = 9;
2118 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002119 // An identifier that can be used to match events for this device.
2120 // The incremental identifier is locally generated and guaranteed not derived
2121 // from any globally unique hardware id.
2122 // For paired devices, it stays consistent between Bluetooth toggling for the
2123 // same remote device.
2124 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2125 // session for the same remote device.
2126 // Default: 0 if the device's metric id is unknown.
2127 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002128}
2129
2130/**
2131 * Logs when A2DP failed to read from PCM source.
2132 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2133 *
2134 * Logged from:
2135 * system/bt
2136 */
2137message BluetoothA2dpAudioUnderrunReported {
2138 // An identifier that can be used to match events for this device.
2139 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2140 // Salt: Randomly generated 256 bit value
2141 // Hash algorithm: HMAC-SHA256
2142 // Size: 32 byte
2143 // Default: null or empty if the device identifier is not known
2144 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2145 // Encoding interval in nanoseconds
2146 // Default: 0
2147 optional int64 encoding_interval_nanos = 2;
2148 // Number of bytes of PCM data that could not be read from the source
2149 // Default: 0
2150 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002151 // An identifier that can be used to match events for this device.
2152 // The incremental identifier is locally generated and guaranteed not derived
2153 // from any globally unique hardware id.
2154 // For paired devices, it stays consistent between Bluetooth toggling for the
2155 // same remote device.
2156 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2157 // session for the same remote device.
2158 // Default: 0 if the device's metric id is unknown.
2159 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002160}
2161
2162/**
2163 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2164 * buffer queue is full and we have to drop data
2165 *
2166 * Logged from:
2167 * system/bt
2168 */
2169message BluetoothA2dpAudioOverrunReported {
2170 // An identifier that can be used to match events for this device.
2171 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2172 // Salt: Randomly generated 256 bit value
2173 // Hash algorithm: HMAC-SHA256
2174 // Size: 32 byte
2175 // Default: null or empty if the device identifier is not known
2176 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2177 // Encoding interval in nanoseconds
2178 // Default: 0
2179 optional int64 encoding_interval_nanos = 2;
2180 // Number of buffers dropped in this event
2181 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2182 // Default: 0
2183 optional int32 num_dropped_buffers = 3;
2184 // Number of encoded buffers dropped in this event
2185 // Default 0
2186 optional int32 num_dropped_encoded_frames = 4;
2187 // Number of encoded bytes dropped in this event
2188 // Default: 0
2189 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002190 // An identifier that can be used to match events for this device.
2191 // The incremental identifier is locally generated and guaranteed not derived
2192 // from any globally unique hardware id.
2193 // For paired devices, it stays consistent between Bluetooth toggling for the
2194 // same remote device.
2195 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2196 // session for the same remote device.
2197 // Default: 0 if the device's metric id is unknown.
2198 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002199}
2200
2201/**
2202 * Logs when we receive reports regarding a device's RSSI value
2203 *
2204 * Logged from:
2205 * system/bt
2206 */
2207message BluetoothDeviceRssiReported {
2208 // An identifier that can be used to match events for this device.
2209 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2210 // Salt: Randomly generated 256 bit value
2211 // Hash algorithm: HMAC-SHA256
2212 // Size: 32 byte
2213 // Default: null or empty if the device identifier is not known
2214 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2215 // Connection handle of this connection if available
2216 // Range: 0x0000 - 0x0EFF (12 bits)
2217 // Default: 0xFFFF if the handle is unknown
2218 optional int32 connection_handle = 2;
2219 // HCI command status code if this is triggerred by hci_cmd
2220 // Default: STATUS_UNKNOWN
2221 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2222 // BR/EDR
2223 // Range: -128 ≤ N ≤ 127 (signed integer)
2224 // Units: dB
2225 // LE:
2226 // Range: -127 to 20, 127 (signed integer)
2227 // Units: dBm
2228 // Invalid when an out of range value is reported
2229 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002230 // An identifier that can be used to match events for this device.
2231 // The incremental identifier is locally generated and guaranteed not derived
2232 // from any globally unique hardware id.
2233 // For paired devices, it stays consistent between Bluetooth toggling for the
2234 // same remote device.
2235 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2236 // session for the same remote device.
2237 // Default: 0 if the device's metric id is unknown.
2238 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002239}
2240
2241/**
2242 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2243 *
2244 * Logged from:
2245 * system/bt
2246 */
2247message BluetoothDeviceFailedContactCounterReported {
2248 // An identifier that can be used to match events for this device.
2249 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2250 // Salt: Randomly generated 256 bit value
2251 // Hash algorithm: HMAC-SHA256
2252 // Size: 32 byte
2253 // Default: null or empty if the device identifier is not known
2254 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2255 // Connection handle of this connection if available
2256 // Range: 0x0000 - 0x0EFF (12 bits)
2257 // Default: 0xFFFF if the handle is unknown
2258 optional int32 connection_handle = 2;
2259 // HCI command status code if this is triggerred by hci_cmd
2260 // Default: STATUS_UNKNOWN
2261 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2262 // Number of consecutive failed contacts for a connection corresponding to the Handle
2263 // Range: uint16_t, 0-0xFFFF
2264 // Default: 0xFFFFF
2265 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002266 // An identifier that can be used to match events for this device.
2267 // The incremental identifier is locally generated and guaranteed not derived
2268 // from any globally unique hardware id.
2269 // For paired devices, it stays consistent between Bluetooth toggling for the
2270 // same remote device.
2271 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2272 // session for the same remote device.
2273 // Default: 0 if the device's metric id is unknown.
2274 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002275}
2276
2277/**
2278 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2279 *
2280 * Logged from:
2281 * system/bt
2282 */
2283message BluetoothDeviceTxPowerLevelReported {
2284 // An identifier that can be used to match events for this device.
2285 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2286 // Salt: Randomly generated 256 bit value
2287 // Hash algorithm: HMAC-SHA256
2288 // Size: 32 byte
2289 // Default: null or empty if the device identifier is not known
2290 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2291 // Connection handle of this connection if available
2292 // Range: 0x0000 - 0x0EFF (12 bits)
2293 // Default: 0xFFFF if the handle is unknown
2294 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002295 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002296 // Default: STATUS_UNKNOWN
2297 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2298 // Range: -30 ≤ N ≤ 20
2299 // Units: dBm
2300 // Invalid when an out of range value is reported
2301 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002302 // An identifier that can be used to match events for this device.
2303 // The incremental identifier is locally generated and guaranteed not derived
2304 // from any globally unique hardware id.
2305 // For paired devices, it stays consistent between Bluetooth toggling for the
2306 // same remote device.
2307 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2308 // session for the same remote device.
2309 // Default: 0 if the device's metric id is unknown.
2310 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002311}
Jack Heab86dbd22018-12-18 15:43:27 -08002312
Tej Singh5d991e12018-03-09 19:48:11 -08002313/**
Jack He1021a612019-01-20 21:22:46 -08002314 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2315 * receiving an HCI command from the host
2316 *
2317 * Logged from: system/bt
2318 */
2319message BluetoothHciTimeoutReported {
2320 // HCI command associated with this event
2321 // Default: CMD_UNKNOWN
2322 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2323}
2324
2325/**
2326 * Logs when we receive Bluetooth Link Quality Report event from the controller
2327 * See Android Bluetooth HCI specification for more details
2328 *
2329 * Note: all count and bytes field are counted since last event
2330 *
2331 * Logged from: system/bt
2332 */
2333message BluetoothQualityReportReported {
2334 // Quality report ID
2335 // Original type: uint8_t
2336 // Default: BQR_ID_UNKNOWN
2337 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2338 // Packet type of the connection
2339 // Original type: uint8_t
2340 // Default: BQR_PACKET_TYPE_UNKNOWN
2341 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2342 // Connection handle of the connection
2343 // Original type: uint16_t
2344 optional int32 connection_handle = 3;
2345 // Performing Role for the connection
2346 // Original type: uint8_t
2347 optional int32 connection_role = 4;
2348 // Current Transmit Power Level for the connection. This value is the same as the controller's
2349 // response to the HCI_Read_Transmit_Power_Level HCI command
2350 // Original type: uint8_t
2351 optional int32 tx_power_level = 5;
2352 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2353 // absolute receiver signal strength value
2354 // Original type: int8_t
2355 optional int32 rssi = 6;
2356 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2357 // channels used by the link currently
2358 // Original type: uint8_t
2359 optional int32 snr = 7;
2360 // Indicates the number of unused channels in AFH_channel_map
2361 // Original type: uint8_t
2362 optional int32 unused_afh_channel_count = 8;
2363 // Indicates the number of the channels which are interfered and quality is bad but are still
2364 // selected for AFH
2365 // Original type: uint8_t
2366 optional int32 afh_select_unideal_channel_count = 9;
2367 // Current Link Supervision Timeout Setting
2368 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2369 // Original type: uint16_t
2370 optional int32 lsto = 10;
2371 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2372 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2373 // 0x01 (Piconet Clock)
2374 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2375 // Original type: uint32_t
2376 optional int64 connection_piconet_clock = 11;
2377 // The count of retransmission
2378 // Original type: uint32_t
2379 optional int64 retransmission_count = 12;
2380 // The count of no RX
2381 // Original type: uint32_t
2382 optional int64 no_rx_count = 13;
2383 // The count of NAK (Negative Acknowledge)
2384 // Original type: uint32_t
2385 optional int64 nak_count = 14;
2386 // Controller timestamp of last TX ACK
2387 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2388 // Original type: uint32_t
2389 optional int64 last_tx_ack_timestamp = 15;
2390 // The count of Flow-off (STOP)
2391 // Original type: uint32_t
2392 optional int64 flow_off_count = 16;
2393 // Controller timestamp of last Flow-on (GO)
2394 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2395 // Original type: uint32_t
2396 optional int64 last_flow_on_timestamp = 17;
2397 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2398 // Original type: uint32_t
2399 optional int64 buffer_overflow_bytes = 18;
2400 // Buffer underflow count (in byte) since last event
2401 // Original type: uint32_t
2402 optional int64 buffer_underflow_bytes = 19;
2403}
2404
2405/**
2406 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2407 *
2408 * Notes:
2409 * - Each event can be partially filled as we might learn different pieces of device
2410 * information at different time
2411 * - Multiple device info events can be combined to give more complete picture
2412 * - When multiple device info events tries to describe the same information, the
2413 * later one wins
2414 *
2415 * Logged from:
2416 * packages/apps/Bluetooth
2417 */
Jack Heaea26982019-04-04 11:19:48 -07002418message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002419 // An identifier that can be used to match events for this device.
2420 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2421 // Salt: Randomly generated 256 bit value
2422 // Hash algorithm: HMAC-SHA256
2423 // Size: 32 byte
2424 // Default: null or empty if the device identifier is not known
2425 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2426 // Where is this device info obtained from
2427 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2428 // Name of the data source
2429 // For EXTERNAL: package name of the data source
2430 // For INTERNAL: null for general case, component name otherwise
2431 optional string source_name = 3;
2432 // Name of the manufacturer of this device
2433 optional string manufacturer = 4;
2434 // Model of this device
2435 optional string model = 5;
2436 // Hardware version of this device
2437 optional string hardware_version = 6;
2438 // Software version of this device
2439 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002440 // An identifier that can be used to match events for this device.
2441 // The incremental identifier is locally generated and guaranteed not derived
2442 // from any globally unique hardware id.
2443 // For paired devices, it stays consistent between Bluetooth toggling for the
2444 // same remote device.
2445 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2446 // session for the same remote device.
2447 // Default: 0 if the device's metric id is unknown.
2448 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002449}
2450
2451/**
2452 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2453 * device, as documented by the Bluetooth Core HCI specification
2454 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2455 * Vol 2, Part E, Page 1118
2456 *
2457 * Logged from:
2458 * system/bt
2459 */
2460message BluetoothRemoteVersionInfoReported {
2461 // Connection handle of the connection
2462 // Original type: uint16_t
2463 optional int32 connection_handle = 1;
2464 // HCI command status code
2465 // Default: STATUS_UNKNOWN
2466 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2467 // 1 byte Version of current LMP in the remote controller
2468 optional int32 lmp_version = 3;
2469 // 2 bytes LMP manufacturer code of the remote controller
2470 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2471 optional int32 lmp_manufacturer_code = 4;
2472 // 4 bytes subversion of the LMP in the remote controller
2473 optional int32 lmp_subversion = 5;
2474}
2475
2476/**
2477 * Logs when certain Bluetooth SDP attributes are discovered
2478 * Constant definitions are from:
2479 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2480 *
2481 * Current logged attributes:
2482 * - BluetoothProfileDescriptorList
2483 * - Supported Features Bitmask
2484 *
2485 * Logged from:
2486 * system/bt
2487 */
2488message BluetoothSdpAttributeReported {
2489 // An identifier that can be used to match events for this device.
2490 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2491 // Salt: Randomly generated 256 bit value
2492 // Hash algorithm: HMAC-SHA256
2493 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2494 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2495 // Original type: uint16_t
2496 optional int32 protocol_uuid = 2;
2497 // Short form UUIDs used to identify Bluetooth SDP attribute types
2498 // Original type: uint16_t
2499 optional int32 attribute_id = 3;
2500 // Attribute value for the particular attribute
2501 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002502 // An identifier that can be used to match events for this device.
2503 // The incremental identifier is locally generated and guaranteed not derived
2504 // from any globally unique hardware id.
2505 // For paired devices, it stays consistent between Bluetooth toggling for the
2506 // same remote device.
2507 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2508 // session for the same remote device.
2509 // Default: 0 if the device's metric id is unknown.
2510 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002511}
2512
2513/**
2514 * Logs when bond state of a Bluetooth device changes
2515 *
2516 * Logged from:
2517 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2518 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2519 */
2520message BluetoothBondStateChanged {
2521 // An identifier that can be used to match events for this device.
2522 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2523 // Salt: Randomly generated 256 bit value
2524 // Hash algorithm: HMAC-SHA256
2525 // Size: 32 byte
2526 // Default: null or empty if the device identifier is not known
2527 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2528 // Preferred transport type to remote dual mode device
2529 // Default: TRANSPORT_AUTO means no preference
2530 optional android.bluetooth.TransportTypeEnum transport = 2;
2531 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2532 // Default: UNKNOWN
2533 optional android.bluetooth.DeviceTypeEnum type = 3;
2534 // Current bond state (NONE, BONDING, BONDED)
2535 // Default: BOND_STATE_UNKNOWN
2536 optional android.bluetooth.BondStateEnum bond_state = 4;
2537 // Bonding sub state
2538 // Default: BOND_SUB_STATE_UNKNOWN
2539 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2540 // Unbond Reason
2541 // Default: UNBOND_REASON_UNKNOWN
2542 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002543 // An identifier that can be used to match events for this device.
2544 // The incremental identifier is locally generated and guaranteed not derived
2545 // from any globally unique hardware id.
2546 // For paired devices, it stays consistent between Bluetooth toggling for the
2547 // same remote device.
2548 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2549 // session for the same remote device.
2550 // Default: 0 if the device's metric id is unknown.
2551 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002552}
2553
2554/**
2555 * Logs there is an event related Bluetooth classic pairing
2556 *
2557 * Logged from:
2558 * system/bt
2559 */
2560message BluetoothClassicPairingEventReported {
2561 // An identifier that can be used to match events for this device.
2562 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2563 // Salt: Randomly generated 256 bit value
2564 // Hash algorithm: HMAC-SHA256
2565 // Size: 32 byte
2566 // Default: null or empty if the device identifier is not known
2567 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2568 // Connection handle of this connection if available
2569 // Range: 0x0000 - 0x0EFF (12 bits)
2570 // Default: 0xFFFF if the handle is unknown
2571 optional int32 connection_handle = 2;
2572 // HCI command associated with this event
2573 // Default: CMD_UNKNOWN
2574 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2575 // HCI event associated with this event
2576 // Default: EVT_UNKNOWN
2577 optional android.bluetooth.hci.EventEnum hci_event = 4;
2578 // HCI command status code if this is triggerred by hci_cmd
2579 // Default: STATUS_UNKNOWN
2580 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2581 // HCI reason code associated with this event
2582 // Default: STATUS_UNKNOWN
2583 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002584 // A status value related to this specific event
2585 // Default: 0
2586 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002587 // An identifier that can be used to match events for this device.
2588 // The incremental identifier is locally generated and guaranteed not derived
2589 // from any globally unique hardware id.
2590 // For paired devices, it stays consistent between Bluetooth toggling for the
2591 // same remote device.
2592 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2593 // session for the same remote device.
2594 // Default: 0 if the device's metric id is unknown.
2595 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002596}
2597
2598/**
2599 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2600 *
2601 * Logged from:
2602 * system/bt
2603 */
2604message BluetoothSmpPairingEventReported {
2605 // An identifier that can be used to match events for this device.
2606 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2607 // Salt: Randomly generated 256 bit value
2608 // Hash algorithm: HMAC-SHA256
2609 // Size: 32 byte
2610 // Default: null or empty if the device identifier is not known
2611 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2612 // SMP command sent or received over L2CAP
2613 // Default: CMD_UNKNOWN
2614 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2615 // Whether this command is sent or received
2616 // Default: DIRECTION_UNKNOWN
2617 optional android.bluetooth.DirectionEnum direction = 3;
2618 // SMP failure reason code
2619 // Default: PAIRING_FAIL_REASON_DEFAULT
2620 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002621 // An identifier that can be used to match events for this device.
2622 // The incremental identifier is locally generated and guaranteed not derived
2623 // from any globally unique hardware id.
2624 // For paired devices, it stays consistent between Bluetooth toggling for the
2625 // same remote device.
2626 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2627 // session for the same remote device.
2628 // Default: 0 if the device's metric id is unknown.
2629 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002630}
2631
2632/**
Jack He815cdba2019-01-30 17:24:55 -08002633 * Logs when a Bluetooth socket’s connection state changed
2634 *
2635 * Logged from:
2636 * system/bt
2637 */
2638message BluetoothSocketConnectionStateChanged {
2639 // An identifier that can be used to match events for this device.
2640 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2641 // Salt: Randomly generated 256 bit value
2642 // Hash algorithm: HMAC-SHA256
2643 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002644 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002645 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002646 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002647 // Default 0 when unknown or don't care
2648 optional int32 port = 2;
2649 // Socket type as mentioned in
2650 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2651 // Default: SOCKET_TYPE_UNKNOWN
2652 optional android.bluetooth.SocketTypeEnum type = 3;
2653 // Socket connection state
2654 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2655 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2656 // Number of bytes sent to remote device during this connection
2657 optional int64 tx_bytes = 5;
2658 // Number of bytes received from remote device during this connection
2659 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002660 // Socket owner's UID
2661 optional int32 uid = 7 [(is_uid) = true];
2662 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2663 // |port| must be spawned by |server_port|
2664 // Default 0 when unknown or don't care
2665 optional int32 server_port = 8;
2666 // Whether this is a server listener socket
2667 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002668 // An identifier that can be used to match events for this device.
2669 // The incremental identifier is locally generated and guaranteed not derived
2670 // from any globally unique hardware id.
2671 // For paired devices, it stays consistent between Bluetooth toggling for the
2672 // same remote device.
2673 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2674 // session for the same remote device.
2675 // Default: 0 if the device's metric id is unknown.
2676 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002677}
2678
2679/**
Jack He71426802019-04-02 13:32:52 -07002680 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2681 *
2682 * Logged from:
2683 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2684 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2685 *
2686 */
2687message BluetoothClassOfDeviceReported {
2688 // An identifier that can be used to match events for this device.
2689 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2690 // Salt: Randomly generated 256 bit value
2691 // Hash algorithm: HMAC-SHA256
2692 // Size: 32 byte
2693 // Default: null or empty if this is a server listener socket
2694 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2695 // Class of Device (CoD) value including both Major, Minor device class and service class
2696 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2697 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2698 // Default: 0
2699 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002700 // An identifier that can be used to match events for this device.
2701 // The incremental identifier is locally generated and guaranteed not derived
2702 // from any globally unique hardware id.
2703 // For paired devices, it stays consistent between Bluetooth toggling for the
2704 // same remote device.
2705 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2706 // session for the same remote device.
2707 // Default: 0 if the device's metric id is unknown.
2708 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002709}
2710
2711/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002712 * Logs when something is plugged into or removed from the USB-C connector.
2713 *
2714 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002715 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002716 */
2717message UsbConnectorStateChanged {
2718 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002719 STATE_DISCONNECTED = 0;
2720 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002721 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002722 optional State state = 1
2723 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2724 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002725 // Last active session in ms.
2726 // 0 when the port is in connected state.
2727 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002728}
2729
2730/**
2731 * Logs the reported speaker impedance.
2732 *
2733 * Logged from:
2734 * Vendor audio implementation.
2735 */
2736message SpeakerImpedanceReported {
2737 optional int32 speaker_location = 1;
2738 optional int32 impedance = 2;
2739}
2740
2741/**
2742 * Logs the report of a failed hardware.
2743 *
2744 * Logged from:
2745 * Vendor HALs.
2746 *
2747 */
2748message HardwareFailed {
2749 enum HardwareType {
2750 HARDWARE_FAILED_UNKNOWN = 0;
2751 HARDWARE_FAILED_MICROPHONE = 1;
2752 HARDWARE_FAILED_CODEC = 2;
2753 HARDWARE_FAILED_SPEAKER = 3;
2754 HARDWARE_FAILED_FINGERPRINT = 4;
2755 }
2756 optional HardwareType hardware_type = 1;
2757
Maggie White6dcd8572019-01-31 14:11:50 -08002758 /**
2759 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002760 * the same hardware_type. The specific locations are vendor defined integers,
2761 * referring to board-specific numbering schemes.
2762 */
2763 optional int32 hardware_location = 2;
2764
Maggie White6dcd8572019-01-31 14:11:50 -08002765 /**
2766 * failure_code is specific to the HardwareType of the failed hardware.
2767 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002768 */
Maggie White6dcd8572019-01-31 14:11:50 -08002769 enum HardwareErrorCode {
2770 UNKNOWN = 0;
2771 COMPLETE = 1;
2772 SPEAKER_HIGH_Z = 2;
2773 SPEAKER_SHORT = 3;
2774 FINGERPRINT_SENSOR_BROKEN = 4;
2775 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002776 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002777 }
2778 optional int32 failure_code = 3;
2779}
2780
2781/**
2782 * Log an event when the device has been physically dropped.
2783 * Reported from the /vendor partition.
2784 */
2785message PhysicalDropDetected {
2786 // Confidence that the event was actually a drop, 0 -> 100
2787 optional int32 confidence_pctg = 1;
2788 // Peak acceleration of the drop, in 1/1000s of a g.
2789 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002790 // Duration of freefall in ms
2791 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002792}
2793
2794/**
2795 * Log bucketed battery charge cycles.
2796 *
2797 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002798 * a given charge point. For example, if 10 cycle buckets are
2799 * initialized, bucket 1 is the lowest 1/10th of the battery,
2800 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002801 *
2802 * Logged from:
2803 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2804 */
2805message ChargeCyclesReported {
2806 optional int32 cycle_bucket_1 = 1;
2807 optional int32 cycle_bucket_2 = 2;
2808 optional int32 cycle_bucket_3 = 3;
2809 optional int32 cycle_bucket_4 = 4;
2810 optional int32 cycle_bucket_5 = 5;
2811 optional int32 cycle_bucket_6 = 6;
2812 optional int32 cycle_bucket_7 = 7;
2813 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002814 optional int32 cycle_bucket_9 = 9;
2815 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002816}
2817
2818/**
Howard Roa46b6582018-09-18 16:45:02 -07002819 * Log battery health snapshot.
2820 *
2821 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2822 * are snapshotted periodically over 24hrs.
2823 */
2824message BatteryHealthSnapshot {
2825 enum BatterySnapshotType {
2826 UNKNOWN = 0;
2827 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2828 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2829 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2830 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2831 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2832 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2833 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2834 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2835 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2836 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2837 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2838 }
2839 optional BatterySnapshotType type = 1;
2840 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002841 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002842 // Voltage Battery Voltage, in microVolts.
2843 optional int32 voltage_micro_volt = 3;
2844 // Current Battery current, in microAmps.
2845 optional int32 current_micro_amps = 4;
2846 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2847 optional int32 open_circuit_micro_volt = 5;
2848 // Resistance Battery Resistance, in microOhms.
2849 optional int32 resistance_micro_ohm = 6;
2850 // Level Battery Level, as % of full.
2851 optional int32 level_percent = 7;
2852}
2853
2854/**
2855 * Log slow I/O operations on the primary storage.
2856 */
2857message SlowIo {
2858 // Classifications of IO Operations.
2859 enum IoOperation {
2860 UNKNOWN = 0;
2861 READ = 1;
2862 WRITE = 2;
2863 UNMAP = 3;
2864 SYNC = 4;
2865 }
2866 optional IoOperation operation = 1;
2867
2868 // The number of slow IO operations of this type over 24 hours.
2869 optional int32 count = 2;
2870}
2871
2872/**
2873 * Log battery caused shutdown with the last recorded voltage.
2874 */
2875message BatteryCausedShutdown {
2876 // The last recorded battery voltage prior to shutdown.
2877 optional int32 last_recorded_micro_volt = 1;
2878}
2879
2880/**
Tej Singha72344992019-04-17 18:55:08 -07002881 * Logs when ThermalService receives throttling events.
2882 *
2883 * Logged from:
2884 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2885 */
2886message ThermalThrottlingSeverityStateChanged {
2887 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2888 optional android.os.TemperatureTypeEnum sensor_type = 1;
2889
2890 // The name of the temperature source. Eg. CPU0
2891 optional string sensor_name = 2;
2892
2893 // Temperature in tenths of a degree C.
2894 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2895 optional int32 temperature_deci_celsius = 3;
2896
2897 // Relative severity of the throttling, see enum definition.
2898 optional android.os.ThrottlingSeverityEnum severity = 4;
2899}
2900
2901/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002902 * Logs the duration of a davey (jank of >=700ms) when it occurs
2903 *
2904 * Logged from:
2905 * frameworks/base/libs/hwui/JankTracker.cpp
2906 */
2907message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002908 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002909 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002910
Tej Singhbb8554a2018-01-26 11:59:14 -08002911 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002912 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002913}
2914
2915/**
Bookatze5885242017-10-24 20:10:31 -07002916 * Logs phone signal strength changes.
2917 *
2918 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002919 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002920 */
2921message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002922 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2923 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002924}
2925
Yangster4ccebea2018-10-09 17:09:02 -07002926
2927/**
2928 * Logs when the phone state, sim state or signal strength changes
2929 *
2930 * Logged from:
2931 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2932 */
2933message PhoneServiceStateChanged {
2934 optional android.telephony.ServiceStateEnum state = 1;
2935 optional android.telephony.SimStateEnum sim_state = 2;
2936 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2937}
2938
2939/**
2940 * Logs when the phone becomes on or off.
2941 *
2942 * Logged from:
2943 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2944 */
2945message PhoneStateChanged {
2946 enum State {
2947 OFF = 0;
2948 ON = 1;
2949 }
2950 optional State state = 1;
2951}
2952
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002953message BackGesture {
2954 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002955 DEFAULT_BACK_TYPE = 0;
2956 COMPLETED = 1;
2957 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2958 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2959 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2960 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2961 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2962 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2963 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002964 }
2965 optional BackType type = 1;
2966
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002967 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2968 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2969 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2970 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2971 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2972 optional int32 left_boundary = 8; // left edge width + left inset
2973 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2974
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002975 enum WindowHorizontalLocation {
2976 DEFAULT_LOCATION = 0;
2977 LEFT = 1;
2978 RIGHT = 2;
2979 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002980 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002981}
2982
2983message ExclusionRectStateChanged {
2984 optional string component_name = 1; // if not available, simply packageName
2985 optional int32 requested_height = 2; // px
2986 optional int32 rejected_height = 3; // px
2987
2988 enum WindowHorizontalLocation {
2989 DEFAULT_LOCATION = 0;
2990 LEFT = 1;
2991 RIGHT = 2;
2992 }
2993 optional WindowHorizontalLocation x_location = 4;
2994 optional bool landscape = 5;
2995 optional bool splitscreen = 6;
2996 optional int32 duration_millis = 7;
2997}
2998
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002999/**
3000 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3001 *
3002 * Logged from:
3003 * packages/apps/Launcher3
3004 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003005message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003006 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003007 optional android.stats.launcher.LauncherState src_state = 2;
3008 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003009 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3010 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3011
3012 // The event id (e.g., app launch, drag and drop, long press)
3013 optional int32 event_id = 6;
3014 // The event's source or target id (e.g., icon, task, button)
3015 optional int32 target_id = 7;
3016 // If the target needs to be tracked, use this id field
3017 optional int32 instance_id = 8;
3018 optional int32 uid = 9 [(is_uid) = true];
3019 optional string package_name = 10;
3020 optional string component_name = 11;
3021
3022 // (x, y) coordinate and the index information of the target on the container
3023 optional int32 grid_x = 12;
3024 optional int32 grid_y = 13;
3025 optional int32 page_id = 14;
3026
3027 // e.g., folder icon's (x, y) location and index information on the workspace
3028 optional int32 grid_x_parent = 15;
3029 optional int32 grid_y_parent = 16;
3030 optional int32 page_id_parent = 17;
3031
3032 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3033 optional int32 hierarchy = 18;
3034
3035 optional bool is_work_profile = 19;
3036
3037 // Used to store the predicted rank of the target
3038 optional int32 rank = 20;
3039
3040 // e.g., folderLabelState can be captured in the following two fields
3041 optional int32 from_state = 21;
3042 optional int32 to_state = 22;
3043
3044 // e.g., autofilled or suggested texts that are not user entered
3045 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003046}
3047
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003048/**
3049 * Used for snapshot of the HomeScreen UI elements
3050 *
3051 * Logged from:
3052 * packages/apps/Launcher3
3053 */
3054message LauncherStaticLayout {
3055 // The event id (e.g., snapshot, drag and drop)
3056 optional int32 event_id = 1;
3057 // The event's source or target id (e.g., icon, shortcut, widget)
3058 optional int32 target_id = 2;
3059 // If the target needs to be tracked, use this id field
3060 optional int32 instance_id = 3;
3061 optional int32 uid = 4 [(is_uid) = true];
3062 optional string package_name = 5;
3063 optional string component_name = 6;
3064
3065 // (x, y) coordinate and the index information of the target on the container
3066 optional int32 grid_x = 7;
3067 optional int32 grid_y = 8;
3068 optional int32 page_id = 9;
3069
3070 // e.g., folder icon's (x, y) location and index information on the workspace
3071 optional int32 grid_x_parent = 10;
3072 optional int32 grid_y_parent = 11;
3073 optional int32 page_id_parent = 12;
3074
3075 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3076 optional int32 hierarchy = 13;
3077
3078 optional bool is_work_profile = 14;
3079
3080 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3081 optional int32 origin = 15;
3082}
3083
3084/**
3085 * Logs when Wallpaper or ThemePicker UI has changed.
3086 *
3087 * Logged from:
3088 * packages/apps/ThemePicker
3089 * packages/apps/WallpaperPicker2
3090 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003091message StyleUIChanged {
3092 optional android.stats.style.Action action = 1;
3093 optional int32 color_package_hash = 2;
3094 optional int32 font_package_hash = 3;
3095 optional int32 shape_package_hash = 4;
3096 optional int32 clock_package_hash = 5;
3097 optional int32 launcher_grid = 6;
3098 optional int32 wallpaper_category_hash = 7;
3099 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003100 optional int32 color_preference = 9;
3101 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003102}
3103
David Chenc28b2bb2017-10-24 12:52:52 -07003104/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003105 * Logs when Settings UI has changed.
3106 *
3107 * Logged from:
3108 * packages/apps/Settings
3109 */
3110message SettingsUIChanged {
3111 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003112 * Where this SettingsUIChange event comes from. For example, if
3113 * it's a PAGE_VISIBLE event, where the page is opened from.
3114 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003115 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003116
3117 /**
3118 * What the UI action is.
3119 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003120 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003121
3122 /**
3123 * Where the action is happening
3124 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003125 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003126
3127 /**
3128 * What preference changed in this event.
3129 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003130 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003131
3132 /**
3133 * The new value of the changed preference.
3134 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003135 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003136}
3137
3138/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003139 * Logs basic timing information about touch events.
3140 * Reported at most every 5 minutes while device is being interacted with.
3141 *
3142 * Logged from:
3143 * frameworks/native/services/inputflinger
3144 */
3145message TouchEventReported {
3146 /**
3147 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003148 * and the standard deviation of the time spent processing touchscreen events
3149 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003150 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003151 * On supported devices, the starting point is taken during the hard interrupt inside the
3152 * kernel touch driver. On all other devices, the starting point is taken inside
3153 * the kernel's input event subsystem upon receipt of the input event.
3154 * The ending point is taken inside InputDispatcher, just after the input event
3155 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003156 */
3157 // Minimum value
3158 optional float latency_min_micros = 1;
3159 // Maximum value
3160 optional float latency_max_micros = 2;
3161 // Average value
3162 optional float latency_mean_micros = 3;
3163 // Standard deviation
3164 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003165 // Number of touch events (input_event) in this report
3166 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003167}
3168
3169/**
Philip Quinn0eded622019-01-29 12:46:28 -08003170 * Logs gesture classification and timing information for touch events.
3171 *
3172 * Logged from:
3173 * frameworks/base/core/java/android/view/GestureDetector.java
3174 * frameworks/base/core/java/android/view/View.java
3175 */
3176message TouchGestureClassified {
3177 // The source of the classification (e.g. Java class name).
3178 optional string source = 1;
3179
3180 enum Classification {
3181 UNKNOWN_CLASSIFICATION = 0;
3182 SINGLE_TAP = 1;
3183 DOUBLE_TAP = 2;
3184 LONG_PRESS = 3;
3185 DEEP_PRESS = 4;
3186 SCROLL = 5;
3187 }
3188 // The classification of the gesture.
3189 optional Classification classification = 2;
3190
3191 // The interval from the start of a touch event stream until the
3192 // classification was made.
3193 optional int32 latency_millis = 3;
3194
3195 // The distance from the location of the first touch event to the
3196 // location of the touch event when the classification was made.
3197 optional float displacement_px = 4;
3198}
3199
3200/**
David Chenc28b2bb2017-10-24 12:52:52 -07003201 * Logs that a setting was updated.
3202 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003203 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003204 * The tag and is_default allow resetting of settings to default values based on the specified
3205 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3206 */
3207message SettingChanged {
3208 // The name of the setting.
3209 optional string setting = 1;
3210
3211 // The change being imposed on this setting. May represent a number, eg "3".
3212 optional string value = 2;
3213
3214 // The new value of this setting. For most settings, this is same as value. For some settings,
3215 // value is +X or -X where X represents an element in a set. For example, if the previous value
3216 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3217 // The +/- feature is currently only used for location_providers_allowed.
3218 optional string new_value = 3;
3219
3220 // The previous value of this setting.
3221 optional string prev_value = 4;
3222
3223 // The tag used with the is_default for resetting sets of settings. This is generally null.
3224 optional string tag = 5;
3225
Bookatz90867622018-01-31 15:05:57 -08003226 // True if this setting with tag should be resettable.
3227 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003228
David Chenbd789912018-03-16 17:19:55 -07003229 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003230 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003231
3232 enum ChangeReason {
3233 UPDATED = 1; // Updated can be an insertion or an update.
3234 DELETED = 2;
3235 }
3236 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003237}
Chenjie Yub3dda412017-10-24 13:41:59 -07003238
Chenjie Yu05013b32017-11-21 10:21:41 -08003239/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003240 * Logs activity going to foreground or background
3241 *
3242 * Logged from:
3243 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3244 */
3245message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003246 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003247 optional string pkg_name = 2;
3248 optional string class_name = 3;
3249
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003250 enum State {
3251 BACKGROUND = 0;
3252 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003253 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003254 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003255}
David Chenc8a43242017-10-17 16:23:28 -07003256
3257/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003258 * Logs when a volume entered low Storage state.
3259 * Logged from:
3260 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3261 */
3262message LowStorageStateChanged {
3263 // Volume that ran out of storage.
3264 optional string volume_description = 1;
3265
3266 enum State {
3267 UNKNOWN = 0;
3268 OFF = 1;
3269 ON = 2;
3270 }
3271 optional State state = 2;
3272}
3273
3274/**
3275 * Logs when an app is downgraded.
3276 * Logged from:
3277 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3278 */
3279message AppDowngraded {
3280 optional string package_name = 1;
3281 // Size of the package (all data) before being downgraded.
3282 optional int64 size_in_bytes_before = 2;
3283 // Size of the package (all data) after being downgraded.
3284 optional int64 size_in_bytes_after = 3;
3285
3286 optional bool aggressive = 4;
3287}
3288
3289/**
3290 * Logs when an app is optimized after being downgraded.
3291 * Logged from:
3292 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3293 */
3294message AppOptimizedAfterDowngraded {
3295 optional string package_name = 1;
3296}
3297
3298/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003299 * Logs whenever an app is installed on external storage.
3300 * Logged from:
3301 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3302 */
3303message AppInstallOnExternalStorageReported {
3304 // The type of external storage.
3305 optional android.stats.storage.ExternalStorageType storage_type = 1;
3306 // The name of the package that is installed on the sd card.
3307 optional string package_name = 2;
3308}
3309
3310/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003311 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003312 * Logged from:
3313 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3314 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003315message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003316 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003317
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003318 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003319
3320 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003321 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003322 optional string process_name = 3;
3323
3324 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003325 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003326
3327 optional string package_name = 5;
3328
3329 enum InstantApp {
3330 UNAVAILABLE = 0;
3331 FALSE = 1;
3332 TRUE = 2;
3333 }
3334 optional InstantApp is_instant_app = 6;
3335
3336 enum ForegroundState {
3337 UNKNOWN = 0;
3338 BACKGROUND = 1;
3339 FOREGROUND = 2;
3340 }
3341 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003342
3343 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003344}
David Chen9e3808c2017-11-20 17:25:34 -08003345
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003346/**
3347 * Logs when a WTF (What a Terrible Failure) happened.
3348 * Logged from:
3349 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3350 */
3351message WTFOccurred {
3352 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003353
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003355
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003356 // The name of the process.
3357 // system_server if it is not by an app
3358 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003359
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003360 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003361 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003362
3363 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003364}
3365
3366/**
3367 * Logs when system server reports low memory.
3368 * Logged from:
3369 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3370 */
3371message LowMemReported {
3372}
3373
3374/**
3375 * Logs when an app ANR (App Not Responding) occurs.
3376 * Logged from:
3377 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3378 */
3379message ANROccurred {
3380 optional int32 uid = 1 [(is_uid) = true];
3381
3382 optional string process_name = 2;
3383
3384 optional string short_component_name = 3;
3385
3386 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003387
3388 enum InstantApp {
3389 UNAVAILABLE = 0;
3390 FALSE = 1;
3391 TRUE = 2;
3392 }
3393 optional InstantApp is_instant_app = 5;
3394
3395 enum ForegroundState {
3396 UNKNOWN = 0;
3397 BACKGROUND = 1;
3398 FOREGROUND = 2;
3399 }
3400 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003401
3402 optional android.server.ErrorSource error_source = 7;
3403
3404 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003405}
3406
Bookatza7020bd2018-08-28 16:29:35 -07003407/**
3408 * Logs when the vibrator state changes.
3409 * Logged from:
3410 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3411 */
3412message VibratorStateChanged {
3413 repeated AttributionNode attribution_node = 1;
3414
3415 enum State {
3416 OFF = 0;
3417 ON = 1;
3418 }
3419 optional State state = 2;
3420
3421 // Duration (in milliseconds) requested to keep the vibrator on.
3422 // Only applicable for State == ON.
3423 optional int64 duration_millis = 3;
3424}
3425
David Chen0a368b22017-12-06 16:28:16 -08003426/*
3427 * Allows other apps to push events into statsd.
3428 * Logged from:
3429 * frameworks/base/core/java/android/util/StatsLog.java
3430 */
David Chen0b5c90c2018-01-25 16:51:49 -08003431message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003432 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003433 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003434
3435 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3436 optional int32 label = 2;
3437
3438 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3439 // predicates for the metrics).
3440 enum State {
3441 UNKNOWN = 0;
3442 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3443 STOP = 2;
3444 START = 3;
3445 }
3446 optional State state = 3;
3447}
3448
David Chen9e3808c2017-11-20 17:25:34 -08003449/**
Bookatz7948c872018-09-04 12:58:33 -07003450 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3451 * For example, this could be due to the user manually changing the time.
3452 *
3453 * Logged from:
3454 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3455 */
3456message WallClockTimeShifted {
3457 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3458 optional int64 wall_clock_timestamp_millis = 1;
3459}
3460
3461/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003462 * Logs when statsd detects an anomaly.
3463 *
3464 * Logged from:
3465 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3466 */
3467message AnomalyDetected {
3468 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003469 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003470
Yangster-mac94e197c2018-01-02 16:03:03 -08003471 // Id of the config whose anomaly detection alert fired.
3472 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003473
Yangster-mac94e197c2018-01-02 16:03:03 -08003474 // Id of the alert (i.e. name of the anomaly that was detected).
3475 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003476}
3477
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003478message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003479 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003480 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003481
3482 // The app package name.
3483 optional string pkg_name = 2;
3484
3485 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003486 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003487 WARM = 1;
3488 HOT = 2;
3489 COLD = 3;
3490 }
3491 // The transition type.
3492 optional TransitionType type = 3;
3493
3494 // The activity name.
3495 optional string activity_name = 4;
3496
3497 // The name of the calling app. Empty if not set.
3498 optional string calling_pkg_name = 5;
3499
3500 // Whether the app is an instant app.
3501 optional bool is_instant_app = 6;
3502
3503 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003504 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003505
Bookatz80d11a02018-01-16 10:46:35 -08003506 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003507
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003509 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003510 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003511 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003512 optional int32 bind_application_delay_millis = 11;
3513 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003514
3515 // Empty if not set.
3516 optional string launch_token = 13;
3517
Calin Juravle759fbda2018-02-20 19:52:30 +00003518 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003519 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003520
3521 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003522 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003523}
3524
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003525message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003526 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003527 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003528
3529 // The app package name.
3530 optional string pkg_name = 2;
3531
3532 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003533 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003534 WARM = 1;
3535 HOT = 2;
3536 COLD = 3;
3537 }
3538 // The transition type.
3539 optional TransitionType type = 3;
3540
3541 // The activity name.
3542 optional string activity_name = 4;
3543}
3544
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003545message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003546 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003547 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003548
3549 // The app package name.
3550 optional string pkg_name = 2;
3551
3552 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003553 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003554 WITH_BUNDLE = 1;
3555 WITHOUT_BUNDLE = 2;
3556 }
3557 // The transition type.
3558 optional TransitionType type = 3;
3559
3560 // The activity name.
3561 optional string activity_name = 4;
3562
3563 optional bool transition_process_running = 5;
3564
3565 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003566 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567}
3568
Bookatz8fcd09a2017-12-18 13:01:10 -08003569/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003570 * Logs a picture-in-picture action
3571 * Logged from:
3572 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3573 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3574 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3575 */
3576message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003577 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003578 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003579
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003580 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003581
Chenjie Yu52cacc62017-12-08 18:11:45 -08003582 enum State {
3583 ENTERED = 1;
3584 EXPANDED_TO_FULL_SCREEN = 2;
3585 MINIMIZED = 3;
3586 DISMISSED = 4;
3587 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003588 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003589}
3590
3591/**
Chenjie Yue8904192017-12-08 19:12:57 -08003592 * Logs overlay action
3593 * Logged from:
3594 * services/core/java/com/android/server/wm/Session.java
3595 */
3596message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003597 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003598
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003599 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003600
3601 optional bool using_alert_window = 3;
3602
3603 enum State {
3604 ENTERED = 1;
3605 EXITED = 2;
3606 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003607 optional State state = 4
3608 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003609}
3610
Adam Bookatz38767932020-02-05 12:13:40 -08003611/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003612 * Logs foreground service starts and stops.
3613 * Note that this is not when a service starts or stops, but when it is
3614 * considered foreground.
3615 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003616 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003617 */
3618message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003619 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003620 // package_name + "/" + class_name
3621 optional string short_name = 2;
3622
3623 enum State {
3624 ENTER = 1;
3625 EXIT = 2;
3626 }
3627 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003628
3629 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3630 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3631 optional bool allow_while_in_use_permission = 4;
3632}
3633
3634/**
3635 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3636 * A foreground service session is any continuous period during which the uid holds at least one
3637 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3638 * Accesses initiated while the uid is in the TOP state are ignored.
3639 * Sessions with no attempted accesses are not logged.
3640 * Logged from
3641 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3642 */
3643message ForegroundServiceAppOpSessionEnded {
3644 optional int32 uid = 1 [(is_uid) = true];
3645
3646 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003647 // Only following four ops are logged
3648 // COARSE_LOCATION = 0
3649 // FINE_LOCATION = 1
3650 // CAMERA = 26
3651 // RECORD_AUDIO = 27
3652 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003653
3654 // The uid's permission mode for accessing the AppOp during this fgs session.
3655 enum Mode {
3656 MODE_UNKNOWN = 0;
3657 MODE_ALLOWED = 1; // Always allowed
3658 MODE_IGNORED = 2; // Denied
3659 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3660 }
3661 optional Mode app_op_mode = 3;
3662
3663 // Number of times this AppOp was requested and allowed.
3664 optional int32 count_ops_accepted = 4;
3665 // Number of times this AppOp was requested but denied.
3666 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003667}
3668
Chenjie Yue8904192017-12-08 19:12:57 -08003669/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003670 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3671 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3672 * attributed back to the parent (host) uid. One example is Chrome.
3673 *
3674 * Logged from:
3675 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3676 */
3677message IsolatedUidChanged {
3678 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003679 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003680 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003681 optional int32 parent_uid = 1;
3682
3683 optional int32 isolated_uid = 2;
3684
3685 // We expect an isolated uid to be removed before if it's used for another parent uid.
3686 enum Event {
3687 REMOVED = 0;
3688 CREATED = 1;
3689 }
3690 optional Event event = 3;
3691}
3692
3693/*
3694 * Logs the reception of an incoming network packet causing the main system to wake up for
3695 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3696 * and processed by WakeupController.cpp.
3697 */
3698message PacketWakeupOccurred {
3699 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3700 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003701 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003702 // The interface name on which the packet was received.
3703 optional string iface = 2;
3704 // The ethertype value of the packet.
3705 optional int32 ethertype = 3;
3706 // String representation of the destination MAC address of the packet.
3707 optional string destination_hardware_address = 4;
3708 // String representation of the source address of the packet if this was an IP packet.
3709 optional string source_ip = 5;
3710 // String representation of the destination address of the packet if this was an IP packet.
3711 optional string destination_ip = 6;
3712 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3713 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3714 // families.
3715 optional int32 ip_next_header = 7;
3716 // The source port if this was a TCP or UDP packet.
3717 optional int32 source_port = 8;
3718 // The destination port if this was a TCP or UDP packet.
3719 optional int32 destination_port = 9;
3720}
3721
3722/*
3723 * Logs the memory stats for an app on startup.
3724 * Logged from:
3725 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3726 */
3727message AppStartMemoryStateCaptured {
3728 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003729 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003730
3731 // The process name.
3732 optional string process_name = 2;
3733
3734 // The activity name.
3735 optional string activity_name = 3;
3736
3737 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003738 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003739
3740 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003741 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003742
3743 // RSS
3744 optional int64 rss_in_bytes = 6;
3745
3746 // CACHE
3747 optional int64 cache_in_bytes = 7;
3748
3749 // SWAP
3750 optional int64 swap_in_bytes = 8;
3751}
3752
3753/*
3754 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3755 * for LMK event.
3756 * Logged from:
3757 * system/core/lmkd/lmkd.c
3758 */
3759message LmkStateChanged {
3760 enum State {
3761 UNKNOWN = 0;
3762 START = 1;
3763 STOP = 2;
3764 }
3765 optional State state = 1;
3766}
3767
3768/*
3769 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3770 * Logged from:
3771 * system/core/lmkd/lmkd.c
3772 */
3773message LmkKillOccurred {
3774 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003776
3777 // The process name.
3778 optional string process_name = 2;
3779
3780 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003781 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003782
3783 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003784 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003785
3786 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003787 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003788
3789 // RSS
3790 optional int64 rss_in_bytes = 6;
3791
3792 // CACHE
3793 optional int64 cache_in_bytes = 7;
3794
3795 // SWAP
3796 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003797
3798 // The elapsed real time of start of the process.
3799 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003800
3801 // Min oom adj score considered by lmkd.
3802 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003803}
3804
Rajeev Kumar51b54602018-03-01 12:18:26 -08003805/*
3806 * Logs when the ActivityManagerService detects that an app died.
3807 *
3808 * Logged from:
3809 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3810 */
3811message AppDied {
3812 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003813 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003814}
3815
Howard Ro21a039c2018-08-06 14:55:47 -07003816/**
3817 * An atom for generic metrics logging. Available from Android Q.
3818 */
3819message GenericAtom {
3820 // The uid of the application that sent this custom atom.
3821 optional int32 uid = 1 [(is_uid) = true];
3822
3823 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003824 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003825}
3826
Tej Singhd6d6d772018-09-05 17:41:25 -07003827/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003828 * Atom for simple logging of user interaction and impression events, such as "the user touched
3829 * this button" or "this dialog was displayed".
3830 * Keep the UI event stream clean: don't use for system or background events.
3831 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003832 *
3833 * Logged from:
3834 * frameworks/base/services/core/java/com/android/server/
3835 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003836 */
3837message UiEventReported {
3838 // The event_id.
3839 optional int32 event_id = 1;
3840 // The event's source or target uid and package, if applicable.
3841 // For example, the package posting a notification, or the destination package of a share.
3842 optional int32 uid = 2 [(is_uid) = true];
3843 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003844 // An identifier used to disambiguate which logs refer to a particular instance of some
3845 // UI element. Useful when there might be multiple instances simultaneously active.
3846 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003847}
3848
3849/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003850 * Reports a notification was created or updated.
3851 *
3852 * Logged from:
3853 * frameworks/base/services/core/java/com/android/server/notification/
3854 */
3855message NotificationReported {
3856 // The event_id (as for UiEventReported).
3857 optional int32 event_id = 1;
3858 // The notifying app's uid and package.
3859 optional int32 uid = 2 [(is_uid) = true];
3860 optional string package_name = 3;
3861 // A small system-assigned identifier for the notification.
3862 // Locally probably-unique, but expect collisions across users and/or days.
3863 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003864 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3865 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003866
3867 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003868 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3869 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3870 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003871
3872 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003873 optional string category = 10; // App-assigned notification category (API-defined strings)
3874 optional int32 style = 11; // App-assigned notification style
3875 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003876
3877 // Ordering, importance and interruptiveness
3878
Will Brockman7614f6962020-02-10 19:43:03 -05003879 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003880
Will Brockman7614f6962020-02-10 19:43:03 -05003881 optional android.stats.sysui.NotificationImportance importance = 14;
3882 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003883
3884 enum NotificationImportanceExplanation {
3885 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3886 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3887 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3888 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3889 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3890 // Like _APP, but based on pre-channels priority signal.
3891 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3892 }
3893
Will Brockman7614f6962020-02-10 19:43:03 -05003894 optional NotificationImportanceExplanation importance_source = 16;
3895 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3896 optional NotificationImportanceExplanation importance_initial_source = 18;
3897 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3898 optional int32 assistant_hash = 20;
3899 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003900}
3901
3902message Notification {
3903 // The notifying app's uid and package.
3904 optional int32 uid = 1 [(is_uid) = true];
3905 optional string package_name = 2;
3906 // A small system-assigned identifier for the notification.
3907 optional int32 instance_id = 3;
3908
3909 // Grouping information.
3910 optional int32 group_instance_id = 4;
3911 optional bool is_group_summary = 5;
3912
3913 // The section of the shade that the notification is in.
3914 // See NotificationSectionsManager.PriorityBucket.
3915 enum NotificationSection {
3916 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003917 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003918 SECTION_MEDIA_CONTROLS = 2;
3919 SECTION_PEOPLE = 3;
3920 SECTION_ALERTING = 4;
3921 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003922 }
3923 optional NotificationSection section = 6;
3924}
3925
3926message NotificationList {
3927 repeated Notification notifications = 1; // An ordered sequence of notifications.
3928}
3929
3930/**
3931 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3932 *
3933 * Logged from:
3934 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3935 */
3936message NotificationPanelReported {
3937 // The event_id (as for UiEventReported).
3938 optional int32 event_id = 1;
3939 optional int32 num_notifications = 2;
3940 // The notifications in the panel, in the order that they appear there.
3941 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3942}
3943
3944/**
3945 * Reports a notification channel, or channel group, was created, updated, or deleted.
3946 *
3947 * Logged from:
3948 * frameworks/base/services/core/java/com/android/server/notification/
3949 */
3950message NotificationChannelModified {
3951 // The event_id (as for UiEventReported).
3952 optional int32 event_id = 1;
3953 // The notifying app's uid and package.
3954 optional int32 uid = 2 [(is_uid) = true];
3955 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003956 // Hash of app-assigned notification channel ID or channel-group ID
3957 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003958 // Previous importance setting, if applicable
3959 optional android.stats.sysui.NotificationImportance old_importance = 5;
3960 // New importance setting
3961 optional android.stats.sysui.NotificationImportance importance = 6;
3962}
3963
3964
3965/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003966 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003967 *
3968 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003969 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003970 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003971message BiometricAcquired {
3972 // Biometric modality that was acquired.
3973 optional android.hardware.biometrics.ModalityEnum modality = 1;
3974 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3975 optional int32 user = 2;
3976 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3977 optional bool is_crypto = 3;
3978 // Action that the device is performing. Acquired messages are only expected for enroll and
3979 // authenticate. Other actions may indicate an error.
3980 optional android.hardware.biometrics.ActionEnum action = 4;
3981 // The client that this acquisition was received for.
3982 optional android.hardware.biometrics.ClientEnum client = 5;
3983 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3984 optional int32 acquire_info = 6;
3985 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3986 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003987 // Dictates if this message should trigger additional debugging.
3988 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003989}
3990
3991/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003992 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003993 *
3994 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003995 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003996 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003997message BiometricAuthenticated {
3998 // Biometric modality that was used.
3999 optional android.hardware.biometrics.ModalityEnum modality = 1;
4000 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4001 optional int32 user = 2;
4002 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4003 // storage.
4004 optional bool is_crypto = 3;
4005 // The client that this acquisition was received for.
4006 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004007 // If authentication requires user confirmation. See BiometricPrompt's
4008 // setRequireConfirmation(bool) method.
4009 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004010
Kevin Chyn1741a072019-01-17 11:54:40 -08004011 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004012 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004013 REJECTED = 1;
4014 PENDING_CONFIRMATION = 2;
4015 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004016 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004017
4018 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004019 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004020 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4021 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4022 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4023 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004024 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004025 // Dictates if this message should trigger additional debugging.
4026 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004027}
4028
4029/**
4030 * Logs when a biometric error occurs.
4031 *
4032 * Logged from:
4033 * frameworks/base/services/core/java/com/android/server/biometrics
4034 */
4035message BiometricErrorOccurred {
4036 // Biometric modality that was used.
4037 optional android.hardware.biometrics.ModalityEnum modality = 1;
4038 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4039 optional int32 user = 2;
4040 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4041 optional bool is_crypto = 3;
4042 // Action that the device is performing.
4043 optional android.hardware.biometrics.ActionEnum action = 4;
4044 // The client that this acquisition was received for.
4045 optional android.hardware.biometrics.ClientEnum client = 5;
4046 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4047 // are unique to modality.
4048 optional int32 error_info = 6;
4049 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4050 // by the vendor and not specified by the HIDL interface.
4051 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004052 // Dictates if this message should trigger additional debugging.
4053 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004054 // Time spent during the authentication attempt.
4055 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004056}
4057
4058/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004059 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004060 * Logged from:
4061 * frameworks/base/services/core/java/com/android/server/biometrics
4062 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004063message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004064 // Biometric modality.
4065 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004066 // Type of issue detected.
4067 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004068 // Dictates if this message should trigger additional debugging.
4069 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004070}
Howard Ro688ae182018-09-25 00:09:36 -07004071
joshmccloskey6f952b22019-03-25 20:59:35 -07004072/**
4073 * Logs when a biometric enrollment occurs.
4074 *
4075 * Logged from:
4076 * frameworks/base/services/core/java/com/android/server/biometrics
4077 */
4078message BiometricEnrolled {
4079 // Biometric modality that was used.
4080 optional android.hardware.biometrics.ModalityEnum modality = 1;
4081 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4082 optional int32 user = 2;
4083 // The amount of time the enrollment took in milliseconds.
4084 optional int64 latency_millis = 3;
4085 // Whether or not the enrollment was successful.
4086 optional bool success = 4;
4087}
4088
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004089/*
Tej Singh0d176952019-01-16 19:10:54 -08004090 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004091 */
Tej Singh0d176952019-01-16 19:10:54 -08004092message FlagFlipUpdateOccurred {
4093 // If the event is from a flag config package, specify the package name.
4094 optional string flag_flip_package_name = 1;
4095
4096 // The order id of the package
4097 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004098}
4099
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004100/**
4101 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004102 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004103 */
4104message TrainExperimentIds {
4105 repeated int64 experiment_id = 1;
4106}
4107
Yangster-macb89807e2018-11-15 21:10:57 -08004108/*
4109 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004110 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004111 */
4112message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004113 // Name of the train.
4114 optional string train_name = 1;
4115 // Version code for a "train" of packages that need to be installed atomically
4116 optional int64 train_version_code = 2;
4117 // After installation of this package, device requires a restart.
4118 optional bool requires_staging = 3;
4119 // Rollback should be enabled for this install.
4120 optional bool rollback_enabled = 4;
4121 // Requires low latency monitoring if possible.
4122 optional bool requires_low_latency_monitor = 5;
4123
Yangster-macb89807e2018-11-15 21:10:57 -08004124 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004125 UNKNOWN = 0;
4126 INSTALL_REQUESTED = 1;
4127 INSTALL_STARTED = 2;
4128 INSTALL_STAGED_NOT_READY = 3;
4129 INSTALL_STAGED_READY = 4;
4130 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004131 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4132 // and INSTALL_FAILURE_COMMIT.
4133 INSTALL_FAILURE = 6 [deprecated = true];
4134 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004135 INSTALL_CANCELLED = 7;
4136 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004137 INSTALLER_ROLLBACK_INITIATED = 9;
4138 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4139 INSTALLER_ROLLBACK_STAGED = 11;
4140 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4141 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4142 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4143 INSTALLER_ROLLBACK_SUCCESS = 15;
4144 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004145 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4146 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4147 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4148 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4149 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4150 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004151 INSTALL_FAILURE_DOWNLOAD = 23;
4152 INSTALL_FAILURE_STATE_MISMATCH = 24;
4153 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004154 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004155 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004156 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004157 // Possible experiment ids for monitoring this push.
4158 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4159 // user id
4160 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004161 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004162 // Whether or not this is a rollback event
4163 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004164}
4165
Tej Singhc9203082019-05-03 13:42:23 -07004166/* Test atom, is not logged anywhere */
4167message TestAtomReported {
4168 repeated AttributionNode attribution_node = 1;
4169 optional int32 int_field = 2;
4170 optional int64 long_field = 3;
4171 optional float float_field = 4;
4172 optional string string_field = 5;
4173 optional bool boolean_field = 6;
4174 enum State {
4175 UNKNOWN = 0;
4176 OFF = 1;
4177 ON = 2;
4178 }
4179 optional State state = 7;
4180 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4181}
4182
Maggie Whitefc1aa592018-11-28 21:55:23 -08004183/** Represents USB port overheat event. */
4184message UsbPortOverheatEvent {
4185 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4186 optional int32 plug_temperature_deci_c = 1;
4187
4188 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4189 optional int32 max_temperature_deci_c = 2;
4190
4191 /* Time between USB plug event and overheat threshold trip, in seconds. */
4192 optional int32 time_to_overheat_secs = 3;
4193
4194 /* Time between overheat threshold trip and hysteresis, in seconds. */
4195 optional int32 time_to_hysteresis_secs = 4;
4196
4197 /* Time between hysteresis and active mitigation ending, in seconds. */
4198 optional int32 time_to_inactive_secs = 5;
4199};
4200
Maggie White8735b852019-01-18 11:40:49 -08004201/**
4202 * Logs total effective full charge and discharge cycles on a battery.
4203 * Here are some examples of one effective cycle:
4204 * 1) the battery charges from 0% to 100% and drains back to 0%,
4205 * 2) charging from 50% to 100% and draining back to 50% twice.
4206 * Pulled from:
4207 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4208 */
4209message BatteryCycleCount {
4210 /* Number of total charge and discharge cycles on the system battery. */
4211 optional int32 cycle_count = 1;
4212}
4213
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004214/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004215 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4216 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004217 * Pulled from:
4218 * StatsCompanionService
4219 */
4220
Carmen Agimof12dec122019-03-06 16:14:38 +00004221message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004222
Carmen Agimof12dec122019-03-06 16:14:38 +00004223 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004224 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004225 PUBLIC = 1;
4226 PRIVATE = 2;
4227 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004228 }
4229
Carmen Agimof12dec122019-03-06 16:14:38 +00004230 // The type of external storage.
4231 optional android.stats.storage.ExternalStorageType storage_type = 1;
4232 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4233 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004234 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004235 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004236}
4237
Yangster-macb89807e2018-11-15 21:10:57 -08004238/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004239 * Logs when a connection becomes available and lost.
4240 * Logged in StatsCompanionService.java
4241 */
4242message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004243 // Id of the network.
4244 optional int32 net_id = 1;
4245
4246 enum State {
4247 UNKNOWN = 0;
4248 CONNECTED = 1;
4249 DISCONNECTED = 2;
4250 }
4251 // Connected state of a network.
4252 optional State state = 2;
4253}
4254
4255/**
4256 * Logs when a service starts and stops.
4257 * Logged from:
4258 * services/core/java/com/android/server/am/ActiveServices.java
4259 */
4260message ServiceStateChanged {
4261
4262 optional int32 uid = 1 [(is_uid) = true];
4263
4264 optional string package_name = 2;
4265
4266 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004267
4268 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004269 START = 1;
4270 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004271 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004272
4273 optional State state = 4;
4274}
4275
4276/**
4277 * Logs when a service is launched.
4278 * Logged from:
4279 * services/core/java/com/android/server/am/ActiveServices.java
4280 */
4281message ServiceLaunchReported {
4282
4283 optional int32 uid = 1 [(is_uid) = true];
4284
4285 optional string package_name = 2;
4286
4287 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004288}
Howard Ro688ae182018-09-25 00:09:36 -07004289
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004290/**
4291 * Logs when a hidden API is used.
4292 *
4293 * Logged from:
4294 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4295 */
4296message HiddenApiUsed {
4297 // The uid of the app making the hidden access.
4298 optional int32 uid = 1 [(is_uid) = true];
4299
4300 // Signature of the method or field accessed.
4301 optional string signature = 2;
4302
4303 enum AccessMethod {
4304 NONE = 0;
4305 REFLECTION = 1;
4306 JNI = 2;
4307 LINKING = 3;
4308 }
4309
4310 // Type of access.
4311 optional AccessMethod access_method = 3;
4312
4313 // Whether the access was prevented or not.
4314 optional bool access_denied = 4;
4315}
4316
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004317/**
4318 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4319 * - When user sees privacy chip
4320 * - When user clicks privacy chip
4321 * - How does the user exit the Privacy Dialog
4322 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004323 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4324 */
4325message PrivacyIndicatorsInteracted {
4326
4327 enum Type {
4328 UNKNOWN = 0;
4329 CHIP_VIEWED = 1;
4330 CHIP_CLICKED = 2;
4331 DIALOG_PRIVACY_SETTINGS = 3;
4332 DIALOG_DISMISS = 4;
4333 DIALOG_LINE_ITEM = 5;
4334 }
4335
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004336 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004337
4338 // Used if the type is LINE_ITEM
4339 optional string package_name = 2;
4340}
4341
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004342/**
4343 * Logs information about a package that is moved from the internal to external storage and vice
4344 * versa.
4345 * It logs the package name, the type of the external storage where the package is installed
4346 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4347 * and the move type: if it's from internal to external or the other way around.
4348 *
4349 * Logged from:
4350 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4351 */
4352message AppMovedStorageReported {
4353 enum MoveType {
4354 UNKNOWN = 0;
4355 TO_EXTERNAL = 1;
4356 TO_INTERNAL = 2;
4357 }
4358 // The type of the external storage.
4359 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4360 // The type of move.
4361 optional MoveType move_type = 2;
4362 // The name of the package that was moved.
4363 optional string package_name = 3;
4364}
4365
jianjin8f2dee02019-03-29 14:03:08 -07004366/**
4367 * Logs when system server watchdog occurs.
4368 * Logged from:
4369 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4370 */
4371message SystemServerWatchdogOccurred {
4372 optional string subject = 1;
4373}
4374
4375/**
4376 * Logs when new file added to tombstones.
4377 * Logged from:
4378 * frameworks/base/core/java/com/android/server/BootReceiver.java
4379 */
4380message TombStoneOccurred {
4381}
4382
Hai Zhang5d3328d2019-04-13 21:25:06 +08004383/*
4384 * Information about a role request
4385 *
4386 * Logged from:
4387 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4388 */
4389message RoleRequestResultReported {
4390 // UID of application requesting the role
4391 optional int32 requesting_uid = 1;
4392
4393 // Package name of application requesting the role
4394 optional string requesting_package_name = 2;
4395
4396 // The role to be granted
4397 optional string role_name = 3;
4398
4399 // The count of applications qualifying for the role
4400 optional int32 qualifying_count = 4;
4401
4402 // UID of application current granted the role
4403 optional int32 current_uid = 5;
4404
4405 // Package name of application current granted the role
4406 optional string current_package_name = 6;
4407
4408 // UID of another application that user chose to grant the role to, instead of the requesting
4409 // application
4410 optional int32 granted_another_uid = 7;
4411
4412 // Package name of another application that user chose to grant the role to, instead of the
4413 // requesting application
4414 optional string granted_another_package_name = 8;
4415
4416 enum Result {
4417 UNDEFINED = 0;
4418 // role request was ignored
4419 IGNORED = 1;
4420 // role request was ignored because it's already granted
4421 IGNORED_ALREADY_GRANTED = 2;
4422 // role request was ignored because the application isn't qualified
4423 IGNORED_NOT_QUALIFIED = 3;
4424 // role request was ignored because user said it should be always denied
4425 IGNORED_USER_ALWAYS_DENIED = 4;
4426 // role was granted by user action
4427 USER_GRANTED = 5;
4428 // role was denied by user action
4429 USER_DENIED = 6;
4430 // role was denied by user granting another application the role
4431 USER_DENIED_GRANTED_ANOTHER = 7;
4432 // role was denied and set to be always denied by the user
4433 USER_DENIED_WITH_ALWAYS = 8;
4434 }
4435 // The result of the role request
4436 optional Result result = 9;
4437}
4438
Mark Tabrya824a642019-11-05 12:26:12 -08004439/**
4440 * Logs when a Vehicle Maps Service client's connection state has changed
4441 *
4442 * Logged from:
4443 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4444 */
4445message VmsClientConnectionStateChanged {
4446 // The UID of the VMS client app
4447 optional int32 uid = 1 [(is_uid) = true];
4448
4449 enum State {
4450 UNKNOWN = 0;
4451 // Attempting to connect to the client
4452 CONNECTING = 1;
4453 // Client connection established
4454 CONNECTED = 2;
4455 // Client connection closed unexpectedly
4456 DISCONNECTED = 3;
4457 // Client connection closed by VMS
4458 TERMINATED = 4;
4459 // Error establishing the client connection
4460 CONNECTION_ERROR = 5;
4461 }
4462
4463 optional State state = 2;
4464}
4465
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004466/**
4467 * Logs when MediaProvider has successfully finished scanning a storage volume.
4468 *
4469 * Logged from:
4470 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4471 */
shafik43825842020-04-02 17:30:24 +01004472message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004473 enum Reason {
4474 // Scan triggered due to unknown reason
4475 UNKNOWN = 0;
4476 // Scan triggered due to storage volume being mounted
4477 MOUNTED = 1;
4478 // Scan triggered due to explicit user action or app request
4479 DEMAND = 2;
4480 // Scan triggered due to idle maintenance
4481 IDLE = 3;
4482 }
4483
4484 // Volume type that this event pertains to
4485 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4486 // Reason why this scan was triggered
4487 optional Reason reason = 2;
4488 // Total number of files scanned
4489 optional int64 item_count = 3;
4490 // Duration of scan, normalized per file
4491 optional float normalized_duration_millis = 4;
4492 // Number of database inserts, normalized per file
4493 optional float normalized_insert_count = 5;
4494 // Number of database updates, normalized per file
4495 optional float normalized_update_count = 6;
4496 // Number of database deletes, normalized per file
4497 optional float normalized_delete_count = 7;
4498}
4499
4500/**
4501 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4502 *
4503 * Logged from:
4504 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4505 */
shafik43825842020-04-02 17:30:24 +01004506message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004507 // Volume type that this event pertains to
4508 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004509 // UID of app that requested deletion
4510 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004511 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004512 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004513}
4514
4515/**
4516 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4517 *
4518 * Logged from:
4519 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4520 */
shafik43825842020-04-02 17:30:24 +01004521message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004522 enum Result {
4523 UNKNOWN = 0;
4524 USER_GRANTED = 1;
4525 AUTO_GRANTED = 2;
4526 USER_DENIED = 3;
4527 USER_DENIED_WITH_PREJUDICE = 4;
4528 AUTO_DENIED = 5;
4529 }
4530
4531 // Volume type that this event pertains to
4532 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004533 // UID of app that requested permission
4534 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004535 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004536 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004537 // Result of this request
shafik43825842020-04-02 17:30:24 +01004538 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004539}
4540
4541/**
4542 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4543 *
4544 * Logged from:
4545 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4546 */
shafik43825842020-04-02 17:30:24 +01004547message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004548 // Volume type that this event pertains to
4549 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4550 // Old database version code
4551 optional int32 version_from = 2;
4552 // New database version code
4553 optional int32 version_to = 3;
4554 // Total number of files in database
4555 optional int64 item_count = 4;
4556 // Duration of schema change, normalized per file
4557 optional float normalized_duration_millis = 5;
4558}
4559
4560/**
4561 * Logs when MediaProvider has finished an idle maintenance job.
4562 *
4563 * Logged from:
4564 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4565 */
shafik43825842020-04-02 17:30:24 +01004566message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004567 // Volume type that this event pertains to
4568 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4569
4570 // Total number of files in database
4571 optional int64 item_count = 2;
4572 // Duration of idle maintenance, normalized per file
4573 optional float normalized_duration_millis = 3;
4574 // Number of thumbnails found to be stale, normalized per file
4575 optional float normalized_stale_thumbnails = 4;
4576 // Number of items found to be expired, normalized per file
4577 optional float normalized_expired_media = 5;
4578}
4579
Keun young Park3e033cb2019-12-18 11:27:35 -08004580/**
4581 * Represents boot time event with duration in ms.
4582 *
4583 * Logged from: bootstat and various system server components. Check each enums for details.
4584 */
4585message BootTimeEventDuration {
4586 enum DurationEvent {
4587 UNKNOWN = 0;
4588 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4589 ABSOLUTE_BOOT_TIME = 1;
4590 // Bootloader's 1st stage execution time.
4591 // Logged from bootstat.
4592 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4593 // Bootloader's 1st stage loading time.
4594 // Logged from bootstat.
4595 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4596 // Bootloader's kernel loading time.
4597 // Logged from bootstat.
4598 BOOTLOADER_KERNEL_LOAD = 4;
4599 // Bootloader's 2nd stage execution time.
4600 // Logged from bootstat.
4601 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4602 // Bootloader's 2nd stage loading time.
4603 // Logged from bootstat.
4604 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4605 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4606 // for locked device.
4607 // Logged from bootstat.
4608 BOOTLOADER_UI_WAIT = 7;
4609 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4610 // Logged from bootstat.
4611 BOOTLOADER_TOTAL = 8;
4612 // Shutdown duration inside init for the reboot before the current boot up.
4613 // Logged from f/b/services/.../BootReceiver.java.
4614 SHUTDOWN_DURATION = 9;
4615 // Total time for mounting of disk devices during bootup.
4616 // Logged from f/b/services/.../BootReceiver.java.
4617 MOUNT_DEFAULT_DURATION = 10;
4618 // Total time for early stage mounting of disk devices during bootup.
4619 // Logged from f/b/services/.../BootReceiver.java.
4620 MOUNT_EARLY_DURATION = 11;
4621 // Total time for late stage mounting of disk devices during bootup.
4622 // Logged from f/b/services/.../BootReceiver.java.
4623 MOUNT_LATE_DURATION = 12;
4624 // Average time to scan non-system app after OTA
4625 // Logged from f/b/services/.../PackageManagerService.java
4626 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4627 // Time to initialize Package manager after OTA
4628 // Logged from f/b/services/.../PackageManagerService.java
4629 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4630 // Time to scan all system app from Package manager after OTA
4631 // Logged from f/b/services/.../PackageManagerService.java
4632 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4633 // Init's total time for cold boot stage.
4634 // Logged from bootstat.
4635 COLDBOOT_WAIT = 16;
4636 // Init's total time for initializing selinux.
4637 // Logged from bootstat.
4638 SELINUX_INIT = 17;
4639 // Time since last factory reset.
4640 // Logged from bootstat.
4641 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004642 // Init's total time spent for completing the 1st stage.
4643 // Logged from bootstat.
4644 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004645 }
4646
4647 // Type of the event.
4648 optional DurationEvent event = 1;
4649 // Duration of the event in ms.
4650 optional int64 duration_millis = 2;
4651}
4652
4653/**
4654 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4655 * since boot-up.
4656 *
4657 * Logged from: bootstat and various system server components. Check each enums for details.
4658 */
4659message BootTimeEventElapsedTime {
4660 enum ElapsedTimeEvent {
4661 UNKNOWN = 0;
4662 // Time when init starts 1st stage. Logged from bootstat.
4663 ANDROID_INIT_STAGE_1 = 1;
4664 // Time when sys.boot_completed prop is set.
4665 // Logged from bootstat.
4666 BOOT_COMPLETE = 2;
4667 // BOOT_COMPLETE for encrypted device.
4668 BOOT_COMPLETE_ENCRYPTION = 3;
4669 // BOOT_COMPLETE for device with no encryption.
4670 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4671 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004672 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004673 // BOOT_COMPLETE after factory reset.
4674 FACTORY_RESET_BOOT_COMPLETE = 6;
4675 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4676 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004677 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4678 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004679 // BOOT_COMPLETE after OTA.
4680 OTA_BOOT_COMPLETE = 9;
4681 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4682 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004683 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4684 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004685 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4686 // Logged from f/b/services/.../UserController.java
4687 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4688 // Time when the system starts sending BOOT_COMPLETED broadcast.
4689 // Logged from f/b/services/.../UserController.java
4690 FRAMEWORK_BOOT_COMPLETED = 13;
4691 // Time when the package manager starts init.
4692 // Logged from f/b/services/.../SystemServer.java
4693 PACKAGE_MANAGER_INIT_START = 14;
4694 // Time when package manager is ready
4695 // Logged from f/b/services/.../SystemServer.java
4696 PACKAGE_MANAGER_INIT_READY = 15;
4697 // Represents the time when user has entered unlock credential for system with user pin.
4698 // Logged from bootstat.
4699 POST_DECRYPT = 16;
4700 // Represents the start of zygote's init.
4701 // Logged from zygote itself.
4702 ZYGOTE_INIT_START = 17;
4703 // Represents the start of secondary zygote's init.
4704 // TODO: add logging to zygote
4705 SECONDARY_ZYGOTE_INIT_START = 18;
4706 // Represents the start of system server's init.
4707 // Logged from f/b/services/.../SystemServer.java
4708 SYSTEM_SERVER_INIT_START = 19;
4709 // Represents the completion of system server's init.
4710 // Logged from f/b/services/.../SystemServer.java
4711 SYSTEM_SERVER_READY = 20;
4712 // Represents the start of launcher during boot-up.
4713 // TODO: add logging
4714 LAUNCHER_START = 21;
4715 // Represents the completion of launcher's initial rendering. User can use other apps from
4716 // launcher from this point.
4717 // TODO: add logging
4718 LAUNCHER_SHOWN = 22;
4719 }
4720
4721 // Type of the event.
4722 optional ElapsedTimeEvent event = 1;
4723 // Time since bootup for the event.
4724 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4725 optional int64 time_millis = 2;
4726}
4727
4728/**
4729 * Boot time events with UTC time.
4730 *
4731 * Logged from: bootstat and various system server components. Check each enums for details.
4732 */
4733message BootTimeEventUtcTime {
4734 enum UtcTimeEvent {
4735 UNKNOWN = 0;
4736 // Time of the bootstat's marking of 1st boot after the last factory reset.
4737 // Logged from bootstat.
4738 FACTORY_RESET_RESET_TIME = 1;
4739 // The time when bootstat records FACTORY_RESET_* events. This is close to
4740 // BOOT_COMPLETE time for the current bootup.
4741 // Logged from bootstat.
4742 FACTORY_RESET_CURRENT_TIME = 2;
4743 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4744 // Logged from bootstat.
4745 FACTORY_RESET_RECORD_VALUE = 3;
4746 }
4747
4748 // Type of the event.
4749 optional UtcTimeEvent event = 1;
4750 // UTC time for the event.
4751 optional int64 utc_time_secs = 2;
4752}
4753
4754/**
4755 * Boot time events representing specific error code during bootup.
4756 * Meaning of error code can be different per each event type.
4757 *
4758 * Logged from: bootstat and various system server components. Check each enums for details.
4759 */
4760message BootTimeEventErrorCode {
4761 enum ErrorCodeEvent {
4762 UNKNOWN = 0;
4763 // Linux error code for time() call to get the current UTC time.
4764 // Logged from bootstat.
4765 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4766 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4767 // as UMOUNT_STAT_* from init/reboot.cpp.
4768 // Logged from f/b/services/.../BootReceiver.java.
4769 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004770 // Reprepsents fie system mounting error code of /data partition for the current boot.
4771 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004772 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004773 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004774 }
4775
4776 // Type of the event.
4777 optional ErrorCodeEvent event = 1;
4778 // error code defined per each event type.
4779 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4780 // FS_MGR_FS_STAT.
4781 optional int32 error_code = 2;
4782}
4783
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004784/**
4785 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4786 * after an OTA.
4787 *
4788 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004789 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004790 */
4791message SnapshotMergeReported {
4792 // Keep in sync with
4793 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4794 enum UpdateState {
4795 // No update or merge is in progress.
4796 NONE = 0;
4797 // An update is applying; snapshots may already exist.
4798 INITIATED = 1;
4799 // An update is pending, but has not been successfully booted yet.
4800 UNVERIFIED = 2;
4801 // The kernel is merging in the background.
4802 MERGING = 3;
4803 // Post-merge cleanup steps could not be completed due to a transient
4804 // error, but the next reboot will finish any pending operations.
4805 MERGE_NEEDS_REBOOT = 4;
4806 // Merging is complete, and needs to be acknowledged.
4807 MERGE_COMPLETED = 5;
4808 // Merging failed due to an unrecoverable error.
4809 MERGE_FAILED = 6;
4810 // The update was implicitly cancelled, either by a rollback or a flash
4811 // operation via fastboot. This state can only be returned by WaitForMerge.
4812 CANCELLED = 7;
4813 };
4814
4815 // Status of the update after the merge attempts.
4816 optional UpdateState final_state = 1;
4817
4818 // Time to complete a merge operation in milliseconds.
4819 // A negative value corresponds to the case in which the merge operation
4820 // was interrupted and resumed (e.g. in case of a system reboot during the
4821 // merge).
4822 optional int64 duration_millis = 2;
4823
4824 // Number of reboots that occurred after issuing and before completing the
4825 // merge of all the snapshot devices.
4826 optional int32 intermediate_reboots = 3;
4827}
4828
Chenjie Yubbcbc602018-02-05 16:51:52 -08004829//////////////////////////////////////////////////////////////////////
4830// Pulled atoms below this line //
4831//////////////////////////////////////////////////////////////////////
4832
4833/**
David Chenc8a43242017-10-17 16:23:28 -07004834 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4835 *
4836 * Pulled from:
4837 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4838 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004839message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004840 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004841
4842 optional int64 rx_bytes = 2;
4843
4844 optional int64 rx_packets = 3;
4845
4846 optional int64 tx_bytes = 4;
4847
4848 optional int64 tx_packets = 5;
4849}
4850
4851/**
4852 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4853 *
4854 * Pulled from:
4855 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4856 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004857message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004858 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004859
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004860 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4861 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004862
4863 optional int64 rx_bytes = 3;
4864
4865 optional int64 rx_packets = 4;
4866
4867 optional int64 tx_bytes = 5;
4868
4869 optional int64 tx_packets = 6;
4870}
4871
4872/**
4873 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4874 *
4875 * Pulled from:
4876 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4877 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004878message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004879 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004880
4881 optional int64 rx_bytes = 2;
4882
4883 optional int64 rx_packets = 3;
4884
4885 optional int64 tx_bytes = 4;
4886
4887 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004888
4889 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004890}
4891
4892/**
4893 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4894 *
4895 * Pulled from:
4896 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4897 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004898message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004899 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004900
Yao Chenc40a19d2018-03-15 16:48:25 -07004901 // 1 denotes foreground and 0 denotes background. This is called Set in
4902 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004903 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004904
4905 optional int64 rx_bytes = 3;
4906
4907 optional int64 rx_packets = 4;
4908
4909 optional int64 tx_bytes = 5;
4910
4911 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004912
4913 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004914}
4915
4916/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004917 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4918 *
4919 * Pulled from:
4920 * StatsCompanionService
4921 */
4922message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004923 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004924
4925 optional int64 rx_bytes = 2;
4926
4927 optional int64 tx_bytes = 3;
4928}
4929
4930/**
David Chenc8a43242017-10-17 16:23:28 -07004931 * Pulls the kernel wakelock durations. This atom is adapted from
4932 * android/internal/os/KernelWakelockStats.java
4933 *
4934 * Pulled from:
4935 * StatsCompanionService using KernelWakelockReader.
4936 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004937message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004938 optional string name = 1;
4939
4940 optional int32 count = 2;
4941
4942 optional int32 version = 3;
4943
Yangster-maca8a30442018-10-13 23:46:34 -07004944 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004945}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004946
Chenjie Yu05013b32017-11-21 10:21:41 -08004947/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004948 * Pulls low power state information. If power.stats HAL is not available, this
4949 * includes platform and subsystem sleep state information,
4950 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4951 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004952 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004953 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004954 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4955 * as defined in:
4956 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004957 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004958message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004959 // Subsystem name
4960 optional string subsystem_name = 1;
4961 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4962 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004963 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4964 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004965 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004966 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004967 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004968 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004969 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004970}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004971
Chenjie Yu05013b32017-11-21 10:21:41 -08004972/**
Bookatz92da2832018-11-01 18:10:03 -07004973 * Pulls on-device power measurement information.
4974 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4975 * Pulled from:
4976 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4977 */
4978message OnDevicePowerMeasurement {
4979 // Name of the subsystem (to which the rail belongs).
4980 optional string subsystem_name = 1;
4981
4982 // Rail name. The rail lies within the subsystem.
4983 optional string rail_name = 2;
4984
4985 // Time (in ms since boot) at which the rail energy value was measured.
4986 // This may differ slightly from the time that statsd logs this information.
4987 optional uint64 measurement_timestamp_millis = 3;
4988
4989 // Accumulated energy used via the rail since device boot in uWs.
4990 optional uint64 energy_microwatt_secs = 4;
4991}
4992
4993/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004994 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004995 * Pulls the time the cpu spend on the frequency index. Frequency index
4996 * starts from highest to lowest. The value should be monotonically
4997 * increasing since boot. However, if there is a cpu
4998 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004999 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005000message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005001 optional uint32 cluster = 1;
5002 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005003 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005004}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005005
Chenjie Yu05013b32017-11-21 10:21:41 -08005006/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005007 * Pulls Cpu Time Per Uid.
5008 * Note that isolated process uid time should be attributed to host uids.
5009 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005010message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005011 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005012 optional uint64 user_time_micros = 2;
5013 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005014}
5015
5016/**
5017 * Pulls Cpu Time Per Uid per frequency.
5018 * Note that isolated process uid time should be attributed to host uids.
5019 * For each uid, we order the time by descending frequencies.
5020 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005021message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005022 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005023 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005024 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005025}
Hugo Benichi884970e2017-11-14 22:42:46 +09005026
Chenjie Yu05013b32017-11-21 10:21:41 -08005027/**
5028 * Pulls Wifi Controller Activity Energy Info
5029 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005030message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005031 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005032 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005033 // stack reported state
5034 // TODO: replace this with proto enum
5035 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005036 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005037 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005038 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005039 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005040 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005041 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005042 // product of current(mA), voltage(V) and time(ms)
5043 optional uint64 controller_energy_used = 6;
5044}
5045
5046/**
5047 * Pulls Modem Activity Energy Info
5048 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005049message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005050 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005051 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005052 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005053 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005054 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005055 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005056 /**
5057 * Tx power index
5058 * index 0 = tx_power < 0dBm
5059 * index 1 = 0dBm < tx_power < 5dBm
5060 * index 2 = 5dBm < tx_power < 15dBm
5061 * index 3 = 15dBm < tx_power < 20dBm
5062 * index 4 = tx_power > 20dBm
5063 */
5064 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005066 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005067 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005068 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005069 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005070 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005071 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005072 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005073 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005074 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005075 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005076 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005077 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005078}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005079
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005080/**
5081 * Pulls Bluetooth Activity Energy Info
5082 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5083 */
5084message BluetoothActivityInfo {
5085 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005086 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005087 // bluetooth stack state
5088 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005089 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005091 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005092 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005093 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005094 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005095 // product of current(mA), voltage(V) and time(ms)
5096 optional uint64 energy_used = 6;
5097}
5098
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005099/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005100 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005101 *
5102 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005103 */
5104message ProcessMemoryState {
5105 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005106 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005107
5108 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005109 // Usually package name, "system" for system server.
5110 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005111 optional string process_name = 2;
5112
Rafal Slawikda51b932018-12-13 16:31:33 +00005113 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005114 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005115
5116 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005117 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005118
5119 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005120 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005121
Rajeev Kumar90235992018-01-29 11:06:48 -08005122 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005123 // Value is read from memory.stat, field total_rss if per-app memory
5124 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005125 optional int64 rss_in_bytes = 6;
5126
5127 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005128 // Value is read from memory.stat, field total_cache if per-app memory
5129 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005130 optional int64 cache_in_bytes = 7;
5131
5132 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005133 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005134 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005135 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005136
Rafal Slawik203c3db2019-09-25 19:53:01 +01005137 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005138 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005139
Rafal Slawik203c3db2019-09-25 19:53:01 +01005140 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5141 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005142
Rafal Slawik203c3db2019-09-25 19:53:01 +01005143 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5144 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005145}
5146
5147/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005148 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005149 *
5150 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5151 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005152 *
5153 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005154 */
5155message ProcessMemoryHighWaterMark {
5156 // The uid if available. -1 means not available.
5157 optional int32 uid = 1 [(is_uid) = true];
5158
Rafal Slawikda51b932018-12-13 16:31:33 +00005159 // The process name.
5160 // Usually package name or process cmdline.
5161 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005162 optional string process_name = 2;
5163
Rafal Slawik239b6802019-09-09 18:46:01 +01005164 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5165 // computed by converting kilobytes to bytes.
5166 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5167
Rafal Slawik3bea8952018-11-15 12:39:33 +00005168 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5169 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005170 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005171}
5172
5173/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005174 * Logs the memory stats for a process.
5175 *
5176 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5177 * and for selected native processes.
5178 */
5179message ProcessMemorySnapshot {
5180 // The uid if available. -1 means not available.
5181 optional int32 uid = 1 [(is_uid) = true];
5182
5183 // The process name.
5184 // Usually package name or process cmdline.
5185 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5186 optional string process_name = 2;
5187
5188 // The pid of the process.
5189 // Allows to disambiguate instances of the process.
5190 optional int32 pid = 3;
5191
5192 // The current OOM score adjustment value.
5193 // Read from ProcessRecord for managed processes.
5194 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5195 optional int32 oom_score_adj = 4;
5196
5197 // The current RSS of the process.
5198 // VmRSS from /proc/pid/status.
5199 optional int32 rss_in_kilobytes = 5;
5200
5201 // The current anon RSS of the process.
5202 // RssAnon from /proc/pid/status.
5203 optional int32 anon_rss_in_kilobytes = 6;
5204
5205 // The current swap size of the process.
5206 // VmSwap from /proc/pid/status.
5207 optional int32 swap_in_kilobytes = 7;
5208
5209 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5210 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5211}
5212
5213/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005214 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005215 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005216message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005217 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005218}
5219
5220/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005221 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005222 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005223message SystemUptime {
5224 // Milliseconds since the system was booted.
5225 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5226 // for external input).
5227 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005228 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005229}
5230
5231/*
5232 * Reads from /proc/uid_concurrent_active_time which has the format:
5233 * active: X (X is # cores)
5234 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5235 * [uid1]: [time-0] [time-1] [time-2] ... ...
5236 * ...
5237 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5238 * The file contains a monotonically increasing count of time for a single boot.
5239 */
5240message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005241 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005242 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005243}
5244
5245/**
5246 * Reads from /proc/uid_concurrent_policy_time which has the format:
5247 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5248 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5249 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5250 * ...
5251 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5252 * The file contains a monotonically increasing count of time for a single boot.
5253 */
5254message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005255 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005256 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005257 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005258}
5259
5260/*
5261 * Pulls free disk space, for data, system partition and temporary directory.
5262 */
5263message DiskSpace {
5264 // available bytes in data partition
5265 optional uint64 data_available_bytes = 1;
5266 // available bytes in system partition
5267 optional uint64 system_available_bytes = 2;
5268 // available bytes in download cache or temp directories
5269 optional uint64 temp_available_bytes = 3;
5270}
Tej Singhbf972d92018-01-10 20:51:13 -08005271
5272/**
5273 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005274 *
5275 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005276 */
5277message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005278 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005279}
5280
5281/**
5282 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005283 * Pulled from:
5284 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005285 */
5286message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005287 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005288}
5289
5290/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005291 * Pulls battery voltage.
5292 * Pulled from:
5293 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5294 */
5295message BatteryVoltage {
5296 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005297 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005298}
5299
5300/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005301 * Pulls battery level (percent full, from 0 to 100).
5302 *
5303 * Pulled from:
5304 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5305 */
5306message BatteryLevel {
5307 // Battery level. Should be in [0, 100].
5308 optional int32 battery_level = 1;
5309}
5310
5311/**
Tej Singhd89137e2018-03-26 14:51:40 -07005312 * Pulls the temperature of various parts of the device.
5313 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005314 *
Maggie White442b6312019-04-05 16:26:44 -07005315 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005316 */
5317message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005318 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005319 optional android.os.TemperatureTypeEnum sensor_location = 1;
5320
5321 // The name of the temperature source. Eg. CPU0
5322 optional string sensor_name = 2;
5323
Tej Singhd89137e2018-03-26 14:51:40 -07005324 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005325 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005326 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005327
5328 // Relative severity of the throttling, see enum definition.
5329 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005330}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005331
5332/**
5333 * Pulls the statistics of calls to Binder.
5334 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005335 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5336 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005337 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005338 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005339 */
5340message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005341 // UID of the process responsible for the binder transaction. It will be set if the process
5342 // executing the binder transaction attribute the transaction to another uid using
5343 // Binder.setThreadWorkSource().
5344 //
5345 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005346 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005347 // UID of the process executing the binder transaction.
5348 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005349 // Fully qualified class name of the API call.
5350 //
5351 // This is a system server class name.
5352 //
5353 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5354 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5355 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5356 // commonly used APIs.
5357 optional string service_class_name = 2;
5358 // Method name of the API call. It can also be a transaction code if we cannot
5359 // resolve it to a name. See Binder#getTransactionName.
5360 //
5361 // This is a system server method name.
5362 optional string service_method_name = 3;
5363 // Total number of API calls.
5364 optional int64 call_count = 4;
5365 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5366 optional bool screen_interactive = 13;
5367 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5368 // call_count will be equal to recorded_call_count.
5369 //
5370 // If recorded_call_count is different than call_count, it means data collection has been
5371 // sampled. All the fields below will be sampled in this case.
5372 optional int64 recorded_call_count = 12;
5373 // Number of exceptions thrown by the API.
5374 optional int64 recorded_exception_count = 5;
5375 // Total latency of all API calls.
5376 // Average can be computed using total_latency_micros / recorded_call_count.
5377 optional int64 recorded_total_latency_micros = 6;
5378 // Maximum latency of one API call.
5379 optional int64 recorded_max_latency_micros = 7;
5380 // Total CPU usage of all API calls.
5381 // Average can be computed using total_cpu_micros / recorded_call_count.
5382 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5383 optional int64 recorded_total_cpu_micros = 8;
5384 // Maximum CPU usage of one API call.
5385 optional int64 recorded_max_cpu_micros = 9;
5386 // Maximum parcel reply size of one API call.
5387 optional int64 recorded_max_reply_size_bytes = 10;
5388 // Maximum parcel request size of one API call.
5389 optional int64 recorded_max_request_size_bytes = 11;
5390}
5391
5392/**
5393 * Pulls the statistics of exceptions during calls to Binder.
5394 *
5395 * Binder stats are cumulative from boot unless somebody reset the data using
5396 * > adb shell dumpsys binder_calls_stats --reset
5397 */
5398message BinderCallsExceptions {
5399 // Exception class name, e.g. java.lang.IllegalArgumentException.
5400 //
5401 // This is an exception class name thrown by the system server.
5402 optional string exception_class_name = 1;
5403 // Total number of exceptions.
5404 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005405}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005406
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005407/**
5408 * Pulls the statistics of message dispatching on HandlerThreads.
5409 *
5410 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5411 * config on the device.
5412 *
5413 * Next tag: 11
5414 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005415message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005416 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005417 optional int32 uid = 1 [(is_uid) = true];
5418
5419 // Fully qualified class name of the handler target class.
5420 //
5421 // This field does not contain PII. This is a system server class name.
5422 optional string handler_class_name = 2;
5423
5424 // The name of the thread that runs the Looper.
5425 //
5426 // This field does not contain PII. This is a system server thread name.
5427 optional string looper_thread_name = 3;
5428
5429 // The name of the dispatched message.
5430 //
5431 // This field does not contain PII. This is a system server constant or class
5432 // name.
5433 optional string message_name = 4;
5434
5435 // Total number of successfully dispatched messages.
5436 optional int64 message_count = 5;
5437
5438 // Total number of messages that failed dispatching.
5439 optional int64 exception_count = 6;
5440
5441 // Total number of processed messages we have data recorded for. If we
5442 // collected data for all the messages, message_count will be equal to
5443 // recorded_message_count.
5444 //
5445 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005446 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005447 optional int64 recorded_message_count = 7;
5448
5449 // Total latency of all processed messages.
5450 // Average can be computed using recorded_total_latency_micros /
5451 // recorded_message_count.
5452 optional int64 recorded_total_latency_micros = 8;
5453
5454 // Total CPU usage of all processed message.
5455 // Average can be computed using recorded_total_cpu_micros /
5456 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005457 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005458 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005459
5460 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5461 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005462
5463 // Max recorded CPU usage of all processed messages.
5464 optional int64 recorded_max_cpu_micros = 11;
5465
5466 // Max recorded latency of all processed messages.
5467 optional int64 recorded_max_latency_micros = 12;
5468
5469 // Total number of messages we tracked the dispatching delay for. If we
5470 // collected data for all the messages, message_count will be equal to
5471 // recorded_delay_message_count.
5472 //
5473 // If recorded_delay_message_count is different than message_count, it means data
5474 // collection has been sampled or/and not all messages specified the target dispatch time.
5475 // The fields below will be sampled in this case.
5476 optional int64 recorded_delay_message_count = 13;
5477
5478 // Total dispatching delay of all processed messages.
5479 // Calculated as a difference between the target dispatching time (Message.when)
5480 // and the actual dispatching time.
5481 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5482 optional int64 recorded_total_delay_millis = 14;
5483
5484 // Max dispatching delay of all processed messages.
5485 // Calculated as a difference between the target dispatching time (Message.when)
5486 // and the actual dispatching time.
5487 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005488}
Tej Singh86dc9db2018-09-06 00:39:57 +00005489
5490/**
5491 * Pulls disk information, such as write speed and latency.
5492 */
5493message DiskStats {
5494 // Time taken to open, write 512B to, and close a file.
5495 // -1 if error performing the check.
5496 optional int64 data_write_latency_millis = 1;
5497
5498 optional bool file_based_encryption = 2;
5499
5500 // Recent disk write speed in kB/s.
5501 // -1 if error querying storageed.
5502 // 0 if data is unavailable.
5503 optional int32 recent_disk_write_speed = 3;
5504}
5505
5506
5507/**
5508 * Free and total bytes of the Data, Cache, and System partition.
5509 */
5510message DirectoryUsage {
5511 enum Directory {
5512 UNKNOWN = 0;
5513 DATA = 1;
5514 CACHE = 2;
5515 SYSTEM = 3;
5516 }
5517 optional Directory directory = 1;
5518 optional int64 free_bytes = 2;
5519 optional int64 total_bytes = 3;
5520}
5521
5522
5523/**
5524 * Size of an application: apk size, data size, and cache size.
5525 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5526 * Information is only reported for apps with the primary user (user 0).
5527 * Sizes are aggregated by package name.
5528 */
5529message AppSize {
5530 // Including uids will involve modifying diskstats logic.
5531 optional string package_name = 1;
5532 // App size in bytes. -1 if unavailable.
5533 optional int64 app_size_bytes = 2;
5534 // App data size in bytes. -1 if unavailable.
5535 optional int64 app_data_size_bytes = 3;
5536 // App cache size in bytes. -1 if unavailable.
5537 optional int64 app_cache_size_bytes = 4;
5538 // Time that the cache file was produced.
5539 // Uses System.currentTimeMillis(), which is wall clock time.
5540 optional int64 cache_time_millis = 5;
5541}
5542
5543
5544/**
5545 * Size of a particular category. Eg: photos, videos.
5546 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5547 */
5548message CategorySize {
5549 enum Category {
5550 UNKNOWN = 0;
5551 APP_SIZE = 1;
5552 APP_DATA_SIZE = 2;
5553 APP_CACHE_SIZE = 3;
5554 PHOTOS = 4;
5555 VIDEOS = 5;
5556 AUDIO = 6;
5557 DOWNLOADS = 7;
5558 SYSTEM = 8;
5559 OTHER = 9;
5560 }
5561 optional Category category = 1;
5562 // Category size in bytes.
5563 optional int64 size_bytes = 2;
5564 // Time that the cache file was produced.
5565 // Uses System.currentTimeMillis(), which is wall clock time.
5566 optional int64 cache_time_millis = 3;
5567}
Tej Singhd6d6d772018-09-05 17:41:25 -07005568
5569/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005570 * Pulls per uid I/O stats. The stats are cumulative since boot.
5571 *
5572 * Read/write bytes are I/O events from a storage device
5573 * Read/write chars are data requested by read/write syscalls, and can be
5574 * satisfied by caching.
5575 *
5576 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5577 */
5578message DiskIo {
5579 optional int32 uid = 1 [(is_uid) = true];
5580 optional int64 fg_chars_read = 2;
5581 optional int64 fg_chars_write = 3;
5582 optional int64 fg_bytes_read = 4;
5583 optional int64 fg_bytes_write = 5;
5584 optional int64 bg_chars_read = 6;
5585 optional int64 bg_chars_write = 7;
5586 optional int64 bg_bytes_read = 8;
5587 optional int64 bg_bytes_write = 9;
5588 optional int64 fg_fsync = 10;
5589 optional int64 bg_fsync= 11;
5590}
5591
5592
5593/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005594 * Pulls the number of fingerprints for each user.
5595 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005596 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005597 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005598message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005599 // The associated user. Eg: 0 for owners, 10+ for others.
5600 // Defined in android/os/UserHandle.java
5601 optional int32 user = 1;
5602 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005603 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005604}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005605
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005606/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005607 * Pulls the number of faces for each user.
5608 *
5609 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5610 */
5611message NumFacesEnrolled {
5612 // The associated user. Eg: 0 for owners, 10+ for others.
5613 // Defined in android/os/UserHandle.java
5614 optional int32 user = 1;
5615 // Number of faces registered to that user.
5616 optional int32 num_faces_enrolled = 2;
5617}
5618/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005619 * A mapping of role holder -> role
5620 */
5621message RoleHolder {
5622 // uid of the role holder
5623 optional int32 uid = 1 [(is_uid) = true];
5624
5625 // package name of the role holder
5626 optional string package_name = 2;
5627
5628 // the role held
5629 optional string role = 3;
5630}
5631
Yangsteraf9aee72018-10-12 09:26:16 -07005632message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005633 // These are all in byte resolution.
5634 optional int64 min = 1 [deprecated = true];
5635 optional int64 average = 2 [deprecated = true];
5636 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005637
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005638 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5639 // int64 fields.
5640 optional int32 mean_kb = 4;
5641 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005642}
5643
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005644// A reduced subset of process states; reducing the number of possible states allows more
5645// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5646enum ProcessStateAggregated {
5647 PROCESS_STATE_UNKNOWN = 0;
5648 // Persistent system process.
5649 PROCESS_STATE_PERSISTENT = 1;
5650 // Top activity; actually any visible activity.
5651 PROCESS_STATE_TOP = 2;
5652 // Process binding to top or a foreground service.
5653 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5654 // Processing running a foreground service.
5655 PROCESS_STATE_FGS = 4;
5656 // Important foreground process (ime, wallpaper, etc).
5657 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5658 // Important background process.
5659 PROCESS_STATE_BACKGROUND = 6;
5660 // Process running a receiver.
5661 PROCESS_STATE_RECEIVER = 7;
5662 // All kinds of cached processes.
5663 PROCESS_STATE_CACHED = 8;
5664}
5665
5666// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005667message ProcessStatsStateProto {
5668 optional android.service.procstats.ScreenState screen_state = 1;
5669
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005670 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005671
5672 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5673 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005674 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5675
5676 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005677
5678 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005679 optional int64 duration_millis = 4 [deprecated = true];
5680 // Same as above, but with minute resolution so it fits into an int32.
5681 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005682
5683 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005684 optional int64 realtime_duration_millis = 9 [deprecated = true];
5685 // Same as above, but with minute resolution so it fits into an int32.
5686 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005687
5688 // # of samples taken
5689 optional int32 sample_size = 5;
5690
5691 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005692 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005693
5694 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005695 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005696
5697 // RSS is memory resident for this process
5698 optional AggStats rss = 8;
5699}
5700
5701// Next Tag: 7
5702message ProcessStatsProto {
5703 // Name of process.
5704 optional string process = 1;
5705
5706 // Uid of the process.
5707 optional int32 uid = 2;
5708
5709 // Information about how often kills occurred
5710 message Kill {
5711 // Count of excessive CPU kills
5712 optional int32 cpu = 1;
5713
5714 // Count of kills when cached
5715 optional int32 cached = 2;
5716
5717 // PSS stats during cached kill
5718 optional AggStats cached_pss = 3;
5719 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005720 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005721
5722 // Time and memory spent in various states.
5723 repeated ProcessStatsStateProto states = 5;
5724
5725 // Total time process has been running... screen_state, memory_state, and process_state
5726 // will not be set.
5727 optional ProcessStatsStateProto total_running_state = 6;
5728}
5729
5730message PackageServiceOperationStatsProto {
5731 // Operate enum: Started, Foreground, Bound, Executing
5732 optional android.service.procstats.ServiceOperationState operation = 1;
5733
5734 // Number of times the service was in this operation.
5735 optional int32 count = 2;
5736
5737 // Information about a state the service can be in.
5738 message StateStats {
5739 // Screen state enum.
5740 optional android.service.procstats.ScreenState screen_state = 1;
5741 // Memory state enum.
5742 optional android.service.procstats.MemoryState memory_state = 2;
5743
5744 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005745 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005746 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005747 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005748 }
5749 repeated StateStats state_stats = 3;
5750}
5751
5752message PackageServiceStatsProto {
5753 // Name of service component.
5754 optional string service_name = 1;
5755
5756 // The operation stats.
5757 // The package_name, package_uid, package_version, service_name will not be set to save space.
5758 repeated PackageServiceOperationStatsProto operation_stats = 2;
5759}
5760
5761message PackageAssociationSourceProcessStatsProto {
5762 // Uid of the process.
5763 optional int32 process_uid = 1;
5764 // Process name.
5765 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005766 // Package name.
5767 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005768 // Total count of the times this association appeared.
5769 optional int32 total_count = 3;
5770
5771 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005772 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005773
5774 // Total count of the times this association became actively impacting its target process.
5775 optional int32 active_count = 5;
5776
5777 // Information on one source in this association.
5778 message StateStats {
5779 // Process state enum.
5780 optional android.service.procstats.ProcessState process_state = 1;
5781 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005782 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005783 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005784 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005785 }
5786 repeated StateStats active_state_stats = 6;
5787}
5788
5789message PackageAssociationProcessStatsProto {
5790 // Name of the target component.
5791 optional string component_name = 1;
5792 // Information on one source in this association.
5793 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5794}
5795
5796
5797message ProcessStatsPackageProto {
5798 // Name of package.
5799 optional string package = 1;
5800
5801 // Uid of the package.
5802 optional int32 uid = 2;
5803
5804 // Version of the package.
5805 optional int64 version = 3;
5806
5807 // Stats for each process running with the package loaded in to it.
5808 repeated ProcessStatsProto process_stats = 4;
5809
5810 // Stats for each of the package's services.
5811 repeated PackageServiceStatsProto service_stats = 5;
5812
5813 // Stats for each association with the package.
5814 repeated PackageAssociationProcessStatsProto association_stats = 6;
5815}
5816
5817message ProcessStatsSectionProto {
5818 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005819 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005820
5821 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005822 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005823
5824 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005825 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005826
5827 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005828 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005829
5830 // System runtime library. e.g. "libdvm.so", "libart.so".
5831 optional string runtime = 5;
5832
5833 // whether kernel reports swapped pss.
5834 optional bool has_swapped_pss = 6;
5835
5836 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5837 enum Status {
5838 STATUS_UNKNOWN = 0;
5839 STATUS_COMPLETE = 1;
5840 STATUS_PARTIAL = 2;
5841 STATUS_SHUTDOWN = 3;
5842 STATUS_SYSPROPS = 4;
5843 }
5844 repeated Status status = 7;
5845
Chenjie Yub2ecc792019-01-17 10:27:26 -08005846 // Number of pages available of various types and sizes, representation fragmentation.
5847 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5848
Yangsteraf9aee72018-10-12 09:26:16 -07005849 // Stats for each process.
5850 repeated ProcessStatsProto process_stats = 8;
5851
5852 // Stats for each package.
5853 repeated ProcessStatsPackageProto package_stats = 9;
5854}
5855
Chenjie Yub2ecc792019-01-17 10:27:26 -08005856message ProcessStatsAvailablePagesProto {
5857 // Node these pages are in (as per /proc/pagetypeinfo)
5858 optional int32 node = 1;
5859
5860 // Zone these pages are in (as per /proc/pagetypeinfo)
5861 optional string zone = 2;
5862
5863 // Label for the type of these pages (as per /proc/pagetypeinfo)
5864 optional string label = 3;
5865
5866 // Distribution of number of pages available by order size. First entry in array is
5867 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5868 repeated int32 pages_per_order = 4;
5869}
5870
Chenjie Yu12e5e672018-09-14 15:54:59 -07005871/**
5872 * Pulled from ProcessStatsService.java
5873 */
5874message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005875 optional ProcessStatsSectionProto proc_stats_section = 1;
5876}
5877
Chenjie Yuf910b7802019-01-11 16:08:20 -08005878/**
5879 * Pulled from ProcessStatsService.java
5880 */
5881message ProcStatsPkgProc {
5882 optional ProcessStatsSectionProto proc_stats_section = 1;
5883}
5884
Chris Wrencdea3b72019-11-22 16:58:17 -05005885// Next Tag: 2
5886message PackageRemoteViewInfoProto {
5887 optional string package_name = 1;
5888 // add per-package additional info here (like channels)
5889}
5890
5891// Next Tag: 2
5892message NotificationRemoteViewsProto {
5893 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5894}
5895
5896/**
5897 * Pulled from NotificationManagerService.java
5898 */
5899message NotificationRemoteViews {
5900 optional NotificationRemoteViewsProto notification_remote_views = 1;
5901}
5902
Yotam Aron74299972020-01-16 16:20:58 +02005903/**
5904 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5905 */
5906message PackageNotificationPreferences {
5907 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005908 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005909 // Notification importance, which specifies when and how a notification is displayed.
5910 // Specified under core/java/android/app/NotificationManager.java.
5911 optional int32 importance = 2;
5912 // Lockscreen visibility as set by the user.
5913 optional int32 visibility = 3;
5914 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5915 // PreferencesHelper.java)
5916 optional int32 user_locked_fields = 4;
5917}
5918
5919/**
5920 * Atom that contains a list of a package's channel preferences, pulled from
5921 * NotificationManagerService.java.
5922 */
5923message PackageNotificationChannelPreferences {
5924 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005925 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005926 // Channel's ID. Should always be available.
5927 optional string channel_id = 2;
5928 // Channel's name. Should always be available.
5929 optional string channel_name = 3;
5930 // Channel's description. Optionally set by the channel creator.
5931 optional string description = 4;
5932 // Notification importance, which specifies when and how a notification is displayed. Specified
5933 // under core/java/android/app/NotificationManager.java.
5934 optional int32 importance = 5;
5935 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5936 // at core/java/android/app/NotificationChannel.java
5937 optional int32 user_locked_fields = 6;
5938 // Indicates if the channel was deleted by the app.
5939 optional bool is_deleted = 7;
5940}
5941
5942/**
5943 * Atom that contains a list of a package's channel group preferences, pulled from
5944 * NotificationManagerService.java.
5945 */
5946message PackageNotificationChannelGroupPreferences {
5947 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005948 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005949 // Channel Group's ID. Should always be available.
5950 optional string group_id = 2;
5951 // Channel Group's name. Should always be available.
5952 optional string group_name = 3;
5953 // Channel Group's description. Optionally set by group creator.
5954 optional string description = 4;
5955 // Indicates if notifications from this channel group are blocked.
5956 optional bool is_blocked = 5;
5957 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5958 // at core/java/android/app/NotificationChannelGroup.java
5959 optional int32 user_locked_fields = 6;
5960}
5961
Yangsteraf9aee72018-10-12 09:26:16 -07005962message PowerProfileProto {
5963 optional double cpu_suspend = 1;
5964
5965 optional double cpu_idle = 2;
5966
5967 optional double cpu_active = 3;
5968
5969 message CpuCluster {
5970 optional int32 id = 1;
5971 optional double cluster_power = 2;
5972 optional int32 cores = 3;
5973 repeated int64 speed = 4;
5974 repeated double core_power = 5;
5975 }
5976
5977 repeated CpuCluster cpu_cluster = 40;
5978
5979 optional double wifi_scan = 4;
5980
5981 optional double wifi_on = 5;
5982
5983 optional double wifi_active = 6;
5984
5985 optional double wifi_controller_idle = 7;
5986
5987 optional double wifi_controller_rx = 8;
5988
5989 optional double wifi_controller_tx = 9;
5990
5991 repeated double wifi_controller_tx_levels = 10;
5992
5993 optional double wifi_controller_operating_voltage = 11;
5994
5995 optional double bluetooth_controller_idle = 12;
5996
5997 optional double bluetooth_controller_rx = 13;
5998
5999 optional double bluetooth_controller_tx = 14;
6000
6001 optional double bluetooth_controller_operating_voltage = 15;
6002
6003 optional double modem_controller_sleep = 16;
6004
6005 optional double modem_controller_idle = 17;
6006
6007 optional double modem_controller_rx = 18;
6008
6009 repeated double modem_controller_tx = 19;
6010
6011 optional double modem_controller_operating_voltage = 20;
6012
6013 optional double gps_on = 21;
6014
6015 repeated double gps_signal_quality_based = 22;
6016
6017 optional double gps_operating_voltage = 23;
6018
6019 optional double bluetooth_on = 24;
6020
6021 optional double bluetooth_active = 25;
6022
6023 optional double bluetooth_at_cmd = 26;
6024
6025 optional double ambient_display = 27;
6026
6027 optional double screen_on = 28;
6028
6029 optional double radio_on = 29;
6030
6031 optional double radio_scanning = 30;
6032
6033 optional double radio_active = 31;
6034
6035 optional double screen_full = 32;
6036
6037 optional double audio = 33;
6038
6039 optional double video = 34;
6040
6041 optional double flashlight = 35;
6042
6043 optional double memory = 36;
6044
6045 optional double camera = 37;
6046
6047 optional double wifi_batched_scan = 38;
6048
6049 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006050}
Chenjie Yuab530202018-09-26 12:39:20 -07006051
6052/**
6053 * power_profile.xml and other constants for power model calculations.
6054 * Pulled from PowerProfile.java
6055 */
6056message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006057 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006058}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006059
6060/**
arangelovd5db50e2018-10-12 20:24:39 +01006061 * Logs when a user restriction was added or removed.
6062 *
6063 * Logged from:
6064 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6065 */
6066message UserRestrictionChanged {
6067 // The raw string of the user restriction as defined in UserManager.
6068 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6069 optional string restriction = 1;
6070 // Whether the restriction is enabled or disabled.
6071 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006072}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006073
6074/**
6075 * Pulls process user time and system time. Puller takes a snapshot of all pids
6076 * in the system and returns cpu stats for those that are working at the time.
6077 * Dead pids will be dropped. Kernel processes are excluded.
6078 * Min cool-down is 5 sec.
6079 */
6080message ProcessCpuTime {
6081 optional int32 uid = 1 [(is_uid) = true];
6082
6083 optional string process_name = 2;
6084 // Process cpu time in user space, cumulative from boot/process start
6085 optional int64 user_time_millis = 3;
6086 // Process cpu time in system space, cumulative from boot/process start
6087 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006088}
Misha Wagner5a51e002018-10-03 15:04:09 +01006089
6090/**
6091 * Pulls the CPU usage for each thread.
6092 *
6093 * Read from /proc/$PID/task/$TID/time_in_state files.
6094 *
6095 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6096 * time_in_state files not being present on some phones, have not been addressed. These should be
6097 * considered before a public release.
6098 */
6099message CpuTimePerThreadFreq {
6100 // UID that owns the process.
6101 optional int32 uid = 1 [(is_uid) = true];
6102 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006103 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006104 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006105 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006106 // Name of the process taken from `/proc/$PID/cmdline`.
6107 optional string process_name = 4;
6108 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6109 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006110
6111 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6112 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6113 // frequencies are given here as the alternative is sending eight separate atoms. This method
6114 // significantly reduces the amount of data created
6115 optional int32 frequency1_khz = 6;
6116 optional int32 time1_millis = 7;
6117 optional int32 frequency2_khz = 8;
6118 optional int32 time2_millis = 9;
6119 optional int32 frequency3_khz = 10;
6120 optional int32 time3_millis = 11;
6121 optional int32 frequency4_khz = 12;
6122 optional int32 time4_millis = 13;
6123 optional int32 frequency5_khz = 14;
6124 optional int32 time5_millis = 15;
6125 optional int32 frequency6_khz = 16;
6126 optional int32 time6_millis = 17;
6127 optional int32 frequency7_khz = 18;
6128 optional int32 time7_millis = 19;
6129 optional int32 frequency8_khz = 20;
6130 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006131}
Bookatz75ee60422018-11-09 12:27:37 -08006132
6133/**
Bookatz366a4432018-11-20 09:42:33 -08006134 * Pulls information about the device's build.
6135 */
6136message BuildInformation {
6137 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6138 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6139 optional string fingerprint = 1;
6140
6141 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6142 optional string brand = 2;
6143
6144 // Build.PRODUCT. The name of the overall product.
6145 optional string product = 3;
6146
6147 // Build.DEVICE. The name of the industrial design.
6148 optional string device = 4;
6149
6150 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6151 optional string version_release = 5;
6152
6153 // Build.ID. E.g. a label like "M4-rc20".
6154 optional string id = 6;
6155
6156 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6157 // represent this build.
6158 optional string version_incremental = 7;
6159
6160 // Build.TYPE. The type of build, like "user" or "eng".
6161 optional string type = 8;
6162
6163 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6164 optional string tags = 9;
6165}
6166
6167/**
Adam He420947c2019-01-23 15:59:09 -08006168 * Logs information about mismatched caller for content capture.
6169 *
6170 * Logged from:
6171 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6172 */
6173message ContentCaptureCallerMismatchReported {
6174 optional string intended_package = 1;
6175 optional string calling_package = 2;
6176}
6177
6178/**
6179 * Logs information about content capture service events.
6180 *
6181 * Logged from:
6182 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6183 */
6184message ContentCaptureServiceEvents {
6185 // The type of event.
6186 enum Event {
6187 UNKNOWN = 0;
6188 ON_CONNECTED = 1;
6189 ON_DISCONNECTED = 2;
6190 SET_WHITELIST = 3;
6191 SET_DISABLED = 4;
6192 ON_USER_DATA_REMOVED = 5;
6193 }
6194 optional Event event = 1;
6195 // component/package of content capture service.
6196 optional string service_info = 2;
6197 // component/package of target.
6198 // it's a concatenated list of component/package for SET_WHITELIST event
6199 // separated by " ".
6200 optional string target_info = 3;
6201}
6202
6203/**
6204 * Logs information about content capture session events.
6205 *
6206 * Logged from:
6207 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6208 */
6209message ContentCaptureSessionEvents {
6210 // The type of event.
6211 enum Event {
6212 UNKNOWN = 0;
6213 ON_SESSION_STARTED = 1;
6214 ON_SESSION_FINISHED = 2;
6215 SESSION_NOT_CREATED = 3;
6216 }
6217 optional int32 session_id = 1;
6218 optional Event event = 2;
6219 // (n/a on session finished)
6220 optional int32 state_flags = 3;
6221 // component/package of content capture service.
6222 optional string service_info = 4;
6223 // component/package of app.
6224 // (n/a on session finished)
6225 optional string app_info = 5;
6226 optional bool is_child_session = 6;
6227}
6228
6229/**
6230 * Logs information about session being flushed.
6231 *
6232 * Logged from:
6233 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6234 */
6235message ContentCaptureFlushed {
6236 optional int32 session_id = 1;
6237 // component/package of content capture service.
6238 optional string service_info = 2;
6239 // component/package of app.
6240 optional string app_info = 3;
6241 // session start/finish events
6242 optional int32 child_session_started = 4;
6243 optional int32 child_session_finished = 5;
6244 // count of view events.
6245 optional int32 view_appeared_count = 6;
6246 optional int32 view_disappeared_count = 7;
6247 optional int32 view_text_changed_count = 8;
6248
6249 // Flush stats.
6250 optional int32 max_events = 9;
6251 optional int32 idle_flush_freq = 10;
6252 optional int32 text_flush_freq = 11;
6253 optional int32 flush_reason = 12;
6254}
6255
6256/**
Bookatz75ee60422018-11-09 12:27:37 -08006257 * Pulls on-device BatteryStats power use calculations for the overall device.
6258 */
6259message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006260 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6261 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6262 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6263 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006264}
6265
6266/**
6267 * Pulls on-device BatteryStats power use calculations broken down by uid.
6268 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6269 * that is attributed to non-uid items. They must all be included to get the total power use.
6270 */
6271message DeviceCalculatedPowerBlameUid {
6272 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6273 optional int32 uid = 1 [(is_uid) = true];
6274
Bookatz3dbc13a2018-12-21 12:16:51 -08006275 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6276 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6277 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006278}
6279
6280/**
6281 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6282 * drain type.
6283 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6284 * is attributed uids. They must all be included to get the total power use.
6285 */
6286message DeviceCalculatedPowerBlameOther {
6287 // The type of item whose power use is being reported.
6288 enum DrainType {
6289 AMBIENT_DISPLAY = 0;
6290 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6291 BLUETOOTH = 2;
6292 CAMERA = 3;
6293 // Cell-standby
6294 CELL = 4;
6295 FLASHLIGHT = 5;
6296 IDLE = 6;
6297 MEMORY = 7;
6298 // Amount that total computed drain exceeded the drain estimated using the
6299 // battery level changes and capacity.
6300 OVERCOUNTED = 8;
6301 PHONE = 9;
6302 SCREEN = 10;
6303 // Amount that total computed drain was below the drain estimated using the
6304 // battery level changes and capacity.
6305 UNACCOUNTED = 11;
6306 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6307 WIFI = 13;
6308 }
6309 optional DrainType drain_type = 1;
6310
Bookatz3dbc13a2018-12-21 12:16:51 -08006311 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6312 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6313 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006314}
arangelov4e994062018-11-13 16:12:38 +00006315
6316/**
6317 * Logs device policy features.
6318 *
6319 * Logged from:
6320 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6321 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6322 */
6323message DevicePolicyEvent {
6324 // The event id - unique for each event.
6325 optional android.stats.devicepolicy.EventId event_id = 1;
6326 // The admin package name.
6327 optional string admin_package_name = 2;
6328 // A generic integer parameter.
6329 optional int32 integer_value = 3;
6330 // A generic boolean parameter.
6331 optional bool boolean_value = 4;
6332 // A parameter specifying a time period in milliseconds.
6333 optional uint64 time_period_millis = 5;
6334 // A parameter specifying a list of package names, bundle extras or string parameters.
6335 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6336}
shawnlinea5b66b2018-11-13 15:05:29 +08006337
6338/**
6339 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6340 *
6341 * Logged from:
6342 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6343 */
6344message DocsUILaunchReported {
6345 optional android.stats.docsui.LaunchAction launch_action = 1;
6346 optional bool has_initial_uri = 2;
6347 optional android.stats.docsui.MimeType mime_type = 3;
6348 optional android.stats.docsui.Root initial_root = 4;
6349}
6350
6351/**
6352 * Logs root/app visited event in file managers/picker. Call this when the user
6353 * taps on root/app in hamburger menu.
6354 *
6355 * Logged from:
6356 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6357 */
6358message DocsUIRootVisitedReported {
6359 optional android.stats.docsui.ContextScope scope = 1;
6360 optional android.stats.docsui.Root root = 2;
6361}
6362
6363/**
6364 * Logs file operation stats. Call this when a file operation has completed.
6365 *
6366 * Logged from:
6367 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6368 */
6369message DocsUIFileOperationReported {
6370 optional android.stats.docsui.Provider provider = 1;
6371 optional android.stats.docsui.FileOperation file_op = 2;
6372}
6373
6374/**
6375 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6376 * mode.
6377 *
6378 * Logged from:
6379 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6380 */
6381message DocsUIFileOperationCopyMoveModeReported {
6382 optional android.stats.docsui.FileOperation file_op = 1;
6383 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6384}
6385
6386
6387/**
6388 * Logs file sub operation stats. Call this when a file operation has failed.
6389 *
6390 * Logged from:
6391 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6392 */
6393message DocsUIFileOperationFailureReported {
6394 optional android.stats.docsui.Authority authority = 1;
6395 optional android.stats.docsui.SubFileOperation sub_op = 2;
6396}
6397
6398/**
6399* Logs the cancellation of a file operation. Call this when a job is canceled
6400*
6401* Logged from:
6402* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6403*/
6404message DocsUIFileOperationCanceledReported {
6405 optional android.stats.docsui.FileOperation file_op = 1;
6406}
6407
6408/**
6409 * Logs startup time in milliseconds.
6410 *
6411 * Logged from:
6412 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6413 */
6414message DocsUIStartupMsReported {
6415 optional int32 startup_millis = 1;
6416}
6417
6418/**
6419 * Logs the action that was started by user.
6420 *
6421 * Logged from:
6422 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6423 */
6424message DocsUIUserActionReported {
6425 optional android.stats.docsui.UserAction action = 1;
6426}
6427
6428/**
6429 * Logs the invalid type when invalid scoped access is requested.
6430 *
6431 * Logged from:
6432 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6433 */
6434message DocsUIInvalidScopedAccessRequestReported {
6435 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006436}
Ben Murdochbab399f62018-12-06 11:01:38 +00006437
6438/**
shawnlina75e82d2019-01-07 10:31:12 +08006439 * Logs the package name that launches docsui picker mode.
6440 *
6441 * Logged from:
6442 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6443 */
6444message DocsUIPickerLaunchedFromReported {
6445 optional string package_name = 1;
6446}
6447
6448/**
6449 * Logs the search type.
6450 *
6451 * Logged from:
6452 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6453 */
6454message DocsUISearchTypeReported {
6455 optional android.stats.docsui.SearchType search_type = 1;
6456}
6457
6458/**
6459 * Logs the search mode.
6460 *
6461 * Logged from:
6462 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6463 */
6464message DocsUISearchModeReported {
6465 optional android.stats.docsui.SearchMode search_mode = 1;
6466}
6467
6468/**
6469 * Logs the pick result information.
6470 *
6471 * Logged from:
6472 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6473 */
6474message DocsUIPickResultReported {
6475 optional int32 total_action_count = 1;
6476 optional int64 duration_millis = 2;
6477 optional int32 file_count= 3;
6478 optional bool is_searching = 4;
6479 optional android.stats.docsui.Root picked_from = 5;
6480 optional android.stats.docsui.MimeType mime_type = 6;
6481 optional int32 repeatedly_pick_times = 7;
6482}
6483
6484/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006485 * Logs when an app's memory is compacted.
6486 *
6487 * Logged from:
6488 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6489 */
6490message AppCompacted {
6491 // The pid of the process being compacted.
6492 optional int32 pid = 1;
6493
6494 // The name of the process being compacted.
6495 optional string process_name = 2;
6496
6497 // The type of compaction.
6498 enum Action {
6499 UNKNOWN = 0;
6500 SOME = 1;
6501 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006502 PERSISTENT = 3;
6503 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006504 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006505 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006506
6507 // Total RSS in kilobytes consumed by the process prior to compaction.
6508 optional int64 before_rss_total_kilobytes = 4;
6509
6510 // File RSS in kilobytes consumed by the process prior to compaction.
6511 optional int64 before_rss_file_kilobytes = 5;
6512
6513 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6514 optional int64 before_rss_anon_kilobytes = 6;
6515
6516 // Swap in kilobytes consumed by the process prior to compaction.
6517 optional int64 before_swap_kilobytes = 7;
6518
6519 // Total RSS in kilobytes consumed by the process after compaction.
6520 optional int64 after_rss_total_kilobytes = 8;
6521
6522 // File RSS in kilobytes consumed by the process after compaction.
6523 optional int64 after_rss_file_kilobytes = 9;
6524
6525 // Anonymous RSS in kilobytes consumed by the process after compaction.
6526 optional int64 after_rss_anon_kilobytes = 10;
6527
6528 // Swap in kilobytes consumed by the process after compaction.
6529 optional int64 after_swap_kilobytes = 11;
6530
6531 // The time taken to perform compaction in milliseconds.
6532 optional int64 time_to_compact_millis = 12;
6533
6534 // The last compaction action performed for this app.
6535 optional Action last_action = 13;
6536
Ben Murdoch01720b82018-12-19 18:03:44 +00006537 // The last time that compaction was attempted on this process in milliseconds
6538 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6539 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006540
Ben Murdoch885c21b2019-03-15 18:02:04 +00006541 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006542 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006543
6544 // The process state at the time of compaction.
6545 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006546
6547 // Free ZRAM in kilobytes before compaction.
6548 optional int64 before_zram_free_kilobytes = 17;
6549
6550 // Free ZRAM in kilobytes after compaction.
6551 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006552}
lifr157fc552018-12-12 16:38:04 +08006553
6554/**
lifrb6b90b62019-03-29 00:40:17 +08006555 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6556 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6557 *
lifr1f74b052019-04-16 22:16:30 +08006558 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6559 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6560 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6561 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006562 */
6563message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006564 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006565
lifr1f74b052019-04-16 22:16:30 +08006566 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006567
6568 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006569 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006570
lifr1f74b052019-04-16 22:16:30 +08006571 // Only valid for event_type = EVENT_GETADDRINFO.
6572 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006573
lifr1f74b052019-04-16 22:16:30 +08006574 // Flags passed to android_res_nsend() defined in multinetwork.h
6575 // Only valid for event_type = EVENT_RESNSEND.
6576 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006577
lifrad9becc2019-05-20 11:04:41 +08006578 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006579
6580 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006581 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006582
6583 // Additional pass-through fields opaque to statsd.
6584 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006585 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006586
6587 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6588 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006589}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006590
6591/**
6592 * Logs when a data stall event occurs.
6593 *
6594 * Log from:
6595 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6596 */
6597message DataStallEvent {
6598 // Data stall evaluation type.
6599 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6600 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6601 optional int32 evaluation_type = 1;
6602 // See definition in data_stall_event.proto.
6603 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6604 // See definition in data_stall_event.proto.
6605 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6606 // See definition in data_stall_event.proto.
6607 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6608 // See definition in data_stall_event.proto.
6609 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6610 // See definition in data_stall_event.proto.
6611 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6612}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006613
6614/*
6615 * Logs when RescueParty resets some set of experiment flags.
6616 *
6617 * Logged from:
6618 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6619 */
6620message RescuePartyResetReported {
6621 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6622 optional int32 rescue_level = 1;
6623}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006624
6625/**
6626 * Logs when signed config is received from an APK, and if that config was applied successfully.
6627 * Logged from:
6628 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6629 */
6630message SignedConfigReported {
6631 enum Type {
6632 UNKNOWN_TYPE = 0;
6633 GLOBAL_SETTINGS = 1;
6634 }
6635 optional Type type = 1;
6636
6637 // The final status of the signed config received.
6638 enum Status {
6639 UNKNOWN_STATUS = 0;
6640 APPLIED = 1;
6641 BASE64_FAILURE_CONFIG = 2;
6642 BASE64_FAILURE_SIGNATURE = 3;
6643 SECURITY_EXCEPTION = 4;
6644 INVALID_CONFIG = 5;
6645 OLD_CONFIG = 6;
6646 SIGNATURE_CHECK_FAILED = 7;
6647 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006648 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006649 }
6650 optional Status status = 2;
6651
6652 // The version of the signed config processed.
6653 optional int32 version = 3;
6654
6655 // The package name that the config was extracted from.
6656 optional string from_package = 4;
6657
6658 enum Key {
6659 NO_KEY = 0;
6660 DEBUG = 1;
6661 PRODUCTION = 2;
6662 }
6663 // Which key was used to verify the config.
6664 optional Key verified_with = 5;
6665}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006666
6667/*
6668 * Logs GNSS Network-Initiated (NI) location events.
6669 *
6670 * Logged from:
6671 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6672 */
6673message GnssNiEventReported {
6674 // The type of GnssNiEvent.
6675 enum EventType {
6676 UNKNOWN = 0;
6677 NI_REQUEST = 1;
6678 NI_RESPONSE = 2;
6679 }
6680 optional EventType event_type = 1;
6681
6682 // An ID generated by HAL to associate NI notifications and UI responses.
6683 optional int32 notification_id = 2;
6684
6685 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006686 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006687
6688 // NI requires notification.
6689 optional bool need_notify = 4;
6690
6691 // NI requires verification.
6692 optional bool need_verify = 5;
6693
6694 // NI requires privacy override, no notification/minimal trace.
6695 optional bool privacy_override = 6;
6696
6697 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6698 // seconds.
6699 optional int32 timeout = 7;
6700
6701 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006702 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006703
6704 // String representing the requester of the network inititated location request.
6705 optional string requestor_id = 9;
6706
6707 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6708 // network initiated location request.
6709 optional string text = 10;
6710
6711 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006712 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006713
6714 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006715 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006716
6717 // True if SUPL ES is enabled.
6718 optional bool is_supl_es_enabled = 13;
6719
6720 // True if GNSS location is enabled.
6721 optional bool is_location_enabled = 14;
6722
6723 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006724 optional android.server.location.GnssUserResponseType user_response = 15;
6725}
6726
6727/**
6728 * Logs GNSS non-framework (NFW) location notification.
6729 *
6730 * Logged from:
6731 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6732 */
6733message GnssNfwNotificationReported {
6734 // Package name of the Android proxy application representing the non-framework entity that
6735 // requested location. Set to empty string if unknown.
6736 optional string proxy_app_package_name = 1;
6737
6738 // Protocol stack that initiated the non-framework location request.
6739 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6740
6741 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6742 // set to empty string. This field is opaque to the framework and used for logging purposes.
6743 optional string other_protocol_stack_name = 3;
6744
6745 // Source initiating/receiving the location information.
6746 optional android.server.location.NfwRequestor requestor = 4;
6747
6748 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6749 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6750 // and used for logging purposes.
6751 optional string requestor_id = 5;
6752
6753 // Indicates whether location information was provided for this request.
6754 optional android.server.location.NfwResponseType response_type = 6;
6755
6756 // True if the device is in user initiated emergency session.
6757 optional bool in_emergency_mode = 7;
6758
6759 // True if cached location is provided.
6760 optional bool is_cached_location = 8;
6761
6762 // True if proxy app permission mismatch between framework and GNSS HAL.
6763 optional bool is_permission_mismatched = 9;
6764}
6765
6766/**
6767 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6768 *
6769 * Logged from:
6770 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6771 */
6772message GnssConfigurationReported {
6773 // SUPL host name.
6774 optional string supl_host = 1;
6775
6776 // SUPL port number.
6777 optional int32 supl_port = 2;
6778
6779 // C2K host name.
6780 optional string c2k_host = 3;
6781
6782 // C2K port number.
6783 optional int32 c2k_port = 4;
6784
6785 // The SUPL version requested by Carrier.
6786 optional int32 supl_ver = 5;
6787
6788 // The SUPL mode.
6789 optional android.server.location.SuplMode supl_mode = 6;
6790
6791 // True if NI emergency SUPL restrictions is enabled.
6792 optional bool supl_es = 7;
6793
6794 // LTE Positioning Profile settings
6795 optional android.server.location.LppProfile lpp_profile = 8;
6796
6797 // Positioning protocol on A-Glonass system.
6798 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6799
6800 // True if emergency PDN is used. Otherwise, regular PDN is used.
6801 optional bool use_emergency_pdn_for_emergency_supl= 10;
6802
6803 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6804 optional android.server.location.GpsLock gps_lock = 11;
6805
6806 // Number of seconds to extend the emergency session duration post emergency call.
6807 optional int32 es_extension_sec = 12;
6808
6809 // The full list of package names of proxy Android applications representing the non-framework
6810 // location access entities (on/off the device) for which the framework user has granted
6811 // non-framework location access permission. The package names are concatenated in one string
6812 // with spaces as separators.
6813 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006814}
Jack Yu95b64f32018-12-13 18:26:11 +08006815
6816/**
6817 * Logs when a NFC device's error occurred.
6818 * Logged from:
6819 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6820 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6821 */
6822message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006823 enum Type {
6824 UNKNOWN = 0;
6825 CMD_TIMEOUT = 1;
6826 ERROR_NOTIFICATION = 2;
6827 AID_OVERFLOW = 3;
6828 }
6829 optional Type type = 1;
6830 // If it's nci cmd timeout, log the timeout command.
6831 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006832
Alex Salod7c3eef2019-01-25 14:43:27 -08006833 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006834}
6835
6836/**
6837 * Logs when a NFC device's state changed event
6838 * Logged from:
6839 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6840 */
6841message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006842 enum State {
6843 UNKNOWN = 0;
6844 OFF = 1;
6845 ON = 2;
6846 ON_LOCKED = 3; // Secure Nfc enabled.
6847 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6848 }
6849 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006850}
6851
6852/**
6853 * Logs when a NFC Beam Transaction occurred.
6854 * Logged from:
6855 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6856 */
6857message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006858 enum Operation {
6859 UNKNOWN = 0;
6860 SEND = 1;
6861 RECEIVE = 2;
6862 }
6863 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006864}
6865
6866/**
6867 * Logs when a NFC Card Emulation Transaction occurred.
6868 * Logged from:
6869 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6870 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6871 */
6872message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006873 enum Category {
6874 UNKNOWN = 0;
6875 HCE_PAYMENT = 1;
6876 HCE_OTHER = 2;
6877 OFFHOST = 3;
6878 }
6879 // Transaction belongs to HCE payment or HCE other category, or offhost.
6880 optional Category category = 1;
6881 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6882 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006883}
6884
6885/**
6886 * Logs when a NFC Tag event occurred.
6887 * Logged from:
6888 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6889 */
6890message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006891 enum Type {
6892 UNKNOWN = 0;
6893 URL = 1;
6894 BT_PAIRING = 2;
6895 PROVISION = 3;
6896 WIFI_CONNECT = 4;
6897 APP_LAUNCH = 5;
6898 OTHERS = 6;
6899 }
6900 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006901}
6902
6903/**
6904 * Logs when Hce transaction triggered
6905 * Logged from:
6906 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6907 */
6908message NfcHceTransactionOccurred {
6909 // The latency period(in microseconds) it took for the first HCE data
6910 // exchange.
6911 optional uint32 latency_micros = 1;
6912}
6913
6914/**
6915 * Logs when SecureElement state event changed
6916 * Logged from:
6917 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6918 */
6919message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006920 enum State {
6921 UNKNOWN = 0;
6922 INITIALIZED = 1;
6923 DISCONNECTED = 2;
6924 CONNECTED = 3;
6925 HALCRASH = 4;
6926 }
6927 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006928
Alex Salod7c3eef2019-01-25 14:43:27 -08006929 optional string state_change_reason = 2;
6930 // SIMx or eSEx.
6931 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006932}
6933
6934/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006935 * Information about a permission grant request
6936 */
6937message PermissionGrantRequestResultReported {
6938 // unique value identifying an API call. A API call might result in multiple of these atoms
6939 optional int64 request_id = 1;
6940
6941 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006942 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006943
6944 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006945 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006946
6947 // The permission to be granted
6948 optional string permission_name = 4;
6949
6950 // If the permission was explicitly requested via the API or added by the system
6951 optional bool is_implicit = 5;
6952
6953 enum Result {
6954 UNDEFINED = 0;
6955 // permission request was ignored
6956 IGNORED = 1;
6957 // permission request was ignored because it was user fixed
6958 IGNORED_USER_FIXED = 2;
6959 // permission request was ignored because it was policy fixed
6960 IGNORED_POLICY_FIXED = 3;
6961 // permission was granted by user action
6962 USER_GRANTED = 4;
6963 // permission was automatically granted
6964 AUTO_GRANTED = 5;
6965 // permission was denied by user action
6966 USER_DENIED = 6;
6967 // permission was denied with prejudice by the user
6968 USER_DENIED_WITH_PREJUDICE = 7;
6969 // permission was automatically denied
6970 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006971 // permission request was ignored because permission is restricted
6972 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006973 // one time permission was granted by user action
6974 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006975 // user ignored request by leaving the request screen without choosing any option
6976 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006977 // user granted the permission after being linked to settings
6978 USER_GRANTED_IN_SETTINGS = 12;
6979 // user denied the permission after being linked to settings
6980 USER_DENIED_IN_SETTINGS = 13;
6981 // user denied the permission with prejudice after being linked to settings
6982 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6983 // permission was automatically revoked after one-time permission expired
6984 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006985 // permission was automatically revoked for unused app
6986 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006987 }
6988 // The result of the permission grant
6989 optional Result result = 6;
6990}
6991
6992/**
Jack Yu95b64f32018-12-13 18:26:11 +08006993 * Logs when Omapi API used
6994 * Logged from:
6995 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6996 */
6997message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006998 enum Operation {
6999 UNKNOWN = 0;
7000 OPEN_CHANNEL = 1;
7001 }
7002 optional Operation operation = 1;
7003 // SIMx or eSEx.
7004 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007005
Alex Salod7c3eef2019-01-25 14:43:27 -08007006 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007007}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007008
7009/**
Alex Saloa060aee2019-01-21 14:36:41 -08007010 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7011 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007012 * Logged from:
7013 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7014 */
7015message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007016 optional int64 dispatch_latency_millis = 1;
7017}
7018
7019/**
7020 * Logs AttentionManagerService attention check result.
7021 *
7022 * Logged from:
7023 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7024 */
7025message AttentionManagerServiceResultReported {
7026 // See core/java/android/service/attention/AttentionService.java
7027 enum AttentionCheckResult {
7028 UNKNOWN = 20;
7029 ATTENTION_SUCCESS_ABSENT = 0;
7030 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007031 ATTENTION_FAILURE_UNKNOWN = 2;
7032 ATTENTION_FAILURE_CANCELLED = 3;
7033 ATTENTION_FAILURE_PREEMPTED = 4;
7034 ATTENTION_FAILURE_TIMED_OUT = 5;
7035 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007036 }
7037 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007038}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007039
7040/**
7041 * Logs when an adb connection changes state.
7042 *
7043 * Logged from:
7044 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7045 */
7046message AdbConnectionChanged {
7047 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7048 // previously selected for this system.
7049 optional int64 last_connection_time_millis = 1;
7050
7051 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7052 // to reconnect via adb without user interaction.
7053 optional int64 auth_window_millis = 2;
7054
7055 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7056 optional android.debug.AdbConnectionStateEnum state = 3;
7057
7058 // True if the 'always allow' option was selected for this system.
7059 optional bool always_allow = 4;
7060}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007061
7062/*
7063 * Logs the reported speech DSP status.
7064 *
7065 * Logged from:
7066 * Vendor audio implementation.
7067 */
7068message SpeechDspStatReported {
7069 // The total Speech DSP uptime in milliseconds.
7070 optional int32 total_uptime_millis = 1;
7071 // The total Speech DSP downtime in milliseconds.
7072 optional int32 total_downtime_millis = 2;
7073 optional int32 total_crash_count = 3;
7074 optional int32 total_recover_count = 4;
7075}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007076
7077/**
7078 * Logs USB connector contaminant status.
7079 *
7080 * Logged from: USB Service.
7081 */
7082message UsbContaminantReported {
7083 optional string id = 1;
7084 optional android.service.usb.ContaminantPresenceStatus status = 2;
7085}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007086
7087/**
7088 * This atom is for debugging purpose.
7089 */
7090message DebugElapsedClock {
7091 // Monotically increasing value for each pull.
7092 optional int64 pull_count = 1;
7093 // Time from System.elapsedRealtime.
7094 optional int64 elapsed_clock_millis = 2;
7095 // Time from System.elapsedRealtime.
7096 optional int64 same_elapsed_clock_millis = 3;
7097 // Diff between current elapsed time and elapsed time from previous pull.
7098 optional int64 elapsed_clock_diff_millis = 4;
7099
7100 enum Type {
7101 TYPE_UNKNOWN = 0;
7102 ALWAYS_PRESENT = 1;
7103 PRESENT_ON_ODD_PULLS = 2;
7104 }
7105 // Type of behavior for the pulled data.
7106 optional Type type = 5;
7107}
7108
7109/**
7110 * This atom is for debugging purpose.
7111 */
7112message DebugFailingElapsedClock {
7113 // Monotically increasing value for each pull.
7114 optional int64 pull_count = 1;
7115 // Time from System.elapsedRealtime.
7116 optional int64 elapsed_clock_millis = 2;
7117 // Time from System.elapsedRealtime.
7118 optional int64 same_elapsed_clock_millis = 3;
7119 // Diff between current elapsed time and elapsed time from previous pull.
7120 optional int64 elapsed_clock_diff_millis = 4;
7121}
Steven Wuacef6bb2019-01-23 14:21:17 -05007122
7123/** Logs System UI bubbles event changed.
7124 *
7125 * Logged from:
7126 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7127 */
7128message BubbleUIChanged {
7129
7130 // The app package that is posting the bubble.
7131 optional string package_name = 1;
7132
7133 // The notification channel that is posting the bubble.
7134 optional string notification_channel = 2;
7135
7136 // The notification id associated with the posted bubble.
7137 optional int32 notification_id = 3;
7138
7139 // The position of the bubble within the bubble stack.
7140 optional int32 position = 4;
7141
7142 // The total number of bubbles within the bubble stack.
7143 optional int32 total_number = 5;
7144
7145 // User interactions with the bubble.
7146 enum Action {
7147 UNKNOWN = 0;
7148 POSTED = 1;
7149 UPDATED = 2;
7150 EXPANDED = 3;
7151 COLLAPSED = 4;
7152 DISMISSED = 5;
7153 STACK_DISMISSED = 6;
7154 STACK_MOVED = 7;
7155 HEADER_GO_TO_APP = 8;
7156 HEADER_GO_TO_SETTINGS = 9;
7157 PERMISSION_OPT_IN = 10;
7158 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007159 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007160 SWIPE_LEFT = 13;
7161 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007162 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007163 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007164 }
7165 optional Action action = 6;
7166
7167 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7168 optional float normalized_x_position = 7;
7169 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007170
7171 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7172 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007173
7174 // Whether the bubble is an on-going one.
7175 optional bool is_ongoing = 10;
7176
7177 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007178 // This is deprecated and the value should be ignored.
7179 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007180}
Kweku Adams8845d012018-12-11 20:06:45 -08007181
7182/**
Steven Wu552f63f2019-02-05 13:41:36 -05007183 * Logs System UI bubbles developer errors.
7184 *
7185 * Logged from:
7186 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7187 */
7188message BubbleDeveloperErrorReported {
7189
7190 // The app package that is posting the bubble.
7191 optional string package_name = 1;
7192
7193 // Bubble developer error type enums.
7194 enum Error {
7195 UNKNOWN = 0;
7196 ACTIVITY_INFO_MISSING = 1;
7197 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7198 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7199 }
7200 optional Error error = 2 [default = UNKNOWN];
7201}
7202
7203/**
Kweku Adams8845d012018-12-11 20:06:45 -08007204 * Logs that a constraint for a scheduled job has changed.
7205 *
7206 * Logged from:
7207 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7208 */
7209message ScheduledJobConstraintChanged {
7210 repeated AttributionNode attribution_node = 1;
7211
7212 // Name of the job.
7213 optional string job_name = 2;
7214
7215 optional com.android.server.job.ConstraintEnum constraint = 3;
7216
7217 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007218 UNKNOWN = 0;
7219 UNSATISFIED = 1;
7220 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007221 }
7222 optional State state = 4;
7223}
Alex Salod7c3eef2019-01-25 14:43:27 -08007224
7225/**
7226 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7227 * returns true.
7228 *
7229 * Logged from:
7230 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7231 */
7232message ScreenTimeoutExtensionReported {
7233 // Describes how many times in a row did the power manager reset the screen off timeout.
7234 optional uint32 consecutive_timeout_extended_count = 1;
7235}
Hui Yu885aca12019-01-10 17:11:34 -08007236
7237/*
7238* Logs number of milliseconds it takes to start a process.
7239* The definition of app process start time is from the app launch time to
7240* the time that Zygote finished forking the app process and loaded the
7241* application package's java classes.
7242
7243* This metric is different from AppStartOccurred which is for foreground
7244* activity only.
7245
7246* ProcessStartTime can report all processes (both foreground and background)
7247* start time.
7248*
7249* Logged from:
7250* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7251*/
7252message ProcessStartTime {
7253 // The uid of the ProcessRecord.
7254 optional int32 uid = 1 [(is_uid) = true];
7255
7256 // The process pid.
7257 optional int32 pid = 2;
7258
7259 // The process name.
7260 // Usually package name, "system" for system server.
7261 // Provided by ActivityManagerService.
7262 optional string process_name = 3;
7263
7264 enum StartType {
7265 UNKNOWN = 0;
7266 WARM = 1;
7267 HOT = 2;
7268 COLD = 3;
7269 }
7270
7271 // The start type.
7272 optional StartType type = 4;
7273
7274 // The elapsed realtime at the start of the process.
7275 optional int64 process_start_time_millis = 5;
7276
7277 // Number of milliseconds it takes to reach bind application.
7278 optional int32 bind_application_delay_millis = 6;
7279
7280 // Number of milliseconds it takes to finish start of the process.
7281 optional int32 process_start_delay_millis = 7;
7282
7283 // hostingType field in ProcessRecord, the component type such as "activity",
7284 // "service", "content provider", "broadcast" or other strings.
7285 optional string hosting_type = 8;
7286
7287 // hostingNameStr field in ProcessRecord. The component class name that runs
7288 // in this process.
7289 optional string hosting_name = 9;
7290}
7291
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007292/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007293 * Track Media Codec usage
7294 * Logged from:
7295 * frameworks/av/media/libstagefright/MediaCodec.cpp
7296 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7297 */
7298message MediametricsCodecReported {
7299 optional int64 timestamp_nanos = 1;
7300 optional string package_name = 2;
7301 optional int64 package_version_code = 3;
7302 optional int64 media_apex_version = 4;
7303
7304 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7305}
7306
7307/**
7308 * Track Media Extractor (pulling video/audio streams out of containers) usage
7309 * Logged from:
7310 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7311 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7312 */
7313message MediametricsExtractorReported {
7314 optional int64 timestamp_nanos = 1;
7315 optional string package_name = 2;
7316 optional int64 package_version_code = 3;
7317 optional int64 media_apex_version = 4;
7318
7319 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7320}
7321
7322/**
7323 * Track how we arbitrate between microphone/input requests.
7324 * Logged from
7325 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7326 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7327 */
7328message MediametricsAudiopolicyReported {
7329 optional int64 timestamp_nanos = 1;
7330 optional string package_name = 2;
7331 optional int64 package_version_code = 3;
7332 optional int64 media_apex_version = 4;
7333
7334 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7335}
7336
7337/**
7338 * Track how we arbitrate between microphone requests.
7339 * Logged from
7340 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7341 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7342 */
7343message MediametricsAudiorecordReported {
7344 optional int64 timestamp_nanos = 1;
7345 optional string package_name = 2;
7346 optional int64 package_version_code = 3;
7347 optional int64 media_apex_version = 4;
7348
7349 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7350}
7351
7352/**
7353 * Track how we arbitrate between microphone/input requests.
7354 * Logged from
7355 * frameworks/av/media/libnblog/ReportPerformance.cpp
7356 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7357 */
7358message MediametricsAudiothreadReported {
7359 optional int64 timestamp_nanos = 1;
7360 optional string package_name = 2;
7361 optional int64 package_version_code = 3;
7362 optional int64 media_apex_version = 4;
7363
7364 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7365}
7366
7367/**
7368 * Track how we arbitrate between microphone/input requests.
7369 * Logged from
7370 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7371 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7372 */
7373message MediametricsAudiotrackReported {
7374 optional int64 timestamp_nanos = 1;
7375 optional string package_name = 2;
7376 optional int64 package_version_code = 3;
7377 optional int64 media_apex_version = 4;
7378
7379 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7380}
7381
7382/**
7383 * Track information about DRM framework performance
7384 * Logged from
7385 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7386 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7387 */
7388message MediametricsMediadrmReported {
7389 optional int64 timestamp_nanos = 1;
7390 optional string package_name = 2;
7391 optional int64 package_version_code = 3;
7392 optional int64 media_apex_version = 4;
7393
7394 // vendor+description tell about which DRM plugin is in use on this device
7395 optional string vendor = 5;
7396 optional string description = 6;
7397 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7398 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7399}
7400
7401/**
7402 * Track information about the widevine DRM plugin performance
7403 * Logged from
7404 * vendor/widevine/libwvdrmengine/cdm/metrics
7405 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7406 */
7407message MediametricsDrmWidevineReported {
7408 optional int64 timestamp_nanos = 1;
7409 optional string package_name = 2;
7410 optional int64 package_version_code = 3;
7411 optional int64 media_apex_version = 4;
7412
7413 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7414}
7415
7416/**
7417 * Track information about recordings (e.g. camcorder)
7418 * Logged from
7419 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7420 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7421 */
7422message MediametricsRecorderReported {
7423 optional int64 timestamp_nanos = 1;
7424 optional string package_name = 2;
7425 optional int64 package_version_code = 3;
7426 optional int64 media_apex_version = 4;
7427
7428 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7429}
7430
7431/**
7432 * Track Media Player usage
7433 * Logged from:
7434 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7435 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7436 */
7437message MediametricsNuPlayerReported {
7438 optional int64 timestamp_nanos = 1;
7439 optional string package_name = 2;
7440 optional int64 package_version_code = 3;
7441 optional int64 media_apex_version = 4;
7442
7443 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7444}
7445
7446/**
Robert Shiha4beed32019-08-19 14:15:23 -07007447 * Track Legacy DRM usage
7448 * Logged from
7449 * frameworks/av/drm/drmserver/DrmManager.cpp
7450 */
7451message MediametricsDrmManagerReported {
7452 optional int64 timestamp_nanos = 1;
7453 optional string package_name = 2;
7454 optional int64 package_version_code = 3;
7455 optional int64 media_apex_version = 4;
7456
7457 enum Method {
7458 METHOD_NOT_FOUND = -1;
7459 GET_CONSTRAINTS = 0;
7460 GET_METADATA = 1;
7461 CAN_HANDLE = 2;
7462 PROCESS_DRM_INFO = 3;
7463 ACQUIRE_DRM_INFO = 4;
7464 SAVE_RIGHTS = 5;
7465 GET_ORIGINAL_MIME_TYPE = 6;
7466 GET_DRM_OBJECT_TYPE = 7;
7467 CHECK_RIGHTS_STATUS = 8;
7468 REMOVE_RIGHTS = 9;
7469 REMOVE_ALL_RIGHTS = 10;
7470 OPEN_CONVERT_SESSION = 11;
7471 OPEN_DECRYPT_SESSION = 12;
7472 }
7473
7474 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7475 optional string plugin_id = 5;
7476 optional string description = 6;
7477 optional Method method = 7;
7478 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007479
7480 optional int64 get_constraints_count = 9;
7481 optional int64 get_metadata_count = 10;
7482 optional int64 can_handle_count = 11;
7483 optional int64 process_drm_info_count = 12;
7484 optional int64 acquire_drm_info_count = 13;
7485 optional int64 save_rights_count = 14;
7486 optional int64 get_original_mime_type_count = 15;
7487 optional int64 get_drm_object_type_count = 16;
7488 optional int64 check_rights_status_count = 17;
7489 optional int64 remove_rights_count = 18;
7490 optional int64 remove_all_rights_count = 19;
7491 optional int64 open_convert_session_count = 20;
7492 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007493}
7494
7495/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007496 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007497 * Pulled from: StatsCompanionService
7498*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007499message DangerousPermissionState {
7500 // Name of the permission
7501 optional string permission_name = 1;
7502
7503 // Uid of the package
7504 optional int32 uid = 2 [(is_uid) = true];
7505
7506 // Package requesting the permission
7507 optional string package_name = 3;
7508
7509 // If the permission is granted to the uid
7510 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007511
7512 // Permission flags as per android.content.pm.PermissionFlags
7513 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007514}
7515
Michael Groover4a0ca942019-01-24 17:41:25 -08007516/**
7517 * Logs when a package is denied access to a device identifier based on the new access requirements.
7518 *
7519 * Logged from:
7520 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7521 */
7522message DeviceIdentifierAccessDenied {
7523 // The name of the package denied access to the requested device identifier.
7524 optional string package_name = 1;
7525
7526 // The name of the device identifier method the package attempted to invoke.
7527 optional string method_name = 2;
7528
7529 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007530 // Starting from Android 11, this boolean is not set and will always be false.
7531 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007532
7533 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007534 // Starting from Android 11, this boolean is not set and will always be false.
7535 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007536}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007537
7538/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007539 * Pulls the ongoing mainline install train version code.
7540 * Pulled from StatsCompanionService
7541 */
7542message TrainInfo {
7543 optional int64 train_version_code = 1;
7544
7545 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007546
7547 optional string train_name = 3;
7548
7549 enum Status {
7550 UNKNOWN = 0;
7551 INSTALL_REQUESTED = 1;
7552 INSTALL_STARTED = 2;
7553 INSTALL_STAGED_NOT_READY = 3;
7554 INSTALL_STAGED_READY = 4;
7555 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007556 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7557 // and INSTALL_FAILURE_COMMIT.
7558 INSTALL_FAILURE = 6 [deprecated = true];
7559 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007560 INSTALL_CANCELLED = 7;
7561 INSTALLER_ROLLBACK_REQUESTED = 8;
7562 INSTALLER_ROLLBACK_INITIATED = 9;
7563 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7564 INSTALLER_ROLLBACK_STAGED = 11;
7565 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7566 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7567 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7568 INSTALLER_ROLLBACK_SUCCESS = 15;
7569 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007570 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7571 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7572 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7573 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7574 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7575 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007576 INSTALL_FAILURE_DOWNLOAD = 23;
7577 INSTALL_FAILURE_STATE_MISMATCH = 24;
7578 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007579 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007580 }
7581 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007582}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007583
7584/**
7585 * Logs the gesture stage changed event.
7586 *
7587 * Logged from:
7588 * frameworks/base/packages/SystemUI/
7589 */
7590message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007591 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007592}
7593
7594/**
7595 * Logs the feedback type.
7596 *
7597 * Logged from:
7598 * frameworks/base/packages/SystemUI/
7599 */
7600message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007601 // Whether or not the gesture was used.
7602 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007603}
7604
7605/**
7606 * Logs the progress.
7607 *
7608 * Logged from:
7609 * frameworks/base/packages/SystemUI/
7610 */
7611message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007612 // [0,100] progress for the assist gesture.
7613 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007614}
Neil Fullerdb14b482019-02-05 19:44:44 +00007615
7616/*
7617 * Information about the time zone data on a device.
7618 */
7619message TimeZoneDataInfo {
7620 // A version identifier for the data set on device. e.g. "2018i"
7621 optional string tzdb_version = 1;
7622}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007623
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007624/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007625 * Logs the GPU stats global health information.
7626 *
7627 * Logged from:
7628 * frameworks/native/services/gpuservice/gpustats/
7629 */
7630message GpuStatsGlobalInfo {
7631 // Package name of the gpu driver.
7632 optional string driver_package_name = 1;
7633
7634 // Version name of the gpu driver.
7635 optional string driver_version_name = 2;
7636
7637 // Version code of the gpu driver.
7638 optional int64 driver_version_code = 3;
7639
7640 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7641 optional int64 driver_build_time = 4;
7642
7643 // Total count of the gl driver gets loaded.
7644 optional int64 gl_loading_count = 5;
7645
7646 // Total count of the gl driver fails to be loaded.
7647 optional int64 gl_loading_failure_count = 6;
7648
7649 // Total count of the Vulkan driver gets loaded.
7650 optional int64 vk_loading_count = 7;
7651
7652 // Total count of the Vulkan driver fails to be loaded.
7653 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007654
7655 // Api version of the system Vulkan driver.
7656 optional int32 vulkan_version = 9;
7657
7658 // Api version of the system CPU Vulkan driver.
7659 optional int32 cpu_vulkan_version = 10;
7660
7661 // Api version of the system GLES driver.
7662 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007663
7664 // Total count of the angle driver gets loaded.
7665 optional int64 angle_loading_count = 12;
7666
7667 // Total count of the angle driver fails to be loaded.
7668 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007669}
7670
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007671/**
7672 * GPU driver loading time info.
7673 */
7674message GpuDriverLoadingTime {
7675 // List of all the driver loading times for this app. The list size is
7676 // capped at 50.
7677 repeated int64 driver_loading_time = 1;
7678}
7679
7680/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007681 * Logs the GPU stats per app health information.
7682 *
7683 * Logged from:
7684 * frameworks/native/services/gpuservice/gpustats/
7685 */
7686message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007687 // Package name of the application that loads the gpu driver. Total number
7688 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007689 optional string app_package_name = 1;
7690
7691 // Version code of the gpu driver this app loads.
7692 optional int64 driver_version_code = 2;
7693
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007694 // gl driver loading time info.
7695 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7696 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007697
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007698 // Vulkan driver loading time info.
7699 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7700 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007701
7702 // Angle driver loading time info.
7703 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7704 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007705
7706 // CPU Vulkan implementation is in use.
7707 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007708
7709 // App is not doing pre-rotation correctly.
7710 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007711
7712 // App creates GLESv1 context.
7713 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007714}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007715
7716/*
7717 * Logs the size of the system ion heap.
7718 *
7719 * Pulled from StatsCompanionService.
7720 */
7721message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007722 // Deprecated due to limited support of ion stats in debugfs.
7723 // Use `IonHeapSize` instead.
7724 option deprecated = true;
7725
Rafal Slawikd4e87572019-03-12 13:08:38 +00007726 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007727 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007728 optional int64 size_in_bytes = 1;
7729}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007730
Rafal Slawik77987ed2019-06-17 12:28:23 +01007731/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007732 * Logs the total size of the ion heap.
7733 *
7734 * Pulled from StatsCompanionService.
7735 */
7736message IonHeapSize {
7737 // Total size of all ion heaps in kilobytes.
7738 // Read from: /sys/kernel/ion/total_heaps_kb.
7739 optional int32 total_size_kb = 1;
7740}
7741
7742/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007743 * Logs the per-process size of the system ion heap.
7744 *
7745 * Pulled from StatsCompanionService.
7746 */
7747message ProcessSystemIonHeapSize {
7748 // The uid if available. -1 means not available.
7749 optional int32 uid = 1 [(is_uid) = true];
7750
7751 // The process name (from /proc/PID/cmdline).
7752 optional string process_name = 2;
7753
7754 // Sum of sizes of all allocations.
7755 optional int32 total_size_in_kilobytes = 3;
7756
7757 // Number of allocations.
7758 optional int32 allocation_count = 4;
7759
7760 // Size of the largest allocation.
7761 optional int32 max_size_in_kilobytes = 5;
7762}
7763
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007764/**
7765 * Push network stack events.
7766 *
7767 * Log from:
7768 * frameworks/base/packages/NetworkStack/
7769 */
7770message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007771 // The id that indicates the event reported from NetworkStack.
7772 optional int32 event_id = 1;
7773 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007774 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7775}
Carmen Agimofa769c152019-03-04 14:39:14 +00007776
7777/**
7778 * Logs the apps that are installed on the external storage.
7779 * Pulled from:
7780 * StatsCompanionService
7781 */
7782message AppsOnExternalStorageInfo {
7783 // The type of the external storage.
7784 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7785 // The name of the package that is installed on the external storage.
7786 optional string package_name = 2;
7787}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007788
7789/**
7790 * Logs the settings related to Face.
7791 * Logged from:
7792 * frameworks/base/services/core/java/com/android/server/stats
7793 */
7794message FaceSettings {
7795 // Whether or not face unlock is allowed on Keyguard.
7796 optional bool unlock_keyguard_enabled = 1;
7797 // Whether or not face unlock dismisses the Keyguard.
7798 optional bool unlock_dismisses_keyguard = 2;
7799 // Whether or not face unlock requires attention.
7800 optional bool unlock_attention_required = 3;
7801 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7802 optional bool unlock_app_enabled = 4;
7803 // Whether or not face unlock always requires user confirmation.
7804 optional bool unlock_always_require_confirmation = 5;
7805 // Whether or not a diverse set of poses are required during enrollment.
7806 optional bool unlock_diversity_required = 6;
7807}
Maggie White442b6312019-04-05 16:26:44 -07007808
7809/**
7810 * Logs cooling devices maintained by the kernel.
7811 *
7812 * Pulled from StatsCompanionService.java
7813 */
7814message CoolingDevice {
7815 // The type of cooling device being reported. Eg. CPU, GPU...
7816 optional android.os.CoolingTypeEnum device_location = 1;
7817 // The name of the cooling device source. Eg. CPU0
7818 optional string device_name = 2;
7819 // Current throttle state of the cooling device. The value can any unsigned
7820 // integer between 0 and max_state defined in its driver. 0 means device is
7821 // not in throttling, higher value means deeper throttling.
7822 optional int32 state = 3;
7823}
Ben Blount763a5d52019-04-10 11:48:58 -07007824
7825/**
7826 * Intelligence has several counter-type events that don't warrant a
7827 * full separate atom. These are primarily API call counters but also include
7828 * counters for feature usage and specific failure modes.
7829 *
7830 * Logged from the Intelligence mainline module.
7831 */
7832message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007833 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007834 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007835 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007836 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007837 // How many times the event occured (to report a batch of high frequency events).
7838 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007839 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007840 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007841}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007842
7843/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007844 * Logs when Car Power state changed.
7845 *
7846 * Logged from:
7847 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7848 */
7849message CarPowerStateChanged {
7850 // States come from CpmsState in CarPowerManagementService.java.
7851 enum State {
7852 WAIT_FOR_VHAL = 0;
7853 ON = 1;
7854 SHUTDOWN_PREPARE = 2;
7855 WAIT_FOR_FINISH = 3;
7856 SUSPEND = 4;
7857 SIMULATE_SLEEP = 5;
7858 }
7859 optional State state = 1;
7860}
7861
7862/**
7863 * Logs whether GarageMode is entered.
7864 *
7865 * Logged from:
7866 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7867 */
7868message GarageModeInfo {
7869 // Whether GarageMode is entered.
7870 optional bool is_garage_mode = 1;
7871}
Martijn Coenencd95d462019-04-25 17:09:45 +02007872
7873/**
7874 * Historical app ops data per package.
7875 */
7876message AppOps {
7877 // Uid of the package requesting the op
7878 optional int32 uid = 1 [(is_uid) = true];
7879
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007880 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007881 optional string package_name = 2;
7882
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007883 // operation id
7884 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007885
7886 // The number of times the op was granted while the app was in the
7887 // foreground (only for trusted requests)
7888 optional int64 trusted_foreground_granted_count = 4;
7889
7890 // The number of times the op was granted while the app was in the
7891 // background (only for trusted requests)
7892 optional int64 trusted_background_granted_count = 5;
7893
7894 // The number of times the op was rejected while the app was in the
7895 // foreground (only for trusted requests)
7896 optional int64 trusted_foreground_rejected_count = 6;
7897
7898 // The number of times the op was rejected while the app was in the
7899 // background (only for trusted requests)
7900 optional int64 trusted_background_rejected_count = 7;
7901
7902 // For long-running operations, total duration of the operation
7903 // while the app was in the foreground (only for trusted requests)
7904 optional int64 trusted_foreground_duration_millis = 8;
7905
7906 // For long-running operations, total duration of the operation
7907 // while the app was in the background (only for trusted requests)
7908 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007909
7910 // Whether AppOps is guarded by Runtime permission
7911 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007912}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007913
7914/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007915 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007916 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007917message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007918 // Uid of the package requesting the op
7919 optional int32 uid = 1 [(is_uid) = true];
7920
7921 // Name of the package performing the op
7922 optional string package_name = 2;
7923
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007924 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7925 // Attributions must be provided through manifest using <attribution> tag available in R and
7926 // above.
7927 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007928
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007929 // operation id
7930 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007931
7932 // The number of times the op was granted while the app was in the
7933 // foreground (only for trusted requests)
7934 optional int64 trusted_foreground_granted_count = 5;
7935
7936 // The number of times the op was granted while the app was in the
7937 // background (only for trusted requests)
7938 optional int64 trusted_background_granted_count = 6;
7939
7940 // The number of times the op was rejected while the app was in the
7941 // foreground (only for trusted requests)
7942 optional int64 trusted_foreground_rejected_count = 7;
7943
7944 // The number of times the op was rejected while the app was in the
7945 // background (only for trusted requests)
7946 optional int64 trusted_background_rejected_count = 8;
7947
7948 // For long-running operations, total duration of the operation
7949 // while the app was in the foreground (only for trusted requests)
7950 optional int64 trusted_foreground_duration_millis = 9;
7951
7952 // For long-running operations, total duration of the operation
7953 // while the app was in the background (only for trusted requests)
7954 optional int64 trusted_background_duration_millis = 10;
7955
7956 // Whether AppOps is guarded by Runtime permission
7957 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007958
7959 // Sampling rate used on device, from 0 to 100
7960 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007961}
7962
7963/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007964 * Location Manager API Usage information(e.g. API under usage,
7965 * API call's parameters).
7966 * Logged from:
7967 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7968 */
7969message LocationManagerApiUsageReported {
7970
7971 // Indicating if usage starts or usage ends.
7972 optional android.stats.location.UsageState state = 1;
7973
7974 // LocationManagerService's API in use.
7975 // We can identify which API from LocationManager is
7976 // invoking current LMS API by the combination of
7977 // API parameter(e.g. is_listener_null, is_intent_null,
7978 // is_location_request_null)
7979 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7980
7981 // Name of the package calling the API.
7982 optional string calling_package_name = 3;
7983
7984 // Type of the location provider.
7985 optional android.stats.location.ProviderType provider = 4;
7986
7987 // Quality of the location request
7988 optional android.stats.location.LocationRequestQuality quality = 5;
7989
7990 // The desired interval for active location updates, in milliseconds.
7991 // Bucketized to reduce cardinality.
7992 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7993
7994 // Minimum distance between location updates, in meters.
7995 // Bucketized to reduce cardinality.
7996 optional android.stats.location.SmallestDisplacementBucket
7997 bucketized_smallest_displacement = 7;
7998
7999 // The number of location updates.
8000 optional int64 num_updates = 8;
8001
8002 // The request expiration time, in millisecond since boot.
8003 // Bucketized to reduce cardinality.
8004 optional android.stats.location.ExpirationBucket
8005 bucketized_expire_in = 9;
8006
8007 // Type of Callback passed in for this API.
8008 optional android.stats.location.CallbackType callback_type = 10;
8009
8010 // The radius of the central point of the alert
8011 // region, in meters. Only for API REQUEST_GEOFENCE.
8012 // Bucketized to reduce cardinality.
8013 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8014
8015 // Activity Importance of API caller.
8016 // Categorized to 3 types that are interesting from location's perspective.
8017 optional android.stats.location.ActivityImportance activiy_importance = 12;
8018}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008019
8020/**
8021 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8022 */
8023message ReviewPermissionsFragmentResultReported {
8024 // unique value identifying a permission group change. A permission group change might result
8025 // in multiple of these atoms
8026 optional int64 change_id = 1;
8027
8028 // UID of package the permission belongs to
8029 optional int32 uid = 2 [(is_uid) = true];
8030
8031 // Name of package the permission belongs to
8032 optional string package_name = 3;
8033
8034 // The permission to be granted
8035 optional string permission_name = 4;
8036
8037 // The result of the permission grant
8038 optional bool permission_granted = 5;
8039}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008040
8041/**
8042* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8043* Logged from: RuntimePermissionUpdgradeController
8044*/
8045message RuntimePermissionsUpgradeResult {
8046 // Permission granted as result of upgrade
8047 optional string permission_name = 1;
8048
8049 // UID of package granted permission
8050 optional int32 uid = 2 [(is_uid) = true];
8051
8052 // Name of package granted permission
8053 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008054}
8055
8056/**
8057* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8058*/
8059message GrantPermissionsActivityButtonActions {
8060 // Permission granted as result of upgrade
8061 optional string permission_group_name = 1;
8062
8063 // UID of package granted permission
8064 optional int32 uid = 2 [(is_uid) = true];
8065
8066 // Name of package requesting permission
8067 optional string package_name = 3;
8068
8069 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8070 // LABEL_ constants in GrantPermissionActivity.java
8071 optional int32 buttons_presented = 4;
8072
8073 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8074 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008075
8076 // id which identifies single session of user interacting with permission controller
8077 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008078}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008079
8080/**
8081 * Information about LocationAccessCheck notification presented to user
8082 */
8083message LocationAccessCheckNotificationAction {
8084
8085 // id which identifies single session of user interacting with permission controller
8086 optional int64 session_id = 1;
8087
8088 // Uid of package for which location access check is presented
8089 optional int32 package_uid = 2;
8090
8091 // Name of package for which location access check is presented
8092 optional string package_name = 3;
8093
8094 enum Result {
8095 UNDEFINED = 0;
8096 // notification was presented to the user
8097 NOTIFICATION_PRESENTED = 1;
8098 // notification was declined by the user
8099 NOTIFICATION_DECLINED = 2;
8100 // notification was clicked by the user
8101 NOTIFICATION_CLICKED = 3;
8102 }
8103
8104 // View / interaction recorded
8105 optional Result result = 4;
8106}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008107
8108/**
8109 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8110 */
8111message AppPermissionFragmentActionReported {
8112 // id which identifies single session of user interacting with permission controller
8113 optional int64 session_id = 1;
8114
8115 // unique value identifying a permission group change. A permission group change might result
8116 // in multiple of these atoms
8117 optional int64 change_id = 2;
8118
8119 // UID of package the permission belongs to
8120 optional int32 uid = 3 [(is_uid) = true];
8121
8122 // Name of package the permission belongs to
8123 optional string package_name = 4;
8124
8125 // The permission to be granted
8126 optional string permission_name = 5;
8127
8128 // The result of the permission grant
8129 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008130
8131 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8132 optional int32 permission_flags = 7;
8133
8134 enum Button {
8135 UNDEFINED = 0;
8136 // Allow button
8137 ALLOW = 1;
8138 // Deny button
8139 DENY = 2;
8140 // Ask every time button
8141 ASK_EVERY_TIME = 3;
8142 // Allow all the time button
8143 ALLOW_ALWAYS = 4;
8144 // Allow only while using the app button
8145 ALLOW_FOREGROUND = 5;
8146 // Same is Deny button but shown in while in use dialog
8147 DENY_FOREGROUND = 6;
8148 }
8149
8150 // Button pressed in the dialog
8151 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008152}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008153
8154/**
8155* Information about a AppPermissionFragment viewed by user
8156*/
8157message AppPermissionFragmentViewed {
8158 // id which identifies single session of user interacting with permission controller
8159 optional int64 session_id = 1;
8160
8161 // UID of package for which permissions are viewed
8162 optional int32 uid = 2 [(is_uid) = true];
8163
8164 // Name of package for which permissions are viewed
8165 optional string package_name = 3;
8166
8167 // Permission group viewed
8168 optional string permission_group_name = 4;
8169}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008170
8171/**
8172* Information about a AppPermissionsFragment viewed by user
8173*/
8174message AppPermissionsFragmentViewed {
8175 // id which identifies single session of user interacting with permission controller
8176 optional int64 session_id = 1;
8177
8178 // id which identifies single view as every view might have several logging records
8179 // with different package information attached
8180 optional int64 view_id = 2;
8181
8182 // Permission group viewed
8183 optional string permission_group_name = 3;
8184
8185 // UID of package for which permissions are viewed
8186 optional int32 uid = 4 [(is_uid) = true];
8187
8188 // Name of package for which permissions are viewed
8189 optional string package_name = 5;
8190
8191 // Category in which permission is included
8192 enum Category {
8193 UNDEFINED = 0;
8194 ALLOWED = 1;
8195 ALLOWED_FOREGROUND = 2;
8196 DENIED = 3;
8197 }
8198 optional Category category = 6;
8199}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008200
8201/**
8202* Information about a PermissionAppsFragment viewed by user.
8203* Logged from ui/handheld/PermissionAppsFragment.java
8204*/
8205message PermissionAppsFragmentViewed {
8206 // id which identifies single session of user interacting with permission controller
8207 optional int64 session_id = 1;
8208
8209 // id which identifies single view as every view might have several logging records
8210 // with different package information attached
8211 optional int64 view_id = 2;
8212
8213 // Permission group viewed
8214 optional string permission_group_name = 3;
8215
8216 // UID of package for which permissions are viewed
8217 optional int32 uid = 4 [(is_uid) = true];
8218
8219 // Name of package for which permissions are viewed
8220 optional string package_name = 5;
8221
8222 // Category in which app is included
8223 enum Category {
8224 UNDEFINED = 0;
8225 ALLOWED = 1;
8226 ALLOWED_FOREGROUND = 2;
8227 DENIED = 3;
8228 }
8229 optional Category category = 6;
8230}
Tony Make2b1b672019-07-29 16:59:47 +01008231
8232/**
8233 * Logs when there is a smart selection related event.
8234 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8235 * Logged from: TextClassifierEventLogger.java
8236 */
8237message TextSelectionEvent {
8238 // A session ID.
8239 optional string session_id = 1;
8240
8241 // Event type of this event.
8242 optional android.stats.textclassifier.EventType event_type = 2;
8243
Tony Mak9c84bd22019-12-09 07:27:25 +00008244 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008245 optional string model_name = 3;
8246
8247 // Type of widget that was involved in triggering this event.
8248 optional android.stats.textclassifier.WidgetType widget_type = 4;
8249
8250 // Index of this event in a session.
8251 optional int32 event_index = 5;
8252
8253 // Entity type that is involved.
8254 optional string entity_type = 6;
8255
8256 // Relative word index of the start of the selection.
8257 optional int32 relative_word_start_index = 7;
8258
8259 // Relative word (exclusive) index of the end of the selection.
8260 optional int32 relative_word_end_index = 8;
8261
8262 // Relative word index of the start of the smart selection.
8263 optional int32 relative_suggested_word_start_index = 9;
8264
8265 // Relative word (exclusive) index of the end of the smart selection.
8266 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008267
8268 // Name of source package.
8269 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008270
8271 // Name of the LangID model that is involved in this event.
8272 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008273}
8274
8275/**
8276 * Logs when there is a smart linkify related event.
8277 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8278 * Logged from: TextClassifierEventLogger.java
8279 */
8280message TextLinkifyEvent {
8281 // A session ID.
8282 optional string session_id = 1;
8283
8284 // Event type of this event.
8285 optional android.stats.textclassifier.EventType event_type = 2;
8286
Tony Mak9c84bd22019-12-09 07:27:25 +00008287 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008288 optional string model_name = 3;
8289
8290 // Type of widget that was involved in triggering this event.
8291 optional android.stats.textclassifier.WidgetType widget_type = 4;
8292
8293 // Index of this event in a session.
8294 optional int32 event_index = 5;
8295
8296 // Entity type that is involved.
8297 optional string entity_type = 6;
8298
8299 // Number of links detected.
8300 optional int32 num_links = 7;
8301
8302 // The total length of all links.
8303 optional int32 linked_text_length = 8;
8304
8305 // Length of input text.
8306 optional int32 text_length = 9;
8307
8308 // Time spent on generating links in ms.
8309 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008310
8311 // Name of source package.
8312 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008313
8314 // Name of the LangID model that is involved in this event.
8315 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008316}
8317
8318/**
8319 * Logs when there is a conversation actions related event.
8320 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8321 * Logged from: TextClassifierEventLogger.java
8322 */
8323message ConversationActionsEvent {
8324 // A session ID.
8325 optional string session_id = 1;
8326
8327 // Event type of this event.
8328 optional android.stats.textclassifier.EventType event_type = 2;
8329
Tony Mak9c84bd22019-12-09 07:27:25 +00008330 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008331 optional string model_name = 3;
8332
8333 // Type of widget that was involved in triggering this event.
8334 optional android.stats.textclassifier.WidgetType widget_type = 4;
8335
8336 // The first entity type that is involved.
8337 optional string first_entity_type = 5;
8338
8339 // The second entity type that is involved.
8340 optional string second_entity_type = 6;
8341
8342 // The third entity type that is involved.
8343 optional string third_entity_type = 7;
8344
8345 // The score of the first entity type.
8346 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008347
8348 // Name of source package.
8349 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008350
8351 // Name of the annotator model that is involved in this event.
8352 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008353
8354 // Name of the LangID model that is involved in this event.
8355 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008356}
8357
8358/**
8359 * Logs when there is a language detection related event.
8360 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8361 * Logged from: TextClassifierEventLogger.java
8362 */
8363message LanguageDetectionEvent {
8364 // A session ID.
8365 optional string session_id = 1;
8366
8367 // Event type of this event.
8368 optional android.stats.textclassifier.EventType event_type = 2;
8369
Tony Mak9c84bd22019-12-09 07:27:25 +00008370 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008371 optional string model_name = 3;
8372
8373 // Type of widget that was involved in triggering this event.
8374 optional android.stats.textclassifier.WidgetType widget_type = 4;
8375
8376 // Detected language.
8377 optional string language_tag = 5;
8378
8379 // Score of the detected language.
8380 optional float score = 6;
8381
8382 // Position of this action.
8383 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008384
8385 // Name of source package.
8386 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008387}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008388
8389/**
8390 * Information about an OTA update attempt by update_engine.
8391 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8392 */
8393message UpdateEngineUpdateAttemptReported {
8394 // The number of attempts for the update engine to apply a given payload.
8395 optional int32 attempt_number = 1;
8396
8397 optional android.stats.otaupdate.PayloadType payload_type = 2;
8398
8399 // The total time in minutes for the update engine to apply a given payload.
8400 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8401 // it's increased when the system is sleeping.
8402 optional int32 duration_boottime_in_minutes = 3;
8403
8404 // The total time in minutes for the update engine to apply a given payload.
8405 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8406 // and it's not increased when the system is sleeping.
8407 optional int32 duration_monotonic_in_minutes = 4;
8408
8409 // The size of the payload in MiBs.
8410 optional int32 payload_size_mib = 5;
8411
8412 // The attempt result reported by the update engine for an OTA update.
8413 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8414
8415 // The error code reported by the update engine after an OTA update attempt
8416 // on A/B devices.
8417 optional android.stats.otaupdate.ErrorCode error_code = 7;
8418
8419 // The build fingerprint of the source system. The value is read from a
8420 // system property when the device takes the update. e.g.
8421 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8422 optional string source_fingerprint = 8;
8423}
8424
8425/**
8426 * Information about all the attempts the device make before finishing the
8427 * successful update.
8428 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8429 */
8430message UpdateEngineSuccessfulUpdateReported {
8431 // The number of attempts for the update engine to apply the payload for a
8432 // successful update.
8433 optional int32 attempt_count = 1;
8434
8435 optional android.stats.otaupdate.PayloadType payload_type = 2;
8436
8437 optional int32 payload_size_mib = 3;
8438
8439 // The total number of bytes downloaded by update_engine since the last
8440 // successful update.
8441 optional int32 total_bytes_downloaded_mib = 4;
8442
8443 // The ratio in percentage of the over-downloaded bytes compared to the
8444 // total bytes needed to successfully install the update. e.g. 200 if we
8445 // download 200MiB in total for a 100MiB package.
8446 optional int32 download_overhead_percentage = 5;
8447
8448 // The total time in minutes for the update engine to apply the payload for a
8449 // successful update.
8450 optional int32 total_duration_minutes = 6;
8451
8452 // The number of reboot of the device during a successful update.
8453 optional int32 reboot_count = 7;
8454}
Alec Mourie088e762019-07-02 13:10:55 -07008455
8456/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008457 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8458 * key to indicate whether it was successful or not.
8459 *
8460 * Logged from:
8461 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8462 */
8463message RebootEscrowRecoveryReported {
8464 optional bool successful = 1;
8465}
8466
8467/**
Alec Mourie088e762019-07-02 13:10:55 -07008468 * Global display pipeline metrics reported by SurfaceFlinger.
8469 * Pulled from:
8470 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8471 */
8472message SurfaceflingerStatsGlobalInfo {
8473 // Total number of frames presented during the tracing period
8474 optional int64 total_frames = 1;
8475 // Total number of frames missed
8476 optional int64 missed_frames = 2;
8477 // Total number of frames that fell back to client composition
8478 optional int64 client_composition_frames = 3;
8479 // Total time the display was turned on
8480 optional int64 display_on_millis = 4;
8481 // Total time that was spent performing animations.
8482 // This is derived from the present-to-present layer histogram
8483 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008484 // Total number of event connections tracked by SurfaceFlinger at the time
8485 // of this pull. If this number grows prohibitively large, then this can
8486 // cause jank due to resource contention.
8487 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008488 // Set of timings measured from when SurfaceFlinger began compositing a
8489 // frame, until the frame was requested to be presented to the display. This
8490 // measures SurfaceFlinger's total CPU walltime on the critical path per
8491 // frame.
8492 optional FrameTimingHistogram frame_duration = 7
8493 [(android.os.statsd.log_mode) = MODE_BYTES];
8494 // Set of timings measured from when SurfaceFlinger first began using the
8495 // GPU to composite a frame, until the GPU has finished compositing that
8496 // frame. This measures the total additional time SurfaceFlinger needed to
8497 // perform due to falling back into GPU composition.
8498 optional FrameTimingHistogram render_engine_timing = 8
8499 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008500}
8501
8502/**
8503 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8504 * The number of layers uploaded will be restricted due to size limitations.
8505 * Pulled from:
8506 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8507 */
8508message SurfaceflingerStatsLayerInfo {
8509 // The layer for this set of metrics
8510 // For now we can infer that the package name is included in the layer
8511 // name.
8512 optional string layer_name = 1;
8513 // Total number of frames presented
8514 optional int64 total_frames = 2;
8515 // Total number of dropped frames while latching a buffer for this layer.
8516 optional int64 dropped_frames = 3;
8517 // Set of timings measured between successive presentation timestamps.
8518 optional FrameTimingHistogram present_to_present = 4
8519 [(android.os.statsd.log_mode) = MODE_BYTES];
8520 // Set of timings measured from when an app queued a buffer for
8521 // presentation, until the buffer was actually presented to the
8522 // display.
8523 optional FrameTimingHistogram post_to_present = 5
8524 [(android.os.statsd.log_mode) = MODE_BYTES];
8525 // Set of timings measured from when a buffer is ready to be presented,
8526 // until the buffer was actually presented to the display.
8527 optional FrameTimingHistogram acquire_to_present = 6
8528 [(android.os.statsd.log_mode) = MODE_BYTES];
8529 // Set of timings measured from when a buffer was latched by
8530 // SurfaceFlinger, until the buffer was presented to the display
8531 optional FrameTimingHistogram latch_to_present = 7
8532 [(android.os.statsd.log_mode) = MODE_BYTES];
8533 // Set of timings measured from the desired presentation to the actual
8534 // presentation time
8535 optional FrameTimingHistogram desired_to_present = 8
8536 [(android.os.statsd.log_mode) = MODE_BYTES];
8537 // Set of timings measured from when an app queued a buffer for
8538 // presentation, until the buffer was ready to be presented.
8539 optional FrameTimingHistogram post_to_acquire = 9
8540 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008541 // Frames missed latch because the acquire fence didn't fire
8542 optional int64 late_acquire_frames = 10;
8543 // Frames latched early because the desired present time was bad
8544 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008545}
8546
8547/**
8548 * Histogram of frame counts bucketed by time in milliseconds.
8549 * Because of size limitations, we hard-cap the number of buckets, with
8550 * buckets for corresponding to larger milliseconds being less precise.
8551 */
8552message FrameTimingHistogram {
8553 // Timings in milliseconds that describes a set of histogram buckets
8554 repeated int32 time_millis_buckets = 1;
8555 // Number of frames that match to each time_millis, i.e. the bucket
8556 // contents
8557 // It's required that len(time_millis) == len(frame_count)
8558 repeated int64 frame_counts = 2;
8559}
Emilian Peev6729f372019-08-29 09:14:09 -07008560
Emilian Peev6729f372019-08-29 09:14:09 -07008561/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008562 * Janky event as reported by SurfaceFlinger.
8563 * This event is intended to be consumed by a Perfetto subscriber for
8564 * automated trace collection.
8565 *
8566 * Logged from:
8567 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8568 */
8569message DisplayJankReported {
8570 // Informational field for how long the janky event lasted in milliseconds
8571 optional int64 event_duration_millis = 1;
8572 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8573 // the display on time.
8574 optional int32 present_deadlines_missed = 2;
8575}
8576
8577/**
Emilian Peev6729f372019-08-29 09:14:09 -07008578 * Information about camera facing and API level usage.
8579 * Logged from:
8580 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8581 */
8582message CameraActionEvent {
8583 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008584 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008585
8586 // Camera API level used
8587 optional int32 api_level = 2;
8588
8589 // Name of client package
8590 optional string package_name = 3;
8591
8592 // Camera facing
8593 enum Facing {
8594 UNKNOWN = 0;
8595 BACK = 1;
8596 FRONT = 2;
8597 EXTERNAL = 3;
8598 }
8599 optional Facing facing = 4;
8600}
atrost01a20932019-08-28 15:40:37 +01008601
8602/**
8603 * Logs when a compatibility change is affecting an app.
8604 *
8605 * Logged from:
8606 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8607 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8608 */
8609message AppCompatibilityChangeReported {
8610 // The UID of the app being affected by the compatibilty change.
8611 optional int32 uid = 1 [(is_uid) = true];
8612
8613 // The ID of the change affecting the app.
8614 optional int64 change_id = 2;
8615
8616 enum State {
8617 UNKNOWN_STATE = 0;
8618 ENABLED = 1;
8619 DISABLED = 2;
8620 LOGGED = 3;
8621 }
8622
8623 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8624 // logged otherwise.
8625 optional State state = 3;
8626
8627 enum Source {
8628 UNKNOWN_SOURCE = 0;
8629 APP_PROCESS = 1;
8630 SYSTEM_SERVER = 2;
8631 }
8632
8633 // Where it was logged from.
8634 optional Source source = 4;
8635
8636}
Hector Dearman40579f62019-11-01 13:19:30 +00008637
8638/**
8639 * Logged from
8640 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8641 */
8642message PerfettoUploaded {
8643 enum Event {
8644 PERFETTO_UNDEFINED = 0;
8645 PERFETTO_TRACE_BEGIN = 1;
8646 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8647 PERFETTO_ON_CONNECT = 3;
8648 PERFETTO_ON_TRACING_DISABLED = 4;
8649 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8650 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8651 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8652 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8653 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8654 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8655 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8656 PERFETTO_TRIGGER_BEGIN = 12;
8657 PERFETTO_TRIGGER_SUCCESS = 13;
8658 PERFETTO_TRIGGER_FAILURE = 14;
8659 PERFETTO_HIT_GUARDRAILS = 15;
8660 PERFETTO_ON_TIMEOUT = 16;
8661 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8662 }
8663
8664 // Which stage of the pipeline we are reporting from.
8665 optional Event event = 1;
8666
8667 // UUID matching the one set inside the SystemInfo trace packet.
8668 optional int64 trace_uuid_lsb = 2;
8669 optional int64 trace_uuid_msb = 3;
8670}
Mark Tabrya824a642019-11-05 12:26:12 -08008671
8672/**
8673 * Pulls client metrics on data transferred via Vehicle Maps Service.
8674 * Metrics are keyed by uid + layer.
8675 *
8676 * Pulled from:
8677 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8678 */
8679message VmsClientStats {
8680 // UID of the VMS client app
8681 optional int32 uid = 1 [(is_uid) = true];
8682
8683 // VMS layer definition
8684 optional int32 layer_type = 2;
8685 optional int32 layer_channel = 3;
8686 optional int32 layer_version = 4;
8687
8688 // Bytes and packets sent by the client for the layer
8689 optional int64 tx_bytes = 5;
8690 optional int64 tx_packets = 6;
8691
8692 // Bytes and packets received by the client for the layer
8693 optional int64 rx_bytes = 7;
8694 optional int64 rx_packets = 8;
8695
8696 // Bytes and packets dropped due to client error
8697 optional int64 dropped_bytes = 9;
8698 optional int64 dropped_packets = 10;
8699}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008700
8701/**
8702 * State of a dangerous permission requested by a package - sampled
8703 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8704*/
8705message DangerousPermissionStateSampled {
8706 // Name of the permission
8707 optional string permission_name = 1;
8708
8709 // Uid of the package
8710 optional int32 uid = 2 [(is_uid) = true];
8711
8712 // If the permission is granted to the uid
8713 optional bool is_granted = 3;
8714
8715 // Permission flags as per android.content.pm.PermissionFlags
8716 optional int32 permission_flags = 4;
8717}
8718
Stan Iliev637ba5e2019-08-16 13:43:08 -04008719/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008720 * HWUI stats for a given app.
8721 */
8722message GraphicsStats {
8723 // The package name of the app
8724 optional string package_name = 1;
8725
8726 // The version code of the app
8727 optional int64 version_code = 2;
8728
8729 // The start & end timestamps in UTC as
8730 // milliseconds since January 1, 1970
8731 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008732 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008733
Stan Ilievb6517192020-02-18 10:12:42 -05008734 optional int64 end_millis = 4;
8735
8736 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8737 enum PipelineType {
8738 UNKNOWN = 0;
8739 GL = 1;
8740 VULKAN = 2;
8741 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008742
8743 // HWUI renders pipeline type: GL or Vulkan.
8744 optional PipelineType pipeline = 5;
8745
8746 // Distinct frame count.
8747 optional int32 total_frames = 6;
8748
8749 // Number of "missed vsync" events.
8750 optional int32 missed_vsync_count = 7;
8751
8752 // Number of frames in triple-buffering scenario (high input latency)
8753 optional int32 high_input_latency_count = 8;
8754
8755 // Number of "slow UI thread" events.
8756 optional int32 slow_ui_thread_count = 9;
8757
8758 // Number of "slow bitmap upload" events.
8759 optional int32 slow_bitmap_upload_count = 10;
8760
8761 // Number of "slow draw" events.
8762 optional int32 slow_draw_count = 11;
8763
8764 // Number of frames that missed their deadline (aka, visibly janked)
8765 optional int32 missed_deadline_count = 12;
8766
8767 // The frame time histogram for the package
8768 optional FrameTimingHistogram cpu_histogram = 13
8769 [(android.os.statsd.log_mode) = MODE_BYTES];
8770
8771 // The gpu frame time histogram for the package
8772 optional FrameTimingHistogram gpu_histogram = 14
8773 [(android.os.statsd.log_mode) = MODE_BYTES];
8774
8775 // UI mainline module version.
8776 optional int64 version_ui_module = 15;
8777
8778 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8779 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8780 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8781 // more apps are running / rendering.
8782 optional bool is_today = 16;
8783}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008784
8785/**
8786 * Message related to dangerous (runtime) app ops access
8787 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008788message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008789 // Uid of the package accessing app op
8790 optional int32 uid = 1 [(is_uid) = true];
8791
8792 // Name of the package accessing app op
8793 optional string package_name = 2;
8794
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008795 // deprecated - set to empty string
8796 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008797
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008798 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008799 // API. Attributions must be provided through manifest using <attribution> tag available in R
8800 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008801 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008802
8803 // message related to app op access, limited to 600 chars by API
8804 optional string message = 5;
8805
8806 enum SamplingStrategy {
8807 DEFAULT = 0;
8808 UNIFORM = 1;
8809 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008810 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008811 }
8812
8813 // sampling strategy used to collect this message
8814 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008815
8816 // operation id
8817 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008818}
8819
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008820/*
8821 * Logs userspace reboot outcome and duration.
8822 *
8823 * Logged from:
8824 * frameworks/base/core/java/com/android/server/BootReceiver.java
8825 */
8826message UserspaceRebootReported {
8827 // Possible outcomes of userspace reboot.
8828 enum Outcome {
8829 // Default value in case platform failed to determine the outcome.
8830 OUTCOME_UNKNOWN = 0;
8831 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8832 SUCCESS = 1;
8833 // Userspace reboot shutdown sequence was aborted.
8834 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8835 // Remounting userdata into checkpointing mode failed.
8836 FAILED_USERDATA_REMOUNT = 3;
8837 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8838 // reboot.
8839 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8840 }
8841 // Outcome of userspace reboot. Always set.
8842 optional Outcome outcome = 1;
8843 // Duration of userspace reboot in case it has a successful outcome.
8844 // Duration is measured as time between userspace reboot was initiated and until boot completed
8845 // (e.g. sys.boot_completed=1).
8846 optional int64 duration_millis = 2;
8847 // State of primary user's (user0) credential encryption storage.
8848 enum UserEncryptionState {
8849 // Default value.
8850 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8851 // Credential encrypted storage is unlocked.
8852 UNLOCKED = 1;
8853 // Credential encrypted storage is locked.
8854 LOCKED = 2;
8855 }
8856 // State of primary user's encryption storage at the moment boot completed. Always set.
8857 optional UserEncryptionState user_encryption_state = 3;
8858}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008859
8860/*
8861 * Logs integrity check information during each install.
8862 *
8863 * Logged from:
8864 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8865 */
8866message IntegrityCheckResultReported {
8867 optional string package_name = 1;
8868 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008869 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008870 optional string installer_package_name = 4;
8871 enum Response {
8872 UNKNOWN = 0;
8873 ALLOWED = 1;
8874 REJECTED = 2;
8875 FORCE_ALLOWED = 3;
8876 }
8877 optional Response response = 5;
8878 // An estimate on the cause of the response. This will only be populated for
8879 // REJECTED and FORCE_ALLOWED
8880 optional bool caused_by_app_cert_rule = 6;
8881 optional bool caused_by_installer_rule = 7;
8882}
8883
8884/**
8885 * Logs the information about the rules and the provider whenever rules are
8886 * pushed into AppIntegrityManager.
8887 *
8888 * Logged from:
8889 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8890 */
8891message IntegrityRulesPushed {
8892 optional bool success = 1;
8893 // Package name of the app that pushed the rules.
8894 optional string rule_provider = 2;
8895 // Version string of arbitrary format provided by the rule provider to
8896 // identify the rules.
8897 optional string rule_version = 3;
8898}
Jordan Liubedfa702019-12-20 15:08:45 -08008899
8900/**
8901 * Logs when a cell broadcast message is received on the device.
8902 *
8903 * Logged from CellBroadcastService module:
8904 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8905 */
8906message CellBroadcastMessageReported {
8907 // The type of Cell Broadcast message
8908 enum CbType {
8909 UNKNOWN_TYPE = 0;
8910 GSM = 1;
8911 CDMA = 2;
8912 CDMA_SPC = 3;
8913 }
8914
8915 // GSM, CDMA, CDMA-SCP
8916 optional CbType type = 1;
8917}
8918
8919/**
8920 * Logs when an error occurs while handling a cell broadcast message;
8921 *
8922 * Logged from CellBroadcastService module:
8923 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8924 */
8925message CellBroadcastMessageError {
8926 // The type of error raised when trying to handle a cell broadcast message
8927 enum ErrorType {
8928 UNKNOWN_TYPE = 0;
8929 CDMA_DECODING_ERROR = 1;
8930 CDMA_SCP_EMPTY = 2;
8931 CDMA_SCP_HANDLING_ERROR = 3;
8932 GSM_INVALID_HEADER_LENGTH = 4;
8933 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8934 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8935 GSM_INVALID_PDU = 7;
8936 GSM_INVALID_GEO_FENCING_DATA = 8;
8937 GSM_UMTS_INVALID_WAC = 9;
8938 FAILED_TO_INSERT_TO_DB = 10;
8939 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8940 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8941 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8942 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8943 }
8944
8945 // What kind of error occurred
8946 optional ErrorType type = 1;
8947
8948 // Exception message (or log message) associated with the error (max 1000 chars)
8949 optional string exception_message = 2;
8950}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008951
8952/**
8953 * Logs when the SDK Extensions test app has polled the current version.
8954 * This is atom ID 354.
8955 *
8956 * Logged from:
8957 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8958 */
8959message SdkExtensionStatus {
8960 enum ApiCallStatus {
8961 CALL_NOT_ATTEMPTED = 0;
8962 CALL_SUCCESSFUL = 1;
8963 CALL_FAILED = 2;
8964 }
8965
8966 optional ApiCallStatus result = 1;
8967
8968 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8969 optional int32 r_extension_version = 2;
8970
8971 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8972 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8973 optional int32 failed_call_symbol = 3;
8974}
Marco Ballesio497aff42020-01-24 08:39:42 -08008975
8976/**
8977 * Logs when an app is frozen or unfrozen.
8978 *
8979 * Logged from:
8980 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8981 */
8982message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008983 // The type of event.
8984 enum Action {
8985 UNKNOWN = 0;
8986 FREEZE_APP = 1;
8987 UNFREEZE_APP = 2;
8988 }
8989 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008990
Blake Kragten6ce382a2020-01-16 20:20:46 -08008991 // Pid of the process being frozen.
8992 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008993
Blake Kragten6ce382a2020-01-16 20:20:46 -08008994 // Name of the process being frozen.
8995 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008996
Blake Kragten6ce382a2020-01-16 20:20:46 -08008997 // Time since last unfrozen.
8998 optional int64 time_unfrozen_millis = 4;
8999}
9000
9001/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009002 * Pulls information for a single voice call.
9003 *
9004 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9005 *
9006 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009007 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009008 */
9009message VoiceCallSession {
9010 // Bearer (IMS or CS) when the call started.
9011 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9012
9013 // Bearer (IMS or CS) when the call ended.
9014 // The bearer may change during the call, e.g. due to SRVCC.
9015 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9016
9017 // Direction of the call (incoming or outgoing).
9018 optional android.telephony.CallDirectionEnum direction = 3;
9019
9020 // Time spent setting up the call.
9021 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9022
9023 // Whether the call ended before the setup was completed.
9024 optional bool setup_failed = 5;
9025
9026 // IMS reason code or CS disconnect cause.
9027 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9028 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9029 optional int32 disconnect_reason_code = 6;
9030
9031 // IMS extra code or CS precise disconnect cause.
9032 // For IMS, this code is vendor-specific
9033 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9034 optional int32 disconnect_extra_code = 7;
9035
9036 // IMS extra message or CS vendor cause.
9037 optional string disconnect_extra_message = 8;
9038
9039 // Radio access technology (RAT) used when call started.
9040 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9041
9042 // Radio access technology (RAT) used when call terminated.
9043 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9044
9045 // Number of times RAT changed during the call.
9046 optional int64 rat_switch_count = 11;
9047
9048 // A bitmask of all codecs used during the call.
9049 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9050 optional int64 codec_bitmask = 12;
9051
9052 // Number of other calls going on during call setup, for the same SIM slot.
9053 optional int32 concurrent_call_count_at_start = 13;
9054
9055 // Number of other calls going on during call termination, for the same SIM slot.
9056 optional int32 concurrent_call_count_at_end = 14;
9057
9058 // Index of the SIM is used, 0 for single-SIM devices.
9059 optional int32 sim_slot_index = 15;
9060
9061 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9062 optional bool is_multi_sim = 16;
9063
9064 // Whether the call was made with an eSIM profile.
9065 optional bool is_esim = 17;
9066
9067 // Carrier ID of the SIM card.
9068 // See https://source.android.com/devices/tech/config/carrierid.
9069 optional int32 carrier_id = 18;
9070
Chi Zhangba1b03a2020-04-21 17:17:56 -07009071 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009072 optional bool srvcc_completed = 19;
9073
9074 // Number of SRVCC failures.
9075 optional int64 srvcc_failure_count = 20;
9076
9077 // Number of SRVCC cancellations.
9078 optional int64 srvcc_cancellation_count = 21;
9079
Chi Zhangba1b03a2020-04-21 17:17:56 -07009080 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9081 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009082 optional bool rtt_enabled = 22;
9083
9084 // Whether this was an emergency call.
9085 optional bool is_emergency = 23;
9086
9087 // Whether the call was performed while roaming.
9088 optional bool is_roaming = 24;
9089}
9090
9091/**
9092 * Pulls voice call radio access technology (RAT) usage.
9093 *
9094 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9095 * time. The atom will be skipped if not enough data is available.
9096 *
9097 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009098 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009099 */
9100message VoiceCallRatUsage {
9101 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9102 optional int32 carrier_id = 1;
9103
9104 // Radio access technology.
9105 optional android.telephony.NetworkTypeEnum rat = 2;
9106
9107 // Total duration that voice calls spent on this carrier and RAT.
9108 optional int64 total_duration_seconds = 3;
9109
9110 // Total number of calls using this carrier and RAT.
9111 // A call is counted once even if it used the RAT multiple times.
9112 optional int64 call_count = 4;
9113}
9114
9115/**
9116 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9117 *
9118 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009119 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009120 */
9121message SimSlotState {
9122 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9123 optional int32 active_slot_count = 1;
9124
9125 // Number of SIM cards (both physical and active eSIM profiles).
9126 // This number is always equal to or less than the number of active SIM slots.
9127 optional int32 sim_count = 2;
9128
9129 // Number of active eSIM profiles.
9130 // This number is always equal to or less than the number of SIMs.
9131 optional int32 esim_count = 3;
9132}
9133
9134/**
9135 * Pulls supported cellular radio access technologies.
9136 *
9137 * This atom reports the capabilities of the device, rather than the network it has access to.
9138 *
9139 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009140 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009141 */
9142message SupportedRadioAccessFamily {
9143 // A bitmask of supported radio technologies.
9144 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9145 optional int64 network_type_bitmask = 1;
9146}
9147
9148/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009149 * Logs gnss stats from location service provider
9150 *
9151 * Pulled from:
9152 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9153 */
9154
9155message GnssStats {
9156 // Number of location reports since boot
9157 optional int64 location_reports = 1;
9158
9159 // Total pulled reports of Location failures since boot
9160 optional int64 location_failure_reports = 2;
9161
9162 // Number of time to first fix reports since boot
9163 optional int64 time_to_first_fix_reports = 3;
9164
9165 // Total pulled reported time to first fix (in milli-seconds) since boot
9166 optional int64 time_to_first_fix_milli_s = 4;
9167
9168 // Number of position accuracy reports since boot
9169 optional int64 position_accuracy_reports = 5;
9170
9171 // Total pulled reported position accuracy (in meters) since boot
9172 optional int64 position_accuracy_meters = 6;
9173
9174 // Number of top 4 average CN0 reports since boot
9175 optional int64 top_four_average_cn0_reports = 7;
9176
9177 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9178 optional int64 top_four_average_cn0_db_mhz = 8;
9179
9180 // Number of l5 top 4 average CN0 reports since boot
9181 optional int64 l5_top_four_average_cn0_reports = 9;
9182
9183 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9184 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9185
9186 // Total number of sv status messages reports since boot
9187 optional int64 sv_status_reports = 11;
9188
9189 // Total number of sv status messages reports, where sv is used in fix since boot
9190 optional int64 sv_status_reports_used_in_fix = 12;
9191
9192 // Total number of L5 sv status messages reports since boot
9193 optional int64 l5_sv_status_reports = 13;
9194
9195 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9196 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009197}
Kweku Adams12752132020-02-18 15:36:48 -08009198
9199/**
9200 * Logs when an app is moved to a different standby bucket.
9201 *
9202 * Logged from:
9203 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9204 */
9205message AppStandbyBucketChanged {
9206 optional string package_name = 1;
9207
9208 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9209 optional int32 user_id = 2;
9210
9211 // These enum values match the constants defined in UsageStatsManager.java.
9212 enum Bucket {
9213 BUCKET_UNKNOWN = 0;
9214 BUCKET_EXEMPTED = 5;
9215 BUCKET_ACTIVE = 10;
9216 BUCKET_WORKING_SET = 20;
9217 BUCKET_FREQUENT = 30;
9218 BUCKET_RARE = 40;
9219 BUCKET_RESTRICTED = 45;
9220 BUCKET_NEVER = 50;
9221 }
9222 optional Bucket bucket = 3;
9223
9224 enum MainReason {
9225 MAIN_UNKNOWN = 0;
9226 MAIN_DEFAULT = 0x0100;
9227 MAIN_TIMEOUT = 0x0200;
9228 MAIN_USAGE = 0x0300;
9229 MAIN_FORCED_BY_USER = 0x0400;
9230 MAIN_PREDICTED = 0x0500;
9231 MAIN_FORCED_BY_SYSTEM = 0x0600;
9232 }
9233 optional MainReason main_reason = 4;
9234
9235 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9236 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9237 // UsageStatsManager.java.
9238 optional int32 sub_reason = 5;
9239}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009240
9241/**
9242* Reports a started sharesheet transaction.
9243*
9244* Logged from:
9245* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9246*/
9247message SharesheetStarted {
9248 // The event_id (as for UiEventReported).
9249 optional int32 event_id = 1;
9250 // The calling app's package name.
9251 optional string package_name = 2;
9252 // An identifier to tie together multiple logs relating to the same share event
9253 optional int32 instance_id = 3;
9254 // The mime type of the share
9255 optional string mime_type = 4;
9256 // The number of direct targets the calling app is providing that will be shown.
9257 optional int32 num_app_provided_direct_targets = 5;
9258 // The number of app targets the calling app is providing that will be shown.
9259 optional int32 num_app_provided_app_targets = 6;
9260 // True if the share originates from the workprofile
9261 optional bool is_workprofile = 7;
9262
9263 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009264 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009265 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9266 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9267 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9268 }
9269 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009270 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009271
9272 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9273 INTENT_DEFAULT = 0;
9274 INTENT_ACTION_VIEW = 1;
9275 INTENT_ACTION_EDIT = 2;
9276 INTENT_ACTION_SEND = 3;
9277 INTENT_ACTION_SENDTO = 4;
9278 INTENT_ACTION_SEND_MULTIPLE = 5;
9279 INTENT_ACTION_IMAGE_CAPTURE = 6;
9280 INTENT_ACTION_MAIN = 7;
9281 }
9282 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009283 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009284}
9285
9286/**
9287 * Reports a ranking selection event.
9288 *
9289 * Logged from:
9290 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9291 */
9292message RankingSelected {
9293 // The event_id (as for UiEventReported).
9294 optional int32 event_id = 1;
9295 // The relevant app's package name (can be source or picked package).
9296 optional string package_name = 2;
9297 // An identifier to tie together multiple logs relating to the same share event.
9298 optional int32 instance_id = 3;
9299 // Which of the ranked targets got picked, default starting position 0.
9300 optional int32 position_picked = 4;
9301}
Raff Tsaiea4db182020-03-06 07:45:43 +08009302
9303/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009304 * Logs when TvSettings UI is interacted at.
9305 *
9306 * Logged from: packages/apps/TvSettings
9307 */
9308message TvSettingsUIInteracted {
9309
9310 /** The UI action category */
9311 optional android.app.tvsettings.Action action = 1;
9312
9313 /** The ID of the entry that the users actioned on */
9314 optional android.app.tvsettings.ItemId item_id = 2;
9315
9316 /** Additional information (e.g., navigation direction on page focused) */
9317 optional string additional_info = 3;
9318}
9319
9320/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009321 * Logs information about a package installation using package installer V2 APIs.
9322 *
9323 * Logged from:
9324 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9325 */
9326message PackageInstallerV2Reported {
9327 // Whether this installation uses Incremental File System
9328 optional bool is_incremental = 1;
9329 // Name of the package that is intended to be installed
9330 optional string package_name = 2;
9331 // The duration between when the install was requested to when the install has completed
9332 optional int64 duration_millis = 3;
9333 // Installation result in final integer, which are SystemApi's.
9334 // Return_code 1 indicates success.
9335 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9336 optional int32 return_code = 4;
9337}
9338
9339/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009340 * Logs settings provider values.
9341 *
9342 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9343 * then write the value to proto.
9344 *
9345 */
9346message SettingSnapshot {
9347
9348 // Setting key
9349 optional string name = 1;
9350
9351 enum SettingsValueType {
9352 NOTASSIGNED = 0;
9353 ASSIGNED_BOOL_TYPE = 1;
9354 ASSIGNED_INT_TYPE = 2;
9355 ASSIGNED_FLOAT_TYPE = 3;
9356 ASSIGNED_STRING_TYPE = 4;
9357 };
9358 // Setting value type
9359 optional SettingsValueType type = 2;
9360
9361 optional bool bool_value = 3;
9362
9363 optional int32 int_value = 4;
9364
9365 optional float float_value = 5;
9366
9367 optional string str_value = 6;
9368
9369 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9370 optional int32 user_id = 7;
9371}
Varun Shahacb56342019-12-18 11:45:38 -08009372
9373/**
9374 * An event logged to indicate that a user journey is about to be performed. This atom includes
9375 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9376 * will immediately follow this atom which will describe the event(s) and its state.
9377 *
9378 * Logged from:
9379 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9380 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9381 */
9382message UserLifecycleJourneyReported {
9383 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9384 // UserLifecycleEventOccurred atom)
9385 optional int64 session_id = 1;
9386
9387 // Indicates what type of user journey this session is related to
9388 enum Journey {
9389 UNKNOWN = 0; // Undefined user lifecycle journey
9390 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9391 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9392 USER_START = 3; // A user start journey
9393 USER_CREATE = 4; // A user creation journey
9394 }
9395 optional Journey journey = 2;
9396 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9397 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9398 optional int32 origin_user = 3;
9399 // Which user the journey is targeting
9400 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9401 optional int32 target_user = 4;
9402
9403 // What is the user type of the target user
9404 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9405 enum UserType {
9406 TYPE_UNKNOWN = 0;
9407 FULL_SYSTEM = 1;
9408 FULL_SECONDARY = 2;
9409 FULL_GUEST = 3;
9410 FULL_DEMO = 4;
9411 FULL_RESTRICTED = 5;
9412 PROFILE_MANAGED = 6;
9413 SYSTEM_HEADLESS = 7;
9414 }
9415 optional UserType user_type = 5;
9416 // What are the flags attached to the target user
9417 optional int32 user_flags = 6;
9418}
9419
9420/**
9421 * An event logged when a specific user lifecycle event is performed. These events should be
9422 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9423 * Note: journeys can span over multiple events, hence some events may share a single session id.
9424 *
9425 * Logged from:
9426 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9427 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9428 */
9429message UserLifecycleEventOccurred {
9430 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9431 optional int64 session_id = 1;
9432 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9433 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9434 optional int32 user_id = 2;
9435
9436 enum Event {
9437 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9438 SWITCH_USER = 1; // Indicates that this is a user switch event
9439 START_USER = 2; // Indicates that this is a user start event
9440 CREATE_USER = 3; // Indicates that this is a user create event
9441 }
9442 optional Event event = 3;
9443
9444 enum State {
9445 NONE = 0; // Indicates the associated event has no start/end defined
9446 BEGIN = 1;
9447 FINISH = 2;
9448 }
9449 optional State state = 4; // Represents the state of an event (beginning/ending)
9450}
jasonwshsu81173e32020-03-27 15:22:03 +08009451
9452/**
9453 * Logs when accessibility shortcut clicked.
9454 *
9455 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009456 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009457 */
9458message AccessibilityShortcutReported {
9459 // The accessibility feature(including installed a11y service, framework a11y feature,
9460 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9461 optional string package_name = 1;
9462
9463 // The definition of the accessibility shortcut.
9464 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9465 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9466
9467 // The definition of the service status.
9468 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9469 optional android.stats.accessibility.ServiceStatus service_status = 3;
9470}
9471
9472/**
9473 * Logs when accessibility service status changed.
9474 *
9475 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009476 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009477 */
9478message AccessibilityServiceReported {
9479 // The accessibility service package name.
9480 optional string package_name = 1;
9481
9482 // The definition of the service status.
9483 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9484 optional android.stats.accessibility.ServiceStatus service_status = 2;
9485}