blob: 03061bb7c5dac66a12de47155c88f58aba51cf15 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070027import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080028import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080029import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080030import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080031import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080032import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080033import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080034import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080035import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080038import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080039import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080040import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080041import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080043import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080044import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080045import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070048import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080049import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070050import "frameworks/base/core/proto/android/stats/enums.proto";
51import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070052import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070053import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080054import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070055import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000056import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080057import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050058import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080059import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080060import "frameworks/base/core/proto/android/telephony/enums.proto";
61import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080062import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010063import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070064import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080065
Yao Chend54f9dd2017-10-17 17:37:48 +000066/**
Stefan Lafonae2df012017-11-14 09:17:21 -080067 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000068 * raw stats log events from the Android system, also known as "atoms."
69 *
70 * This field contains a single oneof with all of the available messages.
71 * The stats-log-api-gen tool runs as part of the Android build and
72 * generates the android.util.StatsLog class, which contains the constants
73 * and methods that Android uses to log.
74 *
Stefan Lafonae2df012017-11-14 09:17:21 -080075 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000076 * Instead, statsd on Android constructs these messages synthetically,
77 * in the format defined here and in stats_log.proto.
78 */
Stefan Lafonae2df012017-11-14 09:17:21 -080079message Atom {
80 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070081 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070082 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070083 BleScanStateChanged ble_scan_state_changed = 2
84 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080085 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080086 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070087 SensorStateChanged sensor_state_changed =
88 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080089 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070090 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
91 ScheduledJobStateChanged scheduled_job_state_changed =
92 8 [(module) = "framework", (module) = "statsdtest"];
93 ScreenBrightnessChanged screen_brightness_changed =
94 9 [(module) = "framework", (module) = "statsdtest"];
95 WakelockStateChanged wakelock_state_changed =
96 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080097 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
98 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070099 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
100 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
102 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
103 14 [(module) = "framework"];
104 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
105 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
106 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
107 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800108 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700109 BatterySaverModeStateChanged battery_saver_mode_state_changed =
110 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800111 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
112 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700113 AudioStateChanged audio_state_changed =
114 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800115 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
116 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
117 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700118 UidProcessStateChanged uid_process_state_changed =
119 27 [(module) = "framework", (module) = "statsdtest"];
120 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
121 28 [(module) = "framework", (module) = "statsdtest"];
122 ScreenStateChanged screen_state_changed =
123 29 [(module) = "framework", (module) = "statsdtest"];
124 BatteryLevelChanged battery_level_changed =
125 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800127 PluggedStateChanged plugged_state_changed = 32
128 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800130 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
132 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800133 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
134 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
135 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700136 PhoneSignalStrengthChanged phone_signal_strength_changed =
137 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 SettingChanged setting_changed = 41 [(module) = "framework"];
139 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700140 42 [(module) = "framework", (module) = "statsdtest"];
141 IsolatedUidChanged isolated_uid_changed =
142 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
144 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800145 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800147 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700148 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
150 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800153 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800154 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800155 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
156 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800157 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800158 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700159 OverlayStateChanged overlay_state_changed =
160 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800161 ForegroundServiceStateChanged foreground_service_state_changed
162 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700163 CallStateChanged call_state_changed =
164 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800165 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
166 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
167 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 AppDied app_died = 65 [(module) = "framework"];
169 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
170 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800171 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
172 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
174 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800175 SpeakerImpedanceReported speaker_impedance_reported = 71;
176 HardwareFailed hardware_failed = 72;
177 PhysicalDropDetected physical_drop_detected = 73;
178 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800179 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
180 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800181 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700182 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800183 ANROccurred anr_occurred = 79 [(module) = "framework"];
184 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
185 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700186 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800187 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800188 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
190 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700191 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
193 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
194 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
195 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700196 BatteryHealthSnapshot battery_health_snapshot = 91;
197 SlowIo slow_io = 92;
198 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800199 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
200 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100201 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800202 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800203 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700204 // TODO: service state change is very noisy shortly after boot, as well
205 // as at other transitions - coming out of doze, device plugged in, etc.
206 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
208 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
209 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800210 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800211 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800212 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
213 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
214 105 [(module) = "docsui"];
215 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
216 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
217 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
218 108 [(module) = "docsui"];
219 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
220 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
221 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
222 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800224 WifiRunningStateChanged wifi_running_state_changed = 114
225 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800227 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800228 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800229 117 [(module) = "docsui"];
230 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
231 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
232 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
233 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800234 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
235 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
236 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800237 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
238 125 [(module) = "bluetooth"];
239 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
240 126 [(module) = "bluetooth"];
241 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
242 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800243 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000244 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800245 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
246 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
247 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800248 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800249 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
250 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
251 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
252 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
253 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
254 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800255 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
256 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800257 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
258 142 [(module) = "framework"];
259 AttentionManagerServiceResultReported attention_manager_service_result_reported =
260 143 [(module) = "framework"];
261 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800262 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800264 WatchdogRollbackOccurred watchdog_rollback_occurred =
265 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
267 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800268 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800269 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
270 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800271 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
272 151 [(module) = "bluetooth"];
273 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
274 152 [(module) = "bluetooth"];
275 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
276 153 [(module) = "bluetooth"];
277 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
278 154 [(module) = "bluetooth"];
279 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
280 155 [(module) = "bluetooth"];
281 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
282 156 [(module) = "bluetooth"];
283 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
284 157 [(module) = "bluetooth"];
285 BluetoothDeviceFailedContactCounterReported
286 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
287 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
288 159 [(module) = "bluetooth"];
289 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
290 160 [(module) = "bluetooth"];
291 BluetoothQualityReportReported bluetooth_quality_report_reported =
292 161 [(module) = "bluetooth"];
293 BluetoothDeviceInfoReported bluetooth_device_info_reported =
294 162 [(module) = "bluetooth"];
295 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
296 163 [(module) = "bluetooth"];
297 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
298 164 [(module) = "bluetooth"];
299 BluetoothBondStateChanged bluetooth_bond_state_changed =
300 165 [(module) = "bluetooth"];
301 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
302 166 [(module) = "bluetooth"];
303 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
304 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
306 168 [(module) = "framework"];
307 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700308 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800309 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800310 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800311 DeviceIdentifierAccessDenied device_identifier_access_denied =
312 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800314 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
315 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
316 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
318 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800319 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700320 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800321 180 [(module) = "permissioncontroller"];
322 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
323 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800324 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800325 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
326 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
327 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
328 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800329 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
330 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700331 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800332 188 [(module) = "intelligence"];
333 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
334 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800335 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800336 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800337 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
338 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
339 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
340 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
341 MediametricsCodecReported mediametrics_codec_reported = 195;
342 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
343 MediametricsExtractorReported mediametrics_extractor_reported = 197;
344 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
345 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
346 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700347 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800348 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
349 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800350 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
352 206 [(module) = "framework"];
353 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
354 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
355 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
356 LocationManagerApiUsageReported location_manager_api_usage_reported =
357 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100358 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100360 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100362 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100364 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100366 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800367 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100368 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800369 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100370 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800371 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100372 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800373 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
375 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
376 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
377 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800378 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800379 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700380 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
381 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800382 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100383 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800384 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800386 VmsClientConnectionStateChanged vms_client_connection_state_changed =
387 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100388 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
389 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
390 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100392 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
393 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800394 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800395 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
396 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
397 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
398 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800399 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800400 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000401 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800402 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500403 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
404 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800405 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
406 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800407 CellBroadcastMessageReported cb_message_reported =
408 249 [(module) = "cellbroadcast"];
409 CellBroadcastMessageError cb_message_error =
410 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700411 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
412 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
413 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800414 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000415 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800416 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
417 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800418 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800419 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500420 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
421 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700422 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800423 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700424 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800425 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
426 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800427 AccessibilityShortcutReported accessibility_shortcut_reported =
428 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800429 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700430 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700431 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000432 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700433
434 // StatsdStats tracks platform atoms with ids upto 500.
435 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000436 }
David Chenc8a43242017-10-17 16:23:28 -0700437
David Chen6e3e6cb2018-01-03 16:14:06 -0800438 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700439 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700440 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800441 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
442 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700443 MobileBytesTransfer mobile_bytes_transfer =
444 10002 [(module) = "framework", (truncate_timestamp) = true];
445 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
446 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800447 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
448 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800450 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700451 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800452 CpuTimePerUidFreq cpu_time_per_uid_freq =
453 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
455 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
456 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
457 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
458 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700459 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700460 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700461 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700462 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800463 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
464 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700465 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800466 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800468 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 DiskStats disk_stats = 10025 [(module) = "framework"];
470 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
471 AppSize app_size = 10027 [(module) = "framework"];
472 CategorySize category_size = 10028 [(module) = "framework"];
473 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
476 DiskIo disk_io = 10032 [(module) = "framework"];
477 PowerProfile power_profile = 10033 [(module) = "framework"];
478 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
479 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
480 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700481 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800482 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
483 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
484 10040 [(module) = "framework"];
485 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
486 10041 [(module) = "framework"];
487 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800488 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800490 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800491 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
492 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
493 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
494 RoleHolder role_holder = 10049 [(module) = "framework"];
495 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800496 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800497 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
498 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800499 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
500 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800501 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
502 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
503 FaceSettings face_settings = 10058 [(module) = "framework"];
504 CoolingDevice cooling_device = 10059 [(module) = "framework"];
505 AppOps app_ops = 10060 [(module) = "framework"];
506 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700507 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
508 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800510 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800511 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
512 DangerousPermissionStateSampled dangerous_permission_state_sampled =
513 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400514 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000515 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000516 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200517 PackageNotificationPreferences package_notification_preferences =
518 10071 [(module) = "framework"];
519 PackageNotificationChannelPreferences package_notification_channel_preferences =
520 10072 [(module) = "framework"];
521 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
522 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800523 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800524 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700525 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
526 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
527 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
528 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800529 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700530 }
yroa1fe77c2018-02-26 14:22:54 -0800531
Bookatz76aafcf2018-09-17 16:17:10 -0700532 // DO NOT USE field numbers above 100,000 in AOSP.
533 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
534 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100535
536 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700537}
538
Yao Chend54f9dd2017-10-17 17:37:48 +0000539/**
Yangster-mac20877162017-12-22 17:19:39 -0800540 * This proto represents a node of an attribution chain.
541 * Note: All attribution chains are represented as a repeated field of type
542 * AttributionNode. It is understood that in such arrays, the order is that
543 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000544 */
Yangster-mac20877162017-12-22 17:19:39 -0800545message AttributionNode {
546 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800547 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800548
Yangster-mac20877162017-12-22 17:19:39 -0800549 // The (optional) string tag for an element in the attribution chain. If the
550 // element has no tag, it is encoded as an empty string.
551 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700552}
553
Yangster-mac48b3d622018-08-18 12:38:11 -0700554message KeyValuePair {
555 optional int32 key = 1;
556 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700557 int32 value_int = 2;
558 int64 value_long = 3;
559 string value_str = 4;
560 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700561 }
562}
563
564message KeyValuePairsAtom {
565 optional int32 uid = 1;
566 repeated KeyValuePair pairs = 2;
567}
568
Yao Chend54f9dd2017-10-17 17:37:48 +0000569/*
570 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800571 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000572 *
573 * RULES:
574 * - The field ids for each atom must start at 1, and count upwards by 1.
575 * Skipping field ids is not allowed.
576 * - These form an API, so renaming, renumbering or removing fields is
577 * not allowed between android releases. (This is not currently enforced,
578 * but there will be a tool to enforce this restriction).
579 * - The types must be built-in protocol buffer types, namely, no sub-messages
580 * are allowed (yet). The bytes type is also not allowed.
581 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800582 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800584 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000585 * - A field that is a uid should be a string field, tagged with the [xxx]
586 * annotation. The generated code on android will be represented by UIDs,
587 * and those UIDs will be translated in xxx to those strings.
588 *
589 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700590 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000591 * - If there is a UID, it goes first. Think in an object-oriented fashion.
592 * *****************************************************************************
593 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700594
Yao Chend54f9dd2017-10-17 17:37:48 +0000595/**
Tej Singha72344992019-04-17 18:55:08 -0700596 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700597 * Logs when the Thermal service HAL notifies the throttling start/stop events.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
601 */
602message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700603 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700604 optional android.os.TemperatureTypeEnum sensor_type = 1;
605
Maggie White442b6312019-04-05 16:26:44 -0700606 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700607 enum State {
608 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700609 START = 1; // START indicated that throttling was triggered.
610 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700611 }
Yangster-mace16189a2018-08-26 12:20:16 -0700612 optional State state = 2;
613
614 optional float temperature = 3;
615}
616
617/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000618 * Logs when the screen state changes.
619 *
620 * Logged from:
621 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
622 */
623message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800624 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800625 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700626 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700627}
Yao Chend54f9dd2017-10-17 17:37:48 +0000628
629/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700630 * Logs that the process state of the uid, as determined by ActivityManager
631 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000632 *
633 * Logged from:
634 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
635 */
Bookatzc1a050a2017-10-10 15:49:28 -0700636message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700637 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000638
Bookatzdb026a22018-01-10 19:01:56 -0800639 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800640 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700641 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000642}
643
644/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700645 * Logs process state change of a process, as per the activity manager.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
649 */
650message ProcessStateChanged {
651 optional int32 uid = 1;
652 optional string process_name = 2;
653 optional string package_name = 3;
654 // TODO: remove this when validation is done
655 optional int64 version = 5;
656 // The state, from frameworks/base/core/proto/android/app/enums.proto.
657 optional android.app.ProcessStateEnum state = 4;
658}
659
660/**
661 * Logs when ActivityManagerService sleep state is changed.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
665 */
666message ActivityManagerSleepStateChanged {
667 // TODO: import frameworks proto
668 enum State {
669 UNKNOWN = 0;
670 ASLEEP = 1;
671 AWAKE = 2;
672 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700673 optional State state = 1
674 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700675}
676
677/**
678 * Logs when system memory state changes.
679 *
680 * Logged from:
681 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
682 */
683message MemoryFactorStateChanged {
684 // TODO: import frameworks proto
685 enum State {
686 MEMORY_UNKNOWN = 0;
687 NORMAL = 1; // normal.
688 MODERATE = 2; // moderate memory pressure.
689 LOW = 3; // low memory.
690 CRITICAL = 4; // critical memory.
691
692 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700693 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700694}
695
696/**
697 * Logs when app is using too much cpu, according to ActivityManagerService.
698 *
699 * Logged from:
700 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
701 */
702message ExcessiveCpuUsageReported {
703 optional int32 uid = 1;
704 optional string process_name = 2;
705 optional string package_name = 3;
706 // package version. TODO: remove this when validation is done
707 optional int64 version = 4;
708}
709
710/**
711 * Logs when a cached process is killed, along with its pss.
712 *
713 * Logged from:
714 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
715 */
716message CachedKillReported {
717 optional int32 uid = 1;
718 optional string process_name = 2;
719 optional string package_name = 3;
720 // TODO: remove this when validation is done
721 optional int64 version = 5;
722 optional int64 pss = 4;
723}
724
725/**
xshu2c3d9e42019-09-26 17:54:02 -0700726 * Logs the change in wifi health.
727 *
728 * Logged from:
729 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
730 */
731message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800732 enum Band {
733 UNKNOWN = 0;
734 // All of 2.4GHz band
735 BAND_2G = 1;
736 // Frequencies in the range of [5150, 5250) GHz
737 BAND_5G_LOW = 2;
738 // Frequencies in the range of [5250, 5725) GHz
739 BAND_5G_MIDDLE = 3;
740 // Frequencies in the range of [5725, 5850) GHz
741 BAND_5G_HIGH = 4;
742 // Frequencies in the range of [5925, 6425) GHz
743 BAND_6G_LOW = 5;
744 // Frequencies in the range of [6425, 6875) GHz
745 BAND_6G_MIDDLE = 6;
746 // Frequencies in the range of [6875, 7125) GHz
747 BAND_6G_HIGH = 7;
748 }
xshu2c3d9e42019-09-26 17:54:02 -0700749 // duration this stat is obtained over in milliseconds
750 optional int32 duration_millis = 1;
751 // whether wifi is classified as sufficient for the user's data traffic, determined
752 // by whether the calculated throughput exceeds the average demand within |duration_millis|
753 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700754 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800755 optional bool is_cell_data_available = 3;
756 // the Band bucket the connected network is on
757 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700758}
759
760/**
761 * Logged when wifi detects a significant change in connection failure rate.
762 *
763 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
764 *
765 */
766message WifiFailureStatReported {
767 enum AbnormalityType {
768 UNKNOWN = 0;
769 SIGNIFICANT_INCREASE = 1;
770 SIGNIFICANT_DECREASE = 2;
771 SIMPLY_HIGH = 3;
772 }
773 enum FailureType {
774 FAILURE_UNKNOWN = 0;
775 FAILURE_CONNECTION = 1;
776 FAILURE_ASSOCIATION_REJECTION = 2;
777 FAILURE_ASSOCIATION_TIMEOUT = 3;
778 FAILURE_AUTHENTICATION = 4;
779 FAILURE_NON_LOCAL_DISCONNECTION = 5;
780 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
781 }
782 // Reason for uploading this stat
783 optional AbnormalityType abnormality_type = 1;
784 // The particular type of failure
785 optional FailureType failure_type = 2;
786 // How many times we have encountered this combination of AbnormalityType and FailureType
787 optional int32 failure_count = 3;
788}
789
790/**
791 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
792 *
793 * Logged from:
794 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
795 */
796message WifiConnectionResultReported {
797 enum FailureCode {
798 FAILURE_UNKNOWN = 0;
799 FAILURE_ASSOCIATION_TIMEOUT = 1;
800 FAILURE_ASSOCIATION_REJECTION = 2;
801 FAILURE_AUTHENTICATION_GENERAL = 3;
802 FAILURE_AUTHENTICATION_EAP = 4;
803 FAILURE_DHCP = 5;
804 FAILURE_NETWORK_DISCONNECTION = 6;
805 FAILURE_ROAM_TIMEOUT = 7;
806 }
807 // true represents a successful connection
808 optional bool connection_result = 1;
809 // reason for the connection failure
810 optional FailureCode failure_code = 2;
811 // scan rssi before the connection attempt
812 optional int32 rssi = 3;
813}
814
815/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700816 * Logs when memory stats of a process is reported.
817 *
818 * Logged from:
819 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
820 */
821message ProcessMemoryStatReported {
822 optional int32 uid = 1;
823 optional string process_name = 2;
824 optional string package_name = 3;
825 //TODO: remove this when validation is done
826 optional int64 version = 9;
827 optional int64 pss = 4;
828 optional int64 uss = 5;
829 optional int64 rss = 6;
830 enum Type {
831 ADD_PSS_INTERNAL_SINGLE = 0;
832 ADD_PSS_INTERNAL_ALL_MEM = 1;
833 ADD_PSS_INTERNAL_ALL_POLL = 2;
834 ADD_PSS_EXTERNAL = 3;
835 ADD_PSS_EXTERNAL_SLOW = 4;
836 }
837 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800838 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700839}
840
841/**
Bookatzc1a050a2017-10-10 15:49:28 -0700842 * Logs that a process started, finished, crashed, or ANRed.
843 *
844 * Logged from:
845 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
846 */
847message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700848 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700849
David Chen0b5c90c2018-01-25 16:51:49 -0800850 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800851 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700852
Bookatzddccf0a2017-11-28 16:48:14 -0800853 // What lifecycle state the process changed to.
854 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800855 enum State {
856 FINISHED = 0;
857 STARTED = 1;
858 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800859 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800860 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700861}
862
Bookatzc1a050a2017-10-10 15:49:28 -0700863/**
864 * Logs when the ble scan state changes.
865 *
866 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700867 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700868 */
869message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800870 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700871 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700872
873 enum State {
874 OFF = 0;
875 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700876 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
877 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700878 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800879 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700880 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800881 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700882 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800883 (state_field_option).nested = true
884 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700885
Bookatze5ec0b42018-03-26 13:34:56 -0700886 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700887 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700888 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700889 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700890 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700891 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700892}
893
894/**
895 * Logs reporting of a ble scan finding results.
896 *
897 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700898 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700899 */
Bookatzae6738e2018-09-13 11:38:56 -0700900// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700901message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800902 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700903
904 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800905 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700906}
907
908/**
909 * Logs when a sensor state changes.
910 *
911 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700912 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700913 */
914message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800915 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700916
Bookatzc1a050a2017-10-10 15:49:28 -0700917 // The id (int) of the sensor.
918 optional int32 sensor_id = 2;
919
920 enum State {
921 OFF = 0;
922 ON = 1;
923 }
924 optional State state = 3;
925}
926
Bookatzc1a050a2017-10-10 15:49:28 -0700927/**
928 * Logs when GPS state changes.
929 *
930 * Logged from:
931 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
932 */
933message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800934 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700935
936 enum State {
937 OFF = 0;
938 ON = 1;
939 }
940 optional State state = 2;
941}
942
Bookatz48d362e2018-11-06 15:49:08 -0800943/**
944 * Logs when GPS signal quality.
945 *
946 * Logged from:
947 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
948 */
949message GpsSignalQualityChanged {
950 optional android.server.location.GpsSignalQualityEnum level = 1;
951}
952
Bookatzc1a050a2017-10-10 15:49:28 -0700953
954/**
955 * Logs when a sync manager sync state changes.
956 *
957 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700958 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700959 */
960message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800961 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700962
David Chen0b5c90c2018-01-25 16:51:49 -0800963 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800964 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700965
966 enum State {
967 OFF = 0;
968 ON = 1;
969 }
970 optional State state = 3;
971}
972
Yangster-mac96353002018-09-05 11:18:55 -0700973/*
974 * Deferred job stats.
975 *
976 * Logged from:
977 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
978*/
979message DeferredJobStatsReported {
980 repeated AttributionNode attribution_node = 1;
981
982 // Number of jobs deferred.
983 optional int32 num_jobs_deferred = 2;
984
985 // Time since the last job runs.
986 optional int64 time_since_last_job_millis = 3;
987}
988
Bookatzc1a050a2017-10-10 15:49:28 -0700989/**
990 * Logs when a job scheduler job state changes.
991 *
992 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700993 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700994 */
995message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800996 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700997
998 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800999 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001000
1001 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001002 FINISHED = 0;
1003 STARTED = 1;
1004 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001005 }
1006 optional State state = 3;
1007
Tej Singh33a412b2018-03-16 18:43:59 -07001008 // The reason a job has stopped.
1009 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001010 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001011 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001012
1013 // The standby bucket of the app that scheduled the job. These match the framework constants
1014 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1015 // already assigned 0.
1016 enum Bucket {
1017 UNKNOWN = -1;
1018 ACTIVE = 0;
1019 WORKING_SET = 1;
1020 FREQUENT = 2;
1021 RARE = 3;
1022 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001023 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001024 }
1025 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1026
1027 // The job id (as assigned by the app).
1028 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001029
1030 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1031 // constraints as they are always assumed to be set.
1032 optional bool has_charging_constraint = 7;
1033 optional bool has_battery_not_low_constraint = 8;
1034 optional bool has_storage_not_low_constraint = 9;
1035 optional bool has_timing_delay_constraint = 10;
1036 optional bool has_deadline_constraint = 11;
1037 optional bool has_idle_constraint = 12;
1038 optional bool has_connectivity_constraint = 13;
1039 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001040}
1041
1042/**
1043 * Logs when the audio state changes.
1044 *
1045 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001046 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001047 */
1048message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001049 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001050
1051 enum State {
1052 OFF = 0;
1053 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001054 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1055 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001056 }
1057 optional State state = 2;
1058}
1059
1060/**
1061 * Logs when the video codec state changes.
1062 *
1063 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001064 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001065 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001066message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001067 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001068
1069 enum State {
1070 OFF = 0;
1071 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001072 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1073 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001074 }
1075 optional State state = 2;
1076}
1077
1078/**
1079 * Logs when the flashlight state changes.
1080 *
1081 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001082 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001083 */
1084message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001085 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001086
1087 enum State {
1088 OFF = 0;
1089 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001090 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1091 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001092 }
1093 optional State state = 2;
1094}
1095
1096/**
1097 * Logs when the camera state changes.
1098 *
1099 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001100 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001101 */
1102message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001103 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001104
1105 enum State {
1106 OFF = 0;
1107 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001108 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1109 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001110 }
1111 optional State state = 2;
1112}
1113
1114/**
1115 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001116 *
1117 * Logged from:
1118 * TODO
1119 */
Bookatzd6746242017-10-24 18:39:35 -07001120message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001121 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001122 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001123
Bookatz1a1b0462018-01-12 11:47:03 -08001124 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1125 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001126 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001127
1128 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001129 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001130
1131 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001132 RELEASE = 0;
1133 ACQUIRE = 1;
1134 CHANGE_RELEASE = 2;
1135 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001136 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001137 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001138 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001139 (state_field_option).default_state_value = 0,
1140 (state_field_option).nested = true
1141 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001142}
1143
1144/**
Bookatzc1a050a2017-10-10 15:49:28 -07001145 * Logs when a partial wakelock is considered 'long' (over 1 min).
1146 *
1147 * Logged from:
1148 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1149 */
1150message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001151 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001152
Yao Chend54f9dd2017-10-17 17:37:48 +00001153 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1154 optional string tag = 2;
1155
Bookatzc1a050a2017-10-10 15:49:28 -07001156 // TODO: I have no idea what this is.
1157 optional string history_tag = 3;
1158
1159 enum State {
1160 OFF = 0;
1161 ON = 1;
1162 }
1163 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001164}
1165
Bookatzc1a050a2017-10-10 15:49:28 -07001166/**
Bookatza66083f2018-09-20 17:24:00 -07001167 * Logs when the device is interactive, according to the PowerManager Notifier.
1168 *
1169 * Logged from:
1170 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1171 */
1172message InteractiveStateChanged {
1173 enum State {
1174 OFF = 0;
1175 ON = 1;
1176 }
1177 optional State state = 1;
1178}
1179
1180/**
Bookatzc1a050a2017-10-10 15:49:28 -07001181 * Logs Battery Saver state change.
1182 *
1183 * Logged from:
1184 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1185 */
1186message BatterySaverModeStateChanged {
1187 enum State {
1188 OFF = 0;
1189 ON = 1;
1190 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001191 optional State state = 1
1192 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001193}
1194
1195/**
1196 * Logs Doze mode state change.
1197 *
1198 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001199 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001200 */
1201message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001202 optional android.server.DeviceIdleModeEnum state = 1
1203 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001204}
1205
1206
1207/**
1208 * Logs state change of Doze mode including maintenance windows.
1209 *
1210 * Logged from:
1211 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1212 */
1213message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001214 optional android.server.DeviceIdleModeEnum state = 1
1215 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001216}
1217
1218/**
1219 * Logs screen brightness level.
1220 *
1221 * Logged from:
1222 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1223 */
1224message ScreenBrightnessChanged {
1225 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1226 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001227}
1228
1229/**
1230 * Logs battery level (percent full, from 0 to 100).
1231 *
1232 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001233 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001234 */
1235message BatteryLevelChanged {
1236 // Battery level. Should be in [0, 100].
1237 optional int32 battery_level = 1;
1238}
1239
1240/**
1241 * Logs change in charging status of the device.
1242 *
1243 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001244 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001245 */
1246message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001247 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1248 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001249}
1250
1251/**
1252 * Logs whether the device is plugged in, and what power source it is using.
1253 *
1254 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001255 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001256 */
1257message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001258 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001259 optional android.os.BatteryPluggedStateEnum state = 1
1260 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001261}
1262
Bookatz8c6571b2017-10-24 15:04:41 -07001263/**
1264 * Logs when an app's wakeup alarm fires.
1265 *
1266 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001267 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001268 */
1269message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001270 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001271
1272 // Name of the wakeup alarm.
1273 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001274
1275 // Name of source package (for historical reasons, since BatteryStats tracked it).
1276 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001277
Ben Murdoch3389f1522019-05-21 15:05:34 +01001278 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001279 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001280}
1281
1282/**
1283 * Logs when an an app causes the mobile radio to change state.
1284 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1285 *
1286 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001287 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001288 */
1289message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001290 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001291
Bookatz1a1b0462018-01-12 11:47:03 -08001292 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1293 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001294}
1295
1296/**
1297 * Logs when an an app causes the wifi radio to change state.
1298 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1299 *
1300 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001301 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001302 */
1303message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001304 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001305
Bookatz1a1b0462018-01-12 11:47:03 -08001306 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1307 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001308}
1309
1310/**
1311 * Logs kernel wakeup reasons and aborts.
1312 *
1313 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001314 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001315 */
1316message KernelWakeupReported {
1317 // Name of the kernel wakeup reason (or abort).
1318 optional string wakeup_reason_name = 1;
1319
1320 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001321 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001322}
1323
1324/**
Bookatzda1798c2018-12-13 14:16:00 -08001325 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001326 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001327 *
1328 * Logged from:
1329 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1330 */
1331message WifiEnabledStateChanged {
1332 enum State {
1333 OFF = 0;
1334 ON = 1;
1335 }
1336 optional State state = 1;
1337}
1338
1339/**
tsaichristinececebdc2020-02-04 14:05:56 -08001340 * This atom is deprecated starting in R.
1341 *
Bookatzda1798c2018-12-13 14:16:00 -08001342 * 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 -08001343 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1344 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001345 *
1346 * Logged from:
1347 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1348 */
1349message WifiRunningStateChanged {
1350 repeated AttributionNode attribution_node = 1;
1351
1352 enum State {
1353 OFF = 0;
1354 ON = 1;
1355 }
1356 optional State state = 2;
1357}
1358
1359/**
Bookatze5885242017-10-24 20:10:31 -07001360 * Logs wifi locks held by an app.
1361 *
1362 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001363 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001364 */
1365message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001366 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001367
1368 enum State {
1369 OFF = 0;
1370 ON = 1;
1371 }
1372 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001373
1374 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1375 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001376}
1377
1378/**
1379 * Logs wifi signal strength changes.
1380 *
1381 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001382 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001383 */
1384message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001385 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1386 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001387}
1388
1389/**
1390 * Logs wifi scans performed by an app.
1391 *
1392 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001393 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001394 */
1395message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001396 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001397
1398 enum State {
1399 OFF = 0;
1400 ON = 1;
1401 }
1402 optional State state = 2;
1403}
1404
1405/**
Tej Singh4503e102018-01-04 14:35:01 -08001406 * Logs wifi multicast locks held by an app
1407 *
1408 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001409 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001410 */
1411message WifiMulticastLockStateChanged {
1412 repeated AttributionNode attribution_node = 1;
1413
1414 enum State {
1415 OFF = 0;
1416 ON = 1;
1417 }
1418 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001419
1420 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001421}
1422
1423/**
Tej Singh1ea42892018-01-19 09:27:00 -08001424 * Logs shutdown reason and duration on next boot.
1425 *
1426 * Logged from:
1427 * frameworks/base/core/java/com/android/server/BootReceiver.java
1428 */
1429message ShutdownSequenceReported {
1430 // True if shutdown is for a reboot. Default: false if we do not know.
1431 optional bool reboot = 1;
1432
1433 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1434 optional string reason = 2;
1435
1436 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1437 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001438 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001439
1440 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001441 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001442}
1443
Tej Singh6483ea42018-01-25 17:45:49 -08001444
1445/**
1446 * Logs boot reason and duration.
1447 *
1448 * Logged from:
1449 * system/core/bootstat/bootstat.cpp
1450 */
1451message BootSequenceReported {
1452 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1453 // Default: "<EMPTY>" if not available.
1454 optional string bootloader_reason = 1;
1455
1456 // Reason for system boot. Eg. bootloader, reboot,userrequested
1457 // Default: "<EMPTY>" if not available.
1458 optional string system_reason = 2;
1459
1460 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001461 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001462
1463 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001464 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001465
1466 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001467 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001468
1469 // Time since last boot in ms. Default: 0 if not available.
1470 optional int64 time_since_last_boot = 6;
1471}
1472
Tej Singhc477d9c2018-02-05 18:31:39 -08001473
1474/**
1475 * Logs call state and disconnect cause (if applicable).
1476 *
1477 * Logged from:
1478 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1479 */
1480message CallStateChanged {
1481 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1482 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1483 optional android.telecom.CallStateEnum call_state = 1;
1484
1485 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1486 // This value is only applicable when the call_state is DISCONNECTED, and
1487 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1488 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1489 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1490
1491 // True if the call is self-managed, which are apps that use the
1492 // telecom infrastructure to make their own calls.
1493 optional bool self_managed = 3;
1494
1495 // True if call is external. External calls are calls on connected Wear
1496 // devices but show up in Telecom so the user can pull them onto the device.
1497 optional bool external_call = 4;
1498}
1499
Tej Singh1ea42892018-01-19 09:27:00 -08001500/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001501 * Logs keyguard state. The keyguard is the lock screen.
1502 *
1503 * Logged from:
1504 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1505 */
1506message KeyguardStateChanged {
1507 enum State {
1508 UNKNOWN = 0;
1509 // The keyguard is hidden when the phone is unlocked.
1510 HIDDEN = 1;
1511 // The keyguard is shown when the phone is locked (screen turns off).
1512 SHOWN= 2;
1513 // The keyguard is occluded when something is overlaying the keyguard.
1514 // Eg. Opening the camera while on the lock screen.
1515 OCCLUDED = 3;
1516 }
1517 optional State state = 1;
1518}
1519
1520/**
1521 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1522 * prompts the user to enter a password (pattern, pin, etc).
1523 *
1524 * Logged from:
1525 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1526 */
1527
1528message KeyguardBouncerStateChanged {
1529 enum State {
1530 UNKNOWN = 0;
1531 // Bouncer is hidden, either as a result of successfully entering the
1532 // password, screen timing out, or user going back to lock screen.
1533 HIDDEN = 1;
1534 // This is when the user is being prompted to enter the password.
1535 SHOWN = 2;
1536 }
1537 optional State state = 1;
1538}
1539
1540/**
1541 * Logs the result of entering a password into the keyguard bouncer.
1542 *
1543 * Logged from:
1544 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1545 */
1546message KeyguardBouncerPasswordEntered {
1547 enum BouncerResult {
1548 UNKNOWN = 0;
1549 // The password entered was incorrect.
1550 FAILURE = 1;
1551 // The password entered was correct.
1552 SUCCESS = 2;
1553 }
1554 optional BouncerResult result = 1;
1555}
1556
Tej Singha883b372018-02-15 11:30:01 -08001557/*
1558 * Logs changes to the configuration of the device. The configuration is defined
1559 * in frameworks/base/core/java/android/content/res/Configuration.java
1560 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1561 * Please go there to interpret the possible values each field can be.
1562 *
1563 * Logged from:
1564 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1565 */
1566message ResourceConfigurationChanged {
1567 // Bit mask of color capabilities of the screen.
1568 // Contains information about the color gamut and hdr mode of the screen.
1569 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001570 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001571
1572 // The target screen density being rendered to.
1573 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001574 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001575
1576 // Current user preference for the scaling factor for fonts,
1577 // relative to the base density scaling.
1578 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001579 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001580
1581 // Flag indicating whether the hard keyboard is hidden.
1582 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001583 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001584
1585 // The type of keyboard attached to the device.
1586 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1587 optional int32 keyboard = 5;
1588
1589 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001591 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001592
1593 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1594 // 0 if undefined.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1596 optional int32 mcc = 7;
1597
1598 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1599 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1600 // MNC_ZERO symbol defined in Configuration.java.
1601 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1602 optional int32 mnc = 8;
1603
1604 // The kind of navigation available on the device.
1605 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1606 optional int32 navigation = 9;
1607
1608 // Flag indicating whether the navigation is available.
1609 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001610 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001611
1612 // Overall orientation of the screen.
1613 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1614 optional int32 orientation = 11;
1615
1616 // The current height of the available screen space, in dp units.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001618 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001619
1620 // Bit mask of overall layout of the screen.
1621 // Contains information about screen size, whether the screen is wider/taller
1622 // than normal, whether the screen layout is right-tl-left or left-to-right,
1623 // and whether the screen has a rounded shape.
1624 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001625 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001626
1627 // Current width of the available screen space, in dp units.
1628 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001629 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001630
1631 // The smallest screen size an application will see in normal operation.
1632 // This is the smallest value of both screenWidthDp and screenHeightDp
1633 // in portrait and landscape.
1634 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001635 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001636
1637 // The type of touch screen attached to the device.
1638 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1639 optional int32 touchscreen = 16;
1640
1641 // Bit mask of the ui mode.
1642 // Contains information about the overall ui mode of the device.
1643 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1644 // Also contains information about whether the device is in night mode.
1645 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001646 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001647}
1648
Tej Singheee317b2018-03-07 19:28:05 -08001649
1650/**
1651 * Logs changes in the connection state of the mobile radio.
1652 *
1653 * Logged from:
1654 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1655 */
1656message MobileConnectionStateChanged {
1657 // States are from the state machine DataConnection.java.
1658 enum State {
1659 UNKNOWN = 0;
1660 // The connection is inactive, or disconnected.
1661 INACTIVE = 1;
1662 // The connection is being activated, or connecting.
1663 ACTIVATING = 2;
1664 // The connection is active, or connected.
1665 ACTIVE = 3;
1666 // The connection is disconnecting.
1667 DISCONNECTING = 4;
1668 // The connection is disconnecting after creating a connection.
1669 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1670 }
1671 optional State state = 1;
1672 // For multi-sim phones, this distinguishes between the sim cards.
1673 optional int32 sim_slot_index = 2;
1674 // Used to identify the connection. Starts at 0 and increments by 1 for
1675 // every new network created. Resets whenever the device reboots.
1676 optional int32 data_connection_id = 3;
1677 // A bitmask for the capabilities of this connection.
1678 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1679 // Default value (if we have no information): 0
1680 optional int64 capabilities = 4;
1681 // If this connection has internet.
1682 // This just checks if the DEFAULT bit of capabilities is set.
1683 optional bool has_internet = 5;
1684}
1685
1686/**
1687 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1688 *
1689 * Logged from:
1690 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1691 */
1692message MobileRadioTechnologyChanged {
1693 optional android.telephony.NetworkTypeEnum state = 1;
1694 // For multi-sim phones, this distinguishes between the sim cards.
1695 optional int32 sim_slot_index = 2;
1696}
1697
Andrew Chantb56388b2018-03-22 21:07:33 -07001698/**
1699 * Logs the VID and PID of any connected USB devices.
1700 *
1701 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1702 *
1703 * Logged by Vendor.
1704 */
1705message UsbDeviceAttached {
1706 optional int32 vid = 1;
1707 optional int32 pid = 2;
1708 optional bool has_audio = 3;
1709 optional bool has_hid = 4;
1710 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001711 enum State {
1712 STATE_DISCONNECTED = 0;
1713 STATE_CONNECTED = 1;
1714 }
1715 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001716 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001717}
1718
Tej Singheee317b2018-03-07 19:28:05 -08001719
Tej Singhdd7bd352018-02-09 19:33:15 -08001720/**
Tej Singh5d991e12018-03-09 19:48:11 -08001721 * Logs when Bluetooth is enabled and disabled.
1722 *
1723 * Logged from:
1724 * services/core/java/com/android/server/BluetoothManagerService.java
1725 */
1726message BluetoothEnabledStateChanged {
1727 repeated AttributionNode attribution_node = 1;
1728 // Whether or not bluetooth is enabled on the device.
1729 enum State {
1730 UNKNOWN = 0;
1731 ENABLED = 1;
1732 DISABLED = 2;
1733 }
1734 optional State state = 2;
1735 // The reason for being enabled/disabled.
1736 // Eg. Airplane mode, crash, application request.
1737 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1738 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001739 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001740}
1741
1742/**
Jack Hed9837c82019-01-09 01:19:13 -08001743 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001744 *
1745 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001746 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1747 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001748 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001749 */
1750message BluetoothConnectionStateChanged {
1751 // The state of the connection.
1752 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1753 optional android.bluetooth.ConnectionStateEnum state = 1;
1754 // An identifier that can be used to match connect and disconnect events.
1755 // Currently is last two bytes of a hash of a device level ID and
1756 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001757 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001758 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001759 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1760 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001761 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001762 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001763 // An identifier that can be used to match events for this device.
1764 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1765 // Salt: Randomly generated 256 bit value
1766 // Hash algorithm: HMAC-SHA256
1767 // Size: 32 byte
1768 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001769 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001770 // An identifier that can be used to match events for this device.
1771 // The incremental identifier is locally generated and guaranteed not derived
1772 // from any globally unique hardware id.
1773 // For paired devices, it stays consistent between Bluetooth toggling for the
1774 // same remote device.
1775 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1776 // session for the same remote device.
1777 // Default: 0 if the device's metric id is unknown.
1778 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001779}
1780
1781/**
1782 * Logs when a Bluetooth device connects and disconnects over ACL
1783 *
1784 * Logged from:
1785 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1786 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001787 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001788 */
1789message BluetoothAclConnectionStateChanged {
1790 // An identifier that can be used to match events for this device.
1791 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1792 // Salt: Randomly generated 256 bit value
1793 // Hash algorithm: HMAC-SHA256
1794 // Size: 32 byte
1795 // Default: null or empty if the device identifier is not known
1796 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1797 // The state of the connection.
1798 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1799 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001800 // An identifier that can be used to match events for this device.
1801 // The incremental identifier is locally generated and guaranteed not derived
1802 // from any globally unique hardware id.
1803 // For paired devices, it stays consistent between Bluetooth toggling for the
1804 // same remote device.
1805 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1806 // session for the same remote device.
1807 // Default: 0 if the device's metric id is unknown.
1808 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001809}
1810
1811/**
1812 * Logs when a Bluetooth device connects and disconnects over SCO
1813 *
1814 * Logged from:
1815 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1816 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1817 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001818 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001819 */
1820message BluetoothScoConnectionStateChanged {
1821 // An identifier that can be used to match events for this device.
1822 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1823 // Salt: Randomly generated 256 bit value
1824 // Hash algorithm: HMAC-SHA256
1825 // Size: 32 byte
1826 // Default: null or empty if the device identifier is not known
1827 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1828 // The state of the connection.
1829 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1830 optional android.bluetooth.ConnectionStateEnum state = 2;
1831 // Codec used for this SCO connection
1832 // Default: UNKNOWN
1833 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001834 // An identifier that can be used to match events for this device.
1835 // The incremental identifier is locally generated and guaranteed not derived
1836 // from any globally unique hardware id.
1837 // For paired devices, it stays consistent between Bluetooth toggling for the
1838 // same remote device.
1839 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1840 // session for the same remote device.
1841 // Default: 0 if the device's metric id is unknown.
1842 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001843}
1844
Jack Hec27040a2019-01-09 20:54:41 -08001845/**
1846 * Logged when active device of a profile changes
1847 *
1848 * Logged from:
1849 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1850 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1851 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1852 */
1853message BluetoothActiveDeviceChanged {
1854 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1855 // From android.bluetooth.BluetoothProfile
1856 optional int32 bt_profile = 1;
1857 // An identifier that can be used to match events for this new active device.
1858 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1859 // Salt: Randomly generated 256 bit value
1860 // Hash algorithm: HMAC-SHA256
1861 // Size: 32 byte
1862 // Default: null or empty if there is no active device for this profile
1863 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001864 // An identifier that can be used to match events for this device.
1865 // The incremental identifier is locally generated and guaranteed not derived
1866 // from any globally unique hardware id.
1867 // For paired devices, it stays consistent between Bluetooth toggling for the
1868 // same remote device.
1869 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1870 // session for the same remote device.
1871 // Default: 0 if the device's metric id is unknown.
1872 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001873}
1874
Jack Heab86dbd22018-12-18 15:43:27 -08001875// Logs when there is an event affecting Bluetooth device's link layer connection.
1876// - This event is triggered when there is a related HCI command or event
1877// - Users of this metrics can deduce Bluetooth device's connection state from these events
1878// - HCI commands are logged before the command is sent, after receiving command status, and after
1879// receiving command complete
1880// - HCI events are logged when they arrive
1881//
1882// Low level log from system/bt
1883//
1884// Bluetooth classic commands:
1885// - CMD_CREATE_CONNECTION
1886// - CMD_DISCONNECT
1887// - CMD_CREATE_CONNECTION_CANCEL
1888// - CMD_ACCEPT_CONNECTION_REQUEST
1889// - CMD_REJECT_CONNECTION_REQUEST
1890// - CMD_SETUP_ESCO_CONNECTION
1891// - CMD_ACCEPT_ESCO_CONNECTION
1892// - CMD_REJECT_ESCO_CONNECTION
1893// - CMD_ENH_SETUP_ESCO_CONNECTION
1894// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1895//
1896// Bluetooth low energy commands:
1897// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1898// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1899// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1900// - CMD_BLE_CLEAR_WHITE_LIST
1901// - CMD_BLE_ADD_WHITE_LIST
1902// - CMD_BLE_REMOVE_WHITE_LIST
1903//
1904// Bluetooth classic events:
1905// - EVT_CONNECTION_COMP
1906// - EVT_CONNECTION_REQUEST
1907// - EVT_DISCONNECTION_COMP
1908// - EVT_ESCO_CONNECTION_COMP
1909// - EVT_ESCO_CONNECTION_CHANGED
1910//
1911// Bluetooth low energy meta events:
1912// - BLE_EVT_CONN_COMPLETE_EVT
1913// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1914//
1915// Next tag: 10
1916message BluetoothLinkLayerConnectionEvent {
1917 // An identifier that can be used to match events for this device.
1918 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1919 // Salt: Randomly generated 256 bit value
1920 // Hash algorithm: HMAC-SHA256
1921 // Size: 32 byte
1922 // Default: null or empty if the device identifier is not known
1923 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1924 // Connection handle of this connection if available
1925 // Range: 0x0000 - 0x0EFF (12 bits)
1926 // Default: 0xFFFF if the handle is unknown
1927 optional int32 connection_handle = 2;
1928 // Direction of the link
1929 // Default: DIRECTION_UNKNOWN
1930 optional android.bluetooth.DirectionEnum direction = 3;
1931 // Type of this link
1932 // Default: LINK_TYPE_UNKNOWN
1933 optional android.bluetooth.LinkTypeEnum type = 4;
1934
1935 // Reason metadata for this link layer connection event, rules for interpretation:
1936 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1937 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1938 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1939 // set and valid, ignore hci_ble_event
1940
1941 // HCI command associated with this event
1942 // Default: CMD_UNKNOWN
1943 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1944 // HCI event associated with this event
1945 // Default: EVT_UNKNOWN
1946 optional android.bluetooth.hci.EventEnum hci_event = 6;
1947 // HCI BLE meta event associated with this event
1948 // Default: BLE_EVT_UNKNOWN
1949 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1950 // HCI command status code if this is triggerred by hci_cmd
1951 // Default: STATUS_UNKNOWN
1952 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1953 // HCI reason code associated with this event
1954 // Default: STATUS_UNKNOWN
1955 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001956 // An identifier that can be used to match events for this device.
1957 // The incremental identifier is locally generated and guaranteed not derived
1958 // from any globally unique hardware id.
1959 // For paired devices, it stays consistent between Bluetooth toggling for the
1960 // same remote device.
1961 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1962 // session for the same remote device.
1963 // Default: 0 if the device's metric id is unknown.
1964 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001965}
1966
Howard Roe103fe22019-01-17 16:52:16 -08001967/**
1968 * Logs when a module is rolled back by Watchdog.
1969 *
1970 * Logged from: Rollback Manager
1971 */
1972message WatchdogRollbackOccurred {
1973 enum RollbackType {
1974 UNKNOWN = 0;
1975 ROLLBACK_INITIATE = 1;
1976 ROLLBACK_SUCCESS = 2;
1977 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001978 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001979 }
1980 optional RollbackType rollback_type = 1;
1981
1982 optional string package_name = 2;
1983
1984 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001985
1986 enum RollbackReasonType {
1987 REASON_UNKNOWN = 0;
1988 REASON_NATIVE_CRASH = 1;
1989 REASON_EXPLICIT_HEALTH_CHECK = 2;
1990 REASON_APP_CRASH = 3;
1991 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001992 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001993 }
1994 optional RollbackReasonType rollback_reason = 4;
1995
1996 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1997 // is initiated. Empty if the package is unknown.
1998 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001999
2000 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002001}
2002
Jack Hec27040a2019-01-09 20:54:41 -08002003/**
2004 * Logs when there is a change in Bluetooth A2DP playback state
2005 *
2006 * Logged from:
2007 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2008 */
2009message BluetoothA2dpPlaybackStateChanged {
2010 // An identifier that can be used to match events for this device.
2011 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2012 // Salt: Randomly generated 256 bit value
2013 // Hash algorithm: HMAC-SHA256
2014 // Size: 32 byte
2015 // Default: null or empty if the device identifier is not known
2016 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2017 // Current playback state
2018 // Default: PLAYBACK_STATE_UNKNOWN
2019 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2020 // Current audio coding mode
2021 // Default: AUDIO_CODING_MODE_UNKNOWN
2022 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002023 // An identifier that can be used to match events for this device.
2024 // The incremental identifier is locally generated and guaranteed not derived
2025 // from any globally unique hardware id.
2026 // For paired devices, it stays consistent between Bluetooth toggling for the
2027 // same remote device.
2028 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2029 // session for the same remote device.
2030 // Default: 0 if the device's metric id is unknown.
2031 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002032}
2033
2034/**
2035 * Logs when there is a change in A2DP codec config for a particular remote device
2036 *
2037 * Logged from:
2038 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2039 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2040 */
2041message BluetoothA2dpCodecConfigChanged {
2042 // An identifier that can be used to match events for this device.
2043 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2044 // Salt: Randomly generated 256 bit value
2045 // Hash algorithm: HMAC-SHA256
2046 // Size: 32 byte
2047 // Default: null or empty if the device identifier is not known
2048 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2049 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2050 // Default SOURCE_CODEC_TYPE_INVALID
2051 optional int32 codec_type = 2;
2052 // Codec priroity, the higher the more preferred, -1 for disabled
2053 // Default: CODEC_PRIORITY_DEFAULT
2054 optional int32 codec_priority = 3;
2055 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2056 // Default: SAMPLE_RATE_NONE
2057 optional int32 sample_rate = 4;
2058 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2059 // Default: BITS_PER_SAMPLE_NONE
2060 optional int32 bits_per_sample = 5;
2061 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2062 // Default: CHANNEL_MODE_NONE
2063 optional int32 channel_mode = 6;
2064 // Codec specific values
2065 // Default 0
2066 optional int64 codec_specific_1 = 7;
2067 optional int64 codec_specific_2 = 8;
2068 optional int64 codec_specific_3 = 9;
2069 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002070 // An identifier that can be used to match events for this device.
2071 // The incremental identifier is locally generated and guaranteed not derived
2072 // from any globally unique hardware id.
2073 // For paired devices, it stays consistent between Bluetooth toggling for the
2074 // same remote device.
2075 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2076 // session for the same remote device.
2077 // Default: 0 if the device's metric id is unknown.
2078 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002079}
2080
2081/**
2082 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2083 * Each codec's capability is logged separately due to statsd restriction
2084 *
2085 * Logged from:
2086 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2087 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2088 */
2089message BluetoothA2dpCodecCapabilityChanged {
2090 // An identifier that can be used to match events for this device.
2091 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2092 // Salt: Randomly generated 256 bit value
2093 // Hash algorithm: HMAC-SHA256
2094 // Size: 32 byte
2095 // Default: null or empty if the device identifier is not known
2096 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2097 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2098 // Default SOURCE_CODEC_TYPE_INVALID
2099 optional int32 codec_type = 2;
2100 // Codec priroity, the higher the more preferred, -1 for disabled
2101 // Default: CODEC_PRIORITY_DEFAULT
2102 optional int32 codec_priority = 3;
2103 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2104 // in BluetoothCodecConfig
2105 // Default: empty and SAMPLE_RATE_NONE for individual item
2106 optional int32 sample_rate = 4;
2107 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2108 // in BluetoothCodecConfig
2109 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2110 optional int32 bits_per_sample = 5;
2111 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2112 // BluetoothCodecConfig
2113 // Default: empty and CHANNEL_MODE_NONE for individual item
2114 optional int32 channel_mode = 6;
2115 // Codec specific values
2116 // Default 0
2117 optional int64 codec_specific_1 = 7;
2118 optional int64 codec_specific_2 = 8;
2119 optional int64 codec_specific_3 = 9;
2120 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002121 // An identifier that can be used to match events for this device.
2122 // The incremental identifier is locally generated and guaranteed not derived
2123 // from any globally unique hardware id.
2124 // For paired devices, it stays consistent between Bluetooth toggling for the
2125 // same remote device.
2126 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2127 // session for the same remote device.
2128 // Default: 0 if the device's metric id is unknown.
2129 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002130}
2131
2132/**
2133 * Logs when A2DP failed to read from PCM source.
2134 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2135 *
2136 * Logged from:
2137 * system/bt
2138 */
2139message BluetoothA2dpAudioUnderrunReported {
2140 // An identifier that can be used to match events for this device.
2141 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2142 // Salt: Randomly generated 256 bit value
2143 // Hash algorithm: HMAC-SHA256
2144 // Size: 32 byte
2145 // Default: null or empty if the device identifier is not known
2146 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2147 // Encoding interval in nanoseconds
2148 // Default: 0
2149 optional int64 encoding_interval_nanos = 2;
2150 // Number of bytes of PCM data that could not be read from the source
2151 // Default: 0
2152 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002153 // An identifier that can be used to match events for this device.
2154 // The incremental identifier is locally generated and guaranteed not derived
2155 // from any globally unique hardware id.
2156 // For paired devices, it stays consistent between Bluetooth toggling for the
2157 // same remote device.
2158 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2159 // session for the same remote device.
2160 // Default: 0 if the device's metric id is unknown.
2161 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002162}
2163
2164/**
2165 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2166 * buffer queue is full and we have to drop data
2167 *
2168 * Logged from:
2169 * system/bt
2170 */
2171message BluetoothA2dpAudioOverrunReported {
2172 // An identifier that can be used to match events for this device.
2173 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2174 // Salt: Randomly generated 256 bit value
2175 // Hash algorithm: HMAC-SHA256
2176 // Size: 32 byte
2177 // Default: null or empty if the device identifier is not known
2178 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2179 // Encoding interval in nanoseconds
2180 // Default: 0
2181 optional int64 encoding_interval_nanos = 2;
2182 // Number of buffers dropped in this event
2183 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2184 // Default: 0
2185 optional int32 num_dropped_buffers = 3;
2186 // Number of encoded buffers dropped in this event
2187 // Default 0
2188 optional int32 num_dropped_encoded_frames = 4;
2189 // Number of encoded bytes dropped in this event
2190 // Default: 0
2191 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002192 // An identifier that can be used to match events for this device.
2193 // The incremental identifier is locally generated and guaranteed not derived
2194 // from any globally unique hardware id.
2195 // For paired devices, it stays consistent between Bluetooth toggling for the
2196 // same remote device.
2197 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2198 // session for the same remote device.
2199 // Default: 0 if the device's metric id is unknown.
2200 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002201}
2202
2203/**
2204 * Logs when we receive reports regarding a device's RSSI value
2205 *
2206 * Logged from:
2207 * system/bt
2208 */
2209message BluetoothDeviceRssiReported {
2210 // An identifier that can be used to match events for this device.
2211 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2212 // Salt: Randomly generated 256 bit value
2213 // Hash algorithm: HMAC-SHA256
2214 // Size: 32 byte
2215 // Default: null or empty if the device identifier is not known
2216 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2217 // Connection handle of this connection if available
2218 // Range: 0x0000 - 0x0EFF (12 bits)
2219 // Default: 0xFFFF if the handle is unknown
2220 optional int32 connection_handle = 2;
2221 // HCI command status code if this is triggerred by hci_cmd
2222 // Default: STATUS_UNKNOWN
2223 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2224 // BR/EDR
2225 // Range: -128 ≤ N ≤ 127 (signed integer)
2226 // Units: dB
2227 // LE:
2228 // Range: -127 to 20, 127 (signed integer)
2229 // Units: dBm
2230 // Invalid when an out of range value is reported
2231 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002232 // An identifier that can be used to match events for this device.
2233 // The incremental identifier is locally generated and guaranteed not derived
2234 // from any globally unique hardware id.
2235 // For paired devices, it stays consistent between Bluetooth toggling for the
2236 // same remote device.
2237 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2238 // session for the same remote device.
2239 // Default: 0 if the device's metric id is unknown.
2240 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002241}
2242
2243/**
2244 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2245 *
2246 * Logged from:
2247 * system/bt
2248 */
2249message BluetoothDeviceFailedContactCounterReported {
2250 // An identifier that can be used to match events for this device.
2251 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2252 // Salt: Randomly generated 256 bit value
2253 // Hash algorithm: HMAC-SHA256
2254 // Size: 32 byte
2255 // Default: null or empty if the device identifier is not known
2256 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2257 // Connection handle of this connection if available
2258 // Range: 0x0000 - 0x0EFF (12 bits)
2259 // Default: 0xFFFF if the handle is unknown
2260 optional int32 connection_handle = 2;
2261 // HCI command status code if this is triggerred by hci_cmd
2262 // Default: STATUS_UNKNOWN
2263 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2264 // Number of consecutive failed contacts for a connection corresponding to the Handle
2265 // Range: uint16_t, 0-0xFFFF
2266 // Default: 0xFFFFF
2267 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002268 // An identifier that can be used to match events for this device.
2269 // The incremental identifier is locally generated and guaranteed not derived
2270 // from any globally unique hardware id.
2271 // For paired devices, it stays consistent between Bluetooth toggling for the
2272 // same remote device.
2273 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2274 // session for the same remote device.
2275 // Default: 0 if the device's metric id is unknown.
2276 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002277}
2278
2279/**
2280 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2281 *
2282 * Logged from:
2283 * system/bt
2284 */
2285message BluetoothDeviceTxPowerLevelReported {
2286 // An identifier that can be used to match events for this device.
2287 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2288 // Salt: Randomly generated 256 bit value
2289 // Hash algorithm: HMAC-SHA256
2290 // Size: 32 byte
2291 // Default: null or empty if the device identifier is not known
2292 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2293 // Connection handle of this connection if available
2294 // Range: 0x0000 - 0x0EFF (12 bits)
2295 // Default: 0xFFFF if the handle is unknown
2296 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002297 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002298 // Default: STATUS_UNKNOWN
2299 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2300 // Range: -30 ≤ N ≤ 20
2301 // Units: dBm
2302 // Invalid when an out of range value is reported
2303 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002304 // An identifier that can be used to match events for this device.
2305 // The incremental identifier is locally generated and guaranteed not derived
2306 // from any globally unique hardware id.
2307 // For paired devices, it stays consistent between Bluetooth toggling for the
2308 // same remote device.
2309 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2310 // session for the same remote device.
2311 // Default: 0 if the device's metric id is unknown.
2312 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002313}
Jack Heab86dbd22018-12-18 15:43:27 -08002314
Tej Singh5d991e12018-03-09 19:48:11 -08002315/**
Jack He1021a612019-01-20 21:22:46 -08002316 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2317 * receiving an HCI command from the host
2318 *
2319 * Logged from: system/bt
2320 */
2321message BluetoothHciTimeoutReported {
2322 // HCI command associated with this event
2323 // Default: CMD_UNKNOWN
2324 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2325}
2326
2327/**
2328 * Logs when we receive Bluetooth Link Quality Report event from the controller
2329 * See Android Bluetooth HCI specification for more details
2330 *
2331 * Note: all count and bytes field are counted since last event
2332 *
2333 * Logged from: system/bt
2334 */
2335message BluetoothQualityReportReported {
2336 // Quality report ID
2337 // Original type: uint8_t
2338 // Default: BQR_ID_UNKNOWN
2339 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2340 // Packet type of the connection
2341 // Original type: uint8_t
2342 // Default: BQR_PACKET_TYPE_UNKNOWN
2343 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2344 // Connection handle of the connection
2345 // Original type: uint16_t
2346 optional int32 connection_handle = 3;
2347 // Performing Role for the connection
2348 // Original type: uint8_t
2349 optional int32 connection_role = 4;
2350 // Current Transmit Power Level for the connection. This value is the same as the controller's
2351 // response to the HCI_Read_Transmit_Power_Level HCI command
2352 // Original type: uint8_t
2353 optional int32 tx_power_level = 5;
2354 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2355 // absolute receiver signal strength value
2356 // Original type: int8_t
2357 optional int32 rssi = 6;
2358 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2359 // channels used by the link currently
2360 // Original type: uint8_t
2361 optional int32 snr = 7;
2362 // Indicates the number of unused channels in AFH_channel_map
2363 // Original type: uint8_t
2364 optional int32 unused_afh_channel_count = 8;
2365 // Indicates the number of the channels which are interfered and quality is bad but are still
2366 // selected for AFH
2367 // Original type: uint8_t
2368 optional int32 afh_select_unideal_channel_count = 9;
2369 // Current Link Supervision Timeout Setting
2370 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2371 // Original type: uint16_t
2372 optional int32 lsto = 10;
2373 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2374 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2375 // 0x01 (Piconet Clock)
2376 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2377 // Original type: uint32_t
2378 optional int64 connection_piconet_clock = 11;
2379 // The count of retransmission
2380 // Original type: uint32_t
2381 optional int64 retransmission_count = 12;
2382 // The count of no RX
2383 // Original type: uint32_t
2384 optional int64 no_rx_count = 13;
2385 // The count of NAK (Negative Acknowledge)
2386 // Original type: uint32_t
2387 optional int64 nak_count = 14;
2388 // Controller timestamp of last TX ACK
2389 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2390 // Original type: uint32_t
2391 optional int64 last_tx_ack_timestamp = 15;
2392 // The count of Flow-off (STOP)
2393 // Original type: uint32_t
2394 optional int64 flow_off_count = 16;
2395 // Controller timestamp of last Flow-on (GO)
2396 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2397 // Original type: uint32_t
2398 optional int64 last_flow_on_timestamp = 17;
2399 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2400 // Original type: uint32_t
2401 optional int64 buffer_overflow_bytes = 18;
2402 // Buffer underflow count (in byte) since last event
2403 // Original type: uint32_t
2404 optional int64 buffer_underflow_bytes = 19;
2405}
2406
2407/**
2408 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2409 *
2410 * Notes:
2411 * - Each event can be partially filled as we might learn different pieces of device
2412 * information at different time
2413 * - Multiple device info events can be combined to give more complete picture
2414 * - When multiple device info events tries to describe the same information, the
2415 * later one wins
2416 *
2417 * Logged from:
2418 * packages/apps/Bluetooth
2419 */
Jack Heaea26982019-04-04 11:19:48 -07002420message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002421 // An identifier that can be used to match events for this device.
2422 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2423 // Salt: Randomly generated 256 bit value
2424 // Hash algorithm: HMAC-SHA256
2425 // Size: 32 byte
2426 // Default: null or empty if the device identifier is not known
2427 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2428 // Where is this device info obtained from
2429 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2430 // Name of the data source
2431 // For EXTERNAL: package name of the data source
2432 // For INTERNAL: null for general case, component name otherwise
2433 optional string source_name = 3;
2434 // Name of the manufacturer of this device
2435 optional string manufacturer = 4;
2436 // Model of this device
2437 optional string model = 5;
2438 // Hardware version of this device
2439 optional string hardware_version = 6;
2440 // Software version of this device
2441 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002442 // An identifier that can be used to match events for this device.
2443 // The incremental identifier is locally generated and guaranteed not derived
2444 // from any globally unique hardware id.
2445 // For paired devices, it stays consistent between Bluetooth toggling for the
2446 // same remote device.
2447 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2448 // session for the same remote device.
2449 // Default: 0 if the device's metric id is unknown.
2450 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002451}
2452
2453/**
2454 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2455 * device, as documented by the Bluetooth Core HCI specification
2456 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2457 * Vol 2, Part E, Page 1118
2458 *
2459 * Logged from:
2460 * system/bt
2461 */
2462message BluetoothRemoteVersionInfoReported {
2463 // Connection handle of the connection
2464 // Original type: uint16_t
2465 optional int32 connection_handle = 1;
2466 // HCI command status code
2467 // Default: STATUS_UNKNOWN
2468 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2469 // 1 byte Version of current LMP in the remote controller
2470 optional int32 lmp_version = 3;
2471 // 2 bytes LMP manufacturer code of the remote controller
2472 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2473 optional int32 lmp_manufacturer_code = 4;
2474 // 4 bytes subversion of the LMP in the remote controller
2475 optional int32 lmp_subversion = 5;
2476}
2477
2478/**
2479 * Logs when certain Bluetooth SDP attributes are discovered
2480 * Constant definitions are from:
2481 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2482 *
2483 * Current logged attributes:
2484 * - BluetoothProfileDescriptorList
2485 * - Supported Features Bitmask
2486 *
2487 * Logged from:
2488 * system/bt
2489 */
2490message BluetoothSdpAttributeReported {
2491 // An identifier that can be used to match events for this device.
2492 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2493 // Salt: Randomly generated 256 bit value
2494 // Hash algorithm: HMAC-SHA256
2495 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2496 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2497 // Original type: uint16_t
2498 optional int32 protocol_uuid = 2;
2499 // Short form UUIDs used to identify Bluetooth SDP attribute types
2500 // Original type: uint16_t
2501 optional int32 attribute_id = 3;
2502 // Attribute value for the particular attribute
2503 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002504 // An identifier that can be used to match events for this device.
2505 // The incremental identifier is locally generated and guaranteed not derived
2506 // from any globally unique hardware id.
2507 // For paired devices, it stays consistent between Bluetooth toggling for the
2508 // same remote device.
2509 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2510 // session for the same remote device.
2511 // Default: 0 if the device's metric id is unknown.
2512 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002513}
2514
2515/**
2516 * Logs when bond state of a Bluetooth device changes
2517 *
2518 * Logged from:
2519 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2520 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2521 */
2522message BluetoothBondStateChanged {
2523 // An identifier that can be used to match events for this device.
2524 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2525 // Salt: Randomly generated 256 bit value
2526 // Hash algorithm: HMAC-SHA256
2527 // Size: 32 byte
2528 // Default: null or empty if the device identifier is not known
2529 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2530 // Preferred transport type to remote dual mode device
2531 // Default: TRANSPORT_AUTO means no preference
2532 optional android.bluetooth.TransportTypeEnum transport = 2;
2533 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2534 // Default: UNKNOWN
2535 optional android.bluetooth.DeviceTypeEnum type = 3;
2536 // Current bond state (NONE, BONDING, BONDED)
2537 // Default: BOND_STATE_UNKNOWN
2538 optional android.bluetooth.BondStateEnum bond_state = 4;
2539 // Bonding sub state
2540 // Default: BOND_SUB_STATE_UNKNOWN
2541 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2542 // Unbond Reason
2543 // Default: UNBOND_REASON_UNKNOWN
2544 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002545 // An identifier that can be used to match events for this device.
2546 // The incremental identifier is locally generated and guaranteed not derived
2547 // from any globally unique hardware id.
2548 // For paired devices, it stays consistent between Bluetooth toggling for the
2549 // same remote device.
2550 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2551 // session for the same remote device.
2552 // Default: 0 if the device's metric id is unknown.
2553 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002554}
2555
2556/**
2557 * Logs there is an event related Bluetooth classic pairing
2558 *
2559 * Logged from:
2560 * system/bt
2561 */
2562message BluetoothClassicPairingEventReported {
2563 // An identifier that can be used to match events for this device.
2564 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2565 // Salt: Randomly generated 256 bit value
2566 // Hash algorithm: HMAC-SHA256
2567 // Size: 32 byte
2568 // Default: null or empty if the device identifier is not known
2569 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2570 // Connection handle of this connection if available
2571 // Range: 0x0000 - 0x0EFF (12 bits)
2572 // Default: 0xFFFF if the handle is unknown
2573 optional int32 connection_handle = 2;
2574 // HCI command associated with this event
2575 // Default: CMD_UNKNOWN
2576 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2577 // HCI event associated with this event
2578 // Default: EVT_UNKNOWN
2579 optional android.bluetooth.hci.EventEnum hci_event = 4;
2580 // HCI command status code if this is triggerred by hci_cmd
2581 // Default: STATUS_UNKNOWN
2582 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2583 // HCI reason code associated with this event
2584 // Default: STATUS_UNKNOWN
2585 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002586 // A status value related to this specific event
2587 // Default: 0
2588 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002589 // An identifier that can be used to match events for this device.
2590 // The incremental identifier is locally generated and guaranteed not derived
2591 // from any globally unique hardware id.
2592 // For paired devices, it stays consistent between Bluetooth toggling for the
2593 // same remote device.
2594 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2595 // session for the same remote device.
2596 // Default: 0 if the device's metric id is unknown.
2597 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002598}
2599
2600/**
2601 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2602 *
2603 * Logged from:
2604 * system/bt
2605 */
2606message BluetoothSmpPairingEventReported {
2607 // An identifier that can be used to match events for this device.
2608 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2609 // Salt: Randomly generated 256 bit value
2610 // Hash algorithm: HMAC-SHA256
2611 // Size: 32 byte
2612 // Default: null or empty if the device identifier is not known
2613 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2614 // SMP command sent or received over L2CAP
2615 // Default: CMD_UNKNOWN
2616 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2617 // Whether this command is sent or received
2618 // Default: DIRECTION_UNKNOWN
2619 optional android.bluetooth.DirectionEnum direction = 3;
2620 // SMP failure reason code
2621 // Default: PAIRING_FAIL_REASON_DEFAULT
2622 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002623 // An identifier that can be used to match events for this device.
2624 // The incremental identifier is locally generated and guaranteed not derived
2625 // from any globally unique hardware id.
2626 // For paired devices, it stays consistent between Bluetooth toggling for the
2627 // same remote device.
2628 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2629 // session for the same remote device.
2630 // Default: 0 if the device's metric id is unknown.
2631 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002632}
2633
2634/**
Jack He815cdba2019-01-30 17:24:55 -08002635 * Logs when a Bluetooth socket’s connection state changed
2636 *
2637 * Logged from:
2638 * system/bt
2639 */
2640message BluetoothSocketConnectionStateChanged {
2641 // An identifier that can be used to match events for this device.
2642 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2643 // Salt: Randomly generated 256 bit value
2644 // Hash algorithm: HMAC-SHA256
2645 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002646 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002647 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002648 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002649 // Default 0 when unknown or don't care
2650 optional int32 port = 2;
2651 // Socket type as mentioned in
2652 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2653 // Default: SOCKET_TYPE_UNKNOWN
2654 optional android.bluetooth.SocketTypeEnum type = 3;
2655 // Socket connection state
2656 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2657 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2658 // Number of bytes sent to remote device during this connection
2659 optional int64 tx_bytes = 5;
2660 // Number of bytes received from remote device during this connection
2661 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002662 // Socket owner's UID
2663 optional int32 uid = 7 [(is_uid) = true];
2664 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2665 // |port| must be spawned by |server_port|
2666 // Default 0 when unknown or don't care
2667 optional int32 server_port = 8;
2668 // Whether this is a server listener socket
2669 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002670 // An identifier that can be used to match events for this device.
2671 // The incremental identifier is locally generated and guaranteed not derived
2672 // from any globally unique hardware id.
2673 // For paired devices, it stays consistent between Bluetooth toggling for the
2674 // same remote device.
2675 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2676 // session for the same remote device.
2677 // Default: 0 if the device's metric id is unknown.
2678 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002679}
2680
2681/**
Jack He71426802019-04-02 13:32:52 -07002682 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2683 *
2684 * Logged from:
2685 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2686 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2687 *
2688 */
2689message BluetoothClassOfDeviceReported {
2690 // An identifier that can be used to match events for this device.
2691 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2692 // Salt: Randomly generated 256 bit value
2693 // Hash algorithm: HMAC-SHA256
2694 // Size: 32 byte
2695 // Default: null or empty if this is a server listener socket
2696 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2697 // Class of Device (CoD) value including both Major, Minor device class and service class
2698 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2699 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2700 // Default: 0
2701 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002702 // An identifier that can be used to match events for this device.
2703 // The incremental identifier is locally generated and guaranteed not derived
2704 // from any globally unique hardware id.
2705 // For paired devices, it stays consistent between Bluetooth toggling for the
2706 // same remote device.
2707 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2708 // session for the same remote device.
2709 // Default: 0 if the device's metric id is unknown.
2710 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002711}
2712
2713/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002714 * Logs when something is plugged into or removed from the USB-C connector.
2715 *
2716 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002717 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002718 */
2719message UsbConnectorStateChanged {
2720 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002721 STATE_DISCONNECTED = 0;
2722 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002723 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002724 optional State state = 1
2725 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2726 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002727 // Last active session in ms.
2728 // 0 when the port is in connected state.
2729 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002730}
2731
2732/**
2733 * Logs the reported speaker impedance.
2734 *
2735 * Logged from:
2736 * Vendor audio implementation.
2737 */
2738message SpeakerImpedanceReported {
2739 optional int32 speaker_location = 1;
2740 optional int32 impedance = 2;
2741}
2742
2743/**
2744 * Logs the report of a failed hardware.
2745 *
2746 * Logged from:
2747 * Vendor HALs.
2748 *
2749 */
2750message HardwareFailed {
2751 enum HardwareType {
2752 HARDWARE_FAILED_UNKNOWN = 0;
2753 HARDWARE_FAILED_MICROPHONE = 1;
2754 HARDWARE_FAILED_CODEC = 2;
2755 HARDWARE_FAILED_SPEAKER = 3;
2756 HARDWARE_FAILED_FINGERPRINT = 4;
2757 }
2758 optional HardwareType hardware_type = 1;
2759
Maggie White6dcd8572019-01-31 14:11:50 -08002760 /**
2761 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002762 * the same hardware_type. The specific locations are vendor defined integers,
2763 * referring to board-specific numbering schemes.
2764 */
2765 optional int32 hardware_location = 2;
2766
Maggie White6dcd8572019-01-31 14:11:50 -08002767 /**
2768 * failure_code is specific to the HardwareType of the failed hardware.
2769 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002770 */
Maggie White6dcd8572019-01-31 14:11:50 -08002771 enum HardwareErrorCode {
2772 UNKNOWN = 0;
2773 COMPLETE = 1;
2774 SPEAKER_HIGH_Z = 2;
2775 SPEAKER_SHORT = 3;
2776 FINGERPRINT_SENSOR_BROKEN = 4;
2777 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002778 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002779 }
2780 optional int32 failure_code = 3;
2781}
2782
2783/**
2784 * Log an event when the device has been physically dropped.
2785 * Reported from the /vendor partition.
2786 */
2787message PhysicalDropDetected {
2788 // Confidence that the event was actually a drop, 0 -> 100
2789 optional int32 confidence_pctg = 1;
2790 // Peak acceleration of the drop, in 1/1000s of a g.
2791 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002792 // Duration of freefall in ms
2793 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002794}
2795
2796/**
2797 * Log bucketed battery charge cycles.
2798 *
2799 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002800 * a given charge point. For example, if 10 cycle buckets are
2801 * initialized, bucket 1 is the lowest 1/10th of the battery,
2802 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002803 *
2804 * Logged from:
2805 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2806 */
2807message ChargeCyclesReported {
2808 optional int32 cycle_bucket_1 = 1;
2809 optional int32 cycle_bucket_2 = 2;
2810 optional int32 cycle_bucket_3 = 3;
2811 optional int32 cycle_bucket_4 = 4;
2812 optional int32 cycle_bucket_5 = 5;
2813 optional int32 cycle_bucket_6 = 6;
2814 optional int32 cycle_bucket_7 = 7;
2815 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002816 optional int32 cycle_bucket_9 = 9;
2817 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002818}
2819
2820/**
Howard Roa46b6582018-09-18 16:45:02 -07002821 * Log battery health snapshot.
2822 *
2823 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2824 * are snapshotted periodically over 24hrs.
2825 */
2826message BatteryHealthSnapshot {
2827 enum BatterySnapshotType {
2828 UNKNOWN = 0;
2829 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2830 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2831 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2832 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2833 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2834 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2835 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2836 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2837 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2838 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2839 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2840 }
2841 optional BatterySnapshotType type = 1;
2842 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002843 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002844 // Voltage Battery Voltage, in microVolts.
2845 optional int32 voltage_micro_volt = 3;
2846 // Current Battery current, in microAmps.
2847 optional int32 current_micro_amps = 4;
2848 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2849 optional int32 open_circuit_micro_volt = 5;
2850 // Resistance Battery Resistance, in microOhms.
2851 optional int32 resistance_micro_ohm = 6;
2852 // Level Battery Level, as % of full.
2853 optional int32 level_percent = 7;
2854}
2855
2856/**
2857 * Log slow I/O operations on the primary storage.
2858 */
2859message SlowIo {
2860 // Classifications of IO Operations.
2861 enum IoOperation {
2862 UNKNOWN = 0;
2863 READ = 1;
2864 WRITE = 2;
2865 UNMAP = 3;
2866 SYNC = 4;
2867 }
2868 optional IoOperation operation = 1;
2869
2870 // The number of slow IO operations of this type over 24 hours.
2871 optional int32 count = 2;
2872}
2873
2874/**
2875 * Log battery caused shutdown with the last recorded voltage.
2876 */
2877message BatteryCausedShutdown {
2878 // The last recorded battery voltage prior to shutdown.
2879 optional int32 last_recorded_micro_volt = 1;
2880}
2881
2882/**
Tej Singha72344992019-04-17 18:55:08 -07002883 * Logs when ThermalService receives throttling events.
2884 *
2885 * Logged from:
2886 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2887 */
2888message ThermalThrottlingSeverityStateChanged {
2889 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2890 optional android.os.TemperatureTypeEnum sensor_type = 1;
2891
2892 // The name of the temperature source. Eg. CPU0
2893 optional string sensor_name = 2;
2894
2895 // Temperature in tenths of a degree C.
2896 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2897 optional int32 temperature_deci_celsius = 3;
2898
2899 // Relative severity of the throttling, see enum definition.
2900 optional android.os.ThrottlingSeverityEnum severity = 4;
2901}
2902
2903/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002904 * Logs the duration of a davey (jank of >=700ms) when it occurs
2905 *
2906 * Logged from:
2907 * frameworks/base/libs/hwui/JankTracker.cpp
2908 */
2909message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002910 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002911 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002912
Tej Singhbb8554a2018-01-26 11:59:14 -08002913 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002914 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002915}
2916
2917/**
Bookatze5885242017-10-24 20:10:31 -07002918 * Logs phone signal strength changes.
2919 *
2920 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002921 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002922 */
2923message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002924 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2925 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002926}
2927
Yangster4ccebea2018-10-09 17:09:02 -07002928
2929/**
2930 * Logs when the phone state, sim state or signal strength changes
2931 *
2932 * Logged from:
2933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2934 */
2935message PhoneServiceStateChanged {
2936 optional android.telephony.ServiceStateEnum state = 1;
2937 optional android.telephony.SimStateEnum sim_state = 2;
2938 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2939}
2940
2941/**
2942 * Logs when the phone becomes on or off.
2943 *
2944 * Logged from:
2945 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2946 */
2947message PhoneStateChanged {
2948 enum State {
2949 OFF = 0;
2950 ON = 1;
2951 }
2952 optional State state = 1;
2953}
2954
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002955message BackGesture {
2956 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002957 DEFAULT_BACK_TYPE = 0;
2958 COMPLETED = 1;
2959 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2960 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2961 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2962 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2963 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2964 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2965 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002966 }
2967 optional BackType type = 1;
2968
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002969 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2970 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2971 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2972 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2973 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2974 optional int32 left_boundary = 8; // left edge width + left inset
2975 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2976
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002977 enum WindowHorizontalLocation {
2978 DEFAULT_LOCATION = 0;
2979 LEFT = 1;
2980 RIGHT = 2;
2981 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002982 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002983}
2984
2985message ExclusionRectStateChanged {
2986 optional string component_name = 1; // if not available, simply packageName
2987 optional int32 requested_height = 2; // px
2988 optional int32 rejected_height = 3; // px
2989
2990 enum WindowHorizontalLocation {
2991 DEFAULT_LOCATION = 0;
2992 LEFT = 1;
2993 RIGHT = 2;
2994 }
2995 optional WindowHorizontalLocation x_location = 4;
2996 optional bool landscape = 5;
2997 optional bool splitscreen = 6;
2998 optional int32 duration_millis = 7;
2999}
3000
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003001/**
3002 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3003 *
3004 * Logged from:
3005 * packages/apps/Launcher3
3006 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003007message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003008 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003009 optional android.stats.launcher.LauncherState src_state = 2;
3010 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003011 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3012 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3013
3014 // The event id (e.g., app launch, drag and drop, long press)
3015 optional int32 event_id = 6;
3016 // The event's source or target id (e.g., icon, task, button)
3017 optional int32 target_id = 7;
3018 // If the target needs to be tracked, use this id field
3019 optional int32 instance_id = 8;
3020 optional int32 uid = 9 [(is_uid) = true];
3021 optional string package_name = 10;
3022 optional string component_name = 11;
3023
3024 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003025 optional int32 grid_x = 12 [default = -1];
3026 optional int32 grid_y = 13 [default = -1];
3027 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003028
3029 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003030 optional int32 grid_x_parent = 15 [default = -1];
3031 optional int32 grid_y_parent = 16 [default = -1];
3032 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003033
3034 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3035 optional int32 hierarchy = 18;
3036
3037 optional bool is_work_profile = 19;
3038
3039 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003040 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003041
3042 // e.g., folderLabelState can be captured in the following two fields
3043 optional int32 from_state = 21;
3044 optional int32 to_state = 22;
3045
3046 // e.g., autofilled or suggested texts that are not user entered
3047 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003048
3049 // e.g., number of contents inside a container (e.g., icons inside a folder)
3050 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003051}
3052
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003053/**
3054 * Used for snapshot of the HomeScreen UI elements
3055 *
3056 * Logged from:
3057 * packages/apps/Launcher3
3058 */
3059message LauncherStaticLayout {
3060 // The event id (e.g., snapshot, drag and drop)
3061 optional int32 event_id = 1;
3062 // The event's source or target id (e.g., icon, shortcut, widget)
3063 optional int32 target_id = 2;
3064 // If the target needs to be tracked, use this id field
3065 optional int32 instance_id = 3;
3066 optional int32 uid = 4 [(is_uid) = true];
3067 optional string package_name = 5;
3068 optional string component_name = 6;
3069
3070 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003071 optional int32 grid_x = 7 [default = -1];
3072 optional int32 grid_y = 8 [default = -1];
3073 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003074
3075 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003076 // e.g., when used with widgets target, use these values for (span_x, span_y)
3077 optional int32 grid_x_parent = 10 [default = -1];
3078 optional int32 grid_y_parent = 11 [default = -1];
3079 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003080
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003081 // UNKNOWN = 0
3082 // HOTSEAT = 1
3083 // WORKSPACE = 2
3084 // FOLDER_HOTSEAT = 3
3085 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003086 optional int32 hierarchy = 13;
3087
3088 optional bool is_work_profile = 14;
3089
3090 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3091 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003092
3093 // e.g., number of icons inside a folder
3094 optional int32 cardinality = 16;
3095
3096 // e.g., (x, y) span of the widget inside homescreen grid system
3097 optional int32 span_x = 17 [default = 1];
3098 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003099}
3100
3101/**
3102 * Logs when Wallpaper or ThemePicker UI has changed.
3103 *
3104 * Logged from:
3105 * packages/apps/ThemePicker
3106 * packages/apps/WallpaperPicker2
3107 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003108message StyleUIChanged {
3109 optional android.stats.style.Action action = 1;
3110 optional int32 color_package_hash = 2;
3111 optional int32 font_package_hash = 3;
3112 optional int32 shape_package_hash = 4;
3113 optional int32 clock_package_hash = 5;
3114 optional int32 launcher_grid = 6;
3115 optional int32 wallpaper_category_hash = 7;
3116 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003117 optional int32 color_preference = 9;
3118 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003119}
3120
David Chenc28b2bb2017-10-24 12:52:52 -07003121/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003122 * Logs when Settings UI has changed.
3123 *
3124 * Logged from:
3125 * packages/apps/Settings
3126 */
3127message SettingsUIChanged {
3128 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003129 * Where this SettingsUIChange event comes from. For example, if
3130 * it's a PAGE_VISIBLE event, where the page is opened from.
3131 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003132 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003133
3134 /**
3135 * What the UI action is.
3136 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003137 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003138
3139 /**
3140 * Where the action is happening
3141 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003142 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003143
3144 /**
3145 * What preference changed in this event.
3146 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003147 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003148
3149 /**
3150 * The new value of the changed preference.
3151 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003152 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003153}
3154
3155/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003156 * Logs basic timing information about touch events.
3157 * Reported at most every 5 minutes while device is being interacted with.
3158 *
3159 * Logged from:
3160 * frameworks/native/services/inputflinger
3161 */
3162message TouchEventReported {
3163 /**
3164 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003165 * and the standard deviation of the time spent processing touchscreen events
3166 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003167 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003168 * On supported devices, the starting point is taken during the hard interrupt inside the
3169 * kernel touch driver. On all other devices, the starting point is taken inside
3170 * the kernel's input event subsystem upon receipt of the input event.
3171 * The ending point is taken inside InputDispatcher, just after the input event
3172 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003173 */
3174 // Minimum value
3175 optional float latency_min_micros = 1;
3176 // Maximum value
3177 optional float latency_max_micros = 2;
3178 // Average value
3179 optional float latency_mean_micros = 3;
3180 // Standard deviation
3181 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003182 // Number of touch events (input_event) in this report
3183 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003184}
3185
3186/**
Philip Quinn0eded622019-01-29 12:46:28 -08003187 * Logs gesture classification and timing information for touch events.
3188 *
3189 * Logged from:
3190 * frameworks/base/core/java/android/view/GestureDetector.java
3191 * frameworks/base/core/java/android/view/View.java
3192 */
3193message TouchGestureClassified {
3194 // The source of the classification (e.g. Java class name).
3195 optional string source = 1;
3196
3197 enum Classification {
3198 UNKNOWN_CLASSIFICATION = 0;
3199 SINGLE_TAP = 1;
3200 DOUBLE_TAP = 2;
3201 LONG_PRESS = 3;
3202 DEEP_PRESS = 4;
3203 SCROLL = 5;
3204 }
3205 // The classification of the gesture.
3206 optional Classification classification = 2;
3207
3208 // The interval from the start of a touch event stream until the
3209 // classification was made.
3210 optional int32 latency_millis = 3;
3211
3212 // The distance from the location of the first touch event to the
3213 // location of the touch event when the classification was made.
3214 optional float displacement_px = 4;
3215}
3216
3217/**
David Chenc28b2bb2017-10-24 12:52:52 -07003218 * Logs that a setting was updated.
3219 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003220 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003221 * The tag and is_default allow resetting of settings to default values based on the specified
3222 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3223 */
3224message SettingChanged {
3225 // The name of the setting.
3226 optional string setting = 1;
3227
3228 // The change being imposed on this setting. May represent a number, eg "3".
3229 optional string value = 2;
3230
3231 // The new value of this setting. For most settings, this is same as value. For some settings,
3232 // value is +X or -X where X represents an element in a set. For example, if the previous value
3233 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3234 // The +/- feature is currently only used for location_providers_allowed.
3235 optional string new_value = 3;
3236
3237 // The previous value of this setting.
3238 optional string prev_value = 4;
3239
3240 // The tag used with the is_default for resetting sets of settings. This is generally null.
3241 optional string tag = 5;
3242
Bookatz90867622018-01-31 15:05:57 -08003243 // True if this setting with tag should be resettable.
3244 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003245
David Chenbd789912018-03-16 17:19:55 -07003246 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003247 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003248
3249 enum ChangeReason {
3250 UPDATED = 1; // Updated can be an insertion or an update.
3251 DELETED = 2;
3252 }
3253 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003254}
Chenjie Yub3dda412017-10-24 13:41:59 -07003255
Chenjie Yu05013b32017-11-21 10:21:41 -08003256/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003257 * Logs activity going to foreground or background
3258 *
3259 * Logged from:
3260 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3261 */
3262message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003263 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003264 optional string pkg_name = 2;
3265 optional string class_name = 3;
3266
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003267 enum State {
3268 BACKGROUND = 0;
3269 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003270 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003271 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003272}
David Chenc8a43242017-10-17 16:23:28 -07003273
3274/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003275 * Logs when a volume entered low Storage state.
3276 * Logged from:
3277 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3278 */
3279message LowStorageStateChanged {
3280 // Volume that ran out of storage.
3281 optional string volume_description = 1;
3282
3283 enum State {
3284 UNKNOWN = 0;
3285 OFF = 1;
3286 ON = 2;
3287 }
3288 optional State state = 2;
3289}
3290
3291/**
3292 * Logs when an app is downgraded.
3293 * Logged from:
3294 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3295 */
3296message AppDowngraded {
3297 optional string package_name = 1;
3298 // Size of the package (all data) before being downgraded.
3299 optional int64 size_in_bytes_before = 2;
3300 // Size of the package (all data) after being downgraded.
3301 optional int64 size_in_bytes_after = 3;
3302
3303 optional bool aggressive = 4;
3304}
3305
3306/**
3307 * Logs when an app is optimized after being downgraded.
3308 * Logged from:
3309 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3310 */
3311message AppOptimizedAfterDowngraded {
3312 optional string package_name = 1;
3313}
3314
3315/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003316 * Logs whenever an app is installed on external storage.
3317 * Logged from:
3318 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3319 */
3320message AppInstallOnExternalStorageReported {
3321 // The type of external storage.
3322 optional android.stats.storage.ExternalStorageType storage_type = 1;
3323 // The name of the package that is installed on the sd card.
3324 optional string package_name = 2;
3325}
3326
3327/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003328 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003329 * Logged from:
3330 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3331 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003332message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003333 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003334
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003335 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003336
3337 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003338 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003339 optional string process_name = 3;
3340
3341 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003342 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003343
3344 optional string package_name = 5;
3345
3346 enum InstantApp {
3347 UNAVAILABLE = 0;
3348 FALSE = 1;
3349 TRUE = 2;
3350 }
3351 optional InstantApp is_instant_app = 6;
3352
3353 enum ForegroundState {
3354 UNKNOWN = 0;
3355 BACKGROUND = 1;
3356 FOREGROUND = 2;
3357 }
3358 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003359
3360 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003361}
David Chen9e3808c2017-11-20 17:25:34 -08003362
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003363/**
3364 * Logs when a WTF (What a Terrible Failure) happened.
3365 * Logged from:
3366 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3367 */
3368message WTFOccurred {
3369 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003370
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003371 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003372
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003373 // The name of the process.
3374 // system_server if it is not by an app
3375 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003376
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003377 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003378 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003379
3380 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381}
3382
3383/**
3384 * Logs when system server reports low memory.
3385 * Logged from:
3386 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3387 */
3388message LowMemReported {
3389}
3390
3391/**
3392 * Logs when an app ANR (App Not Responding) occurs.
3393 * Logged from:
3394 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3395 */
3396message ANROccurred {
3397 optional int32 uid = 1 [(is_uid) = true];
3398
3399 optional string process_name = 2;
3400
3401 optional string short_component_name = 3;
3402
3403 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003404
3405 enum InstantApp {
3406 UNAVAILABLE = 0;
3407 FALSE = 1;
3408 TRUE = 2;
3409 }
3410 optional InstantApp is_instant_app = 5;
3411
3412 enum ForegroundState {
3413 UNKNOWN = 0;
3414 BACKGROUND = 1;
3415 FOREGROUND = 2;
3416 }
3417 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003418
3419 optional android.server.ErrorSource error_source = 7;
3420
3421 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003422}
3423
Bookatza7020bd2018-08-28 16:29:35 -07003424/**
3425 * Logs when the vibrator state changes.
3426 * Logged from:
3427 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3428 */
3429message VibratorStateChanged {
3430 repeated AttributionNode attribution_node = 1;
3431
3432 enum State {
3433 OFF = 0;
3434 ON = 1;
3435 }
3436 optional State state = 2;
3437
3438 // Duration (in milliseconds) requested to keep the vibrator on.
3439 // Only applicable for State == ON.
3440 optional int64 duration_millis = 3;
3441}
3442
David Chen0a368b22017-12-06 16:28:16 -08003443/*
3444 * Allows other apps to push events into statsd.
3445 * Logged from:
3446 * frameworks/base/core/java/android/util/StatsLog.java
3447 */
David Chen0b5c90c2018-01-25 16:51:49 -08003448message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003449 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003450 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003451
3452 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3453 optional int32 label = 2;
3454
3455 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3456 // predicates for the metrics).
3457 enum State {
3458 UNKNOWN = 0;
3459 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3460 STOP = 2;
3461 START = 3;
3462 }
3463 optional State state = 3;
3464}
3465
David Chen9e3808c2017-11-20 17:25:34 -08003466/**
Bookatz7948c872018-09-04 12:58:33 -07003467 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3468 * For example, this could be due to the user manually changing the time.
3469 *
3470 * Logged from:
3471 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3472 */
3473message WallClockTimeShifted {
3474 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3475 optional int64 wall_clock_timestamp_millis = 1;
3476}
3477
3478/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003479 * Logs when statsd detects an anomaly.
3480 *
3481 * Logged from:
3482 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3483 */
3484message AnomalyDetected {
3485 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003486 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003487
Yangster-mac94e197c2018-01-02 16:03:03 -08003488 // Id of the config whose anomaly detection alert fired.
3489 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003490
Yangster-mac94e197c2018-01-02 16:03:03 -08003491 // Id of the alert (i.e. name of the anomaly that was detected).
3492 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003493}
3494
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003495message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003496 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003497 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003498
3499 // The app package name.
3500 optional string pkg_name = 2;
3501
3502 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003503 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003504 WARM = 1;
3505 HOT = 2;
3506 COLD = 3;
3507 }
3508 // The transition type.
3509 optional TransitionType type = 3;
3510
3511 // The activity name.
3512 optional string activity_name = 4;
3513
3514 // The name of the calling app. Empty if not set.
3515 optional string calling_pkg_name = 5;
3516
3517 // Whether the app is an instant app.
3518 optional bool is_instant_app = 6;
3519
3520 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003521 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003522
Bookatz80d11a02018-01-16 10:46:35 -08003523 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003524
David Chen0b5c90c2018-01-25 16:51:49 -08003525 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003526 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003527 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003528 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003529 optional int32 bind_application_delay_millis = 11;
3530 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003531
3532 // Empty if not set.
3533 optional string launch_token = 13;
3534
Calin Juravle759fbda2018-02-20 19:52:30 +00003535 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003536 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003537
3538 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003539 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003540}
3541
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003542message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003543 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003544 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003545
3546 // The app package name.
3547 optional string pkg_name = 2;
3548
3549 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003550 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003551 WARM = 1;
3552 HOT = 2;
3553 COLD = 3;
3554 }
3555 // The transition type.
3556 optional TransitionType type = 3;
3557
3558 // The activity name.
3559 optional string activity_name = 4;
3560}
3561
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003562message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003563 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003564 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003565
3566 // The app package name.
3567 optional string pkg_name = 2;
3568
3569 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003570 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003571 WITH_BUNDLE = 1;
3572 WITHOUT_BUNDLE = 2;
3573 }
3574 // The transition type.
3575 optional TransitionType type = 3;
3576
3577 // The activity name.
3578 optional string activity_name = 4;
3579
3580 optional bool transition_process_running = 5;
3581
3582 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003583 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584}
3585
Bookatz8fcd09a2017-12-18 13:01:10 -08003586/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003587 * Logs a picture-in-picture action
3588 * Logged from:
3589 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3590 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3591 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3592 */
3593message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003594 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003595 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003596
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003597 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003598
Chenjie Yu52cacc62017-12-08 18:11:45 -08003599 enum State {
3600 ENTERED = 1;
3601 EXPANDED_TO_FULL_SCREEN = 2;
3602 MINIMIZED = 3;
3603 DISMISSED = 4;
3604 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003605 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003606}
3607
3608/**
Chenjie Yue8904192017-12-08 19:12:57 -08003609 * Logs overlay action
3610 * Logged from:
3611 * services/core/java/com/android/server/wm/Session.java
3612 */
3613message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003614 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003615
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003616 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003617
3618 optional bool using_alert_window = 3;
3619
3620 enum State {
3621 ENTERED = 1;
3622 EXITED = 2;
3623 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003624 optional State state = 4
3625 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003626}
3627
Adam Bookatz38767932020-02-05 12:13:40 -08003628/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003629 * Logs foreground service starts and stops.
3630 * Note that this is not when a service starts or stops, but when it is
3631 * considered foreground.
3632 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003633 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003634 */
3635message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003636 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003637 // package_name + "/" + class_name
3638 optional string short_name = 2;
3639
3640 enum State {
3641 ENTER = 1;
3642 EXIT = 2;
3643 }
3644 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003645
3646 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3647 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3648 optional bool allow_while_in_use_permission = 4;
3649}
3650
3651/**
3652 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3653 * A foreground service session is any continuous period during which the uid holds at least one
3654 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3655 * Accesses initiated while the uid is in the TOP state are ignored.
3656 * Sessions with no attempted accesses are not logged.
3657 * Logged from
3658 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3659 */
3660message ForegroundServiceAppOpSessionEnded {
3661 optional int32 uid = 1 [(is_uid) = true];
3662
3663 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003664 // Only following four ops are logged
3665 // COARSE_LOCATION = 0
3666 // FINE_LOCATION = 1
3667 // CAMERA = 26
3668 // RECORD_AUDIO = 27
3669 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003670
3671 // The uid's permission mode for accessing the AppOp during this fgs session.
3672 enum Mode {
3673 MODE_UNKNOWN = 0;
3674 MODE_ALLOWED = 1; // Always allowed
3675 MODE_IGNORED = 2; // Denied
3676 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3677 }
3678 optional Mode app_op_mode = 3;
3679
3680 // Number of times this AppOp was requested and allowed.
3681 optional int32 count_ops_accepted = 4;
3682 // Number of times this AppOp was requested but denied.
3683 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003684}
3685
Chenjie Yue8904192017-12-08 19:12:57 -08003686/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003687 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3688 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3689 * attributed back to the parent (host) uid. One example is Chrome.
3690 *
3691 * Logged from:
3692 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3693 */
3694message IsolatedUidChanged {
3695 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003696 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003697 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003698 optional int32 parent_uid = 1;
3699
3700 optional int32 isolated_uid = 2;
3701
3702 // We expect an isolated uid to be removed before if it's used for another parent uid.
3703 enum Event {
3704 REMOVED = 0;
3705 CREATED = 1;
3706 }
3707 optional Event event = 3;
3708}
3709
3710/*
3711 * Logs the reception of an incoming network packet causing the main system to wake up for
3712 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3713 * and processed by WakeupController.cpp.
3714 */
3715message PacketWakeupOccurred {
3716 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3717 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003718 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003719 // The interface name on which the packet was received.
3720 optional string iface = 2;
3721 // The ethertype value of the packet.
3722 optional int32 ethertype = 3;
3723 // String representation of the destination MAC address of the packet.
3724 optional string destination_hardware_address = 4;
3725 // String representation of the source address of the packet if this was an IP packet.
3726 optional string source_ip = 5;
3727 // String representation of the destination address of the packet if this was an IP packet.
3728 optional string destination_ip = 6;
3729 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3730 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3731 // families.
3732 optional int32 ip_next_header = 7;
3733 // The source port if this was a TCP or UDP packet.
3734 optional int32 source_port = 8;
3735 // The destination port if this was a TCP or UDP packet.
3736 optional int32 destination_port = 9;
3737}
3738
3739/*
3740 * Logs the memory stats for an app on startup.
3741 * Logged from:
3742 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3743 */
3744message AppStartMemoryStateCaptured {
3745 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003746 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003747
3748 // The process name.
3749 optional string process_name = 2;
3750
3751 // The activity name.
3752 optional string activity_name = 3;
3753
3754 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003755 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003756
3757 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003758 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003759
3760 // RSS
3761 optional int64 rss_in_bytes = 6;
3762
3763 // CACHE
3764 optional int64 cache_in_bytes = 7;
3765
3766 // SWAP
3767 optional int64 swap_in_bytes = 8;
3768}
3769
3770/*
3771 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3772 * for LMK event.
3773 * Logged from:
3774 * system/core/lmkd/lmkd.c
3775 */
3776message LmkStateChanged {
3777 enum State {
3778 UNKNOWN = 0;
3779 START = 1;
3780 STOP = 2;
3781 }
3782 optional State state = 1;
3783}
3784
3785/*
3786 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3787 * Logged from:
3788 * system/core/lmkd/lmkd.c
3789 */
3790message LmkKillOccurred {
3791 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003792 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793
3794 // The process name.
3795 optional string process_name = 2;
3796
3797 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003798 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003799
3800 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003801 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003802
3803 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003804 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003805
3806 // RSS
3807 optional int64 rss_in_bytes = 6;
3808
3809 // CACHE
3810 optional int64 cache_in_bytes = 7;
3811
3812 // SWAP
3813 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003814
3815 // The elapsed real time of start of the process.
3816 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003817
3818 // Min oom adj score considered by lmkd.
3819 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003820}
3821
Rajeev Kumar51b54602018-03-01 12:18:26 -08003822/*
3823 * Logs when the ActivityManagerService detects that an app died.
3824 *
3825 * Logged from:
3826 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3827 */
3828message AppDied {
3829 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003830 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003831}
3832
Howard Ro21a039c2018-08-06 14:55:47 -07003833/**
3834 * An atom for generic metrics logging. Available from Android Q.
3835 */
3836message GenericAtom {
3837 // The uid of the application that sent this custom atom.
3838 optional int32 uid = 1 [(is_uid) = true];
3839
3840 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003841 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003842}
3843
Tej Singhd6d6d772018-09-05 17:41:25 -07003844/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003845 * Atom for simple logging of user interaction and impression events, such as "the user touched
3846 * this button" or "this dialog was displayed".
3847 * Keep the UI event stream clean: don't use for system or background events.
3848 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003849 *
3850 * Logged from:
3851 * frameworks/base/services/core/java/com/android/server/
3852 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003853 */
3854message UiEventReported {
3855 // The event_id.
3856 optional int32 event_id = 1;
3857 // The event's source or target uid and package, if applicable.
3858 // For example, the package posting a notification, or the destination package of a share.
3859 optional int32 uid = 2 [(is_uid) = true];
3860 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003861 // An identifier used to disambiguate which logs refer to a particular instance of some
3862 // UI element. Useful when there might be multiple instances simultaneously active.
3863 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003864}
3865
3866/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003867 * Reports a notification was created or updated.
3868 *
3869 * Logged from:
3870 * frameworks/base/services/core/java/com/android/server/notification/
3871 */
3872message NotificationReported {
3873 // The event_id (as for UiEventReported).
3874 optional int32 event_id = 1;
3875 // The notifying app's uid and package.
3876 optional int32 uid = 2 [(is_uid) = true];
3877 optional string package_name = 3;
3878 // A small system-assigned identifier for the notification.
3879 // Locally probably-unique, but expect collisions across users and/or days.
3880 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003881 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3882 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003883
3884 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003885 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3886 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3887 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003888
3889 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003890 optional string category = 10; // App-assigned notification category (API-defined strings)
3891 optional int32 style = 11; // App-assigned notification style
3892 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003893
3894 // Ordering, importance and interruptiveness
3895
Will Brockman7614f6962020-02-10 19:43:03 -05003896 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003897
Will Brockman7614f6962020-02-10 19:43:03 -05003898 optional android.stats.sysui.NotificationImportance importance = 14;
3899 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003900
3901 enum NotificationImportanceExplanation {
3902 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3903 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3904 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3905 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3906 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3907 // Like _APP, but based on pre-channels priority signal.
3908 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3909 }
3910
Will Brockman7614f6962020-02-10 19:43:03 -05003911 optional NotificationImportanceExplanation importance_source = 16;
3912 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3913 optional NotificationImportanceExplanation importance_initial_source = 18;
3914 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3915 optional int32 assistant_hash = 20;
3916 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003917}
3918
3919message Notification {
3920 // The notifying app's uid and package.
3921 optional int32 uid = 1 [(is_uid) = true];
3922 optional string package_name = 2;
3923 // A small system-assigned identifier for the notification.
3924 optional int32 instance_id = 3;
3925
3926 // Grouping information.
3927 optional int32 group_instance_id = 4;
3928 optional bool is_group_summary = 5;
3929
3930 // The section of the shade that the notification is in.
3931 // See NotificationSectionsManager.PriorityBucket.
3932 enum NotificationSection {
3933 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003934 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003935 SECTION_MEDIA_CONTROLS = 2;
3936 SECTION_PEOPLE = 3;
3937 SECTION_ALERTING = 4;
3938 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003939 }
3940 optional NotificationSection section = 6;
3941}
3942
3943message NotificationList {
3944 repeated Notification notifications = 1; // An ordered sequence of notifications.
3945}
3946
3947/**
3948 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3949 *
3950 * Logged from:
3951 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3952 */
3953message NotificationPanelReported {
3954 // The event_id (as for UiEventReported).
3955 optional int32 event_id = 1;
3956 optional int32 num_notifications = 2;
3957 // The notifications in the panel, in the order that they appear there.
3958 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3959}
3960
3961/**
3962 * Reports a notification channel, or channel group, was created, updated, or deleted.
3963 *
3964 * Logged from:
3965 * frameworks/base/services/core/java/com/android/server/notification/
3966 */
3967message NotificationChannelModified {
3968 // The event_id (as for UiEventReported).
3969 optional int32 event_id = 1;
3970 // The notifying app's uid and package.
3971 optional int32 uid = 2 [(is_uid) = true];
3972 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003973 // Hash of app-assigned notification channel ID or channel-group ID
3974 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003975 // Previous importance setting, if applicable
3976 optional android.stats.sysui.NotificationImportance old_importance = 5;
3977 // New importance setting
3978 optional android.stats.sysui.NotificationImportance importance = 6;
3979}
3980
3981
3982/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003983 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003984 *
3985 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003986 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003987 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003988message BiometricAcquired {
3989 // Biometric modality that was acquired.
3990 optional android.hardware.biometrics.ModalityEnum modality = 1;
3991 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3992 optional int32 user = 2;
3993 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3994 optional bool is_crypto = 3;
3995 // Action that the device is performing. Acquired messages are only expected for enroll and
3996 // authenticate. Other actions may indicate an error.
3997 optional android.hardware.biometrics.ActionEnum action = 4;
3998 // The client that this acquisition was received for.
3999 optional android.hardware.biometrics.ClientEnum client = 5;
4000 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4001 optional int32 acquire_info = 6;
4002 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4003 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004004 // Dictates if this message should trigger additional debugging.
4005 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004006}
4007
4008/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004009 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004010 *
4011 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004012 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004013 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004014message BiometricAuthenticated {
4015 // Biometric modality that was used.
4016 optional android.hardware.biometrics.ModalityEnum modality = 1;
4017 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4018 optional int32 user = 2;
4019 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4020 // storage.
4021 optional bool is_crypto = 3;
4022 // The client that this acquisition was received for.
4023 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004024 // If authentication requires user confirmation. See BiometricPrompt's
4025 // setRequireConfirmation(bool) method.
4026 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004027
Kevin Chyn1741a072019-01-17 11:54:40 -08004028 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004029 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004030 REJECTED = 1;
4031 PENDING_CONFIRMATION = 2;
4032 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004033 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004034
4035 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004036 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004037 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4038 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4039 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4040 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004041 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004042 // Dictates if this message should trigger additional debugging.
4043 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004044}
4045
4046/**
4047 * Logs when a biometric error occurs.
4048 *
4049 * Logged from:
4050 * frameworks/base/services/core/java/com/android/server/biometrics
4051 */
4052message BiometricErrorOccurred {
4053 // Biometric modality that was used.
4054 optional android.hardware.biometrics.ModalityEnum modality = 1;
4055 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4056 optional int32 user = 2;
4057 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4058 optional bool is_crypto = 3;
4059 // Action that the device is performing.
4060 optional android.hardware.biometrics.ActionEnum action = 4;
4061 // The client that this acquisition was received for.
4062 optional android.hardware.biometrics.ClientEnum client = 5;
4063 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4064 // are unique to modality.
4065 optional int32 error_info = 6;
4066 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4067 // by the vendor and not specified by the HIDL interface.
4068 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004069 // Dictates if this message should trigger additional debugging.
4070 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004071 // Time spent during the authentication attempt.
4072 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004073}
4074
4075/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004076 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004077 * Logged from:
4078 * frameworks/base/services/core/java/com/android/server/biometrics
4079 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004080message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004081 // Biometric modality.
4082 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004083 // Type of issue detected.
4084 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004085 // Dictates if this message should trigger additional debugging.
4086 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004087}
Howard Ro688ae182018-09-25 00:09:36 -07004088
joshmccloskey6f952b22019-03-25 20:59:35 -07004089/**
4090 * Logs when a biometric enrollment occurs.
4091 *
4092 * Logged from:
4093 * frameworks/base/services/core/java/com/android/server/biometrics
4094 */
4095message BiometricEnrolled {
4096 // Biometric modality that was used.
4097 optional android.hardware.biometrics.ModalityEnum modality = 1;
4098 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4099 optional int32 user = 2;
4100 // The amount of time the enrollment took in milliseconds.
4101 optional int64 latency_millis = 3;
4102 // Whether or not the enrollment was successful.
4103 optional bool success = 4;
4104}
4105
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004106/*
Tej Singh0d176952019-01-16 19:10:54 -08004107 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004108 */
Tej Singh0d176952019-01-16 19:10:54 -08004109message FlagFlipUpdateOccurred {
4110 // If the event is from a flag config package, specify the package name.
4111 optional string flag_flip_package_name = 1;
4112
4113 // The order id of the package
4114 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004115}
4116
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004117/**
4118 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004119 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004120 */
4121message TrainExperimentIds {
4122 repeated int64 experiment_id = 1;
4123}
4124
Yangster-macb89807e2018-11-15 21:10:57 -08004125/*
4126 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004127 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004128 */
4129message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004130 // Name of the train.
4131 optional string train_name = 1;
4132 // Version code for a "train" of packages that need to be installed atomically
4133 optional int64 train_version_code = 2;
4134 // After installation of this package, device requires a restart.
4135 optional bool requires_staging = 3;
4136 // Rollback should be enabled for this install.
4137 optional bool rollback_enabled = 4;
4138 // Requires low latency monitoring if possible.
4139 optional bool requires_low_latency_monitor = 5;
4140
Yangster-macb89807e2018-11-15 21:10:57 -08004141 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004142 UNKNOWN = 0;
4143 INSTALL_REQUESTED = 1;
4144 INSTALL_STARTED = 2;
4145 INSTALL_STAGED_NOT_READY = 3;
4146 INSTALL_STAGED_READY = 4;
4147 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004148 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4149 // and INSTALL_FAILURE_COMMIT.
4150 INSTALL_FAILURE = 6 [deprecated = true];
4151 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004152 INSTALL_CANCELLED = 7;
4153 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004154 INSTALLER_ROLLBACK_INITIATED = 9;
4155 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4156 INSTALLER_ROLLBACK_STAGED = 11;
4157 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4158 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4159 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4160 INSTALLER_ROLLBACK_SUCCESS = 15;
4161 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004162 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4163 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4164 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4165 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4166 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4167 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004168 INSTALL_FAILURE_DOWNLOAD = 23;
4169 INSTALL_FAILURE_STATE_MISMATCH = 24;
4170 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004171 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004172 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004173 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004174 // Possible experiment ids for monitoring this push.
4175 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4176 // user id
4177 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004178 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004179 // Whether or not this is a rollback event
4180 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004181}
4182
Tej Singhc9203082019-05-03 13:42:23 -07004183/* Test atom, is not logged anywhere */
4184message TestAtomReported {
4185 repeated AttributionNode attribution_node = 1;
4186 optional int32 int_field = 2;
4187 optional int64 long_field = 3;
4188 optional float float_field = 4;
4189 optional string string_field = 5;
4190 optional bool boolean_field = 6;
4191 enum State {
4192 UNKNOWN = 0;
4193 OFF = 1;
4194 ON = 2;
4195 }
4196 optional State state = 7;
4197 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4198}
4199
Maggie Whitefc1aa592018-11-28 21:55:23 -08004200/** Represents USB port overheat event. */
4201message UsbPortOverheatEvent {
4202 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4203 optional int32 plug_temperature_deci_c = 1;
4204
4205 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4206 optional int32 max_temperature_deci_c = 2;
4207
4208 /* Time between USB plug event and overheat threshold trip, in seconds. */
4209 optional int32 time_to_overheat_secs = 3;
4210
4211 /* Time between overheat threshold trip and hysteresis, in seconds. */
4212 optional int32 time_to_hysteresis_secs = 4;
4213
4214 /* Time between hysteresis and active mitigation ending, in seconds. */
4215 optional int32 time_to_inactive_secs = 5;
4216};
4217
Maggie White8735b852019-01-18 11:40:49 -08004218/**
4219 * Logs total effective full charge and discharge cycles on a battery.
4220 * Here are some examples of one effective cycle:
4221 * 1) the battery charges from 0% to 100% and drains back to 0%,
4222 * 2) charging from 50% to 100% and draining back to 50% twice.
4223 * Pulled from:
4224 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4225 */
4226message BatteryCycleCount {
4227 /* Number of total charge and discharge cycles on the system battery. */
4228 optional int32 cycle_count = 1;
4229}
4230
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004231/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004232 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4233 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004234 * Pulled from:
4235 * StatsCompanionService
4236 */
4237
Carmen Agimof12dec122019-03-06 16:14:38 +00004238message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004239
Carmen Agimof12dec122019-03-06 16:14:38 +00004240 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004241 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004242 PUBLIC = 1;
4243 PRIVATE = 2;
4244 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004245 }
4246
Carmen Agimof12dec122019-03-06 16:14:38 +00004247 // The type of external storage.
4248 optional android.stats.storage.ExternalStorageType storage_type = 1;
4249 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4250 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004251 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004252 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004253}
4254
Yangster-macb89807e2018-11-15 21:10:57 -08004255/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004256 * Logs when a connection becomes available and lost.
4257 * Logged in StatsCompanionService.java
4258 */
4259message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004260 // Id of the network.
4261 optional int32 net_id = 1;
4262
4263 enum State {
4264 UNKNOWN = 0;
4265 CONNECTED = 1;
4266 DISCONNECTED = 2;
4267 }
4268 // Connected state of a network.
4269 optional State state = 2;
4270}
4271
4272/**
4273 * Logs when a service starts and stops.
4274 * Logged from:
4275 * services/core/java/com/android/server/am/ActiveServices.java
4276 */
4277message ServiceStateChanged {
4278
4279 optional int32 uid = 1 [(is_uid) = true];
4280
4281 optional string package_name = 2;
4282
4283 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004284
4285 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004286 START = 1;
4287 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004288 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004289
4290 optional State state = 4;
4291}
4292
4293/**
4294 * Logs when a service is launched.
4295 * Logged from:
4296 * services/core/java/com/android/server/am/ActiveServices.java
4297 */
4298message ServiceLaunchReported {
4299
4300 optional int32 uid = 1 [(is_uid) = true];
4301
4302 optional string package_name = 2;
4303
4304 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004305}
Howard Ro688ae182018-09-25 00:09:36 -07004306
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004307/**
4308 * Logs when a hidden API is used.
4309 *
4310 * Logged from:
4311 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4312 */
4313message HiddenApiUsed {
4314 // The uid of the app making the hidden access.
4315 optional int32 uid = 1 [(is_uid) = true];
4316
4317 // Signature of the method or field accessed.
4318 optional string signature = 2;
4319
4320 enum AccessMethod {
4321 NONE = 0;
4322 REFLECTION = 1;
4323 JNI = 2;
4324 LINKING = 3;
4325 }
4326
4327 // Type of access.
4328 optional AccessMethod access_method = 3;
4329
4330 // Whether the access was prevented or not.
4331 optional bool access_denied = 4;
4332}
4333
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004334/**
4335 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4336 * - When user sees privacy chip
4337 * - When user clicks privacy chip
4338 * - How does the user exit the Privacy Dialog
4339 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004340 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4341 */
4342message PrivacyIndicatorsInteracted {
4343
4344 enum Type {
4345 UNKNOWN = 0;
4346 CHIP_VIEWED = 1;
4347 CHIP_CLICKED = 2;
4348 DIALOG_PRIVACY_SETTINGS = 3;
4349 DIALOG_DISMISS = 4;
4350 DIALOG_LINE_ITEM = 5;
4351 }
4352
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004353 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004354
4355 // Used if the type is LINE_ITEM
4356 optional string package_name = 2;
4357}
4358
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004359/**
4360 * Logs information about a package that is moved from the internal to external storage and vice
4361 * versa.
4362 * It logs the package name, the type of the external storage where the package is installed
4363 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4364 * and the move type: if it's from internal to external or the other way around.
4365 *
4366 * Logged from:
4367 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4368 */
4369message AppMovedStorageReported {
4370 enum MoveType {
4371 UNKNOWN = 0;
4372 TO_EXTERNAL = 1;
4373 TO_INTERNAL = 2;
4374 }
4375 // The type of the external storage.
4376 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4377 // The type of move.
4378 optional MoveType move_type = 2;
4379 // The name of the package that was moved.
4380 optional string package_name = 3;
4381}
4382
jianjin8f2dee02019-03-29 14:03:08 -07004383/**
4384 * Logs when system server watchdog occurs.
4385 * Logged from:
4386 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4387 */
4388message SystemServerWatchdogOccurred {
4389 optional string subject = 1;
4390}
4391
4392/**
4393 * Logs when new file added to tombstones.
4394 * Logged from:
4395 * frameworks/base/core/java/com/android/server/BootReceiver.java
4396 */
4397message TombStoneOccurred {
4398}
4399
Hai Zhang5d3328d2019-04-13 21:25:06 +08004400/*
4401 * Information about a role request
4402 *
4403 * Logged from:
4404 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4405 */
4406message RoleRequestResultReported {
4407 // UID of application requesting the role
4408 optional int32 requesting_uid = 1;
4409
4410 // Package name of application requesting the role
4411 optional string requesting_package_name = 2;
4412
4413 // The role to be granted
4414 optional string role_name = 3;
4415
4416 // The count of applications qualifying for the role
4417 optional int32 qualifying_count = 4;
4418
4419 // UID of application current granted the role
4420 optional int32 current_uid = 5;
4421
4422 // Package name of application current granted the role
4423 optional string current_package_name = 6;
4424
4425 // UID of another application that user chose to grant the role to, instead of the requesting
4426 // application
4427 optional int32 granted_another_uid = 7;
4428
4429 // Package name of another application that user chose to grant the role to, instead of the
4430 // requesting application
4431 optional string granted_another_package_name = 8;
4432
4433 enum Result {
4434 UNDEFINED = 0;
4435 // role request was ignored
4436 IGNORED = 1;
4437 // role request was ignored because it's already granted
4438 IGNORED_ALREADY_GRANTED = 2;
4439 // role request was ignored because the application isn't qualified
4440 IGNORED_NOT_QUALIFIED = 3;
4441 // role request was ignored because user said it should be always denied
4442 IGNORED_USER_ALWAYS_DENIED = 4;
4443 // role was granted by user action
4444 USER_GRANTED = 5;
4445 // role was denied by user action
4446 USER_DENIED = 6;
4447 // role was denied by user granting another application the role
4448 USER_DENIED_GRANTED_ANOTHER = 7;
4449 // role was denied and set to be always denied by the user
4450 USER_DENIED_WITH_ALWAYS = 8;
4451 }
4452 // The result of the role request
4453 optional Result result = 9;
4454}
4455
Mark Tabrya824a642019-11-05 12:26:12 -08004456/**
4457 * Logs when a Vehicle Maps Service client's connection state has changed
4458 *
4459 * Logged from:
4460 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4461 */
4462message VmsClientConnectionStateChanged {
4463 // The UID of the VMS client app
4464 optional int32 uid = 1 [(is_uid) = true];
4465
4466 enum State {
4467 UNKNOWN = 0;
4468 // Attempting to connect to the client
4469 CONNECTING = 1;
4470 // Client connection established
4471 CONNECTED = 2;
4472 // Client connection closed unexpectedly
4473 DISCONNECTED = 3;
4474 // Client connection closed by VMS
4475 TERMINATED = 4;
4476 // Error establishing the client connection
4477 CONNECTION_ERROR = 5;
4478 }
4479
4480 optional State state = 2;
4481}
4482
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004483/**
4484 * Logs when MediaProvider has successfully finished scanning a storage volume.
4485 *
4486 * Logged from:
4487 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4488 */
shafik43825842020-04-02 17:30:24 +01004489message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004490 enum Reason {
4491 // Scan triggered due to unknown reason
4492 UNKNOWN = 0;
4493 // Scan triggered due to storage volume being mounted
4494 MOUNTED = 1;
4495 // Scan triggered due to explicit user action or app request
4496 DEMAND = 2;
4497 // Scan triggered due to idle maintenance
4498 IDLE = 3;
4499 }
4500
4501 // Volume type that this event pertains to
4502 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4503 // Reason why this scan was triggered
4504 optional Reason reason = 2;
4505 // Total number of files scanned
4506 optional int64 item_count = 3;
4507 // Duration of scan, normalized per file
4508 optional float normalized_duration_millis = 4;
4509 // Number of database inserts, normalized per file
4510 optional float normalized_insert_count = 5;
4511 // Number of database updates, normalized per file
4512 optional float normalized_update_count = 6;
4513 // Number of database deletes, normalized per file
4514 optional float normalized_delete_count = 7;
4515}
4516
4517/**
4518 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4519 *
4520 * Logged from:
4521 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4522 */
shafik43825842020-04-02 17:30:24 +01004523message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004524 // Volume type that this event pertains to
4525 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004526 // UID of app that requested deletion
4527 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004528 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004529 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004530}
4531
4532/**
4533 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4534 *
4535 * Logged from:
4536 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4537 */
shafik43825842020-04-02 17:30:24 +01004538message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004539 enum Result {
4540 UNKNOWN = 0;
4541 USER_GRANTED = 1;
4542 AUTO_GRANTED = 2;
4543 USER_DENIED = 3;
4544 USER_DENIED_WITH_PREJUDICE = 4;
4545 AUTO_DENIED = 5;
4546 }
4547
4548 // Volume type that this event pertains to
4549 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004550 // UID of app that requested permission
4551 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004552 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004553 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004554 // Result of this request
shafik43825842020-04-02 17:30:24 +01004555 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004556}
4557
4558/**
4559 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4560 *
4561 * Logged from:
4562 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4563 */
shafik43825842020-04-02 17:30:24 +01004564message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004565 // Volume type that this event pertains to
4566 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4567 // Old database version code
4568 optional int32 version_from = 2;
4569 // New database version code
4570 optional int32 version_to = 3;
4571 // Total number of files in database
4572 optional int64 item_count = 4;
4573 // Duration of schema change, normalized per file
4574 optional float normalized_duration_millis = 5;
4575}
4576
4577/**
4578 * Logs when MediaProvider has finished an idle maintenance job.
4579 *
4580 * Logged from:
4581 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4582 */
shafik43825842020-04-02 17:30:24 +01004583message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004584 // Volume type that this event pertains to
4585 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4586
4587 // Total number of files in database
4588 optional int64 item_count = 2;
4589 // Duration of idle maintenance, normalized per file
4590 optional float normalized_duration_millis = 3;
4591 // Number of thumbnails found to be stale, normalized per file
4592 optional float normalized_stale_thumbnails = 4;
4593 // Number of items found to be expired, normalized per file
4594 optional float normalized_expired_media = 5;
4595}
4596
Keun young Park3e033cb2019-12-18 11:27:35 -08004597/**
4598 * Represents boot time event with duration in ms.
4599 *
4600 * Logged from: bootstat and various system server components. Check each enums for details.
4601 */
4602message BootTimeEventDuration {
4603 enum DurationEvent {
4604 UNKNOWN = 0;
4605 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4606 ABSOLUTE_BOOT_TIME = 1;
4607 // Bootloader's 1st stage execution time.
4608 // Logged from bootstat.
4609 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4610 // Bootloader's 1st stage loading time.
4611 // Logged from bootstat.
4612 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4613 // Bootloader's kernel loading time.
4614 // Logged from bootstat.
4615 BOOTLOADER_KERNEL_LOAD = 4;
4616 // Bootloader's 2nd stage execution time.
4617 // Logged from bootstat.
4618 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4619 // Bootloader's 2nd stage loading time.
4620 // Logged from bootstat.
4621 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4622 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4623 // for locked device.
4624 // Logged from bootstat.
4625 BOOTLOADER_UI_WAIT = 7;
4626 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4627 // Logged from bootstat.
4628 BOOTLOADER_TOTAL = 8;
4629 // Shutdown duration inside init for the reboot before the current boot up.
4630 // Logged from f/b/services/.../BootReceiver.java.
4631 SHUTDOWN_DURATION = 9;
4632 // Total time for mounting of disk devices during bootup.
4633 // Logged from f/b/services/.../BootReceiver.java.
4634 MOUNT_DEFAULT_DURATION = 10;
4635 // Total time for early stage mounting of disk devices during bootup.
4636 // Logged from f/b/services/.../BootReceiver.java.
4637 MOUNT_EARLY_DURATION = 11;
4638 // Total time for late stage mounting of disk devices during bootup.
4639 // Logged from f/b/services/.../BootReceiver.java.
4640 MOUNT_LATE_DURATION = 12;
4641 // Average time to scan non-system app after OTA
4642 // Logged from f/b/services/.../PackageManagerService.java
4643 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4644 // Time to initialize Package manager after OTA
4645 // Logged from f/b/services/.../PackageManagerService.java
4646 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4647 // Time to scan all system app from Package manager after OTA
4648 // Logged from f/b/services/.../PackageManagerService.java
4649 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4650 // Init's total time for cold boot stage.
4651 // Logged from bootstat.
4652 COLDBOOT_WAIT = 16;
4653 // Init's total time for initializing selinux.
4654 // Logged from bootstat.
4655 SELINUX_INIT = 17;
4656 // Time since last factory reset.
4657 // Logged from bootstat.
4658 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004659 // Init's total time spent for completing the 1st stage.
4660 // Logged from bootstat.
4661 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004662 }
4663
4664 // Type of the event.
4665 optional DurationEvent event = 1;
4666 // Duration of the event in ms.
4667 optional int64 duration_millis = 2;
4668}
4669
4670/**
4671 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4672 * since boot-up.
4673 *
4674 * Logged from: bootstat and various system server components. Check each enums for details.
4675 */
4676message BootTimeEventElapsedTime {
4677 enum ElapsedTimeEvent {
4678 UNKNOWN = 0;
4679 // Time when init starts 1st stage. Logged from bootstat.
4680 ANDROID_INIT_STAGE_1 = 1;
4681 // Time when sys.boot_completed prop is set.
4682 // Logged from bootstat.
4683 BOOT_COMPLETE = 2;
4684 // BOOT_COMPLETE for encrypted device.
4685 BOOT_COMPLETE_ENCRYPTION = 3;
4686 // BOOT_COMPLETE for device with no encryption.
4687 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4688 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004689 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004690 // BOOT_COMPLETE after factory reset.
4691 FACTORY_RESET_BOOT_COMPLETE = 6;
4692 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4693 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004694 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4695 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004696 // BOOT_COMPLETE after OTA.
4697 OTA_BOOT_COMPLETE = 9;
4698 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4699 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004700 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4701 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004702 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4703 // Logged from f/b/services/.../UserController.java
4704 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4705 // Time when the system starts sending BOOT_COMPLETED broadcast.
4706 // Logged from f/b/services/.../UserController.java
4707 FRAMEWORK_BOOT_COMPLETED = 13;
4708 // Time when the package manager starts init.
4709 // Logged from f/b/services/.../SystemServer.java
4710 PACKAGE_MANAGER_INIT_START = 14;
4711 // Time when package manager is ready
4712 // Logged from f/b/services/.../SystemServer.java
4713 PACKAGE_MANAGER_INIT_READY = 15;
4714 // Represents the time when user has entered unlock credential for system with user pin.
4715 // Logged from bootstat.
4716 POST_DECRYPT = 16;
4717 // Represents the start of zygote's init.
4718 // Logged from zygote itself.
4719 ZYGOTE_INIT_START = 17;
4720 // Represents the start of secondary zygote's init.
4721 // TODO: add logging to zygote
4722 SECONDARY_ZYGOTE_INIT_START = 18;
4723 // Represents the start of system server's init.
4724 // Logged from f/b/services/.../SystemServer.java
4725 SYSTEM_SERVER_INIT_START = 19;
4726 // Represents the completion of system server's init.
4727 // Logged from f/b/services/.../SystemServer.java
4728 SYSTEM_SERVER_READY = 20;
4729 // Represents the start of launcher during boot-up.
4730 // TODO: add logging
4731 LAUNCHER_START = 21;
4732 // Represents the completion of launcher's initial rendering. User can use other apps from
4733 // launcher from this point.
4734 // TODO: add logging
4735 LAUNCHER_SHOWN = 22;
4736 }
4737
4738 // Type of the event.
4739 optional ElapsedTimeEvent event = 1;
4740 // Time since bootup for the event.
4741 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4742 optional int64 time_millis = 2;
4743}
4744
4745/**
4746 * Boot time events with UTC time.
4747 *
4748 * Logged from: bootstat and various system server components. Check each enums for details.
4749 */
4750message BootTimeEventUtcTime {
4751 enum UtcTimeEvent {
4752 UNKNOWN = 0;
4753 // Time of the bootstat's marking of 1st boot after the last factory reset.
4754 // Logged from bootstat.
4755 FACTORY_RESET_RESET_TIME = 1;
4756 // The time when bootstat records FACTORY_RESET_* events. This is close to
4757 // BOOT_COMPLETE time for the current bootup.
4758 // Logged from bootstat.
4759 FACTORY_RESET_CURRENT_TIME = 2;
4760 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4761 // Logged from bootstat.
4762 FACTORY_RESET_RECORD_VALUE = 3;
4763 }
4764
4765 // Type of the event.
4766 optional UtcTimeEvent event = 1;
4767 // UTC time for the event.
4768 optional int64 utc_time_secs = 2;
4769}
4770
4771/**
4772 * Boot time events representing specific error code during bootup.
4773 * Meaning of error code can be different per each event type.
4774 *
4775 * Logged from: bootstat and various system server components. Check each enums for details.
4776 */
4777message BootTimeEventErrorCode {
4778 enum ErrorCodeEvent {
4779 UNKNOWN = 0;
4780 // Linux error code for time() call to get the current UTC time.
4781 // Logged from bootstat.
4782 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4783 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4784 // as UMOUNT_STAT_* from init/reboot.cpp.
4785 // Logged from f/b/services/.../BootReceiver.java.
4786 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004787 // Reprepsents fie system mounting error code of /data partition for the current boot.
4788 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004789 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004790 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004791 }
4792
4793 // Type of the event.
4794 optional ErrorCodeEvent event = 1;
4795 // error code defined per each event type.
4796 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4797 // FS_MGR_FS_STAT.
4798 optional int32 error_code = 2;
4799}
4800
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004801/**
4802 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4803 * after an OTA.
4804 *
4805 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004806 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004807 */
4808message SnapshotMergeReported {
4809 // Keep in sync with
4810 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4811 enum UpdateState {
4812 // No update or merge is in progress.
4813 NONE = 0;
4814 // An update is applying; snapshots may already exist.
4815 INITIATED = 1;
4816 // An update is pending, but has not been successfully booted yet.
4817 UNVERIFIED = 2;
4818 // The kernel is merging in the background.
4819 MERGING = 3;
4820 // Post-merge cleanup steps could not be completed due to a transient
4821 // error, but the next reboot will finish any pending operations.
4822 MERGE_NEEDS_REBOOT = 4;
4823 // Merging is complete, and needs to be acknowledged.
4824 MERGE_COMPLETED = 5;
4825 // Merging failed due to an unrecoverable error.
4826 MERGE_FAILED = 6;
4827 // The update was implicitly cancelled, either by a rollback or a flash
4828 // operation via fastboot. This state can only be returned by WaitForMerge.
4829 CANCELLED = 7;
4830 };
4831
4832 // Status of the update after the merge attempts.
4833 optional UpdateState final_state = 1;
4834
4835 // Time to complete a merge operation in milliseconds.
4836 // A negative value corresponds to the case in which the merge operation
4837 // was interrupted and resumed (e.g. in case of a system reboot during the
4838 // merge).
4839 optional int64 duration_millis = 2;
4840
4841 // Number of reboots that occurred after issuing and before completing the
4842 // merge of all the snapshot devices.
4843 optional int32 intermediate_reboots = 3;
4844}
4845
Chenjie Yubbcbc602018-02-05 16:51:52 -08004846//////////////////////////////////////////////////////////////////////
4847// Pulled atoms below this line //
4848//////////////////////////////////////////////////////////////////////
4849
4850/**
David Chenc8a43242017-10-17 16:23:28 -07004851 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4852 *
4853 * Pulled from:
4854 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4855 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004856message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004857 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004858
4859 optional int64 rx_bytes = 2;
4860
4861 optional int64 rx_packets = 3;
4862
4863 optional int64 tx_bytes = 4;
4864
4865 optional int64 tx_packets = 5;
4866}
4867
4868/**
4869 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4870 *
4871 * Pulled from:
4872 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4873 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004874message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004875 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004876
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004877 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4878 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004879
4880 optional int64 rx_bytes = 3;
4881
4882 optional int64 rx_packets = 4;
4883
4884 optional int64 tx_bytes = 5;
4885
4886 optional int64 tx_packets = 6;
4887}
4888
4889/**
4890 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4891 *
4892 * Pulled from:
4893 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4894 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004895message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004896 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004897
4898 optional int64 rx_bytes = 2;
4899
4900 optional int64 rx_packets = 3;
4901
4902 optional int64 tx_bytes = 4;
4903
4904 optional int64 tx_packets = 5;
4905}
4906
4907/**
4908 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4909 *
4910 * Pulled from:
4911 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4912 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004913message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004914 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004915
Yao Chenc40a19d2018-03-15 16:48:25 -07004916 // 1 denotes foreground and 0 denotes background. This is called Set in
4917 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004918 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004919
4920 optional int64 rx_bytes = 3;
4921
4922 optional int64 rx_packets = 4;
4923
4924 optional int64 tx_bytes = 5;
4925
4926 optional int64 tx_packets = 6;
4927}
4928
4929/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004930 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4931 *
4932 * Pulled from:
4933 * StatsCompanionService
4934 */
4935message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004936 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004937
4938 optional int64 rx_bytes = 2;
4939
4940 optional int64 tx_bytes = 3;
4941}
4942
4943/**
David Chenc8a43242017-10-17 16:23:28 -07004944 * Pulls the kernel wakelock durations. This atom is adapted from
4945 * android/internal/os/KernelWakelockStats.java
4946 *
4947 * Pulled from:
4948 * StatsCompanionService using KernelWakelockReader.
4949 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004950message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004951 optional string name = 1;
4952
4953 optional int32 count = 2;
4954
4955 optional int32 version = 3;
4956
Yangster-maca8a30442018-10-13 23:46:34 -07004957 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004958}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004959
Chenjie Yu05013b32017-11-21 10:21:41 -08004960/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004961 * Pulls low power state information. If power.stats HAL is not available, this
4962 * includes platform and subsystem sleep state information,
4963 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4964 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004965 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004966 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004967 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4968 * as defined in:
4969 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004970 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004971message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004972 // Subsystem name
4973 optional string subsystem_name = 1;
4974 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4975 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004976 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4977 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004978 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004979 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004980 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004981 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004982 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004983}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004984
Chenjie Yu05013b32017-11-21 10:21:41 -08004985/**
Bookatz92da2832018-11-01 18:10:03 -07004986 * Pulls on-device power measurement information.
4987 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4988 * Pulled from:
4989 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4990 */
4991message OnDevicePowerMeasurement {
4992 // Name of the subsystem (to which the rail belongs).
4993 optional string subsystem_name = 1;
4994
4995 // Rail name. The rail lies within the subsystem.
4996 optional string rail_name = 2;
4997
4998 // Time (in ms since boot) at which the rail energy value was measured.
4999 // This may differ slightly from the time that statsd logs this information.
5000 optional uint64 measurement_timestamp_millis = 3;
5001
5002 // Accumulated energy used via the rail since device boot in uWs.
5003 optional uint64 energy_microwatt_secs = 4;
5004}
5005
5006/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005007 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005008 * Pulls the time the cpu spend on the frequency index. Frequency index
5009 * starts from highest to lowest. The value should be monotonically
5010 * increasing since boot. However, if there is a cpu
5011 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005012 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005013message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005014 optional uint32 cluster = 1;
5015 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005016 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005017}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005018
Chenjie Yu05013b32017-11-21 10:21:41 -08005019/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005020 * Pulls Cpu Time Per Uid.
5021 * Note that isolated process uid time should be attributed to host uids.
5022 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005023message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005024 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005025 optional uint64 user_time_micros = 2;
5026 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005027}
5028
5029/**
5030 * Pulls Cpu Time Per Uid per frequency.
5031 * Note that isolated process uid time should be attributed to host uids.
5032 * For each uid, we order the time by descending frequencies.
5033 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005034message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005035 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005036 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005037 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005038}
Hugo Benichi884970e2017-11-14 22:42:46 +09005039
Chenjie Yu05013b32017-11-21 10:21:41 -08005040/**
5041 * Pulls Wifi Controller Activity Energy Info
5042 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005043message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005044 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005045 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005046 // stack reported state
5047 // TODO: replace this with proto enum
5048 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005049 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005050 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005051 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005052 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005053 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005054 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005055 // product of current(mA), voltage(V) and time(ms)
5056 optional uint64 controller_energy_used = 6;
5057}
5058
5059/**
5060 * Pulls Modem Activity Energy Info
5061 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005062message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005063 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005064 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005065 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005066 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005067 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005068 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005069 /**
5070 * Tx power index
5071 * index 0 = tx_power < 0dBm
5072 * index 1 = 0dBm < tx_power < 5dBm
5073 * index 2 = 5dBm < tx_power < 15dBm
5074 * index 3 = 15dBm < tx_power < 20dBm
5075 * index 4 = tx_power > 20dBm
5076 */
5077 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005078 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005079 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005080 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005081 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005082 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005083 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005084 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005085 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005086 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005087 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005088 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005089 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005090 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005091}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005092
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005093/**
5094 * Pulls Bluetooth Activity Energy Info
5095 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5096 */
5097message BluetoothActivityInfo {
5098 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005099 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005100 // bluetooth stack state
5101 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005102 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005103 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005104 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005105 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005106 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005107 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005108 // product of current(mA), voltage(V) and time(ms)
5109 optional uint64 energy_used = 6;
5110}
5111
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005112/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005113 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005114 *
5115 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005116 */
5117message ProcessMemoryState {
5118 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005119 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005120
5121 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005122 // Usually package name, "system" for system server.
5123 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005124 optional string process_name = 2;
5125
Rafal Slawikda51b932018-12-13 16:31:33 +00005126 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005127 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005128
5129 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005130 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005131
5132 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005133 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005134
Rajeev Kumar90235992018-01-29 11:06:48 -08005135 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005136 // Value is read from memory.stat, field total_rss if per-app memory
5137 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005138 optional int64 rss_in_bytes = 6;
5139
5140 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005141 // Value is read from memory.stat, field total_cache if per-app memory
5142 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005143 optional int64 cache_in_bytes = 7;
5144
5145 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005146 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005147 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005148 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005149
Rafal Slawik203c3db2019-09-25 19:53:01 +01005150 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005151 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005152
Rafal Slawik203c3db2019-09-25 19:53:01 +01005153 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5154 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005155
Rafal Slawik203c3db2019-09-25 19:53:01 +01005156 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5157 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005158}
5159
5160/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005161 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005162 *
5163 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5164 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005165 *
5166 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005167 */
5168message ProcessMemoryHighWaterMark {
5169 // The uid if available. -1 means not available.
5170 optional int32 uid = 1 [(is_uid) = true];
5171
Rafal Slawikda51b932018-12-13 16:31:33 +00005172 // The process name.
5173 // Usually package name or process cmdline.
5174 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005175 optional string process_name = 2;
5176
Rafal Slawik239b6802019-09-09 18:46:01 +01005177 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5178 // computed by converting kilobytes to bytes.
5179 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5180
Rafal Slawik3bea8952018-11-15 12:39:33 +00005181 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5182 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005183 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005184}
5185
5186/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005187 * Logs the memory stats for a process.
5188 *
5189 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5190 * and for selected native processes.
5191 */
5192message ProcessMemorySnapshot {
5193 // The uid if available. -1 means not available.
5194 optional int32 uid = 1 [(is_uid) = true];
5195
5196 // The process name.
5197 // Usually package name or process cmdline.
5198 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5199 optional string process_name = 2;
5200
5201 // The pid of the process.
5202 // Allows to disambiguate instances of the process.
5203 optional int32 pid = 3;
5204
5205 // The current OOM score adjustment value.
5206 // Read from ProcessRecord for managed processes.
5207 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5208 optional int32 oom_score_adj = 4;
5209
5210 // The current RSS of the process.
5211 // VmRSS from /proc/pid/status.
5212 optional int32 rss_in_kilobytes = 5;
5213
5214 // The current anon RSS of the process.
5215 // RssAnon from /proc/pid/status.
5216 optional int32 anon_rss_in_kilobytes = 6;
5217
5218 // The current swap size of the process.
5219 // VmSwap from /proc/pid/status.
5220 optional int32 swap_in_kilobytes = 7;
5221
5222 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5223 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5224}
5225
5226/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005227 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005228 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005229message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005230 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005231}
5232
5233/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005234 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005235 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005236message SystemUptime {
5237 // Milliseconds since the system was booted.
5238 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5239 // for external input).
5240 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005241 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005242}
5243
5244/*
5245 * Reads from /proc/uid_concurrent_active_time which has the format:
5246 * active: X (X is # cores)
5247 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5248 * [uid1]: [time-0] [time-1] [time-2] ... ...
5249 * ...
5250 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5251 * The file contains a monotonically increasing count of time for a single boot.
5252 */
5253message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005254 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005255 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005256}
5257
5258/**
5259 * Reads from /proc/uid_concurrent_policy_time which has the format:
5260 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5261 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5262 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5263 * ...
5264 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5265 * The file contains a monotonically increasing count of time for a single boot.
5266 */
5267message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005268 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005269 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005270 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005271}
5272
5273/*
5274 * Pulls free disk space, for data, system partition and temporary directory.
5275 */
5276message DiskSpace {
5277 // available bytes in data partition
5278 optional uint64 data_available_bytes = 1;
5279 // available bytes in system partition
5280 optional uint64 system_available_bytes = 2;
5281 // available bytes in download cache or temp directories
5282 optional uint64 temp_available_bytes = 3;
5283}
Tej Singhbf972d92018-01-10 20:51:13 -08005284
5285/**
5286 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005287 *
5288 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005289 */
5290message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005291 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005292}
5293
5294/**
5295 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005296 * Pulled from:
5297 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005298 */
5299message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005300 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005301}
5302
5303/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005304 * Pulls battery voltage.
5305 * Pulled from:
5306 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5307 */
5308message BatteryVoltage {
5309 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005310 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005311}
5312
5313/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005314 * Pulls battery level (percent full, from 0 to 100).
5315 *
5316 * Pulled from:
5317 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5318 */
5319message BatteryLevel {
5320 // Battery level. Should be in [0, 100].
5321 optional int32 battery_level = 1;
5322}
5323
5324/**
Tej Singhd89137e2018-03-26 14:51:40 -07005325 * Pulls the temperature of various parts of the device.
5326 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005327 *
Maggie White442b6312019-04-05 16:26:44 -07005328 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005329 */
5330message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005331 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005332 optional android.os.TemperatureTypeEnum sensor_location = 1;
5333
5334 // The name of the temperature source. Eg. CPU0
5335 optional string sensor_name = 2;
5336
Tej Singhd89137e2018-03-26 14:51:40 -07005337 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005338 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005339 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005340
5341 // Relative severity of the throttling, see enum definition.
5342 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005343}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005344
5345/**
5346 * Pulls the statistics of calls to Binder.
5347 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005348 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5349 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005350 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005351 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005352 */
5353message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005354 // UID of the process responsible for the binder transaction. It will be set if the process
5355 // executing the binder transaction attribute the transaction to another uid using
5356 // Binder.setThreadWorkSource().
5357 //
5358 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005359 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005360 // UID of the process executing the binder transaction.
5361 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005362 // Fully qualified class name of the API call.
5363 //
5364 // This is a system server class name.
5365 //
5366 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5367 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5368 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5369 // commonly used APIs.
5370 optional string service_class_name = 2;
5371 // Method name of the API call. It can also be a transaction code if we cannot
5372 // resolve it to a name. See Binder#getTransactionName.
5373 //
5374 // This is a system server method name.
5375 optional string service_method_name = 3;
5376 // Total number of API calls.
5377 optional int64 call_count = 4;
5378 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5379 optional bool screen_interactive = 13;
5380 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5381 // call_count will be equal to recorded_call_count.
5382 //
5383 // If recorded_call_count is different than call_count, it means data collection has been
5384 // sampled. All the fields below will be sampled in this case.
5385 optional int64 recorded_call_count = 12;
5386 // Number of exceptions thrown by the API.
5387 optional int64 recorded_exception_count = 5;
5388 // Total latency of all API calls.
5389 // Average can be computed using total_latency_micros / recorded_call_count.
5390 optional int64 recorded_total_latency_micros = 6;
5391 // Maximum latency of one API call.
5392 optional int64 recorded_max_latency_micros = 7;
5393 // Total CPU usage of all API calls.
5394 // Average can be computed using total_cpu_micros / recorded_call_count.
5395 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5396 optional int64 recorded_total_cpu_micros = 8;
5397 // Maximum CPU usage of one API call.
5398 optional int64 recorded_max_cpu_micros = 9;
5399 // Maximum parcel reply size of one API call.
5400 optional int64 recorded_max_reply_size_bytes = 10;
5401 // Maximum parcel request size of one API call.
5402 optional int64 recorded_max_request_size_bytes = 11;
5403}
5404
5405/**
5406 * Pulls the statistics of exceptions during calls to Binder.
5407 *
5408 * Binder stats are cumulative from boot unless somebody reset the data using
5409 * > adb shell dumpsys binder_calls_stats --reset
5410 */
5411message BinderCallsExceptions {
5412 // Exception class name, e.g. java.lang.IllegalArgumentException.
5413 //
5414 // This is an exception class name thrown by the system server.
5415 optional string exception_class_name = 1;
5416 // Total number of exceptions.
5417 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005418}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005419
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005420/**
5421 * Pulls the statistics of message dispatching on HandlerThreads.
5422 *
5423 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5424 * config on the device.
5425 *
5426 * Next tag: 11
5427 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005428message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005429 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005430 optional int32 uid = 1 [(is_uid) = true];
5431
5432 // Fully qualified class name of the handler target class.
5433 //
5434 // This field does not contain PII. This is a system server class name.
5435 optional string handler_class_name = 2;
5436
5437 // The name of the thread that runs the Looper.
5438 //
5439 // This field does not contain PII. This is a system server thread name.
5440 optional string looper_thread_name = 3;
5441
5442 // The name of the dispatched message.
5443 //
5444 // This field does not contain PII. This is a system server constant or class
5445 // name.
5446 optional string message_name = 4;
5447
5448 // Total number of successfully dispatched messages.
5449 optional int64 message_count = 5;
5450
5451 // Total number of messages that failed dispatching.
5452 optional int64 exception_count = 6;
5453
5454 // Total number of processed messages we have data recorded for. If we
5455 // collected data for all the messages, message_count will be equal to
5456 // recorded_message_count.
5457 //
5458 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005459 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005460 optional int64 recorded_message_count = 7;
5461
5462 // Total latency of all processed messages.
5463 // Average can be computed using recorded_total_latency_micros /
5464 // recorded_message_count.
5465 optional int64 recorded_total_latency_micros = 8;
5466
5467 // Total CPU usage of all processed message.
5468 // Average can be computed using recorded_total_cpu_micros /
5469 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005470 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005471 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005472
5473 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5474 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005475
5476 // Max recorded CPU usage of all processed messages.
5477 optional int64 recorded_max_cpu_micros = 11;
5478
5479 // Max recorded latency of all processed messages.
5480 optional int64 recorded_max_latency_micros = 12;
5481
5482 // Total number of messages we tracked the dispatching delay for. If we
5483 // collected data for all the messages, message_count will be equal to
5484 // recorded_delay_message_count.
5485 //
5486 // If recorded_delay_message_count is different than message_count, it means data
5487 // collection has been sampled or/and not all messages specified the target dispatch time.
5488 // The fields below will be sampled in this case.
5489 optional int64 recorded_delay_message_count = 13;
5490
5491 // Total dispatching delay of all processed messages.
5492 // Calculated as a difference between the target dispatching time (Message.when)
5493 // and the actual dispatching time.
5494 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5495 optional int64 recorded_total_delay_millis = 14;
5496
5497 // Max dispatching delay of all processed messages.
5498 // Calculated as a difference between the target dispatching time (Message.when)
5499 // and the actual dispatching time.
5500 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005501}
Tej Singh86dc9db2018-09-06 00:39:57 +00005502
5503/**
5504 * Pulls disk information, such as write speed and latency.
5505 */
5506message DiskStats {
5507 // Time taken to open, write 512B to, and close a file.
5508 // -1 if error performing the check.
5509 optional int64 data_write_latency_millis = 1;
5510
5511 optional bool file_based_encryption = 2;
5512
5513 // Recent disk write speed in kB/s.
5514 // -1 if error querying storageed.
5515 // 0 if data is unavailable.
5516 optional int32 recent_disk_write_speed = 3;
5517}
5518
5519
5520/**
5521 * Free and total bytes of the Data, Cache, and System partition.
5522 */
5523message DirectoryUsage {
5524 enum Directory {
5525 UNKNOWN = 0;
5526 DATA = 1;
5527 CACHE = 2;
5528 SYSTEM = 3;
5529 }
5530 optional Directory directory = 1;
5531 optional int64 free_bytes = 2;
5532 optional int64 total_bytes = 3;
5533}
5534
5535
5536/**
5537 * Size of an application: apk size, data size, and cache size.
5538 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5539 * Information is only reported for apps with the primary user (user 0).
5540 * Sizes are aggregated by package name.
5541 */
5542message AppSize {
5543 // Including uids will involve modifying diskstats logic.
5544 optional string package_name = 1;
5545 // App size in bytes. -1 if unavailable.
5546 optional int64 app_size_bytes = 2;
5547 // App data size in bytes. -1 if unavailable.
5548 optional int64 app_data_size_bytes = 3;
5549 // App cache size in bytes. -1 if unavailable.
5550 optional int64 app_cache_size_bytes = 4;
5551 // Time that the cache file was produced.
5552 // Uses System.currentTimeMillis(), which is wall clock time.
5553 optional int64 cache_time_millis = 5;
5554}
5555
5556
5557/**
5558 * Size of a particular category. Eg: photos, videos.
5559 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5560 */
5561message CategorySize {
5562 enum Category {
5563 UNKNOWN = 0;
5564 APP_SIZE = 1;
5565 APP_DATA_SIZE = 2;
5566 APP_CACHE_SIZE = 3;
5567 PHOTOS = 4;
5568 VIDEOS = 5;
5569 AUDIO = 6;
5570 DOWNLOADS = 7;
5571 SYSTEM = 8;
5572 OTHER = 9;
5573 }
5574 optional Category category = 1;
5575 // Category size in bytes.
5576 optional int64 size_bytes = 2;
5577 // Time that the cache file was produced.
5578 // Uses System.currentTimeMillis(), which is wall clock time.
5579 optional int64 cache_time_millis = 3;
5580}
Tej Singhd6d6d772018-09-05 17:41:25 -07005581
5582/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005583 * Pulls per uid I/O stats. The stats are cumulative since boot.
5584 *
5585 * Read/write bytes are I/O events from a storage device
5586 * Read/write chars are data requested by read/write syscalls, and can be
5587 * satisfied by caching.
5588 *
5589 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5590 */
5591message DiskIo {
5592 optional int32 uid = 1 [(is_uid) = true];
5593 optional int64 fg_chars_read = 2;
5594 optional int64 fg_chars_write = 3;
5595 optional int64 fg_bytes_read = 4;
5596 optional int64 fg_bytes_write = 5;
5597 optional int64 bg_chars_read = 6;
5598 optional int64 bg_chars_write = 7;
5599 optional int64 bg_bytes_read = 8;
5600 optional int64 bg_bytes_write = 9;
5601 optional int64 fg_fsync = 10;
5602 optional int64 bg_fsync= 11;
5603}
5604
5605
5606/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005607 * Pulls the number of fingerprints for each user.
5608 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005609 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005610 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005611message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005612 // 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 fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005616 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005617}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005618
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005619/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005620 * Pulls the number of faces for each user.
5621 *
5622 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5623 */
5624message NumFacesEnrolled {
5625 // The associated user. Eg: 0 for owners, 10+ for others.
5626 // Defined in android/os/UserHandle.java
5627 optional int32 user = 1;
5628 // Number of faces registered to that user.
5629 optional int32 num_faces_enrolled = 2;
5630}
5631/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005632 * A mapping of role holder -> role
5633 */
5634message RoleHolder {
5635 // uid of the role holder
5636 optional int32 uid = 1 [(is_uid) = true];
5637
5638 // package name of the role holder
5639 optional string package_name = 2;
5640
5641 // the role held
5642 optional string role = 3;
5643}
5644
Yangsteraf9aee72018-10-12 09:26:16 -07005645message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005646 // These are all in byte resolution.
5647 optional int64 min = 1 [deprecated = true];
5648 optional int64 average = 2 [deprecated = true];
5649 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005650
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005651 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5652 // int64 fields.
5653 optional int32 mean_kb = 4;
5654 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005655}
5656
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005657// A reduced subset of process states; reducing the number of possible states allows more
5658// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5659enum ProcessStateAggregated {
5660 PROCESS_STATE_UNKNOWN = 0;
5661 // Persistent system process.
5662 PROCESS_STATE_PERSISTENT = 1;
5663 // Top activity; actually any visible activity.
5664 PROCESS_STATE_TOP = 2;
5665 // Process binding to top or a foreground service.
5666 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5667 // Processing running a foreground service.
5668 PROCESS_STATE_FGS = 4;
5669 // Important foreground process (ime, wallpaper, etc).
5670 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5671 // Important background process.
5672 PROCESS_STATE_BACKGROUND = 6;
5673 // Process running a receiver.
5674 PROCESS_STATE_RECEIVER = 7;
5675 // All kinds of cached processes.
5676 PROCESS_STATE_CACHED = 8;
5677}
5678
5679// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005680message ProcessStatsStateProto {
5681 optional android.service.procstats.ScreenState screen_state = 1;
5682
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005683 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005684
5685 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5686 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005687 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5688
5689 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005690
5691 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005692 optional int64 duration_millis = 4 [deprecated = true];
5693 // Same as above, but with minute resolution so it fits into an int32.
5694 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005695
5696 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005697 optional int64 realtime_duration_millis = 9 [deprecated = true];
5698 // Same as above, but with minute resolution so it fits into an int32.
5699 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005700
5701 // # of samples taken
5702 optional int32 sample_size = 5;
5703
5704 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005705 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005706
5707 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005708 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005709
5710 // RSS is memory resident for this process
5711 optional AggStats rss = 8;
5712}
5713
Jing Ji060d6862020-04-13 19:36:31 -07005714// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005715message ProcessStatsProto {
5716 // Name of process.
5717 optional string process = 1;
5718
5719 // Uid of the process.
5720 optional int32 uid = 2;
5721
5722 // Information about how often kills occurred
5723 message Kill {
5724 // Count of excessive CPU kills
5725 optional int32 cpu = 1;
5726
5727 // Count of kills when cached
5728 optional int32 cached = 2;
5729
5730 // PSS stats during cached kill
5731 optional AggStats cached_pss = 3;
5732 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005733 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005734
5735 // Time and memory spent in various states.
5736 repeated ProcessStatsStateProto states = 5;
5737
5738 // Total time process has been running... screen_state, memory_state, and process_state
5739 // will not be set.
5740 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005741
5742 // Association data for this process in this state;
5743 // each entry here is one association.
5744 repeated ProcessStatsAssociationProto assocs = 7;
5745}
5746
5747// Next Tag: 5
5748message ProcessStatsAssociationProto {
5749 // Procss Name of the associated process (client process of service binding)
5750 optional string assoc_process_name = 1;
5751
5752 // Package Name of the associated package (client package of service binding)
5753 optional string assoc_package_name = 2;
5754
5755 // Total count of the times this association (service binding) appeared.
5756 optional int32 total_count = 3;
5757
5758 // Uptime total duration in seconds this association (service binding) was around.
5759 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005760}
5761
5762message PackageServiceOperationStatsProto {
5763 // Operate enum: Started, Foreground, Bound, Executing
5764 optional android.service.procstats.ServiceOperationState operation = 1;
5765
5766 // Number of times the service was in this operation.
5767 optional int32 count = 2;
5768
5769 // Information about a state the service can be in.
5770 message StateStats {
5771 // Screen state enum.
5772 optional android.service.procstats.ScreenState screen_state = 1;
5773 // Memory state enum.
5774 optional android.service.procstats.MemoryState memory_state = 2;
5775
5776 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005777 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005778 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005779 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005780 }
5781 repeated StateStats state_stats = 3;
5782}
5783
5784message PackageServiceStatsProto {
5785 // Name of service component.
5786 optional string service_name = 1;
5787
5788 // The operation stats.
5789 // The package_name, package_uid, package_version, service_name will not be set to save space.
5790 repeated PackageServiceOperationStatsProto operation_stats = 2;
5791}
5792
5793message PackageAssociationSourceProcessStatsProto {
5794 // Uid of the process.
5795 optional int32 process_uid = 1;
5796 // Process name.
5797 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005798 // Package name.
5799 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005800 // Total count of the times this association appeared.
5801 optional int32 total_count = 3;
5802
5803 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005804 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005805
5806 // Total count of the times this association became actively impacting its target process.
5807 optional int32 active_count = 5;
5808
5809 // Information on one source in this association.
5810 message StateStats {
5811 // Process state enum.
5812 optional android.service.procstats.ProcessState process_state = 1;
5813 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005814 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005815 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005816 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005817 }
5818 repeated StateStats active_state_stats = 6;
5819}
5820
5821message PackageAssociationProcessStatsProto {
5822 // Name of the target component.
5823 optional string component_name = 1;
5824 // Information on one source in this association.
5825 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5826}
5827
5828
5829message ProcessStatsPackageProto {
5830 // Name of package.
5831 optional string package = 1;
5832
5833 // Uid of the package.
5834 optional int32 uid = 2;
5835
5836 // Version of the package.
5837 optional int64 version = 3;
5838
5839 // Stats for each process running with the package loaded in to it.
5840 repeated ProcessStatsProto process_stats = 4;
5841
5842 // Stats for each of the package's services.
5843 repeated PackageServiceStatsProto service_stats = 5;
5844
5845 // Stats for each association with the package.
5846 repeated PackageAssociationProcessStatsProto association_stats = 6;
5847}
5848
5849message ProcessStatsSectionProto {
5850 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005851 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005852
5853 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005854 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005855
5856 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005857 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005858
5859 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005860 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005861
5862 // System runtime library. e.g. "libdvm.so", "libart.so".
5863 optional string runtime = 5;
5864
5865 // whether kernel reports swapped pss.
5866 optional bool has_swapped_pss = 6;
5867
5868 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5869 enum Status {
5870 STATUS_UNKNOWN = 0;
5871 STATUS_COMPLETE = 1;
5872 STATUS_PARTIAL = 2;
5873 STATUS_SHUTDOWN = 3;
5874 STATUS_SYSPROPS = 4;
5875 }
5876 repeated Status status = 7;
5877
Chenjie Yub2ecc792019-01-17 10:27:26 -08005878 // Number of pages available of various types and sizes, representation fragmentation.
5879 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5880
Yangsteraf9aee72018-10-12 09:26:16 -07005881 // Stats for each process.
5882 repeated ProcessStatsProto process_stats = 8;
5883
5884 // Stats for each package.
5885 repeated ProcessStatsPackageProto package_stats = 9;
5886}
5887
Chenjie Yub2ecc792019-01-17 10:27:26 -08005888message ProcessStatsAvailablePagesProto {
5889 // Node these pages are in (as per /proc/pagetypeinfo)
5890 optional int32 node = 1;
5891
5892 // Zone these pages are in (as per /proc/pagetypeinfo)
5893 optional string zone = 2;
5894
5895 // Label for the type of these pages (as per /proc/pagetypeinfo)
5896 optional string label = 3;
5897
5898 // Distribution of number of pages available by order size. First entry in array is
5899 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5900 repeated int32 pages_per_order = 4;
5901}
5902
Chenjie Yu12e5e672018-09-14 15:54:59 -07005903/**
5904 * Pulled from ProcessStatsService.java
5905 */
5906message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005907 optional ProcessStatsSectionProto proc_stats_section = 1;
5908}
5909
Chenjie Yuf910b7802019-01-11 16:08:20 -08005910/**
5911 * Pulled from ProcessStatsService.java
5912 */
5913message ProcStatsPkgProc {
5914 optional ProcessStatsSectionProto proc_stats_section = 1;
5915}
5916
Chris Wrencdea3b72019-11-22 16:58:17 -05005917// Next Tag: 2
5918message PackageRemoteViewInfoProto {
5919 optional string package_name = 1;
5920 // add per-package additional info here (like channels)
5921}
5922
5923// Next Tag: 2
5924message NotificationRemoteViewsProto {
5925 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5926}
5927
5928/**
5929 * Pulled from NotificationManagerService.java
5930 */
5931message NotificationRemoteViews {
5932 optional NotificationRemoteViewsProto notification_remote_views = 1;
5933}
5934
Yotam Aron74299972020-01-16 16:20:58 +02005935/**
5936 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5937 */
5938message PackageNotificationPreferences {
5939 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005940 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005941 // Notification importance, which specifies when and how a notification is displayed.
5942 // Specified under core/java/android/app/NotificationManager.java.
5943 optional int32 importance = 2;
5944 // Lockscreen visibility as set by the user.
5945 optional int32 visibility = 3;
5946 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5947 // PreferencesHelper.java)
5948 optional int32 user_locked_fields = 4;
5949}
5950
5951/**
5952 * Atom that contains a list of a package's channel preferences, pulled from
5953 * NotificationManagerService.java.
5954 */
5955message PackageNotificationChannelPreferences {
5956 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005957 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005958 // Channel's ID. Should always be available.
5959 optional string channel_id = 2;
5960 // Channel's name. Should always be available.
5961 optional string channel_name = 3;
5962 // Channel's description. Optionally set by the channel creator.
5963 optional string description = 4;
5964 // Notification importance, which specifies when and how a notification is displayed. Specified
5965 // under core/java/android/app/NotificationManager.java.
5966 optional int32 importance = 5;
5967 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5968 // at core/java/android/app/NotificationChannel.java
5969 optional int32 user_locked_fields = 6;
5970 // Indicates if the channel was deleted by the app.
5971 optional bool is_deleted = 7;
5972}
5973
5974/**
5975 * Atom that contains a list of a package's channel group preferences, pulled from
5976 * NotificationManagerService.java.
5977 */
5978message PackageNotificationChannelGroupPreferences {
5979 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005980 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005981 // Channel Group's ID. Should always be available.
5982 optional string group_id = 2;
5983 // Channel Group's name. Should always be available.
5984 optional string group_name = 3;
5985 // Channel Group's description. Optionally set by group creator.
5986 optional string description = 4;
5987 // Indicates if notifications from this channel group are blocked.
5988 optional bool is_blocked = 5;
5989 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5990 // at core/java/android/app/NotificationChannelGroup.java
5991 optional int32 user_locked_fields = 6;
5992}
5993
Yangsteraf9aee72018-10-12 09:26:16 -07005994message PowerProfileProto {
5995 optional double cpu_suspend = 1;
5996
5997 optional double cpu_idle = 2;
5998
5999 optional double cpu_active = 3;
6000
6001 message CpuCluster {
6002 optional int32 id = 1;
6003 optional double cluster_power = 2;
6004 optional int32 cores = 3;
6005 repeated int64 speed = 4;
6006 repeated double core_power = 5;
6007 }
6008
6009 repeated CpuCluster cpu_cluster = 40;
6010
6011 optional double wifi_scan = 4;
6012
6013 optional double wifi_on = 5;
6014
6015 optional double wifi_active = 6;
6016
6017 optional double wifi_controller_idle = 7;
6018
6019 optional double wifi_controller_rx = 8;
6020
6021 optional double wifi_controller_tx = 9;
6022
6023 repeated double wifi_controller_tx_levels = 10;
6024
6025 optional double wifi_controller_operating_voltage = 11;
6026
6027 optional double bluetooth_controller_idle = 12;
6028
6029 optional double bluetooth_controller_rx = 13;
6030
6031 optional double bluetooth_controller_tx = 14;
6032
6033 optional double bluetooth_controller_operating_voltage = 15;
6034
6035 optional double modem_controller_sleep = 16;
6036
6037 optional double modem_controller_idle = 17;
6038
6039 optional double modem_controller_rx = 18;
6040
6041 repeated double modem_controller_tx = 19;
6042
6043 optional double modem_controller_operating_voltage = 20;
6044
6045 optional double gps_on = 21;
6046
6047 repeated double gps_signal_quality_based = 22;
6048
6049 optional double gps_operating_voltage = 23;
6050
6051 optional double bluetooth_on = 24;
6052
6053 optional double bluetooth_active = 25;
6054
6055 optional double bluetooth_at_cmd = 26;
6056
6057 optional double ambient_display = 27;
6058
6059 optional double screen_on = 28;
6060
6061 optional double radio_on = 29;
6062
6063 optional double radio_scanning = 30;
6064
6065 optional double radio_active = 31;
6066
6067 optional double screen_full = 32;
6068
6069 optional double audio = 33;
6070
6071 optional double video = 34;
6072
6073 optional double flashlight = 35;
6074
6075 optional double memory = 36;
6076
6077 optional double camera = 37;
6078
6079 optional double wifi_batched_scan = 38;
6080
6081 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006082}
Chenjie Yuab530202018-09-26 12:39:20 -07006083
6084/**
6085 * power_profile.xml and other constants for power model calculations.
6086 * Pulled from PowerProfile.java
6087 */
6088message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006089 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006090}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006091
6092/**
arangelovd5db50e2018-10-12 20:24:39 +01006093 * Logs when a user restriction was added or removed.
6094 *
6095 * Logged from:
6096 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6097 */
6098message UserRestrictionChanged {
6099 // The raw string of the user restriction as defined in UserManager.
6100 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6101 optional string restriction = 1;
6102 // Whether the restriction is enabled or disabled.
6103 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006104}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006105
6106/**
6107 * Pulls process user time and system time. Puller takes a snapshot of all pids
6108 * in the system and returns cpu stats for those that are working at the time.
6109 * Dead pids will be dropped. Kernel processes are excluded.
6110 * Min cool-down is 5 sec.
6111 */
6112message ProcessCpuTime {
6113 optional int32 uid = 1 [(is_uid) = true];
6114
6115 optional string process_name = 2;
6116 // Process cpu time in user space, cumulative from boot/process start
6117 optional int64 user_time_millis = 3;
6118 // Process cpu time in system space, cumulative from boot/process start
6119 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006120}
Misha Wagner5a51e002018-10-03 15:04:09 +01006121
6122/**
6123 * Pulls the CPU usage for each thread.
6124 *
6125 * Read from /proc/$PID/task/$TID/time_in_state files.
6126 *
6127 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6128 * time_in_state files not being present on some phones, have not been addressed. These should be
6129 * considered before a public release.
6130 */
6131message CpuTimePerThreadFreq {
6132 // UID that owns the process.
6133 optional int32 uid = 1 [(is_uid) = true];
6134 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006135 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006136 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006137 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006138 // Name of the process taken from `/proc/$PID/cmdline`.
6139 optional string process_name = 4;
6140 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6141 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006142
6143 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6144 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6145 // frequencies are given here as the alternative is sending eight separate atoms. This method
6146 // significantly reduces the amount of data created
6147 optional int32 frequency1_khz = 6;
6148 optional int32 time1_millis = 7;
6149 optional int32 frequency2_khz = 8;
6150 optional int32 time2_millis = 9;
6151 optional int32 frequency3_khz = 10;
6152 optional int32 time3_millis = 11;
6153 optional int32 frequency4_khz = 12;
6154 optional int32 time4_millis = 13;
6155 optional int32 frequency5_khz = 14;
6156 optional int32 time5_millis = 15;
6157 optional int32 frequency6_khz = 16;
6158 optional int32 time6_millis = 17;
6159 optional int32 frequency7_khz = 18;
6160 optional int32 time7_millis = 19;
6161 optional int32 frequency8_khz = 20;
6162 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006163}
Bookatz75ee60422018-11-09 12:27:37 -08006164
6165/**
Bookatz366a4432018-11-20 09:42:33 -08006166 * Pulls information about the device's build.
6167 */
6168message BuildInformation {
6169 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6170 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6171 optional string fingerprint = 1;
6172
6173 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6174 optional string brand = 2;
6175
6176 // Build.PRODUCT. The name of the overall product.
6177 optional string product = 3;
6178
6179 // Build.DEVICE. The name of the industrial design.
6180 optional string device = 4;
6181
6182 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6183 optional string version_release = 5;
6184
6185 // Build.ID. E.g. a label like "M4-rc20".
6186 optional string id = 6;
6187
6188 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6189 // represent this build.
6190 optional string version_incremental = 7;
6191
6192 // Build.TYPE. The type of build, like "user" or "eng".
6193 optional string type = 8;
6194
6195 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6196 optional string tags = 9;
6197}
6198
6199/**
Adam He420947c2019-01-23 15:59:09 -08006200 * Logs information about mismatched caller for content capture.
6201 *
6202 * Logged from:
6203 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6204 */
6205message ContentCaptureCallerMismatchReported {
6206 optional string intended_package = 1;
6207 optional string calling_package = 2;
6208}
6209
6210/**
6211 * Logs information about content capture service events.
6212 *
6213 * Logged from:
6214 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6215 */
6216message ContentCaptureServiceEvents {
6217 // The type of event.
6218 enum Event {
6219 UNKNOWN = 0;
6220 ON_CONNECTED = 1;
6221 ON_DISCONNECTED = 2;
6222 SET_WHITELIST = 3;
6223 SET_DISABLED = 4;
6224 ON_USER_DATA_REMOVED = 5;
6225 }
6226 optional Event event = 1;
6227 // component/package of content capture service.
6228 optional string service_info = 2;
6229 // component/package of target.
6230 // it's a concatenated list of component/package for SET_WHITELIST event
6231 // separated by " ".
6232 optional string target_info = 3;
6233}
6234
6235/**
6236 * Logs information about content capture session events.
6237 *
6238 * Logged from:
6239 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6240 */
6241message ContentCaptureSessionEvents {
6242 // The type of event.
6243 enum Event {
6244 UNKNOWN = 0;
6245 ON_SESSION_STARTED = 1;
6246 ON_SESSION_FINISHED = 2;
6247 SESSION_NOT_CREATED = 3;
6248 }
6249 optional int32 session_id = 1;
6250 optional Event event = 2;
6251 // (n/a on session finished)
6252 optional int32 state_flags = 3;
6253 // component/package of content capture service.
6254 optional string service_info = 4;
6255 // component/package of app.
6256 // (n/a on session finished)
6257 optional string app_info = 5;
6258 optional bool is_child_session = 6;
6259}
6260
6261/**
6262 * Logs information about session being flushed.
6263 *
6264 * Logged from:
6265 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6266 */
6267message ContentCaptureFlushed {
6268 optional int32 session_id = 1;
6269 // component/package of content capture service.
6270 optional string service_info = 2;
6271 // component/package of app.
6272 optional string app_info = 3;
6273 // session start/finish events
6274 optional int32 child_session_started = 4;
6275 optional int32 child_session_finished = 5;
6276 // count of view events.
6277 optional int32 view_appeared_count = 6;
6278 optional int32 view_disappeared_count = 7;
6279 optional int32 view_text_changed_count = 8;
6280
6281 // Flush stats.
6282 optional int32 max_events = 9;
6283 optional int32 idle_flush_freq = 10;
6284 optional int32 text_flush_freq = 11;
6285 optional int32 flush_reason = 12;
6286}
6287
6288/**
Bookatz75ee60422018-11-09 12:27:37 -08006289 * Pulls on-device BatteryStats power use calculations for the overall device.
6290 */
6291message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006292 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6293 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6294 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6295 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006296}
6297
6298/**
6299 * Pulls on-device BatteryStats power use calculations broken down by uid.
6300 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6301 * that is attributed to non-uid items. They must all be included to get the total power use.
6302 */
6303message DeviceCalculatedPowerBlameUid {
6304 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6305 optional int32 uid = 1 [(is_uid) = true];
6306
Bookatz3dbc13a2018-12-21 12:16:51 -08006307 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6308 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6309 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006310}
6311
6312/**
6313 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6314 * drain type.
6315 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6316 * is attributed uids. They must all be included to get the total power use.
6317 */
6318message DeviceCalculatedPowerBlameOther {
6319 // The type of item whose power use is being reported.
6320 enum DrainType {
6321 AMBIENT_DISPLAY = 0;
6322 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6323 BLUETOOTH = 2;
6324 CAMERA = 3;
6325 // Cell-standby
6326 CELL = 4;
6327 FLASHLIGHT = 5;
6328 IDLE = 6;
6329 MEMORY = 7;
6330 // Amount that total computed drain exceeded the drain estimated using the
6331 // battery level changes and capacity.
6332 OVERCOUNTED = 8;
6333 PHONE = 9;
6334 SCREEN = 10;
6335 // Amount that total computed drain was below the drain estimated using the
6336 // battery level changes and capacity.
6337 UNACCOUNTED = 11;
6338 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6339 WIFI = 13;
6340 }
6341 optional DrainType drain_type = 1;
6342
Bookatz3dbc13a2018-12-21 12:16:51 -08006343 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6344 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6345 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006346}
arangelov4e994062018-11-13 16:12:38 +00006347
6348/**
6349 * Logs device policy features.
6350 *
6351 * Logged from:
6352 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6353 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6354 */
6355message DevicePolicyEvent {
6356 // The event id - unique for each event.
6357 optional android.stats.devicepolicy.EventId event_id = 1;
6358 // The admin package name.
6359 optional string admin_package_name = 2;
6360 // A generic integer parameter.
6361 optional int32 integer_value = 3;
6362 // A generic boolean parameter.
6363 optional bool boolean_value = 4;
6364 // A parameter specifying a time period in milliseconds.
6365 optional uint64 time_period_millis = 5;
6366 // A parameter specifying a list of package names, bundle extras or string parameters.
6367 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6368}
shawnlinea5b66b2018-11-13 15:05:29 +08006369
6370/**
6371 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6372 *
6373 * Logged from:
6374 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6375 */
6376message DocsUILaunchReported {
6377 optional android.stats.docsui.LaunchAction launch_action = 1;
6378 optional bool has_initial_uri = 2;
6379 optional android.stats.docsui.MimeType mime_type = 3;
6380 optional android.stats.docsui.Root initial_root = 4;
6381}
6382
6383/**
6384 * Logs root/app visited event in file managers/picker. Call this when the user
6385 * taps on root/app in hamburger menu.
6386 *
6387 * Logged from:
6388 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6389 */
6390message DocsUIRootVisitedReported {
6391 optional android.stats.docsui.ContextScope scope = 1;
6392 optional android.stats.docsui.Root root = 2;
6393}
6394
6395/**
6396 * Logs file operation stats. Call this when a file operation has completed.
6397 *
6398 * Logged from:
6399 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6400 */
6401message DocsUIFileOperationReported {
6402 optional android.stats.docsui.Provider provider = 1;
6403 optional android.stats.docsui.FileOperation file_op = 2;
6404}
6405
6406/**
6407 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6408 * mode.
6409 *
6410 * Logged from:
6411 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6412 */
6413message DocsUIFileOperationCopyMoveModeReported {
6414 optional android.stats.docsui.FileOperation file_op = 1;
6415 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6416}
6417
6418
6419/**
6420 * Logs file sub operation stats. Call this when a file operation has failed.
6421 *
6422 * Logged from:
6423 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6424 */
6425message DocsUIFileOperationFailureReported {
6426 optional android.stats.docsui.Authority authority = 1;
6427 optional android.stats.docsui.SubFileOperation sub_op = 2;
6428}
6429
6430/**
6431* Logs the cancellation of a file operation. Call this when a job is canceled
6432*
6433* Logged from:
6434* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6435*/
6436message DocsUIFileOperationCanceledReported {
6437 optional android.stats.docsui.FileOperation file_op = 1;
6438}
6439
6440/**
6441 * Logs startup time in milliseconds.
6442 *
6443 * Logged from:
6444 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6445 */
6446message DocsUIStartupMsReported {
6447 optional int32 startup_millis = 1;
6448}
6449
6450/**
6451 * Logs the action that was started by user.
6452 *
6453 * Logged from:
6454 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6455 */
6456message DocsUIUserActionReported {
6457 optional android.stats.docsui.UserAction action = 1;
6458}
6459
6460/**
6461 * Logs the invalid type when invalid scoped access is requested.
6462 *
6463 * Logged from:
6464 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6465 */
6466message DocsUIInvalidScopedAccessRequestReported {
6467 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006468}
Ben Murdochbab399f2018-12-06 11:01:38 +00006469
6470/**
shawnlina75e82d2019-01-07 10:31:12 +08006471 * Logs the package name that launches docsui picker mode.
6472 *
6473 * Logged from:
6474 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6475 */
6476message DocsUIPickerLaunchedFromReported {
6477 optional string package_name = 1;
6478}
6479
6480/**
6481 * Logs the search type.
6482 *
6483 * Logged from:
6484 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6485 */
6486message DocsUISearchTypeReported {
6487 optional android.stats.docsui.SearchType search_type = 1;
6488}
6489
6490/**
6491 * Logs the search mode.
6492 *
6493 * Logged from:
6494 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6495 */
6496message DocsUISearchModeReported {
6497 optional android.stats.docsui.SearchMode search_mode = 1;
6498}
6499
6500/**
6501 * Logs the pick result information.
6502 *
6503 * Logged from:
6504 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6505 */
6506message DocsUIPickResultReported {
6507 optional int32 total_action_count = 1;
6508 optional int64 duration_millis = 2;
6509 optional int32 file_count= 3;
6510 optional bool is_searching = 4;
6511 optional android.stats.docsui.Root picked_from = 5;
6512 optional android.stats.docsui.MimeType mime_type = 6;
6513 optional int32 repeatedly_pick_times = 7;
6514}
6515
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006516/** Logs the drag and drop of files.
6517
6518 * Logged from:
6519 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6520 */
6521message DocsUIDragAndDropReported {
6522 optional bool drag_initiated_from_docsui = 1;
6523}
6524
shawnlina75e82d2019-01-07 10:31:12 +08006525/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006526 * Logs when an app's memory is compacted.
6527 *
6528 * Logged from:
6529 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6530 */
6531message AppCompacted {
6532 // The pid of the process being compacted.
6533 optional int32 pid = 1;
6534
6535 // The name of the process being compacted.
6536 optional string process_name = 2;
6537
6538 // The type of compaction.
6539 enum Action {
6540 UNKNOWN = 0;
6541 SOME = 1;
6542 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006543 PERSISTENT = 3;
6544 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006545 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006546 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006547
6548 // Total RSS in kilobytes consumed by the process prior to compaction.
6549 optional int64 before_rss_total_kilobytes = 4;
6550
6551 // File RSS in kilobytes consumed by the process prior to compaction.
6552 optional int64 before_rss_file_kilobytes = 5;
6553
6554 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6555 optional int64 before_rss_anon_kilobytes = 6;
6556
6557 // Swap in kilobytes consumed by the process prior to compaction.
6558 optional int64 before_swap_kilobytes = 7;
6559
6560 // Total RSS in kilobytes consumed by the process after compaction.
6561 optional int64 after_rss_total_kilobytes = 8;
6562
6563 // File RSS in kilobytes consumed by the process after compaction.
6564 optional int64 after_rss_file_kilobytes = 9;
6565
6566 // Anonymous RSS in kilobytes consumed by the process after compaction.
6567 optional int64 after_rss_anon_kilobytes = 10;
6568
6569 // Swap in kilobytes consumed by the process after compaction.
6570 optional int64 after_swap_kilobytes = 11;
6571
6572 // The time taken to perform compaction in milliseconds.
6573 optional int64 time_to_compact_millis = 12;
6574
6575 // The last compaction action performed for this app.
6576 optional Action last_action = 13;
6577
Ben Murdoch01720b82018-12-19 18:03:44 +00006578 // The last time that compaction was attempted on this process in milliseconds
6579 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6580 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006581
Ben Murdoch885c21b2019-03-15 18:02:04 +00006582 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006583 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006584
6585 // The process state at the time of compaction.
6586 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006587
6588 // Free ZRAM in kilobytes before compaction.
6589 optional int64 before_zram_free_kilobytes = 17;
6590
6591 // Free ZRAM in kilobytes after compaction.
6592 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006593}
lifr157fc552018-12-12 16:38:04 +08006594
6595/**
lifrb6b90b62019-03-29 00:40:17 +08006596 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6597 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6598 *
lifr1f74b052019-04-16 22:16:30 +08006599 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6600 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6601 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6602 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006603 */
6604message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006605 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006606
lifr1f74b052019-04-16 22:16:30 +08006607 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006608
6609 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006610 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006611
lifr1f74b052019-04-16 22:16:30 +08006612 // Only valid for event_type = EVENT_GETADDRINFO.
6613 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006614
lifr1f74b052019-04-16 22:16:30 +08006615 // Flags passed to android_res_nsend() defined in multinetwork.h
6616 // Only valid for event_type = EVENT_RESNSEND.
6617 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006618
lifrad9becc2019-05-20 11:04:41 +08006619 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006620
6621 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006622 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006623
6624 // Additional pass-through fields opaque to statsd.
6625 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006626 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006627
6628 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6629 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006630}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006631
6632/**
6633 * Logs when a data stall event occurs.
6634 *
6635 * Log from:
6636 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6637 */
6638message DataStallEvent {
6639 // Data stall evaluation type.
6640 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6641 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6642 optional int32 evaluation_type = 1;
6643 // See definition in data_stall_event.proto.
6644 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6645 // See definition in data_stall_event.proto.
6646 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6647 // See definition in data_stall_event.proto.
6648 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6649 // See definition in data_stall_event.proto.
6650 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6651 // See definition in data_stall_event.proto.
6652 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6653}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006654
6655/*
6656 * Logs when RescueParty resets some set of experiment flags.
6657 *
6658 * Logged from:
6659 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6660 */
6661message RescuePartyResetReported {
6662 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6663 optional int32 rescue_level = 1;
6664}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006665
6666/**
6667 * Logs when signed config is received from an APK, and if that config was applied successfully.
6668 * Logged from:
6669 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6670 */
6671message SignedConfigReported {
6672 enum Type {
6673 UNKNOWN_TYPE = 0;
6674 GLOBAL_SETTINGS = 1;
6675 }
6676 optional Type type = 1;
6677
6678 // The final status of the signed config received.
6679 enum Status {
6680 UNKNOWN_STATUS = 0;
6681 APPLIED = 1;
6682 BASE64_FAILURE_CONFIG = 2;
6683 BASE64_FAILURE_SIGNATURE = 3;
6684 SECURITY_EXCEPTION = 4;
6685 INVALID_CONFIG = 5;
6686 OLD_CONFIG = 6;
6687 SIGNATURE_CHECK_FAILED = 7;
6688 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006689 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006690 }
6691 optional Status status = 2;
6692
6693 // The version of the signed config processed.
6694 optional int32 version = 3;
6695
6696 // The package name that the config was extracted from.
6697 optional string from_package = 4;
6698
6699 enum Key {
6700 NO_KEY = 0;
6701 DEBUG = 1;
6702 PRODUCTION = 2;
6703 }
6704 // Which key was used to verify the config.
6705 optional Key verified_with = 5;
6706}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006707
6708/*
6709 * Logs GNSS Network-Initiated (NI) location events.
6710 *
6711 * Logged from:
6712 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6713 */
6714message GnssNiEventReported {
6715 // The type of GnssNiEvent.
6716 enum EventType {
6717 UNKNOWN = 0;
6718 NI_REQUEST = 1;
6719 NI_RESPONSE = 2;
6720 }
6721 optional EventType event_type = 1;
6722
6723 // An ID generated by HAL to associate NI notifications and UI responses.
6724 optional int32 notification_id = 2;
6725
6726 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006727 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006728
6729 // NI requires notification.
6730 optional bool need_notify = 4;
6731
6732 // NI requires verification.
6733 optional bool need_verify = 5;
6734
6735 // NI requires privacy override, no notification/minimal trace.
6736 optional bool privacy_override = 6;
6737
6738 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6739 // seconds.
6740 optional int32 timeout = 7;
6741
6742 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006743 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006744
6745 // String representing the requester of the network inititated location request.
6746 optional string requestor_id = 9;
6747
6748 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6749 // network initiated location request.
6750 optional string text = 10;
6751
6752 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006753 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006754
6755 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006756 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006757
6758 // True if SUPL ES is enabled.
6759 optional bool is_supl_es_enabled = 13;
6760
6761 // True if GNSS location is enabled.
6762 optional bool is_location_enabled = 14;
6763
6764 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006765 optional android.server.location.GnssUserResponseType user_response = 15;
6766}
6767
6768/**
6769 * Logs GNSS non-framework (NFW) location notification.
6770 *
6771 * Logged from:
6772 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6773 */
6774message GnssNfwNotificationReported {
6775 // Package name of the Android proxy application representing the non-framework entity that
6776 // requested location. Set to empty string if unknown.
6777 optional string proxy_app_package_name = 1;
6778
6779 // Protocol stack that initiated the non-framework location request.
6780 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6781
6782 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6783 // set to empty string. This field is opaque to the framework and used for logging purposes.
6784 optional string other_protocol_stack_name = 3;
6785
6786 // Source initiating/receiving the location information.
6787 optional android.server.location.NfwRequestor requestor = 4;
6788
6789 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6790 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6791 // and used for logging purposes.
6792 optional string requestor_id = 5;
6793
6794 // Indicates whether location information was provided for this request.
6795 optional android.server.location.NfwResponseType response_type = 6;
6796
6797 // True if the device is in user initiated emergency session.
6798 optional bool in_emergency_mode = 7;
6799
6800 // True if cached location is provided.
6801 optional bool is_cached_location = 8;
6802
6803 // True if proxy app permission mismatch between framework and GNSS HAL.
6804 optional bool is_permission_mismatched = 9;
6805}
6806
6807/**
6808 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6809 *
6810 * Logged from:
6811 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6812 */
6813message GnssConfigurationReported {
6814 // SUPL host name.
6815 optional string supl_host = 1;
6816
6817 // SUPL port number.
6818 optional int32 supl_port = 2;
6819
6820 // C2K host name.
6821 optional string c2k_host = 3;
6822
6823 // C2K port number.
6824 optional int32 c2k_port = 4;
6825
6826 // The SUPL version requested by Carrier.
6827 optional int32 supl_ver = 5;
6828
6829 // The SUPL mode.
6830 optional android.server.location.SuplMode supl_mode = 6;
6831
6832 // True if NI emergency SUPL restrictions is enabled.
6833 optional bool supl_es = 7;
6834
6835 // LTE Positioning Profile settings
6836 optional android.server.location.LppProfile lpp_profile = 8;
6837
6838 // Positioning protocol on A-Glonass system.
6839 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6840
6841 // True if emergency PDN is used. Otherwise, regular PDN is used.
6842 optional bool use_emergency_pdn_for_emergency_supl= 10;
6843
6844 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6845 optional android.server.location.GpsLock gps_lock = 11;
6846
6847 // Number of seconds to extend the emergency session duration post emergency call.
6848 optional int32 es_extension_sec = 12;
6849
6850 // The full list of package names of proxy Android applications representing the non-framework
6851 // location access entities (on/off the device) for which the framework user has granted
6852 // non-framework location access permission. The package names are concatenated in one string
6853 // with spaces as separators.
6854 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006855}
Jack Yu95b64f32018-12-13 18:26:11 +08006856
6857/**
6858 * Logs when a NFC device's error occurred.
6859 * Logged from:
6860 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6861 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6862 */
6863message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006864 enum Type {
6865 UNKNOWN = 0;
6866 CMD_TIMEOUT = 1;
6867 ERROR_NOTIFICATION = 2;
6868 AID_OVERFLOW = 3;
6869 }
6870 optional Type type = 1;
6871 // If it's nci cmd timeout, log the timeout command.
6872 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006873
Alex Salod7c3eef2019-01-25 14:43:27 -08006874 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006875}
6876
6877/**
6878 * Logs when a NFC device's state changed event
6879 * Logged from:
6880 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6881 */
6882message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006883 enum State {
6884 UNKNOWN = 0;
6885 OFF = 1;
6886 ON = 2;
6887 ON_LOCKED = 3; // Secure Nfc enabled.
6888 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6889 }
6890 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006891}
6892
6893/**
6894 * Logs when a NFC Beam Transaction occurred.
6895 * Logged from:
6896 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6897 */
6898message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006899 enum Operation {
6900 UNKNOWN = 0;
6901 SEND = 1;
6902 RECEIVE = 2;
6903 }
6904 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006905}
6906
6907/**
6908 * Logs when a NFC Card Emulation Transaction occurred.
6909 * Logged from:
6910 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6911 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6912 */
6913message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006914 enum Category {
6915 UNKNOWN = 0;
6916 HCE_PAYMENT = 1;
6917 HCE_OTHER = 2;
6918 OFFHOST = 3;
6919 }
6920 // Transaction belongs to HCE payment or HCE other category, or offhost.
6921 optional Category category = 1;
6922 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6923 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006924}
6925
6926/**
6927 * Logs when a NFC Tag event occurred.
6928 * Logged from:
6929 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6930 */
6931message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006932 enum Type {
6933 UNKNOWN = 0;
6934 URL = 1;
6935 BT_PAIRING = 2;
6936 PROVISION = 3;
6937 WIFI_CONNECT = 4;
6938 APP_LAUNCH = 5;
6939 OTHERS = 6;
6940 }
6941 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006942}
6943
6944/**
6945 * Logs when Hce transaction triggered
6946 * Logged from:
6947 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6948 */
6949message NfcHceTransactionOccurred {
6950 // The latency period(in microseconds) it took for the first HCE data
6951 // exchange.
6952 optional uint32 latency_micros = 1;
6953}
6954
6955/**
6956 * Logs when SecureElement state event changed
6957 * Logged from:
6958 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6959 */
6960message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006961 enum State {
6962 UNKNOWN = 0;
6963 INITIALIZED = 1;
6964 DISCONNECTED = 2;
6965 CONNECTED = 3;
6966 HALCRASH = 4;
6967 }
6968 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006969
Alex Salod7c3eef2019-01-25 14:43:27 -08006970 optional string state_change_reason = 2;
6971 // SIMx or eSEx.
6972 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006973}
6974
6975/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006976 * Information about a permission grant request
6977 */
6978message PermissionGrantRequestResultReported {
6979 // unique value identifying an API call. A API call might result in multiple of these atoms
6980 optional int64 request_id = 1;
6981
6982 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006983 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006984
6985 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006986 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006987
6988 // The permission to be granted
6989 optional string permission_name = 4;
6990
6991 // If the permission was explicitly requested via the API or added by the system
6992 optional bool is_implicit = 5;
6993
6994 enum Result {
6995 UNDEFINED = 0;
6996 // permission request was ignored
6997 IGNORED = 1;
6998 // permission request was ignored because it was user fixed
6999 IGNORED_USER_FIXED = 2;
7000 // permission request was ignored because it was policy fixed
7001 IGNORED_POLICY_FIXED = 3;
7002 // permission was granted by user action
7003 USER_GRANTED = 4;
7004 // permission was automatically granted
7005 AUTO_GRANTED = 5;
7006 // permission was denied by user action
7007 USER_DENIED = 6;
7008 // permission was denied with prejudice by the user
7009 USER_DENIED_WITH_PREJUDICE = 7;
7010 // permission was automatically denied
7011 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007012 // permission request was ignored because permission is restricted
7013 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007014 // one time permission was granted by user action
7015 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007016 // user ignored request by leaving the request screen without choosing any option
7017 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007018 // user granted the permission after being linked to settings
7019 USER_GRANTED_IN_SETTINGS = 12;
7020 // user denied the permission after being linked to settings
7021 USER_DENIED_IN_SETTINGS = 13;
7022 // user denied the permission with prejudice after being linked to settings
7023 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7024 // permission was automatically revoked after one-time permission expired
7025 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007026 // permission was automatically revoked for unused app
7027 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007028 }
7029 // The result of the permission grant
7030 optional Result result = 6;
7031}
7032
7033/**
Jack Yu95b64f32018-12-13 18:26:11 +08007034 * Logs when Omapi API used
7035 * Logged from:
7036 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7037 */
7038message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007039 enum Operation {
7040 UNKNOWN = 0;
7041 OPEN_CHANNEL = 1;
7042 }
7043 optional Operation operation = 1;
7044 // SIMx or eSEx.
7045 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007046
Alex Salod7c3eef2019-01-25 14:43:27 -08007047 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007048}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007049
7050/**
Alex Saloa060aee2019-01-21 14:36:41 -08007051 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7052 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007053 * Logged from:
7054 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7055 */
7056message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007057 optional int64 dispatch_latency_millis = 1;
7058}
7059
7060/**
7061 * Logs AttentionManagerService attention check result.
7062 *
7063 * Logged from:
7064 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7065 */
7066message AttentionManagerServiceResultReported {
7067 // See core/java/android/service/attention/AttentionService.java
7068 enum AttentionCheckResult {
7069 UNKNOWN = 20;
7070 ATTENTION_SUCCESS_ABSENT = 0;
7071 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007072 ATTENTION_FAILURE_UNKNOWN = 2;
7073 ATTENTION_FAILURE_CANCELLED = 3;
7074 ATTENTION_FAILURE_PREEMPTED = 4;
7075 ATTENTION_FAILURE_TIMED_OUT = 5;
7076 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007077 }
7078 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007079}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007080
7081/**
7082 * Logs when an adb connection changes state.
7083 *
7084 * Logged from:
7085 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7086 */
7087message AdbConnectionChanged {
7088 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7089 // previously selected for this system.
7090 optional int64 last_connection_time_millis = 1;
7091
7092 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7093 // to reconnect via adb without user interaction.
7094 optional int64 auth_window_millis = 2;
7095
7096 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7097 optional android.debug.AdbConnectionStateEnum state = 3;
7098
7099 // True if the 'always allow' option was selected for this system.
7100 optional bool always_allow = 4;
7101}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007102
7103/*
7104 * Logs the reported speech DSP status.
7105 *
7106 * Logged from:
7107 * Vendor audio implementation.
7108 */
7109message SpeechDspStatReported {
7110 // The total Speech DSP uptime in milliseconds.
7111 optional int32 total_uptime_millis = 1;
7112 // The total Speech DSP downtime in milliseconds.
7113 optional int32 total_downtime_millis = 2;
7114 optional int32 total_crash_count = 3;
7115 optional int32 total_recover_count = 4;
7116}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007117
7118/**
7119 * Logs USB connector contaminant status.
7120 *
7121 * Logged from: USB Service.
7122 */
7123message UsbContaminantReported {
7124 optional string id = 1;
7125 optional android.service.usb.ContaminantPresenceStatus status = 2;
7126}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007127
7128/**
7129 * This atom is for debugging purpose.
7130 */
7131message DebugElapsedClock {
7132 // Monotically increasing value for each pull.
7133 optional int64 pull_count = 1;
7134 // Time from System.elapsedRealtime.
7135 optional int64 elapsed_clock_millis = 2;
7136 // Time from System.elapsedRealtime.
7137 optional int64 same_elapsed_clock_millis = 3;
7138 // Diff between current elapsed time and elapsed time from previous pull.
7139 optional int64 elapsed_clock_diff_millis = 4;
7140
7141 enum Type {
7142 TYPE_UNKNOWN = 0;
7143 ALWAYS_PRESENT = 1;
7144 PRESENT_ON_ODD_PULLS = 2;
7145 }
7146 // Type of behavior for the pulled data.
7147 optional Type type = 5;
7148}
7149
7150/**
7151 * This atom is for debugging purpose.
7152 */
7153message DebugFailingElapsedClock {
7154 // Monotically increasing value for each pull.
7155 optional int64 pull_count = 1;
7156 // Time from System.elapsedRealtime.
7157 optional int64 elapsed_clock_millis = 2;
7158 // Time from System.elapsedRealtime.
7159 optional int64 same_elapsed_clock_millis = 3;
7160 // Diff between current elapsed time and elapsed time from previous pull.
7161 optional int64 elapsed_clock_diff_millis = 4;
7162}
Steven Wuacef6bb2019-01-23 14:21:17 -05007163
7164/** Logs System UI bubbles event changed.
7165 *
7166 * Logged from:
7167 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7168 */
7169message BubbleUIChanged {
7170
7171 // The app package that is posting the bubble.
7172 optional string package_name = 1;
7173
7174 // The notification channel that is posting the bubble.
7175 optional string notification_channel = 2;
7176
7177 // The notification id associated with the posted bubble.
7178 optional int32 notification_id = 3;
7179
7180 // The position of the bubble within the bubble stack.
7181 optional int32 position = 4;
7182
7183 // The total number of bubbles within the bubble stack.
7184 optional int32 total_number = 5;
7185
7186 // User interactions with the bubble.
7187 enum Action {
7188 UNKNOWN = 0;
7189 POSTED = 1;
7190 UPDATED = 2;
7191 EXPANDED = 3;
7192 COLLAPSED = 4;
7193 DISMISSED = 5;
7194 STACK_DISMISSED = 6;
7195 STACK_MOVED = 7;
7196 HEADER_GO_TO_APP = 8;
7197 HEADER_GO_TO_SETTINGS = 9;
7198 PERMISSION_OPT_IN = 10;
7199 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007200 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007201 SWIPE_LEFT = 13;
7202 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007203 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007204 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007205 }
7206 optional Action action = 6;
7207
7208 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7209 optional float normalized_x_position = 7;
7210 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007211
7212 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7213 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007214
7215 // Whether the bubble is an on-going one.
7216 optional bool is_ongoing = 10;
7217
7218 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007219 // This is deprecated and the value should be ignored.
7220 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007221}
Kweku Adams8845d012018-12-11 20:06:45 -08007222
7223/**
Steven Wu552f63f2019-02-05 13:41:36 -05007224 * Logs System UI bubbles developer errors.
7225 *
7226 * Logged from:
7227 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7228 */
7229message BubbleDeveloperErrorReported {
7230
7231 // The app package that is posting the bubble.
7232 optional string package_name = 1;
7233
7234 // Bubble developer error type enums.
7235 enum Error {
7236 UNKNOWN = 0;
7237 ACTIVITY_INFO_MISSING = 1;
7238 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7239 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7240 }
7241 optional Error error = 2 [default = UNKNOWN];
7242}
7243
7244/**
Kweku Adams8845d012018-12-11 20:06:45 -08007245 * Logs that a constraint for a scheduled job has changed.
7246 *
7247 * Logged from:
7248 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7249 */
7250message ScheduledJobConstraintChanged {
7251 repeated AttributionNode attribution_node = 1;
7252
7253 // Name of the job.
7254 optional string job_name = 2;
7255
7256 optional com.android.server.job.ConstraintEnum constraint = 3;
7257
7258 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007259 UNKNOWN = 0;
7260 UNSATISFIED = 1;
7261 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007262 }
7263 optional State state = 4;
7264}
Alex Salod7c3eef2019-01-25 14:43:27 -08007265
7266/**
7267 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7268 * returns true.
7269 *
7270 * Logged from:
7271 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7272 */
7273message ScreenTimeoutExtensionReported {
7274 // Describes how many times in a row did the power manager reset the screen off timeout.
7275 optional uint32 consecutive_timeout_extended_count = 1;
7276}
Hui Yu885aca12019-01-10 17:11:34 -08007277
7278/*
7279* Logs number of milliseconds it takes to start a process.
7280* The definition of app process start time is from the app launch time to
7281* the time that Zygote finished forking the app process and loaded the
7282* application package's java classes.
7283
7284* This metric is different from AppStartOccurred which is for foreground
7285* activity only.
7286
7287* ProcessStartTime can report all processes (both foreground and background)
7288* start time.
7289*
7290* Logged from:
7291* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7292*/
7293message ProcessStartTime {
7294 // The uid of the ProcessRecord.
7295 optional int32 uid = 1 [(is_uid) = true];
7296
7297 // The process pid.
7298 optional int32 pid = 2;
7299
7300 // The process name.
7301 // Usually package name, "system" for system server.
7302 // Provided by ActivityManagerService.
7303 optional string process_name = 3;
7304
7305 enum StartType {
7306 UNKNOWN = 0;
7307 WARM = 1;
7308 HOT = 2;
7309 COLD = 3;
7310 }
7311
7312 // The start type.
7313 optional StartType type = 4;
7314
7315 // The elapsed realtime at the start of the process.
7316 optional int64 process_start_time_millis = 5;
7317
7318 // Number of milliseconds it takes to reach bind application.
7319 optional int32 bind_application_delay_millis = 6;
7320
7321 // Number of milliseconds it takes to finish start of the process.
7322 optional int32 process_start_delay_millis = 7;
7323
7324 // hostingType field in ProcessRecord, the component type such as "activity",
7325 // "service", "content provider", "broadcast" or other strings.
7326 optional string hosting_type = 8;
7327
7328 // hostingNameStr field in ProcessRecord. The component class name that runs
7329 // in this process.
7330 optional string hosting_name = 9;
7331}
7332
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007333/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007334 * Track Media Codec usage
7335 * Logged from:
7336 * frameworks/av/media/libstagefright/MediaCodec.cpp
7337 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7338 */
7339message MediametricsCodecReported {
7340 optional int64 timestamp_nanos = 1;
7341 optional string package_name = 2;
7342 optional int64 package_version_code = 3;
7343 optional int64 media_apex_version = 4;
7344
7345 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7346}
7347
7348/**
7349 * Track Media Extractor (pulling video/audio streams out of containers) usage
7350 * Logged from:
7351 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7352 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7353 */
7354message MediametricsExtractorReported {
7355 optional int64 timestamp_nanos = 1;
7356 optional string package_name = 2;
7357 optional int64 package_version_code = 3;
7358 optional int64 media_apex_version = 4;
7359
7360 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7361}
7362
7363/**
7364 * Track how we arbitrate between microphone/input requests.
7365 * Logged from
7366 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7367 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7368 */
7369message MediametricsAudiopolicyReported {
7370 optional int64 timestamp_nanos = 1;
7371 optional string package_name = 2;
7372 optional int64 package_version_code = 3;
7373 optional int64 media_apex_version = 4;
7374
7375 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7376}
7377
7378/**
7379 * Track how we arbitrate between microphone requests.
7380 * Logged from
7381 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7382 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7383 */
7384message MediametricsAudiorecordReported {
7385 optional int64 timestamp_nanos = 1;
7386 optional string package_name = 2;
7387 optional int64 package_version_code = 3;
7388 optional int64 media_apex_version = 4;
7389
7390 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7391}
7392
7393/**
7394 * Track how we arbitrate between microphone/input requests.
7395 * Logged from
7396 * frameworks/av/media/libnblog/ReportPerformance.cpp
7397 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7398 */
7399message MediametricsAudiothreadReported {
7400 optional int64 timestamp_nanos = 1;
7401 optional string package_name = 2;
7402 optional int64 package_version_code = 3;
7403 optional int64 media_apex_version = 4;
7404
7405 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7406}
7407
7408/**
7409 * Track how we arbitrate between microphone/input requests.
7410 * Logged from
7411 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7412 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7413 */
7414message MediametricsAudiotrackReported {
7415 optional int64 timestamp_nanos = 1;
7416 optional string package_name = 2;
7417 optional int64 package_version_code = 3;
7418 optional int64 media_apex_version = 4;
7419
7420 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7421}
7422
7423/**
7424 * Track information about DRM framework performance
7425 * Logged from
7426 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7427 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7428 */
7429message MediametricsMediadrmReported {
7430 optional int64 timestamp_nanos = 1;
7431 optional string package_name = 2;
7432 optional int64 package_version_code = 3;
7433 optional int64 media_apex_version = 4;
7434
7435 // vendor+description tell about which DRM plugin is in use on this device
7436 optional string vendor = 5;
7437 optional string description = 6;
7438 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7439 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7440}
7441
7442/**
7443 * Track information about the widevine DRM plugin performance
7444 * Logged from
7445 * vendor/widevine/libwvdrmengine/cdm/metrics
7446 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7447 */
7448message MediametricsDrmWidevineReported {
7449 optional int64 timestamp_nanos = 1;
7450 optional string package_name = 2;
7451 optional int64 package_version_code = 3;
7452 optional int64 media_apex_version = 4;
7453
7454 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7455}
7456
7457/**
7458 * Track information about recordings (e.g. camcorder)
7459 * Logged from
7460 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7461 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7462 */
7463message MediametricsRecorderReported {
7464 optional int64 timestamp_nanos = 1;
7465 optional string package_name = 2;
7466 optional int64 package_version_code = 3;
7467 optional int64 media_apex_version = 4;
7468
7469 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7470}
7471
7472/**
7473 * Track Media Player usage
7474 * Logged from:
7475 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7476 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7477 */
7478message MediametricsNuPlayerReported {
7479 optional int64 timestamp_nanos = 1;
7480 optional string package_name = 2;
7481 optional int64 package_version_code = 3;
7482 optional int64 media_apex_version = 4;
7483
7484 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7485}
7486
7487/**
Robert Shiha4beed32019-08-19 14:15:23 -07007488 * Track Legacy DRM usage
7489 * Logged from
7490 * frameworks/av/drm/drmserver/DrmManager.cpp
7491 */
7492message MediametricsDrmManagerReported {
7493 optional int64 timestamp_nanos = 1;
7494 optional string package_name = 2;
7495 optional int64 package_version_code = 3;
7496 optional int64 media_apex_version = 4;
7497
7498 enum Method {
7499 METHOD_NOT_FOUND = -1;
7500 GET_CONSTRAINTS = 0;
7501 GET_METADATA = 1;
7502 CAN_HANDLE = 2;
7503 PROCESS_DRM_INFO = 3;
7504 ACQUIRE_DRM_INFO = 4;
7505 SAVE_RIGHTS = 5;
7506 GET_ORIGINAL_MIME_TYPE = 6;
7507 GET_DRM_OBJECT_TYPE = 7;
7508 CHECK_RIGHTS_STATUS = 8;
7509 REMOVE_RIGHTS = 9;
7510 REMOVE_ALL_RIGHTS = 10;
7511 OPEN_CONVERT_SESSION = 11;
7512 OPEN_DECRYPT_SESSION = 12;
7513 }
7514
7515 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7516 optional string plugin_id = 5;
7517 optional string description = 6;
7518 optional Method method = 7;
7519 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007520
7521 optional int64 get_constraints_count = 9;
7522 optional int64 get_metadata_count = 10;
7523 optional int64 can_handle_count = 11;
7524 optional int64 process_drm_info_count = 12;
7525 optional int64 acquire_drm_info_count = 13;
7526 optional int64 save_rights_count = 14;
7527 optional int64 get_original_mime_type_count = 15;
7528 optional int64 get_drm_object_type_count = 16;
7529 optional int64 check_rights_status_count = 17;
7530 optional int64 remove_rights_count = 18;
7531 optional int64 remove_all_rights_count = 19;
7532 optional int64 open_convert_session_count = 20;
7533 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007534}
7535
7536/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007537 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007538 * Pulled from: StatsCompanionService
7539*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007540message DangerousPermissionState {
7541 // Name of the permission
7542 optional string permission_name = 1;
7543
7544 // Uid of the package
7545 optional int32 uid = 2 [(is_uid) = true];
7546
7547 // Package requesting the permission
7548 optional string package_name = 3;
7549
7550 // If the permission is granted to the uid
7551 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007552
7553 // Permission flags as per android.content.pm.PermissionFlags
7554 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007555}
7556
Michael Groover4a0ca942019-01-24 17:41:25 -08007557/**
7558 * Logs when a package is denied access to a device identifier based on the new access requirements.
7559 *
7560 * Logged from:
7561 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7562 */
7563message DeviceIdentifierAccessDenied {
7564 // The name of the package denied access to the requested device identifier.
7565 optional string package_name = 1;
7566
7567 // The name of the device identifier method the package attempted to invoke.
7568 optional string method_name = 2;
7569
7570 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007571 // Starting from Android 11, this boolean is not set and will always be false.
7572 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007573
7574 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007575 // Starting from Android 11, this boolean is not set and will always be false.
7576 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007577}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007578
7579/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007580 * Pulls the ongoing mainline install train version code.
7581 * Pulled from StatsCompanionService
7582 */
7583message TrainInfo {
7584 optional int64 train_version_code = 1;
7585
7586 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007587
7588 optional string train_name = 3;
7589
7590 enum Status {
7591 UNKNOWN = 0;
7592 INSTALL_REQUESTED = 1;
7593 INSTALL_STARTED = 2;
7594 INSTALL_STAGED_NOT_READY = 3;
7595 INSTALL_STAGED_READY = 4;
7596 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007597 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7598 // and INSTALL_FAILURE_COMMIT.
7599 INSTALL_FAILURE = 6 [deprecated = true];
7600 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007601 INSTALL_CANCELLED = 7;
7602 INSTALLER_ROLLBACK_REQUESTED = 8;
7603 INSTALLER_ROLLBACK_INITIATED = 9;
7604 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7605 INSTALLER_ROLLBACK_STAGED = 11;
7606 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7607 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7608 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7609 INSTALLER_ROLLBACK_SUCCESS = 15;
7610 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007611 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7612 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7613 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7614 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7615 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7616 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007617 INSTALL_FAILURE_DOWNLOAD = 23;
7618 INSTALL_FAILURE_STATE_MISMATCH = 24;
7619 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007620 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007621 }
7622 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007623}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007624
7625/**
7626 * Logs the gesture stage changed event.
7627 *
7628 * Logged from:
7629 * frameworks/base/packages/SystemUI/
7630 */
7631message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007632 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007633}
7634
7635/**
7636 * Logs the feedback type.
7637 *
7638 * Logged from:
7639 * frameworks/base/packages/SystemUI/
7640 */
7641message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007642 // Whether or not the gesture was used.
7643 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007644}
7645
7646/**
7647 * Logs the progress.
7648 *
7649 * Logged from:
7650 * frameworks/base/packages/SystemUI/
7651 */
7652message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007653 // [0,100] progress for the assist gesture.
7654 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007655}
Neil Fullerdb14b482019-02-05 19:44:44 +00007656
7657/*
7658 * Information about the time zone data on a device.
7659 */
7660message TimeZoneDataInfo {
7661 // A version identifier for the data set on device. e.g. "2018i"
7662 optional string tzdb_version = 1;
7663}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007664
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007665/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007666 * Logs the GPU stats global health information.
7667 *
7668 * Logged from:
7669 * frameworks/native/services/gpuservice/gpustats/
7670 */
7671message GpuStatsGlobalInfo {
7672 // Package name of the gpu driver.
7673 optional string driver_package_name = 1;
7674
7675 // Version name of the gpu driver.
7676 optional string driver_version_name = 2;
7677
7678 // Version code of the gpu driver.
7679 optional int64 driver_version_code = 3;
7680
7681 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7682 optional int64 driver_build_time = 4;
7683
7684 // Total count of the gl driver gets loaded.
7685 optional int64 gl_loading_count = 5;
7686
7687 // Total count of the gl driver fails to be loaded.
7688 optional int64 gl_loading_failure_count = 6;
7689
7690 // Total count of the Vulkan driver gets loaded.
7691 optional int64 vk_loading_count = 7;
7692
7693 // Total count of the Vulkan driver fails to be loaded.
7694 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007695
7696 // Api version of the system Vulkan driver.
7697 optional int32 vulkan_version = 9;
7698
7699 // Api version of the system CPU Vulkan driver.
7700 optional int32 cpu_vulkan_version = 10;
7701
7702 // Api version of the system GLES driver.
7703 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007704
7705 // Total count of the angle driver gets loaded.
7706 optional int64 angle_loading_count = 12;
7707
7708 // Total count of the angle driver fails to be loaded.
7709 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007710}
7711
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007712/**
7713 * GPU driver loading time info.
7714 */
7715message GpuDriverLoadingTime {
7716 // List of all the driver loading times for this app. The list size is
7717 // capped at 50.
7718 repeated int64 driver_loading_time = 1;
7719}
7720
7721/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007722 * Logs the GPU stats per app health information.
7723 *
7724 * Logged from:
7725 * frameworks/native/services/gpuservice/gpustats/
7726 */
7727message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007728 // Package name of the application that loads the gpu driver. Total number
7729 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007730 optional string app_package_name = 1;
7731
7732 // Version code of the gpu driver this app loads.
7733 optional int64 driver_version_code = 2;
7734
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007735 // gl driver loading time info.
7736 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7737 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007738
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007739 // Vulkan driver loading time info.
7740 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7741 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007742
7743 // Angle driver loading time info.
7744 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7745 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007746
7747 // CPU Vulkan implementation is in use.
7748 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007749
7750 // App is not doing pre-rotation correctly.
7751 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007752
7753 // App creates GLESv1 context.
7754 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007755}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007756
7757/*
7758 * Logs the size of the system ion heap.
7759 *
7760 * Pulled from StatsCompanionService.
7761 */
7762message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007763 // Deprecated due to limited support of ion stats in debugfs.
7764 // Use `IonHeapSize` instead.
7765 option deprecated = true;
7766
Rafal Slawikd4e87572019-03-12 13:08:38 +00007767 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007768 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007769 optional int64 size_in_bytes = 1;
7770}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007771
Rafal Slawik77987ed2019-06-17 12:28:23 +01007772/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007773 * Logs the total size of the ion heap.
7774 *
7775 * Pulled from StatsCompanionService.
7776 */
7777message IonHeapSize {
7778 // Total size of all ion heaps in kilobytes.
7779 // Read from: /sys/kernel/ion/total_heaps_kb.
7780 optional int32 total_size_kb = 1;
7781}
7782
7783/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007784 * Logs the per-process size of the system ion heap.
7785 *
7786 * Pulled from StatsCompanionService.
7787 */
7788message ProcessSystemIonHeapSize {
7789 // The uid if available. -1 means not available.
7790 optional int32 uid = 1 [(is_uid) = true];
7791
7792 // The process name (from /proc/PID/cmdline).
7793 optional string process_name = 2;
7794
7795 // Sum of sizes of all allocations.
7796 optional int32 total_size_in_kilobytes = 3;
7797
7798 // Number of allocations.
7799 optional int32 allocation_count = 4;
7800
7801 // Size of the largest allocation.
7802 optional int32 max_size_in_kilobytes = 5;
7803}
7804
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007805/**
7806 * Push network stack events.
7807 *
7808 * Log from:
7809 * frameworks/base/packages/NetworkStack/
7810 */
7811message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007812 // The id that indicates the event reported from NetworkStack.
7813 optional int32 event_id = 1;
7814 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007815 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7816}
Carmen Agimofa769c152019-03-04 14:39:14 +00007817
7818/**
7819 * Logs the apps that are installed on the external storage.
7820 * Pulled from:
7821 * StatsCompanionService
7822 */
7823message AppsOnExternalStorageInfo {
7824 // The type of the external storage.
7825 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7826 // The name of the package that is installed on the external storage.
7827 optional string package_name = 2;
7828}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007829
7830/**
7831 * Logs the settings related to Face.
7832 * Logged from:
7833 * frameworks/base/services/core/java/com/android/server/stats
7834 */
7835message FaceSettings {
7836 // Whether or not face unlock is allowed on Keyguard.
7837 optional bool unlock_keyguard_enabled = 1;
7838 // Whether or not face unlock dismisses the Keyguard.
7839 optional bool unlock_dismisses_keyguard = 2;
7840 // Whether or not face unlock requires attention.
7841 optional bool unlock_attention_required = 3;
7842 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7843 optional bool unlock_app_enabled = 4;
7844 // Whether or not face unlock always requires user confirmation.
7845 optional bool unlock_always_require_confirmation = 5;
7846 // Whether or not a diverse set of poses are required during enrollment.
7847 optional bool unlock_diversity_required = 6;
7848}
Maggie White442b6312019-04-05 16:26:44 -07007849
7850/**
7851 * Logs cooling devices maintained by the kernel.
7852 *
7853 * Pulled from StatsCompanionService.java
7854 */
7855message CoolingDevice {
7856 // The type of cooling device being reported. Eg. CPU, GPU...
7857 optional android.os.CoolingTypeEnum device_location = 1;
7858 // The name of the cooling device source. Eg. CPU0
7859 optional string device_name = 2;
7860 // Current throttle state of the cooling device. The value can any unsigned
7861 // integer between 0 and max_state defined in its driver. 0 means device is
7862 // not in throttling, higher value means deeper throttling.
7863 optional int32 state = 3;
7864}
Ben Blount763a5d52019-04-10 11:48:58 -07007865
7866/**
7867 * Intelligence has several counter-type events that don't warrant a
7868 * full separate atom. These are primarily API call counters but also include
7869 * counters for feature usage and specific failure modes.
7870 *
7871 * Logged from the Intelligence mainline module.
7872 */
7873message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007874 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007875 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007876 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007877 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007878 // How many times the event occured (to report a batch of high frequency events).
7879 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007880 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007881 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007882}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007883
7884/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007885 * Logs when Car Power state changed.
7886 *
7887 * Logged from:
7888 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7889 */
7890message CarPowerStateChanged {
7891 // States come from CpmsState in CarPowerManagementService.java.
7892 enum State {
7893 WAIT_FOR_VHAL = 0;
7894 ON = 1;
7895 SHUTDOWN_PREPARE = 2;
7896 WAIT_FOR_FINISH = 3;
7897 SUSPEND = 4;
7898 SIMULATE_SLEEP = 5;
7899 }
7900 optional State state = 1;
7901}
7902
7903/**
7904 * Logs whether GarageMode is entered.
7905 *
7906 * Logged from:
7907 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7908 */
7909message GarageModeInfo {
7910 // Whether GarageMode is entered.
7911 optional bool is_garage_mode = 1;
7912}
Martijn Coenencd95d462019-04-25 17:09:45 +02007913
7914/**
7915 * Historical app ops data per package.
7916 */
7917message AppOps {
7918 // Uid of the package requesting the op
7919 optional int32 uid = 1 [(is_uid) = true];
7920
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007921 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007922 optional string package_name = 2;
7923
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007924 // operation id
7925 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007926
7927 // The number of times the op was granted while the app was in the
7928 // foreground (only for trusted requests)
7929 optional int64 trusted_foreground_granted_count = 4;
7930
7931 // The number of times the op was granted while the app was in the
7932 // background (only for trusted requests)
7933 optional int64 trusted_background_granted_count = 5;
7934
7935 // The number of times the op was rejected while the app was in the
7936 // foreground (only for trusted requests)
7937 optional int64 trusted_foreground_rejected_count = 6;
7938
7939 // The number of times the op was rejected while the app was in the
7940 // background (only for trusted requests)
7941 optional int64 trusted_background_rejected_count = 7;
7942
7943 // For long-running operations, total duration of the operation
7944 // while the app was in the foreground (only for trusted requests)
7945 optional int64 trusted_foreground_duration_millis = 8;
7946
7947 // For long-running operations, total duration of the operation
7948 // while the app was in the background (only for trusted requests)
7949 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007950
7951 // Whether AppOps is guarded by Runtime permission
7952 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007953}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007954
7955/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007956 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007957 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007958message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007959 // Uid of the package requesting the op
7960 optional int32 uid = 1 [(is_uid) = true];
7961
7962 // Name of the package performing the op
7963 optional string package_name = 2;
7964
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007965 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7966 // Attributions must be provided through manifest using <attribution> tag available in R and
7967 // above.
7968 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007969
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007970 // operation id
7971 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007972
7973 // The number of times the op was granted while the app was in the
7974 // foreground (only for trusted requests)
7975 optional int64 trusted_foreground_granted_count = 5;
7976
7977 // The number of times the op was granted while the app was in the
7978 // background (only for trusted requests)
7979 optional int64 trusted_background_granted_count = 6;
7980
7981 // The number of times the op was rejected while the app was in the
7982 // foreground (only for trusted requests)
7983 optional int64 trusted_foreground_rejected_count = 7;
7984
7985 // The number of times the op was rejected while the app was in the
7986 // background (only for trusted requests)
7987 optional int64 trusted_background_rejected_count = 8;
7988
7989 // For long-running operations, total duration of the operation
7990 // while the app was in the foreground (only for trusted requests)
7991 optional int64 trusted_foreground_duration_millis = 9;
7992
7993 // For long-running operations, total duration of the operation
7994 // while the app was in the background (only for trusted requests)
7995 optional int64 trusted_background_duration_millis = 10;
7996
7997 // Whether AppOps is guarded by Runtime permission
7998 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007999
8000 // Sampling rate used on device, from 0 to 100
8001 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008002}
8003
8004/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008005 * Location Manager API Usage information(e.g. API under usage,
8006 * API call's parameters).
8007 * Logged from:
8008 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8009 */
8010message LocationManagerApiUsageReported {
8011
8012 // Indicating if usage starts or usage ends.
8013 optional android.stats.location.UsageState state = 1;
8014
8015 // LocationManagerService's API in use.
8016 // We can identify which API from LocationManager is
8017 // invoking current LMS API by the combination of
8018 // API parameter(e.g. is_listener_null, is_intent_null,
8019 // is_location_request_null)
8020 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8021
8022 // Name of the package calling the API.
8023 optional string calling_package_name = 3;
8024
8025 // Type of the location provider.
8026 optional android.stats.location.ProviderType provider = 4;
8027
8028 // Quality of the location request
8029 optional android.stats.location.LocationRequestQuality quality = 5;
8030
8031 // The desired interval for active location updates, in milliseconds.
8032 // Bucketized to reduce cardinality.
8033 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8034
8035 // Minimum distance between location updates, in meters.
8036 // Bucketized to reduce cardinality.
8037 optional android.stats.location.SmallestDisplacementBucket
8038 bucketized_smallest_displacement = 7;
8039
8040 // The number of location updates.
8041 optional int64 num_updates = 8;
8042
8043 // The request expiration time, in millisecond since boot.
8044 // Bucketized to reduce cardinality.
8045 optional android.stats.location.ExpirationBucket
8046 bucketized_expire_in = 9;
8047
8048 // Type of Callback passed in for this API.
8049 optional android.stats.location.CallbackType callback_type = 10;
8050
8051 // The radius of the central point of the alert
8052 // region, in meters. Only for API REQUEST_GEOFENCE.
8053 // Bucketized to reduce cardinality.
8054 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8055
8056 // Activity Importance of API caller.
8057 // Categorized to 3 types that are interesting from location's perspective.
8058 optional android.stats.location.ActivityImportance activiy_importance = 12;
8059}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008060
8061/**
8062 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8063 */
8064message ReviewPermissionsFragmentResultReported {
8065 // unique value identifying a permission group change. A permission group change might result
8066 // in multiple of these atoms
8067 optional int64 change_id = 1;
8068
8069 // UID of package the permission belongs to
8070 optional int32 uid = 2 [(is_uid) = true];
8071
8072 // Name of package the permission belongs to
8073 optional string package_name = 3;
8074
8075 // The permission to be granted
8076 optional string permission_name = 4;
8077
8078 // The result of the permission grant
8079 optional bool permission_granted = 5;
8080}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008081
8082/**
8083* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8084* Logged from: RuntimePermissionUpdgradeController
8085*/
8086message RuntimePermissionsUpgradeResult {
8087 // Permission granted as result of upgrade
8088 optional string permission_name = 1;
8089
8090 // UID of package granted permission
8091 optional int32 uid = 2 [(is_uid) = true];
8092
8093 // Name of package granted permission
8094 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008095}
8096
8097/**
8098* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8099*/
8100message GrantPermissionsActivityButtonActions {
8101 // Permission granted as result of upgrade
8102 optional string permission_group_name = 1;
8103
8104 // UID of package granted permission
8105 optional int32 uid = 2 [(is_uid) = true];
8106
8107 // Name of package requesting permission
8108 optional string package_name = 3;
8109
8110 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8111 // LABEL_ constants in GrantPermissionActivity.java
8112 optional int32 buttons_presented = 4;
8113
8114 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8115 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008116
8117 // id which identifies single session of user interacting with permission controller
8118 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008119}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008120
8121/**
8122 * Information about LocationAccessCheck notification presented to user
8123 */
8124message LocationAccessCheckNotificationAction {
8125
8126 // id which identifies single session of user interacting with permission controller
8127 optional int64 session_id = 1;
8128
8129 // Uid of package for which location access check is presented
8130 optional int32 package_uid = 2;
8131
8132 // Name of package for which location access check is presented
8133 optional string package_name = 3;
8134
8135 enum Result {
8136 UNDEFINED = 0;
8137 // notification was presented to the user
8138 NOTIFICATION_PRESENTED = 1;
8139 // notification was declined by the user
8140 NOTIFICATION_DECLINED = 2;
8141 // notification was clicked by the user
8142 NOTIFICATION_CLICKED = 3;
8143 }
8144
8145 // View / interaction recorded
8146 optional Result result = 4;
8147}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008148
8149/**
8150 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8151 */
8152message AppPermissionFragmentActionReported {
8153 // id which identifies single session of user interacting with permission controller
8154 optional int64 session_id = 1;
8155
8156 // unique value identifying a permission group change. A permission group change might result
8157 // in multiple of these atoms
8158 optional int64 change_id = 2;
8159
8160 // UID of package the permission belongs to
8161 optional int32 uid = 3 [(is_uid) = true];
8162
8163 // Name of package the permission belongs to
8164 optional string package_name = 4;
8165
8166 // The permission to be granted
8167 optional string permission_name = 5;
8168
8169 // The result of the permission grant
8170 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008171
8172 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8173 optional int32 permission_flags = 7;
8174
8175 enum Button {
8176 UNDEFINED = 0;
8177 // Allow button
8178 ALLOW = 1;
8179 // Deny button
8180 DENY = 2;
8181 // Ask every time button
8182 ASK_EVERY_TIME = 3;
8183 // Allow all the time button
8184 ALLOW_ALWAYS = 4;
8185 // Allow only while using the app button
8186 ALLOW_FOREGROUND = 5;
8187 // Same is Deny button but shown in while in use dialog
8188 DENY_FOREGROUND = 6;
8189 }
8190
8191 // Button pressed in the dialog
8192 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008193}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008194
8195/**
8196* Information about a AppPermissionFragment viewed by user
8197*/
8198message AppPermissionFragmentViewed {
8199 // id which identifies single session of user interacting with permission controller
8200 optional int64 session_id = 1;
8201
8202 // UID of package for which permissions are viewed
8203 optional int32 uid = 2 [(is_uid) = true];
8204
8205 // Name of package for which permissions are viewed
8206 optional string package_name = 3;
8207
8208 // Permission group viewed
8209 optional string permission_group_name = 4;
8210}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008211
8212/**
8213* Information about a AppPermissionsFragment viewed by user
8214*/
8215message AppPermissionsFragmentViewed {
8216 // id which identifies single session of user interacting with permission controller
8217 optional int64 session_id = 1;
8218
8219 // id which identifies single view as every view might have several logging records
8220 // with different package information attached
8221 optional int64 view_id = 2;
8222
8223 // Permission group viewed
8224 optional string permission_group_name = 3;
8225
8226 // UID of package for which permissions are viewed
8227 optional int32 uid = 4 [(is_uid) = true];
8228
8229 // Name of package for which permissions are viewed
8230 optional string package_name = 5;
8231
8232 // Category in which permission is included
8233 enum Category {
8234 UNDEFINED = 0;
8235 ALLOWED = 1;
8236 ALLOWED_FOREGROUND = 2;
8237 DENIED = 3;
8238 }
8239 optional Category category = 6;
8240}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008241
8242/**
8243* Information about a PermissionAppsFragment viewed by user.
8244* Logged from ui/handheld/PermissionAppsFragment.java
8245*/
8246message PermissionAppsFragmentViewed {
8247 // id which identifies single session of user interacting with permission controller
8248 optional int64 session_id = 1;
8249
8250 // id which identifies single view as every view might have several logging records
8251 // with different package information attached
8252 optional int64 view_id = 2;
8253
8254 // Permission group viewed
8255 optional string permission_group_name = 3;
8256
8257 // UID of package for which permissions are viewed
8258 optional int32 uid = 4 [(is_uid) = true];
8259
8260 // Name of package for which permissions are viewed
8261 optional string package_name = 5;
8262
8263 // Category in which app is included
8264 enum Category {
8265 UNDEFINED = 0;
8266 ALLOWED = 1;
8267 ALLOWED_FOREGROUND = 2;
8268 DENIED = 3;
8269 }
8270 optional Category category = 6;
8271}
Tony Make2b1b672019-07-29 16:59:47 +01008272
8273/**
8274 * Logs when there is a smart selection related event.
8275 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8276 * Logged from: TextClassifierEventLogger.java
8277 */
8278message TextSelectionEvent {
8279 // A session ID.
8280 optional string session_id = 1;
8281
8282 // Event type of this event.
8283 optional android.stats.textclassifier.EventType event_type = 2;
8284
Tony Mak9c84bd22019-12-09 07:27:25 +00008285 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008286 optional string model_name = 3;
8287
8288 // Type of widget that was involved in triggering this event.
8289 optional android.stats.textclassifier.WidgetType widget_type = 4;
8290
8291 // Index of this event in a session.
8292 optional int32 event_index = 5;
8293
8294 // Entity type that is involved.
8295 optional string entity_type = 6;
8296
8297 // Relative word index of the start of the selection.
8298 optional int32 relative_word_start_index = 7;
8299
8300 // Relative word (exclusive) index of the end of the selection.
8301 optional int32 relative_word_end_index = 8;
8302
8303 // Relative word index of the start of the smart selection.
8304 optional int32 relative_suggested_word_start_index = 9;
8305
8306 // Relative word (exclusive) index of the end of the smart selection.
8307 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008308
8309 // Name of source package.
8310 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008311
8312 // Name of the LangID model that is involved in this event.
8313 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008314}
8315
8316/**
8317 * Logs when there is a smart linkify related event.
8318 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8319 * Logged from: TextClassifierEventLogger.java
8320 */
8321message TextLinkifyEvent {
8322 // A session ID.
8323 optional string session_id = 1;
8324
8325 // Event type of this event.
8326 optional android.stats.textclassifier.EventType event_type = 2;
8327
Tony Mak9c84bd22019-12-09 07:27:25 +00008328 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008329 optional string model_name = 3;
8330
8331 // Type of widget that was involved in triggering this event.
8332 optional android.stats.textclassifier.WidgetType widget_type = 4;
8333
8334 // Index of this event in a session.
8335 optional int32 event_index = 5;
8336
8337 // Entity type that is involved.
8338 optional string entity_type = 6;
8339
8340 // Number of links detected.
8341 optional int32 num_links = 7;
8342
8343 // The total length of all links.
8344 optional int32 linked_text_length = 8;
8345
8346 // Length of input text.
8347 optional int32 text_length = 9;
8348
8349 // Time spent on generating links in ms.
8350 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008351
8352 // Name of source package.
8353 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008354
8355 // Name of the LangID model that is involved in this event.
8356 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008357}
8358
8359/**
8360 * Logs when there is a conversation actions related event.
8361 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8362 * Logged from: TextClassifierEventLogger.java
8363 */
8364message ConversationActionsEvent {
8365 // A session ID.
8366 optional string session_id = 1;
8367
8368 // Event type of this event.
8369 optional android.stats.textclassifier.EventType event_type = 2;
8370
Tony Mak9c84bd22019-12-09 07:27:25 +00008371 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008372 optional string model_name = 3;
8373
8374 // Type of widget that was involved in triggering this event.
8375 optional android.stats.textclassifier.WidgetType widget_type = 4;
8376
8377 // The first entity type that is involved.
8378 optional string first_entity_type = 5;
8379
8380 // The second entity type that is involved.
8381 optional string second_entity_type = 6;
8382
8383 // The third entity type that is involved.
8384 optional string third_entity_type = 7;
8385
8386 // The score of the first entity type.
8387 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008388
8389 // Name of source package.
8390 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008391
8392 // Name of the annotator model that is involved in this event.
8393 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008394
8395 // Name of the LangID model that is involved in this event.
8396 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008397}
8398
8399/**
8400 * Logs when there is a language detection related event.
8401 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8402 * Logged from: TextClassifierEventLogger.java
8403 */
8404message LanguageDetectionEvent {
8405 // A session ID.
8406 optional string session_id = 1;
8407
8408 // Event type of this event.
8409 optional android.stats.textclassifier.EventType event_type = 2;
8410
Tony Mak9c84bd22019-12-09 07:27:25 +00008411 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008412 optional string model_name = 3;
8413
8414 // Type of widget that was involved in triggering this event.
8415 optional android.stats.textclassifier.WidgetType widget_type = 4;
8416
8417 // Detected language.
8418 optional string language_tag = 5;
8419
8420 // Score of the detected language.
8421 optional float score = 6;
8422
8423 // Position of this action.
8424 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008425
8426 // Name of source package.
8427 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008428}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008429
8430/**
8431 * Information about an OTA update attempt by update_engine.
8432 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8433 */
8434message UpdateEngineUpdateAttemptReported {
8435 // The number of attempts for the update engine to apply a given payload.
8436 optional int32 attempt_number = 1;
8437
8438 optional android.stats.otaupdate.PayloadType payload_type = 2;
8439
8440 // The total time in minutes for the update engine to apply a given payload.
8441 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8442 // it's increased when the system is sleeping.
8443 optional int32 duration_boottime_in_minutes = 3;
8444
8445 // The total time in minutes for the update engine to apply a given payload.
8446 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8447 // and it's not increased when the system is sleeping.
8448 optional int32 duration_monotonic_in_minutes = 4;
8449
8450 // The size of the payload in MiBs.
8451 optional int32 payload_size_mib = 5;
8452
8453 // The attempt result reported by the update engine for an OTA update.
8454 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8455
8456 // The error code reported by the update engine after an OTA update attempt
8457 // on A/B devices.
8458 optional android.stats.otaupdate.ErrorCode error_code = 7;
8459
8460 // The build fingerprint of the source system. The value is read from a
8461 // system property when the device takes the update. e.g.
8462 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8463 optional string source_fingerprint = 8;
8464}
8465
8466/**
8467 * Information about all the attempts the device make before finishing the
8468 * successful update.
8469 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8470 */
8471message UpdateEngineSuccessfulUpdateReported {
8472 // The number of attempts for the update engine to apply the payload for a
8473 // successful update.
8474 optional int32 attempt_count = 1;
8475
8476 optional android.stats.otaupdate.PayloadType payload_type = 2;
8477
8478 optional int32 payload_size_mib = 3;
8479
8480 // The total number of bytes downloaded by update_engine since the last
8481 // successful update.
8482 optional int32 total_bytes_downloaded_mib = 4;
8483
8484 // The ratio in percentage of the over-downloaded bytes compared to the
8485 // total bytes needed to successfully install the update. e.g. 200 if we
8486 // download 200MiB in total for a 100MiB package.
8487 optional int32 download_overhead_percentage = 5;
8488
8489 // The total time in minutes for the update engine to apply the payload for a
8490 // successful update.
8491 optional int32 total_duration_minutes = 6;
8492
8493 // The number of reboot of the device during a successful update.
8494 optional int32 reboot_count = 7;
8495}
Alec Mourie088e762019-07-02 13:10:55 -07008496
8497/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008498 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8499 * key to indicate whether it was successful or not.
8500 *
8501 * Logged from:
8502 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8503 */
8504message RebootEscrowRecoveryReported {
8505 optional bool successful = 1;
8506}
8507
8508/**
Alec Mourie088e762019-07-02 13:10:55 -07008509 * Global display pipeline metrics reported by SurfaceFlinger.
8510 * Pulled from:
8511 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8512 */
8513message SurfaceflingerStatsGlobalInfo {
8514 // Total number of frames presented during the tracing period
8515 optional int64 total_frames = 1;
8516 // Total number of frames missed
8517 optional int64 missed_frames = 2;
8518 // Total number of frames that fell back to client composition
8519 optional int64 client_composition_frames = 3;
8520 // Total time the display was turned on
8521 optional int64 display_on_millis = 4;
8522 // Total time that was spent performing animations.
8523 // This is derived from the present-to-present layer histogram
8524 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008525 // Total number of event connections tracked by SurfaceFlinger at the time
8526 // of this pull. If this number grows prohibitively large, then this can
8527 // cause jank due to resource contention.
8528 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008529 // Set of timings measured from when SurfaceFlinger began compositing a
8530 // frame, until the frame was requested to be presented to the display. This
8531 // measures SurfaceFlinger's total CPU walltime on the critical path per
8532 // frame.
8533 optional FrameTimingHistogram frame_duration = 7
8534 [(android.os.statsd.log_mode) = MODE_BYTES];
8535 // Set of timings measured from when SurfaceFlinger first began using the
8536 // GPU to composite a frame, until the GPU has finished compositing that
8537 // frame. This measures the total additional time SurfaceFlinger needed to
8538 // perform due to falling back into GPU composition.
8539 optional FrameTimingHistogram render_engine_timing = 8
8540 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008541}
8542
8543/**
8544 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8545 * The number of layers uploaded will be restricted due to size limitations.
8546 * Pulled from:
8547 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8548 */
8549message SurfaceflingerStatsLayerInfo {
8550 // The layer for this set of metrics
8551 // For now we can infer that the package name is included in the layer
8552 // name.
8553 optional string layer_name = 1;
8554 // Total number of frames presented
8555 optional int64 total_frames = 2;
8556 // Total number of dropped frames while latching a buffer for this layer.
8557 optional int64 dropped_frames = 3;
8558 // Set of timings measured between successive presentation timestamps.
8559 optional FrameTimingHistogram present_to_present = 4
8560 [(android.os.statsd.log_mode) = MODE_BYTES];
8561 // Set of timings measured from when an app queued a buffer for
8562 // presentation, until the buffer was actually presented to the
8563 // display.
8564 optional FrameTimingHistogram post_to_present = 5
8565 [(android.os.statsd.log_mode) = MODE_BYTES];
8566 // Set of timings measured from when a buffer is ready to be presented,
8567 // until the buffer was actually presented to the display.
8568 optional FrameTimingHistogram acquire_to_present = 6
8569 [(android.os.statsd.log_mode) = MODE_BYTES];
8570 // Set of timings measured from when a buffer was latched by
8571 // SurfaceFlinger, until the buffer was presented to the display
8572 optional FrameTimingHistogram latch_to_present = 7
8573 [(android.os.statsd.log_mode) = MODE_BYTES];
8574 // Set of timings measured from the desired presentation to the actual
8575 // presentation time
8576 optional FrameTimingHistogram desired_to_present = 8
8577 [(android.os.statsd.log_mode) = MODE_BYTES];
8578 // Set of timings measured from when an app queued a buffer for
8579 // presentation, until the buffer was ready to be presented.
8580 optional FrameTimingHistogram post_to_acquire = 9
8581 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008582 // Frames missed latch because the acquire fence didn't fire
8583 optional int64 late_acquire_frames = 10;
8584 // Frames latched early because the desired present time was bad
8585 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008586}
8587
8588/**
8589 * Histogram of frame counts bucketed by time in milliseconds.
8590 * Because of size limitations, we hard-cap the number of buckets, with
8591 * buckets for corresponding to larger milliseconds being less precise.
8592 */
8593message FrameTimingHistogram {
8594 // Timings in milliseconds that describes a set of histogram buckets
8595 repeated int32 time_millis_buckets = 1;
8596 // Number of frames that match to each time_millis, i.e. the bucket
8597 // contents
8598 // It's required that len(time_millis) == len(frame_count)
8599 repeated int64 frame_counts = 2;
8600}
Emilian Peev6729f372019-08-29 09:14:09 -07008601
Emilian Peev6729f372019-08-29 09:14:09 -07008602/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008603 * Janky event as reported by SurfaceFlinger.
8604 * This event is intended to be consumed by a Perfetto subscriber for
8605 * automated trace collection.
8606 *
8607 * Logged from:
8608 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8609 */
8610message DisplayJankReported {
8611 // Informational field for how long the janky event lasted in milliseconds
8612 optional int64 event_duration_millis = 1;
8613 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8614 // the display on time.
8615 optional int32 present_deadlines_missed = 2;
8616}
8617
8618/**
Emilian Peev6729f372019-08-29 09:14:09 -07008619 * Information about camera facing and API level usage.
8620 * Logged from:
8621 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8622 */
8623message CameraActionEvent {
8624 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008625 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008626
8627 // Camera API level used
8628 optional int32 api_level = 2;
8629
8630 // Name of client package
8631 optional string package_name = 3;
8632
8633 // Camera facing
8634 enum Facing {
8635 UNKNOWN = 0;
8636 BACK = 1;
8637 FRONT = 2;
8638 EXTERNAL = 3;
8639 }
8640 optional Facing facing = 4;
8641}
atrost01a20932019-08-28 15:40:37 +01008642
8643/**
8644 * Logs when a compatibility change is affecting an app.
8645 *
8646 * Logged from:
8647 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8648 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8649 */
8650message AppCompatibilityChangeReported {
8651 // The UID of the app being affected by the compatibilty change.
8652 optional int32 uid = 1 [(is_uid) = true];
8653
8654 // The ID of the change affecting the app.
8655 optional int64 change_id = 2;
8656
8657 enum State {
8658 UNKNOWN_STATE = 0;
8659 ENABLED = 1;
8660 DISABLED = 2;
8661 LOGGED = 3;
8662 }
8663
8664 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8665 // logged otherwise.
8666 optional State state = 3;
8667
8668 enum Source {
8669 UNKNOWN_SOURCE = 0;
8670 APP_PROCESS = 1;
8671 SYSTEM_SERVER = 2;
8672 }
8673
8674 // Where it was logged from.
8675 optional Source source = 4;
8676
8677}
Hector Dearman40579f62019-11-01 13:19:30 +00008678
8679/**
8680 * Logged from
8681 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8682 */
8683message PerfettoUploaded {
8684 enum Event {
8685 PERFETTO_UNDEFINED = 0;
8686 PERFETTO_TRACE_BEGIN = 1;
8687 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8688 PERFETTO_ON_CONNECT = 3;
8689 PERFETTO_ON_TRACING_DISABLED = 4;
8690 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8691 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8692 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8693 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8694 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8695 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8696 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8697 PERFETTO_TRIGGER_BEGIN = 12;
8698 PERFETTO_TRIGGER_SUCCESS = 13;
8699 PERFETTO_TRIGGER_FAILURE = 14;
8700 PERFETTO_HIT_GUARDRAILS = 15;
8701 PERFETTO_ON_TIMEOUT = 16;
8702 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8703 }
8704
8705 // Which stage of the pipeline we are reporting from.
8706 optional Event event = 1;
8707
8708 // UUID matching the one set inside the SystemInfo trace packet.
8709 optional int64 trace_uuid_lsb = 2;
8710 optional int64 trace_uuid_msb = 3;
8711}
Mark Tabrya824a642019-11-05 12:26:12 -08008712
8713/**
8714 * Pulls client metrics on data transferred via Vehicle Maps Service.
8715 * Metrics are keyed by uid + layer.
8716 *
8717 * Pulled from:
8718 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8719 */
8720message VmsClientStats {
8721 // UID of the VMS client app
8722 optional int32 uid = 1 [(is_uid) = true];
8723
8724 // VMS layer definition
8725 optional int32 layer_type = 2;
8726 optional int32 layer_channel = 3;
8727 optional int32 layer_version = 4;
8728
8729 // Bytes and packets sent by the client for the layer
8730 optional int64 tx_bytes = 5;
8731 optional int64 tx_packets = 6;
8732
8733 // Bytes and packets received by the client for the layer
8734 optional int64 rx_bytes = 7;
8735 optional int64 rx_packets = 8;
8736
8737 // Bytes and packets dropped due to client error
8738 optional int64 dropped_bytes = 9;
8739 optional int64 dropped_packets = 10;
8740}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008741
8742/**
8743 * State of a dangerous permission requested by a package - sampled
8744 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8745*/
8746message DangerousPermissionStateSampled {
8747 // Name of the permission
8748 optional string permission_name = 1;
8749
8750 // Uid of the package
8751 optional int32 uid = 2 [(is_uid) = true];
8752
8753 // If the permission is granted to the uid
8754 optional bool is_granted = 3;
8755
8756 // Permission flags as per android.content.pm.PermissionFlags
8757 optional int32 permission_flags = 4;
8758}
8759
Stan Iliev637ba5e2019-08-16 13:43:08 -04008760/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008761 * HWUI stats for a given app.
8762 */
8763message GraphicsStats {
8764 // The package name of the app
8765 optional string package_name = 1;
8766
8767 // The version code of the app
8768 optional int64 version_code = 2;
8769
8770 // The start & end timestamps in UTC as
8771 // milliseconds since January 1, 1970
8772 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008773 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008774
Stan Ilievb6517192020-02-18 10:12:42 -05008775 optional int64 end_millis = 4;
8776
8777 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8778 enum PipelineType {
8779 UNKNOWN = 0;
8780 GL = 1;
8781 VULKAN = 2;
8782 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008783
8784 // HWUI renders pipeline type: GL or Vulkan.
8785 optional PipelineType pipeline = 5;
8786
8787 // Distinct frame count.
8788 optional int32 total_frames = 6;
8789
8790 // Number of "missed vsync" events.
8791 optional int32 missed_vsync_count = 7;
8792
8793 // Number of frames in triple-buffering scenario (high input latency)
8794 optional int32 high_input_latency_count = 8;
8795
8796 // Number of "slow UI thread" events.
8797 optional int32 slow_ui_thread_count = 9;
8798
8799 // Number of "slow bitmap upload" events.
8800 optional int32 slow_bitmap_upload_count = 10;
8801
8802 // Number of "slow draw" events.
8803 optional int32 slow_draw_count = 11;
8804
8805 // Number of frames that missed their deadline (aka, visibly janked)
8806 optional int32 missed_deadline_count = 12;
8807
8808 // The frame time histogram for the package
8809 optional FrameTimingHistogram cpu_histogram = 13
8810 [(android.os.statsd.log_mode) = MODE_BYTES];
8811
8812 // The gpu frame time histogram for the package
8813 optional FrameTimingHistogram gpu_histogram = 14
8814 [(android.os.statsd.log_mode) = MODE_BYTES];
8815
8816 // UI mainline module version.
8817 optional int64 version_ui_module = 15;
8818
8819 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8820 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8821 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8822 // more apps are running / rendering.
8823 optional bool is_today = 16;
8824}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008825
8826/**
8827 * Message related to dangerous (runtime) app ops access
8828 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008829message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008830 // Uid of the package accessing app op
8831 optional int32 uid = 1 [(is_uid) = true];
8832
8833 // Name of the package accessing app op
8834 optional string package_name = 2;
8835
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008836 // deprecated - set to empty string
8837 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008838
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008839 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008840 // API. Attributions must be provided through manifest using <attribution> tag available in R
8841 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008842 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008843
8844 // message related to app op access, limited to 600 chars by API
8845 optional string message = 5;
8846
8847 enum SamplingStrategy {
8848 DEFAULT = 0;
8849 UNIFORM = 1;
8850 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008851 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008852 }
8853
8854 // sampling strategy used to collect this message
8855 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008856
8857 // operation id
8858 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008859}
8860
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008861/*
8862 * Logs userspace reboot outcome and duration.
8863 *
8864 * Logged from:
8865 * frameworks/base/core/java/com/android/server/BootReceiver.java
8866 */
8867message UserspaceRebootReported {
8868 // Possible outcomes of userspace reboot.
8869 enum Outcome {
8870 // Default value in case platform failed to determine the outcome.
8871 OUTCOME_UNKNOWN = 0;
8872 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8873 SUCCESS = 1;
8874 // Userspace reboot shutdown sequence was aborted.
8875 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8876 // Remounting userdata into checkpointing mode failed.
8877 FAILED_USERDATA_REMOUNT = 3;
8878 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8879 // reboot.
8880 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8881 }
8882 // Outcome of userspace reboot. Always set.
8883 optional Outcome outcome = 1;
8884 // Duration of userspace reboot in case it has a successful outcome.
8885 // Duration is measured as time between userspace reboot was initiated and until boot completed
8886 // (e.g. sys.boot_completed=1).
8887 optional int64 duration_millis = 2;
8888 // State of primary user's (user0) credential encryption storage.
8889 enum UserEncryptionState {
8890 // Default value.
8891 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8892 // Credential encrypted storage is unlocked.
8893 UNLOCKED = 1;
8894 // Credential encrypted storage is locked.
8895 LOCKED = 2;
8896 }
8897 // State of primary user's encryption storage at the moment boot completed. Always set.
8898 optional UserEncryptionState user_encryption_state = 3;
8899}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008900
8901/*
8902 * Logs integrity check information during each install.
8903 *
8904 * Logged from:
8905 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8906 */
8907message IntegrityCheckResultReported {
8908 optional string package_name = 1;
8909 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008910 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008911 optional string installer_package_name = 4;
8912 enum Response {
8913 UNKNOWN = 0;
8914 ALLOWED = 1;
8915 REJECTED = 2;
8916 FORCE_ALLOWED = 3;
8917 }
8918 optional Response response = 5;
8919 // An estimate on the cause of the response. This will only be populated for
8920 // REJECTED and FORCE_ALLOWED
8921 optional bool caused_by_app_cert_rule = 6;
8922 optional bool caused_by_installer_rule = 7;
8923}
8924
8925/**
8926 * Logs the information about the rules and the provider whenever rules are
8927 * pushed into AppIntegrityManager.
8928 *
8929 * Logged from:
8930 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8931 */
8932message IntegrityRulesPushed {
8933 optional bool success = 1;
8934 // Package name of the app that pushed the rules.
8935 optional string rule_provider = 2;
8936 // Version string of arbitrary format provided by the rule provider to
8937 // identify the rules.
8938 optional string rule_version = 3;
8939}
Jordan Liubedfa702019-12-20 15:08:45 -08008940
8941/**
8942 * Logs when a cell broadcast message is received on the device.
8943 *
8944 * Logged from CellBroadcastService module:
8945 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8946 */
8947message CellBroadcastMessageReported {
8948 // The type of Cell Broadcast message
8949 enum CbType {
8950 UNKNOWN_TYPE = 0;
8951 GSM = 1;
8952 CDMA = 2;
8953 CDMA_SPC = 3;
8954 }
8955
8956 // GSM, CDMA, CDMA-SCP
8957 optional CbType type = 1;
8958}
8959
8960/**
8961 * Logs when an error occurs while handling a cell broadcast message;
8962 *
8963 * Logged from CellBroadcastService module:
8964 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8965 */
8966message CellBroadcastMessageError {
8967 // The type of error raised when trying to handle a cell broadcast message
8968 enum ErrorType {
8969 UNKNOWN_TYPE = 0;
8970 CDMA_DECODING_ERROR = 1;
8971 CDMA_SCP_EMPTY = 2;
8972 CDMA_SCP_HANDLING_ERROR = 3;
8973 GSM_INVALID_HEADER_LENGTH = 4;
8974 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8975 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8976 GSM_INVALID_PDU = 7;
8977 GSM_INVALID_GEO_FENCING_DATA = 8;
8978 GSM_UMTS_INVALID_WAC = 9;
8979 FAILED_TO_INSERT_TO_DB = 10;
8980 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8981 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8982 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8983 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8984 }
8985
8986 // What kind of error occurred
8987 optional ErrorType type = 1;
8988
8989 // Exception message (or log message) associated with the error (max 1000 chars)
8990 optional string exception_message = 2;
8991}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008992
8993/**
8994 * Logs when the SDK Extensions test app has polled the current version.
8995 * This is atom ID 354.
8996 *
8997 * Logged from:
8998 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8999 */
9000message SdkExtensionStatus {
9001 enum ApiCallStatus {
9002 CALL_NOT_ATTEMPTED = 0;
9003 CALL_SUCCESSFUL = 1;
9004 CALL_FAILED = 2;
9005 }
9006
9007 optional ApiCallStatus result = 1;
9008
9009 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9010 optional int32 r_extension_version = 2;
9011
9012 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9013 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9014 optional int32 failed_call_symbol = 3;
9015}
Marco Ballesio497aff42020-01-24 08:39:42 -08009016
9017/**
9018 * Logs when an app is frozen or unfrozen.
9019 *
9020 * Logged from:
9021 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9022 */
9023message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009024 // The type of event.
9025 enum Action {
9026 UNKNOWN = 0;
9027 FREEZE_APP = 1;
9028 UNFREEZE_APP = 2;
9029 }
9030 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009031
Blake Kragten6ce382a2020-01-16 20:20:46 -08009032 // Pid of the process being frozen.
9033 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009034
Blake Kragten6ce382a2020-01-16 20:20:46 -08009035 // Name of the process being frozen.
9036 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009037
Blake Kragten6ce382a2020-01-16 20:20:46 -08009038 // Time since last unfrozen.
9039 optional int64 time_unfrozen_millis = 4;
9040}
9041
9042/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009043 * Pulls information for a single voice call.
9044 *
9045 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9046 *
9047 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009048 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009049 */
9050message VoiceCallSession {
9051 // Bearer (IMS or CS) when the call started.
9052 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9053
9054 // Bearer (IMS or CS) when the call ended.
9055 // The bearer may change during the call, e.g. due to SRVCC.
9056 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9057
9058 // Direction of the call (incoming or outgoing).
9059 optional android.telephony.CallDirectionEnum direction = 3;
9060
9061 // Time spent setting up the call.
9062 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9063
9064 // Whether the call ended before the setup was completed.
9065 optional bool setup_failed = 5;
9066
9067 // IMS reason code or CS disconnect cause.
9068 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9069 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9070 optional int32 disconnect_reason_code = 6;
9071
9072 // IMS extra code or CS precise disconnect cause.
9073 // For IMS, this code is vendor-specific
9074 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9075 optional int32 disconnect_extra_code = 7;
9076
9077 // IMS extra message or CS vendor cause.
9078 optional string disconnect_extra_message = 8;
9079
9080 // Radio access technology (RAT) used when call started.
9081 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9082
9083 // Radio access technology (RAT) used when call terminated.
9084 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9085
9086 // Number of times RAT changed during the call.
9087 optional int64 rat_switch_count = 11;
9088
9089 // A bitmask of all codecs used during the call.
9090 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9091 optional int64 codec_bitmask = 12;
9092
9093 // Number of other calls going on during call setup, for the same SIM slot.
9094 optional int32 concurrent_call_count_at_start = 13;
9095
9096 // Number of other calls going on during call termination, for the same SIM slot.
9097 optional int32 concurrent_call_count_at_end = 14;
9098
9099 // Index of the SIM is used, 0 for single-SIM devices.
9100 optional int32 sim_slot_index = 15;
9101
9102 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9103 optional bool is_multi_sim = 16;
9104
9105 // Whether the call was made with an eSIM profile.
9106 optional bool is_esim = 17;
9107
9108 // Carrier ID of the SIM card.
9109 // See https://source.android.com/devices/tech/config/carrierid.
9110 optional int32 carrier_id = 18;
9111
Chi Zhangba1b03a2020-04-21 17:17:56 -07009112 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009113 optional bool srvcc_completed = 19;
9114
9115 // Number of SRVCC failures.
9116 optional int64 srvcc_failure_count = 20;
9117
9118 // Number of SRVCC cancellations.
9119 optional int64 srvcc_cancellation_count = 21;
9120
Chi Zhangba1b03a2020-04-21 17:17:56 -07009121 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9122 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009123 optional bool rtt_enabled = 22;
9124
9125 // Whether this was an emergency call.
9126 optional bool is_emergency = 23;
9127
9128 // Whether the call was performed while roaming.
9129 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009130
9131 // A random number used as the dimension field to pull multiple atoms.
9132 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009133}
9134
9135/**
9136 * Pulls voice call radio access technology (RAT) usage.
9137 *
9138 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9139 * time. The atom will be skipped if not enough data is available.
9140 *
9141 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009142 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009143 */
9144message VoiceCallRatUsage {
9145 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9146 optional int32 carrier_id = 1;
9147
9148 // Radio access technology.
9149 optional android.telephony.NetworkTypeEnum rat = 2;
9150
9151 // Total duration that voice calls spent on this carrier and RAT.
9152 optional int64 total_duration_seconds = 3;
9153
9154 // Total number of calls using this carrier and RAT.
9155 // A call is counted once even if it used the RAT multiple times.
9156 optional int64 call_count = 4;
9157}
9158
9159/**
9160 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9161 *
9162 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009163 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009164 */
9165message SimSlotState {
9166 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9167 optional int32 active_slot_count = 1;
9168
9169 // Number of SIM cards (both physical and active eSIM profiles).
9170 // This number is always equal to or less than the number of active SIM slots.
9171 optional int32 sim_count = 2;
9172
9173 // Number of active eSIM profiles.
9174 // This number is always equal to or less than the number of SIMs.
9175 optional int32 esim_count = 3;
9176}
9177
9178/**
9179 * Pulls supported cellular radio access technologies.
9180 *
9181 * This atom reports the capabilities of the device, rather than the network it has access to.
9182 *
9183 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009184 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009185 */
9186message SupportedRadioAccessFamily {
9187 // A bitmask of supported radio technologies.
9188 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9189 optional int64 network_type_bitmask = 1;
9190}
9191
9192/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009193 * Logs gnss stats from location service provider
9194 *
9195 * Pulled from:
9196 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9197 */
9198
9199message GnssStats {
9200 // Number of location reports since boot
9201 optional int64 location_reports = 1;
9202
9203 // Total pulled reports of Location failures since boot
9204 optional int64 location_failure_reports = 2;
9205
9206 // Number of time to first fix reports since boot
9207 optional int64 time_to_first_fix_reports = 3;
9208
9209 // Total pulled reported time to first fix (in milli-seconds) since boot
9210 optional int64 time_to_first_fix_milli_s = 4;
9211
9212 // Number of position accuracy reports since boot
9213 optional int64 position_accuracy_reports = 5;
9214
9215 // Total pulled reported position accuracy (in meters) since boot
9216 optional int64 position_accuracy_meters = 6;
9217
9218 // Number of top 4 average CN0 reports since boot
9219 optional int64 top_four_average_cn0_reports = 7;
9220
9221 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9222 optional int64 top_four_average_cn0_db_mhz = 8;
9223
9224 // Number of l5 top 4 average CN0 reports since boot
9225 optional int64 l5_top_four_average_cn0_reports = 9;
9226
9227 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9228 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9229
9230 // Total number of sv status messages reports since boot
9231 optional int64 sv_status_reports = 11;
9232
9233 // Total number of sv status messages reports, where sv is used in fix since boot
9234 optional int64 sv_status_reports_used_in_fix = 12;
9235
9236 // Total number of L5 sv status messages reports since boot
9237 optional int64 l5_sv_status_reports = 13;
9238
9239 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9240 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009241}
Kweku Adams12752132020-02-18 15:36:48 -08009242
9243/**
9244 * Logs when an app is moved to a different standby bucket.
9245 *
9246 * Logged from:
9247 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9248 */
9249message AppStandbyBucketChanged {
9250 optional string package_name = 1;
9251
9252 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9253 optional int32 user_id = 2;
9254
9255 // These enum values match the constants defined in UsageStatsManager.java.
9256 enum Bucket {
9257 BUCKET_UNKNOWN = 0;
9258 BUCKET_EXEMPTED = 5;
9259 BUCKET_ACTIVE = 10;
9260 BUCKET_WORKING_SET = 20;
9261 BUCKET_FREQUENT = 30;
9262 BUCKET_RARE = 40;
9263 BUCKET_RESTRICTED = 45;
9264 BUCKET_NEVER = 50;
9265 }
9266 optional Bucket bucket = 3;
9267
9268 enum MainReason {
9269 MAIN_UNKNOWN = 0;
9270 MAIN_DEFAULT = 0x0100;
9271 MAIN_TIMEOUT = 0x0200;
9272 MAIN_USAGE = 0x0300;
9273 MAIN_FORCED_BY_USER = 0x0400;
9274 MAIN_PREDICTED = 0x0500;
9275 MAIN_FORCED_BY_SYSTEM = 0x0600;
9276 }
9277 optional MainReason main_reason = 4;
9278
9279 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9280 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9281 // UsageStatsManager.java.
9282 optional int32 sub_reason = 5;
9283}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009284
9285/**
9286* Reports a started sharesheet transaction.
9287*
9288* Logged from:
9289* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9290*/
9291message SharesheetStarted {
9292 // The event_id (as for UiEventReported).
9293 optional int32 event_id = 1;
9294 // The calling app's package name.
9295 optional string package_name = 2;
9296 // An identifier to tie together multiple logs relating to the same share event
9297 optional int32 instance_id = 3;
9298 // The mime type of the share
9299 optional string mime_type = 4;
9300 // The number of direct targets the calling app is providing that will be shown.
9301 optional int32 num_app_provided_direct_targets = 5;
9302 // The number of app targets the calling app is providing that will be shown.
9303 optional int32 num_app_provided_app_targets = 6;
9304 // True if the share originates from the workprofile
9305 optional bool is_workprofile = 7;
9306
9307 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009308 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009309 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9310 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9311 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9312 }
9313 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009314 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009315
9316 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9317 INTENT_DEFAULT = 0;
9318 INTENT_ACTION_VIEW = 1;
9319 INTENT_ACTION_EDIT = 2;
9320 INTENT_ACTION_SEND = 3;
9321 INTENT_ACTION_SENDTO = 4;
9322 INTENT_ACTION_SEND_MULTIPLE = 5;
9323 INTENT_ACTION_IMAGE_CAPTURE = 6;
9324 INTENT_ACTION_MAIN = 7;
9325 }
9326 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009327 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009328}
9329
9330/**
9331 * Reports a ranking selection event.
9332 *
9333 * Logged from:
9334 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9335 */
9336message RankingSelected {
9337 // The event_id (as for UiEventReported).
9338 optional int32 event_id = 1;
9339 // The relevant app's package name (can be source or picked package).
9340 optional string package_name = 2;
9341 // An identifier to tie together multiple logs relating to the same share event.
9342 optional int32 instance_id = 3;
9343 // Which of the ranked targets got picked, default starting position 0.
9344 optional int32 position_picked = 4;
9345}
Raff Tsaiea4db182020-03-06 07:45:43 +08009346
9347/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009348 * Logs when TvSettings UI is interacted at.
9349 *
9350 * Logged from: packages/apps/TvSettings
9351 */
9352message TvSettingsUIInteracted {
9353
9354 /** The UI action category */
9355 optional android.app.tvsettings.Action action = 1;
9356
9357 /** The ID of the entry that the users actioned on */
9358 optional android.app.tvsettings.ItemId item_id = 2;
9359
9360 /** Additional information (e.g., navigation direction on page focused) */
9361 optional string additional_info = 3;
9362}
9363
9364/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009365 * Logs information about a package installation using package installer V2 APIs.
9366 *
9367 * Logged from:
9368 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9369 */
9370message PackageInstallerV2Reported {
9371 // Whether this installation uses Incremental File System
9372 optional bool is_incremental = 1;
9373 // Name of the package that is intended to be installed
9374 optional string package_name = 2;
9375 // The duration between when the install was requested to when the install has completed
9376 optional int64 duration_millis = 3;
9377 // Installation result in final integer, which are SystemApi's.
9378 // Return_code 1 indicates success.
9379 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9380 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009381 // Total size of the APKs installed for this package
9382 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009383}
9384
9385/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009386 * Logs settings provider values.
9387 *
9388 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9389 * then write the value to proto.
9390 *
9391 */
9392message SettingSnapshot {
9393
9394 // Setting key
9395 optional string name = 1;
9396
9397 enum SettingsValueType {
9398 NOTASSIGNED = 0;
9399 ASSIGNED_BOOL_TYPE = 1;
9400 ASSIGNED_INT_TYPE = 2;
9401 ASSIGNED_FLOAT_TYPE = 3;
9402 ASSIGNED_STRING_TYPE = 4;
9403 };
9404 // Setting value type
9405 optional SettingsValueType type = 2;
9406
9407 optional bool bool_value = 3;
9408
9409 optional int32 int_value = 4;
9410
9411 optional float float_value = 5;
9412
9413 optional string str_value = 6;
9414
9415 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9416 optional int32 user_id = 7;
9417}
Varun Shahacb56342019-12-18 11:45:38 -08009418
9419/**
9420 * An event logged to indicate that a user journey is about to be performed. This atom includes
9421 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9422 * will immediately follow this atom which will describe the event(s) and its state.
9423 *
9424 * Logged from:
9425 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9426 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9427 */
9428message UserLifecycleJourneyReported {
9429 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9430 // UserLifecycleEventOccurred atom)
9431 optional int64 session_id = 1;
9432
9433 // Indicates what type of user journey this session is related to
9434 enum Journey {
9435 UNKNOWN = 0; // Undefined user lifecycle journey
9436 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9437 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9438 USER_START = 3; // A user start journey
9439 USER_CREATE = 4; // A user creation journey
9440 }
9441 optional Journey journey = 2;
9442 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9443 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9444 optional int32 origin_user = 3;
9445 // Which user the journey is targeting
9446 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9447 optional int32 target_user = 4;
9448
9449 // What is the user type of the target user
9450 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9451 enum UserType {
9452 TYPE_UNKNOWN = 0;
9453 FULL_SYSTEM = 1;
9454 FULL_SECONDARY = 2;
9455 FULL_GUEST = 3;
9456 FULL_DEMO = 4;
9457 FULL_RESTRICTED = 5;
9458 PROFILE_MANAGED = 6;
9459 SYSTEM_HEADLESS = 7;
9460 }
9461 optional UserType user_type = 5;
9462 // What are the flags attached to the target user
9463 optional int32 user_flags = 6;
9464}
9465
9466/**
9467 * An event logged when a specific user lifecycle event is performed. These events should be
9468 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9469 * Note: journeys can span over multiple events, hence some events may share a single session id.
9470 *
9471 * Logged from:
9472 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9473 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9474 */
9475message UserLifecycleEventOccurred {
9476 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9477 optional int64 session_id = 1;
9478 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9479 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9480 optional int32 user_id = 2;
9481
9482 enum Event {
9483 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9484 SWITCH_USER = 1; // Indicates that this is a user switch event
9485 START_USER = 2; // Indicates that this is a user start event
9486 CREATE_USER = 3; // Indicates that this is a user create event
9487 }
9488 optional Event event = 3;
9489
9490 enum State {
9491 NONE = 0; // Indicates the associated event has no start/end defined
9492 BEGIN = 1;
9493 FINISH = 2;
9494 }
9495 optional State state = 4; // Represents the state of an event (beginning/ending)
9496}
jasonwshsu81173e32020-03-27 15:22:03 +08009497
9498/**
9499 * Logs when accessibility shortcut clicked.
9500 *
9501 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009502 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009503 */
9504message AccessibilityShortcutReported {
9505 // The accessibility feature(including installed a11y service, framework a11y feature,
9506 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9507 optional string package_name = 1;
9508
9509 // The definition of the accessibility shortcut.
9510 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9511 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9512
9513 // The definition of the service status.
9514 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9515 optional android.stats.accessibility.ServiceStatus service_status = 3;
9516}
9517
9518/**
9519 * Logs when accessibility service status changed.
9520 *
9521 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009522 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009523 */
9524message AccessibilityServiceReported {
9525 // The accessibility service package name.
9526 optional string package_name = 1;
9527
9528 // The definition of the service status.
9529 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9530 optional android.stats.accessibility.ServiceStatus service_status = 2;
9531}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009532
9533/**
9534 * Logs app usage events.
9535 */
9536message AppUsageEventOccurred {
9537 optional int32 uid = 1 [(is_uid) = true];
9538 optional string package_name = 2;
9539 optional string class_name = 3;
9540
9541 enum EventType {
9542 NONE = 0;
9543 MOVE_TO_FOREGROUND = 1;
9544 MOVE_TO_BACKGROUND = 2;
9545 }
9546 optional EventType event_type = 4;
9547}