blob: 499713e297118096409c0b92961cc5da28e04899 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070027import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080028import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080029import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080030import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080031import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080032import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080033import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080034import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080035import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080038import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080039import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080040import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080041import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080043import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080044import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080045import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070048import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080049import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070050import "frameworks/base/core/proto/android/stats/enums.proto";
51import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070052import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070053import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080054import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070055import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000056import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080057import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050058import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080059import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080060import "frameworks/base/core/proto/android/telephony/enums.proto";
61import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080062import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010063import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070064import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080065
Yao Chend54f9dd2017-10-17 17:37:48 +000066/**
Stefan Lafonae2df012017-11-14 09:17:21 -080067 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000068 * raw stats log events from the Android system, also known as "atoms."
69 *
70 * This field contains a single oneof with all of the available messages.
71 * The stats-log-api-gen tool runs as part of the Android build and
72 * generates the android.util.StatsLog class, which contains the constants
73 * and methods that Android uses to log.
74 *
Stefan Lafonae2df012017-11-14 09:17:21 -080075 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000076 * Instead, statsd on Android constructs these messages synthetically,
77 * in the format defined here and in stats_log.proto.
78 */
Stefan Lafonae2df012017-11-14 09:17:21 -080079message Atom {
80 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070081 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070082 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070083 BleScanStateChanged ble_scan_state_changed = 2
84 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080085 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080086 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070087 SensorStateChanged sensor_state_changed =
88 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080089 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070090 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
91 ScheduledJobStateChanged scheduled_job_state_changed =
92 8 [(module) = "framework", (module) = "statsdtest"];
93 ScreenBrightnessChanged screen_brightness_changed =
94 9 [(module) = "framework", (module) = "statsdtest"];
95 WakelockStateChanged wakelock_state_changed =
96 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080097 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
98 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070099 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
100 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
102 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
103 14 [(module) = "framework"];
104 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
105 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
106 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
107 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800108 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700109 BatterySaverModeStateChanged battery_saver_mode_state_changed =
110 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800111 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
112 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700113 AudioStateChanged audio_state_changed =
114 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800115 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
116 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
117 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700118 UidProcessStateChanged uid_process_state_changed =
119 27 [(module) = "framework", (module) = "statsdtest"];
120 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
121 28 [(module) = "framework", (module) = "statsdtest"];
122 ScreenStateChanged screen_state_changed =
123 29 [(module) = "framework", (module) = "statsdtest"];
124 BatteryLevelChanged battery_level_changed =
125 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800127 PluggedStateChanged plugged_state_changed = 32
128 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800130 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
132 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800133 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
134 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
135 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700136 PhoneSignalStrengthChanged phone_signal_strength_changed =
137 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 SettingChanged setting_changed = 41 [(module) = "framework"];
139 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700140 42 [(module) = "framework", (module) = "statsdtest"];
141 IsolatedUidChanged isolated_uid_changed =
142 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
144 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800145 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800147 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700148 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
150 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800153 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800154 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800155 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
156 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800157 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800158 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700159 OverlayStateChanged overlay_state_changed =
160 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800161 ForegroundServiceStateChanged foreground_service_state_changed
162 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700163 CallStateChanged call_state_changed =
164 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800165 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
166 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
167 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 AppDied app_died = 65 [(module) = "framework"];
169 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
170 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800171 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
172 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
174 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800175 SpeakerImpedanceReported speaker_impedance_reported = 71;
176 HardwareFailed hardware_failed = 72;
177 PhysicalDropDetected physical_drop_detected = 73;
178 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800179 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
180 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800181 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700182 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800183 ANROccurred anr_occurred = 79 [(module) = "framework"];
184 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
185 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700186 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800187 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800188 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
190 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700191 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
193 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
194 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
195 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700196 BatteryHealthSnapshot battery_health_snapshot = 91;
197 SlowIo slow_io = 92;
198 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800199 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
200 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100201 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800202 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800203 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700204 // TODO: service state change is very noisy shortly after boot, as well
205 // as at other transitions - coming out of doze, device plugged in, etc.
206 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
208 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
209 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800210 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800211 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800212 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
213 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
214 105 [(module) = "docsui"];
215 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
216 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
217 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
218 108 [(module) = "docsui"];
219 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
220 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
221 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
222 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800224 WifiRunningStateChanged wifi_running_state_changed = 114
225 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800227 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800228 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800229 117 [(module) = "docsui"];
230 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
231 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
232 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
233 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800234 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
235 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
236 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800237 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
238 125 [(module) = "bluetooth"];
239 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
240 126 [(module) = "bluetooth"];
241 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
242 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800243 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000244 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800245 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
246 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
247 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800248 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800249 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
250 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
251 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
252 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
253 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
254 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800255 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
256 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800257 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
258 142 [(module) = "framework"];
259 AttentionManagerServiceResultReported attention_manager_service_result_reported =
260 143 [(module) = "framework"];
261 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800262 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800264 WatchdogRollbackOccurred watchdog_rollback_occurred =
265 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
267 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800268 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800269 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
270 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800271 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
272 151 [(module) = "bluetooth"];
273 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
274 152 [(module) = "bluetooth"];
275 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
276 153 [(module) = "bluetooth"];
277 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
278 154 [(module) = "bluetooth"];
279 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
280 155 [(module) = "bluetooth"];
281 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
282 156 [(module) = "bluetooth"];
283 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
284 157 [(module) = "bluetooth"];
285 BluetoothDeviceFailedContactCounterReported
286 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
287 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
288 159 [(module) = "bluetooth"];
289 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
290 160 [(module) = "bluetooth"];
291 BluetoothQualityReportReported bluetooth_quality_report_reported =
292 161 [(module) = "bluetooth"];
293 BluetoothDeviceInfoReported bluetooth_device_info_reported =
294 162 [(module) = "bluetooth"];
295 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
296 163 [(module) = "bluetooth"];
297 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
298 164 [(module) = "bluetooth"];
299 BluetoothBondStateChanged bluetooth_bond_state_changed =
300 165 [(module) = "bluetooth"];
301 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
302 166 [(module) = "bluetooth"];
303 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
304 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
306 168 [(module) = "framework"];
307 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700308 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800309 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800310 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800311 DeviceIdentifierAccessDenied device_identifier_access_denied =
312 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800314 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
315 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
316 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
318 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800319 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700320 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800321 180 [(module) = "permissioncontroller"];
322 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
323 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800324 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800325 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
326 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
327 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
328 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800329 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
330 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700331 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800332 188 [(module) = "intelligence"];
333 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
334 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800335 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800336 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800337 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
338 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
339 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
340 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
341 MediametricsCodecReported mediametrics_codec_reported = 195;
342 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
343 MediametricsExtractorReported mediametrics_extractor_reported = 197;
344 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
345 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
346 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700347 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800348 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
349 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800350 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
352 206 [(module) = "framework"];
353 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
354 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
355 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
356 LocationManagerApiUsageReported location_manager_api_usage_reported =
357 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100358 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100360 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100362 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100364 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100366 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800367 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100368 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800369 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100370 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800371 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100372 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800373 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
375 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
376 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
377 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800378 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800379 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700380 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
381 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800382 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100383 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800384 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800386 VmsClientConnectionStateChanged vms_client_connection_state_changed =
387 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100388 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
389 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
390 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100392 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
393 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800394 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800395 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
396 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
397 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
398 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800399 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800400 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000401 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800402 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500403 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
404 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800405 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
406 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800407 CellBroadcastMessageReported cb_message_reported =
408 249 [(module) = "cellbroadcast"];
409 CellBroadcastMessageError cb_message_error =
410 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700411 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
412 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
413 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800414 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000415 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800416 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
417 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800418 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800419 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500420 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
421 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700422 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800423 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700424 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800425 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
426 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800427 AccessibilityShortcutReported accessibility_shortcut_reported =
428 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800429 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700430 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700431 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700432 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
433 270 [(module) = "permissioncontroller"];
434 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
435 271 [(module) = "permissioncontroller"];
436 AutoRevokedAppInteraction auto_revoked_app_interaction =
437 272 [(module) = "permissioncontroller", (module) = "settings"];
438 AppPermissionGroupsFragmentAutoRevokeAction
439 app_permission_groups_fragment_auto_revoke_action =
440 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700441 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800442 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000443 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700444
445 // StatsdStats tracks platform atoms with ids upto 500.
446 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 }
David Chenc8a43242017-10-17 16:23:28 -0700448
David Chen6e3e6cb2018-01-03 16:14:06 -0800449 // Pulled events will start at field 10000.
Denny cy Lee57b31282020-04-17 10:08:52 +0800450 // Next: 10082
David Chenc8a43242017-10-17 16:23:28 -0700451 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
453 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700454 MobileBytesTransfer mobile_bytes_transfer =
455 10002 [(module) = "framework", (truncate_timestamp) = true];
456 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
457 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
459 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700460 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700462 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800463 CpuTimePerUidFreq cpu_time_per_uid_freq =
464 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
466 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
467 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
468 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
469 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700470 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700471 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700472 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700473 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
475 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700476 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800477 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800478 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800479 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 DiskStats disk_stats = 10025 [(module) = "framework"];
481 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
482 AppSize app_size = 10027 [(module) = "framework"];
483 CategorySize category_size = 10028 [(module) = "framework"];
484 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800485 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
487 DiskIo disk_io = 10032 [(module) = "framework"];
488 PowerProfile power_profile = 10033 [(module) = "framework"];
489 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
490 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
491 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700492 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800493 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
494 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
495 10040 [(module) = "framework"];
496 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
497 10041 [(module) = "framework"];
498 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800499 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800500 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800501 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
503 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
504 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
505 RoleHolder role_holder = 10049 [(module) = "framework"];
506 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800507 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800508 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
509 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800510 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
511 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800512 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
513 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
514 FaceSettings face_settings = 10058 [(module) = "framework"];
515 CoolingDevice cooling_device = 10059 [(module) = "framework"];
516 AppOps app_ops = 10060 [(module) = "framework"];
517 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700518 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
519 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800520 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800521 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800522 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
523 DangerousPermissionStateSampled dangerous_permission_state_sampled =
524 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400525 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000526 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000527 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200528 PackageNotificationPreferences package_notification_preferences =
529 10071 [(module) = "framework"];
530 PackageNotificationChannelPreferences package_notification_channel_preferences =
531 10072 [(module) = "framework"];
532 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
533 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800534 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800535 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700536 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
537 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
538 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
539 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800540 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800541 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700542 }
yroa1fe77c2018-02-26 14:22:54 -0800543
Bookatz76aafcf2018-09-17 16:17:10 -0700544 // DO NOT USE field numbers above 100,000 in AOSP.
545 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
546 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100547
548 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700549}
550
Yao Chend54f9dd2017-10-17 17:37:48 +0000551/**
Yangster-mac20877162017-12-22 17:19:39 -0800552 * This proto represents a node of an attribution chain.
553 * Note: All attribution chains are represented as a repeated field of type
554 * AttributionNode. It is understood that in such arrays, the order is that
555 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 */
Yangster-mac20877162017-12-22 17:19:39 -0800557message AttributionNode {
558 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800559 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800560
Yangster-mac20877162017-12-22 17:19:39 -0800561 // The (optional) string tag for an element in the attribution chain. If the
562 // element has no tag, it is encoded as an empty string.
563 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700564}
565
Yangster-mac48b3d622018-08-18 12:38:11 -0700566message KeyValuePair {
567 optional int32 key = 1;
568 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700569 int32 value_int = 2;
570 int64 value_long = 3;
571 string value_str = 4;
572 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700573 }
574}
575
576message KeyValuePairsAtom {
577 optional int32 uid = 1;
578 repeated KeyValuePair pairs = 2;
579}
580
Yao Chend54f9dd2017-10-17 17:37:48 +0000581/*
582 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800583 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000584 *
585 * RULES:
586 * - The field ids for each atom must start at 1, and count upwards by 1.
587 * Skipping field ids is not allowed.
588 * - These form an API, so renaming, renumbering or removing fields is
589 * not allowed between android releases. (This is not currently enforced,
590 * but there will be a tool to enforce this restriction).
591 * - The types must be built-in protocol buffer types, namely, no sub-messages
592 * are allowed (yet). The bytes type is also not allowed.
593 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800594 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800596 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000597 * - A field that is a uid should be a string field, tagged with the [xxx]
598 * annotation. The generated code on android will be represented by UIDs,
599 * and those UIDs will be translated in xxx to those strings.
600 *
601 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700602 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000603 * - If there is a UID, it goes first. Think in an object-oriented fashion.
604 * *****************************************************************************
605 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700606
Yao Chend54f9dd2017-10-17 17:37:48 +0000607/**
Tej Singha72344992019-04-17 18:55:08 -0700608 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700609 * Logs when the Thermal service HAL notifies the throttling start/stop events.
610 *
611 * Logged from:
612 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
613 */
614message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700615 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700616 optional android.os.TemperatureTypeEnum sensor_type = 1;
617
Maggie White442b6312019-04-05 16:26:44 -0700618 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700619 enum State {
620 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700621 START = 1; // START indicated that throttling was triggered.
622 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700623 }
Yangster-mace16189a2018-08-26 12:20:16 -0700624 optional State state = 2;
625
626 optional float temperature = 3;
627}
628
629/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000630 * Logs when the screen state changes.
631 *
632 * Logged from:
633 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
634 */
635message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800636 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800637 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700638 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700639}
Yao Chend54f9dd2017-10-17 17:37:48 +0000640
641/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700642 * Logs that the process state of the uid, as determined by ActivityManager
643 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000644 *
645 * Logged from:
646 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
647 */
Bookatzc1a050a2017-10-10 15:49:28 -0700648message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700649 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000650
Bookatzdb026a22018-01-10 19:01:56 -0800651 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800652 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700653 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000654}
655
656/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700657 * Logs process state change of a process, as per the activity manager.
658 *
659 * Logged from:
660 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
661 */
662message ProcessStateChanged {
663 optional int32 uid = 1;
664 optional string process_name = 2;
665 optional string package_name = 3;
666 // TODO: remove this when validation is done
667 optional int64 version = 5;
668 // The state, from frameworks/base/core/proto/android/app/enums.proto.
669 optional android.app.ProcessStateEnum state = 4;
670}
671
672/**
673 * Logs when ActivityManagerService sleep state is changed.
674 *
675 * Logged from:
676 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
677 */
678message ActivityManagerSleepStateChanged {
679 // TODO: import frameworks proto
680 enum State {
681 UNKNOWN = 0;
682 ASLEEP = 1;
683 AWAKE = 2;
684 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700685 optional State state = 1
686 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700687}
688
689/**
690 * Logs when system memory state changes.
691 *
692 * Logged from:
693 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
694 */
695message MemoryFactorStateChanged {
696 // TODO: import frameworks proto
697 enum State {
698 MEMORY_UNKNOWN = 0;
699 NORMAL = 1; // normal.
700 MODERATE = 2; // moderate memory pressure.
701 LOW = 3; // low memory.
702 CRITICAL = 4; // critical memory.
703
704 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700705 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700706}
707
708/**
709 * Logs when app is using too much cpu, according to ActivityManagerService.
710 *
711 * Logged from:
712 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
713 */
714message ExcessiveCpuUsageReported {
715 optional int32 uid = 1;
716 optional string process_name = 2;
717 optional string package_name = 3;
718 // package version. TODO: remove this when validation is done
719 optional int64 version = 4;
720}
721
722/**
723 * Logs when a cached process is killed, along with its pss.
724 *
725 * Logged from:
726 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
727 */
728message CachedKillReported {
729 optional int32 uid = 1;
730 optional string process_name = 2;
731 optional string package_name = 3;
732 // TODO: remove this when validation is done
733 optional int64 version = 5;
734 optional int64 pss = 4;
735}
736
737/**
xshu2c3d9e42019-09-26 17:54:02 -0700738 * Logs the change in wifi health.
739 *
740 * Logged from:
741 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
742 */
743message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800744 enum Band {
745 UNKNOWN = 0;
746 // All of 2.4GHz band
747 BAND_2G = 1;
748 // Frequencies in the range of [5150, 5250) GHz
749 BAND_5G_LOW = 2;
750 // Frequencies in the range of [5250, 5725) GHz
751 BAND_5G_MIDDLE = 3;
752 // Frequencies in the range of [5725, 5850) GHz
753 BAND_5G_HIGH = 4;
754 // Frequencies in the range of [5925, 6425) GHz
755 BAND_6G_LOW = 5;
756 // Frequencies in the range of [6425, 6875) GHz
757 BAND_6G_MIDDLE = 6;
758 // Frequencies in the range of [6875, 7125) GHz
759 BAND_6G_HIGH = 7;
760 }
xshu2c3d9e42019-09-26 17:54:02 -0700761 // duration this stat is obtained over in milliseconds
762 optional int32 duration_millis = 1;
763 // whether wifi is classified as sufficient for the user's data traffic, determined
764 // by whether the calculated throughput exceeds the average demand within |duration_millis|
765 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700766 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800767 optional bool is_cell_data_available = 3;
768 // the Band bucket the connected network is on
769 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700770}
771
772/**
773 * Logged when wifi detects a significant change in connection failure rate.
774 *
775 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
776 *
777 */
778message WifiFailureStatReported {
779 enum AbnormalityType {
780 UNKNOWN = 0;
781 SIGNIFICANT_INCREASE = 1;
782 SIGNIFICANT_DECREASE = 2;
783 SIMPLY_HIGH = 3;
784 }
785 enum FailureType {
786 FAILURE_UNKNOWN = 0;
787 FAILURE_CONNECTION = 1;
788 FAILURE_ASSOCIATION_REJECTION = 2;
789 FAILURE_ASSOCIATION_TIMEOUT = 3;
790 FAILURE_AUTHENTICATION = 4;
791 FAILURE_NON_LOCAL_DISCONNECTION = 5;
792 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
793 }
794 // Reason for uploading this stat
795 optional AbnormalityType abnormality_type = 1;
796 // The particular type of failure
797 optional FailureType failure_type = 2;
798 // How many times we have encountered this combination of AbnormalityType and FailureType
799 optional int32 failure_count = 3;
800}
801
802/**
803 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
804 *
805 * Logged from:
806 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
807 */
808message WifiConnectionResultReported {
809 enum FailureCode {
810 FAILURE_UNKNOWN = 0;
811 FAILURE_ASSOCIATION_TIMEOUT = 1;
812 FAILURE_ASSOCIATION_REJECTION = 2;
813 FAILURE_AUTHENTICATION_GENERAL = 3;
814 FAILURE_AUTHENTICATION_EAP = 4;
815 FAILURE_DHCP = 5;
816 FAILURE_NETWORK_DISCONNECTION = 6;
817 FAILURE_ROAM_TIMEOUT = 7;
818 }
819 // true represents a successful connection
820 optional bool connection_result = 1;
821 // reason for the connection failure
822 optional FailureCode failure_code = 2;
823 // scan rssi before the connection attempt
824 optional int32 rssi = 3;
825}
826
827/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700828 * Logs when memory stats of a process is reported.
829 *
830 * Logged from:
831 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
832 */
833message ProcessMemoryStatReported {
834 optional int32 uid = 1;
835 optional string process_name = 2;
836 optional string package_name = 3;
837 //TODO: remove this when validation is done
838 optional int64 version = 9;
839 optional int64 pss = 4;
840 optional int64 uss = 5;
841 optional int64 rss = 6;
842 enum Type {
843 ADD_PSS_INTERNAL_SINGLE = 0;
844 ADD_PSS_INTERNAL_ALL_MEM = 1;
845 ADD_PSS_INTERNAL_ALL_POLL = 2;
846 ADD_PSS_EXTERNAL = 3;
847 ADD_PSS_EXTERNAL_SLOW = 4;
848 }
849 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800850 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700851}
852
853/**
Bookatzc1a050a2017-10-10 15:49:28 -0700854 * Logs that a process started, finished, crashed, or ANRed.
855 *
856 * Logged from:
857 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
858 */
859message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700860 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700861
David Chen0b5c90c2018-01-25 16:51:49 -0800862 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800863 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700864
Bookatzddccf0a2017-11-28 16:48:14 -0800865 // What lifecycle state the process changed to.
866 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800867 enum State {
868 FINISHED = 0;
869 STARTED = 1;
870 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800871 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800872 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700873}
874
Bookatzc1a050a2017-10-10 15:49:28 -0700875/**
876 * Logs when the ble scan state changes.
877 *
878 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700879 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700880 */
881message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800882 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700883 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700884
885 enum State {
886 OFF = 0;
887 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700888 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
889 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700890 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800891 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700892 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800893 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700894 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800895 (state_field_option).nested = true
896 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700897
Bookatze5ec0b42018-03-26 13:34:56 -0700898 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700899 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700900 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700901 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700902 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700903 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700904}
905
906/**
907 * Logs reporting of a ble scan finding results.
908 *
909 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700910 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700911 */
Bookatzae6738e2018-09-13 11:38:56 -0700912// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700913message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800914 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700915
916 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800917 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700918}
919
920/**
921 * Logs when a sensor state changes.
922 *
923 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700924 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700925 */
926message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800927 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700928
Bookatzc1a050a2017-10-10 15:49:28 -0700929 // The id (int) of the sensor.
930 optional int32 sensor_id = 2;
931
932 enum State {
933 OFF = 0;
934 ON = 1;
935 }
936 optional State state = 3;
937}
938
Bookatzc1a050a2017-10-10 15:49:28 -0700939/**
940 * Logs when GPS state changes.
941 *
942 * Logged from:
943 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
944 */
945message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800946 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700947
948 enum State {
949 OFF = 0;
950 ON = 1;
951 }
952 optional State state = 2;
953}
954
Bookatz48d362e2018-11-06 15:49:08 -0800955/**
956 * Logs when GPS signal quality.
957 *
958 * Logged from:
959 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
960 */
961message GpsSignalQualityChanged {
962 optional android.server.location.GpsSignalQualityEnum level = 1;
963}
964
Bookatzc1a050a2017-10-10 15:49:28 -0700965
966/**
967 * Logs when a sync manager sync state changes.
968 *
969 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700971 */
972message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800973 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700974
David Chen0b5c90c2018-01-25 16:51:49 -0800975 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800976 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700977
978 enum State {
979 OFF = 0;
980 ON = 1;
981 }
982 optional State state = 3;
983}
984
Yangster-mac96353002018-09-05 11:18:55 -0700985/*
986 * Deferred job stats.
987 *
988 * Logged from:
989 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
990*/
991message DeferredJobStatsReported {
992 repeated AttributionNode attribution_node = 1;
993
994 // Number of jobs deferred.
995 optional int32 num_jobs_deferred = 2;
996
997 // Time since the last job runs.
998 optional int64 time_since_last_job_millis = 3;
999}
1000
Bookatzc1a050a2017-10-10 15:49:28 -07001001/**
1002 * Logs when a job scheduler job state changes.
1003 *
1004 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001005 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001006 */
1007message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001008 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001009
1010 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001011 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001012
1013 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001014 FINISHED = 0;
1015 STARTED = 1;
1016 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001017 }
1018 optional State state = 3;
1019
Tej Singh33a412b2018-03-16 18:43:59 -07001020 // The reason a job has stopped.
1021 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001022 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001023 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001024
1025 // The standby bucket of the app that scheduled the job. These match the framework constants
1026 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1027 // already assigned 0.
1028 enum Bucket {
1029 UNKNOWN = -1;
1030 ACTIVE = 0;
1031 WORKING_SET = 1;
1032 FREQUENT = 2;
1033 RARE = 3;
1034 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001035 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001036 }
1037 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1038
1039 // The job id (as assigned by the app).
1040 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001041
1042 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1043 // constraints as they are always assumed to be set.
1044 optional bool has_charging_constraint = 7;
1045 optional bool has_battery_not_low_constraint = 8;
1046 optional bool has_storage_not_low_constraint = 9;
1047 optional bool has_timing_delay_constraint = 10;
1048 optional bool has_deadline_constraint = 11;
1049 optional bool has_idle_constraint = 12;
1050 optional bool has_connectivity_constraint = 13;
1051 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001052}
1053
1054/**
1055 * Logs when the audio state changes.
1056 *
1057 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001058 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001059 */
1060message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001061 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001062
1063 enum State {
1064 OFF = 0;
1065 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001066 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1067 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001068 }
1069 optional State state = 2;
1070}
1071
1072/**
1073 * Logs when the video codec state changes.
1074 *
1075 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001076 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001077 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001078message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001079 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001080
1081 enum State {
1082 OFF = 0;
1083 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001084 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1085 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001086 }
1087 optional State state = 2;
1088}
1089
1090/**
1091 * Logs when the flashlight state changes.
1092 *
1093 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001094 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001095 */
1096message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001097 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001098
1099 enum State {
1100 OFF = 0;
1101 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001102 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1103 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001104 }
1105 optional State state = 2;
1106}
1107
1108/**
1109 * Logs when the camera state changes.
1110 *
1111 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001112 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001113 */
1114message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001115 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001116
1117 enum State {
1118 OFF = 0;
1119 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001120 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1121 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001122 }
1123 optional State state = 2;
1124}
1125
1126/**
1127 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001128 *
1129 * Logged from:
1130 * TODO
1131 */
Bookatzd6746242017-10-24 18:39:35 -07001132message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001133 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001134 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001135
Bookatz1a1b0462018-01-12 11:47:03 -08001136 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1137 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001138 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001139
1140 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001141 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001142
1143 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001144 RELEASE = 0;
1145 ACQUIRE = 1;
1146 CHANGE_RELEASE = 2;
1147 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001148 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001149 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001150 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001151 (state_field_option).default_state_value = 0,
1152 (state_field_option).nested = true
1153 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001154}
1155
1156/**
Bookatzc1a050a2017-10-10 15:49:28 -07001157 * Logs when a partial wakelock is considered 'long' (over 1 min).
1158 *
1159 * Logged from:
1160 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1161 */
1162message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001163 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001164
Yao Chend54f9dd2017-10-17 17:37:48 +00001165 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1166 optional string tag = 2;
1167
Bookatzc1a050a2017-10-10 15:49:28 -07001168 // TODO: I have no idea what this is.
1169 optional string history_tag = 3;
1170
1171 enum State {
1172 OFF = 0;
1173 ON = 1;
1174 }
1175 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001176}
1177
Bookatzc1a050a2017-10-10 15:49:28 -07001178/**
Bookatza66083f2018-09-20 17:24:00 -07001179 * Logs when the device is interactive, according to the PowerManager Notifier.
1180 *
1181 * Logged from:
1182 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1183 */
1184message InteractiveStateChanged {
1185 enum State {
1186 OFF = 0;
1187 ON = 1;
1188 }
1189 optional State state = 1;
1190}
1191
1192/**
Bookatzc1a050a2017-10-10 15:49:28 -07001193 * Logs Battery Saver state change.
1194 *
1195 * Logged from:
1196 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1197 */
1198message BatterySaverModeStateChanged {
1199 enum State {
1200 OFF = 0;
1201 ON = 1;
1202 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001203 optional State state = 1
1204 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001205}
1206
1207/**
1208 * Logs Doze mode state change.
1209 *
1210 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001211 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001212 */
1213message DeviceIdleModeStateChanged {
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];
Bookatzddccf0a2017-11-28 16:48:14 -08001216}
1217
1218
1219/**
1220 * Logs state change of Doze mode including maintenance windows.
1221 *
1222 * Logged from:
1223 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1224 */
1225message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001226 optional android.server.DeviceIdleModeEnum state = 1
1227 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001228}
1229
1230/**
1231 * Logs screen brightness level.
1232 *
1233 * Logged from:
1234 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1235 */
1236message ScreenBrightnessChanged {
1237 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1238 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001239}
1240
1241/**
1242 * Logs battery level (percent full, from 0 to 100).
1243 *
1244 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001245 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001246 */
1247message BatteryLevelChanged {
1248 // Battery level. Should be in [0, 100].
1249 optional int32 battery_level = 1;
1250}
1251
1252/**
1253 * Logs change in charging status of the device.
1254 *
1255 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001256 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001257 */
1258message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001259 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001260 optional android.os.BatteryStatusEnum state = 1
1261 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001262}
1263
1264/**
1265 * Logs whether the device is plugged in, and what power source it is using.
1266 *
1267 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001268 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001269 */
1270message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001271 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001272 optional android.os.BatteryPluggedStateEnum state = 1
1273 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001274}
1275
Bookatz8c6571b2017-10-24 15:04:41 -07001276/**
1277 * Logs when an app's wakeup alarm fires.
1278 *
1279 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001280 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001281 */
1282message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001283 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001284
1285 // Name of the wakeup alarm.
1286 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001287
1288 // Name of source package (for historical reasons, since BatteryStats tracked it).
1289 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001290
Ben Murdoch3389f1522019-05-21 15:05:34 +01001291 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001292 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001293}
1294
1295/**
1296 * Logs when an an app causes the mobile radio to change state.
1297 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1298 *
1299 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001300 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001301 */
1302message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001303 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001304
Bookatz1a1b0462018-01-12 11:47:03 -08001305 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1306 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001307}
1308
1309/**
1310 * Logs when an an app causes the wifi radio to change state.
1311 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1312 *
1313 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001314 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001315 */
1316message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001317 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001318
Bookatz1a1b0462018-01-12 11:47:03 -08001319 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1320 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001321}
1322
1323/**
1324 * Logs kernel wakeup reasons and aborts.
1325 *
1326 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001327 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001328 */
1329message KernelWakeupReported {
1330 // Name of the kernel wakeup reason (or abort).
1331 optional string wakeup_reason_name = 1;
1332
1333 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001334 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001335}
1336
1337/**
Bookatzda1798c2018-12-13 14:16:00 -08001338 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001339 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001340 *
1341 * Logged from:
1342 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1343 */
1344message WifiEnabledStateChanged {
1345 enum State {
1346 OFF = 0;
1347 ON = 1;
1348 }
1349 optional State state = 1;
1350}
1351
1352/**
tsaichristinececebdc2020-02-04 14:05:56 -08001353 * This atom is deprecated starting in R.
1354 *
Bookatzda1798c2018-12-13 14:16:00 -08001355 * 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 -08001356 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1357 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001358 *
1359 * Logged from:
1360 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1361 */
1362message WifiRunningStateChanged {
1363 repeated AttributionNode attribution_node = 1;
1364
1365 enum State {
1366 OFF = 0;
1367 ON = 1;
1368 }
1369 optional State state = 2;
1370}
1371
1372/**
Bookatze5885242017-10-24 20:10:31 -07001373 * Logs wifi locks held by an app.
1374 *
1375 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001376 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001377 */
1378message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001379 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001380
1381 enum State {
1382 OFF = 0;
1383 ON = 1;
1384 }
1385 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001386
1387 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1388 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001389}
1390
1391/**
1392 * Logs wifi signal strength changes.
1393 *
1394 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001395 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001396 */
1397message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001398 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1399 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001400}
1401
1402/**
1403 * Logs wifi scans performed by an app.
1404 *
1405 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001406 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001407 */
1408message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001409 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001410
1411 enum State {
1412 OFF = 0;
1413 ON = 1;
1414 }
1415 optional State state = 2;
1416}
1417
1418/**
Tej Singh4503e102018-01-04 14:35:01 -08001419 * Logs wifi multicast locks held by an app
1420 *
1421 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001422 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001423 */
1424message WifiMulticastLockStateChanged {
1425 repeated AttributionNode attribution_node = 1;
1426
1427 enum State {
1428 OFF = 0;
1429 ON = 1;
1430 }
1431 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001432
1433 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001434}
1435
1436/**
Tej Singh1ea42892018-01-19 09:27:00 -08001437 * Logs shutdown reason and duration on next boot.
1438 *
1439 * Logged from:
1440 * frameworks/base/core/java/com/android/server/BootReceiver.java
1441 */
1442message ShutdownSequenceReported {
1443 // True if shutdown is for a reboot. Default: false if we do not know.
1444 optional bool reboot = 1;
1445
1446 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1447 optional string reason = 2;
1448
1449 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1450 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001451 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001452
1453 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001454 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001455}
1456
Tej Singh6483ea42018-01-25 17:45:49 -08001457
1458/**
1459 * Logs boot reason and duration.
1460 *
1461 * Logged from:
1462 * system/core/bootstat/bootstat.cpp
1463 */
1464message BootSequenceReported {
1465 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1466 // Default: "<EMPTY>" if not available.
1467 optional string bootloader_reason = 1;
1468
1469 // Reason for system boot. Eg. bootloader, reboot,userrequested
1470 // Default: "<EMPTY>" if not available.
1471 optional string system_reason = 2;
1472
1473 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001474 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001475
1476 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001477 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001478
1479 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001480 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001481
1482 // Time since last boot in ms. Default: 0 if not available.
1483 optional int64 time_since_last_boot = 6;
1484}
1485
Tej Singhc477d9c2018-02-05 18:31:39 -08001486
1487/**
1488 * Logs call state and disconnect cause (if applicable).
1489 *
1490 * Logged from:
1491 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1492 */
1493message CallStateChanged {
1494 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1495 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1496 optional android.telecom.CallStateEnum call_state = 1;
1497
1498 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1499 // This value is only applicable when the call_state is DISCONNECTED, and
1500 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1501 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1502 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1503
1504 // True if the call is self-managed, which are apps that use the
1505 // telecom infrastructure to make their own calls.
1506 optional bool self_managed = 3;
1507
1508 // True if call is external. External calls are calls on connected Wear
1509 // devices but show up in Telecom so the user can pull them onto the device.
1510 optional bool external_call = 4;
1511}
1512
Tej Singh1ea42892018-01-19 09:27:00 -08001513/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001514 * Logs keyguard state. The keyguard is the lock screen.
1515 *
1516 * Logged from:
1517 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1518 */
1519message KeyguardStateChanged {
1520 enum State {
1521 UNKNOWN = 0;
1522 // The keyguard is hidden when the phone is unlocked.
1523 HIDDEN = 1;
1524 // The keyguard is shown when the phone is locked (screen turns off).
1525 SHOWN= 2;
1526 // The keyguard is occluded when something is overlaying the keyguard.
1527 // Eg. Opening the camera while on the lock screen.
1528 OCCLUDED = 3;
1529 }
1530 optional State state = 1;
1531}
1532
1533/**
1534 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1535 * prompts the user to enter a password (pattern, pin, etc).
1536 *
1537 * Logged from:
1538 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1539 */
1540
1541message KeyguardBouncerStateChanged {
1542 enum State {
1543 UNKNOWN = 0;
1544 // Bouncer is hidden, either as a result of successfully entering the
1545 // password, screen timing out, or user going back to lock screen.
1546 HIDDEN = 1;
1547 // This is when the user is being prompted to enter the password.
1548 SHOWN = 2;
1549 }
1550 optional State state = 1;
1551}
1552
1553/**
1554 * Logs the result of entering a password into the keyguard bouncer.
1555 *
1556 * Logged from:
1557 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1558 */
1559message KeyguardBouncerPasswordEntered {
1560 enum BouncerResult {
1561 UNKNOWN = 0;
1562 // The password entered was incorrect.
1563 FAILURE = 1;
1564 // The password entered was correct.
1565 SUCCESS = 2;
1566 }
1567 optional BouncerResult result = 1;
1568}
1569
Tej Singha883b372018-02-15 11:30:01 -08001570/*
1571 * Logs changes to the configuration of the device. The configuration is defined
1572 * in frameworks/base/core/java/android/content/res/Configuration.java
1573 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1574 * Please go there to interpret the possible values each field can be.
1575 *
1576 * Logged from:
1577 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1578 */
1579message ResourceConfigurationChanged {
1580 // Bit mask of color capabilities of the screen.
1581 // Contains information about the color gamut and hdr mode of the screen.
1582 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001583 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001584
1585 // The target screen density being rendered to.
1586 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001587 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001588
1589 // Current user preference for the scaling factor for fonts,
1590 // relative to the base density scaling.
1591 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001592 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001593
1594 // Flag indicating whether the hard keyboard is hidden.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001596 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001597
1598 // The type of keyboard attached to the device.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1600 optional int32 keyboard = 5;
1601
1602 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1603 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001604 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001605
1606 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1607 // 0 if undefined.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1609 optional int32 mcc = 7;
1610
1611 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1612 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1613 // MNC_ZERO symbol defined in Configuration.java.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1615 optional int32 mnc = 8;
1616
1617 // The kind of navigation available on the device.
1618 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1619 optional int32 navigation = 9;
1620
1621 // Flag indicating whether the navigation is available.
1622 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001623 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001624
1625 // Overall orientation of the screen.
1626 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1627 optional int32 orientation = 11;
1628
1629 // The current height of the available screen space, in dp units.
1630 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001631 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001632
1633 // Bit mask of overall layout of the screen.
1634 // Contains information about screen size, whether the screen is wider/taller
1635 // than normal, whether the screen layout is right-tl-left or left-to-right,
1636 // and whether the screen has a rounded shape.
1637 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001638 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001639
1640 // Current width of the available screen space, in dp units.
1641 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001642 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001643
1644 // The smallest screen size an application will see in normal operation.
1645 // This is the smallest value of both screenWidthDp and screenHeightDp
1646 // in portrait and landscape.
1647 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001648 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001649
1650 // The type of touch screen attached to the device.
1651 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1652 optional int32 touchscreen = 16;
1653
1654 // Bit mask of the ui mode.
1655 // Contains information about the overall ui mode of the device.
1656 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1657 // Also contains information about whether the device is in night mode.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001659 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001660}
1661
Tej Singheee317b2018-03-07 19:28:05 -08001662
1663/**
1664 * Logs changes in the connection state of the mobile radio.
1665 *
1666 * Logged from:
1667 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1668 */
1669message MobileConnectionStateChanged {
1670 // States are from the state machine DataConnection.java.
1671 enum State {
1672 UNKNOWN = 0;
1673 // The connection is inactive, or disconnected.
1674 INACTIVE = 1;
1675 // The connection is being activated, or connecting.
1676 ACTIVATING = 2;
1677 // The connection is active, or connected.
1678 ACTIVE = 3;
1679 // The connection is disconnecting.
1680 DISCONNECTING = 4;
1681 // The connection is disconnecting after creating a connection.
1682 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1683 }
1684 optional State state = 1;
1685 // For multi-sim phones, this distinguishes between the sim cards.
1686 optional int32 sim_slot_index = 2;
1687 // Used to identify the connection. Starts at 0 and increments by 1 for
1688 // every new network created. Resets whenever the device reboots.
1689 optional int32 data_connection_id = 3;
1690 // A bitmask for the capabilities of this connection.
1691 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1692 // Default value (if we have no information): 0
1693 optional int64 capabilities = 4;
1694 // If this connection has internet.
1695 // This just checks if the DEFAULT bit of capabilities is set.
1696 optional bool has_internet = 5;
1697}
1698
1699/**
1700 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1701 *
1702 * Logged from:
1703 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1704 */
1705message MobileRadioTechnologyChanged {
1706 optional android.telephony.NetworkTypeEnum state = 1;
1707 // For multi-sim phones, this distinguishes between the sim cards.
1708 optional int32 sim_slot_index = 2;
1709}
1710
Andrew Chantb56388b2018-03-22 21:07:33 -07001711/**
1712 * Logs the VID and PID of any connected USB devices.
1713 *
1714 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1715 *
1716 * Logged by Vendor.
1717 */
1718message UsbDeviceAttached {
1719 optional int32 vid = 1;
1720 optional int32 pid = 2;
1721 optional bool has_audio = 3;
1722 optional bool has_hid = 4;
1723 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001724 enum State {
1725 STATE_DISCONNECTED = 0;
1726 STATE_CONNECTED = 1;
1727 }
1728 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001729 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001730}
1731
Tej Singheee317b2018-03-07 19:28:05 -08001732
Tej Singhdd7bd352018-02-09 19:33:15 -08001733/**
Tej Singh5d991e12018-03-09 19:48:11 -08001734 * Logs when Bluetooth is enabled and disabled.
1735 *
1736 * Logged from:
1737 * services/core/java/com/android/server/BluetoothManagerService.java
1738 */
1739message BluetoothEnabledStateChanged {
1740 repeated AttributionNode attribution_node = 1;
1741 // Whether or not bluetooth is enabled on the device.
1742 enum State {
1743 UNKNOWN = 0;
1744 ENABLED = 1;
1745 DISABLED = 2;
1746 }
1747 optional State state = 2;
1748 // The reason for being enabled/disabled.
1749 // Eg. Airplane mode, crash, application request.
1750 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1751 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001752 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001753}
1754
1755/**
Jack Hed9837c82019-01-09 01:19:13 -08001756 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001757 *
1758 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001759 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1760 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001761 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001762 */
1763message BluetoothConnectionStateChanged {
1764 // The state of the connection.
1765 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1766 optional android.bluetooth.ConnectionStateEnum state = 1;
1767 // An identifier that can be used to match connect and disconnect events.
1768 // Currently is last two bytes of a hash of a device level ID and
1769 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001770 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001771 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001772 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1773 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001774 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001775 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001776 // An identifier that can be used to match events for this device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001782 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001783 // An identifier that can be used to match events for this device.
1784 // The incremental identifier is locally generated and guaranteed not derived
1785 // from any globally unique hardware id.
1786 // For paired devices, it stays consistent between Bluetooth toggling for the
1787 // same remote device.
1788 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1789 // session for the same remote device.
1790 // Default: 0 if the device's metric id is unknown.
1791 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001792}
1793
1794/**
1795 * Logs when a Bluetooth device connects and disconnects over ACL
1796 *
1797 * Logged from:
1798 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1799 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001800 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001801 */
1802message BluetoothAclConnectionStateChanged {
1803 // An identifier that can be used to match events for this device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if the device identifier is not known
1809 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1810 // The state of the connection.
1811 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1812 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001813 // An identifier that can be used to match events for this device.
1814 // The incremental identifier is locally generated and guaranteed not derived
1815 // from any globally unique hardware id.
1816 // For paired devices, it stays consistent between Bluetooth toggling for the
1817 // same remote device.
1818 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1819 // session for the same remote device.
1820 // Default: 0 if the device's metric id is unknown.
1821 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001822}
1823
1824/**
1825 * Logs when a Bluetooth device connects and disconnects over SCO
1826 *
1827 * Logged from:
1828 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1829 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1830 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001831 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001832 */
1833message BluetoothScoConnectionStateChanged {
1834 // An identifier that can be used to match events for this device.
1835 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1836 // Salt: Randomly generated 256 bit value
1837 // Hash algorithm: HMAC-SHA256
1838 // Size: 32 byte
1839 // Default: null or empty if the device identifier is not known
1840 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1841 // The state of the connection.
1842 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1843 optional android.bluetooth.ConnectionStateEnum state = 2;
1844 // Codec used for this SCO connection
1845 // Default: UNKNOWN
1846 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001847 // An identifier that can be used to match events for this device.
1848 // The incremental identifier is locally generated and guaranteed not derived
1849 // from any globally unique hardware id.
1850 // For paired devices, it stays consistent between Bluetooth toggling for the
1851 // same remote device.
1852 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1853 // session for the same remote device.
1854 // Default: 0 if the device's metric id is unknown.
1855 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001856}
1857
Jack Hec27040a2019-01-09 20:54:41 -08001858/**
1859 * Logged when active device of a profile changes
1860 *
1861 * Logged from:
1862 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1863 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1864 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1865 */
1866message BluetoothActiveDeviceChanged {
1867 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1868 // From android.bluetooth.BluetoothProfile
1869 optional int32 bt_profile = 1;
1870 // An identifier that can be used to match events for this new active device.
1871 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1872 // Salt: Randomly generated 256 bit value
1873 // Hash algorithm: HMAC-SHA256
1874 // Size: 32 byte
1875 // Default: null or empty if there is no active device for this profile
1876 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001877 // An identifier that can be used to match events for this device.
1878 // The incremental identifier is locally generated and guaranteed not derived
1879 // from any globally unique hardware id.
1880 // For paired devices, it stays consistent between Bluetooth toggling for the
1881 // same remote device.
1882 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1883 // session for the same remote device.
1884 // Default: 0 if the device's metric id is unknown.
1885 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001886}
1887
Jack Heab86dbd22018-12-18 15:43:27 -08001888// Logs when there is an event affecting Bluetooth device's link layer connection.
1889// - This event is triggered when there is a related HCI command or event
1890// - Users of this metrics can deduce Bluetooth device's connection state from these events
1891// - HCI commands are logged before the command is sent, after receiving command status, and after
1892// receiving command complete
1893// - HCI events are logged when they arrive
1894//
1895// Low level log from system/bt
1896//
1897// Bluetooth classic commands:
1898// - CMD_CREATE_CONNECTION
1899// - CMD_DISCONNECT
1900// - CMD_CREATE_CONNECTION_CANCEL
1901// - CMD_ACCEPT_CONNECTION_REQUEST
1902// - CMD_REJECT_CONNECTION_REQUEST
1903// - CMD_SETUP_ESCO_CONNECTION
1904// - CMD_ACCEPT_ESCO_CONNECTION
1905// - CMD_REJECT_ESCO_CONNECTION
1906// - CMD_ENH_SETUP_ESCO_CONNECTION
1907// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1908//
1909// Bluetooth low energy commands:
1910// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1911// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1912// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1913// - CMD_BLE_CLEAR_WHITE_LIST
1914// - CMD_BLE_ADD_WHITE_LIST
1915// - CMD_BLE_REMOVE_WHITE_LIST
1916//
1917// Bluetooth classic events:
1918// - EVT_CONNECTION_COMP
1919// - EVT_CONNECTION_REQUEST
1920// - EVT_DISCONNECTION_COMP
1921// - EVT_ESCO_CONNECTION_COMP
1922// - EVT_ESCO_CONNECTION_CHANGED
1923//
1924// Bluetooth low energy meta events:
1925// - BLE_EVT_CONN_COMPLETE_EVT
1926// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1927//
1928// Next tag: 10
1929message BluetoothLinkLayerConnectionEvent {
1930 // An identifier that can be used to match events for this device.
1931 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1932 // Salt: Randomly generated 256 bit value
1933 // Hash algorithm: HMAC-SHA256
1934 // Size: 32 byte
1935 // Default: null or empty if the device identifier is not known
1936 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1937 // Connection handle of this connection if available
1938 // Range: 0x0000 - 0x0EFF (12 bits)
1939 // Default: 0xFFFF if the handle is unknown
1940 optional int32 connection_handle = 2;
1941 // Direction of the link
1942 // Default: DIRECTION_UNKNOWN
1943 optional android.bluetooth.DirectionEnum direction = 3;
1944 // Type of this link
1945 // Default: LINK_TYPE_UNKNOWN
1946 optional android.bluetooth.LinkTypeEnum type = 4;
1947
1948 // Reason metadata for this link layer connection event, rules for interpretation:
1949 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1950 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1951 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1952 // set and valid, ignore hci_ble_event
1953
1954 // HCI command associated with this event
1955 // Default: CMD_UNKNOWN
1956 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1957 // HCI event associated with this event
1958 // Default: EVT_UNKNOWN
1959 optional android.bluetooth.hci.EventEnum hci_event = 6;
1960 // HCI BLE meta event associated with this event
1961 // Default: BLE_EVT_UNKNOWN
1962 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1963 // HCI command status code if this is triggerred by hci_cmd
1964 // Default: STATUS_UNKNOWN
1965 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1966 // HCI reason code associated with this event
1967 // Default: STATUS_UNKNOWN
1968 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001969 // An identifier that can be used to match events for this device.
1970 // The incremental identifier is locally generated and guaranteed not derived
1971 // from any globally unique hardware id.
1972 // For paired devices, it stays consistent between Bluetooth toggling for the
1973 // same remote device.
1974 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1975 // session for the same remote device.
1976 // Default: 0 if the device's metric id is unknown.
1977 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001978}
1979
Howard Roe103fe22019-01-17 16:52:16 -08001980/**
1981 * Logs when a module is rolled back by Watchdog.
1982 *
1983 * Logged from: Rollback Manager
1984 */
1985message WatchdogRollbackOccurred {
1986 enum RollbackType {
1987 UNKNOWN = 0;
1988 ROLLBACK_INITIATE = 1;
1989 ROLLBACK_SUCCESS = 2;
1990 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001991 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001992 }
1993 optional RollbackType rollback_type = 1;
1994
1995 optional string package_name = 2;
1996
1997 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001998
1999 enum RollbackReasonType {
2000 REASON_UNKNOWN = 0;
2001 REASON_NATIVE_CRASH = 1;
2002 REASON_EXPLICIT_HEALTH_CHECK = 2;
2003 REASON_APP_CRASH = 3;
2004 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002005 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002006 }
2007 optional RollbackReasonType rollback_reason = 4;
2008
2009 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2010 // is initiated. Empty if the package is unknown.
2011 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002012
2013 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002014}
2015
Jack Hec27040a2019-01-09 20:54:41 -08002016/**
2017 * Logs when there is a change in Bluetooth A2DP playback state
2018 *
2019 * Logged from:
2020 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2021 */
2022message BluetoothA2dpPlaybackStateChanged {
2023 // An identifier that can be used to match events for this device.
2024 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2025 // Salt: Randomly generated 256 bit value
2026 // Hash algorithm: HMAC-SHA256
2027 // Size: 32 byte
2028 // Default: null or empty if the device identifier is not known
2029 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2030 // Current playback state
2031 // Default: PLAYBACK_STATE_UNKNOWN
2032 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2033 // Current audio coding mode
2034 // Default: AUDIO_CODING_MODE_UNKNOWN
2035 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002036 // An identifier that can be used to match events for this device.
2037 // The incremental identifier is locally generated and guaranteed not derived
2038 // from any globally unique hardware id.
2039 // For paired devices, it stays consistent between Bluetooth toggling for the
2040 // same remote device.
2041 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2042 // session for the same remote device.
2043 // Default: 0 if the device's metric id is unknown.
2044 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002045}
2046
2047/**
2048 * Logs when there is a change in A2DP codec config for a particular remote device
2049 *
2050 * Logged from:
2051 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2052 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2053 */
2054message BluetoothA2dpCodecConfigChanged {
2055 // An identifier that can be used to match events for this device.
2056 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2057 // Salt: Randomly generated 256 bit value
2058 // Hash algorithm: HMAC-SHA256
2059 // Size: 32 byte
2060 // Default: null or empty if the device identifier is not known
2061 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2062 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2063 // Default SOURCE_CODEC_TYPE_INVALID
2064 optional int32 codec_type = 2;
2065 // Codec priroity, the higher the more preferred, -1 for disabled
2066 // Default: CODEC_PRIORITY_DEFAULT
2067 optional int32 codec_priority = 3;
2068 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2069 // Default: SAMPLE_RATE_NONE
2070 optional int32 sample_rate = 4;
2071 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2072 // Default: BITS_PER_SAMPLE_NONE
2073 optional int32 bits_per_sample = 5;
2074 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2075 // Default: CHANNEL_MODE_NONE
2076 optional int32 channel_mode = 6;
2077 // Codec specific values
2078 // Default 0
2079 optional int64 codec_specific_1 = 7;
2080 optional int64 codec_specific_2 = 8;
2081 optional int64 codec_specific_3 = 9;
2082 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002083 // An identifier that can be used to match events for this device.
2084 // The incremental identifier is locally generated and guaranteed not derived
2085 // from any globally unique hardware id.
2086 // For paired devices, it stays consistent between Bluetooth toggling for the
2087 // same remote device.
2088 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2089 // session for the same remote device.
2090 // Default: 0 if the device's metric id is unknown.
2091 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002092}
2093
2094/**
2095 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2096 * Each codec's capability is logged separately due to statsd restriction
2097 *
2098 * Logged from:
2099 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2100 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2101 */
2102message BluetoothA2dpCodecCapabilityChanged {
2103 // An identifier that can be used to match events for this device.
2104 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2105 // Salt: Randomly generated 256 bit value
2106 // Hash algorithm: HMAC-SHA256
2107 // Size: 32 byte
2108 // Default: null or empty if the device identifier is not known
2109 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2110 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2111 // Default SOURCE_CODEC_TYPE_INVALID
2112 optional int32 codec_type = 2;
2113 // Codec priroity, the higher the more preferred, -1 for disabled
2114 // Default: CODEC_PRIORITY_DEFAULT
2115 optional int32 codec_priority = 3;
2116 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2117 // in BluetoothCodecConfig
2118 // Default: empty and SAMPLE_RATE_NONE for individual item
2119 optional int32 sample_rate = 4;
2120 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2121 // in BluetoothCodecConfig
2122 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2123 optional int32 bits_per_sample = 5;
2124 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2125 // BluetoothCodecConfig
2126 // Default: empty and CHANNEL_MODE_NONE for individual item
2127 optional int32 channel_mode = 6;
2128 // Codec specific values
2129 // Default 0
2130 optional int64 codec_specific_1 = 7;
2131 optional int64 codec_specific_2 = 8;
2132 optional int64 codec_specific_3 = 9;
2133 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002134 // An identifier that can be used to match events for this device.
2135 // The incremental identifier is locally generated and guaranteed not derived
2136 // from any globally unique hardware id.
2137 // For paired devices, it stays consistent between Bluetooth toggling for the
2138 // same remote device.
2139 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2140 // session for the same remote device.
2141 // Default: 0 if the device's metric id is unknown.
2142 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002143}
2144
2145/**
2146 * Logs when A2DP failed to read from PCM source.
2147 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2148 *
2149 * Logged from:
2150 * system/bt
2151 */
2152message BluetoothA2dpAudioUnderrunReported {
2153 // An identifier that can be used to match events for this device.
2154 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2155 // Salt: Randomly generated 256 bit value
2156 // Hash algorithm: HMAC-SHA256
2157 // Size: 32 byte
2158 // Default: null or empty if the device identifier is not known
2159 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2160 // Encoding interval in nanoseconds
2161 // Default: 0
2162 optional int64 encoding_interval_nanos = 2;
2163 // Number of bytes of PCM data that could not be read from the source
2164 // Default: 0
2165 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002166 // An identifier that can be used to match events for this device.
2167 // The incremental identifier is locally generated and guaranteed not derived
2168 // from any globally unique hardware id.
2169 // For paired devices, it stays consistent between Bluetooth toggling for the
2170 // same remote device.
2171 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2172 // session for the same remote device.
2173 // Default: 0 if the device's metric id is unknown.
2174 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002175}
2176
2177/**
2178 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2179 * buffer queue is full and we have to drop data
2180 *
2181 * Logged from:
2182 * system/bt
2183 */
2184message BluetoothA2dpAudioOverrunReported {
2185 // An identifier that can be used to match events for this device.
2186 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2187 // Salt: Randomly generated 256 bit value
2188 // Hash algorithm: HMAC-SHA256
2189 // Size: 32 byte
2190 // Default: null or empty if the device identifier is not known
2191 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2192 // Encoding interval in nanoseconds
2193 // Default: 0
2194 optional int64 encoding_interval_nanos = 2;
2195 // Number of buffers dropped in this event
2196 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2197 // Default: 0
2198 optional int32 num_dropped_buffers = 3;
2199 // Number of encoded buffers dropped in this event
2200 // Default 0
2201 optional int32 num_dropped_encoded_frames = 4;
2202 // Number of encoded bytes dropped in this event
2203 // Default: 0
2204 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002205 // An identifier that can be used to match events for this device.
2206 // The incremental identifier is locally generated and guaranteed not derived
2207 // from any globally unique hardware id.
2208 // For paired devices, it stays consistent between Bluetooth toggling for the
2209 // same remote device.
2210 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2211 // session for the same remote device.
2212 // Default: 0 if the device's metric id is unknown.
2213 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002214}
2215
2216/**
2217 * Logs when we receive reports regarding a device's RSSI value
2218 *
2219 * Logged from:
2220 * system/bt
2221 */
2222message BluetoothDeviceRssiReported {
2223 // An identifier that can be used to match events for this device.
2224 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2225 // Salt: Randomly generated 256 bit value
2226 // Hash algorithm: HMAC-SHA256
2227 // Size: 32 byte
2228 // Default: null or empty if the device identifier is not known
2229 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2230 // Connection handle of this connection if available
2231 // Range: 0x0000 - 0x0EFF (12 bits)
2232 // Default: 0xFFFF if the handle is unknown
2233 optional int32 connection_handle = 2;
2234 // HCI command status code if this is triggerred by hci_cmd
2235 // Default: STATUS_UNKNOWN
2236 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2237 // BR/EDR
2238 // Range: -128 ≤ N ≤ 127 (signed integer)
2239 // Units: dB
2240 // LE:
2241 // Range: -127 to 20, 127 (signed integer)
2242 // Units: dBm
2243 // Invalid when an out of range value is reported
2244 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002245 // An identifier that can be used to match events for this device.
2246 // The incremental identifier is locally generated and guaranteed not derived
2247 // from any globally unique hardware id.
2248 // For paired devices, it stays consistent between Bluetooth toggling for the
2249 // same remote device.
2250 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2251 // session for the same remote device.
2252 // Default: 0 if the device's metric id is unknown.
2253 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002254}
2255
2256/**
2257 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2258 *
2259 * Logged from:
2260 * system/bt
2261 */
2262message BluetoothDeviceFailedContactCounterReported {
2263 // An identifier that can be used to match events for this device.
2264 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2265 // Salt: Randomly generated 256 bit value
2266 // Hash algorithm: HMAC-SHA256
2267 // Size: 32 byte
2268 // Default: null or empty if the device identifier is not known
2269 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2270 // Connection handle of this connection if available
2271 // Range: 0x0000 - 0x0EFF (12 bits)
2272 // Default: 0xFFFF if the handle is unknown
2273 optional int32 connection_handle = 2;
2274 // HCI command status code if this is triggerred by hci_cmd
2275 // Default: STATUS_UNKNOWN
2276 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2277 // Number of consecutive failed contacts for a connection corresponding to the Handle
2278 // Range: uint16_t, 0-0xFFFF
2279 // Default: 0xFFFFF
2280 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002281 // An identifier that can be used to match events for this device.
2282 // The incremental identifier is locally generated and guaranteed not derived
2283 // from any globally unique hardware id.
2284 // For paired devices, it stays consistent between Bluetooth toggling for the
2285 // same remote device.
2286 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2287 // session for the same remote device.
2288 // Default: 0 if the device's metric id is unknown.
2289 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002290}
2291
2292/**
2293 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2294 *
2295 * Logged from:
2296 * system/bt
2297 */
2298message BluetoothDeviceTxPowerLevelReported {
2299 // An identifier that can be used to match events for this device.
2300 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2301 // Salt: Randomly generated 256 bit value
2302 // Hash algorithm: HMAC-SHA256
2303 // Size: 32 byte
2304 // Default: null or empty if the device identifier is not known
2305 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2306 // Connection handle of this connection if available
2307 // Range: 0x0000 - 0x0EFF (12 bits)
2308 // Default: 0xFFFF if the handle is unknown
2309 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002310 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002311 // Default: STATUS_UNKNOWN
2312 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2313 // Range: -30 ≤ N ≤ 20
2314 // Units: dBm
2315 // Invalid when an out of range value is reported
2316 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002317 // An identifier that can be used to match events for this device.
2318 // The incremental identifier is locally generated and guaranteed not derived
2319 // from any globally unique hardware id.
2320 // For paired devices, it stays consistent between Bluetooth toggling for the
2321 // same remote device.
2322 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2323 // session for the same remote device.
2324 // Default: 0 if the device's metric id is unknown.
2325 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002326}
Jack Heab86dbd22018-12-18 15:43:27 -08002327
Tej Singh5d991e12018-03-09 19:48:11 -08002328/**
Jack He1021a612019-01-20 21:22:46 -08002329 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2330 * receiving an HCI command from the host
2331 *
2332 * Logged from: system/bt
2333 */
2334message BluetoothHciTimeoutReported {
2335 // HCI command associated with this event
2336 // Default: CMD_UNKNOWN
2337 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2338}
2339
2340/**
2341 * Logs when we receive Bluetooth Link Quality Report event from the controller
2342 * See Android Bluetooth HCI specification for more details
2343 *
2344 * Note: all count and bytes field are counted since last event
2345 *
2346 * Logged from: system/bt
2347 */
2348message BluetoothQualityReportReported {
2349 // Quality report ID
2350 // Original type: uint8_t
2351 // Default: BQR_ID_UNKNOWN
2352 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2353 // Packet type of the connection
2354 // Original type: uint8_t
2355 // Default: BQR_PACKET_TYPE_UNKNOWN
2356 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2357 // Connection handle of the connection
2358 // Original type: uint16_t
2359 optional int32 connection_handle = 3;
2360 // Performing Role for the connection
2361 // Original type: uint8_t
2362 optional int32 connection_role = 4;
2363 // Current Transmit Power Level for the connection. This value is the same as the controller's
2364 // response to the HCI_Read_Transmit_Power_Level HCI command
2365 // Original type: uint8_t
2366 optional int32 tx_power_level = 5;
2367 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2368 // absolute receiver signal strength value
2369 // Original type: int8_t
2370 optional int32 rssi = 6;
2371 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2372 // channels used by the link currently
2373 // Original type: uint8_t
2374 optional int32 snr = 7;
2375 // Indicates the number of unused channels in AFH_channel_map
2376 // Original type: uint8_t
2377 optional int32 unused_afh_channel_count = 8;
2378 // Indicates the number of the channels which are interfered and quality is bad but are still
2379 // selected for AFH
2380 // Original type: uint8_t
2381 optional int32 afh_select_unideal_channel_count = 9;
2382 // Current Link Supervision Timeout Setting
2383 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2384 // Original type: uint16_t
2385 optional int32 lsto = 10;
2386 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2387 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2388 // 0x01 (Piconet Clock)
2389 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2390 // Original type: uint32_t
2391 optional int64 connection_piconet_clock = 11;
2392 // The count of retransmission
2393 // Original type: uint32_t
2394 optional int64 retransmission_count = 12;
2395 // The count of no RX
2396 // Original type: uint32_t
2397 optional int64 no_rx_count = 13;
2398 // The count of NAK (Negative Acknowledge)
2399 // Original type: uint32_t
2400 optional int64 nak_count = 14;
2401 // Controller timestamp of last TX ACK
2402 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2403 // Original type: uint32_t
2404 optional int64 last_tx_ack_timestamp = 15;
2405 // The count of Flow-off (STOP)
2406 // Original type: uint32_t
2407 optional int64 flow_off_count = 16;
2408 // Controller timestamp of last Flow-on (GO)
2409 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2410 // Original type: uint32_t
2411 optional int64 last_flow_on_timestamp = 17;
2412 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2413 // Original type: uint32_t
2414 optional int64 buffer_overflow_bytes = 18;
2415 // Buffer underflow count (in byte) since last event
2416 // Original type: uint32_t
2417 optional int64 buffer_underflow_bytes = 19;
2418}
2419
2420/**
2421 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2422 *
2423 * Notes:
2424 * - Each event can be partially filled as we might learn different pieces of device
2425 * information at different time
2426 * - Multiple device info events can be combined to give more complete picture
2427 * - When multiple device info events tries to describe the same information, the
2428 * later one wins
2429 *
2430 * Logged from:
2431 * packages/apps/Bluetooth
2432 */
Jack Heaea26982019-04-04 11:19:48 -07002433message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002434 // An identifier that can be used to match events for this device.
2435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2436 // Salt: Randomly generated 256 bit value
2437 // Hash algorithm: HMAC-SHA256
2438 // Size: 32 byte
2439 // Default: null or empty if the device identifier is not known
2440 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2441 // Where is this device info obtained from
2442 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2443 // Name of the data source
2444 // For EXTERNAL: package name of the data source
2445 // For INTERNAL: null for general case, component name otherwise
2446 optional string source_name = 3;
2447 // Name of the manufacturer of this device
2448 optional string manufacturer = 4;
2449 // Model of this device
2450 optional string model = 5;
2451 // Hardware version of this device
2452 optional string hardware_version = 6;
2453 // Software version of this device
2454 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002455 // An identifier that can be used to match events for this device.
2456 // The incremental identifier is locally generated and guaranteed not derived
2457 // from any globally unique hardware id.
2458 // For paired devices, it stays consistent between Bluetooth toggling for the
2459 // same remote device.
2460 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2461 // session for the same remote device.
2462 // Default: 0 if the device's metric id is unknown.
2463 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002464}
2465
2466/**
2467 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2468 * device, as documented by the Bluetooth Core HCI specification
2469 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2470 * Vol 2, Part E, Page 1118
2471 *
2472 * Logged from:
2473 * system/bt
2474 */
2475message BluetoothRemoteVersionInfoReported {
2476 // Connection handle of the connection
2477 // Original type: uint16_t
2478 optional int32 connection_handle = 1;
2479 // HCI command status code
2480 // Default: STATUS_UNKNOWN
2481 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2482 // 1 byte Version of current LMP in the remote controller
2483 optional int32 lmp_version = 3;
2484 // 2 bytes LMP manufacturer code of the remote controller
2485 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2486 optional int32 lmp_manufacturer_code = 4;
2487 // 4 bytes subversion of the LMP in the remote controller
2488 optional int32 lmp_subversion = 5;
2489}
2490
2491/**
2492 * Logs when certain Bluetooth SDP attributes are discovered
2493 * Constant definitions are from:
2494 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2495 *
2496 * Current logged attributes:
2497 * - BluetoothProfileDescriptorList
2498 * - Supported Features Bitmask
2499 *
2500 * Logged from:
2501 * system/bt
2502 */
2503message BluetoothSdpAttributeReported {
2504 // An identifier that can be used to match events for this device.
2505 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2506 // Salt: Randomly generated 256 bit value
2507 // Hash algorithm: HMAC-SHA256
2508 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2509 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2510 // Original type: uint16_t
2511 optional int32 protocol_uuid = 2;
2512 // Short form UUIDs used to identify Bluetooth SDP attribute types
2513 // Original type: uint16_t
2514 optional int32 attribute_id = 3;
2515 // Attribute value for the particular attribute
2516 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002517 // An identifier that can be used to match events for this device.
2518 // The incremental identifier is locally generated and guaranteed not derived
2519 // from any globally unique hardware id.
2520 // For paired devices, it stays consistent between Bluetooth toggling for the
2521 // same remote device.
2522 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2523 // session for the same remote device.
2524 // Default: 0 if the device's metric id is unknown.
2525 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002526}
2527
2528/**
2529 * Logs when bond state of a Bluetooth device changes
2530 *
2531 * Logged from:
2532 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2533 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2534 */
2535message BluetoothBondStateChanged {
2536 // An identifier that can be used to match events for this device.
2537 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2538 // Salt: Randomly generated 256 bit value
2539 // Hash algorithm: HMAC-SHA256
2540 // Size: 32 byte
2541 // Default: null or empty if the device identifier is not known
2542 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2543 // Preferred transport type to remote dual mode device
2544 // Default: TRANSPORT_AUTO means no preference
2545 optional android.bluetooth.TransportTypeEnum transport = 2;
2546 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2547 // Default: UNKNOWN
2548 optional android.bluetooth.DeviceTypeEnum type = 3;
2549 // Current bond state (NONE, BONDING, BONDED)
2550 // Default: BOND_STATE_UNKNOWN
2551 optional android.bluetooth.BondStateEnum bond_state = 4;
2552 // Bonding sub state
2553 // Default: BOND_SUB_STATE_UNKNOWN
2554 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2555 // Unbond Reason
2556 // Default: UNBOND_REASON_UNKNOWN
2557 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002558 // An identifier that can be used to match events for this device.
2559 // The incremental identifier is locally generated and guaranteed not derived
2560 // from any globally unique hardware id.
2561 // For paired devices, it stays consistent between Bluetooth toggling for the
2562 // same remote device.
2563 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2564 // session for the same remote device.
2565 // Default: 0 if the device's metric id is unknown.
2566 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002567}
2568
2569/**
2570 * Logs there is an event related Bluetooth classic pairing
2571 *
2572 * Logged from:
2573 * system/bt
2574 */
2575message BluetoothClassicPairingEventReported {
2576 // An identifier that can be used to match events for this device.
2577 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2578 // Salt: Randomly generated 256 bit value
2579 // Hash algorithm: HMAC-SHA256
2580 // Size: 32 byte
2581 // Default: null or empty if the device identifier is not known
2582 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2583 // Connection handle of this connection if available
2584 // Range: 0x0000 - 0x0EFF (12 bits)
2585 // Default: 0xFFFF if the handle is unknown
2586 optional int32 connection_handle = 2;
2587 // HCI command associated with this event
2588 // Default: CMD_UNKNOWN
2589 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2590 // HCI event associated with this event
2591 // Default: EVT_UNKNOWN
2592 optional android.bluetooth.hci.EventEnum hci_event = 4;
2593 // HCI command status code if this is triggerred by hci_cmd
2594 // Default: STATUS_UNKNOWN
2595 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2596 // HCI reason code associated with this event
2597 // Default: STATUS_UNKNOWN
2598 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002599 // A status value related to this specific event
2600 // Default: 0
2601 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002602 // An identifier that can be used to match events for this device.
2603 // The incremental identifier is locally generated and guaranteed not derived
2604 // from any globally unique hardware id.
2605 // For paired devices, it stays consistent between Bluetooth toggling for the
2606 // same remote device.
2607 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2608 // session for the same remote device.
2609 // Default: 0 if the device's metric id is unknown.
2610 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002611}
2612
2613/**
2614 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2615 *
2616 * Logged from:
2617 * system/bt
2618 */
2619message BluetoothSmpPairingEventReported {
2620 // An identifier that can be used to match events for this device.
2621 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2622 // Salt: Randomly generated 256 bit value
2623 // Hash algorithm: HMAC-SHA256
2624 // Size: 32 byte
2625 // Default: null or empty if the device identifier is not known
2626 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2627 // SMP command sent or received over L2CAP
2628 // Default: CMD_UNKNOWN
2629 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2630 // Whether this command is sent or received
2631 // Default: DIRECTION_UNKNOWN
2632 optional android.bluetooth.DirectionEnum direction = 3;
2633 // SMP failure reason code
2634 // Default: PAIRING_FAIL_REASON_DEFAULT
2635 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002636 // An identifier that can be used to match events for this device.
2637 // The incremental identifier is locally generated and guaranteed not derived
2638 // from any globally unique hardware id.
2639 // For paired devices, it stays consistent between Bluetooth toggling for the
2640 // same remote device.
2641 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2642 // session for the same remote device.
2643 // Default: 0 if the device's metric id is unknown.
2644 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002645}
2646
2647/**
Jack He815cdba2019-01-30 17:24:55 -08002648 * Logs when a Bluetooth socket’s connection state changed
2649 *
2650 * Logged from:
2651 * system/bt
2652 */
2653message BluetoothSocketConnectionStateChanged {
2654 // An identifier that can be used to match events for this device.
2655 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2656 // Salt: Randomly generated 256 bit value
2657 // Hash algorithm: HMAC-SHA256
2658 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002659 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002660 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002661 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002662 // Default 0 when unknown or don't care
2663 optional int32 port = 2;
2664 // Socket type as mentioned in
2665 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2666 // Default: SOCKET_TYPE_UNKNOWN
2667 optional android.bluetooth.SocketTypeEnum type = 3;
2668 // Socket connection state
2669 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2670 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2671 // Number of bytes sent to remote device during this connection
2672 optional int64 tx_bytes = 5;
2673 // Number of bytes received from remote device during this connection
2674 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002675 // Socket owner's UID
2676 optional int32 uid = 7 [(is_uid) = true];
2677 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2678 // |port| must be spawned by |server_port|
2679 // Default 0 when unknown or don't care
2680 optional int32 server_port = 8;
2681 // Whether this is a server listener socket
2682 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002683 // An identifier that can be used to match events for this device.
2684 // The incremental identifier is locally generated and guaranteed not derived
2685 // from any globally unique hardware id.
2686 // For paired devices, it stays consistent between Bluetooth toggling for the
2687 // same remote device.
2688 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2689 // session for the same remote device.
2690 // Default: 0 if the device's metric id is unknown.
2691 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002692}
2693
2694/**
Jack He71426802019-04-02 13:32:52 -07002695 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2696 *
2697 * Logged from:
2698 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2699 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2700 *
2701 */
2702message BluetoothClassOfDeviceReported {
2703 // An identifier that can be used to match events for this device.
2704 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2705 // Salt: Randomly generated 256 bit value
2706 // Hash algorithm: HMAC-SHA256
2707 // Size: 32 byte
2708 // Default: null or empty if this is a server listener socket
2709 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2710 // Class of Device (CoD) value including both Major, Minor device class and service class
2711 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2712 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2713 // Default: 0
2714 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002715 // An identifier that can be used to match events for this device.
2716 // The incremental identifier is locally generated and guaranteed not derived
2717 // from any globally unique hardware id.
2718 // For paired devices, it stays consistent between Bluetooth toggling for the
2719 // same remote device.
2720 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2721 // session for the same remote device.
2722 // Default: 0 if the device's metric id is unknown.
2723 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002724}
2725
2726/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002727 * Logs when something is plugged into or removed from the USB-C connector.
2728 *
2729 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002730 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002731 */
2732message UsbConnectorStateChanged {
2733 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002734 STATE_DISCONNECTED = 0;
2735 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002736 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002737 optional State state = 1
2738 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2739 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002740 // Last active session in ms.
2741 // 0 when the port is in connected state.
2742 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002743}
2744
2745/**
2746 * Logs the reported speaker impedance.
2747 *
2748 * Logged from:
2749 * Vendor audio implementation.
2750 */
2751message SpeakerImpedanceReported {
2752 optional int32 speaker_location = 1;
2753 optional int32 impedance = 2;
2754}
2755
2756/**
2757 * Logs the report of a failed hardware.
2758 *
2759 * Logged from:
2760 * Vendor HALs.
2761 *
2762 */
2763message HardwareFailed {
2764 enum HardwareType {
2765 HARDWARE_FAILED_UNKNOWN = 0;
2766 HARDWARE_FAILED_MICROPHONE = 1;
2767 HARDWARE_FAILED_CODEC = 2;
2768 HARDWARE_FAILED_SPEAKER = 3;
2769 HARDWARE_FAILED_FINGERPRINT = 4;
2770 }
2771 optional HardwareType hardware_type = 1;
2772
Maggie White6dcd8572019-01-31 14:11:50 -08002773 /**
2774 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002775 * the same hardware_type. The specific locations are vendor defined integers,
2776 * referring to board-specific numbering schemes.
2777 */
2778 optional int32 hardware_location = 2;
2779
Maggie White6dcd8572019-01-31 14:11:50 -08002780 /**
2781 * failure_code is specific to the HardwareType of the failed hardware.
2782 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002783 */
Maggie White6dcd8572019-01-31 14:11:50 -08002784 enum HardwareErrorCode {
2785 UNKNOWN = 0;
2786 COMPLETE = 1;
2787 SPEAKER_HIGH_Z = 2;
2788 SPEAKER_SHORT = 3;
2789 FINGERPRINT_SENSOR_BROKEN = 4;
2790 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002791 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002792 }
2793 optional int32 failure_code = 3;
2794}
2795
2796/**
2797 * Log an event when the device has been physically dropped.
2798 * Reported from the /vendor partition.
2799 */
2800message PhysicalDropDetected {
2801 // Confidence that the event was actually a drop, 0 -> 100
2802 optional int32 confidence_pctg = 1;
2803 // Peak acceleration of the drop, in 1/1000s of a g.
2804 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002805 // Duration of freefall in ms
2806 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002807}
2808
2809/**
2810 * Log bucketed battery charge cycles.
2811 *
2812 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002813 * a given charge point. For example, if 10 cycle buckets are
2814 * initialized, bucket 1 is the lowest 1/10th of the battery,
2815 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002816 *
2817 * Logged from:
2818 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2819 */
2820message ChargeCyclesReported {
2821 optional int32 cycle_bucket_1 = 1;
2822 optional int32 cycle_bucket_2 = 2;
2823 optional int32 cycle_bucket_3 = 3;
2824 optional int32 cycle_bucket_4 = 4;
2825 optional int32 cycle_bucket_5 = 5;
2826 optional int32 cycle_bucket_6 = 6;
2827 optional int32 cycle_bucket_7 = 7;
2828 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002829 optional int32 cycle_bucket_9 = 9;
2830 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002831}
2832
2833/**
Howard Roa46b6582018-09-18 16:45:02 -07002834 * Log battery health snapshot.
2835 *
2836 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2837 * are snapshotted periodically over 24hrs.
2838 */
2839message BatteryHealthSnapshot {
2840 enum BatterySnapshotType {
2841 UNKNOWN = 0;
2842 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2843 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2844 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2845 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2846 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2847 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2848 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2849 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2850 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2851 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2852 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2853 }
2854 optional BatterySnapshotType type = 1;
2855 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002856 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002857 // Voltage Battery Voltage, in microVolts.
2858 optional int32 voltage_micro_volt = 3;
2859 // Current Battery current, in microAmps.
2860 optional int32 current_micro_amps = 4;
2861 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2862 optional int32 open_circuit_micro_volt = 5;
2863 // Resistance Battery Resistance, in microOhms.
2864 optional int32 resistance_micro_ohm = 6;
2865 // Level Battery Level, as % of full.
2866 optional int32 level_percent = 7;
2867}
2868
2869/**
2870 * Log slow I/O operations on the primary storage.
2871 */
2872message SlowIo {
2873 // Classifications of IO Operations.
2874 enum IoOperation {
2875 UNKNOWN = 0;
2876 READ = 1;
2877 WRITE = 2;
2878 UNMAP = 3;
2879 SYNC = 4;
2880 }
2881 optional IoOperation operation = 1;
2882
2883 // The number of slow IO operations of this type over 24 hours.
2884 optional int32 count = 2;
2885}
2886
2887/**
2888 * Log battery caused shutdown with the last recorded voltage.
2889 */
2890message BatteryCausedShutdown {
2891 // The last recorded battery voltage prior to shutdown.
2892 optional int32 last_recorded_micro_volt = 1;
2893}
2894
2895/**
Tej Singha72344992019-04-17 18:55:08 -07002896 * Logs when ThermalService receives throttling events.
2897 *
2898 * Logged from:
2899 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2900 */
2901message ThermalThrottlingSeverityStateChanged {
2902 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2903 optional android.os.TemperatureTypeEnum sensor_type = 1;
2904
2905 // The name of the temperature source. Eg. CPU0
2906 optional string sensor_name = 2;
2907
2908 // Temperature in tenths of a degree C.
2909 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2910 optional int32 temperature_deci_celsius = 3;
2911
2912 // Relative severity of the throttling, see enum definition.
2913 optional android.os.ThrottlingSeverityEnum severity = 4;
2914}
2915
2916/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002917 * Logs the duration of a davey (jank of >=700ms) when it occurs
2918 *
2919 * Logged from:
2920 * frameworks/base/libs/hwui/JankTracker.cpp
2921 */
2922message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002923 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002924 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002925
Tej Singhbb8554a2018-01-26 11:59:14 -08002926 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002927 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002928}
2929
2930/**
Bookatze5885242017-10-24 20:10:31 -07002931 * Logs phone signal strength changes.
2932 *
2933 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002934 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002935 */
2936message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002937 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2938 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002939}
2940
Yangster4ccebea2018-10-09 17:09:02 -07002941
2942/**
2943 * Logs when the phone state, sim state or signal strength changes
2944 *
2945 * Logged from:
2946 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2947 */
2948message PhoneServiceStateChanged {
2949 optional android.telephony.ServiceStateEnum state = 1;
2950 optional android.telephony.SimStateEnum sim_state = 2;
2951 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2952}
2953
2954/**
2955 * Logs when the phone becomes on or off.
2956 *
2957 * Logged from:
2958 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2959 */
2960message PhoneStateChanged {
2961 enum State {
2962 OFF = 0;
2963 ON = 1;
2964 }
2965 optional State state = 1;
2966}
2967
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002968message BackGesture {
2969 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002970 DEFAULT_BACK_TYPE = 0;
2971 COMPLETED = 1;
2972 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2973 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2974 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2975 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2976 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2977 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2978 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002979 }
2980 optional BackType type = 1;
2981
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002982 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2983 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2984 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2985 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2986 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2987 optional int32 left_boundary = 8; // left edge width + left inset
2988 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2989
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002990 enum WindowHorizontalLocation {
2991 DEFAULT_LOCATION = 0;
2992 LEFT = 1;
2993 RIGHT = 2;
2994 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002995 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002996}
2997
2998message ExclusionRectStateChanged {
2999 optional string component_name = 1; // if not available, simply packageName
3000 optional int32 requested_height = 2; // px
3001 optional int32 rejected_height = 3; // px
3002
3003 enum WindowHorizontalLocation {
3004 DEFAULT_LOCATION = 0;
3005 LEFT = 1;
3006 RIGHT = 2;
3007 }
3008 optional WindowHorizontalLocation x_location = 4;
3009 optional bool landscape = 5;
3010 optional bool splitscreen = 6;
3011 optional int32 duration_millis = 7;
3012}
3013
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003014/**
3015 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3016 *
3017 * Logged from:
3018 * packages/apps/Launcher3
3019 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003020message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003021 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003022 optional android.stats.launcher.LauncherState src_state = 2;
3023 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003024 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3025 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3026
3027 // The event id (e.g., app launch, drag and drop, long press)
3028 optional int32 event_id = 6;
3029 // The event's source or target id (e.g., icon, task, button)
3030 optional int32 target_id = 7;
3031 // If the target needs to be tracked, use this id field
3032 optional int32 instance_id = 8;
3033 optional int32 uid = 9 [(is_uid) = true];
3034 optional string package_name = 10;
3035 optional string component_name = 11;
3036
3037 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003038 optional int32 grid_x = 12 [default = -1];
3039 optional int32 grid_y = 13 [default = -1];
3040 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003041
3042 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003043 optional int32 grid_x_parent = 15 [default = -1];
3044 optional int32 grid_y_parent = 16 [default = -1];
3045 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003046
3047 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3048 optional int32 hierarchy = 18;
3049
3050 optional bool is_work_profile = 19;
3051
3052 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003053 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003054
3055 // e.g., folderLabelState can be captured in the following two fields
3056 optional int32 from_state = 21;
3057 optional int32 to_state = 22;
3058
3059 // e.g., autofilled or suggested texts that are not user entered
3060 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003061
3062 // e.g., number of contents inside a container (e.g., icons inside a folder)
3063 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003064}
3065
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003066/**
3067 * Used for snapshot of the HomeScreen UI elements
3068 *
3069 * Logged from:
3070 * packages/apps/Launcher3
3071 */
3072message LauncherStaticLayout {
3073 // The event id (e.g., snapshot, drag and drop)
3074 optional int32 event_id = 1;
3075 // The event's source or target id (e.g., icon, shortcut, widget)
3076 optional int32 target_id = 2;
3077 // If the target needs to be tracked, use this id field
3078 optional int32 instance_id = 3;
3079 optional int32 uid = 4 [(is_uid) = true];
3080 optional string package_name = 5;
3081 optional string component_name = 6;
3082
3083 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003084 optional int32 grid_x = 7 [default = -1];
3085 optional int32 grid_y = 8 [default = -1];
3086 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003087
3088 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003089 // e.g., when used with widgets target, use these values for (span_x, span_y)
3090 optional int32 grid_x_parent = 10 [default = -1];
3091 optional int32 grid_y_parent = 11 [default = -1];
3092 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003093
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003094 // UNKNOWN = 0
3095 // HOTSEAT = 1
3096 // WORKSPACE = 2
3097 // FOLDER_HOTSEAT = 3
3098 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003099 optional int32 hierarchy = 13;
3100
3101 optional bool is_work_profile = 14;
3102
3103 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3104 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003105
3106 // e.g., number of icons inside a folder
3107 optional int32 cardinality = 16;
3108
3109 // e.g., (x, y) span of the widget inside homescreen grid system
3110 optional int32 span_x = 17 [default = 1];
3111 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003112}
3113
3114/**
3115 * Logs when Wallpaper or ThemePicker UI has changed.
3116 *
3117 * Logged from:
3118 * packages/apps/ThemePicker
3119 * packages/apps/WallpaperPicker2
3120 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003121message StyleUIChanged {
3122 optional android.stats.style.Action action = 1;
3123 optional int32 color_package_hash = 2;
3124 optional int32 font_package_hash = 3;
3125 optional int32 shape_package_hash = 4;
3126 optional int32 clock_package_hash = 5;
3127 optional int32 launcher_grid = 6;
3128 optional int32 wallpaper_category_hash = 7;
3129 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003130 optional int32 color_preference = 9;
3131 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003132}
3133
David Chenc28b2bb2017-10-24 12:52:52 -07003134/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003135 * Logs when Settings UI has changed.
3136 *
3137 * Logged from:
3138 * packages/apps/Settings
3139 */
3140message SettingsUIChanged {
3141 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003142 * Where this SettingsUIChange event comes from. For example, if
3143 * it's a PAGE_VISIBLE event, where the page is opened from.
3144 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003145 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003146
3147 /**
3148 * What the UI action is.
3149 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003150 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003151
3152 /**
3153 * Where the action is happening
3154 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003155 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003156
3157 /**
3158 * What preference changed in this event.
3159 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003160 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003161
3162 /**
3163 * The new value of the changed preference.
3164 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003165 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003166}
3167
3168/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003169 * Logs basic timing information about touch events.
3170 * Reported at most every 5 minutes while device is being interacted with.
3171 *
3172 * Logged from:
3173 * frameworks/native/services/inputflinger
3174 */
3175message TouchEventReported {
3176 /**
3177 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003178 * and the standard deviation of the time spent processing touchscreen events
3179 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003180 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003181 * On supported devices, the starting point is taken during the hard interrupt inside the
3182 * kernel touch driver. On all other devices, the starting point is taken inside
3183 * the kernel's input event subsystem upon receipt of the input event.
3184 * The ending point is taken inside InputDispatcher, just after the input event
3185 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003186 */
3187 // Minimum value
3188 optional float latency_min_micros = 1;
3189 // Maximum value
3190 optional float latency_max_micros = 2;
3191 // Average value
3192 optional float latency_mean_micros = 3;
3193 // Standard deviation
3194 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003195 // Number of touch events (input_event) in this report
3196 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003197}
3198
3199/**
Philip Quinn0eded622019-01-29 12:46:28 -08003200 * Logs gesture classification and timing information for touch events.
3201 *
3202 * Logged from:
3203 * frameworks/base/core/java/android/view/GestureDetector.java
3204 * frameworks/base/core/java/android/view/View.java
3205 */
3206message TouchGestureClassified {
3207 // The source of the classification (e.g. Java class name).
3208 optional string source = 1;
3209
3210 enum Classification {
3211 UNKNOWN_CLASSIFICATION = 0;
3212 SINGLE_TAP = 1;
3213 DOUBLE_TAP = 2;
3214 LONG_PRESS = 3;
3215 DEEP_PRESS = 4;
3216 SCROLL = 5;
3217 }
3218 // The classification of the gesture.
3219 optional Classification classification = 2;
3220
3221 // The interval from the start of a touch event stream until the
3222 // classification was made.
3223 optional int32 latency_millis = 3;
3224
3225 // The distance from the location of the first touch event to the
3226 // location of the touch event when the classification was made.
3227 optional float displacement_px = 4;
3228}
3229
3230/**
David Chenc28b2bb2017-10-24 12:52:52 -07003231 * Logs that a setting was updated.
3232 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003233 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003234 * The tag and is_default allow resetting of settings to default values based on the specified
3235 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3236 */
3237message SettingChanged {
3238 // The name of the setting.
3239 optional string setting = 1;
3240
3241 // The change being imposed on this setting. May represent a number, eg "3".
3242 optional string value = 2;
3243
3244 // The new value of this setting. For most settings, this is same as value. For some settings,
3245 // value is +X or -X where X represents an element in a set. For example, if the previous value
3246 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3247 // The +/- feature is currently only used for location_providers_allowed.
3248 optional string new_value = 3;
3249
3250 // The previous value of this setting.
3251 optional string prev_value = 4;
3252
3253 // The tag used with the is_default for resetting sets of settings. This is generally null.
3254 optional string tag = 5;
3255
Bookatz90867622018-01-31 15:05:57 -08003256 // True if this setting with tag should be resettable.
3257 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003258
David Chenbd789912018-03-16 17:19:55 -07003259 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003260 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003261
3262 enum ChangeReason {
3263 UPDATED = 1; // Updated can be an insertion or an update.
3264 DELETED = 2;
3265 }
3266 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003267}
Chenjie Yub3dda412017-10-24 13:41:59 -07003268
Chenjie Yu05013b32017-11-21 10:21:41 -08003269/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003270 * Logs activity going to foreground or background
3271 *
3272 * Logged from:
3273 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3274 */
3275message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003276 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003277 optional string pkg_name = 2;
3278 optional string class_name = 3;
3279
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003280 enum State {
3281 BACKGROUND = 0;
3282 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003283 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003284 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003285}
David Chenc8a43242017-10-17 16:23:28 -07003286
3287/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003288 * Logs when a volume entered low Storage state.
3289 * Logged from:
3290 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3291 */
3292message LowStorageStateChanged {
3293 // Volume that ran out of storage.
3294 optional string volume_description = 1;
3295
3296 enum State {
3297 UNKNOWN = 0;
3298 OFF = 1;
3299 ON = 2;
3300 }
3301 optional State state = 2;
3302}
3303
3304/**
3305 * Logs when an app is downgraded.
3306 * Logged from:
3307 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3308 */
3309message AppDowngraded {
3310 optional string package_name = 1;
3311 // Size of the package (all data) before being downgraded.
3312 optional int64 size_in_bytes_before = 2;
3313 // Size of the package (all data) after being downgraded.
3314 optional int64 size_in_bytes_after = 3;
3315
3316 optional bool aggressive = 4;
3317}
3318
3319/**
3320 * Logs when an app is optimized after being downgraded.
3321 * Logged from:
3322 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3323 */
3324message AppOptimizedAfterDowngraded {
3325 optional string package_name = 1;
3326}
3327
3328/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003329 * Logs whenever an app is installed on external storage.
3330 * Logged from:
3331 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3332 */
3333message AppInstallOnExternalStorageReported {
3334 // The type of external storage.
3335 optional android.stats.storage.ExternalStorageType storage_type = 1;
3336 // The name of the package that is installed on the sd card.
3337 optional string package_name = 2;
3338}
3339
3340/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003341 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003342 * Logged from:
3343 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3344 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003345message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003346 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003347
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003349
3350 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003351 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003352 optional string process_name = 3;
3353
3354 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003355 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003356
3357 optional string package_name = 5;
3358
3359 enum InstantApp {
3360 UNAVAILABLE = 0;
3361 FALSE = 1;
3362 TRUE = 2;
3363 }
3364 optional InstantApp is_instant_app = 6;
3365
3366 enum ForegroundState {
3367 UNKNOWN = 0;
3368 BACKGROUND = 1;
3369 FOREGROUND = 2;
3370 }
3371 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003372
3373 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003374}
David Chen9e3808c2017-11-20 17:25:34 -08003375
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003376/**
3377 * Logs when a WTF (What a Terrible Failure) happened.
3378 * Logged from:
3379 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3380 */
3381message WTFOccurred {
3382 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003383
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003384 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003385
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003386 // The name of the process.
3387 // system_server if it is not by an app
3388 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003389
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003390 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003391 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003392
3393 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003394}
3395
3396/**
3397 * Logs when system server reports low memory.
3398 * Logged from:
3399 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3400 */
3401message LowMemReported {
3402}
3403
3404/**
3405 * Logs when an app ANR (App Not Responding) occurs.
3406 * Logged from:
3407 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3408 */
3409message ANROccurred {
3410 optional int32 uid = 1 [(is_uid) = true];
3411
3412 optional string process_name = 2;
3413
3414 optional string short_component_name = 3;
3415
3416 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003417
3418 enum InstantApp {
3419 UNAVAILABLE = 0;
3420 FALSE = 1;
3421 TRUE = 2;
3422 }
3423 optional InstantApp is_instant_app = 5;
3424
3425 enum ForegroundState {
3426 UNKNOWN = 0;
3427 BACKGROUND = 1;
3428 FOREGROUND = 2;
3429 }
3430 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003431
3432 optional android.server.ErrorSource error_source = 7;
3433
3434 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003435}
3436
Bookatza7020bd2018-08-28 16:29:35 -07003437/**
3438 * Logs when the vibrator state changes.
3439 * Logged from:
3440 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3441 */
3442message VibratorStateChanged {
3443 repeated AttributionNode attribution_node = 1;
3444
3445 enum State {
3446 OFF = 0;
3447 ON = 1;
3448 }
3449 optional State state = 2;
3450
3451 // Duration (in milliseconds) requested to keep the vibrator on.
3452 // Only applicable for State == ON.
3453 optional int64 duration_millis = 3;
3454}
3455
David Chen0a368b22017-12-06 16:28:16 -08003456/*
3457 * Allows other apps to push events into statsd.
3458 * Logged from:
3459 * frameworks/base/core/java/android/util/StatsLog.java
3460 */
David Chen0b5c90c2018-01-25 16:51:49 -08003461message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003462 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003463 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003464
3465 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3466 optional int32 label = 2;
3467
3468 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3469 // predicates for the metrics).
3470 enum State {
3471 UNKNOWN = 0;
3472 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3473 STOP = 2;
3474 START = 3;
3475 }
3476 optional State state = 3;
3477}
3478
David Chen9e3808c2017-11-20 17:25:34 -08003479/**
Bookatz7948c872018-09-04 12:58:33 -07003480 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3481 * For example, this could be due to the user manually changing the time.
3482 *
3483 * Logged from:
3484 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3485 */
3486message WallClockTimeShifted {
3487 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3488 optional int64 wall_clock_timestamp_millis = 1;
3489}
3490
3491/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003492 * Logs when statsd detects an anomaly.
3493 *
3494 * Logged from:
3495 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3496 */
3497message AnomalyDetected {
3498 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003499 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003500
Yangster-mac94e197c2018-01-02 16:03:03 -08003501 // Id of the config whose anomaly detection alert fired.
3502 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003503
Yangster-mac94e197c2018-01-02 16:03:03 -08003504 // Id of the alert (i.e. name of the anomaly that was detected).
3505 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003506}
3507
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003508message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003509 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003510 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003511
3512 // The app package name.
3513 optional string pkg_name = 2;
3514
3515 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003516 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003517 WARM = 1;
3518 HOT = 2;
3519 COLD = 3;
3520 }
3521 // The transition type.
3522 optional TransitionType type = 3;
3523
3524 // The activity name.
3525 optional string activity_name = 4;
3526
3527 // The name of the calling app. Empty if not set.
3528 optional string calling_pkg_name = 5;
3529
3530 // Whether the app is an instant app.
3531 optional bool is_instant_app = 6;
3532
3533 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003534 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003535
Bookatz80d11a02018-01-16 10:46:35 -08003536 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003537
David Chen0b5c90c2018-01-25 16:51:49 -08003538 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003539 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003540 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003541 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003542 optional int32 bind_application_delay_millis = 11;
3543 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544
3545 // Empty if not set.
3546 optional string launch_token = 13;
3547
Calin Juravle759fbda2018-02-20 19:52:30 +00003548 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003549 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003550
3551 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003552 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003553}
3554
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003555message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003556 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003557 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003558
3559 // The app package name.
3560 optional string pkg_name = 2;
3561
3562 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003563 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003564 WARM = 1;
3565 HOT = 2;
3566 COLD = 3;
3567 }
3568 // The transition type.
3569 optional TransitionType type = 3;
3570
3571 // The activity name.
3572 optional string activity_name = 4;
3573}
3574
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003575message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003576 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003577 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003578
3579 // The app package name.
3580 optional string pkg_name = 2;
3581
3582 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003583 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584 WITH_BUNDLE = 1;
3585 WITHOUT_BUNDLE = 2;
3586 }
3587 // The transition type.
3588 optional TransitionType type = 3;
3589
3590 // The activity name.
3591 optional string activity_name = 4;
3592
3593 optional bool transition_process_running = 5;
3594
3595 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003596 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003597}
3598
Bookatz8fcd09a2017-12-18 13:01:10 -08003599/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003600 * Logs a picture-in-picture action
3601 * Logged from:
3602 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3603 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3604 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3605 */
3606message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003607 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003608 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003609
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003610 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003611
Chenjie Yu52cacc62017-12-08 18:11:45 -08003612 enum State {
3613 ENTERED = 1;
3614 EXPANDED_TO_FULL_SCREEN = 2;
3615 MINIMIZED = 3;
3616 DISMISSED = 4;
3617 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003618 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003619}
3620
3621/**
Chenjie Yue8904192017-12-08 19:12:57 -08003622 * Logs overlay action
3623 * Logged from:
3624 * services/core/java/com/android/server/wm/Session.java
3625 */
3626message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003627 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003628
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003629 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003630
3631 optional bool using_alert_window = 3;
3632
3633 enum State {
3634 ENTERED = 1;
3635 EXITED = 2;
3636 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003637 optional State state = 4
3638 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003639}
3640
Adam Bookatz38767932020-02-05 12:13:40 -08003641/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003642 * Logs foreground service starts and stops.
3643 * Note that this is not when a service starts or stops, but when it is
3644 * considered foreground.
3645 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003646 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003647 */
3648message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003649 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003650 // package_name + "/" + class_name
3651 optional string short_name = 2;
3652
3653 enum State {
3654 ENTER = 1;
3655 EXIT = 2;
3656 }
3657 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003658
3659 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3660 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3661 optional bool allow_while_in_use_permission = 4;
3662}
3663
3664/**
3665 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3666 * A foreground service session is any continuous period during which the uid holds at least one
3667 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3668 * Accesses initiated while the uid is in the TOP state are ignored.
3669 * Sessions with no attempted accesses are not logged.
3670 * Logged from
3671 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3672 */
3673message ForegroundServiceAppOpSessionEnded {
3674 optional int32 uid = 1 [(is_uid) = true];
3675
3676 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003677 // Only following four ops are logged
3678 // COARSE_LOCATION = 0
3679 // FINE_LOCATION = 1
3680 // CAMERA = 26
3681 // RECORD_AUDIO = 27
3682 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003683
3684 // The uid's permission mode for accessing the AppOp during this fgs session.
3685 enum Mode {
3686 MODE_UNKNOWN = 0;
3687 MODE_ALLOWED = 1; // Always allowed
3688 MODE_IGNORED = 2; // Denied
3689 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3690 }
3691 optional Mode app_op_mode = 3;
3692
3693 // Number of times this AppOp was requested and allowed.
3694 optional int32 count_ops_accepted = 4;
3695 // Number of times this AppOp was requested but denied.
3696 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003697}
3698
Chenjie Yue8904192017-12-08 19:12:57 -08003699/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003700 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3701 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3702 * attributed back to the parent (host) uid. One example is Chrome.
3703 *
3704 * Logged from:
3705 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3706 */
3707message IsolatedUidChanged {
3708 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003709 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003710 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003711 optional int32 parent_uid = 1;
3712
3713 optional int32 isolated_uid = 2;
3714
3715 // We expect an isolated uid to be removed before if it's used for another parent uid.
3716 enum Event {
3717 REMOVED = 0;
3718 CREATED = 1;
3719 }
3720 optional Event event = 3;
3721}
3722
3723/*
3724 * Logs the reception of an incoming network packet causing the main system to wake up for
3725 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3726 * and processed by WakeupController.cpp.
3727 */
3728message PacketWakeupOccurred {
3729 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3730 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003731 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003732 // The interface name on which the packet was received.
3733 optional string iface = 2;
3734 // The ethertype value of the packet.
3735 optional int32 ethertype = 3;
3736 // String representation of the destination MAC address of the packet.
3737 optional string destination_hardware_address = 4;
3738 // String representation of the source address of the packet if this was an IP packet.
3739 optional string source_ip = 5;
3740 // String representation of the destination address of the packet if this was an IP packet.
3741 optional string destination_ip = 6;
3742 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3743 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3744 // families.
3745 optional int32 ip_next_header = 7;
3746 // The source port if this was a TCP or UDP packet.
3747 optional int32 source_port = 8;
3748 // The destination port if this was a TCP or UDP packet.
3749 optional int32 destination_port = 9;
3750}
3751
3752/*
3753 * Logs the memory stats for an app on startup.
3754 * Logged from:
3755 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3756 */
3757message AppStartMemoryStateCaptured {
3758 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003759 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003760
3761 // The process name.
3762 optional string process_name = 2;
3763
3764 // The activity name.
3765 optional string activity_name = 3;
3766
3767 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003768 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003769
3770 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003771 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772
3773 // RSS
3774 optional int64 rss_in_bytes = 6;
3775
3776 // CACHE
3777 optional int64 cache_in_bytes = 7;
3778
3779 // SWAP
3780 optional int64 swap_in_bytes = 8;
3781}
3782
3783/*
3784 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3785 * for LMK event.
3786 * Logged from:
3787 * system/core/lmkd/lmkd.c
3788 */
3789message LmkStateChanged {
3790 enum State {
3791 UNKNOWN = 0;
3792 START = 1;
3793 STOP = 2;
3794 }
3795 optional State state = 1;
3796}
3797
3798/*
3799 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3800 * Logged from:
3801 * system/core/lmkd/lmkd.c
3802 */
3803message LmkKillOccurred {
3804 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003805 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003806
3807 // The process name.
3808 optional string process_name = 2;
3809
3810 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003811 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003812
3813 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003814 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003815
3816 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003817 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818
3819 // RSS
3820 optional int64 rss_in_bytes = 6;
3821
3822 // CACHE
3823 optional int64 cache_in_bytes = 7;
3824
3825 // SWAP
3826 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003827
3828 // The elapsed real time of start of the process.
3829 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003830
3831 // Min oom adj score considered by lmkd.
3832 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003833}
3834
Rajeev Kumar51b54602018-03-01 12:18:26 -08003835/*
3836 * Logs when the ActivityManagerService detects that an app died.
3837 *
3838 * Logged from:
3839 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3840 */
3841message AppDied {
3842 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003843 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003844}
3845
Howard Ro21a039c2018-08-06 14:55:47 -07003846/**
3847 * An atom for generic metrics logging. Available from Android Q.
3848 */
3849message GenericAtom {
3850 // The uid of the application that sent this custom atom.
3851 optional int32 uid = 1 [(is_uid) = true];
3852
3853 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003854 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003855}
3856
Tej Singhd6d6d772018-09-05 17:41:25 -07003857/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003858 * Atom for simple logging of user interaction and impression events, such as "the user touched
3859 * this button" or "this dialog was displayed".
3860 * Keep the UI event stream clean: don't use for system or background events.
3861 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003862 *
3863 * Logged from:
3864 * frameworks/base/services/core/java/com/android/server/
3865 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003866 */
3867message UiEventReported {
3868 // The event_id.
3869 optional int32 event_id = 1;
3870 // The event's source or target uid and package, if applicable.
3871 // For example, the package posting a notification, or the destination package of a share.
3872 optional int32 uid = 2 [(is_uid) = true];
3873 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003874 // An identifier used to disambiguate which logs refer to a particular instance of some
3875 // UI element. Useful when there might be multiple instances simultaneously active.
3876 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003877}
3878
3879/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003880 * Reports a notification was created or updated.
3881 *
3882 * Logged from:
3883 * frameworks/base/services/core/java/com/android/server/notification/
3884 */
3885message NotificationReported {
3886 // The event_id (as for UiEventReported).
3887 optional int32 event_id = 1;
3888 // The notifying app's uid and package.
3889 optional int32 uid = 2 [(is_uid) = true];
3890 optional string package_name = 3;
3891 // A small system-assigned identifier for the notification.
3892 // Locally probably-unique, but expect collisions across users and/or days.
3893 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003894 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3895 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003896
3897 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003898 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3899 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3900 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003901
3902 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003903 optional string category = 10; // App-assigned notification category (API-defined strings)
3904 optional int32 style = 11; // App-assigned notification style
3905 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003906
3907 // Ordering, importance and interruptiveness
3908
Will Brockman7614f6962020-02-10 19:43:03 -05003909 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003910
Will Brockman7614f6962020-02-10 19:43:03 -05003911 optional android.stats.sysui.NotificationImportance importance = 14;
3912 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003913
3914 enum NotificationImportanceExplanation {
3915 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3916 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3917 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3918 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3919 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3920 // Like _APP, but based on pre-channels priority signal.
3921 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3922 }
3923
Will Brockman7614f6962020-02-10 19:43:03 -05003924 optional NotificationImportanceExplanation importance_source = 16;
3925 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3926 optional NotificationImportanceExplanation importance_initial_source = 18;
3927 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3928 optional int32 assistant_hash = 20;
3929 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003930}
3931
3932message Notification {
3933 // The notifying app's uid and package.
3934 optional int32 uid = 1 [(is_uid) = true];
3935 optional string package_name = 2;
3936 // A small system-assigned identifier for the notification.
3937 optional int32 instance_id = 3;
3938
3939 // Grouping information.
3940 optional int32 group_instance_id = 4;
3941 optional bool is_group_summary = 5;
3942
3943 // The section of the shade that the notification is in.
3944 // See NotificationSectionsManager.PriorityBucket.
3945 enum NotificationSection {
3946 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003947 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003948 SECTION_MEDIA_CONTROLS = 2;
3949 SECTION_PEOPLE = 3;
3950 SECTION_ALERTING = 4;
3951 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003952 }
3953 optional NotificationSection section = 6;
3954}
3955
3956message NotificationList {
3957 repeated Notification notifications = 1; // An ordered sequence of notifications.
3958}
3959
3960/**
3961 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3962 *
3963 * Logged from:
3964 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3965 */
3966message NotificationPanelReported {
3967 // The event_id (as for UiEventReported).
3968 optional int32 event_id = 1;
3969 optional int32 num_notifications = 2;
3970 // The notifications in the panel, in the order that they appear there.
3971 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3972}
3973
3974/**
3975 * Reports a notification channel, or channel group, was created, updated, or deleted.
3976 *
3977 * Logged from:
3978 * frameworks/base/services/core/java/com/android/server/notification/
3979 */
3980message NotificationChannelModified {
3981 // The event_id (as for UiEventReported).
3982 optional int32 event_id = 1;
3983 // The notifying app's uid and package.
3984 optional int32 uid = 2 [(is_uid) = true];
3985 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003986 // Hash of app-assigned notification channel ID or channel-group ID
3987 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003988 // Previous importance setting, if applicable
3989 optional android.stats.sysui.NotificationImportance old_importance = 5;
3990 // New importance setting
3991 optional android.stats.sysui.NotificationImportance importance = 6;
3992}
3993
3994
3995/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003996 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003997 *
3998 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003999 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004000 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004001message BiometricAcquired {
4002 // Biometric modality that was acquired.
4003 optional android.hardware.biometrics.ModalityEnum modality = 1;
4004 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4005 optional int32 user = 2;
4006 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4007 optional bool is_crypto = 3;
4008 // Action that the device is performing. Acquired messages are only expected for enroll and
4009 // authenticate. Other actions may indicate an error.
4010 optional android.hardware.biometrics.ActionEnum action = 4;
4011 // The client that this acquisition was received for.
4012 optional android.hardware.biometrics.ClientEnum client = 5;
4013 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4014 optional int32 acquire_info = 6;
4015 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4016 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004017 // Dictates if this message should trigger additional debugging.
4018 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004019}
4020
4021/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004022 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004023 *
4024 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004025 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004026 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004027message BiometricAuthenticated {
4028 // Biometric modality that was used.
4029 optional android.hardware.biometrics.ModalityEnum modality = 1;
4030 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4031 optional int32 user = 2;
4032 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4033 // storage.
4034 optional bool is_crypto = 3;
4035 // The client that this acquisition was received for.
4036 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004037 // If authentication requires user confirmation. See BiometricPrompt's
4038 // setRequireConfirmation(bool) method.
4039 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004040
Kevin Chyn1741a072019-01-17 11:54:40 -08004041 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004042 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004043 REJECTED = 1;
4044 PENDING_CONFIRMATION = 2;
4045 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004046 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004047
4048 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004049 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004050 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4051 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4052 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4053 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004054 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004055 // Dictates if this message should trigger additional debugging.
4056 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004057}
4058
4059/**
4060 * Logs when a biometric error occurs.
4061 *
4062 * Logged from:
4063 * frameworks/base/services/core/java/com/android/server/biometrics
4064 */
4065message BiometricErrorOccurred {
4066 // Biometric modality that was used.
4067 optional android.hardware.biometrics.ModalityEnum modality = 1;
4068 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4069 optional int32 user = 2;
4070 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4071 optional bool is_crypto = 3;
4072 // Action that the device is performing.
4073 optional android.hardware.biometrics.ActionEnum action = 4;
4074 // The client that this acquisition was received for.
4075 optional android.hardware.biometrics.ClientEnum client = 5;
4076 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4077 // are unique to modality.
4078 optional int32 error_info = 6;
4079 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4080 // by the vendor and not specified by the HIDL interface.
4081 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004082 // Dictates if this message should trigger additional debugging.
4083 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004084 // Time spent during the authentication attempt.
4085 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004086}
4087
4088/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004089 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004090 * Logged from:
4091 * frameworks/base/services/core/java/com/android/server/biometrics
4092 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004093message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004094 // Biometric modality.
4095 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004096 // Type of issue detected.
4097 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004098 // Dictates if this message should trigger additional debugging.
4099 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004100}
Howard Ro688ae182018-09-25 00:09:36 -07004101
joshmccloskey6f952b22019-03-25 20:59:35 -07004102/**
4103 * Logs when a biometric enrollment occurs.
4104 *
4105 * Logged from:
4106 * frameworks/base/services/core/java/com/android/server/biometrics
4107 */
4108message BiometricEnrolled {
4109 // Biometric modality that was used.
4110 optional android.hardware.biometrics.ModalityEnum modality = 1;
4111 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4112 optional int32 user = 2;
4113 // The amount of time the enrollment took in milliseconds.
4114 optional int64 latency_millis = 3;
4115 // Whether or not the enrollment was successful.
4116 optional bool success = 4;
4117}
4118
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004119/*
Tej Singh0d176952019-01-16 19:10:54 -08004120 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004121 */
Tej Singh0d176952019-01-16 19:10:54 -08004122message FlagFlipUpdateOccurred {
4123 // If the event is from a flag config package, specify the package name.
4124 optional string flag_flip_package_name = 1;
4125
4126 // The order id of the package
4127 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004128}
4129
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004130/**
4131 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004132 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004133 */
4134message TrainExperimentIds {
4135 repeated int64 experiment_id = 1;
4136}
4137
Yangster-macb89807e2018-11-15 21:10:57 -08004138/*
4139 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004140 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004141 */
4142message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004143 // Name of the train.
4144 optional string train_name = 1;
4145 // Version code for a "train" of packages that need to be installed atomically
4146 optional int64 train_version_code = 2;
4147 // After installation of this package, device requires a restart.
4148 optional bool requires_staging = 3;
4149 // Rollback should be enabled for this install.
4150 optional bool rollback_enabled = 4;
4151 // Requires low latency monitoring if possible.
4152 optional bool requires_low_latency_monitor = 5;
4153
Yangster-macb89807e2018-11-15 21:10:57 -08004154 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004155 UNKNOWN = 0;
4156 INSTALL_REQUESTED = 1;
4157 INSTALL_STARTED = 2;
4158 INSTALL_STAGED_NOT_READY = 3;
4159 INSTALL_STAGED_READY = 4;
4160 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004161 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4162 // and INSTALL_FAILURE_COMMIT.
4163 INSTALL_FAILURE = 6 [deprecated = true];
4164 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004165 INSTALL_CANCELLED = 7;
4166 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004167 INSTALLER_ROLLBACK_INITIATED = 9;
4168 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4169 INSTALLER_ROLLBACK_STAGED = 11;
4170 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4171 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4172 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4173 INSTALLER_ROLLBACK_SUCCESS = 15;
4174 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004175 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4176 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4177 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4178 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4179 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4180 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004181 INSTALL_FAILURE_DOWNLOAD = 23;
4182 INSTALL_FAILURE_STATE_MISMATCH = 24;
4183 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004184 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004185 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004186 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004187 // Possible experiment ids for monitoring this push.
4188 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4189 // user id
4190 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004191 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004192 // Whether or not this is a rollback event
4193 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004194}
4195
Tej Singhc9203082019-05-03 13:42:23 -07004196/* Test atom, is not logged anywhere */
4197message TestAtomReported {
4198 repeated AttributionNode attribution_node = 1;
4199 optional int32 int_field = 2;
4200 optional int64 long_field = 3;
4201 optional float float_field = 4;
4202 optional string string_field = 5;
4203 optional bool boolean_field = 6;
4204 enum State {
4205 UNKNOWN = 0;
4206 OFF = 1;
4207 ON = 2;
4208 }
4209 optional State state = 7;
4210 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4211}
4212
Maggie Whitefc1aa592018-11-28 21:55:23 -08004213/** Represents USB port overheat event. */
4214message UsbPortOverheatEvent {
4215 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4216 optional int32 plug_temperature_deci_c = 1;
4217
4218 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4219 optional int32 max_temperature_deci_c = 2;
4220
4221 /* Time between USB plug event and overheat threshold trip, in seconds. */
4222 optional int32 time_to_overheat_secs = 3;
4223
4224 /* Time between overheat threshold trip and hysteresis, in seconds. */
4225 optional int32 time_to_hysteresis_secs = 4;
4226
4227 /* Time between hysteresis and active mitigation ending, in seconds. */
4228 optional int32 time_to_inactive_secs = 5;
4229};
4230
Maggie White8735b852019-01-18 11:40:49 -08004231/**
4232 * Logs total effective full charge and discharge cycles on a battery.
4233 * Here are some examples of one effective cycle:
4234 * 1) the battery charges from 0% to 100% and drains back to 0%,
4235 * 2) charging from 50% to 100% and draining back to 50% twice.
4236 * Pulled from:
4237 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4238 */
4239message BatteryCycleCount {
4240 /* Number of total charge and discharge cycles on the system battery. */
4241 optional int32 cycle_count = 1;
4242}
4243
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004244/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004245 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4246 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004247 * Pulled from:
4248 * StatsCompanionService
4249 */
4250
Carmen Agimof12dec122019-03-06 16:14:38 +00004251message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004252
Carmen Agimof12dec122019-03-06 16:14:38 +00004253 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004254 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004255 PUBLIC = 1;
4256 PRIVATE = 2;
4257 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004258 }
4259
Carmen Agimof12dec122019-03-06 16:14:38 +00004260 // The type of external storage.
4261 optional android.stats.storage.ExternalStorageType storage_type = 1;
4262 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4263 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004264 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004265 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004266}
4267
Yangster-macb89807e2018-11-15 21:10:57 -08004268/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004269 * Logs when a connection becomes available and lost.
4270 * Logged in StatsCompanionService.java
4271 */
4272message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004273 // Id of the network.
4274 optional int32 net_id = 1;
4275
4276 enum State {
4277 UNKNOWN = 0;
4278 CONNECTED = 1;
4279 DISCONNECTED = 2;
4280 }
4281 // Connected state of a network.
4282 optional State state = 2;
4283}
4284
4285/**
4286 * Logs when a service starts and stops.
4287 * Logged from:
4288 * services/core/java/com/android/server/am/ActiveServices.java
4289 */
4290message ServiceStateChanged {
4291
4292 optional int32 uid = 1 [(is_uid) = true];
4293
4294 optional string package_name = 2;
4295
4296 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004297
4298 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004299 START = 1;
4300 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004301 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004302
4303 optional State state = 4;
4304}
4305
4306/**
4307 * Logs when a service is launched.
4308 * Logged from:
4309 * services/core/java/com/android/server/am/ActiveServices.java
4310 */
4311message ServiceLaunchReported {
4312
4313 optional int32 uid = 1 [(is_uid) = true];
4314
4315 optional string package_name = 2;
4316
4317 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004318}
Howard Ro688ae182018-09-25 00:09:36 -07004319
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004320/**
4321 * Logs when a hidden API is used.
4322 *
4323 * Logged from:
4324 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4325 */
4326message HiddenApiUsed {
4327 // The uid of the app making the hidden access.
4328 optional int32 uid = 1 [(is_uid) = true];
4329
4330 // Signature of the method or field accessed.
4331 optional string signature = 2;
4332
4333 enum AccessMethod {
4334 NONE = 0;
4335 REFLECTION = 1;
4336 JNI = 2;
4337 LINKING = 3;
4338 }
4339
4340 // Type of access.
4341 optional AccessMethod access_method = 3;
4342
4343 // Whether the access was prevented or not.
4344 optional bool access_denied = 4;
4345}
4346
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004347/**
4348 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4349 * - When user sees privacy chip
4350 * - When user clicks privacy chip
4351 * - How does the user exit the Privacy Dialog
4352 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004353 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4354 */
4355message PrivacyIndicatorsInteracted {
4356
4357 enum Type {
4358 UNKNOWN = 0;
4359 CHIP_VIEWED = 1;
4360 CHIP_CLICKED = 2;
4361 DIALOG_PRIVACY_SETTINGS = 3;
4362 DIALOG_DISMISS = 4;
4363 DIALOG_LINE_ITEM = 5;
4364 }
4365
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004366 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004367
4368 // Used if the type is LINE_ITEM
4369 optional string package_name = 2;
4370}
4371
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004372/**
4373 * Logs information about a package that is moved from the internal to external storage and vice
4374 * versa.
4375 * It logs the package name, the type of the external storage where the package is installed
4376 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4377 * and the move type: if it's from internal to external or the other way around.
4378 *
4379 * Logged from:
4380 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4381 */
4382message AppMovedStorageReported {
4383 enum MoveType {
4384 UNKNOWN = 0;
4385 TO_EXTERNAL = 1;
4386 TO_INTERNAL = 2;
4387 }
4388 // The type of the external storage.
4389 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4390 // The type of move.
4391 optional MoveType move_type = 2;
4392 // The name of the package that was moved.
4393 optional string package_name = 3;
4394}
4395
jianjin8f2dee02019-03-29 14:03:08 -07004396/**
4397 * Logs when system server watchdog occurs.
4398 * Logged from:
4399 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4400 */
4401message SystemServerWatchdogOccurred {
4402 optional string subject = 1;
4403}
4404
4405/**
4406 * Logs when new file added to tombstones.
4407 * Logged from:
4408 * frameworks/base/core/java/com/android/server/BootReceiver.java
4409 */
4410message TombStoneOccurred {
4411}
4412
Hai Zhang5d3328d2019-04-13 21:25:06 +08004413/*
4414 * Information about a role request
4415 *
4416 * Logged from:
4417 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4418 */
4419message RoleRequestResultReported {
4420 // UID of application requesting the role
4421 optional int32 requesting_uid = 1;
4422
4423 // Package name of application requesting the role
4424 optional string requesting_package_name = 2;
4425
4426 // The role to be granted
4427 optional string role_name = 3;
4428
4429 // The count of applications qualifying for the role
4430 optional int32 qualifying_count = 4;
4431
4432 // UID of application current granted the role
4433 optional int32 current_uid = 5;
4434
4435 // Package name of application current granted the role
4436 optional string current_package_name = 6;
4437
4438 // UID of another application that user chose to grant the role to, instead of the requesting
4439 // application
4440 optional int32 granted_another_uid = 7;
4441
4442 // Package name of another application that user chose to grant the role to, instead of the
4443 // requesting application
4444 optional string granted_another_package_name = 8;
4445
4446 enum Result {
4447 UNDEFINED = 0;
4448 // role request was ignored
4449 IGNORED = 1;
4450 // role request was ignored because it's already granted
4451 IGNORED_ALREADY_GRANTED = 2;
4452 // role request was ignored because the application isn't qualified
4453 IGNORED_NOT_QUALIFIED = 3;
4454 // role request was ignored because user said it should be always denied
4455 IGNORED_USER_ALWAYS_DENIED = 4;
4456 // role was granted by user action
4457 USER_GRANTED = 5;
4458 // role was denied by user action
4459 USER_DENIED = 6;
4460 // role was denied by user granting another application the role
4461 USER_DENIED_GRANTED_ANOTHER = 7;
4462 // role was denied and set to be always denied by the user
4463 USER_DENIED_WITH_ALWAYS = 8;
4464 }
4465 // The result of the role request
4466 optional Result result = 9;
4467}
4468
Mark Tabrya824a642019-11-05 12:26:12 -08004469/**
4470 * Logs when a Vehicle Maps Service client's connection state has changed
4471 *
4472 * Logged from:
4473 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4474 */
4475message VmsClientConnectionStateChanged {
4476 // The UID of the VMS client app
4477 optional int32 uid = 1 [(is_uid) = true];
4478
4479 enum State {
4480 UNKNOWN = 0;
4481 // Attempting to connect to the client
4482 CONNECTING = 1;
4483 // Client connection established
4484 CONNECTED = 2;
4485 // Client connection closed unexpectedly
4486 DISCONNECTED = 3;
4487 // Client connection closed by VMS
4488 TERMINATED = 4;
4489 // Error establishing the client connection
4490 CONNECTION_ERROR = 5;
4491 }
4492
4493 optional State state = 2;
4494}
4495
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004496/**
4497 * Logs when MediaProvider has successfully finished scanning a storage volume.
4498 *
4499 * Logged from:
4500 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4501 */
shafik43825842020-04-02 17:30:24 +01004502message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004503 enum Reason {
4504 // Scan triggered due to unknown reason
4505 UNKNOWN = 0;
4506 // Scan triggered due to storage volume being mounted
4507 MOUNTED = 1;
4508 // Scan triggered due to explicit user action or app request
4509 DEMAND = 2;
4510 // Scan triggered due to idle maintenance
4511 IDLE = 3;
4512 }
4513
4514 // Volume type that this event pertains to
4515 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4516 // Reason why this scan was triggered
4517 optional Reason reason = 2;
4518 // Total number of files scanned
4519 optional int64 item_count = 3;
4520 // Duration of scan, normalized per file
4521 optional float normalized_duration_millis = 4;
4522 // Number of database inserts, normalized per file
4523 optional float normalized_insert_count = 5;
4524 // Number of database updates, normalized per file
4525 optional float normalized_update_count = 6;
4526 // Number of database deletes, normalized per file
4527 optional float normalized_delete_count = 7;
4528}
4529
4530/**
4531 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4532 *
4533 * Logged from:
4534 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4535 */
shafik43825842020-04-02 17:30:24 +01004536message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004537 // Volume type that this event pertains to
4538 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004539 // UID of app that requested deletion
4540 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004541 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004542 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004543}
4544
4545/**
4546 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4547 *
4548 * Logged from:
4549 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4550 */
shafik43825842020-04-02 17:30:24 +01004551message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004552 enum Result {
4553 UNKNOWN = 0;
4554 USER_GRANTED = 1;
4555 AUTO_GRANTED = 2;
4556 USER_DENIED = 3;
4557 USER_DENIED_WITH_PREJUDICE = 4;
4558 AUTO_DENIED = 5;
4559 }
4560
4561 // Volume type that this event pertains to
4562 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004563 // UID of app that requested permission
4564 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004565 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004566 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004567 // Result of this request
shafik43825842020-04-02 17:30:24 +01004568 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004569}
4570
4571/**
4572 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4573 *
4574 * Logged from:
4575 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4576 */
shafik43825842020-04-02 17:30:24 +01004577message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004578 // Volume type that this event pertains to
4579 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4580 // Old database version code
4581 optional int32 version_from = 2;
4582 // New database version code
4583 optional int32 version_to = 3;
4584 // Total number of files in database
4585 optional int64 item_count = 4;
4586 // Duration of schema change, normalized per file
4587 optional float normalized_duration_millis = 5;
4588}
4589
4590/**
4591 * Logs when MediaProvider has finished an idle maintenance job.
4592 *
4593 * Logged from:
4594 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4595 */
shafik43825842020-04-02 17:30:24 +01004596message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004597 // Volume type that this event pertains to
4598 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4599
4600 // Total number of files in database
4601 optional int64 item_count = 2;
4602 // Duration of idle maintenance, normalized per file
4603 optional float normalized_duration_millis = 3;
4604 // Number of thumbnails found to be stale, normalized per file
4605 optional float normalized_stale_thumbnails = 4;
4606 // Number of items found to be expired, normalized per file
4607 optional float normalized_expired_media = 5;
4608}
4609
Keun young Park3e033cb2019-12-18 11:27:35 -08004610/**
4611 * Represents boot time event with duration in ms.
4612 *
4613 * Logged from: bootstat and various system server components. Check each enums for details.
4614 */
4615message BootTimeEventDuration {
4616 enum DurationEvent {
4617 UNKNOWN = 0;
4618 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4619 ABSOLUTE_BOOT_TIME = 1;
4620 // Bootloader's 1st stage execution time.
4621 // Logged from bootstat.
4622 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4623 // Bootloader's 1st stage loading time.
4624 // Logged from bootstat.
4625 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4626 // Bootloader's kernel loading time.
4627 // Logged from bootstat.
4628 BOOTLOADER_KERNEL_LOAD = 4;
4629 // Bootloader's 2nd stage execution time.
4630 // Logged from bootstat.
4631 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4632 // Bootloader's 2nd stage loading time.
4633 // Logged from bootstat.
4634 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4635 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4636 // for locked device.
4637 // Logged from bootstat.
4638 BOOTLOADER_UI_WAIT = 7;
4639 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4640 // Logged from bootstat.
4641 BOOTLOADER_TOTAL = 8;
4642 // Shutdown duration inside init for the reboot before the current boot up.
4643 // Logged from f/b/services/.../BootReceiver.java.
4644 SHUTDOWN_DURATION = 9;
4645 // Total time for mounting of disk devices during bootup.
4646 // Logged from f/b/services/.../BootReceiver.java.
4647 MOUNT_DEFAULT_DURATION = 10;
4648 // Total time for early stage mounting of disk devices during bootup.
4649 // Logged from f/b/services/.../BootReceiver.java.
4650 MOUNT_EARLY_DURATION = 11;
4651 // Total time for late stage mounting of disk devices during bootup.
4652 // Logged from f/b/services/.../BootReceiver.java.
4653 MOUNT_LATE_DURATION = 12;
4654 // Average time to scan non-system app after OTA
4655 // Logged from f/b/services/.../PackageManagerService.java
4656 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4657 // Time to initialize Package manager after OTA
4658 // Logged from f/b/services/.../PackageManagerService.java
4659 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4660 // Time to scan all system app from Package manager after OTA
4661 // Logged from f/b/services/.../PackageManagerService.java
4662 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4663 // Init's total time for cold boot stage.
4664 // Logged from bootstat.
4665 COLDBOOT_WAIT = 16;
4666 // Init's total time for initializing selinux.
4667 // Logged from bootstat.
4668 SELINUX_INIT = 17;
4669 // Time since last factory reset.
4670 // Logged from bootstat.
4671 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004672 // Init's total time spent for completing the 1st stage.
4673 // Logged from bootstat.
4674 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004675 }
4676
4677 // Type of the event.
4678 optional DurationEvent event = 1;
4679 // Duration of the event in ms.
4680 optional int64 duration_millis = 2;
4681}
4682
4683/**
4684 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4685 * since boot-up.
4686 *
4687 * Logged from: bootstat and various system server components. Check each enums for details.
4688 */
4689message BootTimeEventElapsedTime {
4690 enum ElapsedTimeEvent {
4691 UNKNOWN = 0;
4692 // Time when init starts 1st stage. Logged from bootstat.
4693 ANDROID_INIT_STAGE_1 = 1;
4694 // Time when sys.boot_completed prop is set.
4695 // Logged from bootstat.
4696 BOOT_COMPLETE = 2;
4697 // BOOT_COMPLETE for encrypted device.
4698 BOOT_COMPLETE_ENCRYPTION = 3;
4699 // BOOT_COMPLETE for device with no encryption.
4700 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4701 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004702 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004703 // BOOT_COMPLETE after factory reset.
4704 FACTORY_RESET_BOOT_COMPLETE = 6;
4705 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4706 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004707 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4708 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004709 // BOOT_COMPLETE after OTA.
4710 OTA_BOOT_COMPLETE = 9;
4711 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4712 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004713 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4714 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004715 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4716 // Logged from f/b/services/.../UserController.java
4717 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4718 // Time when the system starts sending BOOT_COMPLETED broadcast.
4719 // Logged from f/b/services/.../UserController.java
4720 FRAMEWORK_BOOT_COMPLETED = 13;
4721 // Time when the package manager starts init.
4722 // Logged from f/b/services/.../SystemServer.java
4723 PACKAGE_MANAGER_INIT_START = 14;
4724 // Time when package manager is ready
4725 // Logged from f/b/services/.../SystemServer.java
4726 PACKAGE_MANAGER_INIT_READY = 15;
4727 // Represents the time when user has entered unlock credential for system with user pin.
4728 // Logged from bootstat.
4729 POST_DECRYPT = 16;
4730 // Represents the start of zygote's init.
4731 // Logged from zygote itself.
4732 ZYGOTE_INIT_START = 17;
4733 // Represents the start of secondary zygote's init.
4734 // TODO: add logging to zygote
4735 SECONDARY_ZYGOTE_INIT_START = 18;
4736 // Represents the start of system server's init.
4737 // Logged from f/b/services/.../SystemServer.java
4738 SYSTEM_SERVER_INIT_START = 19;
4739 // Represents the completion of system server's init.
4740 // Logged from f/b/services/.../SystemServer.java
4741 SYSTEM_SERVER_READY = 20;
4742 // Represents the start of launcher during boot-up.
4743 // TODO: add logging
4744 LAUNCHER_START = 21;
4745 // Represents the completion of launcher's initial rendering. User can use other apps from
4746 // launcher from this point.
4747 // TODO: add logging
4748 LAUNCHER_SHOWN = 22;
4749 }
4750
4751 // Type of the event.
4752 optional ElapsedTimeEvent event = 1;
4753 // Time since bootup for the event.
4754 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4755 optional int64 time_millis = 2;
4756}
4757
4758/**
4759 * Boot time events with UTC time.
4760 *
4761 * Logged from: bootstat and various system server components. Check each enums for details.
4762 */
4763message BootTimeEventUtcTime {
4764 enum UtcTimeEvent {
4765 UNKNOWN = 0;
4766 // Time of the bootstat's marking of 1st boot after the last factory reset.
4767 // Logged from bootstat.
4768 FACTORY_RESET_RESET_TIME = 1;
4769 // The time when bootstat records FACTORY_RESET_* events. This is close to
4770 // BOOT_COMPLETE time for the current bootup.
4771 // Logged from bootstat.
4772 FACTORY_RESET_CURRENT_TIME = 2;
4773 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4774 // Logged from bootstat.
4775 FACTORY_RESET_RECORD_VALUE = 3;
4776 }
4777
4778 // Type of the event.
4779 optional UtcTimeEvent event = 1;
4780 // UTC time for the event.
4781 optional int64 utc_time_secs = 2;
4782}
4783
4784/**
4785 * Boot time events representing specific error code during bootup.
4786 * Meaning of error code can be different per each event type.
4787 *
4788 * Logged from: bootstat and various system server components. Check each enums for details.
4789 */
4790message BootTimeEventErrorCode {
4791 enum ErrorCodeEvent {
4792 UNKNOWN = 0;
4793 // Linux error code for time() call to get the current UTC time.
4794 // Logged from bootstat.
4795 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4796 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4797 // as UMOUNT_STAT_* from init/reboot.cpp.
4798 // Logged from f/b/services/.../BootReceiver.java.
4799 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004800 // Reprepsents fie system mounting error code of /data partition for the current boot.
4801 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004802 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004803 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004804 }
4805
4806 // Type of the event.
4807 optional ErrorCodeEvent event = 1;
4808 // error code defined per each event type.
4809 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4810 // FS_MGR_FS_STAT.
4811 optional int32 error_code = 2;
4812}
4813
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004814/**
4815 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4816 * after an OTA.
4817 *
4818 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004819 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004820 */
4821message SnapshotMergeReported {
4822 // Keep in sync with
4823 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4824 enum UpdateState {
4825 // No update or merge is in progress.
4826 NONE = 0;
4827 // An update is applying; snapshots may already exist.
4828 INITIATED = 1;
4829 // An update is pending, but has not been successfully booted yet.
4830 UNVERIFIED = 2;
4831 // The kernel is merging in the background.
4832 MERGING = 3;
4833 // Post-merge cleanup steps could not be completed due to a transient
4834 // error, but the next reboot will finish any pending operations.
4835 MERGE_NEEDS_REBOOT = 4;
4836 // Merging is complete, and needs to be acknowledged.
4837 MERGE_COMPLETED = 5;
4838 // Merging failed due to an unrecoverable error.
4839 MERGE_FAILED = 6;
4840 // The update was implicitly cancelled, either by a rollback or a flash
4841 // operation via fastboot. This state can only be returned by WaitForMerge.
4842 CANCELLED = 7;
4843 };
4844
4845 // Status of the update after the merge attempts.
4846 optional UpdateState final_state = 1;
4847
4848 // Time to complete a merge operation in milliseconds.
4849 // A negative value corresponds to the case in which the merge operation
4850 // was interrupted and resumed (e.g. in case of a system reboot during the
4851 // merge).
4852 optional int64 duration_millis = 2;
4853
4854 // Number of reboots that occurred after issuing and before completing the
4855 // merge of all the snapshot devices.
4856 optional int32 intermediate_reboots = 3;
4857}
4858
Chenjie Yubbcbc602018-02-05 16:51:52 -08004859//////////////////////////////////////////////////////////////////////
4860// Pulled atoms below this line //
4861//////////////////////////////////////////////////////////////////////
4862
4863/**
David Chenc8a43242017-10-17 16:23:28 -07004864 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4865 *
4866 * Pulled from:
4867 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4868 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004869message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004870 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004871
4872 optional int64 rx_bytes = 2;
4873
4874 optional int64 rx_packets = 3;
4875
4876 optional int64 tx_bytes = 4;
4877
4878 optional int64 tx_packets = 5;
4879}
4880
4881/**
4882 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4883 *
4884 * Pulled from:
4885 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4886 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004887message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004888 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004889
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004890 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4891 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004892
4893 optional int64 rx_bytes = 3;
4894
4895 optional int64 rx_packets = 4;
4896
4897 optional int64 tx_bytes = 5;
4898
4899 optional int64 tx_packets = 6;
4900}
4901
4902/**
4903 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4904 *
4905 * Pulled from:
4906 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4907 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004908message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004909 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004910
4911 optional int64 rx_bytes = 2;
4912
4913 optional int64 rx_packets = 3;
4914
4915 optional int64 tx_bytes = 4;
4916
4917 optional int64 tx_packets = 5;
4918}
4919
4920/**
4921 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4922 *
4923 * Pulled from:
4924 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4925 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004926message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004927 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004928
Yao Chenc40a19d2018-03-15 16:48:25 -07004929 // 1 denotes foreground and 0 denotes background. This is called Set in
4930 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004931 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004932
4933 optional int64 rx_bytes = 3;
4934
4935 optional int64 rx_packets = 4;
4936
4937 optional int64 tx_bytes = 5;
4938
4939 optional int64 tx_packets = 6;
4940}
4941
4942/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004943 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4944 *
4945 * Pulled from:
4946 * StatsCompanionService
4947 */
4948message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004949 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004950
4951 optional int64 rx_bytes = 2;
4952
4953 optional int64 tx_bytes = 3;
4954}
4955
4956/**
David Chenc8a43242017-10-17 16:23:28 -07004957 * Pulls the kernel wakelock durations. This atom is adapted from
4958 * android/internal/os/KernelWakelockStats.java
4959 *
4960 * Pulled from:
4961 * StatsCompanionService using KernelWakelockReader.
4962 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004963message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004964 optional string name = 1;
4965
4966 optional int32 count = 2;
4967
4968 optional int32 version = 3;
4969
Yangster-maca8a30442018-10-13 23:46:34 -07004970 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004971}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004972
Chenjie Yu05013b32017-11-21 10:21:41 -08004973/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004974 * Pulls low power state information. If power.stats HAL is not available, this
4975 * includes platform and subsystem sleep state information,
4976 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4977 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004978 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004979 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004980 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4981 * as defined in:
4982 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004983 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004984message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004985 // Subsystem name
4986 optional string subsystem_name = 1;
4987 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4988 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004989 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4990 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004991 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004992 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004993 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004994 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004995 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004996}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004997
Chenjie Yu05013b32017-11-21 10:21:41 -08004998/**
Bookatz92da2832018-11-01 18:10:03 -07004999 * Pulls on-device power measurement information.
5000 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5001 * Pulled from:
5002 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5003 */
5004message OnDevicePowerMeasurement {
5005 // Name of the subsystem (to which the rail belongs).
5006 optional string subsystem_name = 1;
5007
5008 // Rail name. The rail lies within the subsystem.
5009 optional string rail_name = 2;
5010
5011 // Time (in ms since boot) at which the rail energy value was measured.
5012 // This may differ slightly from the time that statsd logs this information.
5013 optional uint64 measurement_timestamp_millis = 3;
5014
5015 // Accumulated energy used via the rail since device boot in uWs.
5016 optional uint64 energy_microwatt_secs = 4;
5017}
5018
5019/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005020 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005021 * Pulls the time the cpu spend on the frequency index. Frequency index
5022 * starts from highest to lowest. The value should be monotonically
5023 * increasing since boot. However, if there is a cpu
5024 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005025 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005026message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005027 optional uint32 cluster = 1;
5028 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005029 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005030}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005031
Chenjie Yu05013b32017-11-21 10:21:41 -08005032/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005033 * Pulls Cpu Time Per Uid.
5034 * Note that isolated process uid time should be attributed to host uids.
5035 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005036message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005037 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005038 optional uint64 user_time_micros = 2;
5039 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005040}
5041
5042/**
5043 * Pulls Cpu Time Per Uid per frequency.
5044 * Note that isolated process uid time should be attributed to host uids.
5045 * For each uid, we order the time by descending frequencies.
5046 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005047message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005048 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005049 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005050 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005051}
Hugo Benichi884970e2017-11-14 22:42:46 +09005052
Chenjie Yu05013b32017-11-21 10:21:41 -08005053/**
5054 * Pulls Wifi Controller Activity Energy Info
5055 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005056message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005057 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005058 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005059 // stack reported state
5060 // TODO: replace this with proto enum
5061 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005062 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005063 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005064 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005066 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005067 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005068 // product of current(mA), voltage(V) and time(ms)
5069 optional uint64 controller_energy_used = 6;
5070}
5071
5072/**
5073 * Pulls Modem Activity Energy Info
5074 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005075message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005076 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005077 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005078 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005079 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005080 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005081 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005082 /**
5083 * Tx power index
5084 * index 0 = tx_power < 0dBm
5085 * index 1 = 0dBm < tx_power < 5dBm
5086 * index 2 = 5dBm < tx_power < 15dBm
5087 * index 3 = 15dBm < tx_power < 20dBm
5088 * index 4 = tx_power > 20dBm
5089 */
5090 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005091 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005092 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005093 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005094 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005095 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005096 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005097 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005098 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005099 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005100 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005101 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005102 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005103 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005104}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005105
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005106/**
5107 * Pulls Bluetooth Activity Energy Info
5108 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5109 */
5110message BluetoothActivityInfo {
5111 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005112 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005113 // bluetooth stack state
5114 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005115 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005116 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005117 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005118 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005119 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005120 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005121 // product of current(mA), voltage(V) and time(ms)
5122 optional uint64 energy_used = 6;
5123}
5124
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005125/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005126 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005127 *
5128 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005129 */
5130message ProcessMemoryState {
5131 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005132 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005133
5134 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005135 // Usually package name, "system" for system server.
5136 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005137 optional string process_name = 2;
5138
Rafal Slawikda51b932018-12-13 16:31:33 +00005139 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005140 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005141
5142 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005143 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005144
5145 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005146 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005147
Rajeev Kumar90235992018-01-29 11:06:48 -08005148 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005149 // Value is read from memory.stat, field total_rss if per-app memory
5150 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005151 optional int64 rss_in_bytes = 6;
5152
5153 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005154 // Value is read from memory.stat, field total_cache if per-app memory
5155 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005156 optional int64 cache_in_bytes = 7;
5157
5158 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005159 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005160 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005161 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005162
Rafal Slawik203c3db2019-09-25 19:53:01 +01005163 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005164 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005165
Rafal Slawik203c3db2019-09-25 19:53:01 +01005166 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5167 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005168
Rafal Slawik203c3db2019-09-25 19:53:01 +01005169 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5170 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005171}
5172
5173/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005174 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005175 *
5176 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5177 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005178 *
5179 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005180 */
5181message ProcessMemoryHighWaterMark {
5182 // The uid if available. -1 means not available.
5183 optional int32 uid = 1 [(is_uid) = true];
5184
Rafal Slawikda51b932018-12-13 16:31:33 +00005185 // The process name.
5186 // Usually package name or process cmdline.
5187 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005188 optional string process_name = 2;
5189
Rafal Slawik239b6802019-09-09 18:46:01 +01005190 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5191 // computed by converting kilobytes to bytes.
5192 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5193
Rafal Slawik3bea8952018-11-15 12:39:33 +00005194 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5195 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005196 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005197}
5198
5199/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005200 * Logs the memory stats for a process.
5201 *
5202 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5203 * and for selected native processes.
5204 */
5205message ProcessMemorySnapshot {
5206 // The uid if available. -1 means not available.
5207 optional int32 uid = 1 [(is_uid) = true];
5208
5209 // The process name.
5210 // Usually package name or process cmdline.
5211 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5212 optional string process_name = 2;
5213
5214 // The pid of the process.
5215 // Allows to disambiguate instances of the process.
5216 optional int32 pid = 3;
5217
5218 // The current OOM score adjustment value.
5219 // Read from ProcessRecord for managed processes.
5220 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5221 optional int32 oom_score_adj = 4;
5222
5223 // The current RSS of the process.
5224 // VmRSS from /proc/pid/status.
5225 optional int32 rss_in_kilobytes = 5;
5226
5227 // The current anon RSS of the process.
5228 // RssAnon from /proc/pid/status.
5229 optional int32 anon_rss_in_kilobytes = 6;
5230
5231 // The current swap size of the process.
5232 // VmSwap from /proc/pid/status.
5233 optional int32 swap_in_kilobytes = 7;
5234
5235 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5236 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5237}
5238
5239/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005240 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005241 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005242message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005243 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005244}
5245
5246/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005247 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005248 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005249message SystemUptime {
5250 // Milliseconds since the system was booted.
5251 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5252 // for external input).
5253 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005254 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005255}
5256
5257/*
5258 * Reads from /proc/uid_concurrent_active_time which has the format:
5259 * active: X (X is # cores)
5260 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5261 * [uid1]: [time-0] [time-1] [time-2] ... ...
5262 * ...
5263 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5264 * The file contains a monotonically increasing count of time for a single boot.
5265 */
5266message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005267 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005268 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005269}
5270
5271/**
5272 * Reads from /proc/uid_concurrent_policy_time which has the format:
5273 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5274 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5275 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5276 * ...
5277 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5278 * The file contains a monotonically increasing count of time for a single boot.
5279 */
5280message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005281 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005282 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005283 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005284}
5285
5286/*
5287 * Pulls free disk space, for data, system partition and temporary directory.
5288 */
5289message DiskSpace {
5290 // available bytes in data partition
5291 optional uint64 data_available_bytes = 1;
5292 // available bytes in system partition
5293 optional uint64 system_available_bytes = 2;
5294 // available bytes in download cache or temp directories
5295 optional uint64 temp_available_bytes = 3;
5296}
Tej Singhbf972d92018-01-10 20:51:13 -08005297
5298/**
5299 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005300 *
5301 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005302 */
5303message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005304 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005305}
5306
5307/**
5308 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005309 * Pulled from:
5310 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005311 */
5312message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005313 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005314}
5315
5316/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005317 * Pulls battery voltage.
5318 * Pulled from:
5319 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5320 */
5321message BatteryVoltage {
5322 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005323 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005324}
5325
5326/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005327 * Pulls battery level (percent full, from 0 to 100).
5328 *
5329 * Pulled from:
5330 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5331 */
5332message BatteryLevel {
5333 // Battery level. Should be in [0, 100].
5334 optional int32 battery_level = 1;
5335}
5336
5337/**
Tej Singhd89137e2018-03-26 14:51:40 -07005338 * Pulls the temperature of various parts of the device.
5339 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005340 *
Maggie White442b6312019-04-05 16:26:44 -07005341 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005342 */
5343message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005344 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005345 optional android.os.TemperatureTypeEnum sensor_location = 1;
5346
5347 // The name of the temperature source. Eg. CPU0
5348 optional string sensor_name = 2;
5349
Tej Singhd89137e2018-03-26 14:51:40 -07005350 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005351 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005352 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005353
5354 // Relative severity of the throttling, see enum definition.
5355 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005356}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005357
5358/**
5359 * Pulls the statistics of calls to Binder.
5360 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005361 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5362 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005363 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005364 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005365 */
5366message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005367 // UID of the process responsible for the binder transaction. It will be set if the process
5368 // executing the binder transaction attribute the transaction to another uid using
5369 // Binder.setThreadWorkSource().
5370 //
5371 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005372 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005373 // UID of the process executing the binder transaction.
5374 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005375 // Fully qualified class name of the API call.
5376 //
5377 // This is a system server class name.
5378 //
5379 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5380 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5381 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5382 // commonly used APIs.
5383 optional string service_class_name = 2;
5384 // Method name of the API call. It can also be a transaction code if we cannot
5385 // resolve it to a name. See Binder#getTransactionName.
5386 //
5387 // This is a system server method name.
5388 optional string service_method_name = 3;
5389 // Total number of API calls.
5390 optional int64 call_count = 4;
5391 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5392 optional bool screen_interactive = 13;
5393 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5394 // call_count will be equal to recorded_call_count.
5395 //
5396 // If recorded_call_count is different than call_count, it means data collection has been
5397 // sampled. All the fields below will be sampled in this case.
5398 optional int64 recorded_call_count = 12;
5399 // Number of exceptions thrown by the API.
5400 optional int64 recorded_exception_count = 5;
5401 // Total latency of all API calls.
5402 // Average can be computed using total_latency_micros / recorded_call_count.
5403 optional int64 recorded_total_latency_micros = 6;
5404 // Maximum latency of one API call.
5405 optional int64 recorded_max_latency_micros = 7;
5406 // Total CPU usage of all API calls.
5407 // Average can be computed using total_cpu_micros / recorded_call_count.
5408 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5409 optional int64 recorded_total_cpu_micros = 8;
5410 // Maximum CPU usage of one API call.
5411 optional int64 recorded_max_cpu_micros = 9;
5412 // Maximum parcel reply size of one API call.
5413 optional int64 recorded_max_reply_size_bytes = 10;
5414 // Maximum parcel request size of one API call.
5415 optional int64 recorded_max_request_size_bytes = 11;
5416}
5417
5418/**
5419 * Pulls the statistics of exceptions during calls to Binder.
5420 *
5421 * Binder stats are cumulative from boot unless somebody reset the data using
5422 * > adb shell dumpsys binder_calls_stats --reset
5423 */
5424message BinderCallsExceptions {
5425 // Exception class name, e.g. java.lang.IllegalArgumentException.
5426 //
5427 // This is an exception class name thrown by the system server.
5428 optional string exception_class_name = 1;
5429 // Total number of exceptions.
5430 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005431}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005432
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005433/**
5434 * Pulls the statistics of message dispatching on HandlerThreads.
5435 *
5436 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5437 * config on the device.
5438 *
5439 * Next tag: 11
5440 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005441message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005442 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005443 optional int32 uid = 1 [(is_uid) = true];
5444
5445 // Fully qualified class name of the handler target class.
5446 //
5447 // This field does not contain PII. This is a system server class name.
5448 optional string handler_class_name = 2;
5449
5450 // The name of the thread that runs the Looper.
5451 //
5452 // This field does not contain PII. This is a system server thread name.
5453 optional string looper_thread_name = 3;
5454
5455 // The name of the dispatched message.
5456 //
5457 // This field does not contain PII. This is a system server constant or class
5458 // name.
5459 optional string message_name = 4;
5460
5461 // Total number of successfully dispatched messages.
5462 optional int64 message_count = 5;
5463
5464 // Total number of messages that failed dispatching.
5465 optional int64 exception_count = 6;
5466
5467 // Total number of processed messages we have data recorded for. If we
5468 // collected data for all the messages, message_count will be equal to
5469 // recorded_message_count.
5470 //
5471 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005472 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005473 optional int64 recorded_message_count = 7;
5474
5475 // Total latency of all processed messages.
5476 // Average can be computed using recorded_total_latency_micros /
5477 // recorded_message_count.
5478 optional int64 recorded_total_latency_micros = 8;
5479
5480 // Total CPU usage of all processed message.
5481 // Average can be computed using recorded_total_cpu_micros /
5482 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005483 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005484 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005485
5486 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5487 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005488
5489 // Max recorded CPU usage of all processed messages.
5490 optional int64 recorded_max_cpu_micros = 11;
5491
5492 // Max recorded latency of all processed messages.
5493 optional int64 recorded_max_latency_micros = 12;
5494
5495 // Total number of messages we tracked the dispatching delay for. If we
5496 // collected data for all the messages, message_count will be equal to
5497 // recorded_delay_message_count.
5498 //
5499 // If recorded_delay_message_count is different than message_count, it means data
5500 // collection has been sampled or/and not all messages specified the target dispatch time.
5501 // The fields below will be sampled in this case.
5502 optional int64 recorded_delay_message_count = 13;
5503
5504 // Total dispatching delay of all processed messages.
5505 // Calculated as a difference between the target dispatching time (Message.when)
5506 // and the actual dispatching time.
5507 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5508 optional int64 recorded_total_delay_millis = 14;
5509
5510 // Max dispatching delay of all processed messages.
5511 // Calculated as a difference between the target dispatching time (Message.when)
5512 // and the actual dispatching time.
5513 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005514}
Tej Singh86dc9db2018-09-06 00:39:57 +00005515
5516/**
5517 * Pulls disk information, such as write speed and latency.
5518 */
5519message DiskStats {
5520 // Time taken to open, write 512B to, and close a file.
5521 // -1 if error performing the check.
5522 optional int64 data_write_latency_millis = 1;
5523
5524 optional bool file_based_encryption = 2;
5525
5526 // Recent disk write speed in kB/s.
5527 // -1 if error querying storageed.
5528 // 0 if data is unavailable.
5529 optional int32 recent_disk_write_speed = 3;
5530}
5531
5532
5533/**
5534 * Free and total bytes of the Data, Cache, and System partition.
5535 */
5536message DirectoryUsage {
5537 enum Directory {
5538 UNKNOWN = 0;
5539 DATA = 1;
5540 CACHE = 2;
5541 SYSTEM = 3;
5542 }
5543 optional Directory directory = 1;
5544 optional int64 free_bytes = 2;
5545 optional int64 total_bytes = 3;
5546}
5547
5548
5549/**
5550 * Size of an application: apk size, data size, and cache size.
5551 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5552 * Information is only reported for apps with the primary user (user 0).
5553 * Sizes are aggregated by package name.
5554 */
5555message AppSize {
5556 // Including uids will involve modifying diskstats logic.
5557 optional string package_name = 1;
5558 // App size in bytes. -1 if unavailable.
5559 optional int64 app_size_bytes = 2;
5560 // App data size in bytes. -1 if unavailable.
5561 optional int64 app_data_size_bytes = 3;
5562 // App cache size in bytes. -1 if unavailable.
5563 optional int64 app_cache_size_bytes = 4;
5564 // Time that the cache file was produced.
5565 // Uses System.currentTimeMillis(), which is wall clock time.
5566 optional int64 cache_time_millis = 5;
5567}
5568
5569
5570/**
5571 * Size of a particular category. Eg: photos, videos.
5572 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5573 */
5574message CategorySize {
5575 enum Category {
5576 UNKNOWN = 0;
5577 APP_SIZE = 1;
5578 APP_DATA_SIZE = 2;
5579 APP_CACHE_SIZE = 3;
5580 PHOTOS = 4;
5581 VIDEOS = 5;
5582 AUDIO = 6;
5583 DOWNLOADS = 7;
5584 SYSTEM = 8;
5585 OTHER = 9;
5586 }
5587 optional Category category = 1;
5588 // Category size in bytes.
5589 optional int64 size_bytes = 2;
5590 // Time that the cache file was produced.
5591 // Uses System.currentTimeMillis(), which is wall clock time.
5592 optional int64 cache_time_millis = 3;
5593}
Tej Singhd6d6d772018-09-05 17:41:25 -07005594
5595/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005596 * Pulls per uid I/O stats. The stats are cumulative since boot.
5597 *
5598 * Read/write bytes are I/O events from a storage device
5599 * Read/write chars are data requested by read/write syscalls, and can be
5600 * satisfied by caching.
5601 *
5602 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5603 */
5604message DiskIo {
5605 optional int32 uid = 1 [(is_uid) = true];
5606 optional int64 fg_chars_read = 2;
5607 optional int64 fg_chars_write = 3;
5608 optional int64 fg_bytes_read = 4;
5609 optional int64 fg_bytes_write = 5;
5610 optional int64 bg_chars_read = 6;
5611 optional int64 bg_chars_write = 7;
5612 optional int64 bg_bytes_read = 8;
5613 optional int64 bg_bytes_write = 9;
5614 optional int64 fg_fsync = 10;
5615 optional int64 bg_fsync= 11;
5616}
5617
5618
5619/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005620 * Pulls the number of fingerprints for each user.
5621 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005622 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005623 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005624message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005625 // 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 fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005629 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005630}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005631
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005632/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005633 * Pulls the number of faces for each user.
5634 *
5635 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5636 */
5637message NumFacesEnrolled {
5638 // The associated user. Eg: 0 for owners, 10+ for others.
5639 // Defined in android/os/UserHandle.java
5640 optional int32 user = 1;
5641 // Number of faces registered to that user.
5642 optional int32 num_faces_enrolled = 2;
5643}
5644/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005645 * A mapping of role holder -> role
5646 */
5647message RoleHolder {
5648 // uid of the role holder
5649 optional int32 uid = 1 [(is_uid) = true];
5650
5651 // package name of the role holder
5652 optional string package_name = 2;
5653
5654 // the role held
5655 optional string role = 3;
5656}
5657
Yangsteraf9aee72018-10-12 09:26:16 -07005658message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005659 // These are all in byte resolution.
5660 optional int64 min = 1 [deprecated = true];
5661 optional int64 average = 2 [deprecated = true];
5662 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005663
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005664 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5665 // int64 fields.
5666 optional int32 mean_kb = 4;
5667 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005668}
5669
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005670// A reduced subset of process states; reducing the number of possible states allows more
5671// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5672enum ProcessStateAggregated {
5673 PROCESS_STATE_UNKNOWN = 0;
5674 // Persistent system process.
5675 PROCESS_STATE_PERSISTENT = 1;
5676 // Top activity; actually any visible activity.
5677 PROCESS_STATE_TOP = 2;
5678 // Process binding to top or a foreground service.
5679 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5680 // Processing running a foreground service.
5681 PROCESS_STATE_FGS = 4;
5682 // Important foreground process (ime, wallpaper, etc).
5683 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5684 // Important background process.
5685 PROCESS_STATE_BACKGROUND = 6;
5686 // Process running a receiver.
5687 PROCESS_STATE_RECEIVER = 7;
5688 // All kinds of cached processes.
5689 PROCESS_STATE_CACHED = 8;
5690}
5691
5692// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005693message ProcessStatsStateProto {
5694 optional android.service.procstats.ScreenState screen_state = 1;
5695
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005696 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005697
5698 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5699 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005700 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5701
5702 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005703
5704 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005705 optional int64 duration_millis = 4 [deprecated = true];
5706 // Same as above, but with minute resolution so it fits into an int32.
5707 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005708
5709 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005710 optional int64 realtime_duration_millis = 9 [deprecated = true];
5711 // Same as above, but with minute resolution so it fits into an int32.
5712 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005713
5714 // # of samples taken
5715 optional int32 sample_size = 5;
5716
5717 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005718 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005719
5720 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005721 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005722
5723 // RSS is memory resident for this process
5724 optional AggStats rss = 8;
5725}
5726
Jing Ji060d6862020-04-13 19:36:31 -07005727// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005728message ProcessStatsProto {
5729 // Name of process.
5730 optional string process = 1;
5731
5732 // Uid of the process.
5733 optional int32 uid = 2;
5734
5735 // Information about how often kills occurred
5736 message Kill {
5737 // Count of excessive CPU kills
5738 optional int32 cpu = 1;
5739
5740 // Count of kills when cached
5741 optional int32 cached = 2;
5742
5743 // PSS stats during cached kill
5744 optional AggStats cached_pss = 3;
5745 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005746 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005747
5748 // Time and memory spent in various states.
5749 repeated ProcessStatsStateProto states = 5;
5750
5751 // Total time process has been running... screen_state, memory_state, and process_state
5752 // will not be set.
5753 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005754
5755 // Association data for this process in this state;
5756 // each entry here is one association.
5757 repeated ProcessStatsAssociationProto assocs = 7;
5758}
5759
5760// Next Tag: 5
5761message ProcessStatsAssociationProto {
5762 // Procss Name of the associated process (client process of service binding)
5763 optional string assoc_process_name = 1;
5764
5765 // Package Name of the associated package (client package of service binding)
5766 optional string assoc_package_name = 2;
5767
5768 // Total count of the times this association (service binding) appeared.
5769 optional int32 total_count = 3;
5770
5771 // Uptime total duration in seconds this association (service binding) was around.
5772 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005773}
5774
5775message PackageServiceOperationStatsProto {
5776 // Operate enum: Started, Foreground, Bound, Executing
5777 optional android.service.procstats.ServiceOperationState operation = 1;
5778
5779 // Number of times the service was in this operation.
5780 optional int32 count = 2;
5781
5782 // Information about a state the service can be in.
5783 message StateStats {
5784 // Screen state enum.
5785 optional android.service.procstats.ScreenState screen_state = 1;
5786 // Memory state enum.
5787 optional android.service.procstats.MemoryState memory_state = 2;
5788
5789 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005790 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005791 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005792 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005793 }
5794 repeated StateStats state_stats = 3;
5795}
5796
5797message PackageServiceStatsProto {
5798 // Name of service component.
5799 optional string service_name = 1;
5800
5801 // The operation stats.
5802 // The package_name, package_uid, package_version, service_name will not be set to save space.
5803 repeated PackageServiceOperationStatsProto operation_stats = 2;
5804}
5805
5806message PackageAssociationSourceProcessStatsProto {
5807 // Uid of the process.
5808 optional int32 process_uid = 1;
5809 // Process name.
5810 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005811 // Package name.
5812 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005813 // Total count of the times this association appeared.
5814 optional int32 total_count = 3;
5815
5816 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005817 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005818
5819 // Total count of the times this association became actively impacting its target process.
5820 optional int32 active_count = 5;
5821
5822 // Information on one source in this association.
5823 message StateStats {
5824 // Process state enum.
5825 optional android.service.procstats.ProcessState process_state = 1;
5826 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005827 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005828 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005829 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005830 }
5831 repeated StateStats active_state_stats = 6;
5832}
5833
5834message PackageAssociationProcessStatsProto {
5835 // Name of the target component.
5836 optional string component_name = 1;
5837 // Information on one source in this association.
5838 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5839}
5840
5841
5842message ProcessStatsPackageProto {
5843 // Name of package.
5844 optional string package = 1;
5845
5846 // Uid of the package.
5847 optional int32 uid = 2;
5848
5849 // Version of the package.
5850 optional int64 version = 3;
5851
5852 // Stats for each process running with the package loaded in to it.
5853 repeated ProcessStatsProto process_stats = 4;
5854
5855 // Stats for each of the package's services.
5856 repeated PackageServiceStatsProto service_stats = 5;
5857
5858 // Stats for each association with the package.
5859 repeated PackageAssociationProcessStatsProto association_stats = 6;
5860}
5861
5862message ProcessStatsSectionProto {
5863 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005864 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005865
5866 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005867 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005868
5869 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005870 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005871
5872 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005873 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005874
5875 // System runtime library. e.g. "libdvm.so", "libart.so".
5876 optional string runtime = 5;
5877
5878 // whether kernel reports swapped pss.
5879 optional bool has_swapped_pss = 6;
5880
5881 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5882 enum Status {
5883 STATUS_UNKNOWN = 0;
5884 STATUS_COMPLETE = 1;
5885 STATUS_PARTIAL = 2;
5886 STATUS_SHUTDOWN = 3;
5887 STATUS_SYSPROPS = 4;
5888 }
5889 repeated Status status = 7;
5890
Chenjie Yub2ecc792019-01-17 10:27:26 -08005891 // Number of pages available of various types and sizes, representation fragmentation.
5892 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5893
Yangsteraf9aee72018-10-12 09:26:16 -07005894 // Stats for each process.
5895 repeated ProcessStatsProto process_stats = 8;
5896
5897 // Stats for each package.
5898 repeated ProcessStatsPackageProto package_stats = 9;
5899}
5900
Chenjie Yub2ecc792019-01-17 10:27:26 -08005901message ProcessStatsAvailablePagesProto {
5902 // Node these pages are in (as per /proc/pagetypeinfo)
5903 optional int32 node = 1;
5904
5905 // Zone these pages are in (as per /proc/pagetypeinfo)
5906 optional string zone = 2;
5907
5908 // Label for the type of these pages (as per /proc/pagetypeinfo)
5909 optional string label = 3;
5910
5911 // Distribution of number of pages available by order size. First entry in array is
5912 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5913 repeated int32 pages_per_order = 4;
5914}
5915
Chenjie Yu12e5e672018-09-14 15:54:59 -07005916/**
5917 * Pulled from ProcessStatsService.java
5918 */
5919message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005920 optional ProcessStatsSectionProto proc_stats_section = 1;
5921}
5922
Chenjie Yuf910b7802019-01-11 16:08:20 -08005923/**
5924 * Pulled from ProcessStatsService.java
5925 */
5926message ProcStatsPkgProc {
5927 optional ProcessStatsSectionProto proc_stats_section = 1;
5928}
5929
Chris Wrencdea3b72019-11-22 16:58:17 -05005930// Next Tag: 2
5931message PackageRemoteViewInfoProto {
5932 optional string package_name = 1;
5933 // add per-package additional info here (like channels)
5934}
5935
5936// Next Tag: 2
5937message NotificationRemoteViewsProto {
5938 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5939}
5940
5941/**
5942 * Pulled from NotificationManagerService.java
5943 */
5944message NotificationRemoteViews {
5945 optional NotificationRemoteViewsProto notification_remote_views = 1;
5946}
5947
Yotam Aron74299972020-01-16 16:20:58 +02005948/**
5949 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5950 */
5951message PackageNotificationPreferences {
5952 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005953 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005954 // Notification importance, which specifies when and how a notification is displayed.
5955 // Specified under core/java/android/app/NotificationManager.java.
5956 optional int32 importance = 2;
5957 // Lockscreen visibility as set by the user.
5958 optional int32 visibility = 3;
5959 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5960 // PreferencesHelper.java)
5961 optional int32 user_locked_fields = 4;
5962}
5963
5964/**
5965 * Atom that contains a list of a package's channel preferences, pulled from
5966 * NotificationManagerService.java.
5967 */
5968message PackageNotificationChannelPreferences {
5969 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005970 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005971 // Channel's ID. Should always be available.
5972 optional string channel_id = 2;
5973 // Channel's name. Should always be available.
5974 optional string channel_name = 3;
5975 // Channel's description. Optionally set by the channel creator.
5976 optional string description = 4;
5977 // Notification importance, which specifies when and how a notification is displayed. Specified
5978 // under core/java/android/app/NotificationManager.java.
5979 optional int32 importance = 5;
5980 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5981 // at core/java/android/app/NotificationChannel.java
5982 optional int32 user_locked_fields = 6;
5983 // Indicates if the channel was deleted by the app.
5984 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04005985 // Indicates if the channel was marked as a conversation by the app.
5986 optional bool is_conversation = 8;
5987 // Indicates if the channel is a conversation that was demoted by the user.
5988 optional bool is_demoted_conversation = 9;
5989 // Indicates if the channel is a conversation that was marked as important by the user.
5990 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02005991}
5992
5993/**
5994 * Atom that contains a list of a package's channel group preferences, pulled from
5995 * NotificationManagerService.java.
5996 */
5997message PackageNotificationChannelGroupPreferences {
5998 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005999 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006000 // Channel Group's ID. Should always be available.
6001 optional string group_id = 2;
6002 // Channel Group's name. Should always be available.
6003 optional string group_name = 3;
6004 // Channel Group's description. Optionally set by group creator.
6005 optional string description = 4;
6006 // Indicates if notifications from this channel group are blocked.
6007 optional bool is_blocked = 5;
6008 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6009 // at core/java/android/app/NotificationChannelGroup.java
6010 optional int32 user_locked_fields = 6;
6011}
6012
Yangsteraf9aee72018-10-12 09:26:16 -07006013message PowerProfileProto {
6014 optional double cpu_suspend = 1;
6015
6016 optional double cpu_idle = 2;
6017
6018 optional double cpu_active = 3;
6019
6020 message CpuCluster {
6021 optional int32 id = 1;
6022 optional double cluster_power = 2;
6023 optional int32 cores = 3;
6024 repeated int64 speed = 4;
6025 repeated double core_power = 5;
6026 }
6027
6028 repeated CpuCluster cpu_cluster = 40;
6029
6030 optional double wifi_scan = 4;
6031
6032 optional double wifi_on = 5;
6033
6034 optional double wifi_active = 6;
6035
6036 optional double wifi_controller_idle = 7;
6037
6038 optional double wifi_controller_rx = 8;
6039
6040 optional double wifi_controller_tx = 9;
6041
6042 repeated double wifi_controller_tx_levels = 10;
6043
6044 optional double wifi_controller_operating_voltage = 11;
6045
6046 optional double bluetooth_controller_idle = 12;
6047
6048 optional double bluetooth_controller_rx = 13;
6049
6050 optional double bluetooth_controller_tx = 14;
6051
6052 optional double bluetooth_controller_operating_voltage = 15;
6053
6054 optional double modem_controller_sleep = 16;
6055
6056 optional double modem_controller_idle = 17;
6057
6058 optional double modem_controller_rx = 18;
6059
6060 repeated double modem_controller_tx = 19;
6061
6062 optional double modem_controller_operating_voltage = 20;
6063
6064 optional double gps_on = 21;
6065
6066 repeated double gps_signal_quality_based = 22;
6067
6068 optional double gps_operating_voltage = 23;
6069
6070 optional double bluetooth_on = 24;
6071
6072 optional double bluetooth_active = 25;
6073
6074 optional double bluetooth_at_cmd = 26;
6075
6076 optional double ambient_display = 27;
6077
6078 optional double screen_on = 28;
6079
6080 optional double radio_on = 29;
6081
6082 optional double radio_scanning = 30;
6083
6084 optional double radio_active = 31;
6085
6086 optional double screen_full = 32;
6087
6088 optional double audio = 33;
6089
6090 optional double video = 34;
6091
6092 optional double flashlight = 35;
6093
6094 optional double memory = 36;
6095
6096 optional double camera = 37;
6097
6098 optional double wifi_batched_scan = 38;
6099
6100 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006101}
Chenjie Yuab530202018-09-26 12:39:20 -07006102
6103/**
6104 * power_profile.xml and other constants for power model calculations.
6105 * Pulled from PowerProfile.java
6106 */
6107message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006108 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006109}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006110
6111/**
arangelovd5db50e2018-10-12 20:24:39 +01006112 * Logs when a user restriction was added or removed.
6113 *
6114 * Logged from:
6115 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6116 */
6117message UserRestrictionChanged {
6118 // The raw string of the user restriction as defined in UserManager.
6119 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6120 optional string restriction = 1;
6121 // Whether the restriction is enabled or disabled.
6122 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006123}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006124
6125/**
6126 * Pulls process user time and system time. Puller takes a snapshot of all pids
6127 * in the system and returns cpu stats for those that are working at the time.
6128 * Dead pids will be dropped. Kernel processes are excluded.
6129 * Min cool-down is 5 sec.
6130 */
6131message ProcessCpuTime {
6132 optional int32 uid = 1 [(is_uid) = true];
6133
6134 optional string process_name = 2;
6135 // Process cpu time in user space, cumulative from boot/process start
6136 optional int64 user_time_millis = 3;
6137 // Process cpu time in system space, cumulative from boot/process start
6138 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006139}
Misha Wagner5a51e002018-10-03 15:04:09 +01006140
6141/**
6142 * Pulls the CPU usage for each thread.
6143 *
6144 * Read from /proc/$PID/task/$TID/time_in_state files.
6145 *
6146 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6147 * time_in_state files not being present on some phones, have not been addressed. These should be
6148 * considered before a public release.
6149 */
6150message CpuTimePerThreadFreq {
6151 // UID that owns the process.
6152 optional int32 uid = 1 [(is_uid) = true];
6153 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006154 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006155 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006156 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006157 // Name of the process taken from `/proc/$PID/cmdline`.
6158 optional string process_name = 4;
6159 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6160 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006161
6162 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6163 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6164 // frequencies are given here as the alternative is sending eight separate atoms. This method
6165 // significantly reduces the amount of data created
6166 optional int32 frequency1_khz = 6;
6167 optional int32 time1_millis = 7;
6168 optional int32 frequency2_khz = 8;
6169 optional int32 time2_millis = 9;
6170 optional int32 frequency3_khz = 10;
6171 optional int32 time3_millis = 11;
6172 optional int32 frequency4_khz = 12;
6173 optional int32 time4_millis = 13;
6174 optional int32 frequency5_khz = 14;
6175 optional int32 time5_millis = 15;
6176 optional int32 frequency6_khz = 16;
6177 optional int32 time6_millis = 17;
6178 optional int32 frequency7_khz = 18;
6179 optional int32 time7_millis = 19;
6180 optional int32 frequency8_khz = 20;
6181 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006182}
Bookatz75ee60422018-11-09 12:27:37 -08006183
6184/**
Bookatz366a4432018-11-20 09:42:33 -08006185 * Pulls information about the device's build.
6186 */
6187message BuildInformation {
6188 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6189 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6190 optional string fingerprint = 1;
6191
6192 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6193 optional string brand = 2;
6194
6195 // Build.PRODUCT. The name of the overall product.
6196 optional string product = 3;
6197
6198 // Build.DEVICE. The name of the industrial design.
6199 optional string device = 4;
6200
6201 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6202 optional string version_release = 5;
6203
6204 // Build.ID. E.g. a label like "M4-rc20".
6205 optional string id = 6;
6206
6207 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6208 // represent this build.
6209 optional string version_incremental = 7;
6210
6211 // Build.TYPE. The type of build, like "user" or "eng".
6212 optional string type = 8;
6213
6214 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6215 optional string tags = 9;
6216}
6217
6218/**
Adam He420947c2019-01-23 15:59:09 -08006219 * Logs information about mismatched caller for content capture.
6220 *
6221 * Logged from:
6222 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6223 */
6224message ContentCaptureCallerMismatchReported {
6225 optional string intended_package = 1;
6226 optional string calling_package = 2;
6227}
6228
6229/**
6230 * Logs information about content capture service events.
6231 *
6232 * Logged from:
6233 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6234 */
6235message ContentCaptureServiceEvents {
6236 // The type of event.
6237 enum Event {
6238 UNKNOWN = 0;
6239 ON_CONNECTED = 1;
6240 ON_DISCONNECTED = 2;
6241 SET_WHITELIST = 3;
6242 SET_DISABLED = 4;
6243 ON_USER_DATA_REMOVED = 5;
6244 }
6245 optional Event event = 1;
6246 // component/package of content capture service.
6247 optional string service_info = 2;
6248 // component/package of target.
6249 // it's a concatenated list of component/package for SET_WHITELIST event
6250 // separated by " ".
6251 optional string target_info = 3;
6252}
6253
6254/**
6255 * Logs information about content capture session events.
6256 *
6257 * Logged from:
6258 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6259 */
6260message ContentCaptureSessionEvents {
6261 // The type of event.
6262 enum Event {
6263 UNKNOWN = 0;
6264 ON_SESSION_STARTED = 1;
6265 ON_SESSION_FINISHED = 2;
6266 SESSION_NOT_CREATED = 3;
6267 }
6268 optional int32 session_id = 1;
6269 optional Event event = 2;
6270 // (n/a on session finished)
6271 optional int32 state_flags = 3;
6272 // component/package of content capture service.
6273 optional string service_info = 4;
6274 // component/package of app.
6275 // (n/a on session finished)
6276 optional string app_info = 5;
6277 optional bool is_child_session = 6;
6278}
6279
6280/**
6281 * Logs information about session being flushed.
6282 *
6283 * Logged from:
6284 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6285 */
6286message ContentCaptureFlushed {
6287 optional int32 session_id = 1;
6288 // component/package of content capture service.
6289 optional string service_info = 2;
6290 // component/package of app.
6291 optional string app_info = 3;
6292 // session start/finish events
6293 optional int32 child_session_started = 4;
6294 optional int32 child_session_finished = 5;
6295 // count of view events.
6296 optional int32 view_appeared_count = 6;
6297 optional int32 view_disappeared_count = 7;
6298 optional int32 view_text_changed_count = 8;
6299
6300 // Flush stats.
6301 optional int32 max_events = 9;
6302 optional int32 idle_flush_freq = 10;
6303 optional int32 text_flush_freq = 11;
6304 optional int32 flush_reason = 12;
6305}
6306
6307/**
Bookatz75ee60422018-11-09 12:27:37 -08006308 * Pulls on-device BatteryStats power use calculations for the overall device.
6309 */
6310message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006311 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6312 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6313 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6314 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006315}
6316
6317/**
6318 * Pulls on-device BatteryStats power use calculations broken down by uid.
6319 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6320 * that is attributed to non-uid items. They must all be included to get the total power use.
6321 */
6322message DeviceCalculatedPowerBlameUid {
6323 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6324 optional int32 uid = 1 [(is_uid) = true];
6325
Bookatz3dbc13a2018-12-21 12:16:51 -08006326 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6327 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6328 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006329}
6330
6331/**
6332 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6333 * drain type.
6334 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6335 * is attributed uids. They must all be included to get the total power use.
6336 */
6337message DeviceCalculatedPowerBlameOther {
6338 // The type of item whose power use is being reported.
6339 enum DrainType {
6340 AMBIENT_DISPLAY = 0;
6341 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6342 BLUETOOTH = 2;
6343 CAMERA = 3;
6344 // Cell-standby
6345 CELL = 4;
6346 FLASHLIGHT = 5;
6347 IDLE = 6;
6348 MEMORY = 7;
6349 // Amount that total computed drain exceeded the drain estimated using the
6350 // battery level changes and capacity.
6351 OVERCOUNTED = 8;
6352 PHONE = 9;
6353 SCREEN = 10;
6354 // Amount that total computed drain was below the drain estimated using the
6355 // battery level changes and capacity.
6356 UNACCOUNTED = 11;
6357 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6358 WIFI = 13;
6359 }
6360 optional DrainType drain_type = 1;
6361
Bookatz3dbc13a2018-12-21 12:16:51 -08006362 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6363 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6364 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006365}
arangelov4e994062018-11-13 16:12:38 +00006366
6367/**
6368 * Logs device policy features.
6369 *
6370 * Logged from:
6371 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6372 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6373 */
6374message DevicePolicyEvent {
6375 // The event id - unique for each event.
6376 optional android.stats.devicepolicy.EventId event_id = 1;
6377 // The admin package name.
6378 optional string admin_package_name = 2;
6379 // A generic integer parameter.
6380 optional int32 integer_value = 3;
6381 // A generic boolean parameter.
6382 optional bool boolean_value = 4;
6383 // A parameter specifying a time period in milliseconds.
6384 optional uint64 time_period_millis = 5;
6385 // A parameter specifying a list of package names, bundle extras or string parameters.
6386 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6387}
shawnlinea5b66b2018-11-13 15:05:29 +08006388
6389/**
6390 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6391 *
6392 * Logged from:
6393 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6394 */
6395message DocsUILaunchReported {
6396 optional android.stats.docsui.LaunchAction launch_action = 1;
6397 optional bool has_initial_uri = 2;
6398 optional android.stats.docsui.MimeType mime_type = 3;
6399 optional android.stats.docsui.Root initial_root = 4;
6400}
6401
6402/**
6403 * Logs root/app visited event in file managers/picker. Call this when the user
6404 * taps on root/app in hamburger menu.
6405 *
6406 * Logged from:
6407 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6408 */
6409message DocsUIRootVisitedReported {
6410 optional android.stats.docsui.ContextScope scope = 1;
6411 optional android.stats.docsui.Root root = 2;
6412}
6413
6414/**
6415 * Logs file operation stats. Call this when a file operation has completed.
6416 *
6417 * Logged from:
6418 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6419 */
6420message DocsUIFileOperationReported {
6421 optional android.stats.docsui.Provider provider = 1;
6422 optional android.stats.docsui.FileOperation file_op = 2;
6423}
6424
6425/**
6426 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6427 * mode.
6428 *
6429 * Logged from:
6430 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6431 */
6432message DocsUIFileOperationCopyMoveModeReported {
6433 optional android.stats.docsui.FileOperation file_op = 1;
6434 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6435}
6436
6437
6438/**
6439 * Logs file sub operation stats. Call this when a file operation has failed.
6440 *
6441 * Logged from:
6442 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6443 */
6444message DocsUIFileOperationFailureReported {
6445 optional android.stats.docsui.Authority authority = 1;
6446 optional android.stats.docsui.SubFileOperation sub_op = 2;
6447}
6448
6449/**
6450* Logs the cancellation of a file operation. Call this when a job is canceled
6451*
6452* Logged from:
6453* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6454*/
6455message DocsUIFileOperationCanceledReported {
6456 optional android.stats.docsui.FileOperation file_op = 1;
6457}
6458
6459/**
6460 * Logs startup time in milliseconds.
6461 *
6462 * Logged from:
6463 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6464 */
6465message DocsUIStartupMsReported {
6466 optional int32 startup_millis = 1;
6467}
6468
6469/**
6470 * Logs the action that was started by user.
6471 *
6472 * Logged from:
6473 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6474 */
6475message DocsUIUserActionReported {
6476 optional android.stats.docsui.UserAction action = 1;
6477}
6478
6479/**
6480 * Logs the invalid type when invalid scoped access is requested.
6481 *
6482 * Logged from:
6483 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6484 */
6485message DocsUIInvalidScopedAccessRequestReported {
6486 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006487}
Ben Murdochbab399f2018-12-06 11:01:38 +00006488
6489/**
shawnlina75e82d2019-01-07 10:31:12 +08006490 * Logs the package name that launches docsui picker mode.
6491 *
6492 * Logged from:
6493 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6494 */
6495message DocsUIPickerLaunchedFromReported {
6496 optional string package_name = 1;
6497}
6498
6499/**
6500 * Logs the search type.
6501 *
6502 * Logged from:
6503 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6504 */
6505message DocsUISearchTypeReported {
6506 optional android.stats.docsui.SearchType search_type = 1;
6507}
6508
6509/**
6510 * Logs the search mode.
6511 *
6512 * Logged from:
6513 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6514 */
6515message DocsUISearchModeReported {
6516 optional android.stats.docsui.SearchMode search_mode = 1;
6517}
6518
6519/**
6520 * Logs the pick result information.
6521 *
6522 * Logged from:
6523 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6524 */
6525message DocsUIPickResultReported {
6526 optional int32 total_action_count = 1;
6527 optional int64 duration_millis = 2;
6528 optional int32 file_count= 3;
6529 optional bool is_searching = 4;
6530 optional android.stats.docsui.Root picked_from = 5;
6531 optional android.stats.docsui.MimeType mime_type = 6;
6532 optional int32 repeatedly_pick_times = 7;
6533}
6534
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006535/** Logs the drag and drop of files.
6536
6537 * Logged from:
6538 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6539 */
6540message DocsUIDragAndDropReported {
6541 optional bool drag_initiated_from_docsui = 1;
6542}
6543
shawnlina75e82d2019-01-07 10:31:12 +08006544/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006545 * Logs when an app's memory is compacted.
6546 *
6547 * Logged from:
6548 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6549 */
6550message AppCompacted {
6551 // The pid of the process being compacted.
6552 optional int32 pid = 1;
6553
6554 // The name of the process being compacted.
6555 optional string process_name = 2;
6556
6557 // The type of compaction.
6558 enum Action {
6559 UNKNOWN = 0;
6560 SOME = 1;
6561 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006562 PERSISTENT = 3;
6563 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006564 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006565 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006566
6567 // Total RSS in kilobytes consumed by the process prior to compaction.
6568 optional int64 before_rss_total_kilobytes = 4;
6569
6570 // File RSS in kilobytes consumed by the process prior to compaction.
6571 optional int64 before_rss_file_kilobytes = 5;
6572
6573 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6574 optional int64 before_rss_anon_kilobytes = 6;
6575
6576 // Swap in kilobytes consumed by the process prior to compaction.
6577 optional int64 before_swap_kilobytes = 7;
6578
6579 // Total RSS in kilobytes consumed by the process after compaction.
6580 optional int64 after_rss_total_kilobytes = 8;
6581
6582 // File RSS in kilobytes consumed by the process after compaction.
6583 optional int64 after_rss_file_kilobytes = 9;
6584
6585 // Anonymous RSS in kilobytes consumed by the process after compaction.
6586 optional int64 after_rss_anon_kilobytes = 10;
6587
6588 // Swap in kilobytes consumed by the process after compaction.
6589 optional int64 after_swap_kilobytes = 11;
6590
6591 // The time taken to perform compaction in milliseconds.
6592 optional int64 time_to_compact_millis = 12;
6593
6594 // The last compaction action performed for this app.
6595 optional Action last_action = 13;
6596
Ben Murdoch01720b82018-12-19 18:03:44 +00006597 // The last time that compaction was attempted on this process in milliseconds
6598 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6599 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006600
Ben Murdoch885c21b2019-03-15 18:02:04 +00006601 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006602 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006603
6604 // The process state at the time of compaction.
6605 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006606
6607 // Free ZRAM in kilobytes before compaction.
6608 optional int64 before_zram_free_kilobytes = 17;
6609
6610 // Free ZRAM in kilobytes after compaction.
6611 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006612}
lifr157fc552018-12-12 16:38:04 +08006613
6614/**
lifrb6b90b62019-03-29 00:40:17 +08006615 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6616 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6617 *
lifr1f74b052019-04-16 22:16:30 +08006618 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6619 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6620 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6621 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006622 */
6623message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006624 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006625
lifr1f74b052019-04-16 22:16:30 +08006626 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006627
6628 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006629 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006630
lifr1f74b052019-04-16 22:16:30 +08006631 // Only valid for event_type = EVENT_GETADDRINFO.
6632 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006633
lifr1f74b052019-04-16 22:16:30 +08006634 // Flags passed to android_res_nsend() defined in multinetwork.h
6635 // Only valid for event_type = EVENT_RESNSEND.
6636 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006637
lifrad9becc2019-05-20 11:04:41 +08006638 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006639
6640 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006641 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006642
6643 // Additional pass-through fields opaque to statsd.
6644 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006645 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006646
6647 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6648 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006649}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006650
6651/**
6652 * Logs when a data stall event occurs.
6653 *
6654 * Log from:
6655 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6656 */
6657message DataStallEvent {
6658 // Data stall evaluation type.
6659 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6660 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6661 optional int32 evaluation_type = 1;
6662 // See definition in data_stall_event.proto.
6663 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6664 // See definition in data_stall_event.proto.
6665 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6666 // See definition in data_stall_event.proto.
6667 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6668 // See definition in data_stall_event.proto.
6669 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6670 // See definition in data_stall_event.proto.
6671 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6672}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006673
6674/*
6675 * Logs when RescueParty resets some set of experiment flags.
6676 *
6677 * Logged from:
6678 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6679 */
6680message RescuePartyResetReported {
6681 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6682 optional int32 rescue_level = 1;
6683}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006684
6685/**
6686 * Logs when signed config is received from an APK, and if that config was applied successfully.
6687 * Logged from:
6688 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6689 */
6690message SignedConfigReported {
6691 enum Type {
6692 UNKNOWN_TYPE = 0;
6693 GLOBAL_SETTINGS = 1;
6694 }
6695 optional Type type = 1;
6696
6697 // The final status of the signed config received.
6698 enum Status {
6699 UNKNOWN_STATUS = 0;
6700 APPLIED = 1;
6701 BASE64_FAILURE_CONFIG = 2;
6702 BASE64_FAILURE_SIGNATURE = 3;
6703 SECURITY_EXCEPTION = 4;
6704 INVALID_CONFIG = 5;
6705 OLD_CONFIG = 6;
6706 SIGNATURE_CHECK_FAILED = 7;
6707 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006708 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006709 }
6710 optional Status status = 2;
6711
6712 // The version of the signed config processed.
6713 optional int32 version = 3;
6714
6715 // The package name that the config was extracted from.
6716 optional string from_package = 4;
6717
6718 enum Key {
6719 NO_KEY = 0;
6720 DEBUG = 1;
6721 PRODUCTION = 2;
6722 }
6723 // Which key was used to verify the config.
6724 optional Key verified_with = 5;
6725}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006726
6727/*
6728 * Logs GNSS Network-Initiated (NI) location events.
6729 *
6730 * Logged from:
6731 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6732 */
6733message GnssNiEventReported {
6734 // The type of GnssNiEvent.
6735 enum EventType {
6736 UNKNOWN = 0;
6737 NI_REQUEST = 1;
6738 NI_RESPONSE = 2;
6739 }
6740 optional EventType event_type = 1;
6741
6742 // An ID generated by HAL to associate NI notifications and UI responses.
6743 optional int32 notification_id = 2;
6744
6745 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006746 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006747
6748 // NI requires notification.
6749 optional bool need_notify = 4;
6750
6751 // NI requires verification.
6752 optional bool need_verify = 5;
6753
6754 // NI requires privacy override, no notification/minimal trace.
6755 optional bool privacy_override = 6;
6756
6757 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6758 // seconds.
6759 optional int32 timeout = 7;
6760
6761 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006762 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006763
6764 // String representing the requester of the network inititated location request.
6765 optional string requestor_id = 9;
6766
6767 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6768 // network initiated location request.
6769 optional string text = 10;
6770
6771 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006772 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006773
6774 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006775 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006776
6777 // True if SUPL ES is enabled.
6778 optional bool is_supl_es_enabled = 13;
6779
6780 // True if GNSS location is enabled.
6781 optional bool is_location_enabled = 14;
6782
6783 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006784 optional android.server.location.GnssUserResponseType user_response = 15;
6785}
6786
6787/**
6788 * Logs GNSS non-framework (NFW) location notification.
6789 *
6790 * Logged from:
6791 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6792 */
6793message GnssNfwNotificationReported {
6794 // Package name of the Android proxy application representing the non-framework entity that
6795 // requested location. Set to empty string if unknown.
6796 optional string proxy_app_package_name = 1;
6797
6798 // Protocol stack that initiated the non-framework location request.
6799 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6800
6801 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6802 // set to empty string. This field is opaque to the framework and used for logging purposes.
6803 optional string other_protocol_stack_name = 3;
6804
6805 // Source initiating/receiving the location information.
6806 optional android.server.location.NfwRequestor requestor = 4;
6807
6808 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6809 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6810 // and used for logging purposes.
6811 optional string requestor_id = 5;
6812
6813 // Indicates whether location information was provided for this request.
6814 optional android.server.location.NfwResponseType response_type = 6;
6815
6816 // True if the device is in user initiated emergency session.
6817 optional bool in_emergency_mode = 7;
6818
6819 // True if cached location is provided.
6820 optional bool is_cached_location = 8;
6821
6822 // True if proxy app permission mismatch between framework and GNSS HAL.
6823 optional bool is_permission_mismatched = 9;
6824}
6825
6826/**
6827 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6828 *
6829 * Logged from:
6830 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6831 */
6832message GnssConfigurationReported {
6833 // SUPL host name.
6834 optional string supl_host = 1;
6835
6836 // SUPL port number.
6837 optional int32 supl_port = 2;
6838
6839 // C2K host name.
6840 optional string c2k_host = 3;
6841
6842 // C2K port number.
6843 optional int32 c2k_port = 4;
6844
6845 // The SUPL version requested by Carrier.
6846 optional int32 supl_ver = 5;
6847
6848 // The SUPL mode.
6849 optional android.server.location.SuplMode supl_mode = 6;
6850
6851 // True if NI emergency SUPL restrictions is enabled.
6852 optional bool supl_es = 7;
6853
6854 // LTE Positioning Profile settings
6855 optional android.server.location.LppProfile lpp_profile = 8;
6856
6857 // Positioning protocol on A-Glonass system.
6858 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6859
6860 // True if emergency PDN is used. Otherwise, regular PDN is used.
6861 optional bool use_emergency_pdn_for_emergency_supl= 10;
6862
6863 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6864 optional android.server.location.GpsLock gps_lock = 11;
6865
6866 // Number of seconds to extend the emergency session duration post emergency call.
6867 optional int32 es_extension_sec = 12;
6868
6869 // The full list of package names of proxy Android applications representing the non-framework
6870 // location access entities (on/off the device) for which the framework user has granted
6871 // non-framework location access permission. The package names are concatenated in one string
6872 // with spaces as separators.
6873 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006874}
Jack Yu95b64f32018-12-13 18:26:11 +08006875
6876/**
6877 * Logs when a NFC device's error occurred.
6878 * Logged from:
6879 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6880 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6881 */
6882message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006883 enum Type {
6884 UNKNOWN = 0;
6885 CMD_TIMEOUT = 1;
6886 ERROR_NOTIFICATION = 2;
6887 AID_OVERFLOW = 3;
6888 }
6889 optional Type type = 1;
6890 // If it's nci cmd timeout, log the timeout command.
6891 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006892
Alex Salod7c3eef2019-01-25 14:43:27 -08006893 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006894}
6895
6896/**
6897 * Logs when a NFC device's state changed event
6898 * Logged from:
6899 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6900 */
6901message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006902 enum State {
6903 UNKNOWN = 0;
6904 OFF = 1;
6905 ON = 2;
6906 ON_LOCKED = 3; // Secure Nfc enabled.
6907 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6908 }
6909 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006910}
6911
6912/**
6913 * Logs when a NFC Beam Transaction occurred.
6914 * Logged from:
6915 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6916 */
6917message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006918 enum Operation {
6919 UNKNOWN = 0;
6920 SEND = 1;
6921 RECEIVE = 2;
6922 }
6923 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006924}
6925
6926/**
6927 * Logs when a NFC Card Emulation Transaction occurred.
6928 * Logged from:
6929 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6930 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6931 */
6932message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006933 enum Category {
6934 UNKNOWN = 0;
6935 HCE_PAYMENT = 1;
6936 HCE_OTHER = 2;
6937 OFFHOST = 3;
6938 }
6939 // Transaction belongs to HCE payment or HCE other category, or offhost.
6940 optional Category category = 1;
6941 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6942 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006943}
6944
6945/**
6946 * Logs when a NFC Tag event occurred.
6947 * Logged from:
6948 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6949 */
6950message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006951 enum Type {
6952 UNKNOWN = 0;
6953 URL = 1;
6954 BT_PAIRING = 2;
6955 PROVISION = 3;
6956 WIFI_CONNECT = 4;
6957 APP_LAUNCH = 5;
6958 OTHERS = 6;
6959 }
6960 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006961}
6962
6963/**
6964 * Logs when Hce transaction triggered
6965 * Logged from:
6966 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6967 */
6968message NfcHceTransactionOccurred {
6969 // The latency period(in microseconds) it took for the first HCE data
6970 // exchange.
6971 optional uint32 latency_micros = 1;
6972}
6973
6974/**
6975 * Logs when SecureElement state event changed
6976 * Logged from:
6977 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6978 */
6979message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006980 enum State {
6981 UNKNOWN = 0;
6982 INITIALIZED = 1;
6983 DISCONNECTED = 2;
6984 CONNECTED = 3;
6985 HALCRASH = 4;
6986 }
6987 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006988
Alex Salod7c3eef2019-01-25 14:43:27 -08006989 optional string state_change_reason = 2;
6990 // SIMx or eSEx.
6991 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006992}
6993
6994/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006995 * Information about a permission grant request
6996 */
6997message PermissionGrantRequestResultReported {
6998 // unique value identifying an API call. A API call might result in multiple of these atoms
6999 optional int64 request_id = 1;
7000
7001 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007002 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007003
7004 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007005 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007006
7007 // The permission to be granted
7008 optional string permission_name = 4;
7009
7010 // If the permission was explicitly requested via the API or added by the system
7011 optional bool is_implicit = 5;
7012
7013 enum Result {
7014 UNDEFINED = 0;
7015 // permission request was ignored
7016 IGNORED = 1;
7017 // permission request was ignored because it was user fixed
7018 IGNORED_USER_FIXED = 2;
7019 // permission request was ignored because it was policy fixed
7020 IGNORED_POLICY_FIXED = 3;
7021 // permission was granted by user action
7022 USER_GRANTED = 4;
7023 // permission was automatically granted
7024 AUTO_GRANTED = 5;
7025 // permission was denied by user action
7026 USER_DENIED = 6;
7027 // permission was denied with prejudice by the user
7028 USER_DENIED_WITH_PREJUDICE = 7;
7029 // permission was automatically denied
7030 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007031 // permission request was ignored because permission is restricted
7032 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007033 // one time permission was granted by user action
7034 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007035 // user ignored request by leaving the request screen without choosing any option
7036 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007037 // user granted the permission after being linked to settings
7038 USER_GRANTED_IN_SETTINGS = 12;
7039 // user denied the permission after being linked to settings
7040 USER_DENIED_IN_SETTINGS = 13;
7041 // user denied the permission with prejudice after being linked to settings
7042 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7043 // permission was automatically revoked after one-time permission expired
7044 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007045 // permission was automatically revoked for unused app
7046 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007047 }
7048 // The result of the permission grant
7049 optional Result result = 6;
7050}
7051
7052/**
Jack Yu95b64f32018-12-13 18:26:11 +08007053 * Logs when Omapi API used
7054 * Logged from:
7055 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7056 */
7057message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007058 enum Operation {
7059 UNKNOWN = 0;
7060 OPEN_CHANNEL = 1;
7061 }
7062 optional Operation operation = 1;
7063 // SIMx or eSEx.
7064 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007065
Alex Salod7c3eef2019-01-25 14:43:27 -08007066 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007067}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007068
7069/**
Alex Saloa060aee2019-01-21 14:36:41 -08007070 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7071 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007072 * Logged from:
7073 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7074 */
7075message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007076 optional int64 dispatch_latency_millis = 1;
7077}
7078
7079/**
7080 * Logs AttentionManagerService attention check result.
7081 *
7082 * Logged from:
7083 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7084 */
7085message AttentionManagerServiceResultReported {
7086 // See core/java/android/service/attention/AttentionService.java
7087 enum AttentionCheckResult {
7088 UNKNOWN = 20;
7089 ATTENTION_SUCCESS_ABSENT = 0;
7090 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007091 ATTENTION_FAILURE_UNKNOWN = 2;
7092 ATTENTION_FAILURE_CANCELLED = 3;
7093 ATTENTION_FAILURE_PREEMPTED = 4;
7094 ATTENTION_FAILURE_TIMED_OUT = 5;
7095 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007096 }
7097 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007098}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007099
7100/**
7101 * Logs when an adb connection changes state.
7102 *
7103 * Logged from:
7104 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7105 */
7106message AdbConnectionChanged {
7107 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7108 // previously selected for this system.
7109 optional int64 last_connection_time_millis = 1;
7110
7111 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7112 // to reconnect via adb without user interaction.
7113 optional int64 auth_window_millis = 2;
7114
7115 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7116 optional android.debug.AdbConnectionStateEnum state = 3;
7117
7118 // True if the 'always allow' option was selected for this system.
7119 optional bool always_allow = 4;
7120}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007121
7122/*
7123 * Logs the reported speech DSP status.
7124 *
7125 * Logged from:
7126 * Vendor audio implementation.
7127 */
7128message SpeechDspStatReported {
7129 // The total Speech DSP uptime in milliseconds.
7130 optional int32 total_uptime_millis = 1;
7131 // The total Speech DSP downtime in milliseconds.
7132 optional int32 total_downtime_millis = 2;
7133 optional int32 total_crash_count = 3;
7134 optional int32 total_recover_count = 4;
7135}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007136
7137/**
7138 * Logs USB connector contaminant status.
7139 *
7140 * Logged from: USB Service.
7141 */
7142message UsbContaminantReported {
7143 optional string id = 1;
7144 optional android.service.usb.ContaminantPresenceStatus status = 2;
7145}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007146
7147/**
7148 * This atom is for debugging purpose.
7149 */
7150message DebugElapsedClock {
7151 // Monotically increasing value for each pull.
7152 optional int64 pull_count = 1;
7153 // Time from System.elapsedRealtime.
7154 optional int64 elapsed_clock_millis = 2;
7155 // Time from System.elapsedRealtime.
7156 optional int64 same_elapsed_clock_millis = 3;
7157 // Diff between current elapsed time and elapsed time from previous pull.
7158 optional int64 elapsed_clock_diff_millis = 4;
7159
7160 enum Type {
7161 TYPE_UNKNOWN = 0;
7162 ALWAYS_PRESENT = 1;
7163 PRESENT_ON_ODD_PULLS = 2;
7164 }
7165 // Type of behavior for the pulled data.
7166 optional Type type = 5;
7167}
7168
7169/**
7170 * This atom is for debugging purpose.
7171 */
7172message DebugFailingElapsedClock {
7173 // Monotically increasing value for each pull.
7174 optional int64 pull_count = 1;
7175 // Time from System.elapsedRealtime.
7176 optional int64 elapsed_clock_millis = 2;
7177 // Time from System.elapsedRealtime.
7178 optional int64 same_elapsed_clock_millis = 3;
7179 // Diff between current elapsed time and elapsed time from previous pull.
7180 optional int64 elapsed_clock_diff_millis = 4;
7181}
Steven Wuacef6bb2019-01-23 14:21:17 -05007182
7183/** Logs System UI bubbles event changed.
7184 *
7185 * Logged from:
7186 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7187 */
7188message BubbleUIChanged {
7189
7190 // The app package that is posting the bubble.
7191 optional string package_name = 1;
7192
7193 // The notification channel that is posting the bubble.
7194 optional string notification_channel = 2;
7195
7196 // The notification id associated with the posted bubble.
7197 optional int32 notification_id = 3;
7198
7199 // The position of the bubble within the bubble stack.
7200 optional int32 position = 4;
7201
7202 // The total number of bubbles within the bubble stack.
7203 optional int32 total_number = 5;
7204
7205 // User interactions with the bubble.
7206 enum Action {
7207 UNKNOWN = 0;
7208 POSTED = 1;
7209 UPDATED = 2;
7210 EXPANDED = 3;
7211 COLLAPSED = 4;
7212 DISMISSED = 5;
7213 STACK_DISMISSED = 6;
7214 STACK_MOVED = 7;
7215 HEADER_GO_TO_APP = 8;
7216 HEADER_GO_TO_SETTINGS = 9;
7217 PERMISSION_OPT_IN = 10;
7218 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007219 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007220 SWIPE_LEFT = 13;
7221 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007222 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007223 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007224 }
7225 optional Action action = 6;
7226
7227 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7228 optional float normalized_x_position = 7;
7229 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007230
7231 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7232 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007233
7234 // Whether the bubble is an on-going one.
7235 optional bool is_ongoing = 10;
7236
7237 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007238 // This is deprecated and the value should be ignored.
7239 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007240}
Kweku Adams8845d012018-12-11 20:06:45 -08007241
7242/**
Steven Wu552f63f2019-02-05 13:41:36 -05007243 * Logs System UI bubbles developer errors.
7244 *
7245 * Logged from:
7246 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7247 */
7248message BubbleDeveloperErrorReported {
7249
7250 // The app package that is posting the bubble.
7251 optional string package_name = 1;
7252
7253 // Bubble developer error type enums.
7254 enum Error {
7255 UNKNOWN = 0;
7256 ACTIVITY_INFO_MISSING = 1;
7257 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7258 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7259 }
7260 optional Error error = 2 [default = UNKNOWN];
7261}
7262
7263/**
Kweku Adams8845d012018-12-11 20:06:45 -08007264 * Logs that a constraint for a scheduled job has changed.
7265 *
7266 * Logged from:
7267 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7268 */
7269message ScheduledJobConstraintChanged {
7270 repeated AttributionNode attribution_node = 1;
7271
7272 // Name of the job.
7273 optional string job_name = 2;
7274
7275 optional com.android.server.job.ConstraintEnum constraint = 3;
7276
7277 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007278 UNKNOWN = 0;
7279 UNSATISFIED = 1;
7280 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007281 }
7282 optional State state = 4;
7283}
Alex Salod7c3eef2019-01-25 14:43:27 -08007284
7285/**
7286 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7287 * returns true.
7288 *
7289 * Logged from:
7290 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7291 */
7292message ScreenTimeoutExtensionReported {
7293 // Describes how many times in a row did the power manager reset the screen off timeout.
7294 optional uint32 consecutive_timeout_extended_count = 1;
7295}
Hui Yu885aca12019-01-10 17:11:34 -08007296
7297/*
7298* Logs number of milliseconds it takes to start a process.
7299* The definition of app process start time is from the app launch time to
7300* the time that Zygote finished forking the app process and loaded the
7301* application package's java classes.
7302
7303* This metric is different from AppStartOccurred which is for foreground
7304* activity only.
7305
7306* ProcessStartTime can report all processes (both foreground and background)
7307* start time.
7308*
7309* Logged from:
7310* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7311*/
7312message ProcessStartTime {
7313 // The uid of the ProcessRecord.
7314 optional int32 uid = 1 [(is_uid) = true];
7315
7316 // The process pid.
7317 optional int32 pid = 2;
7318
7319 // The process name.
7320 // Usually package name, "system" for system server.
7321 // Provided by ActivityManagerService.
7322 optional string process_name = 3;
7323
7324 enum StartType {
7325 UNKNOWN = 0;
7326 WARM = 1;
7327 HOT = 2;
7328 COLD = 3;
7329 }
7330
7331 // The start type.
7332 optional StartType type = 4;
7333
7334 // The elapsed realtime at the start of the process.
7335 optional int64 process_start_time_millis = 5;
7336
7337 // Number of milliseconds it takes to reach bind application.
7338 optional int32 bind_application_delay_millis = 6;
7339
7340 // Number of milliseconds it takes to finish start of the process.
7341 optional int32 process_start_delay_millis = 7;
7342
7343 // hostingType field in ProcessRecord, the component type such as "activity",
7344 // "service", "content provider", "broadcast" or other strings.
7345 optional string hosting_type = 8;
7346
7347 // hostingNameStr field in ProcessRecord. The component class name that runs
7348 // in this process.
7349 optional string hosting_name = 9;
7350}
7351
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007352/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007353 * Track Media Codec usage
7354 * Logged from:
7355 * frameworks/av/media/libstagefright/MediaCodec.cpp
7356 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7357 */
7358message MediametricsCodecReported {
7359 optional int64 timestamp_nanos = 1;
7360 optional string package_name = 2;
7361 optional int64 package_version_code = 3;
7362 optional int64 media_apex_version = 4;
7363
7364 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7365}
7366
7367/**
7368 * Track Media Extractor (pulling video/audio streams out of containers) usage
7369 * Logged from:
7370 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7371 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7372 */
7373message MediametricsExtractorReported {
7374 optional int64 timestamp_nanos = 1;
7375 optional string package_name = 2;
7376 optional int64 package_version_code = 3;
7377 optional int64 media_apex_version = 4;
7378
7379 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7380}
7381
7382/**
7383 * Track how we arbitrate between microphone/input requests.
7384 * Logged from
7385 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7386 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7387 */
7388message MediametricsAudiopolicyReported {
7389 optional int64 timestamp_nanos = 1;
7390 optional string package_name = 2;
7391 optional int64 package_version_code = 3;
7392 optional int64 media_apex_version = 4;
7393
7394 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7395}
7396
7397/**
7398 * Track how we arbitrate between microphone requests.
7399 * Logged from
7400 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7401 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7402 */
7403message MediametricsAudiorecordReported {
7404 optional int64 timestamp_nanos = 1;
7405 optional string package_name = 2;
7406 optional int64 package_version_code = 3;
7407 optional int64 media_apex_version = 4;
7408
7409 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7410}
7411
7412/**
7413 * Track how we arbitrate between microphone/input requests.
7414 * Logged from
7415 * frameworks/av/media/libnblog/ReportPerformance.cpp
7416 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7417 */
7418message MediametricsAudiothreadReported {
7419 optional int64 timestamp_nanos = 1;
7420 optional string package_name = 2;
7421 optional int64 package_version_code = 3;
7422 optional int64 media_apex_version = 4;
7423
7424 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7425}
7426
7427/**
7428 * Track how we arbitrate between microphone/input requests.
7429 * Logged from
7430 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7431 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7432 */
7433message MediametricsAudiotrackReported {
7434 optional int64 timestamp_nanos = 1;
7435 optional string package_name = 2;
7436 optional int64 package_version_code = 3;
7437 optional int64 media_apex_version = 4;
7438
7439 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7440}
7441
7442/**
7443 * Track information about DRM framework performance
7444 * Logged from
7445 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7446 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7447 */
7448message MediametricsMediadrmReported {
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 // vendor+description tell about which DRM plugin is in use on this device
7455 optional string vendor = 5;
7456 optional string description = 6;
7457 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7458 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7459}
7460
7461/**
7462 * Track information about the widevine DRM plugin performance
7463 * Logged from
7464 * vendor/widevine/libwvdrmengine/cdm/metrics
7465 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7466 */
7467message MediametricsDrmWidevineReported {
7468 optional int64 timestamp_nanos = 1;
7469 optional string package_name = 2;
7470 optional int64 package_version_code = 3;
7471 optional int64 media_apex_version = 4;
7472
7473 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7474}
7475
7476/**
7477 * Track information about recordings (e.g. camcorder)
7478 * Logged from
7479 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7480 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7481 */
7482message MediametricsRecorderReported {
7483 optional int64 timestamp_nanos = 1;
7484 optional string package_name = 2;
7485 optional int64 package_version_code = 3;
7486 optional int64 media_apex_version = 4;
7487
7488 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7489}
7490
7491/**
7492 * Track Media Player usage
7493 * Logged from:
7494 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7495 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7496 */
7497message MediametricsNuPlayerReported {
7498 optional int64 timestamp_nanos = 1;
7499 optional string package_name = 2;
7500 optional int64 package_version_code = 3;
7501 optional int64 media_apex_version = 4;
7502
7503 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7504}
7505
7506/**
Robert Shiha4beed32019-08-19 14:15:23 -07007507 * Track Legacy DRM usage
7508 * Logged from
7509 * frameworks/av/drm/drmserver/DrmManager.cpp
7510 */
7511message MediametricsDrmManagerReported {
7512 optional int64 timestamp_nanos = 1;
7513 optional string package_name = 2;
7514 optional int64 package_version_code = 3;
7515 optional int64 media_apex_version = 4;
7516
7517 enum Method {
7518 METHOD_NOT_FOUND = -1;
7519 GET_CONSTRAINTS = 0;
7520 GET_METADATA = 1;
7521 CAN_HANDLE = 2;
7522 PROCESS_DRM_INFO = 3;
7523 ACQUIRE_DRM_INFO = 4;
7524 SAVE_RIGHTS = 5;
7525 GET_ORIGINAL_MIME_TYPE = 6;
7526 GET_DRM_OBJECT_TYPE = 7;
7527 CHECK_RIGHTS_STATUS = 8;
7528 REMOVE_RIGHTS = 9;
7529 REMOVE_ALL_RIGHTS = 10;
7530 OPEN_CONVERT_SESSION = 11;
7531 OPEN_DECRYPT_SESSION = 12;
7532 }
7533
7534 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7535 optional string plugin_id = 5;
7536 optional string description = 6;
7537 optional Method method = 7;
7538 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007539
7540 optional int64 get_constraints_count = 9;
7541 optional int64 get_metadata_count = 10;
7542 optional int64 can_handle_count = 11;
7543 optional int64 process_drm_info_count = 12;
7544 optional int64 acquire_drm_info_count = 13;
7545 optional int64 save_rights_count = 14;
7546 optional int64 get_original_mime_type_count = 15;
7547 optional int64 get_drm_object_type_count = 16;
7548 optional int64 check_rights_status_count = 17;
7549 optional int64 remove_rights_count = 18;
7550 optional int64 remove_all_rights_count = 19;
7551 optional int64 open_convert_session_count = 20;
7552 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007553}
7554
7555/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007556 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007557 * Pulled from: StatsCompanionService
7558*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007559message DangerousPermissionState {
7560 // Name of the permission
7561 optional string permission_name = 1;
7562
7563 // Uid of the package
7564 optional int32 uid = 2 [(is_uid) = true];
7565
7566 // Package requesting the permission
7567 optional string package_name = 3;
7568
7569 // If the permission is granted to the uid
7570 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007571
7572 // Permission flags as per android.content.pm.PermissionFlags
7573 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007574}
7575
Michael Groover4a0ca942019-01-24 17:41:25 -08007576/**
7577 * Logs when a package is denied access to a device identifier based on the new access requirements.
7578 *
7579 * Logged from:
7580 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7581 */
7582message DeviceIdentifierAccessDenied {
7583 // The name of the package denied access to the requested device identifier.
7584 optional string package_name = 1;
7585
7586 // The name of the device identifier method the package attempted to invoke.
7587 optional string method_name = 2;
7588
7589 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007590 // Starting from Android 11, this boolean is not set and will always be false.
7591 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007592
7593 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007594 // Starting from Android 11, this boolean is not set and will always be false.
7595 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007596}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007597
7598/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007599 * Pulls the ongoing mainline install train version code.
7600 * Pulled from StatsCompanionService
7601 */
7602message TrainInfo {
7603 optional int64 train_version_code = 1;
7604
7605 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007606
7607 optional string train_name = 3;
7608
7609 enum Status {
7610 UNKNOWN = 0;
7611 INSTALL_REQUESTED = 1;
7612 INSTALL_STARTED = 2;
7613 INSTALL_STAGED_NOT_READY = 3;
7614 INSTALL_STAGED_READY = 4;
7615 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007616 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7617 // and INSTALL_FAILURE_COMMIT.
7618 INSTALL_FAILURE = 6 [deprecated = true];
7619 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007620 INSTALL_CANCELLED = 7;
7621 INSTALLER_ROLLBACK_REQUESTED = 8;
7622 INSTALLER_ROLLBACK_INITIATED = 9;
7623 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7624 INSTALLER_ROLLBACK_STAGED = 11;
7625 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7626 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7627 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7628 INSTALLER_ROLLBACK_SUCCESS = 15;
7629 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007630 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7631 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7632 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7633 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7634 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7635 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007636 INSTALL_FAILURE_DOWNLOAD = 23;
7637 INSTALL_FAILURE_STATE_MISMATCH = 24;
7638 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007639 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007640 }
7641 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007642}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007643
7644/**
7645 * Logs the gesture stage changed event.
7646 *
7647 * Logged from:
7648 * frameworks/base/packages/SystemUI/
7649 */
7650message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007651 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007652}
7653
7654/**
7655 * Logs the feedback type.
7656 *
7657 * Logged from:
7658 * frameworks/base/packages/SystemUI/
7659 */
7660message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007661 // Whether or not the gesture was used.
7662 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007663}
7664
7665/**
7666 * Logs the progress.
7667 *
7668 * Logged from:
7669 * frameworks/base/packages/SystemUI/
7670 */
7671message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007672 // [0,100] progress for the assist gesture.
7673 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007674}
Neil Fullerdb14b482019-02-05 19:44:44 +00007675
7676/*
7677 * Information about the time zone data on a device.
7678 */
7679message TimeZoneDataInfo {
7680 // A version identifier for the data set on device. e.g. "2018i"
7681 optional string tzdb_version = 1;
7682}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007683
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007684/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007685 * Logs the GPU stats global health information.
7686 *
7687 * Logged from:
7688 * frameworks/native/services/gpuservice/gpustats/
7689 */
7690message GpuStatsGlobalInfo {
7691 // Package name of the gpu driver.
7692 optional string driver_package_name = 1;
7693
7694 // Version name of the gpu driver.
7695 optional string driver_version_name = 2;
7696
7697 // Version code of the gpu driver.
7698 optional int64 driver_version_code = 3;
7699
7700 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7701 optional int64 driver_build_time = 4;
7702
7703 // Total count of the gl driver gets loaded.
7704 optional int64 gl_loading_count = 5;
7705
7706 // Total count of the gl driver fails to be loaded.
7707 optional int64 gl_loading_failure_count = 6;
7708
7709 // Total count of the Vulkan driver gets loaded.
7710 optional int64 vk_loading_count = 7;
7711
7712 // Total count of the Vulkan driver fails to be loaded.
7713 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007714
7715 // Api version of the system Vulkan driver.
7716 optional int32 vulkan_version = 9;
7717
7718 // Api version of the system CPU Vulkan driver.
7719 optional int32 cpu_vulkan_version = 10;
7720
7721 // Api version of the system GLES driver.
7722 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007723
7724 // Total count of the angle driver gets loaded.
7725 optional int64 angle_loading_count = 12;
7726
7727 // Total count of the angle driver fails to be loaded.
7728 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007729}
7730
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007731/**
7732 * GPU driver loading time info.
7733 */
7734message GpuDriverLoadingTime {
7735 // List of all the driver loading times for this app. The list size is
7736 // capped at 50.
7737 repeated int64 driver_loading_time = 1;
7738}
7739
7740/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007741 * Logs the GPU stats per app health information.
7742 *
7743 * Logged from:
7744 * frameworks/native/services/gpuservice/gpustats/
7745 */
7746message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007747 // Package name of the application that loads the gpu driver. Total number
7748 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007749 optional string app_package_name = 1;
7750
7751 // Version code of the gpu driver this app loads.
7752 optional int64 driver_version_code = 2;
7753
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007754 // gl driver loading time info.
7755 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7756 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007757
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007758 // Vulkan driver loading time info.
7759 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7760 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007761
7762 // Angle driver loading time info.
7763 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7764 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007765
7766 // CPU Vulkan implementation is in use.
7767 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007768
7769 // App is not doing pre-rotation correctly.
7770 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007771
7772 // App creates GLESv1 context.
7773 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007774}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007775
7776/*
7777 * Logs the size of the system ion heap.
7778 *
7779 * Pulled from StatsCompanionService.
7780 */
7781message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007782 // Deprecated due to limited support of ion stats in debugfs.
7783 // Use `IonHeapSize` instead.
7784 option deprecated = true;
7785
Rafal Slawikd4e87572019-03-12 13:08:38 +00007786 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007787 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007788 optional int64 size_in_bytes = 1;
7789}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007790
Rafal Slawik77987ed2019-06-17 12:28:23 +01007791/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007792 * Logs the total size of the ion heap.
7793 *
7794 * Pulled from StatsCompanionService.
7795 */
7796message IonHeapSize {
7797 // Total size of all ion heaps in kilobytes.
7798 // Read from: /sys/kernel/ion/total_heaps_kb.
7799 optional int32 total_size_kb = 1;
7800}
7801
7802/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007803 * Logs the per-process size of the system ion heap.
7804 *
7805 * Pulled from StatsCompanionService.
7806 */
7807message ProcessSystemIonHeapSize {
7808 // The uid if available. -1 means not available.
7809 optional int32 uid = 1 [(is_uid) = true];
7810
7811 // The process name (from /proc/PID/cmdline).
7812 optional string process_name = 2;
7813
7814 // Sum of sizes of all allocations.
7815 optional int32 total_size_in_kilobytes = 3;
7816
7817 // Number of allocations.
7818 optional int32 allocation_count = 4;
7819
7820 // Size of the largest allocation.
7821 optional int32 max_size_in_kilobytes = 5;
7822}
7823
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007824/**
7825 * Push network stack events.
7826 *
7827 * Log from:
7828 * frameworks/base/packages/NetworkStack/
7829 */
7830message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007831 // The id that indicates the event reported from NetworkStack.
7832 optional int32 event_id = 1;
7833 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007834 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7835}
Carmen Agimofa769c152019-03-04 14:39:14 +00007836
7837/**
7838 * Logs the apps that are installed on the external storage.
7839 * Pulled from:
7840 * StatsCompanionService
7841 */
7842message AppsOnExternalStorageInfo {
7843 // The type of the external storage.
7844 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7845 // The name of the package that is installed on the external storage.
7846 optional string package_name = 2;
7847}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007848
7849/**
7850 * Logs the settings related to Face.
7851 * Logged from:
7852 * frameworks/base/services/core/java/com/android/server/stats
7853 */
7854message FaceSettings {
7855 // Whether or not face unlock is allowed on Keyguard.
7856 optional bool unlock_keyguard_enabled = 1;
7857 // Whether or not face unlock dismisses the Keyguard.
7858 optional bool unlock_dismisses_keyguard = 2;
7859 // Whether or not face unlock requires attention.
7860 optional bool unlock_attention_required = 3;
7861 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7862 optional bool unlock_app_enabled = 4;
7863 // Whether or not face unlock always requires user confirmation.
7864 optional bool unlock_always_require_confirmation = 5;
7865 // Whether or not a diverse set of poses are required during enrollment.
7866 optional bool unlock_diversity_required = 6;
7867}
Maggie White442b6312019-04-05 16:26:44 -07007868
7869/**
7870 * Logs cooling devices maintained by the kernel.
7871 *
7872 * Pulled from StatsCompanionService.java
7873 */
7874message CoolingDevice {
7875 // The type of cooling device being reported. Eg. CPU, GPU...
7876 optional android.os.CoolingTypeEnum device_location = 1;
7877 // The name of the cooling device source. Eg. CPU0
7878 optional string device_name = 2;
7879 // Current throttle state of the cooling device. The value can any unsigned
7880 // integer between 0 and max_state defined in its driver. 0 means device is
7881 // not in throttling, higher value means deeper throttling.
7882 optional int32 state = 3;
7883}
Ben Blount763a5d52019-04-10 11:48:58 -07007884
7885/**
7886 * Intelligence has several counter-type events that don't warrant a
7887 * full separate atom. These are primarily API call counters but also include
7888 * counters for feature usage and specific failure modes.
7889 *
7890 * Logged from the Intelligence mainline module.
7891 */
7892message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007893 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007894 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007895 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007896 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007897 // How many times the event occured (to report a batch of high frequency events).
7898 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007899 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007900 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007901}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007902
7903/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007904 * Logs when Car Power state changed.
7905 *
7906 * Logged from:
7907 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7908 */
7909message CarPowerStateChanged {
7910 // States come from CpmsState in CarPowerManagementService.java.
7911 enum State {
7912 WAIT_FOR_VHAL = 0;
7913 ON = 1;
7914 SHUTDOWN_PREPARE = 2;
7915 WAIT_FOR_FINISH = 3;
7916 SUSPEND = 4;
7917 SIMULATE_SLEEP = 5;
7918 }
7919 optional State state = 1;
7920}
7921
7922/**
7923 * Logs whether GarageMode is entered.
7924 *
7925 * Logged from:
7926 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7927 */
7928message GarageModeInfo {
7929 // Whether GarageMode is entered.
7930 optional bool is_garage_mode = 1;
7931}
Martijn Coenencd95d462019-04-25 17:09:45 +02007932
7933/**
7934 * Historical app ops data per package.
7935 */
7936message AppOps {
7937 // Uid of the package requesting the op
7938 optional int32 uid = 1 [(is_uid) = true];
7939
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007940 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007941 optional string package_name = 2;
7942
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007943 // operation id
7944 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007945
7946 // The number of times the op was granted while the app was in the
7947 // foreground (only for trusted requests)
7948 optional int64 trusted_foreground_granted_count = 4;
7949
7950 // The number of times the op was granted while the app was in the
7951 // background (only for trusted requests)
7952 optional int64 trusted_background_granted_count = 5;
7953
7954 // The number of times the op was rejected while the app was in the
7955 // foreground (only for trusted requests)
7956 optional int64 trusted_foreground_rejected_count = 6;
7957
7958 // The number of times the op was rejected while the app was in the
7959 // background (only for trusted requests)
7960 optional int64 trusted_background_rejected_count = 7;
7961
7962 // For long-running operations, total duration of the operation
7963 // while the app was in the foreground (only for trusted requests)
7964 optional int64 trusted_foreground_duration_millis = 8;
7965
7966 // For long-running operations, total duration of the operation
7967 // while the app was in the background (only for trusted requests)
7968 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007969
7970 // Whether AppOps is guarded by Runtime permission
7971 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007972}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007973
7974/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007975 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007976 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007977message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007978 // Uid of the package requesting the op
7979 optional int32 uid = 1 [(is_uid) = true];
7980
7981 // Name of the package performing the op
7982 optional string package_name = 2;
7983
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007984 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7985 // Attributions must be provided through manifest using <attribution> tag available in R and
7986 // above.
7987 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007988
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007989 // operation id
7990 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007991
7992 // The number of times the op was granted while the app was in the
7993 // foreground (only for trusted requests)
7994 optional int64 trusted_foreground_granted_count = 5;
7995
7996 // The number of times the op was granted while the app was in the
7997 // background (only for trusted requests)
7998 optional int64 trusted_background_granted_count = 6;
7999
8000 // The number of times the op was rejected while the app was in the
8001 // foreground (only for trusted requests)
8002 optional int64 trusted_foreground_rejected_count = 7;
8003
8004 // The number of times the op was rejected while the app was in the
8005 // background (only for trusted requests)
8006 optional int64 trusted_background_rejected_count = 8;
8007
8008 // For long-running operations, total duration of the operation
8009 // while the app was in the foreground (only for trusted requests)
8010 optional int64 trusted_foreground_duration_millis = 9;
8011
8012 // For long-running operations, total duration of the operation
8013 // while the app was in the background (only for trusted requests)
8014 optional int64 trusted_background_duration_millis = 10;
8015
8016 // Whether AppOps is guarded by Runtime permission
8017 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008018
8019 // Sampling rate used on device, from 0 to 100
8020 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008021}
8022
8023/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008024 * Location Manager API Usage information(e.g. API under usage,
8025 * API call's parameters).
8026 * Logged from:
8027 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8028 */
8029message LocationManagerApiUsageReported {
8030
8031 // Indicating if usage starts or usage ends.
8032 optional android.stats.location.UsageState state = 1;
8033
8034 // LocationManagerService's API in use.
8035 // We can identify which API from LocationManager is
8036 // invoking current LMS API by the combination of
8037 // API parameter(e.g. is_listener_null, is_intent_null,
8038 // is_location_request_null)
8039 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8040
8041 // Name of the package calling the API.
8042 optional string calling_package_name = 3;
8043
8044 // Type of the location provider.
8045 optional android.stats.location.ProviderType provider = 4;
8046
8047 // Quality of the location request
8048 optional android.stats.location.LocationRequestQuality quality = 5;
8049
8050 // The desired interval for active location updates, in milliseconds.
8051 // Bucketized to reduce cardinality.
8052 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8053
8054 // Minimum distance between location updates, in meters.
8055 // Bucketized to reduce cardinality.
8056 optional android.stats.location.SmallestDisplacementBucket
8057 bucketized_smallest_displacement = 7;
8058
8059 // The number of location updates.
8060 optional int64 num_updates = 8;
8061
8062 // The request expiration time, in millisecond since boot.
8063 // Bucketized to reduce cardinality.
8064 optional android.stats.location.ExpirationBucket
8065 bucketized_expire_in = 9;
8066
8067 // Type of Callback passed in for this API.
8068 optional android.stats.location.CallbackType callback_type = 10;
8069
8070 // The radius of the central point of the alert
8071 // region, in meters. Only for API REQUEST_GEOFENCE.
8072 // Bucketized to reduce cardinality.
8073 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8074
8075 // Activity Importance of API caller.
8076 // Categorized to 3 types that are interesting from location's perspective.
8077 optional android.stats.location.ActivityImportance activiy_importance = 12;
8078}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008079
8080/**
8081 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8082 */
8083message ReviewPermissionsFragmentResultReported {
8084 // unique value identifying a permission group change. A permission group change might result
8085 // in multiple of these atoms
8086 optional int64 change_id = 1;
8087
8088 // UID of package the permission belongs to
8089 optional int32 uid = 2 [(is_uid) = true];
8090
8091 // Name of package the permission belongs to
8092 optional string package_name = 3;
8093
8094 // The permission to be granted
8095 optional string permission_name = 4;
8096
8097 // The result of the permission grant
8098 optional bool permission_granted = 5;
8099}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008100
8101/**
8102* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8103* Logged from: RuntimePermissionUpdgradeController
8104*/
8105message RuntimePermissionsUpgradeResult {
8106 // Permission granted as result of upgrade
8107 optional string permission_name = 1;
8108
8109 // UID of package granted permission
8110 optional int32 uid = 2 [(is_uid) = true];
8111
8112 // Name of package granted permission
8113 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008114}
8115
8116/**
8117* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8118*/
8119message GrantPermissionsActivityButtonActions {
8120 // Permission granted as result of upgrade
8121 optional string permission_group_name = 1;
8122
8123 // UID of package granted permission
8124 optional int32 uid = 2 [(is_uid) = true];
8125
8126 // Name of package requesting permission
8127 optional string package_name = 3;
8128
8129 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8130 // LABEL_ constants in GrantPermissionActivity.java
8131 optional int32 buttons_presented = 4;
8132
8133 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8134 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008135
8136 // id which identifies single session of user interacting with permission controller
8137 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008138}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008139
8140/**
8141 * Information about LocationAccessCheck notification presented to user
8142 */
8143message LocationAccessCheckNotificationAction {
8144
8145 // id which identifies single session of user interacting with permission controller
8146 optional int64 session_id = 1;
8147
8148 // Uid of package for which location access check is presented
8149 optional int32 package_uid = 2;
8150
8151 // Name of package for which location access check is presented
8152 optional string package_name = 3;
8153
8154 enum Result {
8155 UNDEFINED = 0;
8156 // notification was presented to the user
8157 NOTIFICATION_PRESENTED = 1;
8158 // notification was declined by the user
8159 NOTIFICATION_DECLINED = 2;
8160 // notification was clicked by the user
8161 NOTIFICATION_CLICKED = 3;
8162 }
8163
8164 // View / interaction recorded
8165 optional Result result = 4;
8166}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008167
8168/**
8169 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8170 */
8171message AppPermissionFragmentActionReported {
8172 // id which identifies single session of user interacting with permission controller
8173 optional int64 session_id = 1;
8174
8175 // unique value identifying a permission group change. A permission group change might result
8176 // in multiple of these atoms
8177 optional int64 change_id = 2;
8178
8179 // UID of package the permission belongs to
8180 optional int32 uid = 3 [(is_uid) = true];
8181
8182 // Name of package the permission belongs to
8183 optional string package_name = 4;
8184
8185 // The permission to be granted
8186 optional string permission_name = 5;
8187
8188 // The result of the permission grant
8189 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008190
8191 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8192 optional int32 permission_flags = 7;
8193
8194 enum Button {
8195 UNDEFINED = 0;
8196 // Allow button
8197 ALLOW = 1;
8198 // Deny button
8199 DENY = 2;
8200 // Ask every time button
8201 ASK_EVERY_TIME = 3;
8202 // Allow all the time button
8203 ALLOW_ALWAYS = 4;
8204 // Allow only while using the app button
8205 ALLOW_FOREGROUND = 5;
8206 // Same is Deny button but shown in while in use dialog
8207 DENY_FOREGROUND = 6;
8208 }
8209
8210 // Button pressed in the dialog
8211 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008212}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008213
8214/**
8215* Information about a AppPermissionFragment viewed by user
8216*/
8217message AppPermissionFragmentViewed {
8218 // id which identifies single session of user interacting with permission controller
8219 optional int64 session_id = 1;
8220
8221 // UID of package for which permissions are viewed
8222 optional int32 uid = 2 [(is_uid) = true];
8223
8224 // Name of package for which permissions are viewed
8225 optional string package_name = 3;
8226
8227 // Permission group viewed
8228 optional string permission_group_name = 4;
8229}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008230
8231/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008232* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8233* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008234*/
8235message AppPermissionsFragmentViewed {
8236 // id which identifies single session of user interacting with permission controller
8237 optional int64 session_id = 1;
8238
8239 // id which identifies single view as every view might have several logging records
8240 // with different package information attached
8241 optional int64 view_id = 2;
8242
8243 // Permission group viewed
8244 optional string permission_group_name = 3;
8245
8246 // UID of package for which permissions are viewed
8247 optional int32 uid = 4 [(is_uid) = true];
8248
8249 // Name of package for which permissions are viewed
8250 optional string package_name = 5;
8251
8252 // Category in which permission is included
8253 enum Category {
8254 UNDEFINED = 0;
8255 ALLOWED = 1;
8256 ALLOWED_FOREGROUND = 2;
8257 DENIED = 3;
8258 }
8259 optional Category category = 6;
8260}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008261/**
8262* Information about a PermissionAppsFragment viewed by user.
8263* Logged from ui/handheld/PermissionAppsFragment.java
8264*/
8265message PermissionAppsFragmentViewed {
8266 // id which identifies single session of user interacting with permission controller
8267 optional int64 session_id = 1;
8268
8269 // id which identifies single view as every view might have several logging records
8270 // with different package information attached
8271 optional int64 view_id = 2;
8272
8273 // Permission group viewed
8274 optional string permission_group_name = 3;
8275
8276 // UID of package for which permissions are viewed
8277 optional int32 uid = 4 [(is_uid) = true];
8278
8279 // Name of package for which permissions are viewed
8280 optional string package_name = 5;
8281
8282 // Category in which app is included
8283 enum Category {
8284 UNDEFINED = 0;
8285 ALLOWED = 1;
8286 ALLOWED_FOREGROUND = 2;
8287 DENIED = 3;
8288 }
8289 optional Category category = 6;
8290}
Tony Make2b1b672019-07-29 16:59:47 +01008291
8292/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008293* Log that the Auto Revoke notification has been clicked
8294* Logged from ui/ManagePermissionsActivity
8295*/
8296message AutoRevokeNotificationClicked {
8297 // id which identifies single session of user interacting with permission controller
8298 optional int64 session_id = 1;
8299}
8300
8301/**
8302* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8303* auto revoked for it.
8304* Logged from ui/handheld/AutoRevokeFragment
8305*/
8306message AutoRevokeFragmentAppViewed {
8307 // id which identifies single session of user interacting with permission controller
8308 optional int64 session_id = 1;
8309
8310 // UID of package for which permissions are viewed
8311 optional int32 uid = 2 [(is_uid) = true];
8312
8313 // Name of package for which permissions are viewed
8314 optional string package_name = 3;
8315
8316 // The name of a permission group that has been revoked
8317 optional string permission_group_name = 4;
8318
8319 // The age of the app- more than three months old, or more than six months
8320 enum Age {
8321 UNDEFINED = 0;
8322 NEWER_BUCKET = 1;
8323 OLDER_BUCKET = 2;
8324 }
8325
8326 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8327 optional Age age = 5;
8328}
8329
8330/**
8331* Log that the user has interacted with an app on the auto revoke fragment
8332* Logged from ui/handheld/AutoRevokeFragment
8333*/
8334message AutoRevokedAppInteraction {
8335 // id which identifies single session of user interacting with permission controller
8336 optional int64 session_id = 1;
8337
8338 // UID of package for which permissions are viewed
8339 optional int32 uid = 2 [(is_uid) = true];
8340
8341 // Name of package for which permissions are viewed
8342 optional string package_name = 3;
8343
8344 enum Action {
8345 UNDEFINED = 0;
8346 REMOVE = 1;
8347 OPEN = 2;
8348 APP_INFO = 3;
8349 PERMISSIONS = 4;
8350 REMOVE_IN_SETTINGS = 5;
8351 OPEN_IN_SETTINGS = 6;
8352 }
8353
8354 // The action the user took to interact with the app
8355 optional Action action = 4;
8356}
8357
8358/**
8359* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8360* auto revoke, or that the auto revoke switch has been changed
8361* Logged from ui/handheld/AppPermissionGroupsFragment
8362 */
8363message AppPermissionGroupsFragmentAutoRevokeAction {
8364 // id which identifies single session of user interacting with permission controller
8365 optional int64 session_id = 1;
8366
8367 // UID of package for which permissions are viewed
8368 optional int32 uid = 2 [(is_uid) = true];
8369
8370 // Name of package for which permissions are viewed
8371 optional string package_name = 3;
8372
8373 enum Action {
8374 UNDEFINED = 0;
8375 OPENED_FOR_AUTO_REVOKE = 1;
8376 OPENED_FROM_INTENT = 2;
8377 SWITCH_ENABLED = 3;
8378 SWITCH_DISABLED = 4;
8379 }
8380
8381 // The action the user took to interact with the fragment
8382 optional Action action = 4;
8383}
8384
8385/**
Tony Make2b1b672019-07-29 16:59:47 +01008386 * Logs when there is a smart selection related event.
8387 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8388 * Logged from: TextClassifierEventLogger.java
8389 */
8390message TextSelectionEvent {
8391 // A session ID.
8392 optional string session_id = 1;
8393
8394 // Event type of this event.
8395 optional android.stats.textclassifier.EventType event_type = 2;
8396
Tony Mak9c84bd22019-12-09 07:27:25 +00008397 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008398 optional string model_name = 3;
8399
8400 // Type of widget that was involved in triggering this event.
8401 optional android.stats.textclassifier.WidgetType widget_type = 4;
8402
8403 // Index of this event in a session.
8404 optional int32 event_index = 5;
8405
8406 // Entity type that is involved.
8407 optional string entity_type = 6;
8408
8409 // Relative word index of the start of the selection.
8410 optional int32 relative_word_start_index = 7;
8411
8412 // Relative word (exclusive) index of the end of the selection.
8413 optional int32 relative_word_end_index = 8;
8414
8415 // Relative word index of the start of the smart selection.
8416 optional int32 relative_suggested_word_start_index = 9;
8417
8418 // Relative word (exclusive) index of the end of the smart selection.
8419 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008420
8421 // Name of source package.
8422 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008423
8424 // Name of the LangID model that is involved in this event.
8425 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008426}
8427
8428/**
8429 * Logs when there is a smart linkify related event.
8430 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8431 * Logged from: TextClassifierEventLogger.java
8432 */
8433message TextLinkifyEvent {
8434 // A session ID.
8435 optional string session_id = 1;
8436
8437 // Event type of this event.
8438 optional android.stats.textclassifier.EventType event_type = 2;
8439
Tony Mak9c84bd22019-12-09 07:27:25 +00008440 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008441 optional string model_name = 3;
8442
8443 // Type of widget that was involved in triggering this event.
8444 optional android.stats.textclassifier.WidgetType widget_type = 4;
8445
8446 // Index of this event in a session.
8447 optional int32 event_index = 5;
8448
8449 // Entity type that is involved.
8450 optional string entity_type = 6;
8451
8452 // Number of links detected.
8453 optional int32 num_links = 7;
8454
8455 // The total length of all links.
8456 optional int32 linked_text_length = 8;
8457
8458 // Length of input text.
8459 optional int32 text_length = 9;
8460
8461 // Time spent on generating links in ms.
8462 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008463
8464 // Name of source package.
8465 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008466
8467 // Name of the LangID model that is involved in this event.
8468 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008469}
8470
8471/**
8472 * Logs when there is a conversation actions related event.
8473 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8474 * Logged from: TextClassifierEventLogger.java
8475 */
8476message ConversationActionsEvent {
8477 // A session ID.
8478 optional string session_id = 1;
8479
8480 // Event type of this event.
8481 optional android.stats.textclassifier.EventType event_type = 2;
8482
Tony Mak9c84bd22019-12-09 07:27:25 +00008483 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008484 optional string model_name = 3;
8485
8486 // Type of widget that was involved in triggering this event.
8487 optional android.stats.textclassifier.WidgetType widget_type = 4;
8488
8489 // The first entity type that is involved.
8490 optional string first_entity_type = 5;
8491
8492 // The second entity type that is involved.
8493 optional string second_entity_type = 6;
8494
8495 // The third entity type that is involved.
8496 optional string third_entity_type = 7;
8497
8498 // The score of the first entity type.
8499 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008500
8501 // Name of source package.
8502 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008503
8504 // Name of the annotator model that is involved in this event.
8505 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008506
8507 // Name of the LangID model that is involved in this event.
8508 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008509}
8510
8511/**
8512 * Logs when there is a language detection related event.
8513 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8514 * Logged from: TextClassifierEventLogger.java
8515 */
8516message LanguageDetectionEvent {
8517 // A session ID.
8518 optional string session_id = 1;
8519
8520 // Event type of this event.
8521 optional android.stats.textclassifier.EventType event_type = 2;
8522
Tony Mak9c84bd22019-12-09 07:27:25 +00008523 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008524 optional string model_name = 3;
8525
8526 // Type of widget that was involved in triggering this event.
8527 optional android.stats.textclassifier.WidgetType widget_type = 4;
8528
8529 // Detected language.
8530 optional string language_tag = 5;
8531
8532 // Score of the detected language.
8533 optional float score = 6;
8534
8535 // Position of this action.
8536 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008537
8538 // Name of source package.
8539 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008540}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008541
8542/**
8543 * Information about an OTA update attempt by update_engine.
8544 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8545 */
8546message UpdateEngineUpdateAttemptReported {
8547 // The number of attempts for the update engine to apply a given payload.
8548 optional int32 attempt_number = 1;
8549
8550 optional android.stats.otaupdate.PayloadType payload_type = 2;
8551
8552 // The total time in minutes for the update engine to apply a given payload.
8553 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8554 // it's increased when the system is sleeping.
8555 optional int32 duration_boottime_in_minutes = 3;
8556
8557 // The total time in minutes for the update engine to apply a given payload.
8558 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8559 // and it's not increased when the system is sleeping.
8560 optional int32 duration_monotonic_in_minutes = 4;
8561
8562 // The size of the payload in MiBs.
8563 optional int32 payload_size_mib = 5;
8564
8565 // The attempt result reported by the update engine for an OTA update.
8566 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8567
8568 // The error code reported by the update engine after an OTA update attempt
8569 // on A/B devices.
8570 optional android.stats.otaupdate.ErrorCode error_code = 7;
8571
8572 // The build fingerprint of the source system. The value is read from a
8573 // system property when the device takes the update. e.g.
8574 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8575 optional string source_fingerprint = 8;
8576}
8577
8578/**
8579 * Information about all the attempts the device make before finishing the
8580 * successful update.
8581 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8582 */
8583message UpdateEngineSuccessfulUpdateReported {
8584 // The number of attempts for the update engine to apply the payload for a
8585 // successful update.
8586 optional int32 attempt_count = 1;
8587
8588 optional android.stats.otaupdate.PayloadType payload_type = 2;
8589
8590 optional int32 payload_size_mib = 3;
8591
8592 // The total number of bytes downloaded by update_engine since the last
8593 // successful update.
8594 optional int32 total_bytes_downloaded_mib = 4;
8595
8596 // The ratio in percentage of the over-downloaded bytes compared to the
8597 // total bytes needed to successfully install the update. e.g. 200 if we
8598 // download 200MiB in total for a 100MiB package.
8599 optional int32 download_overhead_percentage = 5;
8600
8601 // The total time in minutes for the update engine to apply the payload for a
8602 // successful update.
8603 optional int32 total_duration_minutes = 6;
8604
8605 // The number of reboot of the device during a successful update.
8606 optional int32 reboot_count = 7;
8607}
Alec Mourie088e762019-07-02 13:10:55 -07008608
8609/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008610 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8611 * key to indicate whether it was successful or not.
8612 *
8613 * Logged from:
8614 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8615 */
8616message RebootEscrowRecoveryReported {
8617 optional bool successful = 1;
8618}
8619
8620/**
Alec Mourie088e762019-07-02 13:10:55 -07008621 * Global display pipeline metrics reported by SurfaceFlinger.
8622 * Pulled from:
8623 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8624 */
8625message SurfaceflingerStatsGlobalInfo {
8626 // Total number of frames presented during the tracing period
8627 optional int64 total_frames = 1;
8628 // Total number of frames missed
8629 optional int64 missed_frames = 2;
8630 // Total number of frames that fell back to client composition
8631 optional int64 client_composition_frames = 3;
8632 // Total time the display was turned on
8633 optional int64 display_on_millis = 4;
8634 // Total time that was spent performing animations.
8635 // This is derived from the present-to-present layer histogram
8636 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008637 // Total number of event connections tracked by SurfaceFlinger at the time
8638 // of this pull. If this number grows prohibitively large, then this can
8639 // cause jank due to resource contention.
8640 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008641 // Set of timings measured from when SurfaceFlinger began compositing a
8642 // frame, until the frame was requested to be presented to the display. This
8643 // measures SurfaceFlinger's total CPU walltime on the critical path per
8644 // frame.
8645 optional FrameTimingHistogram frame_duration = 7
8646 [(android.os.statsd.log_mode) = MODE_BYTES];
8647 // Set of timings measured from when SurfaceFlinger first began using the
8648 // GPU to composite a frame, until the GPU has finished compositing that
8649 // frame. This measures the total additional time SurfaceFlinger needed to
8650 // perform due to falling back into GPU composition.
8651 optional FrameTimingHistogram render_engine_timing = 8
8652 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008653}
8654
8655/**
8656 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8657 * The number of layers uploaded will be restricted due to size limitations.
8658 * Pulled from:
8659 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8660 */
8661message SurfaceflingerStatsLayerInfo {
8662 // The layer for this set of metrics
8663 // For now we can infer that the package name is included in the layer
8664 // name.
8665 optional string layer_name = 1;
8666 // Total number of frames presented
8667 optional int64 total_frames = 2;
8668 // Total number of dropped frames while latching a buffer for this layer.
8669 optional int64 dropped_frames = 3;
8670 // Set of timings measured between successive presentation timestamps.
8671 optional FrameTimingHistogram present_to_present = 4
8672 [(android.os.statsd.log_mode) = MODE_BYTES];
8673 // Set of timings measured from when an app queued a buffer for
8674 // presentation, until the buffer was actually presented to the
8675 // display.
8676 optional FrameTimingHistogram post_to_present = 5
8677 [(android.os.statsd.log_mode) = MODE_BYTES];
8678 // Set of timings measured from when a buffer is ready to be presented,
8679 // until the buffer was actually presented to the display.
8680 optional FrameTimingHistogram acquire_to_present = 6
8681 [(android.os.statsd.log_mode) = MODE_BYTES];
8682 // Set of timings measured from when a buffer was latched by
8683 // SurfaceFlinger, until the buffer was presented to the display
8684 optional FrameTimingHistogram latch_to_present = 7
8685 [(android.os.statsd.log_mode) = MODE_BYTES];
8686 // Set of timings measured from the desired presentation to the actual
8687 // presentation time
8688 optional FrameTimingHistogram desired_to_present = 8
8689 [(android.os.statsd.log_mode) = MODE_BYTES];
8690 // Set of timings measured from when an app queued a buffer for
8691 // presentation, until the buffer was ready to be presented.
8692 optional FrameTimingHistogram post_to_acquire = 9
8693 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008694 // Frames missed latch because the acquire fence didn't fire
8695 optional int64 late_acquire_frames = 10;
8696 // Frames latched early because the desired present time was bad
8697 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008698}
8699
8700/**
8701 * Histogram of frame counts bucketed by time in milliseconds.
8702 * Because of size limitations, we hard-cap the number of buckets, with
8703 * buckets for corresponding to larger milliseconds being less precise.
8704 */
8705message FrameTimingHistogram {
8706 // Timings in milliseconds that describes a set of histogram buckets
8707 repeated int32 time_millis_buckets = 1;
8708 // Number of frames that match to each time_millis, i.e. the bucket
8709 // contents
8710 // It's required that len(time_millis) == len(frame_count)
8711 repeated int64 frame_counts = 2;
8712}
Emilian Peev6729f372019-08-29 09:14:09 -07008713
Emilian Peev6729f372019-08-29 09:14:09 -07008714/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008715 * Janky event as reported by SurfaceFlinger.
8716 * This event is intended to be consumed by a Perfetto subscriber for
8717 * automated trace collection.
8718 *
8719 * Logged from:
8720 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8721 */
8722message DisplayJankReported {
8723 // Informational field for how long the janky event lasted in milliseconds
8724 optional int64 event_duration_millis = 1;
8725 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8726 // the display on time.
8727 optional int32 present_deadlines_missed = 2;
8728}
8729
8730/**
Emilian Peev6729f372019-08-29 09:14:09 -07008731 * Information about camera facing and API level usage.
8732 * Logged from:
8733 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8734 */
8735message CameraActionEvent {
8736 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008737 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008738
8739 // Camera API level used
8740 optional int32 api_level = 2;
8741
8742 // Name of client package
8743 optional string package_name = 3;
8744
8745 // Camera facing
8746 enum Facing {
8747 UNKNOWN = 0;
8748 BACK = 1;
8749 FRONT = 2;
8750 EXTERNAL = 3;
8751 }
8752 optional Facing facing = 4;
8753}
atrost01a20932019-08-28 15:40:37 +01008754
8755/**
8756 * Logs when a compatibility change is affecting an app.
8757 *
8758 * Logged from:
8759 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8760 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8761 */
8762message AppCompatibilityChangeReported {
8763 // The UID of the app being affected by the compatibilty change.
8764 optional int32 uid = 1 [(is_uid) = true];
8765
8766 // The ID of the change affecting the app.
8767 optional int64 change_id = 2;
8768
8769 enum State {
8770 UNKNOWN_STATE = 0;
8771 ENABLED = 1;
8772 DISABLED = 2;
8773 LOGGED = 3;
8774 }
8775
8776 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8777 // logged otherwise.
8778 optional State state = 3;
8779
8780 enum Source {
8781 UNKNOWN_SOURCE = 0;
8782 APP_PROCESS = 1;
8783 SYSTEM_SERVER = 2;
8784 }
8785
8786 // Where it was logged from.
8787 optional Source source = 4;
8788
8789}
Hector Dearman40579f62019-11-01 13:19:30 +00008790
8791/**
8792 * Logged from
8793 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8794 */
8795message PerfettoUploaded {
8796 enum Event {
8797 PERFETTO_UNDEFINED = 0;
8798 PERFETTO_TRACE_BEGIN = 1;
8799 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8800 PERFETTO_ON_CONNECT = 3;
8801 PERFETTO_ON_TRACING_DISABLED = 4;
8802 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8803 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8804 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8805 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8806 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8807 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8808 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8809 PERFETTO_TRIGGER_BEGIN = 12;
8810 PERFETTO_TRIGGER_SUCCESS = 13;
8811 PERFETTO_TRIGGER_FAILURE = 14;
8812 PERFETTO_HIT_GUARDRAILS = 15;
8813 PERFETTO_ON_TIMEOUT = 16;
8814 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8815 }
8816
8817 // Which stage of the pipeline we are reporting from.
8818 optional Event event = 1;
8819
8820 // UUID matching the one set inside the SystemInfo trace packet.
8821 optional int64 trace_uuid_lsb = 2;
8822 optional int64 trace_uuid_msb = 3;
8823}
Mark Tabrya824a642019-11-05 12:26:12 -08008824
8825/**
8826 * Pulls client metrics on data transferred via Vehicle Maps Service.
8827 * Metrics are keyed by uid + layer.
8828 *
8829 * Pulled from:
8830 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8831 */
8832message VmsClientStats {
8833 // UID of the VMS client app
8834 optional int32 uid = 1 [(is_uid) = true];
8835
8836 // VMS layer definition
8837 optional int32 layer_type = 2;
8838 optional int32 layer_channel = 3;
8839 optional int32 layer_version = 4;
8840
8841 // Bytes and packets sent by the client for the layer
8842 optional int64 tx_bytes = 5;
8843 optional int64 tx_packets = 6;
8844
8845 // Bytes and packets received by the client for the layer
8846 optional int64 rx_bytes = 7;
8847 optional int64 rx_packets = 8;
8848
8849 // Bytes and packets dropped due to client error
8850 optional int64 dropped_bytes = 9;
8851 optional int64 dropped_packets = 10;
8852}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008853
8854/**
8855 * State of a dangerous permission requested by a package - sampled
8856 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8857*/
8858message DangerousPermissionStateSampled {
8859 // Name of the permission
8860 optional string permission_name = 1;
8861
8862 // Uid of the package
8863 optional int32 uid = 2 [(is_uid) = true];
8864
8865 // If the permission is granted to the uid
8866 optional bool is_granted = 3;
8867
8868 // Permission flags as per android.content.pm.PermissionFlags
8869 optional int32 permission_flags = 4;
8870}
8871
Stan Iliev637ba5e2019-08-16 13:43:08 -04008872/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008873 * HWUI stats for a given app.
8874 */
8875message GraphicsStats {
8876 // The package name of the app
8877 optional string package_name = 1;
8878
8879 // The version code of the app
8880 optional int64 version_code = 2;
8881
8882 // The start & end timestamps in UTC as
8883 // milliseconds since January 1, 1970
8884 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008885 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008886
Stan Ilievb6517192020-02-18 10:12:42 -05008887 optional int64 end_millis = 4;
8888
8889 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8890 enum PipelineType {
8891 UNKNOWN = 0;
8892 GL = 1;
8893 VULKAN = 2;
8894 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008895
8896 // HWUI renders pipeline type: GL or Vulkan.
8897 optional PipelineType pipeline = 5;
8898
8899 // Distinct frame count.
8900 optional int32 total_frames = 6;
8901
8902 // Number of "missed vsync" events.
8903 optional int32 missed_vsync_count = 7;
8904
8905 // Number of frames in triple-buffering scenario (high input latency)
8906 optional int32 high_input_latency_count = 8;
8907
8908 // Number of "slow UI thread" events.
8909 optional int32 slow_ui_thread_count = 9;
8910
8911 // Number of "slow bitmap upload" events.
8912 optional int32 slow_bitmap_upload_count = 10;
8913
8914 // Number of "slow draw" events.
8915 optional int32 slow_draw_count = 11;
8916
8917 // Number of frames that missed their deadline (aka, visibly janked)
8918 optional int32 missed_deadline_count = 12;
8919
8920 // The frame time histogram for the package
8921 optional FrameTimingHistogram cpu_histogram = 13
8922 [(android.os.statsd.log_mode) = MODE_BYTES];
8923
8924 // The gpu frame time histogram for the package
8925 optional FrameTimingHistogram gpu_histogram = 14
8926 [(android.os.statsd.log_mode) = MODE_BYTES];
8927
8928 // UI mainline module version.
8929 optional int64 version_ui_module = 15;
8930
8931 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8932 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8933 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8934 // more apps are running / rendering.
8935 optional bool is_today = 16;
8936}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008937
8938/**
8939 * Message related to dangerous (runtime) app ops access
8940 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008941message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008942 // Uid of the package accessing app op
8943 optional int32 uid = 1 [(is_uid) = true];
8944
8945 // Name of the package accessing app op
8946 optional string package_name = 2;
8947
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008948 // deprecated - set to empty string
8949 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008950
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008951 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008952 // API. Attributions must be provided through manifest using <attribution> tag available in R
8953 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008954 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008955
8956 // message related to app op access, limited to 600 chars by API
8957 optional string message = 5;
8958
8959 enum SamplingStrategy {
8960 DEFAULT = 0;
8961 UNIFORM = 1;
8962 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008963 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008964 }
8965
8966 // sampling strategy used to collect this message
8967 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008968
8969 // operation id
8970 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008971}
8972
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008973/*
8974 * Logs userspace reboot outcome and duration.
8975 *
8976 * Logged from:
8977 * frameworks/base/core/java/com/android/server/BootReceiver.java
8978 */
8979message UserspaceRebootReported {
8980 // Possible outcomes of userspace reboot.
8981 enum Outcome {
8982 // Default value in case platform failed to determine the outcome.
8983 OUTCOME_UNKNOWN = 0;
8984 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8985 SUCCESS = 1;
8986 // Userspace reboot shutdown sequence was aborted.
8987 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8988 // Remounting userdata into checkpointing mode failed.
8989 FAILED_USERDATA_REMOUNT = 3;
8990 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8991 // reboot.
8992 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8993 }
8994 // Outcome of userspace reboot. Always set.
8995 optional Outcome outcome = 1;
8996 // Duration of userspace reboot in case it has a successful outcome.
8997 // Duration is measured as time between userspace reboot was initiated and until boot completed
8998 // (e.g. sys.boot_completed=1).
8999 optional int64 duration_millis = 2;
9000 // State of primary user's (user0) credential encryption storage.
9001 enum UserEncryptionState {
9002 // Default value.
9003 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9004 // Credential encrypted storage is unlocked.
9005 UNLOCKED = 1;
9006 // Credential encrypted storage is locked.
9007 LOCKED = 2;
9008 }
9009 // State of primary user's encryption storage at the moment boot completed. Always set.
9010 optional UserEncryptionState user_encryption_state = 3;
9011}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009012
9013/*
9014 * Logs integrity check information during each install.
9015 *
9016 * Logged from:
9017 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9018 */
9019message IntegrityCheckResultReported {
9020 optional string package_name = 1;
9021 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009022 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009023 optional string installer_package_name = 4;
9024 enum Response {
9025 UNKNOWN = 0;
9026 ALLOWED = 1;
9027 REJECTED = 2;
9028 FORCE_ALLOWED = 3;
9029 }
9030 optional Response response = 5;
9031 // An estimate on the cause of the response. This will only be populated for
9032 // REJECTED and FORCE_ALLOWED
9033 optional bool caused_by_app_cert_rule = 6;
9034 optional bool caused_by_installer_rule = 7;
9035}
9036
9037/**
9038 * Logs the information about the rules and the provider whenever rules are
9039 * pushed into AppIntegrityManager.
9040 *
9041 * Logged from:
9042 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9043 */
9044message IntegrityRulesPushed {
9045 optional bool success = 1;
9046 // Package name of the app that pushed the rules.
9047 optional string rule_provider = 2;
9048 // Version string of arbitrary format provided by the rule provider to
9049 // identify the rules.
9050 optional string rule_version = 3;
9051}
Jordan Liubedfa702019-12-20 15:08:45 -08009052
9053/**
9054 * Logs when a cell broadcast message is received on the device.
9055 *
9056 * Logged from CellBroadcastService module:
9057 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9058 */
9059message CellBroadcastMessageReported {
9060 // The type of Cell Broadcast message
9061 enum CbType {
9062 UNKNOWN_TYPE = 0;
9063 GSM = 1;
9064 CDMA = 2;
9065 CDMA_SPC = 3;
9066 }
9067
9068 // GSM, CDMA, CDMA-SCP
9069 optional CbType type = 1;
9070}
9071
9072/**
9073 * Logs when an error occurs while handling a cell broadcast message;
9074 *
9075 * Logged from CellBroadcastService module:
9076 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9077 */
9078message CellBroadcastMessageError {
9079 // The type of error raised when trying to handle a cell broadcast message
9080 enum ErrorType {
9081 UNKNOWN_TYPE = 0;
9082 CDMA_DECODING_ERROR = 1;
9083 CDMA_SCP_EMPTY = 2;
9084 CDMA_SCP_HANDLING_ERROR = 3;
9085 GSM_INVALID_HEADER_LENGTH = 4;
9086 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9087 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9088 GSM_INVALID_PDU = 7;
9089 GSM_INVALID_GEO_FENCING_DATA = 8;
9090 GSM_UMTS_INVALID_WAC = 9;
9091 FAILED_TO_INSERT_TO_DB = 10;
9092 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9093 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9094 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9095 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9096 }
9097
9098 // What kind of error occurred
9099 optional ErrorType type = 1;
9100
9101 // Exception message (or log message) associated with the error (max 1000 chars)
9102 optional string exception_message = 2;
9103}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009104
9105/**
9106 * Logs when the SDK Extensions test app has polled the current version.
9107 * This is atom ID 354.
9108 *
9109 * Logged from:
9110 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
9111 */
9112message SdkExtensionStatus {
9113 enum ApiCallStatus {
9114 CALL_NOT_ATTEMPTED = 0;
9115 CALL_SUCCESSFUL = 1;
9116 CALL_FAILED = 2;
9117 }
9118
9119 optional ApiCallStatus result = 1;
9120
9121 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9122 optional int32 r_extension_version = 2;
9123
9124 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9125 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9126 optional int32 failed_call_symbol = 3;
9127}
Marco Ballesio497aff42020-01-24 08:39:42 -08009128
9129/**
9130 * Logs when an app is frozen or unfrozen.
9131 *
9132 * Logged from:
9133 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9134 */
9135message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009136 // The type of event.
9137 enum Action {
9138 UNKNOWN = 0;
9139 FREEZE_APP = 1;
9140 UNFREEZE_APP = 2;
9141 }
9142 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009143
Blake Kragten6ce382a2020-01-16 20:20:46 -08009144 // Pid of the process being frozen.
9145 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009146
Blake Kragten6ce382a2020-01-16 20:20:46 -08009147 // Name of the process being frozen.
9148 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009149
Blake Kragten6ce382a2020-01-16 20:20:46 -08009150 // Time since last unfrozen.
9151 optional int64 time_unfrozen_millis = 4;
9152}
9153
9154/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009155 * Pulls information for a single voice call.
9156 *
9157 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9158 *
9159 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009160 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009161 */
9162message VoiceCallSession {
9163 // Bearer (IMS or CS) when the call started.
9164 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9165
9166 // Bearer (IMS or CS) when the call ended.
9167 // The bearer may change during the call, e.g. due to SRVCC.
9168 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9169
9170 // Direction of the call (incoming or outgoing).
9171 optional android.telephony.CallDirectionEnum direction = 3;
9172
9173 // Time spent setting up the call.
9174 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9175
9176 // Whether the call ended before the setup was completed.
9177 optional bool setup_failed = 5;
9178
9179 // IMS reason code or CS disconnect cause.
9180 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9181 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9182 optional int32 disconnect_reason_code = 6;
9183
9184 // IMS extra code or CS precise disconnect cause.
9185 // For IMS, this code is vendor-specific
9186 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9187 optional int32 disconnect_extra_code = 7;
9188
9189 // IMS extra message or CS vendor cause.
9190 optional string disconnect_extra_message = 8;
9191
9192 // Radio access technology (RAT) used when call started.
9193 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9194
9195 // Radio access technology (RAT) used when call terminated.
9196 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9197
9198 // Number of times RAT changed during the call.
9199 optional int64 rat_switch_count = 11;
9200
9201 // A bitmask of all codecs used during the call.
9202 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9203 optional int64 codec_bitmask = 12;
9204
9205 // Number of other calls going on during call setup, for the same SIM slot.
9206 optional int32 concurrent_call_count_at_start = 13;
9207
9208 // Number of other calls going on during call termination, for the same SIM slot.
9209 optional int32 concurrent_call_count_at_end = 14;
9210
9211 // Index of the SIM is used, 0 for single-SIM devices.
9212 optional int32 sim_slot_index = 15;
9213
9214 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9215 optional bool is_multi_sim = 16;
9216
9217 // Whether the call was made with an eSIM profile.
9218 optional bool is_esim = 17;
9219
9220 // Carrier ID of the SIM card.
9221 // See https://source.android.com/devices/tech/config/carrierid.
9222 optional int32 carrier_id = 18;
9223
Chi Zhangba1b03a2020-04-21 17:17:56 -07009224 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009225 optional bool srvcc_completed = 19;
9226
9227 // Number of SRVCC failures.
9228 optional int64 srvcc_failure_count = 20;
9229
9230 // Number of SRVCC cancellations.
9231 optional int64 srvcc_cancellation_count = 21;
9232
Chi Zhangba1b03a2020-04-21 17:17:56 -07009233 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9234 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009235 optional bool rtt_enabled = 22;
9236
9237 // Whether this was an emergency call.
9238 optional bool is_emergency = 23;
9239
9240 // Whether the call was performed while roaming.
9241 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009242
9243 // A random number used as the dimension field to pull multiple atoms.
9244 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009245}
9246
9247/**
9248 * Pulls voice call radio access technology (RAT) usage.
9249 *
9250 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9251 * time. The atom will be skipped if not enough data is available.
9252 *
9253 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009254 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009255 */
9256message VoiceCallRatUsage {
9257 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9258 optional int32 carrier_id = 1;
9259
9260 // Radio access technology.
9261 optional android.telephony.NetworkTypeEnum rat = 2;
9262
9263 // Total duration that voice calls spent on this carrier and RAT.
9264 optional int64 total_duration_seconds = 3;
9265
9266 // Total number of calls using this carrier and RAT.
9267 // A call is counted once even if it used the RAT multiple times.
9268 optional int64 call_count = 4;
9269}
9270
9271/**
9272 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9273 *
9274 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009275 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009276 */
9277message SimSlotState {
9278 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9279 optional int32 active_slot_count = 1;
9280
9281 // Number of SIM cards (both physical and active eSIM profiles).
9282 // This number is always equal to or less than the number of active SIM slots.
9283 optional int32 sim_count = 2;
9284
9285 // Number of active eSIM profiles.
9286 // This number is always equal to or less than the number of SIMs.
9287 optional int32 esim_count = 3;
9288}
9289
9290/**
9291 * Pulls supported cellular radio access technologies.
9292 *
9293 * This atom reports the capabilities of the device, rather than the network it has access to.
9294 *
9295 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009296 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009297 */
9298message SupportedRadioAccessFamily {
9299 // A bitmask of supported radio technologies.
9300 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9301 optional int64 network_type_bitmask = 1;
9302}
9303
9304/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009305 * Logs gnss stats from location service provider
9306 *
9307 * Pulled from:
9308 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9309 */
9310
9311message GnssStats {
9312 // Number of location reports since boot
9313 optional int64 location_reports = 1;
9314
9315 // Total pulled reports of Location failures since boot
9316 optional int64 location_failure_reports = 2;
9317
9318 // Number of time to first fix reports since boot
9319 optional int64 time_to_first_fix_reports = 3;
9320
9321 // Total pulled reported time to first fix (in milli-seconds) since boot
9322 optional int64 time_to_first_fix_milli_s = 4;
9323
9324 // Number of position accuracy reports since boot
9325 optional int64 position_accuracy_reports = 5;
9326
9327 // Total pulled reported position accuracy (in meters) since boot
9328 optional int64 position_accuracy_meters = 6;
9329
9330 // Number of top 4 average CN0 reports since boot
9331 optional int64 top_four_average_cn0_reports = 7;
9332
9333 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9334 optional int64 top_four_average_cn0_db_mhz = 8;
9335
9336 // Number of l5 top 4 average CN0 reports since boot
9337 optional int64 l5_top_four_average_cn0_reports = 9;
9338
9339 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9340 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9341
9342 // Total number of sv status messages reports since boot
9343 optional int64 sv_status_reports = 11;
9344
9345 // Total number of sv status messages reports, where sv is used in fix since boot
9346 optional int64 sv_status_reports_used_in_fix = 12;
9347
9348 // Total number of L5 sv status messages reports since boot
9349 optional int64 l5_sv_status_reports = 13;
9350
9351 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9352 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009353}
Kweku Adams12752132020-02-18 15:36:48 -08009354
9355/**
9356 * Logs when an app is moved to a different standby bucket.
9357 *
9358 * Logged from:
9359 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9360 */
9361message AppStandbyBucketChanged {
9362 optional string package_name = 1;
9363
9364 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9365 optional int32 user_id = 2;
9366
9367 // These enum values match the constants defined in UsageStatsManager.java.
9368 enum Bucket {
9369 BUCKET_UNKNOWN = 0;
9370 BUCKET_EXEMPTED = 5;
9371 BUCKET_ACTIVE = 10;
9372 BUCKET_WORKING_SET = 20;
9373 BUCKET_FREQUENT = 30;
9374 BUCKET_RARE = 40;
9375 BUCKET_RESTRICTED = 45;
9376 BUCKET_NEVER = 50;
9377 }
9378 optional Bucket bucket = 3;
9379
9380 enum MainReason {
9381 MAIN_UNKNOWN = 0;
9382 MAIN_DEFAULT = 0x0100;
9383 MAIN_TIMEOUT = 0x0200;
9384 MAIN_USAGE = 0x0300;
9385 MAIN_FORCED_BY_USER = 0x0400;
9386 MAIN_PREDICTED = 0x0500;
9387 MAIN_FORCED_BY_SYSTEM = 0x0600;
9388 }
9389 optional MainReason main_reason = 4;
9390
9391 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9392 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9393 // UsageStatsManager.java.
9394 optional int32 sub_reason = 5;
9395}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009396
9397/**
9398* Reports a started sharesheet transaction.
9399*
9400* Logged from:
9401* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9402*/
9403message SharesheetStarted {
9404 // The event_id (as for UiEventReported).
9405 optional int32 event_id = 1;
9406 // The calling app's package name.
9407 optional string package_name = 2;
9408 // An identifier to tie together multiple logs relating to the same share event
9409 optional int32 instance_id = 3;
9410 // The mime type of the share
9411 optional string mime_type = 4;
9412 // The number of direct targets the calling app is providing that will be shown.
9413 optional int32 num_app_provided_direct_targets = 5;
9414 // The number of app targets the calling app is providing that will be shown.
9415 optional int32 num_app_provided_app_targets = 6;
9416 // True if the share originates from the workprofile
9417 optional bool is_workprofile = 7;
9418
9419 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009420 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009421 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9422 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9423 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9424 }
9425 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009426 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009427
9428 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9429 INTENT_DEFAULT = 0;
9430 INTENT_ACTION_VIEW = 1;
9431 INTENT_ACTION_EDIT = 2;
9432 INTENT_ACTION_SEND = 3;
9433 INTENT_ACTION_SENDTO = 4;
9434 INTENT_ACTION_SEND_MULTIPLE = 5;
9435 INTENT_ACTION_IMAGE_CAPTURE = 6;
9436 INTENT_ACTION_MAIN = 7;
9437 }
9438 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009439 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009440}
9441
9442/**
9443 * Reports a ranking selection event.
9444 *
9445 * Logged from:
9446 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9447 */
9448message RankingSelected {
9449 // The event_id (as for UiEventReported).
9450 optional int32 event_id = 1;
9451 // The relevant app's package name (can be source or picked package).
9452 optional string package_name = 2;
9453 // An identifier to tie together multiple logs relating to the same share event.
9454 optional int32 instance_id = 3;
9455 // Which of the ranked targets got picked, default starting position 0.
9456 optional int32 position_picked = 4;
9457}
Raff Tsaiea4db182020-03-06 07:45:43 +08009458
9459/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009460 * Logs when TvSettings UI is interacted at.
9461 *
9462 * Logged from: packages/apps/TvSettings
9463 */
9464message TvSettingsUIInteracted {
9465
9466 /** The UI action category */
9467 optional android.app.tvsettings.Action action = 1;
9468
9469 /** The ID of the entry that the users actioned on */
9470 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009471}
9472
9473/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009474 * Logs information about a package installation using package installer V2 APIs.
9475 *
9476 * Logged from:
9477 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9478 */
9479message PackageInstallerV2Reported {
9480 // Whether this installation uses Incremental File System
9481 optional bool is_incremental = 1;
9482 // Name of the package that is intended to be installed
9483 optional string package_name = 2;
9484 // The duration between when the install was requested to when the install has completed
9485 optional int64 duration_millis = 3;
9486 // Installation result in final integer, which are SystemApi's.
9487 // Return_code 1 indicates success.
9488 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9489 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009490 // Total size of the APKs installed for this package
9491 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009492}
9493
9494/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009495 * Logs settings provider values.
9496 *
9497 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9498 * then write the value to proto.
9499 *
9500 */
9501message SettingSnapshot {
9502
9503 // Setting key
9504 optional string name = 1;
9505
9506 enum SettingsValueType {
9507 NOTASSIGNED = 0;
9508 ASSIGNED_BOOL_TYPE = 1;
9509 ASSIGNED_INT_TYPE = 2;
9510 ASSIGNED_FLOAT_TYPE = 3;
9511 ASSIGNED_STRING_TYPE = 4;
9512 };
9513 // Setting value type
9514 optional SettingsValueType type = 2;
9515
9516 optional bool bool_value = 3;
9517
9518 optional int32 int_value = 4;
9519
9520 optional float float_value = 5;
9521
9522 optional string str_value = 6;
9523
9524 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9525 optional int32 user_id = 7;
9526}
Varun Shahacb56342019-12-18 11:45:38 -08009527
9528/**
9529 * An event logged to indicate that a user journey is about to be performed. This atom includes
9530 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9531 * will immediately follow this atom which will describe the event(s) and its state.
9532 *
9533 * Logged from:
9534 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9535 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9536 */
9537message UserLifecycleJourneyReported {
9538 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9539 // UserLifecycleEventOccurred atom)
9540 optional int64 session_id = 1;
9541
9542 // Indicates what type of user journey this session is related to
9543 enum Journey {
9544 UNKNOWN = 0; // Undefined user lifecycle journey
9545 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9546 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9547 USER_START = 3; // A user start journey
9548 USER_CREATE = 4; // A user creation journey
9549 }
9550 optional Journey journey = 2;
9551 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9552 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9553 optional int32 origin_user = 3;
9554 // Which user the journey is targeting
9555 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9556 optional int32 target_user = 4;
9557
9558 // What is the user type of the target user
9559 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9560 enum UserType {
9561 TYPE_UNKNOWN = 0;
9562 FULL_SYSTEM = 1;
9563 FULL_SECONDARY = 2;
9564 FULL_GUEST = 3;
9565 FULL_DEMO = 4;
9566 FULL_RESTRICTED = 5;
9567 PROFILE_MANAGED = 6;
9568 SYSTEM_HEADLESS = 7;
9569 }
9570 optional UserType user_type = 5;
9571 // What are the flags attached to the target user
9572 optional int32 user_flags = 6;
9573}
9574
9575/**
9576 * An event logged when a specific user lifecycle event is performed. These events should be
9577 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9578 * Note: journeys can span over multiple events, hence some events may share a single session id.
9579 *
9580 * Logged from:
9581 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9582 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9583 */
9584message UserLifecycleEventOccurred {
9585 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9586 optional int64 session_id = 1;
9587 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9588 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9589 optional int32 user_id = 2;
9590
9591 enum Event {
9592 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9593 SWITCH_USER = 1; // Indicates that this is a user switch event
9594 START_USER = 2; // Indicates that this is a user start event
9595 CREATE_USER = 3; // Indicates that this is a user create event
9596 }
9597 optional Event event = 3;
9598
9599 enum State {
9600 NONE = 0; // Indicates the associated event has no start/end defined
9601 BEGIN = 1;
9602 FINISH = 2;
9603 }
9604 optional State state = 4; // Represents the state of an event (beginning/ending)
9605}
jasonwshsu81173e32020-03-27 15:22:03 +08009606
9607/**
9608 * Logs when accessibility shortcut clicked.
9609 *
9610 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009611 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009612 */
9613message AccessibilityShortcutReported {
9614 // The accessibility feature(including installed a11y service, framework a11y feature,
9615 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9616 optional string package_name = 1;
9617
9618 // The definition of the accessibility shortcut.
9619 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9620 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9621
9622 // The definition of the service status.
9623 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9624 optional android.stats.accessibility.ServiceStatus service_status = 3;
9625}
9626
9627/**
9628 * Logs when accessibility service status changed.
9629 *
9630 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009631 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009632 */
9633message AccessibilityServiceReported {
9634 // The accessibility service package name.
9635 optional string package_name = 1;
9636
9637 // The definition of the service status.
9638 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9639 optional android.stats.accessibility.ServiceStatus service_status = 2;
9640}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009641
Denny cy Lee57b31282020-04-17 10:08:52 +08009642message DisplayWakeReason {
9643 // Wake_up_reason code
9644 // If LOWORD(wake_up_reason) = 0
9645 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9646 // else reference wake_up_reason to
9647 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9648 optional int32 wake_up_reason = 1;
9649 // Count of wake up by reason
9650 optional int32 wake_times = 2;
9651}
9652
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009653/**
9654 * Logs app usage events.
9655 */
9656message AppUsageEventOccurred {
9657 optional int32 uid = 1 [(is_uid) = true];
9658 optional string package_name = 2;
9659 optional string class_name = 3;
9660
9661 enum EventType {
9662 NONE = 0;
9663 MOVE_TO_FOREGROUND = 1;
9664 MOVE_TO_BACKGROUND = 2;
9665 }
9666 optional EventType event_type = 4;
9667}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009668
9669/*
9670 * Quality metrics logged when EVS cameras are active.
9671 *
9672 * Logged from:
9673 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9674 */
9675message EvsUsageStatsReported {
9676
9677 // Camera identifier to distinguish the source camera device. This is not
9678 // globally unique and therefore cannot be used to identify the user and/or
9679 // the device.
9680 optional int32 device_id = 1;
9681
9682 // Peak number of clients during the service
9683 optional int32 peak_num_clients = 2;
9684
9685 // Number of erroneous events during the service
9686 optional int32 num_errors = 3;
9687
9688 // Round trip latency of the very first frame
9689 optional int64 first_latency_millis = 4;
9690
9691 // Average frame round trip latency
9692 optional float avg_latency_millis = 5;
9693
9694 // Peak frame round trip latency
9695 optional int64 peak_latency_millis = 6;
9696
9697 // Total number of frames received
9698 optional int64 total_frames = 7;
9699
9700 // Number of frames ignored
9701 optional int64 ignored_frames = 8;
9702
9703 // Number of dropped frames to synchronize camera devices
9704 optional int64 dropped_frames_to_sync = 9;
9705
9706 // The duration of the service
9707 optional int64 duration_millis = 10;
9708}
Robert Leecccdc152020-04-23 13:22:46 +08009709
9710/**
9711 * Logs audio power usage stats.
9712 *
9713 * Pushed from:
9714 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9715 */
9716message AudioPowerUsageDataReported {
9717 /**
9718 * Device used for input/output
9719 *
9720 * All audio devices please refer to below file:
9721 * system/media/audio/include/system/audio-base.h
9722 *
9723 * Define our own enum values because we don't report all audio devices.
9724 * Currently, we only report built-in audio devices such as handset, speaker,
9725 * built-in mics, common audio devices such as wired headset, usb headset
9726 * and bluetooth devices.
9727 */
9728 enum AudioDevice {
9729 OUTPUT_EARPIECE = 0x1; // handset
9730 OUTPUT_SPEAKER = 0x2; // dual speaker
9731 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9732 OUTPUT_USB_HEADSET = 0x8; // usb headset
9733 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9734 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9735 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9736
9737 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9738 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9739 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9740 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9741 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9742 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9743 }
9744 optional AudioDevice audio_device = 1;
9745
9746 // Duration of the audio in seconds
9747 optional int32 duration_secs = 2;
9748
9749 // Average volume (0 ... 1.0)
9750 optional float average_volume = 3;
9751
9752 enum AudioType {
9753 UNKNOWN_TYPE = 0;
9754 VOICE_CALL_TYPE = 1; // voice call
9755 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9756 MEDIA_TYPE = 3; // music and system sound
9757 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9758 ALARM_TYPE = 5; // alarm type
9759 // record type
9760 CAMCORDER_TYPE = 6; // camcorder
9761 RECORD_TYPE = 7; // other recording
9762 }
9763 optional AudioType type = 4;
9764}