blob: 4db0f91ca871e3ddd8faa0d3424839a8f4fb65ce [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.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700450 // Next: 10080
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"];
David Chenc8a43242017-10-17 16:23:28 -0700541 }
yroa1fe77c2018-02-26 14:22:54 -0800542
Bookatz76aafcf2018-09-17 16:17:10 -0700543 // DO NOT USE field numbers above 100,000 in AOSP.
544 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
545 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100546
547 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700548}
549
Yao Chend54f9dd2017-10-17 17:37:48 +0000550/**
Yangster-mac20877162017-12-22 17:19:39 -0800551 * This proto represents a node of an attribution chain.
552 * Note: All attribution chains are represented as a repeated field of type
553 * AttributionNode. It is understood that in such arrays, the order is that
554 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000555 */
Yangster-mac20877162017-12-22 17:19:39 -0800556message AttributionNode {
557 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800558 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800559
Yangster-mac20877162017-12-22 17:19:39 -0800560 // The (optional) string tag for an element in the attribution chain. If the
561 // element has no tag, it is encoded as an empty string.
562 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700563}
564
Yangster-mac48b3d622018-08-18 12:38:11 -0700565message KeyValuePair {
566 optional int32 key = 1;
567 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700568 int32 value_int = 2;
569 int64 value_long = 3;
570 string value_str = 4;
571 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700572 }
573}
574
575message KeyValuePairsAtom {
576 optional int32 uid = 1;
577 repeated KeyValuePair pairs = 2;
578}
579
Yao Chend54f9dd2017-10-17 17:37:48 +0000580/*
581 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800582 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 *
584 * RULES:
585 * - The field ids for each atom must start at 1, and count upwards by 1.
586 * Skipping field ids is not allowed.
587 * - These form an API, so renaming, renumbering or removing fields is
588 * not allowed between android releases. (This is not currently enforced,
589 * but there will be a tool to enforce this restriction).
590 * - The types must be built-in protocol buffer types, namely, no sub-messages
591 * are allowed (yet). The bytes type is also not allowed.
592 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800593 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000594 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800595 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000596 * - A field that is a uid should be a string field, tagged with the [xxx]
597 * annotation. The generated code on android will be represented by UIDs,
598 * and those UIDs will be translated in xxx to those strings.
599 *
600 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700601 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000602 * - If there is a UID, it goes first. Think in an object-oriented fashion.
603 * *****************************************************************************
604 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700605
Yao Chend54f9dd2017-10-17 17:37:48 +0000606/**
Tej Singha72344992019-04-17 18:55:08 -0700607 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700608 * Logs when the Thermal service HAL notifies the throttling start/stop events.
609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
612 */
613message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700614 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700615 optional android.os.TemperatureTypeEnum sensor_type = 1;
616
Maggie White442b6312019-04-05 16:26:44 -0700617 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700618 enum State {
619 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700620 START = 1; // START indicated that throttling was triggered.
621 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700622 }
Yangster-mace16189a2018-08-26 12:20:16 -0700623 optional State state = 2;
624
625 optional float temperature = 3;
626}
627
628/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000629 * Logs when the screen state changes.
630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
633 */
634message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800635 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800636 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700637 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700638}
Yao Chend54f9dd2017-10-17 17:37:48 +0000639
640/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700641 * Logs that the process state of the uid, as determined by ActivityManager
642 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
646 */
Bookatzc1a050a2017-10-10 15:49:28 -0700647message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700648 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000649
Bookatzdb026a22018-01-10 19:01:56 -0800650 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800651 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700652 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000653}
654
655/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700656 * Logs process state change of a process, as per the activity manager.
657 *
658 * Logged from:
659 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
660 */
661message ProcessStateChanged {
662 optional int32 uid = 1;
663 optional string process_name = 2;
664 optional string package_name = 3;
665 // TODO: remove this when validation is done
666 optional int64 version = 5;
667 // The state, from frameworks/base/core/proto/android/app/enums.proto.
668 optional android.app.ProcessStateEnum state = 4;
669}
670
671/**
672 * Logs when ActivityManagerService sleep state is changed.
673 *
674 * Logged from:
675 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
676 */
677message ActivityManagerSleepStateChanged {
678 // TODO: import frameworks proto
679 enum State {
680 UNKNOWN = 0;
681 ASLEEP = 1;
682 AWAKE = 2;
683 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700684 optional State state = 1
685 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700686}
687
688/**
689 * Logs when system memory state changes.
690 *
691 * Logged from:
692 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
693 */
694message MemoryFactorStateChanged {
695 // TODO: import frameworks proto
696 enum State {
697 MEMORY_UNKNOWN = 0;
698 NORMAL = 1; // normal.
699 MODERATE = 2; // moderate memory pressure.
700 LOW = 3; // low memory.
701 CRITICAL = 4; // critical memory.
702
703 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700704 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700705}
706
707/**
708 * Logs when app is using too much cpu, according to ActivityManagerService.
709 *
710 * Logged from:
711 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
712 */
713message ExcessiveCpuUsageReported {
714 optional int32 uid = 1;
715 optional string process_name = 2;
716 optional string package_name = 3;
717 // package version. TODO: remove this when validation is done
718 optional int64 version = 4;
719}
720
721/**
722 * Logs when a cached process is killed, along with its pss.
723 *
724 * Logged from:
725 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
726 */
727message CachedKillReported {
728 optional int32 uid = 1;
729 optional string process_name = 2;
730 optional string package_name = 3;
731 // TODO: remove this when validation is done
732 optional int64 version = 5;
733 optional int64 pss = 4;
734}
735
736/**
xshu2c3d9e42019-09-26 17:54:02 -0700737 * Logs the change in wifi health.
738 *
739 * Logged from:
740 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
741 */
742message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800743 enum Band {
744 UNKNOWN = 0;
745 // All of 2.4GHz band
746 BAND_2G = 1;
747 // Frequencies in the range of [5150, 5250) GHz
748 BAND_5G_LOW = 2;
749 // Frequencies in the range of [5250, 5725) GHz
750 BAND_5G_MIDDLE = 3;
751 // Frequencies in the range of [5725, 5850) GHz
752 BAND_5G_HIGH = 4;
753 // Frequencies in the range of [5925, 6425) GHz
754 BAND_6G_LOW = 5;
755 // Frequencies in the range of [6425, 6875) GHz
756 BAND_6G_MIDDLE = 6;
757 // Frequencies in the range of [6875, 7125) GHz
758 BAND_6G_HIGH = 7;
759 }
xshu2c3d9e42019-09-26 17:54:02 -0700760 // duration this stat is obtained over in milliseconds
761 optional int32 duration_millis = 1;
762 // whether wifi is classified as sufficient for the user's data traffic, determined
763 // by whether the calculated throughput exceeds the average demand within |duration_millis|
764 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700765 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800766 optional bool is_cell_data_available = 3;
767 // the Band bucket the connected network is on
768 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700769}
770
771/**
772 * Logged when wifi detects a significant change in connection failure rate.
773 *
774 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
775 *
776 */
777message WifiFailureStatReported {
778 enum AbnormalityType {
779 UNKNOWN = 0;
780 SIGNIFICANT_INCREASE = 1;
781 SIGNIFICANT_DECREASE = 2;
782 SIMPLY_HIGH = 3;
783 }
784 enum FailureType {
785 FAILURE_UNKNOWN = 0;
786 FAILURE_CONNECTION = 1;
787 FAILURE_ASSOCIATION_REJECTION = 2;
788 FAILURE_ASSOCIATION_TIMEOUT = 3;
789 FAILURE_AUTHENTICATION = 4;
790 FAILURE_NON_LOCAL_DISCONNECTION = 5;
791 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
792 }
793 // Reason for uploading this stat
794 optional AbnormalityType abnormality_type = 1;
795 // The particular type of failure
796 optional FailureType failure_type = 2;
797 // How many times we have encountered this combination of AbnormalityType and FailureType
798 optional int32 failure_count = 3;
799}
800
801/**
802 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
803 *
804 * Logged from:
805 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
806 */
807message WifiConnectionResultReported {
808 enum FailureCode {
809 FAILURE_UNKNOWN = 0;
810 FAILURE_ASSOCIATION_TIMEOUT = 1;
811 FAILURE_ASSOCIATION_REJECTION = 2;
812 FAILURE_AUTHENTICATION_GENERAL = 3;
813 FAILURE_AUTHENTICATION_EAP = 4;
814 FAILURE_DHCP = 5;
815 FAILURE_NETWORK_DISCONNECTION = 6;
816 FAILURE_ROAM_TIMEOUT = 7;
817 }
818 // true represents a successful connection
819 optional bool connection_result = 1;
820 // reason for the connection failure
821 optional FailureCode failure_code = 2;
822 // scan rssi before the connection attempt
823 optional int32 rssi = 3;
824}
825
826/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700827 * Logs when memory stats of a process is reported.
828 *
829 * Logged from:
830 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
831 */
832message ProcessMemoryStatReported {
833 optional int32 uid = 1;
834 optional string process_name = 2;
835 optional string package_name = 3;
836 //TODO: remove this when validation is done
837 optional int64 version = 9;
838 optional int64 pss = 4;
839 optional int64 uss = 5;
840 optional int64 rss = 6;
841 enum Type {
842 ADD_PSS_INTERNAL_SINGLE = 0;
843 ADD_PSS_INTERNAL_ALL_MEM = 1;
844 ADD_PSS_INTERNAL_ALL_POLL = 2;
845 ADD_PSS_EXTERNAL = 3;
846 ADD_PSS_EXTERNAL_SLOW = 4;
847 }
848 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800849 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700850}
851
852/**
Bookatzc1a050a2017-10-10 15:49:28 -0700853 * Logs that a process started, finished, crashed, or ANRed.
854 *
855 * Logged from:
856 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
857 */
858message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700859 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700860
David Chen0b5c90c2018-01-25 16:51:49 -0800861 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800862 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700863
Bookatzddccf0a2017-11-28 16:48:14 -0800864 // What lifecycle state the process changed to.
865 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800866 enum State {
867 FINISHED = 0;
868 STARTED = 1;
869 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800870 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800871 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700872}
873
Bookatzc1a050a2017-10-10 15:49:28 -0700874/**
875 * Logs when the ble scan state changes.
876 *
877 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700878 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700879 */
880message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800881 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700882 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700883
884 enum State {
885 OFF = 0;
886 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700887 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
888 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800890 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700891 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800892 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700893 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800894 (state_field_option).nested = true
895 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700896
Bookatze5ec0b42018-03-26 13:34:56 -0700897 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700898 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700899 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700900 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700901 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700902 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700903}
904
905/**
906 * Logs reporting of a ble scan finding results.
907 *
908 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700909 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700910 */
Bookatzae6738e2018-09-13 11:38:56 -0700911// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700912message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
915 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700917}
918
919/**
920 * Logs when a sensor state changes.
921 *
922 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700923 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700924 */
925message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700927
Bookatzc1a050a2017-10-10 15:49:28 -0700928 // The id (int) of the sensor.
929 optional int32 sensor_id = 2;
930
931 enum State {
932 OFF = 0;
933 ON = 1;
934 }
935 optional State state = 3;
936}
937
Bookatzc1a050a2017-10-10 15:49:28 -0700938/**
939 * Logs when GPS state changes.
940 *
941 * Logged from:
942 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
943 */
944message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800945 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700946
947 enum State {
948 OFF = 0;
949 ON = 1;
950 }
951 optional State state = 2;
952}
953
Bookatz48d362e2018-11-06 15:49:08 -0800954/**
955 * Logs when GPS signal quality.
956 *
957 * Logged from:
958 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
959 */
960message GpsSignalQualityChanged {
961 optional android.server.location.GpsSignalQualityEnum level = 1;
962}
963
Bookatzc1a050a2017-10-10 15:49:28 -0700964
965/**
966 * Logs when a sync manager sync state changes.
967 *
968 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700969 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700970 */
971message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800972 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700973
David Chen0b5c90c2018-01-25 16:51:49 -0800974 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800975 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700976
977 enum State {
978 OFF = 0;
979 ON = 1;
980 }
981 optional State state = 3;
982}
983
Yangster-mac96353002018-09-05 11:18:55 -0700984/*
985 * Deferred job stats.
986 *
987 * Logged from:
988 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
989*/
990message DeferredJobStatsReported {
991 repeated AttributionNode attribution_node = 1;
992
993 // Number of jobs deferred.
994 optional int32 num_jobs_deferred = 2;
995
996 // Time since the last job runs.
997 optional int64 time_since_last_job_millis = 3;
998}
999
Bookatzc1a050a2017-10-10 15:49:28 -07001000/**
1001 * Logs when a job scheduler job state changes.
1002 *
1003 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001004 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001005 */
1006message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001007 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001008
1009 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001010 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001011
1012 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001013 FINISHED = 0;
1014 STARTED = 1;
1015 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001016 }
1017 optional State state = 3;
1018
Tej Singh33a412b2018-03-16 18:43:59 -07001019 // The reason a job has stopped.
1020 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001021 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001022 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001023
1024 // The standby bucket of the app that scheduled the job. These match the framework constants
1025 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1026 // already assigned 0.
1027 enum Bucket {
1028 UNKNOWN = -1;
1029 ACTIVE = 0;
1030 WORKING_SET = 1;
1031 FREQUENT = 2;
1032 RARE = 3;
1033 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001034 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001035 }
1036 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1037
1038 // The job id (as assigned by the app).
1039 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001040
1041 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1042 // constraints as they are always assumed to be set.
1043 optional bool has_charging_constraint = 7;
1044 optional bool has_battery_not_low_constraint = 8;
1045 optional bool has_storage_not_low_constraint = 9;
1046 optional bool has_timing_delay_constraint = 10;
1047 optional bool has_deadline_constraint = 11;
1048 optional bool has_idle_constraint = 12;
1049 optional bool has_connectivity_constraint = 13;
1050 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001051}
1052
1053/**
1054 * Logs when the audio state changes.
1055 *
1056 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001057 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001058 */
1059message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001060 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001061
1062 enum State {
1063 OFF = 0;
1064 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001065 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1066 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001067 }
1068 optional State state = 2;
1069}
1070
1071/**
1072 * Logs when the video codec state changes.
1073 *
1074 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001075 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001076 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001077message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001078 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001079
1080 enum State {
1081 OFF = 0;
1082 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001083 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1084 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001085 }
1086 optional State state = 2;
1087}
1088
1089/**
1090 * Logs when the flashlight state changes.
1091 *
1092 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001093 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001094 */
1095message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001096 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001097
1098 enum State {
1099 OFF = 0;
1100 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001101 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1102 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001103 }
1104 optional State state = 2;
1105}
1106
1107/**
1108 * Logs when the camera state changes.
1109 *
1110 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001111 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001112 */
1113message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001114 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001115
1116 enum State {
1117 OFF = 0;
1118 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001119 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1120 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001121 }
1122 optional State state = 2;
1123}
1124
1125/**
1126 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001127 *
1128 * Logged from:
1129 * TODO
1130 */
Bookatzd6746242017-10-24 18:39:35 -07001131message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001132 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001133 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001134
Bookatz1a1b0462018-01-12 11:47:03 -08001135 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1136 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001137 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001138
1139 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001140 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001141
1142 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001143 RELEASE = 0;
1144 ACQUIRE = 1;
1145 CHANGE_RELEASE = 2;
1146 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001147 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001148 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001149 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001150 (state_field_option).default_state_value = 0,
1151 (state_field_option).nested = true
1152 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001153}
1154
1155/**
Bookatzc1a050a2017-10-10 15:49:28 -07001156 * Logs when a partial wakelock is considered 'long' (over 1 min).
1157 *
1158 * Logged from:
1159 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1160 */
1161message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001162 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001163
Yao Chend54f9dd2017-10-17 17:37:48 +00001164 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1165 optional string tag = 2;
1166
Bookatzc1a050a2017-10-10 15:49:28 -07001167 // TODO: I have no idea what this is.
1168 optional string history_tag = 3;
1169
1170 enum State {
1171 OFF = 0;
1172 ON = 1;
1173 }
1174 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001175}
1176
Bookatzc1a050a2017-10-10 15:49:28 -07001177/**
Bookatza66083f2018-09-20 17:24:00 -07001178 * Logs when the device is interactive, according to the PowerManager Notifier.
1179 *
1180 * Logged from:
1181 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1182 */
1183message InteractiveStateChanged {
1184 enum State {
1185 OFF = 0;
1186 ON = 1;
1187 }
1188 optional State state = 1;
1189}
1190
1191/**
Bookatzc1a050a2017-10-10 15:49:28 -07001192 * Logs Battery Saver state change.
1193 *
1194 * Logged from:
1195 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1196 */
1197message BatterySaverModeStateChanged {
1198 enum State {
1199 OFF = 0;
1200 ON = 1;
1201 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001202 optional State state = 1
1203 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001204}
1205
1206/**
1207 * Logs Doze mode state change.
1208 *
1209 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001210 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001211 */
1212message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001213 optional android.server.DeviceIdleModeEnum state = 1
1214 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001215}
1216
1217
1218/**
1219 * Logs state change of Doze mode including maintenance windows.
1220 *
1221 * Logged from:
1222 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1223 */
1224message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001225 optional android.server.DeviceIdleModeEnum state = 1
1226 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001227}
1228
1229/**
1230 * Logs screen brightness level.
1231 *
1232 * Logged from:
1233 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1234 */
1235message ScreenBrightnessChanged {
1236 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1237 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001238}
1239
1240/**
1241 * Logs battery level (percent full, from 0 to 100).
1242 *
1243 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001244 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001245 */
1246message BatteryLevelChanged {
1247 // Battery level. Should be in [0, 100].
1248 optional int32 battery_level = 1;
1249}
1250
1251/**
1252 * Logs change in charging status of the device.
1253 *
1254 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001255 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001256 */
1257message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001258 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001259 optional android.os.BatteryStatusEnum state = 1
1260 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001261}
1262
1263/**
1264 * Logs whether the device is plugged in, and what power source it is using.
1265 *
1266 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001267 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001268 */
1269message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001270 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001271 optional android.os.BatteryPluggedStateEnum state = 1
1272 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001273}
1274
Bookatz8c6571b2017-10-24 15:04:41 -07001275/**
1276 * Logs when an app's wakeup alarm fires.
1277 *
1278 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001279 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001280 */
1281message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001282 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001283
1284 // Name of the wakeup alarm.
1285 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001286
1287 // Name of source package (for historical reasons, since BatteryStats tracked it).
1288 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001289
Ben Murdoch3389f1522019-05-21 15:05:34 +01001290 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001291 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001292}
1293
1294/**
1295 * Logs when an an app causes the mobile radio to change state.
1296 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1297 *
1298 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001299 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001300 */
1301message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001302 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001303
Bookatz1a1b0462018-01-12 11:47:03 -08001304 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1305 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001306}
1307
1308/**
1309 * Logs when an an app causes the wifi radio to change state.
1310 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1311 *
1312 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001313 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001314 */
1315message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001316 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001317
Bookatz1a1b0462018-01-12 11:47:03 -08001318 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1319 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001320}
1321
1322/**
1323 * Logs kernel wakeup reasons and aborts.
1324 *
1325 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001326 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001327 */
1328message KernelWakeupReported {
1329 // Name of the kernel wakeup reason (or abort).
1330 optional string wakeup_reason_name = 1;
1331
1332 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001333 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001334}
1335
1336/**
Bookatzda1798c2018-12-13 14:16:00 -08001337 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001338 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001339 *
1340 * Logged from:
1341 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1342 */
1343message WifiEnabledStateChanged {
1344 enum State {
1345 OFF = 0;
1346 ON = 1;
1347 }
1348 optional State state = 1;
1349}
1350
1351/**
tsaichristinececebdc2020-02-04 14:05:56 -08001352 * This atom is deprecated starting in R.
1353 *
Bookatzda1798c2018-12-13 14:16:00 -08001354 * 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 -08001355 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1356 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001357 *
1358 * Logged from:
1359 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1360 */
1361message WifiRunningStateChanged {
1362 repeated AttributionNode attribution_node = 1;
1363
1364 enum State {
1365 OFF = 0;
1366 ON = 1;
1367 }
1368 optional State state = 2;
1369}
1370
1371/**
Bookatze5885242017-10-24 20:10:31 -07001372 * Logs wifi locks held by an app.
1373 *
1374 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001375 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001376 */
1377message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001378 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001379
1380 enum State {
1381 OFF = 0;
1382 ON = 1;
1383 }
1384 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001385
1386 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1387 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001388}
1389
1390/**
1391 * Logs wifi signal strength changes.
1392 *
1393 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001394 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001395 */
1396message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001397 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1398 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001399}
1400
1401/**
1402 * Logs wifi scans performed by an app.
1403 *
1404 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001405 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001406 */
1407message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001408 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001409
1410 enum State {
1411 OFF = 0;
1412 ON = 1;
1413 }
1414 optional State state = 2;
1415}
1416
1417/**
Tej Singh4503e102018-01-04 14:35:01 -08001418 * Logs wifi multicast locks held by an app
1419 *
1420 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001421 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001422 */
1423message WifiMulticastLockStateChanged {
1424 repeated AttributionNode attribution_node = 1;
1425
1426 enum State {
1427 OFF = 0;
1428 ON = 1;
1429 }
1430 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001431
1432 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001433}
1434
1435/**
Tej Singh1ea42892018-01-19 09:27:00 -08001436 * Logs shutdown reason and duration on next boot.
1437 *
1438 * Logged from:
1439 * frameworks/base/core/java/com/android/server/BootReceiver.java
1440 */
1441message ShutdownSequenceReported {
1442 // True if shutdown is for a reboot. Default: false if we do not know.
1443 optional bool reboot = 1;
1444
1445 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1446 optional string reason = 2;
1447
1448 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1449 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001450 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001451
1452 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001453 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001454}
1455
Tej Singh6483ea42018-01-25 17:45:49 -08001456
1457/**
1458 * Logs boot reason and duration.
1459 *
1460 * Logged from:
1461 * system/core/bootstat/bootstat.cpp
1462 */
1463message BootSequenceReported {
1464 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1465 // Default: "<EMPTY>" if not available.
1466 optional string bootloader_reason = 1;
1467
1468 // Reason for system boot. Eg. bootloader, reboot,userrequested
1469 // Default: "<EMPTY>" if not available.
1470 optional string system_reason = 2;
1471
1472 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001473 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001474
1475 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001476 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001477
1478 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001479 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001480
1481 // Time since last boot in ms. Default: 0 if not available.
1482 optional int64 time_since_last_boot = 6;
1483}
1484
Tej Singhc477d9c2018-02-05 18:31:39 -08001485
1486/**
1487 * Logs call state and disconnect cause (if applicable).
1488 *
1489 * Logged from:
1490 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1491 */
1492message CallStateChanged {
1493 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1494 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1495 optional android.telecom.CallStateEnum call_state = 1;
1496
1497 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1498 // This value is only applicable when the call_state is DISCONNECTED, and
1499 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1500 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1501 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1502
1503 // True if the call is self-managed, which are apps that use the
1504 // telecom infrastructure to make their own calls.
1505 optional bool self_managed = 3;
1506
1507 // True if call is external. External calls are calls on connected Wear
1508 // devices but show up in Telecom so the user can pull them onto the device.
1509 optional bool external_call = 4;
1510}
1511
Tej Singh1ea42892018-01-19 09:27:00 -08001512/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001513 * Logs keyguard state. The keyguard is the lock screen.
1514 *
1515 * Logged from:
1516 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1517 */
1518message KeyguardStateChanged {
1519 enum State {
1520 UNKNOWN = 0;
1521 // The keyguard is hidden when the phone is unlocked.
1522 HIDDEN = 1;
1523 // The keyguard is shown when the phone is locked (screen turns off).
1524 SHOWN= 2;
1525 // The keyguard is occluded when something is overlaying the keyguard.
1526 // Eg. Opening the camera while on the lock screen.
1527 OCCLUDED = 3;
1528 }
1529 optional State state = 1;
1530}
1531
1532/**
1533 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1534 * prompts the user to enter a password (pattern, pin, etc).
1535 *
1536 * Logged from:
1537 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1538 */
1539
1540message KeyguardBouncerStateChanged {
1541 enum State {
1542 UNKNOWN = 0;
1543 // Bouncer is hidden, either as a result of successfully entering the
1544 // password, screen timing out, or user going back to lock screen.
1545 HIDDEN = 1;
1546 // This is when the user is being prompted to enter the password.
1547 SHOWN = 2;
1548 }
1549 optional State state = 1;
1550}
1551
1552/**
1553 * Logs the result of entering a password into the keyguard bouncer.
1554 *
1555 * Logged from:
1556 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1557 */
1558message KeyguardBouncerPasswordEntered {
1559 enum BouncerResult {
1560 UNKNOWN = 0;
1561 // The password entered was incorrect.
1562 FAILURE = 1;
1563 // The password entered was correct.
1564 SUCCESS = 2;
1565 }
1566 optional BouncerResult result = 1;
1567}
1568
Tej Singha883b372018-02-15 11:30:01 -08001569/*
1570 * Logs changes to the configuration of the device. The configuration is defined
1571 * in frameworks/base/core/java/android/content/res/Configuration.java
1572 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1573 * Please go there to interpret the possible values each field can be.
1574 *
1575 * Logged from:
1576 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1577 */
1578message ResourceConfigurationChanged {
1579 // Bit mask of color capabilities of the screen.
1580 // Contains information about the color gamut and hdr mode of the screen.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001582 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001583
1584 // The target screen density being rendered to.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001586 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001587
1588 // Current user preference for the scaling factor for fonts,
1589 // relative to the base density scaling.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001591 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001592
1593 // Flag indicating whether the hard keyboard is hidden.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001595 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001596
1597 // The type of keyboard attached to the device.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1599 optional int32 keyboard = 5;
1600
1601 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001603 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001604
1605 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1606 // 0 if undefined.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1608 optional int32 mcc = 7;
1609
1610 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1611 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1612 // MNC_ZERO symbol defined in Configuration.java.
1613 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1614 optional int32 mnc = 8;
1615
1616 // The kind of navigation available on the device.
1617 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1618 optional int32 navigation = 9;
1619
1620 // Flag indicating whether the navigation is available.
1621 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001622 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001623
1624 // Overall orientation of the screen.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1626 optional int32 orientation = 11;
1627
1628 // The current height of the available screen space, in dp units.
1629 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001630 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001631
1632 // Bit mask of overall layout of the screen.
1633 // Contains information about screen size, whether the screen is wider/taller
1634 // than normal, whether the screen layout is right-tl-left or left-to-right,
1635 // and whether the screen has a rounded shape.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001637 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001638
1639 // Current width of the available screen space, in dp units.
1640 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001641 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001642
1643 // The smallest screen size an application will see in normal operation.
1644 // This is the smallest value of both screenWidthDp and screenHeightDp
1645 // in portrait and landscape.
1646 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001647 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001648
1649 // The type of touch screen attached to the device.
1650 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1651 optional int32 touchscreen = 16;
1652
1653 // Bit mask of the ui mode.
1654 // Contains information about the overall ui mode of the device.
1655 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1656 // Also contains information about whether the device is in night mode.
1657 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001658 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001659}
1660
Tej Singheee317b2018-03-07 19:28:05 -08001661
1662/**
1663 * Logs changes in the connection state of the mobile radio.
1664 *
1665 * Logged from:
1666 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1667 */
1668message MobileConnectionStateChanged {
1669 // States are from the state machine DataConnection.java.
1670 enum State {
1671 UNKNOWN = 0;
1672 // The connection is inactive, or disconnected.
1673 INACTIVE = 1;
1674 // The connection is being activated, or connecting.
1675 ACTIVATING = 2;
1676 // The connection is active, or connected.
1677 ACTIVE = 3;
1678 // The connection is disconnecting.
1679 DISCONNECTING = 4;
1680 // The connection is disconnecting after creating a connection.
1681 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1682 }
1683 optional State state = 1;
1684 // For multi-sim phones, this distinguishes between the sim cards.
1685 optional int32 sim_slot_index = 2;
1686 // Used to identify the connection. Starts at 0 and increments by 1 for
1687 // every new network created. Resets whenever the device reboots.
1688 optional int32 data_connection_id = 3;
1689 // A bitmask for the capabilities of this connection.
1690 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1691 // Default value (if we have no information): 0
1692 optional int64 capabilities = 4;
1693 // If this connection has internet.
1694 // This just checks if the DEFAULT bit of capabilities is set.
1695 optional bool has_internet = 5;
1696}
1697
1698/**
1699 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1700 *
1701 * Logged from:
1702 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1703 */
1704message MobileRadioTechnologyChanged {
1705 optional android.telephony.NetworkTypeEnum state = 1;
1706 // For multi-sim phones, this distinguishes between the sim cards.
1707 optional int32 sim_slot_index = 2;
1708}
1709
Andrew Chantb56388b2018-03-22 21:07:33 -07001710/**
1711 * Logs the VID and PID of any connected USB devices.
1712 *
1713 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1714 *
1715 * Logged by Vendor.
1716 */
1717message UsbDeviceAttached {
1718 optional int32 vid = 1;
1719 optional int32 pid = 2;
1720 optional bool has_audio = 3;
1721 optional bool has_hid = 4;
1722 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001723 enum State {
1724 STATE_DISCONNECTED = 0;
1725 STATE_CONNECTED = 1;
1726 }
1727 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001728 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001729}
1730
Tej Singheee317b2018-03-07 19:28:05 -08001731
Tej Singhdd7bd352018-02-09 19:33:15 -08001732/**
Tej Singh5d991e12018-03-09 19:48:11 -08001733 * Logs when Bluetooth is enabled and disabled.
1734 *
1735 * Logged from:
1736 * services/core/java/com/android/server/BluetoothManagerService.java
1737 */
1738message BluetoothEnabledStateChanged {
1739 repeated AttributionNode attribution_node = 1;
1740 // Whether or not bluetooth is enabled on the device.
1741 enum State {
1742 UNKNOWN = 0;
1743 ENABLED = 1;
1744 DISABLED = 2;
1745 }
1746 optional State state = 2;
1747 // The reason for being enabled/disabled.
1748 // Eg. Airplane mode, crash, application request.
1749 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1750 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001751 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001752}
1753
1754/**
Jack Hed9837c82019-01-09 01:19:13 -08001755 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001756 *
1757 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001758 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1759 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001760 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001761 */
1762message BluetoothConnectionStateChanged {
1763 // The state of the connection.
1764 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1765 optional android.bluetooth.ConnectionStateEnum state = 1;
1766 // An identifier that can be used to match connect and disconnect events.
1767 // Currently is last two bytes of a hash of a device level ID and
1768 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001769 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001770 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001771 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1772 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001773 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001774 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001775 // An identifier that can be used to match events for this device.
1776 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1777 // Salt: Randomly generated 256 bit value
1778 // Hash algorithm: HMAC-SHA256
1779 // Size: 32 byte
1780 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001781 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001782 // An identifier that can be used to match events for this device.
1783 // The incremental identifier is locally generated and guaranteed not derived
1784 // from any globally unique hardware id.
1785 // For paired devices, it stays consistent between Bluetooth toggling for the
1786 // same remote device.
1787 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1788 // session for the same remote device.
1789 // Default: 0 if the device's metric id is unknown.
1790 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001791}
1792
1793/**
1794 * Logs when a Bluetooth device connects and disconnects over ACL
1795 *
1796 * Logged from:
1797 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1798 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001799 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001800 */
1801message BluetoothAclConnectionStateChanged {
1802 // An identifier that can be used to match events for this device.
1803 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1804 // Salt: Randomly generated 256 bit value
1805 // Hash algorithm: HMAC-SHA256
1806 // Size: 32 byte
1807 // Default: null or empty if the device identifier is not known
1808 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1809 // The state of the connection.
1810 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1811 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001812 // An identifier that can be used to match events for this device.
1813 // The incremental identifier is locally generated and guaranteed not derived
1814 // from any globally unique hardware id.
1815 // For paired devices, it stays consistent between Bluetooth toggling for the
1816 // same remote device.
1817 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1818 // session for the same remote device.
1819 // Default: 0 if the device's metric id is unknown.
1820 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001821}
1822
1823/**
1824 * Logs when a Bluetooth device connects and disconnects over SCO
1825 *
1826 * Logged from:
1827 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1828 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1829 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001830 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001831 */
1832message BluetoothScoConnectionStateChanged {
1833 // An identifier that can be used to match events for this device.
1834 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1835 // Salt: Randomly generated 256 bit value
1836 // Hash algorithm: HMAC-SHA256
1837 // Size: 32 byte
1838 // Default: null or empty if the device identifier is not known
1839 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1840 // The state of the connection.
1841 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1842 optional android.bluetooth.ConnectionStateEnum state = 2;
1843 // Codec used for this SCO connection
1844 // Default: UNKNOWN
1845 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001846 // An identifier that can be used to match events for this device.
1847 // The incremental identifier is locally generated and guaranteed not derived
1848 // from any globally unique hardware id.
1849 // For paired devices, it stays consistent between Bluetooth toggling for the
1850 // same remote device.
1851 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1852 // session for the same remote device.
1853 // Default: 0 if the device's metric id is unknown.
1854 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001855}
1856
Jack Hec27040a2019-01-09 20:54:41 -08001857/**
1858 * Logged when active device of a profile changes
1859 *
1860 * Logged from:
1861 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1862 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1863 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1864 */
1865message BluetoothActiveDeviceChanged {
1866 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1867 // From android.bluetooth.BluetoothProfile
1868 optional int32 bt_profile = 1;
1869 // An identifier that can be used to match events for this new active device.
1870 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1871 // Salt: Randomly generated 256 bit value
1872 // Hash algorithm: HMAC-SHA256
1873 // Size: 32 byte
1874 // Default: null or empty if there is no active device for this profile
1875 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001876 // An identifier that can be used to match events for this device.
1877 // The incremental identifier is locally generated and guaranteed not derived
1878 // from any globally unique hardware id.
1879 // For paired devices, it stays consistent between Bluetooth toggling for the
1880 // same remote device.
1881 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1882 // session for the same remote device.
1883 // Default: 0 if the device's metric id is unknown.
1884 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001885}
1886
Jack Heab86dbd22018-12-18 15:43:27 -08001887// Logs when there is an event affecting Bluetooth device's link layer connection.
1888// - This event is triggered when there is a related HCI command or event
1889// - Users of this metrics can deduce Bluetooth device's connection state from these events
1890// - HCI commands are logged before the command is sent, after receiving command status, and after
1891// receiving command complete
1892// - HCI events are logged when they arrive
1893//
1894// Low level log from system/bt
1895//
1896// Bluetooth classic commands:
1897// - CMD_CREATE_CONNECTION
1898// - CMD_DISCONNECT
1899// - CMD_CREATE_CONNECTION_CANCEL
1900// - CMD_ACCEPT_CONNECTION_REQUEST
1901// - CMD_REJECT_CONNECTION_REQUEST
1902// - CMD_SETUP_ESCO_CONNECTION
1903// - CMD_ACCEPT_ESCO_CONNECTION
1904// - CMD_REJECT_ESCO_CONNECTION
1905// - CMD_ENH_SETUP_ESCO_CONNECTION
1906// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1907//
1908// Bluetooth low energy commands:
1909// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1910// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1911// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1912// - CMD_BLE_CLEAR_WHITE_LIST
1913// - CMD_BLE_ADD_WHITE_LIST
1914// - CMD_BLE_REMOVE_WHITE_LIST
1915//
1916// Bluetooth classic events:
1917// - EVT_CONNECTION_COMP
1918// - EVT_CONNECTION_REQUEST
1919// - EVT_DISCONNECTION_COMP
1920// - EVT_ESCO_CONNECTION_COMP
1921// - EVT_ESCO_CONNECTION_CHANGED
1922//
1923// Bluetooth low energy meta events:
1924// - BLE_EVT_CONN_COMPLETE_EVT
1925// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1926//
1927// Next tag: 10
1928message BluetoothLinkLayerConnectionEvent {
1929 // An identifier that can be used to match events for this device.
1930 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1931 // Salt: Randomly generated 256 bit value
1932 // Hash algorithm: HMAC-SHA256
1933 // Size: 32 byte
1934 // Default: null or empty if the device identifier is not known
1935 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1936 // Connection handle of this connection if available
1937 // Range: 0x0000 - 0x0EFF (12 bits)
1938 // Default: 0xFFFF if the handle is unknown
1939 optional int32 connection_handle = 2;
1940 // Direction of the link
1941 // Default: DIRECTION_UNKNOWN
1942 optional android.bluetooth.DirectionEnum direction = 3;
1943 // Type of this link
1944 // Default: LINK_TYPE_UNKNOWN
1945 optional android.bluetooth.LinkTypeEnum type = 4;
1946
1947 // Reason metadata for this link layer connection event, rules for interpretation:
1948 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1949 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1950 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1951 // set and valid, ignore hci_ble_event
1952
1953 // HCI command associated with this event
1954 // Default: CMD_UNKNOWN
1955 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1956 // HCI event associated with this event
1957 // Default: EVT_UNKNOWN
1958 optional android.bluetooth.hci.EventEnum hci_event = 6;
1959 // HCI BLE meta event associated with this event
1960 // Default: BLE_EVT_UNKNOWN
1961 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1962 // HCI command status code if this is triggerred by hci_cmd
1963 // Default: STATUS_UNKNOWN
1964 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1965 // HCI reason code associated with this event
1966 // Default: STATUS_UNKNOWN
1967 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001968 // An identifier that can be used to match events for this device.
1969 // The incremental identifier is locally generated and guaranteed not derived
1970 // from any globally unique hardware id.
1971 // For paired devices, it stays consistent between Bluetooth toggling for the
1972 // same remote device.
1973 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1974 // session for the same remote device.
1975 // Default: 0 if the device's metric id is unknown.
1976 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001977}
1978
Howard Roe103fe22019-01-17 16:52:16 -08001979/**
1980 * Logs when a module is rolled back by Watchdog.
1981 *
1982 * Logged from: Rollback Manager
1983 */
1984message WatchdogRollbackOccurred {
1985 enum RollbackType {
1986 UNKNOWN = 0;
1987 ROLLBACK_INITIATE = 1;
1988 ROLLBACK_SUCCESS = 2;
1989 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001990 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001991 }
1992 optional RollbackType rollback_type = 1;
1993
1994 optional string package_name = 2;
1995
1996 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001997
1998 enum RollbackReasonType {
1999 REASON_UNKNOWN = 0;
2000 REASON_NATIVE_CRASH = 1;
2001 REASON_EXPLICIT_HEALTH_CHECK = 2;
2002 REASON_APP_CRASH = 3;
2003 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002004 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002005 }
2006 optional RollbackReasonType rollback_reason = 4;
2007
2008 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2009 // is initiated. Empty if the package is unknown.
2010 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002011
2012 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002013}
2014
Jack Hec27040a2019-01-09 20:54:41 -08002015/**
2016 * Logs when there is a change in Bluetooth A2DP playback state
2017 *
2018 * Logged from:
2019 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2020 */
2021message BluetoothA2dpPlaybackStateChanged {
2022 // An identifier that can be used to match events for this device.
2023 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2024 // Salt: Randomly generated 256 bit value
2025 // Hash algorithm: HMAC-SHA256
2026 // Size: 32 byte
2027 // Default: null or empty if the device identifier is not known
2028 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2029 // Current playback state
2030 // Default: PLAYBACK_STATE_UNKNOWN
2031 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2032 // Current audio coding mode
2033 // Default: AUDIO_CODING_MODE_UNKNOWN
2034 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002035 // An identifier that can be used to match events for this device.
2036 // The incremental identifier is locally generated and guaranteed not derived
2037 // from any globally unique hardware id.
2038 // For paired devices, it stays consistent between Bluetooth toggling for the
2039 // same remote device.
2040 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2041 // session for the same remote device.
2042 // Default: 0 if the device's metric id is unknown.
2043 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002044}
2045
2046/**
2047 * Logs when there is a change in A2DP codec config for a particular remote device
2048 *
2049 * Logged from:
2050 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2051 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2052 */
2053message BluetoothA2dpCodecConfigChanged {
2054 // An identifier that can be used to match events for this device.
2055 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2056 // Salt: Randomly generated 256 bit value
2057 // Hash algorithm: HMAC-SHA256
2058 // Size: 32 byte
2059 // Default: null or empty if the device identifier is not known
2060 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2061 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2062 // Default SOURCE_CODEC_TYPE_INVALID
2063 optional int32 codec_type = 2;
2064 // Codec priroity, the higher the more preferred, -1 for disabled
2065 // Default: CODEC_PRIORITY_DEFAULT
2066 optional int32 codec_priority = 3;
2067 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2068 // Default: SAMPLE_RATE_NONE
2069 optional int32 sample_rate = 4;
2070 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2071 // Default: BITS_PER_SAMPLE_NONE
2072 optional int32 bits_per_sample = 5;
2073 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2074 // Default: CHANNEL_MODE_NONE
2075 optional int32 channel_mode = 6;
2076 // Codec specific values
2077 // Default 0
2078 optional int64 codec_specific_1 = 7;
2079 optional int64 codec_specific_2 = 8;
2080 optional int64 codec_specific_3 = 9;
2081 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002082 // An identifier that can be used to match events for this device.
2083 // The incremental identifier is locally generated and guaranteed not derived
2084 // from any globally unique hardware id.
2085 // For paired devices, it stays consistent between Bluetooth toggling for the
2086 // same remote device.
2087 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2088 // session for the same remote device.
2089 // Default: 0 if the device's metric id is unknown.
2090 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002091}
2092
2093/**
2094 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2095 * Each codec's capability is logged separately due to statsd restriction
2096 *
2097 * Logged from:
2098 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2099 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2100 */
2101message BluetoothA2dpCodecCapabilityChanged {
2102 // An identifier that can be used to match events for this device.
2103 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2104 // Salt: Randomly generated 256 bit value
2105 // Hash algorithm: HMAC-SHA256
2106 // Size: 32 byte
2107 // Default: null or empty if the device identifier is not known
2108 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2109 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2110 // Default SOURCE_CODEC_TYPE_INVALID
2111 optional int32 codec_type = 2;
2112 // Codec priroity, the higher the more preferred, -1 for disabled
2113 // Default: CODEC_PRIORITY_DEFAULT
2114 optional int32 codec_priority = 3;
2115 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2116 // in BluetoothCodecConfig
2117 // Default: empty and SAMPLE_RATE_NONE for individual item
2118 optional int32 sample_rate = 4;
2119 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2120 // in BluetoothCodecConfig
2121 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2122 optional int32 bits_per_sample = 5;
2123 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2124 // BluetoothCodecConfig
2125 // Default: empty and CHANNEL_MODE_NONE for individual item
2126 optional int32 channel_mode = 6;
2127 // Codec specific values
2128 // Default 0
2129 optional int64 codec_specific_1 = 7;
2130 optional int64 codec_specific_2 = 8;
2131 optional int64 codec_specific_3 = 9;
2132 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002133 // An identifier that can be used to match events for this device.
2134 // The incremental identifier is locally generated and guaranteed not derived
2135 // from any globally unique hardware id.
2136 // For paired devices, it stays consistent between Bluetooth toggling for the
2137 // same remote device.
2138 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2139 // session for the same remote device.
2140 // Default: 0 if the device's metric id is unknown.
2141 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002142}
2143
2144/**
2145 * Logs when A2DP failed to read from PCM source.
2146 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2147 *
2148 * Logged from:
2149 * system/bt
2150 */
2151message BluetoothA2dpAudioUnderrunReported {
2152 // An identifier that can be used to match events for this device.
2153 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2154 // Salt: Randomly generated 256 bit value
2155 // Hash algorithm: HMAC-SHA256
2156 // Size: 32 byte
2157 // Default: null or empty if the device identifier is not known
2158 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2159 // Encoding interval in nanoseconds
2160 // Default: 0
2161 optional int64 encoding_interval_nanos = 2;
2162 // Number of bytes of PCM data that could not be read from the source
2163 // Default: 0
2164 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002165 // An identifier that can be used to match events for this device.
2166 // The incremental identifier is locally generated and guaranteed not derived
2167 // from any globally unique hardware id.
2168 // For paired devices, it stays consistent between Bluetooth toggling for the
2169 // same remote device.
2170 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2171 // session for the same remote device.
2172 // Default: 0 if the device's metric id is unknown.
2173 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002174}
2175
2176/**
2177 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2178 * buffer queue is full and we have to drop data
2179 *
2180 * Logged from:
2181 * system/bt
2182 */
2183message BluetoothA2dpAudioOverrunReported {
2184 // An identifier that can be used to match events for this device.
2185 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2186 // Salt: Randomly generated 256 bit value
2187 // Hash algorithm: HMAC-SHA256
2188 // Size: 32 byte
2189 // Default: null or empty if the device identifier is not known
2190 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2191 // Encoding interval in nanoseconds
2192 // Default: 0
2193 optional int64 encoding_interval_nanos = 2;
2194 // Number of buffers dropped in this event
2195 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2196 // Default: 0
2197 optional int32 num_dropped_buffers = 3;
2198 // Number of encoded buffers dropped in this event
2199 // Default 0
2200 optional int32 num_dropped_encoded_frames = 4;
2201 // Number of encoded bytes dropped in this event
2202 // Default: 0
2203 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002204 // An identifier that can be used to match events for this device.
2205 // The incremental identifier is locally generated and guaranteed not derived
2206 // from any globally unique hardware id.
2207 // For paired devices, it stays consistent between Bluetooth toggling for the
2208 // same remote device.
2209 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2210 // session for the same remote device.
2211 // Default: 0 if the device's metric id is unknown.
2212 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002213}
2214
2215/**
2216 * Logs when we receive reports regarding a device's RSSI value
2217 *
2218 * Logged from:
2219 * system/bt
2220 */
2221message BluetoothDeviceRssiReported {
2222 // An identifier that can be used to match events for this device.
2223 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2224 // Salt: Randomly generated 256 bit value
2225 // Hash algorithm: HMAC-SHA256
2226 // Size: 32 byte
2227 // Default: null or empty if the device identifier is not known
2228 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2229 // Connection handle of this connection if available
2230 // Range: 0x0000 - 0x0EFF (12 bits)
2231 // Default: 0xFFFF if the handle is unknown
2232 optional int32 connection_handle = 2;
2233 // HCI command status code if this is triggerred by hci_cmd
2234 // Default: STATUS_UNKNOWN
2235 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2236 // BR/EDR
2237 // Range: -128 ≤ N ≤ 127 (signed integer)
2238 // Units: dB
2239 // LE:
2240 // Range: -127 to 20, 127 (signed integer)
2241 // Units: dBm
2242 // Invalid when an out of range value is reported
2243 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002244 // An identifier that can be used to match events for this device.
2245 // The incremental identifier is locally generated and guaranteed not derived
2246 // from any globally unique hardware id.
2247 // For paired devices, it stays consistent between Bluetooth toggling for the
2248 // same remote device.
2249 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2250 // session for the same remote device.
2251 // Default: 0 if the device's metric id is unknown.
2252 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002253}
2254
2255/**
2256 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2257 *
2258 * Logged from:
2259 * system/bt
2260 */
2261message BluetoothDeviceFailedContactCounterReported {
2262 // An identifier that can be used to match events for this device.
2263 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2264 // Salt: Randomly generated 256 bit value
2265 // Hash algorithm: HMAC-SHA256
2266 // Size: 32 byte
2267 // Default: null or empty if the device identifier is not known
2268 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2269 // Connection handle of this connection if available
2270 // Range: 0x0000 - 0x0EFF (12 bits)
2271 // Default: 0xFFFF if the handle is unknown
2272 optional int32 connection_handle = 2;
2273 // HCI command status code if this is triggerred by hci_cmd
2274 // Default: STATUS_UNKNOWN
2275 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2276 // Number of consecutive failed contacts for a connection corresponding to the Handle
2277 // Range: uint16_t, 0-0xFFFF
2278 // Default: 0xFFFFF
2279 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002280 // An identifier that can be used to match events for this device.
2281 // The incremental identifier is locally generated and guaranteed not derived
2282 // from any globally unique hardware id.
2283 // For paired devices, it stays consistent between Bluetooth toggling for the
2284 // same remote device.
2285 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2286 // session for the same remote device.
2287 // Default: 0 if the device's metric id is unknown.
2288 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002289}
2290
2291/**
2292 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2293 *
2294 * Logged from:
2295 * system/bt
2296 */
2297message BluetoothDeviceTxPowerLevelReported {
2298 // An identifier that can be used to match events for this device.
2299 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2300 // Salt: Randomly generated 256 bit value
2301 // Hash algorithm: HMAC-SHA256
2302 // Size: 32 byte
2303 // Default: null or empty if the device identifier is not known
2304 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2305 // Connection handle of this connection if available
2306 // Range: 0x0000 - 0x0EFF (12 bits)
2307 // Default: 0xFFFF if the handle is unknown
2308 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002309 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002310 // Default: STATUS_UNKNOWN
2311 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2312 // Range: -30 ≤ N ≤ 20
2313 // Units: dBm
2314 // Invalid when an out of range value is reported
2315 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002316 // An identifier that can be used to match events for this device.
2317 // The incremental identifier is locally generated and guaranteed not derived
2318 // from any globally unique hardware id.
2319 // For paired devices, it stays consistent between Bluetooth toggling for the
2320 // same remote device.
2321 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2322 // session for the same remote device.
2323 // Default: 0 if the device's metric id is unknown.
2324 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002325}
Jack Heab86dbd22018-12-18 15:43:27 -08002326
Tej Singh5d991e12018-03-09 19:48:11 -08002327/**
Jack He1021a612019-01-20 21:22:46 -08002328 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2329 * receiving an HCI command from the host
2330 *
2331 * Logged from: system/bt
2332 */
2333message BluetoothHciTimeoutReported {
2334 // HCI command associated with this event
2335 // Default: CMD_UNKNOWN
2336 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2337}
2338
2339/**
2340 * Logs when we receive Bluetooth Link Quality Report event from the controller
2341 * See Android Bluetooth HCI specification for more details
2342 *
2343 * Note: all count and bytes field are counted since last event
2344 *
2345 * Logged from: system/bt
2346 */
2347message BluetoothQualityReportReported {
2348 // Quality report ID
2349 // Original type: uint8_t
2350 // Default: BQR_ID_UNKNOWN
2351 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2352 // Packet type of the connection
2353 // Original type: uint8_t
2354 // Default: BQR_PACKET_TYPE_UNKNOWN
2355 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2356 // Connection handle of the connection
2357 // Original type: uint16_t
2358 optional int32 connection_handle = 3;
2359 // Performing Role for the connection
2360 // Original type: uint8_t
2361 optional int32 connection_role = 4;
2362 // Current Transmit Power Level for the connection. This value is the same as the controller's
2363 // response to the HCI_Read_Transmit_Power_Level HCI command
2364 // Original type: uint8_t
2365 optional int32 tx_power_level = 5;
2366 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2367 // absolute receiver signal strength value
2368 // Original type: int8_t
2369 optional int32 rssi = 6;
2370 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2371 // channels used by the link currently
2372 // Original type: uint8_t
2373 optional int32 snr = 7;
2374 // Indicates the number of unused channels in AFH_channel_map
2375 // Original type: uint8_t
2376 optional int32 unused_afh_channel_count = 8;
2377 // Indicates the number of the channels which are interfered and quality is bad but are still
2378 // selected for AFH
2379 // Original type: uint8_t
2380 optional int32 afh_select_unideal_channel_count = 9;
2381 // Current Link Supervision Timeout Setting
2382 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2383 // Original type: uint16_t
2384 optional int32 lsto = 10;
2385 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2386 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2387 // 0x01 (Piconet Clock)
2388 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2389 // Original type: uint32_t
2390 optional int64 connection_piconet_clock = 11;
2391 // The count of retransmission
2392 // Original type: uint32_t
2393 optional int64 retransmission_count = 12;
2394 // The count of no RX
2395 // Original type: uint32_t
2396 optional int64 no_rx_count = 13;
2397 // The count of NAK (Negative Acknowledge)
2398 // Original type: uint32_t
2399 optional int64 nak_count = 14;
2400 // Controller timestamp of last TX ACK
2401 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2402 // Original type: uint32_t
2403 optional int64 last_tx_ack_timestamp = 15;
2404 // The count of Flow-off (STOP)
2405 // Original type: uint32_t
2406 optional int64 flow_off_count = 16;
2407 // Controller timestamp of last Flow-on (GO)
2408 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2409 // Original type: uint32_t
2410 optional int64 last_flow_on_timestamp = 17;
2411 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2412 // Original type: uint32_t
2413 optional int64 buffer_overflow_bytes = 18;
2414 // Buffer underflow count (in byte) since last event
2415 // Original type: uint32_t
2416 optional int64 buffer_underflow_bytes = 19;
2417}
2418
2419/**
2420 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2421 *
2422 * Notes:
2423 * - Each event can be partially filled as we might learn different pieces of device
2424 * information at different time
2425 * - Multiple device info events can be combined to give more complete picture
2426 * - When multiple device info events tries to describe the same information, the
2427 * later one wins
2428 *
2429 * Logged from:
2430 * packages/apps/Bluetooth
2431 */
Jack Heaea26982019-04-04 11:19:48 -07002432message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002433 // An identifier that can be used to match events for this device.
2434 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2435 // Salt: Randomly generated 256 bit value
2436 // Hash algorithm: HMAC-SHA256
2437 // Size: 32 byte
2438 // Default: null or empty if the device identifier is not known
2439 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2440 // Where is this device info obtained from
2441 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2442 // Name of the data source
2443 // For EXTERNAL: package name of the data source
2444 // For INTERNAL: null for general case, component name otherwise
2445 optional string source_name = 3;
2446 // Name of the manufacturer of this device
2447 optional string manufacturer = 4;
2448 // Model of this device
2449 optional string model = 5;
2450 // Hardware version of this device
2451 optional string hardware_version = 6;
2452 // Software version of this device
2453 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002454 // An identifier that can be used to match events for this device.
2455 // The incremental identifier is locally generated and guaranteed not derived
2456 // from any globally unique hardware id.
2457 // For paired devices, it stays consistent between Bluetooth toggling for the
2458 // same remote device.
2459 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2460 // session for the same remote device.
2461 // Default: 0 if the device's metric id is unknown.
2462 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002463}
2464
2465/**
2466 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2467 * device, as documented by the Bluetooth Core HCI specification
2468 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2469 * Vol 2, Part E, Page 1118
2470 *
2471 * Logged from:
2472 * system/bt
2473 */
2474message BluetoothRemoteVersionInfoReported {
2475 // Connection handle of the connection
2476 // Original type: uint16_t
2477 optional int32 connection_handle = 1;
2478 // HCI command status code
2479 // Default: STATUS_UNKNOWN
2480 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2481 // 1 byte Version of current LMP in the remote controller
2482 optional int32 lmp_version = 3;
2483 // 2 bytes LMP manufacturer code of the remote controller
2484 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2485 optional int32 lmp_manufacturer_code = 4;
2486 // 4 bytes subversion of the LMP in the remote controller
2487 optional int32 lmp_subversion = 5;
2488}
2489
2490/**
2491 * Logs when certain Bluetooth SDP attributes are discovered
2492 * Constant definitions are from:
2493 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2494 *
2495 * Current logged attributes:
2496 * - BluetoothProfileDescriptorList
2497 * - Supported Features Bitmask
2498 *
2499 * Logged from:
2500 * system/bt
2501 */
2502message BluetoothSdpAttributeReported {
2503 // An identifier that can be used to match events for this device.
2504 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2505 // Salt: Randomly generated 256 bit value
2506 // Hash algorithm: HMAC-SHA256
2507 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2508 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2509 // Original type: uint16_t
2510 optional int32 protocol_uuid = 2;
2511 // Short form UUIDs used to identify Bluetooth SDP attribute types
2512 // Original type: uint16_t
2513 optional int32 attribute_id = 3;
2514 // Attribute value for the particular attribute
2515 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002516 // An identifier that can be used to match events for this device.
2517 // The incremental identifier is locally generated and guaranteed not derived
2518 // from any globally unique hardware id.
2519 // For paired devices, it stays consistent between Bluetooth toggling for the
2520 // same remote device.
2521 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2522 // session for the same remote device.
2523 // Default: 0 if the device's metric id is unknown.
2524 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002525}
2526
2527/**
2528 * Logs when bond state of a Bluetooth device changes
2529 *
2530 * Logged from:
2531 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2532 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2533 */
2534message BluetoothBondStateChanged {
2535 // An identifier that can be used to match events for this device.
2536 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2537 // Salt: Randomly generated 256 bit value
2538 // Hash algorithm: HMAC-SHA256
2539 // Size: 32 byte
2540 // Default: null or empty if the device identifier is not known
2541 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2542 // Preferred transport type to remote dual mode device
2543 // Default: TRANSPORT_AUTO means no preference
2544 optional android.bluetooth.TransportTypeEnum transport = 2;
2545 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2546 // Default: UNKNOWN
2547 optional android.bluetooth.DeviceTypeEnum type = 3;
2548 // Current bond state (NONE, BONDING, BONDED)
2549 // Default: BOND_STATE_UNKNOWN
2550 optional android.bluetooth.BondStateEnum bond_state = 4;
2551 // Bonding sub state
2552 // Default: BOND_SUB_STATE_UNKNOWN
2553 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2554 // Unbond Reason
2555 // Default: UNBOND_REASON_UNKNOWN
2556 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002557 // An identifier that can be used to match events for this device.
2558 // The incremental identifier is locally generated and guaranteed not derived
2559 // from any globally unique hardware id.
2560 // For paired devices, it stays consistent between Bluetooth toggling for the
2561 // same remote device.
2562 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2563 // session for the same remote device.
2564 // Default: 0 if the device's metric id is unknown.
2565 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002566}
2567
2568/**
2569 * Logs there is an event related Bluetooth classic pairing
2570 *
2571 * Logged from:
2572 * system/bt
2573 */
2574message BluetoothClassicPairingEventReported {
2575 // An identifier that can be used to match events for this device.
2576 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2577 // Salt: Randomly generated 256 bit value
2578 // Hash algorithm: HMAC-SHA256
2579 // Size: 32 byte
2580 // Default: null or empty if the device identifier is not known
2581 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2582 // Connection handle of this connection if available
2583 // Range: 0x0000 - 0x0EFF (12 bits)
2584 // Default: 0xFFFF if the handle is unknown
2585 optional int32 connection_handle = 2;
2586 // HCI command associated with this event
2587 // Default: CMD_UNKNOWN
2588 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2589 // HCI event associated with this event
2590 // Default: EVT_UNKNOWN
2591 optional android.bluetooth.hci.EventEnum hci_event = 4;
2592 // HCI command status code if this is triggerred by hci_cmd
2593 // Default: STATUS_UNKNOWN
2594 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2595 // HCI reason code associated with this event
2596 // Default: STATUS_UNKNOWN
2597 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002598 // A status value related to this specific event
2599 // Default: 0
2600 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002601 // An identifier that can be used to match events for this device.
2602 // The incremental identifier is locally generated and guaranteed not derived
2603 // from any globally unique hardware id.
2604 // For paired devices, it stays consistent between Bluetooth toggling for the
2605 // same remote device.
2606 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2607 // session for the same remote device.
2608 // Default: 0 if the device's metric id is unknown.
2609 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002610}
2611
2612/**
2613 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2614 *
2615 * Logged from:
2616 * system/bt
2617 */
2618message BluetoothSmpPairingEventReported {
2619 // An identifier that can be used to match events for this device.
2620 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2621 // Salt: Randomly generated 256 bit value
2622 // Hash algorithm: HMAC-SHA256
2623 // Size: 32 byte
2624 // Default: null or empty if the device identifier is not known
2625 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2626 // SMP command sent or received over L2CAP
2627 // Default: CMD_UNKNOWN
2628 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2629 // Whether this command is sent or received
2630 // Default: DIRECTION_UNKNOWN
2631 optional android.bluetooth.DirectionEnum direction = 3;
2632 // SMP failure reason code
2633 // Default: PAIRING_FAIL_REASON_DEFAULT
2634 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002635 // An identifier that can be used to match events for this device.
2636 // The incremental identifier is locally generated and guaranteed not derived
2637 // from any globally unique hardware id.
2638 // For paired devices, it stays consistent between Bluetooth toggling for the
2639 // same remote device.
2640 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2641 // session for the same remote device.
2642 // Default: 0 if the device's metric id is unknown.
2643 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002644}
2645
2646/**
Jack He815cdba2019-01-30 17:24:55 -08002647 * Logs when a Bluetooth socket’s connection state changed
2648 *
2649 * Logged from:
2650 * system/bt
2651 */
2652message BluetoothSocketConnectionStateChanged {
2653 // An identifier that can be used to match events for this device.
2654 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2655 // Salt: Randomly generated 256 bit value
2656 // Hash algorithm: HMAC-SHA256
2657 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002658 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002659 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002660 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002661 // Default 0 when unknown or don't care
2662 optional int32 port = 2;
2663 // Socket type as mentioned in
2664 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2665 // Default: SOCKET_TYPE_UNKNOWN
2666 optional android.bluetooth.SocketTypeEnum type = 3;
2667 // Socket connection state
2668 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2669 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2670 // Number of bytes sent to remote device during this connection
2671 optional int64 tx_bytes = 5;
2672 // Number of bytes received from remote device during this connection
2673 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002674 // Socket owner's UID
2675 optional int32 uid = 7 [(is_uid) = true];
2676 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2677 // |port| must be spawned by |server_port|
2678 // Default 0 when unknown or don't care
2679 optional int32 server_port = 8;
2680 // Whether this is a server listener socket
2681 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002682 // An identifier that can be used to match events for this device.
2683 // The incremental identifier is locally generated and guaranteed not derived
2684 // from any globally unique hardware id.
2685 // For paired devices, it stays consistent between Bluetooth toggling for the
2686 // same remote device.
2687 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2688 // session for the same remote device.
2689 // Default: 0 if the device's metric id is unknown.
2690 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002691}
2692
2693/**
Jack He71426802019-04-02 13:32:52 -07002694 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2695 *
2696 * Logged from:
2697 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2698 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2699 *
2700 */
2701message BluetoothClassOfDeviceReported {
2702 // An identifier that can be used to match events for this device.
2703 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2704 // Salt: Randomly generated 256 bit value
2705 // Hash algorithm: HMAC-SHA256
2706 // Size: 32 byte
2707 // Default: null or empty if this is a server listener socket
2708 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2709 // Class of Device (CoD) value including both Major, Minor device class and service class
2710 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2711 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2712 // Default: 0
2713 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002714 // An identifier that can be used to match events for this device.
2715 // The incremental identifier is locally generated and guaranteed not derived
2716 // from any globally unique hardware id.
2717 // For paired devices, it stays consistent between Bluetooth toggling for the
2718 // same remote device.
2719 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2720 // session for the same remote device.
2721 // Default: 0 if the device's metric id is unknown.
2722 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002723}
2724
2725/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002726 * Logs when something is plugged into or removed from the USB-C connector.
2727 *
2728 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002729 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002730 */
2731message UsbConnectorStateChanged {
2732 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002733 STATE_DISCONNECTED = 0;
2734 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002735 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002736 optional State state = 1
2737 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2738 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002739 // Last active session in ms.
2740 // 0 when the port is in connected state.
2741 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002742}
2743
2744/**
2745 * Logs the reported speaker impedance.
2746 *
2747 * Logged from:
2748 * Vendor audio implementation.
2749 */
2750message SpeakerImpedanceReported {
2751 optional int32 speaker_location = 1;
2752 optional int32 impedance = 2;
2753}
2754
2755/**
2756 * Logs the report of a failed hardware.
2757 *
2758 * Logged from:
2759 * Vendor HALs.
2760 *
2761 */
2762message HardwareFailed {
2763 enum HardwareType {
2764 HARDWARE_FAILED_UNKNOWN = 0;
2765 HARDWARE_FAILED_MICROPHONE = 1;
2766 HARDWARE_FAILED_CODEC = 2;
2767 HARDWARE_FAILED_SPEAKER = 3;
2768 HARDWARE_FAILED_FINGERPRINT = 4;
2769 }
2770 optional HardwareType hardware_type = 1;
2771
Maggie White6dcd8572019-01-31 14:11:50 -08002772 /**
2773 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002774 * the same hardware_type. The specific locations are vendor defined integers,
2775 * referring to board-specific numbering schemes.
2776 */
2777 optional int32 hardware_location = 2;
2778
Maggie White6dcd8572019-01-31 14:11:50 -08002779 /**
2780 * failure_code is specific to the HardwareType of the failed hardware.
2781 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002782 */
Maggie White6dcd8572019-01-31 14:11:50 -08002783 enum HardwareErrorCode {
2784 UNKNOWN = 0;
2785 COMPLETE = 1;
2786 SPEAKER_HIGH_Z = 2;
2787 SPEAKER_SHORT = 3;
2788 FINGERPRINT_SENSOR_BROKEN = 4;
2789 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002790 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002791 }
2792 optional int32 failure_code = 3;
2793}
2794
2795/**
2796 * Log an event when the device has been physically dropped.
2797 * Reported from the /vendor partition.
2798 */
2799message PhysicalDropDetected {
2800 // Confidence that the event was actually a drop, 0 -> 100
2801 optional int32 confidence_pctg = 1;
2802 // Peak acceleration of the drop, in 1/1000s of a g.
2803 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002804 // Duration of freefall in ms
2805 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002806}
2807
2808/**
2809 * Log bucketed battery charge cycles.
2810 *
2811 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002812 * a given charge point. For example, if 10 cycle buckets are
2813 * initialized, bucket 1 is the lowest 1/10th of the battery,
2814 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002815 *
2816 * Logged from:
2817 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2818 */
2819message ChargeCyclesReported {
2820 optional int32 cycle_bucket_1 = 1;
2821 optional int32 cycle_bucket_2 = 2;
2822 optional int32 cycle_bucket_3 = 3;
2823 optional int32 cycle_bucket_4 = 4;
2824 optional int32 cycle_bucket_5 = 5;
2825 optional int32 cycle_bucket_6 = 6;
2826 optional int32 cycle_bucket_7 = 7;
2827 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002828 optional int32 cycle_bucket_9 = 9;
2829 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002830}
2831
2832/**
Howard Roa46b6582018-09-18 16:45:02 -07002833 * Log battery health snapshot.
2834 *
2835 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2836 * are snapshotted periodically over 24hrs.
2837 */
2838message BatteryHealthSnapshot {
2839 enum BatterySnapshotType {
2840 UNKNOWN = 0;
2841 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2842 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2843 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2844 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2845 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2846 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2847 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2848 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2849 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2850 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2851 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2852 }
2853 optional BatterySnapshotType type = 1;
2854 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002855 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002856 // Voltage Battery Voltage, in microVolts.
2857 optional int32 voltage_micro_volt = 3;
2858 // Current Battery current, in microAmps.
2859 optional int32 current_micro_amps = 4;
2860 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2861 optional int32 open_circuit_micro_volt = 5;
2862 // Resistance Battery Resistance, in microOhms.
2863 optional int32 resistance_micro_ohm = 6;
2864 // Level Battery Level, as % of full.
2865 optional int32 level_percent = 7;
2866}
2867
2868/**
2869 * Log slow I/O operations on the primary storage.
2870 */
2871message SlowIo {
2872 // Classifications of IO Operations.
2873 enum IoOperation {
2874 UNKNOWN = 0;
2875 READ = 1;
2876 WRITE = 2;
2877 UNMAP = 3;
2878 SYNC = 4;
2879 }
2880 optional IoOperation operation = 1;
2881
2882 // The number of slow IO operations of this type over 24 hours.
2883 optional int32 count = 2;
2884}
2885
2886/**
2887 * Log battery caused shutdown with the last recorded voltage.
2888 */
2889message BatteryCausedShutdown {
2890 // The last recorded battery voltage prior to shutdown.
2891 optional int32 last_recorded_micro_volt = 1;
2892}
2893
2894/**
Tej Singha72344992019-04-17 18:55:08 -07002895 * Logs when ThermalService receives throttling events.
2896 *
2897 * Logged from:
2898 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2899 */
2900message ThermalThrottlingSeverityStateChanged {
2901 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2902 optional android.os.TemperatureTypeEnum sensor_type = 1;
2903
2904 // The name of the temperature source. Eg. CPU0
2905 optional string sensor_name = 2;
2906
2907 // Temperature in tenths of a degree C.
2908 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2909 optional int32 temperature_deci_celsius = 3;
2910
2911 // Relative severity of the throttling, see enum definition.
2912 optional android.os.ThrottlingSeverityEnum severity = 4;
2913}
2914
2915/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002916 * Logs the duration of a davey (jank of >=700ms) when it occurs
2917 *
2918 * Logged from:
2919 * frameworks/base/libs/hwui/JankTracker.cpp
2920 */
2921message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002922 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002923 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002924
Tej Singhbb8554a2018-01-26 11:59:14 -08002925 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002926 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002927}
2928
2929/**
Bookatze5885242017-10-24 20:10:31 -07002930 * Logs phone signal strength changes.
2931 *
2932 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002934 */
2935message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002936 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2937 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002938}
2939
Yangster4ccebea2018-10-09 17:09:02 -07002940
2941/**
2942 * Logs when the phone state, sim state or signal strength changes
2943 *
2944 * Logged from:
2945 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2946 */
2947message PhoneServiceStateChanged {
2948 optional android.telephony.ServiceStateEnum state = 1;
2949 optional android.telephony.SimStateEnum sim_state = 2;
2950 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2951}
2952
2953/**
2954 * Logs when the phone becomes on or off.
2955 *
2956 * Logged from:
2957 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2958 */
2959message PhoneStateChanged {
2960 enum State {
2961 OFF = 0;
2962 ON = 1;
2963 }
2964 optional State state = 1;
2965}
2966
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002967message BackGesture {
2968 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002969 DEFAULT_BACK_TYPE = 0;
2970 COMPLETED = 1;
2971 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2972 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2973 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2974 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2975 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2976 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2977 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002978 }
2979 optional BackType type = 1;
2980
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002981 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2982 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2983 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2984 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2985 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2986 optional int32 left_boundary = 8; // left edge width + left inset
2987 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2988
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002989 enum WindowHorizontalLocation {
2990 DEFAULT_LOCATION = 0;
2991 LEFT = 1;
2992 RIGHT = 2;
2993 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002994 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002995}
2996
2997message ExclusionRectStateChanged {
2998 optional string component_name = 1; // if not available, simply packageName
2999 optional int32 requested_height = 2; // px
3000 optional int32 rejected_height = 3; // px
3001
3002 enum WindowHorizontalLocation {
3003 DEFAULT_LOCATION = 0;
3004 LEFT = 1;
3005 RIGHT = 2;
3006 }
3007 optional WindowHorizontalLocation x_location = 4;
3008 optional bool landscape = 5;
3009 optional bool splitscreen = 6;
3010 optional int32 duration_millis = 7;
3011}
3012
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003013/**
3014 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3015 *
3016 * Logged from:
3017 * packages/apps/Launcher3
3018 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003019message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003020 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003021 optional android.stats.launcher.LauncherState src_state = 2;
3022 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003023 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3024 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3025
3026 // The event id (e.g., app launch, drag and drop, long press)
3027 optional int32 event_id = 6;
3028 // The event's source or target id (e.g., icon, task, button)
3029 optional int32 target_id = 7;
3030 // If the target needs to be tracked, use this id field
3031 optional int32 instance_id = 8;
3032 optional int32 uid = 9 [(is_uid) = true];
3033 optional string package_name = 10;
3034 optional string component_name = 11;
3035
3036 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003037 optional int32 grid_x = 12 [default = -1];
3038 optional int32 grid_y = 13 [default = -1];
3039 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003040
3041 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003042 optional int32 grid_x_parent = 15 [default = -1];
3043 optional int32 grid_y_parent = 16 [default = -1];
3044 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003045
3046 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3047 optional int32 hierarchy = 18;
3048
3049 optional bool is_work_profile = 19;
3050
3051 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003052 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003053
3054 // e.g., folderLabelState can be captured in the following two fields
3055 optional int32 from_state = 21;
3056 optional int32 to_state = 22;
3057
3058 // e.g., autofilled or suggested texts that are not user entered
3059 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003060
3061 // e.g., number of contents inside a container (e.g., icons inside a folder)
3062 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003063}
3064
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003065/**
3066 * Used for snapshot of the HomeScreen UI elements
3067 *
3068 * Logged from:
3069 * packages/apps/Launcher3
3070 */
3071message LauncherStaticLayout {
3072 // The event id (e.g., snapshot, drag and drop)
3073 optional int32 event_id = 1;
3074 // The event's source or target id (e.g., icon, shortcut, widget)
3075 optional int32 target_id = 2;
3076 // If the target needs to be tracked, use this id field
3077 optional int32 instance_id = 3;
3078 optional int32 uid = 4 [(is_uid) = true];
3079 optional string package_name = 5;
3080 optional string component_name = 6;
3081
3082 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003083 optional int32 grid_x = 7 [default = -1];
3084 optional int32 grid_y = 8 [default = -1];
3085 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003086
3087 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003088 // e.g., when used with widgets target, use these values for (span_x, span_y)
3089 optional int32 grid_x_parent = 10 [default = -1];
3090 optional int32 grid_y_parent = 11 [default = -1];
3091 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003092
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003093 // UNKNOWN = 0
3094 // HOTSEAT = 1
3095 // WORKSPACE = 2
3096 // FOLDER_HOTSEAT = 3
3097 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003098 optional int32 hierarchy = 13;
3099
3100 optional bool is_work_profile = 14;
3101
3102 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3103 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003104
3105 // e.g., number of icons inside a folder
3106 optional int32 cardinality = 16;
3107
3108 // e.g., (x, y) span of the widget inside homescreen grid system
3109 optional int32 span_x = 17 [default = 1];
3110 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003111}
3112
3113/**
3114 * Logs when Wallpaper or ThemePicker UI has changed.
3115 *
3116 * Logged from:
3117 * packages/apps/ThemePicker
3118 * packages/apps/WallpaperPicker2
3119 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003120message StyleUIChanged {
3121 optional android.stats.style.Action action = 1;
3122 optional int32 color_package_hash = 2;
3123 optional int32 font_package_hash = 3;
3124 optional int32 shape_package_hash = 4;
3125 optional int32 clock_package_hash = 5;
3126 optional int32 launcher_grid = 6;
3127 optional int32 wallpaper_category_hash = 7;
3128 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003129 optional int32 color_preference = 9;
3130 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003131}
3132
David Chenc28b2bb2017-10-24 12:52:52 -07003133/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003134 * Logs when Settings UI has changed.
3135 *
3136 * Logged from:
3137 * packages/apps/Settings
3138 */
3139message SettingsUIChanged {
3140 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003141 * Where this SettingsUIChange event comes from. For example, if
3142 * it's a PAGE_VISIBLE event, where the page is opened from.
3143 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003144 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003145
3146 /**
3147 * What the UI action is.
3148 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003149 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003150
3151 /**
3152 * Where the action is happening
3153 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003154 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003155
3156 /**
3157 * What preference changed in this event.
3158 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003159 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003160
3161 /**
3162 * The new value of the changed preference.
3163 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003164 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003165}
3166
3167/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003168 * Logs basic timing information about touch events.
3169 * Reported at most every 5 minutes while device is being interacted with.
3170 *
3171 * Logged from:
3172 * frameworks/native/services/inputflinger
3173 */
3174message TouchEventReported {
3175 /**
3176 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003177 * and the standard deviation of the time spent processing touchscreen events
3178 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003179 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003180 * On supported devices, the starting point is taken during the hard interrupt inside the
3181 * kernel touch driver. On all other devices, the starting point is taken inside
3182 * the kernel's input event subsystem upon receipt of the input event.
3183 * The ending point is taken inside InputDispatcher, just after the input event
3184 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003185 */
3186 // Minimum value
3187 optional float latency_min_micros = 1;
3188 // Maximum value
3189 optional float latency_max_micros = 2;
3190 // Average value
3191 optional float latency_mean_micros = 3;
3192 // Standard deviation
3193 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003194 // Number of touch events (input_event) in this report
3195 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003196}
3197
3198/**
Philip Quinn0eded622019-01-29 12:46:28 -08003199 * Logs gesture classification and timing information for touch events.
3200 *
3201 * Logged from:
3202 * frameworks/base/core/java/android/view/GestureDetector.java
3203 * frameworks/base/core/java/android/view/View.java
3204 */
3205message TouchGestureClassified {
3206 // The source of the classification (e.g. Java class name).
3207 optional string source = 1;
3208
3209 enum Classification {
3210 UNKNOWN_CLASSIFICATION = 0;
3211 SINGLE_TAP = 1;
3212 DOUBLE_TAP = 2;
3213 LONG_PRESS = 3;
3214 DEEP_PRESS = 4;
3215 SCROLL = 5;
3216 }
3217 // The classification of the gesture.
3218 optional Classification classification = 2;
3219
3220 // The interval from the start of a touch event stream until the
3221 // classification was made.
3222 optional int32 latency_millis = 3;
3223
3224 // The distance from the location of the first touch event to the
3225 // location of the touch event when the classification was made.
3226 optional float displacement_px = 4;
3227}
3228
3229/**
David Chenc28b2bb2017-10-24 12:52:52 -07003230 * Logs that a setting was updated.
3231 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003232 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003233 * The tag and is_default allow resetting of settings to default values based on the specified
3234 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3235 */
3236message SettingChanged {
3237 // The name of the setting.
3238 optional string setting = 1;
3239
3240 // The change being imposed on this setting. May represent a number, eg "3".
3241 optional string value = 2;
3242
3243 // The new value of this setting. For most settings, this is same as value. For some settings,
3244 // value is +X or -X where X represents an element in a set. For example, if the previous value
3245 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3246 // The +/- feature is currently only used for location_providers_allowed.
3247 optional string new_value = 3;
3248
3249 // The previous value of this setting.
3250 optional string prev_value = 4;
3251
3252 // The tag used with the is_default for resetting sets of settings. This is generally null.
3253 optional string tag = 5;
3254
Bookatz90867622018-01-31 15:05:57 -08003255 // True if this setting with tag should be resettable.
3256 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003257
David Chenbd789912018-03-16 17:19:55 -07003258 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003259 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003260
3261 enum ChangeReason {
3262 UPDATED = 1; // Updated can be an insertion or an update.
3263 DELETED = 2;
3264 }
3265 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003266}
Chenjie Yub3dda412017-10-24 13:41:59 -07003267
Chenjie Yu05013b32017-11-21 10:21:41 -08003268/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003269 * Logs activity going to foreground or background
3270 *
3271 * Logged from:
3272 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3273 */
3274message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003275 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003276 optional string pkg_name = 2;
3277 optional string class_name = 3;
3278
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003279 enum State {
3280 BACKGROUND = 0;
3281 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003282 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003283 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003284}
David Chenc8a43242017-10-17 16:23:28 -07003285
3286/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003287 * Logs when a volume entered low Storage state.
3288 * Logged from:
3289 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3290 */
3291message LowStorageStateChanged {
3292 // Volume that ran out of storage.
3293 optional string volume_description = 1;
3294
3295 enum State {
3296 UNKNOWN = 0;
3297 OFF = 1;
3298 ON = 2;
3299 }
3300 optional State state = 2;
3301}
3302
3303/**
3304 * Logs when an app is downgraded.
3305 * Logged from:
3306 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3307 */
3308message AppDowngraded {
3309 optional string package_name = 1;
3310 // Size of the package (all data) before being downgraded.
3311 optional int64 size_in_bytes_before = 2;
3312 // Size of the package (all data) after being downgraded.
3313 optional int64 size_in_bytes_after = 3;
3314
3315 optional bool aggressive = 4;
3316}
3317
3318/**
3319 * Logs when an app is optimized after being downgraded.
3320 * Logged from:
3321 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3322 */
3323message AppOptimizedAfterDowngraded {
3324 optional string package_name = 1;
3325}
3326
3327/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003328 * Logs whenever an app is installed on external storage.
3329 * Logged from:
3330 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3331 */
3332message AppInstallOnExternalStorageReported {
3333 // The type of external storage.
3334 optional android.stats.storage.ExternalStorageType storage_type = 1;
3335 // The name of the package that is installed on the sd card.
3336 optional string package_name = 2;
3337}
3338
3339/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003340 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003341 * Logged from:
3342 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3343 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003344message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003345 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003346
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003347 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003348
3349 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003350 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003351 optional string process_name = 3;
3352
3353 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003354 optional int32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003355
3356 optional string package_name = 5;
3357
3358 enum InstantApp {
3359 UNAVAILABLE = 0;
3360 FALSE = 1;
3361 TRUE = 2;
3362 }
3363 optional InstantApp is_instant_app = 6;
3364
3365 enum ForegroundState {
3366 UNKNOWN = 0;
3367 BACKGROUND = 1;
3368 FOREGROUND = 2;
3369 }
3370 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003371
3372 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003373}
David Chen9e3808c2017-11-20 17:25:34 -08003374
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003375/**
3376 * Logs when a WTF (What a Terrible Failure) happened.
3377 * Logged from:
3378 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3379 */
3380message WTFOccurred {
3381 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003382
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003384
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003385 // The name of the process.
3386 // system_server if it is not by an app
3387 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003388
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003389 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003390 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003391
3392 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003393}
3394
3395/**
3396 * Logs when system server reports low memory.
3397 * Logged from:
3398 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3399 */
3400message LowMemReported {
3401}
3402
3403/**
3404 * Logs when an app ANR (App Not Responding) occurs.
3405 * Logged from:
3406 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3407 */
3408message ANROccurred {
3409 optional int32 uid = 1 [(is_uid) = true];
3410
3411 optional string process_name = 2;
3412
3413 optional string short_component_name = 3;
3414
3415 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003416
3417 enum InstantApp {
3418 UNAVAILABLE = 0;
3419 FALSE = 1;
3420 TRUE = 2;
3421 }
3422 optional InstantApp is_instant_app = 5;
3423
3424 enum ForegroundState {
3425 UNKNOWN = 0;
3426 BACKGROUND = 1;
3427 FOREGROUND = 2;
3428 }
3429 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003430
3431 optional android.server.ErrorSource error_source = 7;
3432
3433 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003434}
3435
Bookatza7020bd2018-08-28 16:29:35 -07003436/**
3437 * Logs when the vibrator state changes.
3438 * Logged from:
3439 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3440 */
3441message VibratorStateChanged {
3442 repeated AttributionNode attribution_node = 1;
3443
3444 enum State {
3445 OFF = 0;
3446 ON = 1;
3447 }
3448 optional State state = 2;
3449
3450 // Duration (in milliseconds) requested to keep the vibrator on.
3451 // Only applicable for State == ON.
3452 optional int64 duration_millis = 3;
3453}
3454
David Chen0a368b22017-12-06 16:28:16 -08003455/*
3456 * Allows other apps to push events into statsd.
3457 * Logged from:
3458 * frameworks/base/core/java/android/util/StatsLog.java
3459 */
David Chen0b5c90c2018-01-25 16:51:49 -08003460message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003461 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003462 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003463
3464 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3465 optional int32 label = 2;
3466
3467 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3468 // predicates for the metrics).
3469 enum State {
3470 UNKNOWN = 0;
3471 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3472 STOP = 2;
3473 START = 3;
3474 }
3475 optional State state = 3;
3476}
3477
David Chen9e3808c2017-11-20 17:25:34 -08003478/**
Bookatz7948c872018-09-04 12:58:33 -07003479 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3480 * For example, this could be due to the user manually changing the time.
3481 *
3482 * Logged from:
3483 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3484 */
3485message WallClockTimeShifted {
3486 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3487 optional int64 wall_clock_timestamp_millis = 1;
3488}
3489
3490/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003491 * Logs when statsd detects an anomaly.
3492 *
3493 * Logged from:
3494 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3495 */
3496message AnomalyDetected {
3497 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003498 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003499
Yangster-mac94e197c2018-01-02 16:03:03 -08003500 // Id of the config whose anomaly detection alert fired.
3501 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003502
Yangster-mac94e197c2018-01-02 16:03:03 -08003503 // Id of the alert (i.e. name of the anomaly that was detected).
3504 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003505}
3506
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003507message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003508 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003509 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003510
3511 // The app package name.
3512 optional string pkg_name = 2;
3513
3514 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003515 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003516 WARM = 1;
3517 HOT = 2;
3518 COLD = 3;
3519 }
3520 // The transition type.
3521 optional TransitionType type = 3;
3522
3523 // The activity name.
3524 optional string activity_name = 4;
3525
3526 // The name of the calling app. Empty if not set.
3527 optional string calling_pkg_name = 5;
3528
3529 // Whether the app is an instant app.
3530 optional bool is_instant_app = 6;
3531
3532 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003533 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003534
Bookatz80d11a02018-01-16 10:46:35 -08003535 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003536
David Chen0b5c90c2018-01-25 16:51:49 -08003537 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003539 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003540 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003541 optional int32 bind_application_delay_millis = 11;
3542 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003543
3544 // Empty if not set.
3545 optional string launch_token = 13;
3546
Calin Juravle759fbda2018-02-20 19:52:30 +00003547 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003548 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003549
3550 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003551 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003552}
3553
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003554message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003555 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003556 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003557
3558 // The app package name.
3559 optional string pkg_name = 2;
3560
3561 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003562 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003563 WARM = 1;
3564 HOT = 2;
3565 COLD = 3;
3566 }
3567 // The transition type.
3568 optional TransitionType type = 3;
3569
3570 // The activity name.
3571 optional string activity_name = 4;
3572}
3573
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003574message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003575 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003576 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003577
3578 // The app package name.
3579 optional string pkg_name = 2;
3580
3581 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003582 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003583 WITH_BUNDLE = 1;
3584 WITHOUT_BUNDLE = 2;
3585 }
3586 // The transition type.
3587 optional TransitionType type = 3;
3588
3589 // The activity name.
3590 optional string activity_name = 4;
3591
3592 optional bool transition_process_running = 5;
3593
3594 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003595 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003596}
3597
Bookatz8fcd09a2017-12-18 13:01:10 -08003598/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003599 * Logs a picture-in-picture action
3600 * Logged from:
3601 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3602 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3603 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3604 */
3605message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003606 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003607 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003608
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003609 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003610
Chenjie Yu52cacc62017-12-08 18:11:45 -08003611 enum State {
3612 ENTERED = 1;
3613 EXPANDED_TO_FULL_SCREEN = 2;
3614 MINIMIZED = 3;
3615 DISMISSED = 4;
3616 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003617 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003618}
3619
3620/**
Chenjie Yue8904192017-12-08 19:12:57 -08003621 * Logs overlay action
3622 * Logged from:
3623 * services/core/java/com/android/server/wm/Session.java
3624 */
3625message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003626 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003627
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003628 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003629
3630 optional bool using_alert_window = 3;
3631
3632 enum State {
3633 ENTERED = 1;
3634 EXITED = 2;
3635 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003636 optional State state = 4
3637 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003638}
3639
Adam Bookatz38767932020-02-05 12:13:40 -08003640/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003641 * Logs foreground service starts and stops.
3642 * Note that this is not when a service starts or stops, but when it is
3643 * considered foreground.
3644 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003645 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003646 */
3647message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003648 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003649 // package_name + "/" + class_name
3650 optional string short_name = 2;
3651
3652 enum State {
3653 ENTER = 1;
3654 EXIT = 2;
3655 }
3656 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003657
3658 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3659 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3660 optional bool allow_while_in_use_permission = 4;
3661}
3662
3663/**
3664 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3665 * A foreground service session is any continuous period during which the uid holds at least one
3666 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3667 * Accesses initiated while the uid is in the TOP state are ignored.
3668 * Sessions with no attempted accesses are not logged.
3669 * Logged from
3670 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3671 */
3672message ForegroundServiceAppOpSessionEnded {
3673 optional int32 uid = 1 [(is_uid) = true];
3674
3675 // The operation's name.
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00003676 // Only following four ops are logged
3677 // COARSE_LOCATION = 0
3678 // FINE_LOCATION = 1
3679 // CAMERA = 26
3680 // RECORD_AUDIO = 27
3681 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003682
3683 // The uid's permission mode for accessing the AppOp during this fgs session.
3684 enum Mode {
3685 MODE_UNKNOWN = 0;
3686 MODE_ALLOWED = 1; // Always allowed
3687 MODE_IGNORED = 2; // Denied
3688 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3689 }
3690 optional Mode app_op_mode = 3;
3691
3692 // Number of times this AppOp was requested and allowed.
3693 optional int32 count_ops_accepted = 4;
3694 // Number of times this AppOp was requested but denied.
3695 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003696}
3697
Chenjie Yue8904192017-12-08 19:12:57 -08003698/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003699 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3700 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3701 * attributed back to the parent (host) uid. One example is Chrome.
3702 *
3703 * Logged from:
3704 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3705 */
3706message IsolatedUidChanged {
3707 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003708 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003709 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003710 optional int32 parent_uid = 1;
3711
3712 optional int32 isolated_uid = 2;
3713
3714 // We expect an isolated uid to be removed before if it's used for another parent uid.
3715 enum Event {
3716 REMOVED = 0;
3717 CREATED = 1;
3718 }
3719 optional Event event = 3;
3720}
3721
3722/*
3723 * Logs the reception of an incoming network packet causing the main system to wake up for
3724 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3725 * and processed by WakeupController.cpp.
3726 */
3727message PacketWakeupOccurred {
3728 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3729 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003730 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003731 // The interface name on which the packet was received.
3732 optional string iface = 2;
3733 // The ethertype value of the packet.
3734 optional int32 ethertype = 3;
3735 // String representation of the destination MAC address of the packet.
3736 optional string destination_hardware_address = 4;
3737 // String representation of the source address of the packet if this was an IP packet.
3738 optional string source_ip = 5;
3739 // String representation of the destination address of the packet if this was an IP packet.
3740 optional string destination_ip = 6;
3741 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3742 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3743 // families.
3744 optional int32 ip_next_header = 7;
3745 // The source port if this was a TCP or UDP packet.
3746 optional int32 source_port = 8;
3747 // The destination port if this was a TCP or UDP packet.
3748 optional int32 destination_port = 9;
3749}
3750
3751/*
3752 * Logs the memory stats for an app on startup.
3753 * Logged from:
3754 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3755 */
3756message AppStartMemoryStateCaptured {
3757 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003758 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003759
3760 // The process name.
3761 optional string process_name = 2;
3762
3763 // The activity name.
3764 optional string activity_name = 3;
3765
3766 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003767 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003768
3769 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003770 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003771
3772 // RSS
3773 optional int64 rss_in_bytes = 6;
3774
3775 // CACHE
3776 optional int64 cache_in_bytes = 7;
3777
3778 // SWAP
3779 optional int64 swap_in_bytes = 8;
3780}
3781
3782/*
3783 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3784 * for LMK event.
3785 * Logged from:
3786 * system/core/lmkd/lmkd.c
3787 */
3788message LmkStateChanged {
3789 enum State {
3790 UNKNOWN = 0;
3791 START = 1;
3792 STOP = 2;
3793 }
3794 optional State state = 1;
3795}
3796
3797/*
3798 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3799 * Logged from:
3800 * system/core/lmkd/lmkd.c
3801 */
3802message LmkKillOccurred {
3803 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003804 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003805
3806 // The process name.
3807 optional string process_name = 2;
3808
3809 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003810 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003811
3812 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003813 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003814
3815 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003816 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003817
3818 // RSS
3819 optional int64 rss_in_bytes = 6;
3820
3821 // CACHE
3822 optional int64 cache_in_bytes = 7;
3823
3824 // SWAP
3825 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003826
3827 // The elapsed real time of start of the process.
3828 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003829
3830 // Min oom adj score considered by lmkd.
3831 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003832}
3833
Rajeev Kumar51b54602018-03-01 12:18:26 -08003834/*
3835 * Logs when the ActivityManagerService detects that an app died.
3836 *
3837 * Logged from:
3838 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3839 */
3840message AppDied {
3841 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003842 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003843}
3844
Howard Ro21a039c2018-08-06 14:55:47 -07003845/**
3846 * An atom for generic metrics logging. Available from Android Q.
3847 */
3848message GenericAtom {
3849 // The uid of the application that sent this custom atom.
3850 optional int32 uid = 1 [(is_uid) = true];
3851
3852 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003853 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003854}
3855
Tej Singhd6d6d772018-09-05 17:41:25 -07003856/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003857 * Atom for simple logging of user interaction and impression events, such as "the user touched
3858 * this button" or "this dialog was displayed".
3859 * Keep the UI event stream clean: don't use for system or background events.
3860 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003861 *
3862 * Logged from:
3863 * frameworks/base/services/core/java/com/android/server/
3864 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003865 */
3866message UiEventReported {
3867 // The event_id.
3868 optional int32 event_id = 1;
3869 // The event's source or target uid and package, if applicable.
3870 // For example, the package posting a notification, or the destination package of a share.
3871 optional int32 uid = 2 [(is_uid) = true];
3872 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003873 // An identifier used to disambiguate which logs refer to a particular instance of some
3874 // UI element. Useful when there might be multiple instances simultaneously active.
3875 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003876}
3877
3878/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003879 * Reports a notification was created or updated.
3880 *
3881 * Logged from:
3882 * frameworks/base/services/core/java/com/android/server/notification/
3883 */
3884message NotificationReported {
3885 // The event_id (as for UiEventReported).
3886 optional int32 event_id = 1;
3887 // The notifying app's uid and package.
3888 optional int32 uid = 2 [(is_uid) = true];
3889 optional string package_name = 3;
3890 // A small system-assigned identifier for the notification.
3891 // Locally probably-unique, but expect collisions across users and/or days.
3892 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003893 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3894 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003895
3896 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003897 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3898 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3899 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003900
3901 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003902 optional string category = 10; // App-assigned notification category (API-defined strings)
3903 optional int32 style = 11; // App-assigned notification style
3904 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003905
3906 // Ordering, importance and interruptiveness
3907
Will Brockman7614f6962020-02-10 19:43:03 -05003908 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003909
Will Brockman7614f6962020-02-10 19:43:03 -05003910 optional android.stats.sysui.NotificationImportance importance = 14;
3911 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003912
3913 enum NotificationImportanceExplanation {
3914 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3915 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3916 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3917 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3918 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3919 // Like _APP, but based on pre-channels priority signal.
3920 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3921 }
3922
Will Brockman7614f6962020-02-10 19:43:03 -05003923 optional NotificationImportanceExplanation importance_source = 16;
3924 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3925 optional NotificationImportanceExplanation importance_initial_source = 18;
3926 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3927 optional int32 assistant_hash = 20;
3928 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003929}
3930
3931message Notification {
3932 // The notifying app's uid and package.
3933 optional int32 uid = 1 [(is_uid) = true];
3934 optional string package_name = 2;
3935 // A small system-assigned identifier for the notification.
3936 optional int32 instance_id = 3;
3937
3938 // Grouping information.
3939 optional int32 group_instance_id = 4;
3940 optional bool is_group_summary = 5;
3941
3942 // The section of the shade that the notification is in.
3943 // See NotificationSectionsManager.PriorityBucket.
3944 enum NotificationSection {
3945 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003946 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003947 SECTION_MEDIA_CONTROLS = 2;
3948 SECTION_PEOPLE = 3;
3949 SECTION_ALERTING = 4;
3950 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003951 }
3952 optional NotificationSection section = 6;
3953}
3954
3955message NotificationList {
3956 repeated Notification notifications = 1; // An ordered sequence of notifications.
3957}
3958
3959/**
3960 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3961 *
3962 * Logged from:
3963 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3964 */
3965message NotificationPanelReported {
3966 // The event_id (as for UiEventReported).
3967 optional int32 event_id = 1;
3968 optional int32 num_notifications = 2;
3969 // The notifications in the panel, in the order that they appear there.
3970 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3971}
3972
3973/**
3974 * Reports a notification channel, or channel group, was created, updated, or deleted.
3975 *
3976 * Logged from:
3977 * frameworks/base/services/core/java/com/android/server/notification/
3978 */
3979message NotificationChannelModified {
3980 // The event_id (as for UiEventReported).
3981 optional int32 event_id = 1;
3982 // The notifying app's uid and package.
3983 optional int32 uid = 2 [(is_uid) = true];
3984 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003985 // Hash of app-assigned notification channel ID or channel-group ID
3986 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003987 // Previous importance setting, if applicable
3988 optional android.stats.sysui.NotificationImportance old_importance = 5;
3989 // New importance setting
3990 optional android.stats.sysui.NotificationImportance importance = 6;
3991}
3992
3993
3994/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003995 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003996 *
3997 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003998 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003999 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004000message BiometricAcquired {
4001 // Biometric modality that was acquired.
4002 optional android.hardware.biometrics.ModalityEnum modality = 1;
4003 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4004 optional int32 user = 2;
4005 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4006 optional bool is_crypto = 3;
4007 // Action that the device is performing. Acquired messages are only expected for enroll and
4008 // authenticate. Other actions may indicate an error.
4009 optional android.hardware.biometrics.ActionEnum action = 4;
4010 // The client that this acquisition was received for.
4011 optional android.hardware.biometrics.ClientEnum client = 5;
4012 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4013 optional int32 acquire_info = 6;
4014 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4015 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004016 // Dictates if this message should trigger additional debugging.
4017 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004018}
4019
4020/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004021 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004022 *
4023 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004024 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004025 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004026message BiometricAuthenticated {
4027 // Biometric modality that was used.
4028 optional android.hardware.biometrics.ModalityEnum modality = 1;
4029 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4030 optional int32 user = 2;
4031 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4032 // storage.
4033 optional bool is_crypto = 3;
4034 // The client that this acquisition was received for.
4035 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004036 // If authentication requires user confirmation. See BiometricPrompt's
4037 // setRequireConfirmation(bool) method.
4038 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004039
Kevin Chyn1741a072019-01-17 11:54:40 -08004040 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004041 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004042 REJECTED = 1;
4043 PENDING_CONFIRMATION = 2;
4044 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004045 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004046
4047 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004048 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004049 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4050 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4051 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4052 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004053 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004054 // Dictates if this message should trigger additional debugging.
4055 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004056}
4057
4058/**
4059 * Logs when a biometric error occurs.
4060 *
4061 * Logged from:
4062 * frameworks/base/services/core/java/com/android/server/biometrics
4063 */
4064message BiometricErrorOccurred {
4065 // Biometric modality that was used.
4066 optional android.hardware.biometrics.ModalityEnum modality = 1;
4067 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4068 optional int32 user = 2;
4069 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4070 optional bool is_crypto = 3;
4071 // Action that the device is performing.
4072 optional android.hardware.biometrics.ActionEnum action = 4;
4073 // The client that this acquisition was received for.
4074 optional android.hardware.biometrics.ClientEnum client = 5;
4075 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4076 // are unique to modality.
4077 optional int32 error_info = 6;
4078 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4079 // by the vendor and not specified by the HIDL interface.
4080 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004081 // Dictates if this message should trigger additional debugging.
4082 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004083 // Time spent during the authentication attempt.
4084 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004085}
4086
4087/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004088 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004089 * Logged from:
4090 * frameworks/base/services/core/java/com/android/server/biometrics
4091 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004092message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004093 // Biometric modality.
4094 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004095 // Type of issue detected.
4096 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004097 // Dictates if this message should trigger additional debugging.
4098 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004099}
Howard Ro688ae182018-09-25 00:09:36 -07004100
joshmccloskey6f952b22019-03-25 20:59:35 -07004101/**
4102 * Logs when a biometric enrollment occurs.
4103 *
4104 * Logged from:
4105 * frameworks/base/services/core/java/com/android/server/biometrics
4106 */
4107message BiometricEnrolled {
4108 // Biometric modality that was used.
4109 optional android.hardware.biometrics.ModalityEnum modality = 1;
4110 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4111 optional int32 user = 2;
4112 // The amount of time the enrollment took in milliseconds.
4113 optional int64 latency_millis = 3;
4114 // Whether or not the enrollment was successful.
4115 optional bool success = 4;
4116}
4117
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004118/*
Tej Singh0d176952019-01-16 19:10:54 -08004119 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004120 */
Tej Singh0d176952019-01-16 19:10:54 -08004121message FlagFlipUpdateOccurred {
4122 // If the event is from a flag config package, specify the package name.
4123 optional string flag_flip_package_name = 1;
4124
4125 // The order id of the package
4126 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004127}
4128
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004129/**
4130 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004131 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004132 */
4133message TrainExperimentIds {
4134 repeated int64 experiment_id = 1;
4135}
4136
Yangster-macb89807e2018-11-15 21:10:57 -08004137/*
4138 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004139 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004140 */
4141message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004142 // Name of the train.
4143 optional string train_name = 1;
4144 // Version code for a "train" of packages that need to be installed atomically
4145 optional int64 train_version_code = 2;
4146 // After installation of this package, device requires a restart.
4147 optional bool requires_staging = 3;
4148 // Rollback should be enabled for this install.
4149 optional bool rollback_enabled = 4;
4150 // Requires low latency monitoring if possible.
4151 optional bool requires_low_latency_monitor = 5;
4152
Yangster-macb89807e2018-11-15 21:10:57 -08004153 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004154 UNKNOWN = 0;
4155 INSTALL_REQUESTED = 1;
4156 INSTALL_STARTED = 2;
4157 INSTALL_STAGED_NOT_READY = 3;
4158 INSTALL_STAGED_READY = 4;
4159 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004160 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4161 // and INSTALL_FAILURE_COMMIT.
4162 INSTALL_FAILURE = 6 [deprecated = true];
4163 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004164 INSTALL_CANCELLED = 7;
4165 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004166 INSTALLER_ROLLBACK_INITIATED = 9;
4167 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4168 INSTALLER_ROLLBACK_STAGED = 11;
4169 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4170 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4171 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4172 INSTALLER_ROLLBACK_SUCCESS = 15;
4173 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004174 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4175 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4176 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4177 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4178 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4179 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004180 INSTALL_FAILURE_DOWNLOAD = 23;
4181 INSTALL_FAILURE_STATE_MISMATCH = 24;
4182 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004183 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004184 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004185 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004186 // Possible experiment ids for monitoring this push.
4187 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4188 // user id
4189 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004190 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004191 // Whether or not this is a rollback event
4192 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004193}
4194
Tej Singhc9203082019-05-03 13:42:23 -07004195/* Test atom, is not logged anywhere */
4196message TestAtomReported {
4197 repeated AttributionNode attribution_node = 1;
4198 optional int32 int_field = 2;
4199 optional int64 long_field = 3;
4200 optional float float_field = 4;
4201 optional string string_field = 5;
4202 optional bool boolean_field = 6;
4203 enum State {
4204 UNKNOWN = 0;
4205 OFF = 1;
4206 ON = 2;
4207 }
4208 optional State state = 7;
4209 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4210}
4211
Maggie Whitefc1aa592018-11-28 21:55:23 -08004212/** Represents USB port overheat event. */
4213message UsbPortOverheatEvent {
4214 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4215 optional int32 plug_temperature_deci_c = 1;
4216
4217 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4218 optional int32 max_temperature_deci_c = 2;
4219
4220 /* Time between USB plug event and overheat threshold trip, in seconds. */
4221 optional int32 time_to_overheat_secs = 3;
4222
4223 /* Time between overheat threshold trip and hysteresis, in seconds. */
4224 optional int32 time_to_hysteresis_secs = 4;
4225
4226 /* Time between hysteresis and active mitigation ending, in seconds. */
4227 optional int32 time_to_inactive_secs = 5;
4228};
4229
Maggie White8735b852019-01-18 11:40:49 -08004230/**
4231 * Logs total effective full charge and discharge cycles on a battery.
4232 * Here are some examples of one effective cycle:
4233 * 1) the battery charges from 0% to 100% and drains back to 0%,
4234 * 2) charging from 50% to 100% and draining back to 50% twice.
4235 * Pulled from:
4236 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4237 */
4238message BatteryCycleCount {
4239 /* Number of total charge and discharge cycles on the system battery. */
4240 optional int32 cycle_count = 1;
4241}
4242
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004243/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004244 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4245 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004246 * Pulled from:
4247 * StatsCompanionService
4248 */
4249
Carmen Agimof12dec122019-03-06 16:14:38 +00004250message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004251
Carmen Agimof12dec122019-03-06 16:14:38 +00004252 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004253 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004254 PUBLIC = 1;
4255 PRIVATE = 2;
4256 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004257 }
4258
Carmen Agimof12dec122019-03-06 16:14:38 +00004259 // The type of external storage.
4260 optional android.stats.storage.ExternalStorageType storage_type = 1;
4261 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4262 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004263 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004264 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004265}
4266
Yangster-macb89807e2018-11-15 21:10:57 -08004267/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004268 * Logs when a connection becomes available and lost.
4269 * Logged in StatsCompanionService.java
4270 */
4271message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004272 // Id of the network.
4273 optional int32 net_id = 1;
4274
4275 enum State {
4276 UNKNOWN = 0;
4277 CONNECTED = 1;
4278 DISCONNECTED = 2;
4279 }
4280 // Connected state of a network.
4281 optional State state = 2;
4282}
4283
4284/**
4285 * Logs when a service starts and stops.
4286 * Logged from:
4287 * services/core/java/com/android/server/am/ActiveServices.java
4288 */
4289message ServiceStateChanged {
4290
4291 optional int32 uid = 1 [(is_uid) = true];
4292
4293 optional string package_name = 2;
4294
4295 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004296
4297 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004298 START = 1;
4299 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004300 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004301
4302 optional State state = 4;
4303}
4304
4305/**
4306 * Logs when a service is launched.
4307 * Logged from:
4308 * services/core/java/com/android/server/am/ActiveServices.java
4309 */
4310message ServiceLaunchReported {
4311
4312 optional int32 uid = 1 [(is_uid) = true];
4313
4314 optional string package_name = 2;
4315
4316 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004317}
Howard Ro688ae182018-09-25 00:09:36 -07004318
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004319/**
4320 * Logs when a hidden API is used.
4321 *
4322 * Logged from:
4323 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4324 */
4325message HiddenApiUsed {
4326 // The uid of the app making the hidden access.
4327 optional int32 uid = 1 [(is_uid) = true];
4328
4329 // Signature of the method or field accessed.
4330 optional string signature = 2;
4331
4332 enum AccessMethod {
4333 NONE = 0;
4334 REFLECTION = 1;
4335 JNI = 2;
4336 LINKING = 3;
4337 }
4338
4339 // Type of access.
4340 optional AccessMethod access_method = 3;
4341
4342 // Whether the access was prevented or not.
4343 optional bool access_denied = 4;
4344}
4345
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004346/**
4347 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4348 * - When user sees privacy chip
4349 * - When user clicks privacy chip
4350 * - How does the user exit the Privacy Dialog
4351 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004352 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4353 */
4354message PrivacyIndicatorsInteracted {
4355
4356 enum Type {
4357 UNKNOWN = 0;
4358 CHIP_VIEWED = 1;
4359 CHIP_CLICKED = 2;
4360 DIALOG_PRIVACY_SETTINGS = 3;
4361 DIALOG_DISMISS = 4;
4362 DIALOG_LINE_ITEM = 5;
4363 }
4364
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004365 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004366
4367 // Used if the type is LINE_ITEM
4368 optional string package_name = 2;
4369}
4370
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004371/**
4372 * Logs information about a package that is moved from the internal to external storage and vice
4373 * versa.
4374 * It logs the package name, the type of the external storage where the package is installed
4375 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4376 * and the move type: if it's from internal to external or the other way around.
4377 *
4378 * Logged from:
4379 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4380 */
4381message AppMovedStorageReported {
4382 enum MoveType {
4383 UNKNOWN = 0;
4384 TO_EXTERNAL = 1;
4385 TO_INTERNAL = 2;
4386 }
4387 // The type of the external storage.
4388 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4389 // The type of move.
4390 optional MoveType move_type = 2;
4391 // The name of the package that was moved.
4392 optional string package_name = 3;
4393}
4394
jianjin8f2dee02019-03-29 14:03:08 -07004395/**
4396 * Logs when system server watchdog occurs.
4397 * Logged from:
4398 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4399 */
4400message SystemServerWatchdogOccurred {
4401 optional string subject = 1;
4402}
4403
4404/**
4405 * Logs when new file added to tombstones.
4406 * Logged from:
4407 * frameworks/base/core/java/com/android/server/BootReceiver.java
4408 */
4409message TombStoneOccurred {
4410}
4411
Hai Zhang5d3328d2019-04-13 21:25:06 +08004412/*
4413 * Information about a role request
4414 *
4415 * Logged from:
4416 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4417 */
4418message RoleRequestResultReported {
4419 // UID of application requesting the role
4420 optional int32 requesting_uid = 1;
4421
4422 // Package name of application requesting the role
4423 optional string requesting_package_name = 2;
4424
4425 // The role to be granted
4426 optional string role_name = 3;
4427
4428 // The count of applications qualifying for the role
4429 optional int32 qualifying_count = 4;
4430
4431 // UID of application current granted the role
4432 optional int32 current_uid = 5;
4433
4434 // Package name of application current granted the role
4435 optional string current_package_name = 6;
4436
4437 // UID of another application that user chose to grant the role to, instead of the requesting
4438 // application
4439 optional int32 granted_another_uid = 7;
4440
4441 // Package name of another application that user chose to grant the role to, instead of the
4442 // requesting application
4443 optional string granted_another_package_name = 8;
4444
4445 enum Result {
4446 UNDEFINED = 0;
4447 // role request was ignored
4448 IGNORED = 1;
4449 // role request was ignored because it's already granted
4450 IGNORED_ALREADY_GRANTED = 2;
4451 // role request was ignored because the application isn't qualified
4452 IGNORED_NOT_QUALIFIED = 3;
4453 // role request was ignored because user said it should be always denied
4454 IGNORED_USER_ALWAYS_DENIED = 4;
4455 // role was granted by user action
4456 USER_GRANTED = 5;
4457 // role was denied by user action
4458 USER_DENIED = 6;
4459 // role was denied by user granting another application the role
4460 USER_DENIED_GRANTED_ANOTHER = 7;
4461 // role was denied and set to be always denied by the user
4462 USER_DENIED_WITH_ALWAYS = 8;
4463 }
4464 // The result of the role request
4465 optional Result result = 9;
4466}
4467
Mark Tabrya824a642019-11-05 12:26:12 -08004468/**
4469 * Logs when a Vehicle Maps Service client's connection state has changed
4470 *
4471 * Logged from:
4472 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4473 */
4474message VmsClientConnectionStateChanged {
4475 // The UID of the VMS client app
4476 optional int32 uid = 1 [(is_uid) = true];
4477
4478 enum State {
4479 UNKNOWN = 0;
4480 // Attempting to connect to the client
4481 CONNECTING = 1;
4482 // Client connection established
4483 CONNECTED = 2;
4484 // Client connection closed unexpectedly
4485 DISCONNECTED = 3;
4486 // Client connection closed by VMS
4487 TERMINATED = 4;
4488 // Error establishing the client connection
4489 CONNECTION_ERROR = 5;
4490 }
4491
4492 optional State state = 2;
4493}
4494
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004495/**
4496 * Logs when MediaProvider has successfully finished scanning a storage volume.
4497 *
4498 * Logged from:
4499 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4500 */
shafik43825842020-04-02 17:30:24 +01004501message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004502 enum Reason {
4503 // Scan triggered due to unknown reason
4504 UNKNOWN = 0;
4505 // Scan triggered due to storage volume being mounted
4506 MOUNTED = 1;
4507 // Scan triggered due to explicit user action or app request
4508 DEMAND = 2;
4509 // Scan triggered due to idle maintenance
4510 IDLE = 3;
4511 }
4512
4513 // Volume type that this event pertains to
4514 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4515 // Reason why this scan was triggered
4516 optional Reason reason = 2;
4517 // Total number of files scanned
4518 optional int64 item_count = 3;
4519 // Duration of scan, normalized per file
4520 optional float normalized_duration_millis = 4;
4521 // Number of database inserts, normalized per file
4522 optional float normalized_insert_count = 5;
4523 // Number of database updates, normalized per file
4524 optional float normalized_update_count = 6;
4525 // Number of database deletes, normalized per file
4526 optional float normalized_delete_count = 7;
4527}
4528
4529/**
4530 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4531 *
4532 * Logged from:
4533 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4534 */
shafik43825842020-04-02 17:30:24 +01004535message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004536 // Volume type that this event pertains to
4537 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004538 // UID of app that requested deletion
4539 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004540 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004541 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004542}
4543
4544/**
4545 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4546 *
4547 * Logged from:
4548 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4549 */
shafik43825842020-04-02 17:30:24 +01004550message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004551 enum Result {
4552 UNKNOWN = 0;
4553 USER_GRANTED = 1;
4554 AUTO_GRANTED = 2;
4555 USER_DENIED = 3;
4556 USER_DENIED_WITH_PREJUDICE = 4;
4557 AUTO_DENIED = 5;
4558 }
4559
4560 // Volume type that this event pertains to
4561 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004562 // UID of app that requested permission
4563 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004564 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004565 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004566 // Result of this request
shafik43825842020-04-02 17:30:24 +01004567 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004568}
4569
4570/**
4571 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4572 *
4573 * Logged from:
4574 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4575 */
shafik43825842020-04-02 17:30:24 +01004576message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004577 // Volume type that this event pertains to
4578 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4579 // Old database version code
4580 optional int32 version_from = 2;
4581 // New database version code
4582 optional int32 version_to = 3;
4583 // Total number of files in database
4584 optional int64 item_count = 4;
4585 // Duration of schema change, normalized per file
4586 optional float normalized_duration_millis = 5;
4587}
4588
4589/**
4590 * Logs when MediaProvider has finished an idle maintenance job.
4591 *
4592 * Logged from:
4593 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4594 */
shafik43825842020-04-02 17:30:24 +01004595message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004596 // Volume type that this event pertains to
4597 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4598
4599 // Total number of files in database
4600 optional int64 item_count = 2;
4601 // Duration of idle maintenance, normalized per file
4602 optional float normalized_duration_millis = 3;
4603 // Number of thumbnails found to be stale, normalized per file
4604 optional float normalized_stale_thumbnails = 4;
4605 // Number of items found to be expired, normalized per file
4606 optional float normalized_expired_media = 5;
4607}
4608
Keun young Park3e033cb2019-12-18 11:27:35 -08004609/**
4610 * Represents boot time event with duration in ms.
4611 *
4612 * Logged from: bootstat and various system server components. Check each enums for details.
4613 */
4614message BootTimeEventDuration {
4615 enum DurationEvent {
4616 UNKNOWN = 0;
4617 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4618 ABSOLUTE_BOOT_TIME = 1;
4619 // Bootloader's 1st stage execution time.
4620 // Logged from bootstat.
4621 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4622 // Bootloader's 1st stage loading time.
4623 // Logged from bootstat.
4624 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4625 // Bootloader's kernel loading time.
4626 // Logged from bootstat.
4627 BOOTLOADER_KERNEL_LOAD = 4;
4628 // Bootloader's 2nd stage execution time.
4629 // Logged from bootstat.
4630 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4631 // Bootloader's 2nd stage loading time.
4632 // Logged from bootstat.
4633 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4634 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4635 // for locked device.
4636 // Logged from bootstat.
4637 BOOTLOADER_UI_WAIT = 7;
4638 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4639 // Logged from bootstat.
4640 BOOTLOADER_TOTAL = 8;
4641 // Shutdown duration inside init for the reboot before the current boot up.
4642 // Logged from f/b/services/.../BootReceiver.java.
4643 SHUTDOWN_DURATION = 9;
4644 // Total time for mounting of disk devices during bootup.
4645 // Logged from f/b/services/.../BootReceiver.java.
4646 MOUNT_DEFAULT_DURATION = 10;
4647 // Total time for early stage mounting of disk devices during bootup.
4648 // Logged from f/b/services/.../BootReceiver.java.
4649 MOUNT_EARLY_DURATION = 11;
4650 // Total time for late stage mounting of disk devices during bootup.
4651 // Logged from f/b/services/.../BootReceiver.java.
4652 MOUNT_LATE_DURATION = 12;
4653 // Average time to scan non-system app after OTA
4654 // Logged from f/b/services/.../PackageManagerService.java
4655 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4656 // Time to initialize Package manager after OTA
4657 // Logged from f/b/services/.../PackageManagerService.java
4658 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4659 // Time to scan all system app from Package manager after OTA
4660 // Logged from f/b/services/.../PackageManagerService.java
4661 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4662 // Init's total time for cold boot stage.
4663 // Logged from bootstat.
4664 COLDBOOT_WAIT = 16;
4665 // Init's total time for initializing selinux.
4666 // Logged from bootstat.
4667 SELINUX_INIT = 17;
4668 // Time since last factory reset.
4669 // Logged from bootstat.
4670 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004671 // Init's total time spent for completing the 1st stage.
4672 // Logged from bootstat.
4673 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004674 }
4675
4676 // Type of the event.
4677 optional DurationEvent event = 1;
4678 // Duration of the event in ms.
4679 optional int64 duration_millis = 2;
4680}
4681
4682/**
4683 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4684 * since boot-up.
4685 *
4686 * Logged from: bootstat and various system server components. Check each enums for details.
4687 */
4688message BootTimeEventElapsedTime {
4689 enum ElapsedTimeEvent {
4690 UNKNOWN = 0;
4691 // Time when init starts 1st stage. Logged from bootstat.
4692 ANDROID_INIT_STAGE_1 = 1;
4693 // Time when sys.boot_completed prop is set.
4694 // Logged from bootstat.
4695 BOOT_COMPLETE = 2;
4696 // BOOT_COMPLETE for encrypted device.
4697 BOOT_COMPLETE_ENCRYPTION = 3;
4698 // BOOT_COMPLETE for device with no encryption.
4699 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4700 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004701 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004702 // BOOT_COMPLETE after factory reset.
4703 FACTORY_RESET_BOOT_COMPLETE = 6;
4704 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4705 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004706 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4707 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004708 // BOOT_COMPLETE after OTA.
4709 OTA_BOOT_COMPLETE = 9;
4710 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4711 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004712 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4713 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004714 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4715 // Logged from f/b/services/.../UserController.java
4716 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4717 // Time when the system starts sending BOOT_COMPLETED broadcast.
4718 // Logged from f/b/services/.../UserController.java
4719 FRAMEWORK_BOOT_COMPLETED = 13;
4720 // Time when the package manager starts init.
4721 // Logged from f/b/services/.../SystemServer.java
4722 PACKAGE_MANAGER_INIT_START = 14;
4723 // Time when package manager is ready
4724 // Logged from f/b/services/.../SystemServer.java
4725 PACKAGE_MANAGER_INIT_READY = 15;
4726 // Represents the time when user has entered unlock credential for system with user pin.
4727 // Logged from bootstat.
4728 POST_DECRYPT = 16;
4729 // Represents the start of zygote's init.
4730 // Logged from zygote itself.
4731 ZYGOTE_INIT_START = 17;
4732 // Represents the start of secondary zygote's init.
4733 // TODO: add logging to zygote
4734 SECONDARY_ZYGOTE_INIT_START = 18;
4735 // Represents the start of system server's init.
4736 // Logged from f/b/services/.../SystemServer.java
4737 SYSTEM_SERVER_INIT_START = 19;
4738 // Represents the completion of system server's init.
4739 // Logged from f/b/services/.../SystemServer.java
4740 SYSTEM_SERVER_READY = 20;
4741 // Represents the start of launcher during boot-up.
4742 // TODO: add logging
4743 LAUNCHER_START = 21;
4744 // Represents the completion of launcher's initial rendering. User can use other apps from
4745 // launcher from this point.
4746 // TODO: add logging
4747 LAUNCHER_SHOWN = 22;
4748 }
4749
4750 // Type of the event.
4751 optional ElapsedTimeEvent event = 1;
4752 // Time since bootup for the event.
4753 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4754 optional int64 time_millis = 2;
4755}
4756
4757/**
4758 * Boot time events with UTC time.
4759 *
4760 * Logged from: bootstat and various system server components. Check each enums for details.
4761 */
4762message BootTimeEventUtcTime {
4763 enum UtcTimeEvent {
4764 UNKNOWN = 0;
4765 // Time of the bootstat's marking of 1st boot after the last factory reset.
4766 // Logged from bootstat.
4767 FACTORY_RESET_RESET_TIME = 1;
4768 // The time when bootstat records FACTORY_RESET_* events. This is close to
4769 // BOOT_COMPLETE time for the current bootup.
4770 // Logged from bootstat.
4771 FACTORY_RESET_CURRENT_TIME = 2;
4772 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4773 // Logged from bootstat.
4774 FACTORY_RESET_RECORD_VALUE = 3;
4775 }
4776
4777 // Type of the event.
4778 optional UtcTimeEvent event = 1;
4779 // UTC time for the event.
4780 optional int64 utc_time_secs = 2;
4781}
4782
4783/**
4784 * Boot time events representing specific error code during bootup.
4785 * Meaning of error code can be different per each event type.
4786 *
4787 * Logged from: bootstat and various system server components. Check each enums for details.
4788 */
4789message BootTimeEventErrorCode {
4790 enum ErrorCodeEvent {
4791 UNKNOWN = 0;
4792 // Linux error code for time() call to get the current UTC time.
4793 // Logged from bootstat.
4794 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4795 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4796 // as UMOUNT_STAT_* from init/reboot.cpp.
4797 // Logged from f/b/services/.../BootReceiver.java.
4798 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004799 // Reprepsents fie system mounting error code of /data partition for the current boot.
4800 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004801 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004802 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004803 }
4804
4805 // Type of the event.
4806 optional ErrorCodeEvent event = 1;
4807 // error code defined per each event type.
4808 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4809 // FS_MGR_FS_STAT.
4810 optional int32 error_code = 2;
4811}
4812
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004813/**
4814 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4815 * after an OTA.
4816 *
4817 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004818 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004819 */
4820message SnapshotMergeReported {
4821 // Keep in sync with
4822 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4823 enum UpdateState {
4824 // No update or merge is in progress.
4825 NONE = 0;
4826 // An update is applying; snapshots may already exist.
4827 INITIATED = 1;
4828 // An update is pending, but has not been successfully booted yet.
4829 UNVERIFIED = 2;
4830 // The kernel is merging in the background.
4831 MERGING = 3;
4832 // Post-merge cleanup steps could not be completed due to a transient
4833 // error, but the next reboot will finish any pending operations.
4834 MERGE_NEEDS_REBOOT = 4;
4835 // Merging is complete, and needs to be acknowledged.
4836 MERGE_COMPLETED = 5;
4837 // Merging failed due to an unrecoverable error.
4838 MERGE_FAILED = 6;
4839 // The update was implicitly cancelled, either by a rollback or a flash
4840 // operation via fastboot. This state can only be returned by WaitForMerge.
4841 CANCELLED = 7;
4842 };
4843
4844 // Status of the update after the merge attempts.
4845 optional UpdateState final_state = 1;
4846
4847 // Time to complete a merge operation in milliseconds.
4848 // A negative value corresponds to the case in which the merge operation
4849 // was interrupted and resumed (e.g. in case of a system reboot during the
4850 // merge).
4851 optional int64 duration_millis = 2;
4852
4853 // Number of reboots that occurred after issuing and before completing the
4854 // merge of all the snapshot devices.
4855 optional int32 intermediate_reboots = 3;
4856}
4857
Chenjie Yubbcbc602018-02-05 16:51:52 -08004858//////////////////////////////////////////////////////////////////////
4859// Pulled atoms below this line //
4860//////////////////////////////////////////////////////////////////////
4861
4862/**
David Chenc8a43242017-10-17 16:23:28 -07004863 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4864 *
4865 * Pulled from:
4866 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4867 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004868message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004869 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004870
4871 optional int64 rx_bytes = 2;
4872
4873 optional int64 rx_packets = 3;
4874
4875 optional int64 tx_bytes = 4;
4876
4877 optional int64 tx_packets = 5;
4878}
4879
4880/**
4881 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4882 *
4883 * Pulled from:
4884 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4885 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004886message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004887 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004888
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004889 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4890 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004891
4892 optional int64 rx_bytes = 3;
4893
4894 optional int64 rx_packets = 4;
4895
4896 optional int64 tx_bytes = 5;
4897
4898 optional int64 tx_packets = 6;
4899}
4900
4901/**
4902 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4903 *
4904 * Pulled from:
4905 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4906 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004907message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004908 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004909
4910 optional int64 rx_bytes = 2;
4911
4912 optional int64 rx_packets = 3;
4913
4914 optional int64 tx_bytes = 4;
4915
4916 optional int64 tx_packets = 5;
4917}
4918
4919/**
4920 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4921 *
4922 * Pulled from:
4923 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4924 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004925message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004926 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004927
Yao Chenc40a19d2018-03-15 16:48:25 -07004928 // 1 denotes foreground and 0 denotes background. This is called Set in
4929 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004930 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004931
4932 optional int64 rx_bytes = 3;
4933
4934 optional int64 rx_packets = 4;
4935
4936 optional int64 tx_bytes = 5;
4937
4938 optional int64 tx_packets = 6;
4939}
4940
4941/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004942 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4943 *
4944 * Pulled from:
4945 * StatsCompanionService
4946 */
4947message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004948 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004949
4950 optional int64 rx_bytes = 2;
4951
4952 optional int64 tx_bytes = 3;
4953}
4954
4955/**
David Chenc8a43242017-10-17 16:23:28 -07004956 * Pulls the kernel wakelock durations. This atom is adapted from
4957 * android/internal/os/KernelWakelockStats.java
4958 *
4959 * Pulled from:
4960 * StatsCompanionService using KernelWakelockReader.
4961 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004962message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004963 optional string name = 1;
4964
4965 optional int32 count = 2;
4966
4967 optional int32 version = 3;
4968
Yangster-maca8a30442018-10-13 23:46:34 -07004969 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004970}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004971
Chenjie Yu05013b32017-11-21 10:21:41 -08004972/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004973 * Pulls low power state information. If power.stats HAL is not available, this
4974 * includes platform and subsystem sleep state information,
4975 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4976 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004977 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004978 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004979 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4980 * as defined in:
4981 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004982 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004983message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004984 // Subsystem name
4985 optional string subsystem_name = 1;
4986 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4987 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004988 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4989 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004990 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004991 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004992 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004993 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004994 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004995}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004996
Chenjie Yu05013b32017-11-21 10:21:41 -08004997/**
Bookatz92da2832018-11-01 18:10:03 -07004998 * Pulls on-device power measurement information.
4999 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5000 * Pulled from:
5001 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5002 */
5003message OnDevicePowerMeasurement {
5004 // Name of the subsystem (to which the rail belongs).
5005 optional string subsystem_name = 1;
5006
5007 // Rail name. The rail lies within the subsystem.
5008 optional string rail_name = 2;
5009
5010 // Time (in ms since boot) at which the rail energy value was measured.
5011 // This may differ slightly from the time that statsd logs this information.
5012 optional uint64 measurement_timestamp_millis = 3;
5013
5014 // Accumulated energy used via the rail since device boot in uWs.
5015 optional uint64 energy_microwatt_secs = 4;
5016}
5017
5018/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005019 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005020 * Pulls the time the cpu spend on the frequency index. Frequency index
5021 * starts from highest to lowest. The value should be monotonically
5022 * increasing since boot. However, if there is a cpu
5023 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005024 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005025message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005026 optional uint32 cluster = 1;
5027 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005028 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005029}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005030
Chenjie Yu05013b32017-11-21 10:21:41 -08005031/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005032 * Pulls Cpu Time Per Uid.
5033 * Note that isolated process uid time should be attributed to host uids.
5034 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005035message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005036 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005037 optional uint64 user_time_micros = 2;
5038 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005039}
5040
5041/**
5042 * Pulls Cpu Time Per Uid per frequency.
5043 * Note that isolated process uid time should be attributed to host uids.
5044 * For each uid, we order the time by descending frequencies.
5045 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005046message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005047 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005048 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005049 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005050}
Hugo Benichi884970e2017-11-14 22:42:46 +09005051
Chenjie Yu05013b32017-11-21 10:21:41 -08005052/**
5053 * Pulls Wifi Controller Activity Energy Info
5054 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005055message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005056 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005057 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005058 // stack reported state
5059 // TODO: replace this with proto enum
5060 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005061 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005062 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005063 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005064 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005065 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005066 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005067 // product of current(mA), voltage(V) and time(ms)
5068 optional uint64 controller_energy_used = 6;
5069}
5070
5071/**
5072 * Pulls Modem Activity Energy Info
5073 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005074message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005075 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005076 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005077 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005078 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005079 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005080 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005081 /**
5082 * Tx power index
5083 * index 0 = tx_power < 0dBm
5084 * index 1 = 0dBm < tx_power < 5dBm
5085 * index 2 = 5dBm < tx_power < 15dBm
5086 * index 3 = 15dBm < tx_power < 20dBm
5087 * index 4 = tx_power > 20dBm
5088 */
5089 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005091 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005092 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005093 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005094 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005095 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005096 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005097 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005098 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005099 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005100 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005101 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005102 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005103}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005104
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005105/**
5106 * Pulls Bluetooth Activity Energy Info
5107 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5108 */
5109message BluetoothActivityInfo {
5110 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005111 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005112 // bluetooth stack state
5113 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005114 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005115 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005116 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005117 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005118 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005119 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005120 // product of current(mA), voltage(V) and time(ms)
5121 optional uint64 energy_used = 6;
5122}
5123
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005124/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005125 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005126 *
5127 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005128 */
5129message ProcessMemoryState {
5130 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005131 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005132
5133 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005134 // Usually package name, "system" for system server.
5135 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005136 optional string process_name = 2;
5137
Rafal Slawikda51b932018-12-13 16:31:33 +00005138 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005139 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005140
5141 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005142 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005143
5144 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005145 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005146
Rajeev Kumar90235992018-01-29 11:06:48 -08005147 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005148 // Value is read from memory.stat, field total_rss if per-app memory
5149 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005150 optional int64 rss_in_bytes = 6;
5151
5152 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005153 // Value is read from memory.stat, field total_cache if per-app memory
5154 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005155 optional int64 cache_in_bytes = 7;
5156
5157 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005158 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005159 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005160 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005161
Rafal Slawik203c3db2019-09-25 19:53:01 +01005162 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005163 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005164
Rafal Slawik203c3db2019-09-25 19:53:01 +01005165 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5166 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005167
Rafal Slawik203c3db2019-09-25 19:53:01 +01005168 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5169 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005170}
5171
5172/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005173 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005174 *
5175 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5176 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005177 *
5178 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005179 */
5180message ProcessMemoryHighWaterMark {
5181 // The uid if available. -1 means not available.
5182 optional int32 uid = 1 [(is_uid) = true];
5183
Rafal Slawikda51b932018-12-13 16:31:33 +00005184 // The process name.
5185 // Usually package name or process cmdline.
5186 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005187 optional string process_name = 2;
5188
Rafal Slawik239b6802019-09-09 18:46:01 +01005189 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5190 // computed by converting kilobytes to bytes.
5191 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5192
Rafal Slawik3bea8952018-11-15 12:39:33 +00005193 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5194 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005195 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005196}
5197
5198/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005199 * Logs the memory stats for a process.
5200 *
5201 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5202 * and for selected native processes.
5203 */
5204message ProcessMemorySnapshot {
5205 // The uid if available. -1 means not available.
5206 optional int32 uid = 1 [(is_uid) = true];
5207
5208 // The process name.
5209 // Usually package name or process cmdline.
5210 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5211 optional string process_name = 2;
5212
5213 // The pid of the process.
5214 // Allows to disambiguate instances of the process.
5215 optional int32 pid = 3;
5216
5217 // The current OOM score adjustment value.
5218 // Read from ProcessRecord for managed processes.
5219 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5220 optional int32 oom_score_adj = 4;
5221
5222 // The current RSS of the process.
5223 // VmRSS from /proc/pid/status.
5224 optional int32 rss_in_kilobytes = 5;
5225
5226 // The current anon RSS of the process.
5227 // RssAnon from /proc/pid/status.
5228 optional int32 anon_rss_in_kilobytes = 6;
5229
5230 // The current swap size of the process.
5231 // VmSwap from /proc/pid/status.
5232 optional int32 swap_in_kilobytes = 7;
5233
5234 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5235 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5236}
5237
5238/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005239 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005240 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005241message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005242 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005243}
5244
5245/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005246 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005247 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005248message SystemUptime {
5249 // Milliseconds since the system was booted.
5250 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5251 // for external input).
5252 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005253 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005254}
5255
5256/*
5257 * Reads from /proc/uid_concurrent_active_time which has the format:
5258 * active: X (X is # cores)
5259 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5260 * [uid1]: [time-0] [time-1] [time-2] ... ...
5261 * ...
5262 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5263 * The file contains a monotonically increasing count of time for a single boot.
5264 */
5265message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005266 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005267 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005268}
5269
5270/**
5271 * Reads from /proc/uid_concurrent_policy_time which has the format:
5272 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5273 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5274 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5275 * ...
5276 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5277 * The file contains a monotonically increasing count of time for a single boot.
5278 */
5279message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005280 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005281 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005282 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005283}
5284
5285/*
5286 * Pulls free disk space, for data, system partition and temporary directory.
5287 */
5288message DiskSpace {
5289 // available bytes in data partition
5290 optional uint64 data_available_bytes = 1;
5291 // available bytes in system partition
5292 optional uint64 system_available_bytes = 2;
5293 // available bytes in download cache or temp directories
5294 optional uint64 temp_available_bytes = 3;
5295}
Tej Singhbf972d92018-01-10 20:51:13 -08005296
5297/**
5298 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005299 *
5300 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005301 */
5302message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005303 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005304}
5305
5306/**
5307 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005308 * Pulled from:
5309 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005310 */
5311message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005312 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005313}
5314
5315/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005316 * Pulls battery voltage.
5317 * Pulled from:
5318 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5319 */
5320message BatteryVoltage {
5321 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005322 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005323}
5324
5325/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005326 * Pulls battery level (percent full, from 0 to 100).
5327 *
5328 * Pulled from:
5329 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5330 */
5331message BatteryLevel {
5332 // Battery level. Should be in [0, 100].
5333 optional int32 battery_level = 1;
5334}
5335
5336/**
Tej Singhd89137e2018-03-26 14:51:40 -07005337 * Pulls the temperature of various parts of the device.
5338 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005339 *
Maggie White442b6312019-04-05 16:26:44 -07005340 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005341 */
5342message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005343 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005344 optional android.os.TemperatureTypeEnum sensor_location = 1;
5345
5346 // The name of the temperature source. Eg. CPU0
5347 optional string sensor_name = 2;
5348
Tej Singhd89137e2018-03-26 14:51:40 -07005349 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005350 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005351 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005352
5353 // Relative severity of the throttling, see enum definition.
5354 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005355}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005356
5357/**
5358 * Pulls the statistics of calls to Binder.
5359 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005360 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5361 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005362 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005363 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005364 */
5365message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005366 // UID of the process responsible for the binder transaction. It will be set if the process
5367 // executing the binder transaction attribute the transaction to another uid using
5368 // Binder.setThreadWorkSource().
5369 //
5370 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005371 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005372 // UID of the process executing the binder transaction.
5373 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005374 // Fully qualified class name of the API call.
5375 //
5376 // This is a system server class name.
5377 //
5378 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5379 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5380 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5381 // commonly used APIs.
5382 optional string service_class_name = 2;
5383 // Method name of the API call. It can also be a transaction code if we cannot
5384 // resolve it to a name. See Binder#getTransactionName.
5385 //
5386 // This is a system server method name.
5387 optional string service_method_name = 3;
5388 // Total number of API calls.
5389 optional int64 call_count = 4;
5390 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5391 optional bool screen_interactive = 13;
5392 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5393 // call_count will be equal to recorded_call_count.
5394 //
5395 // If recorded_call_count is different than call_count, it means data collection has been
5396 // sampled. All the fields below will be sampled in this case.
5397 optional int64 recorded_call_count = 12;
5398 // Number of exceptions thrown by the API.
5399 optional int64 recorded_exception_count = 5;
5400 // Total latency of all API calls.
5401 // Average can be computed using total_latency_micros / recorded_call_count.
5402 optional int64 recorded_total_latency_micros = 6;
5403 // Maximum latency of one API call.
5404 optional int64 recorded_max_latency_micros = 7;
5405 // Total CPU usage of all API calls.
5406 // Average can be computed using total_cpu_micros / recorded_call_count.
5407 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5408 optional int64 recorded_total_cpu_micros = 8;
5409 // Maximum CPU usage of one API call.
5410 optional int64 recorded_max_cpu_micros = 9;
5411 // Maximum parcel reply size of one API call.
5412 optional int64 recorded_max_reply_size_bytes = 10;
5413 // Maximum parcel request size of one API call.
5414 optional int64 recorded_max_request_size_bytes = 11;
5415}
5416
5417/**
5418 * Pulls the statistics of exceptions during calls to Binder.
5419 *
5420 * Binder stats are cumulative from boot unless somebody reset the data using
5421 * > adb shell dumpsys binder_calls_stats --reset
5422 */
5423message BinderCallsExceptions {
5424 // Exception class name, e.g. java.lang.IllegalArgumentException.
5425 //
5426 // This is an exception class name thrown by the system server.
5427 optional string exception_class_name = 1;
5428 // Total number of exceptions.
5429 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005430}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005431
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005432/**
5433 * Pulls the statistics of message dispatching on HandlerThreads.
5434 *
5435 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5436 * config on the device.
5437 *
5438 * Next tag: 11
5439 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005440message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005441 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005442 optional int32 uid = 1 [(is_uid) = true];
5443
5444 // Fully qualified class name of the handler target class.
5445 //
5446 // This field does not contain PII. This is a system server class name.
5447 optional string handler_class_name = 2;
5448
5449 // The name of the thread that runs the Looper.
5450 //
5451 // This field does not contain PII. This is a system server thread name.
5452 optional string looper_thread_name = 3;
5453
5454 // The name of the dispatched message.
5455 //
5456 // This field does not contain PII. This is a system server constant or class
5457 // name.
5458 optional string message_name = 4;
5459
5460 // Total number of successfully dispatched messages.
5461 optional int64 message_count = 5;
5462
5463 // Total number of messages that failed dispatching.
5464 optional int64 exception_count = 6;
5465
5466 // Total number of processed messages we have data recorded for. If we
5467 // collected data for all the messages, message_count will be equal to
5468 // recorded_message_count.
5469 //
5470 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005471 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005472 optional int64 recorded_message_count = 7;
5473
5474 // Total latency of all processed messages.
5475 // Average can be computed using recorded_total_latency_micros /
5476 // recorded_message_count.
5477 optional int64 recorded_total_latency_micros = 8;
5478
5479 // Total CPU usage of all processed message.
5480 // Average can be computed using recorded_total_cpu_micros /
5481 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005482 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005483 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005484
5485 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5486 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005487
5488 // Max recorded CPU usage of all processed messages.
5489 optional int64 recorded_max_cpu_micros = 11;
5490
5491 // Max recorded latency of all processed messages.
5492 optional int64 recorded_max_latency_micros = 12;
5493
5494 // Total number of messages we tracked the dispatching delay for. If we
5495 // collected data for all the messages, message_count will be equal to
5496 // recorded_delay_message_count.
5497 //
5498 // If recorded_delay_message_count is different than message_count, it means data
5499 // collection has been sampled or/and not all messages specified the target dispatch time.
5500 // The fields below will be sampled in this case.
5501 optional int64 recorded_delay_message_count = 13;
5502
5503 // Total dispatching delay of all processed messages.
5504 // Calculated as a difference between the target dispatching time (Message.when)
5505 // and the actual dispatching time.
5506 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5507 optional int64 recorded_total_delay_millis = 14;
5508
5509 // Max dispatching delay of all processed messages.
5510 // Calculated as a difference between the target dispatching time (Message.when)
5511 // and the actual dispatching time.
5512 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005513}
Tej Singh86dc9db2018-09-06 00:39:57 +00005514
5515/**
5516 * Pulls disk information, such as write speed and latency.
5517 */
5518message DiskStats {
5519 // Time taken to open, write 512B to, and close a file.
5520 // -1 if error performing the check.
5521 optional int64 data_write_latency_millis = 1;
5522
5523 optional bool file_based_encryption = 2;
5524
5525 // Recent disk write speed in kB/s.
5526 // -1 if error querying storageed.
5527 // 0 if data is unavailable.
5528 optional int32 recent_disk_write_speed = 3;
5529}
5530
5531
5532/**
5533 * Free and total bytes of the Data, Cache, and System partition.
5534 */
5535message DirectoryUsage {
5536 enum Directory {
5537 UNKNOWN = 0;
5538 DATA = 1;
5539 CACHE = 2;
5540 SYSTEM = 3;
5541 }
5542 optional Directory directory = 1;
5543 optional int64 free_bytes = 2;
5544 optional int64 total_bytes = 3;
5545}
5546
5547
5548/**
5549 * Size of an application: apk size, data size, and cache size.
5550 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5551 * Information is only reported for apps with the primary user (user 0).
5552 * Sizes are aggregated by package name.
5553 */
5554message AppSize {
5555 // Including uids will involve modifying diskstats logic.
5556 optional string package_name = 1;
5557 // App size in bytes. -1 if unavailable.
5558 optional int64 app_size_bytes = 2;
5559 // App data size in bytes. -1 if unavailable.
5560 optional int64 app_data_size_bytes = 3;
5561 // App cache size in bytes. -1 if unavailable.
5562 optional int64 app_cache_size_bytes = 4;
5563 // Time that the cache file was produced.
5564 // Uses System.currentTimeMillis(), which is wall clock time.
5565 optional int64 cache_time_millis = 5;
5566}
5567
5568
5569/**
5570 * Size of a particular category. Eg: photos, videos.
5571 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5572 */
5573message CategorySize {
5574 enum Category {
5575 UNKNOWN = 0;
5576 APP_SIZE = 1;
5577 APP_DATA_SIZE = 2;
5578 APP_CACHE_SIZE = 3;
5579 PHOTOS = 4;
5580 VIDEOS = 5;
5581 AUDIO = 6;
5582 DOWNLOADS = 7;
5583 SYSTEM = 8;
5584 OTHER = 9;
5585 }
5586 optional Category category = 1;
5587 // Category size in bytes.
5588 optional int64 size_bytes = 2;
5589 // Time that the cache file was produced.
5590 // Uses System.currentTimeMillis(), which is wall clock time.
5591 optional int64 cache_time_millis = 3;
5592}
Tej Singhd6d6d772018-09-05 17:41:25 -07005593
5594/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005595 * Pulls per uid I/O stats. The stats are cumulative since boot.
5596 *
5597 * Read/write bytes are I/O events from a storage device
5598 * Read/write chars are data requested by read/write syscalls, and can be
5599 * satisfied by caching.
5600 *
5601 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5602 */
5603message DiskIo {
5604 optional int32 uid = 1 [(is_uid) = true];
5605 optional int64 fg_chars_read = 2;
5606 optional int64 fg_chars_write = 3;
5607 optional int64 fg_bytes_read = 4;
5608 optional int64 fg_bytes_write = 5;
5609 optional int64 bg_chars_read = 6;
5610 optional int64 bg_chars_write = 7;
5611 optional int64 bg_bytes_read = 8;
5612 optional int64 bg_bytes_write = 9;
5613 optional int64 fg_fsync = 10;
5614 optional int64 bg_fsync= 11;
5615}
5616
5617
5618/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005619 * Pulls the number of fingerprints for each user.
5620 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005621 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005622 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005623message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005624 // The associated user. Eg: 0 for owners, 10+ for others.
5625 // Defined in android/os/UserHandle.java
5626 optional int32 user = 1;
5627 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005628 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005629}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005630
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005631/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005632 * Pulls the number of faces for each user.
5633 *
5634 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5635 */
5636message NumFacesEnrolled {
5637 // The associated user. Eg: 0 for owners, 10+ for others.
5638 // Defined in android/os/UserHandle.java
5639 optional int32 user = 1;
5640 // Number of faces registered to that user.
5641 optional int32 num_faces_enrolled = 2;
5642}
5643/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005644 * A mapping of role holder -> role
5645 */
5646message RoleHolder {
5647 // uid of the role holder
5648 optional int32 uid = 1 [(is_uid) = true];
5649
5650 // package name of the role holder
5651 optional string package_name = 2;
5652
5653 // the role held
5654 optional string role = 3;
5655}
5656
Yangsteraf9aee72018-10-12 09:26:16 -07005657message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005658 // These are all in byte resolution.
5659 optional int64 min = 1 [deprecated = true];
5660 optional int64 average = 2 [deprecated = true];
5661 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005662
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005663 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5664 // int64 fields.
5665 optional int32 mean_kb = 4;
5666 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005667}
5668
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005669// A reduced subset of process states; reducing the number of possible states allows more
5670// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5671enum ProcessStateAggregated {
5672 PROCESS_STATE_UNKNOWN = 0;
5673 // Persistent system process.
5674 PROCESS_STATE_PERSISTENT = 1;
5675 // Top activity; actually any visible activity.
5676 PROCESS_STATE_TOP = 2;
5677 // Process binding to top or a foreground service.
5678 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5679 // Processing running a foreground service.
5680 PROCESS_STATE_FGS = 4;
5681 // Important foreground process (ime, wallpaper, etc).
5682 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5683 // Important background process.
5684 PROCESS_STATE_BACKGROUND = 6;
5685 // Process running a receiver.
5686 PROCESS_STATE_RECEIVER = 7;
5687 // All kinds of cached processes.
5688 PROCESS_STATE_CACHED = 8;
5689}
5690
5691// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005692message ProcessStatsStateProto {
5693 optional android.service.procstats.ScreenState screen_state = 1;
5694
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005695 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005696
5697 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5698 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005699 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5700
5701 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005702
5703 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005704 optional int64 duration_millis = 4 [deprecated = true];
5705 // Same as above, but with minute resolution so it fits into an int32.
5706 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005707
5708 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005709 optional int64 realtime_duration_millis = 9 [deprecated = true];
5710 // Same as above, but with minute resolution so it fits into an int32.
5711 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005712
5713 // # of samples taken
5714 optional int32 sample_size = 5;
5715
5716 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005717 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005718
5719 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005720 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005721
5722 // RSS is memory resident for this process
5723 optional AggStats rss = 8;
5724}
5725
Jing Ji060d6862020-04-13 19:36:31 -07005726// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005727message ProcessStatsProto {
5728 // Name of process.
5729 optional string process = 1;
5730
5731 // Uid of the process.
5732 optional int32 uid = 2;
5733
5734 // Information about how often kills occurred
5735 message Kill {
5736 // Count of excessive CPU kills
5737 optional int32 cpu = 1;
5738
5739 // Count of kills when cached
5740 optional int32 cached = 2;
5741
5742 // PSS stats during cached kill
5743 optional AggStats cached_pss = 3;
5744 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005745 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005746
5747 // Time and memory spent in various states.
5748 repeated ProcessStatsStateProto states = 5;
5749
5750 // Total time process has been running... screen_state, memory_state, and process_state
5751 // will not be set.
5752 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005753
5754 // Association data for this process in this state;
5755 // each entry here is one association.
5756 repeated ProcessStatsAssociationProto assocs = 7;
5757}
5758
5759// Next Tag: 5
5760message ProcessStatsAssociationProto {
5761 // Procss Name of the associated process (client process of service binding)
5762 optional string assoc_process_name = 1;
5763
5764 // Package Name of the associated package (client package of service binding)
5765 optional string assoc_package_name = 2;
5766
5767 // Total count of the times this association (service binding) appeared.
5768 optional int32 total_count = 3;
5769
5770 // Uptime total duration in seconds this association (service binding) was around.
5771 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005772}
5773
5774message PackageServiceOperationStatsProto {
5775 // Operate enum: Started, Foreground, Bound, Executing
5776 optional android.service.procstats.ServiceOperationState operation = 1;
5777
5778 // Number of times the service was in this operation.
5779 optional int32 count = 2;
5780
5781 // Information about a state the service can be in.
5782 message StateStats {
5783 // Screen state enum.
5784 optional android.service.procstats.ScreenState screen_state = 1;
5785 // Memory state enum.
5786 optional android.service.procstats.MemoryState memory_state = 2;
5787
5788 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005789 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005790 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005791 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005792 }
5793 repeated StateStats state_stats = 3;
5794}
5795
5796message PackageServiceStatsProto {
5797 // Name of service component.
5798 optional string service_name = 1;
5799
5800 // The operation stats.
5801 // The package_name, package_uid, package_version, service_name will not be set to save space.
5802 repeated PackageServiceOperationStatsProto operation_stats = 2;
5803}
5804
5805message PackageAssociationSourceProcessStatsProto {
5806 // Uid of the process.
5807 optional int32 process_uid = 1;
5808 // Process name.
5809 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005810 // Package name.
5811 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005812 // Total count of the times this association appeared.
5813 optional int32 total_count = 3;
5814
5815 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005816 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005817
5818 // Total count of the times this association became actively impacting its target process.
5819 optional int32 active_count = 5;
5820
5821 // Information on one source in this association.
5822 message StateStats {
5823 // Process state enum.
5824 optional android.service.procstats.ProcessState process_state = 1;
5825 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005826 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005827 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005828 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005829 }
5830 repeated StateStats active_state_stats = 6;
5831}
5832
5833message PackageAssociationProcessStatsProto {
5834 // Name of the target component.
5835 optional string component_name = 1;
5836 // Information on one source in this association.
5837 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5838}
5839
5840
5841message ProcessStatsPackageProto {
5842 // Name of package.
5843 optional string package = 1;
5844
5845 // Uid of the package.
5846 optional int32 uid = 2;
5847
5848 // Version of the package.
5849 optional int64 version = 3;
5850
5851 // Stats for each process running with the package loaded in to it.
5852 repeated ProcessStatsProto process_stats = 4;
5853
5854 // Stats for each of the package's services.
5855 repeated PackageServiceStatsProto service_stats = 5;
5856
5857 // Stats for each association with the package.
5858 repeated PackageAssociationProcessStatsProto association_stats = 6;
5859}
5860
5861message ProcessStatsSectionProto {
5862 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005863 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005864
5865 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005866 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005867
5868 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005869 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005870
5871 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005872 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005873
5874 // System runtime library. e.g. "libdvm.so", "libart.so".
5875 optional string runtime = 5;
5876
5877 // whether kernel reports swapped pss.
5878 optional bool has_swapped_pss = 6;
5879
5880 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5881 enum Status {
5882 STATUS_UNKNOWN = 0;
5883 STATUS_COMPLETE = 1;
5884 STATUS_PARTIAL = 2;
5885 STATUS_SHUTDOWN = 3;
5886 STATUS_SYSPROPS = 4;
5887 }
5888 repeated Status status = 7;
5889
Chenjie Yub2ecc792019-01-17 10:27:26 -08005890 // Number of pages available of various types and sizes, representation fragmentation.
5891 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5892
Yangsteraf9aee72018-10-12 09:26:16 -07005893 // Stats for each process.
5894 repeated ProcessStatsProto process_stats = 8;
5895
5896 // Stats for each package.
5897 repeated ProcessStatsPackageProto package_stats = 9;
5898}
5899
Chenjie Yub2ecc792019-01-17 10:27:26 -08005900message ProcessStatsAvailablePagesProto {
5901 // Node these pages are in (as per /proc/pagetypeinfo)
5902 optional int32 node = 1;
5903
5904 // Zone these pages are in (as per /proc/pagetypeinfo)
5905 optional string zone = 2;
5906
5907 // Label for the type of these pages (as per /proc/pagetypeinfo)
5908 optional string label = 3;
5909
5910 // Distribution of number of pages available by order size. First entry in array is
5911 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5912 repeated int32 pages_per_order = 4;
5913}
5914
Chenjie Yu12e5e672018-09-14 15:54:59 -07005915/**
5916 * Pulled from ProcessStatsService.java
5917 */
5918message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005919 optional ProcessStatsSectionProto proc_stats_section = 1;
5920}
5921
Chenjie Yuf910b7802019-01-11 16:08:20 -08005922/**
5923 * Pulled from ProcessStatsService.java
5924 */
5925message ProcStatsPkgProc {
5926 optional ProcessStatsSectionProto proc_stats_section = 1;
5927}
5928
Chris Wrencdea3b72019-11-22 16:58:17 -05005929// Next Tag: 2
5930message PackageRemoteViewInfoProto {
5931 optional string package_name = 1;
5932 // add per-package additional info here (like channels)
5933}
5934
5935// Next Tag: 2
5936message NotificationRemoteViewsProto {
5937 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5938}
5939
5940/**
5941 * Pulled from NotificationManagerService.java
5942 */
5943message NotificationRemoteViews {
5944 optional NotificationRemoteViewsProto notification_remote_views = 1;
5945}
5946
Yotam Aron74299972020-01-16 16:20:58 +02005947/**
5948 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5949 */
5950message PackageNotificationPreferences {
5951 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005952 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005953 // Notification importance, which specifies when and how a notification is displayed.
5954 // Specified under core/java/android/app/NotificationManager.java.
5955 optional int32 importance = 2;
5956 // Lockscreen visibility as set by the user.
5957 optional int32 visibility = 3;
5958 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5959 // PreferencesHelper.java)
5960 optional int32 user_locked_fields = 4;
5961}
5962
5963/**
5964 * Atom that contains a list of a package's channel preferences, pulled from
5965 * NotificationManagerService.java.
5966 */
5967message PackageNotificationChannelPreferences {
5968 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005969 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005970 // Channel's ID. Should always be available.
5971 optional string channel_id = 2;
5972 // Channel's name. Should always be available.
5973 optional string channel_name = 3;
5974 // Channel's description. Optionally set by the channel creator.
5975 optional string description = 4;
5976 // Notification importance, which specifies when and how a notification is displayed. Specified
5977 // under core/java/android/app/NotificationManager.java.
5978 optional int32 importance = 5;
5979 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5980 // at core/java/android/app/NotificationChannel.java
5981 optional int32 user_locked_fields = 6;
5982 // Indicates if the channel was deleted by the app.
5983 optional bool is_deleted = 7;
5984}
5985
5986/**
5987 * Atom that contains a list of a package's channel group preferences, pulled from
5988 * NotificationManagerService.java.
5989 */
5990message PackageNotificationChannelGroupPreferences {
5991 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005992 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005993 // Channel Group's ID. Should always be available.
5994 optional string group_id = 2;
5995 // Channel Group's name. Should always be available.
5996 optional string group_name = 3;
5997 // Channel Group's description. Optionally set by group creator.
5998 optional string description = 4;
5999 // Indicates if notifications from this channel group are blocked.
6000 optional bool is_blocked = 5;
6001 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6002 // at core/java/android/app/NotificationChannelGroup.java
6003 optional int32 user_locked_fields = 6;
6004}
6005
Yangsteraf9aee72018-10-12 09:26:16 -07006006message PowerProfileProto {
6007 optional double cpu_suspend = 1;
6008
6009 optional double cpu_idle = 2;
6010
6011 optional double cpu_active = 3;
6012
6013 message CpuCluster {
6014 optional int32 id = 1;
6015 optional double cluster_power = 2;
6016 optional int32 cores = 3;
6017 repeated int64 speed = 4;
6018 repeated double core_power = 5;
6019 }
6020
6021 repeated CpuCluster cpu_cluster = 40;
6022
6023 optional double wifi_scan = 4;
6024
6025 optional double wifi_on = 5;
6026
6027 optional double wifi_active = 6;
6028
6029 optional double wifi_controller_idle = 7;
6030
6031 optional double wifi_controller_rx = 8;
6032
6033 optional double wifi_controller_tx = 9;
6034
6035 repeated double wifi_controller_tx_levels = 10;
6036
6037 optional double wifi_controller_operating_voltage = 11;
6038
6039 optional double bluetooth_controller_idle = 12;
6040
6041 optional double bluetooth_controller_rx = 13;
6042
6043 optional double bluetooth_controller_tx = 14;
6044
6045 optional double bluetooth_controller_operating_voltage = 15;
6046
6047 optional double modem_controller_sleep = 16;
6048
6049 optional double modem_controller_idle = 17;
6050
6051 optional double modem_controller_rx = 18;
6052
6053 repeated double modem_controller_tx = 19;
6054
6055 optional double modem_controller_operating_voltage = 20;
6056
6057 optional double gps_on = 21;
6058
6059 repeated double gps_signal_quality_based = 22;
6060
6061 optional double gps_operating_voltage = 23;
6062
6063 optional double bluetooth_on = 24;
6064
6065 optional double bluetooth_active = 25;
6066
6067 optional double bluetooth_at_cmd = 26;
6068
6069 optional double ambient_display = 27;
6070
6071 optional double screen_on = 28;
6072
6073 optional double radio_on = 29;
6074
6075 optional double radio_scanning = 30;
6076
6077 optional double radio_active = 31;
6078
6079 optional double screen_full = 32;
6080
6081 optional double audio = 33;
6082
6083 optional double video = 34;
6084
6085 optional double flashlight = 35;
6086
6087 optional double memory = 36;
6088
6089 optional double camera = 37;
6090
6091 optional double wifi_batched_scan = 38;
6092
6093 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006094}
Chenjie Yuab530202018-09-26 12:39:20 -07006095
6096/**
6097 * power_profile.xml and other constants for power model calculations.
6098 * Pulled from PowerProfile.java
6099 */
6100message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006101 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006102}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006103
6104/**
arangelovd5db50e2018-10-12 20:24:39 +01006105 * Logs when a user restriction was added or removed.
6106 *
6107 * Logged from:
6108 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6109 */
6110message UserRestrictionChanged {
6111 // The raw string of the user restriction as defined in UserManager.
6112 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6113 optional string restriction = 1;
6114 // Whether the restriction is enabled or disabled.
6115 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006116}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006117
6118/**
6119 * Pulls process user time and system time. Puller takes a snapshot of all pids
6120 * in the system and returns cpu stats for those that are working at the time.
6121 * Dead pids will be dropped. Kernel processes are excluded.
6122 * Min cool-down is 5 sec.
6123 */
6124message ProcessCpuTime {
6125 optional int32 uid = 1 [(is_uid) = true];
6126
6127 optional string process_name = 2;
6128 // Process cpu time in user space, cumulative from boot/process start
6129 optional int64 user_time_millis = 3;
6130 // Process cpu time in system space, cumulative from boot/process start
6131 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006132}
Misha Wagner5a51e002018-10-03 15:04:09 +01006133
6134/**
6135 * Pulls the CPU usage for each thread.
6136 *
6137 * Read from /proc/$PID/task/$TID/time_in_state files.
6138 *
6139 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6140 * time_in_state files not being present on some phones, have not been addressed. These should be
6141 * considered before a public release.
6142 */
6143message CpuTimePerThreadFreq {
6144 // UID that owns the process.
6145 optional int32 uid = 1 [(is_uid) = true];
6146 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006147 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006148 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006149 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006150 // Name of the process taken from `/proc/$PID/cmdline`.
6151 optional string process_name = 4;
6152 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6153 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006154
6155 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6156 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6157 // frequencies are given here as the alternative is sending eight separate atoms. This method
6158 // significantly reduces the amount of data created
6159 optional int32 frequency1_khz = 6;
6160 optional int32 time1_millis = 7;
6161 optional int32 frequency2_khz = 8;
6162 optional int32 time2_millis = 9;
6163 optional int32 frequency3_khz = 10;
6164 optional int32 time3_millis = 11;
6165 optional int32 frequency4_khz = 12;
6166 optional int32 time4_millis = 13;
6167 optional int32 frequency5_khz = 14;
6168 optional int32 time5_millis = 15;
6169 optional int32 frequency6_khz = 16;
6170 optional int32 time6_millis = 17;
6171 optional int32 frequency7_khz = 18;
6172 optional int32 time7_millis = 19;
6173 optional int32 frequency8_khz = 20;
6174 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006175}
Bookatz75ee6042018-11-09 12:27:37 -08006176
6177/**
Bookatz366a4432018-11-20 09:42:33 -08006178 * Pulls information about the device's build.
6179 */
6180message BuildInformation {
6181 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6182 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6183 optional string fingerprint = 1;
6184
6185 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6186 optional string brand = 2;
6187
6188 // Build.PRODUCT. The name of the overall product.
6189 optional string product = 3;
6190
6191 // Build.DEVICE. The name of the industrial design.
6192 optional string device = 4;
6193
6194 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6195 optional string version_release = 5;
6196
6197 // Build.ID. E.g. a label like "M4-rc20".
6198 optional string id = 6;
6199
6200 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6201 // represent this build.
6202 optional string version_incremental = 7;
6203
6204 // Build.TYPE. The type of build, like "user" or "eng".
6205 optional string type = 8;
6206
6207 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6208 optional string tags = 9;
6209}
6210
6211/**
Adam He420947c2019-01-23 15:59:09 -08006212 * Logs information about mismatched caller for content capture.
6213 *
6214 * Logged from:
6215 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6216 */
6217message ContentCaptureCallerMismatchReported {
6218 optional string intended_package = 1;
6219 optional string calling_package = 2;
6220}
6221
6222/**
6223 * Logs information about content capture service events.
6224 *
6225 * Logged from:
6226 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6227 */
6228message ContentCaptureServiceEvents {
6229 // The type of event.
6230 enum Event {
6231 UNKNOWN = 0;
6232 ON_CONNECTED = 1;
6233 ON_DISCONNECTED = 2;
6234 SET_WHITELIST = 3;
6235 SET_DISABLED = 4;
6236 ON_USER_DATA_REMOVED = 5;
6237 }
6238 optional Event event = 1;
6239 // component/package of content capture service.
6240 optional string service_info = 2;
6241 // component/package of target.
6242 // it's a concatenated list of component/package for SET_WHITELIST event
6243 // separated by " ".
6244 optional string target_info = 3;
6245}
6246
6247/**
6248 * Logs information about content capture session events.
6249 *
6250 * Logged from:
6251 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6252 */
6253message ContentCaptureSessionEvents {
6254 // The type of event.
6255 enum Event {
6256 UNKNOWN = 0;
6257 ON_SESSION_STARTED = 1;
6258 ON_SESSION_FINISHED = 2;
6259 SESSION_NOT_CREATED = 3;
6260 }
6261 optional int32 session_id = 1;
6262 optional Event event = 2;
6263 // (n/a on session finished)
6264 optional int32 state_flags = 3;
6265 // component/package of content capture service.
6266 optional string service_info = 4;
6267 // component/package of app.
6268 // (n/a on session finished)
6269 optional string app_info = 5;
6270 optional bool is_child_session = 6;
6271}
6272
6273/**
6274 * Logs information about session being flushed.
6275 *
6276 * Logged from:
6277 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6278 */
6279message ContentCaptureFlushed {
6280 optional int32 session_id = 1;
6281 // component/package of content capture service.
6282 optional string service_info = 2;
6283 // component/package of app.
6284 optional string app_info = 3;
6285 // session start/finish events
6286 optional int32 child_session_started = 4;
6287 optional int32 child_session_finished = 5;
6288 // count of view events.
6289 optional int32 view_appeared_count = 6;
6290 optional int32 view_disappeared_count = 7;
6291 optional int32 view_text_changed_count = 8;
6292
6293 // Flush stats.
6294 optional int32 max_events = 9;
6295 optional int32 idle_flush_freq = 10;
6296 optional int32 text_flush_freq = 11;
6297 optional int32 flush_reason = 12;
6298}
6299
6300/**
Bookatz75ee6042018-11-09 12:27:37 -08006301 * Pulls on-device BatteryStats power use calculations for the overall device.
6302 */
6303message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006304 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6305 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6306 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6307 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08006308}
6309
6310/**
6311 * Pulls on-device BatteryStats power use calculations broken down by uid.
6312 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6313 * that is attributed to non-uid items. They must all be included to get the total power use.
6314 */
6315message DeviceCalculatedPowerBlameUid {
6316 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6317 optional int32 uid = 1 [(is_uid) = true];
6318
Bookatz3dbc13a2018-12-21 12:16:51 -08006319 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6320 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6321 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08006322}
6323
6324/**
6325 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6326 * drain type.
6327 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6328 * is attributed uids. They must all be included to get the total power use.
6329 */
6330message DeviceCalculatedPowerBlameOther {
6331 // The type of item whose power use is being reported.
6332 enum DrainType {
6333 AMBIENT_DISPLAY = 0;
6334 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6335 BLUETOOTH = 2;
6336 CAMERA = 3;
6337 // Cell-standby
6338 CELL = 4;
6339 FLASHLIGHT = 5;
6340 IDLE = 6;
6341 MEMORY = 7;
6342 // Amount that total computed drain exceeded the drain estimated using the
6343 // battery level changes and capacity.
6344 OVERCOUNTED = 8;
6345 PHONE = 9;
6346 SCREEN = 10;
6347 // Amount that total computed drain was below the drain estimated using the
6348 // battery level changes and capacity.
6349 UNACCOUNTED = 11;
6350 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6351 WIFI = 13;
6352 }
6353 optional DrainType drain_type = 1;
6354
Bookatz3dbc13a2018-12-21 12:16:51 -08006355 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6356 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6357 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006358}
arangelov4e994062018-11-13 16:12:38 +00006359
6360/**
6361 * Logs device policy features.
6362 *
6363 * Logged from:
6364 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6365 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6366 */
6367message DevicePolicyEvent {
6368 // The event id - unique for each event.
6369 optional android.stats.devicepolicy.EventId event_id = 1;
6370 // The admin package name.
6371 optional string admin_package_name = 2;
6372 // A generic integer parameter.
6373 optional int32 integer_value = 3;
6374 // A generic boolean parameter.
6375 optional bool boolean_value = 4;
6376 // A parameter specifying a time period in milliseconds.
6377 optional uint64 time_period_millis = 5;
6378 // A parameter specifying a list of package names, bundle extras or string parameters.
6379 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6380}
shawnlinea5b66b2018-11-13 15:05:29 +08006381
6382/**
6383 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6384 *
6385 * Logged from:
6386 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6387 */
6388message DocsUILaunchReported {
6389 optional android.stats.docsui.LaunchAction launch_action = 1;
6390 optional bool has_initial_uri = 2;
6391 optional android.stats.docsui.MimeType mime_type = 3;
6392 optional android.stats.docsui.Root initial_root = 4;
6393}
6394
6395/**
6396 * Logs root/app visited event in file managers/picker. Call this when the user
6397 * taps on root/app in hamburger menu.
6398 *
6399 * Logged from:
6400 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6401 */
6402message DocsUIRootVisitedReported {
6403 optional android.stats.docsui.ContextScope scope = 1;
6404 optional android.stats.docsui.Root root = 2;
6405}
6406
6407/**
6408 * Logs file operation stats. Call this when a file operation has completed.
6409 *
6410 * Logged from:
6411 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6412 */
6413message DocsUIFileOperationReported {
6414 optional android.stats.docsui.Provider provider = 1;
6415 optional android.stats.docsui.FileOperation file_op = 2;
6416}
6417
6418/**
6419 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6420 * mode.
6421 *
6422 * Logged from:
6423 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6424 */
6425message DocsUIFileOperationCopyMoveModeReported {
6426 optional android.stats.docsui.FileOperation file_op = 1;
6427 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6428}
6429
6430
6431/**
6432 * Logs file sub operation stats. Call this when a file operation has failed.
6433 *
6434 * Logged from:
6435 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6436 */
6437message DocsUIFileOperationFailureReported {
6438 optional android.stats.docsui.Authority authority = 1;
6439 optional android.stats.docsui.SubFileOperation sub_op = 2;
6440}
6441
6442/**
6443* Logs the cancellation of a file operation. Call this when a job is canceled
6444*
6445* Logged from:
6446* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6447*/
6448message DocsUIFileOperationCanceledReported {
6449 optional android.stats.docsui.FileOperation file_op = 1;
6450}
6451
6452/**
6453 * Logs startup time in milliseconds.
6454 *
6455 * Logged from:
6456 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6457 */
6458message DocsUIStartupMsReported {
6459 optional int32 startup_millis = 1;
6460}
6461
6462/**
6463 * Logs the action that was started by user.
6464 *
6465 * Logged from:
6466 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6467 */
6468message DocsUIUserActionReported {
6469 optional android.stats.docsui.UserAction action = 1;
6470}
6471
6472/**
6473 * Logs the invalid type when invalid scoped access is requested.
6474 *
6475 * Logged from:
6476 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6477 */
6478message DocsUIInvalidScopedAccessRequestReported {
6479 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006480}
Ben Murdochbab399f2018-12-06 11:01:38 +00006481
6482/**
shawnlina75e82d2019-01-07 10:31:12 +08006483 * Logs the package name that launches docsui picker mode.
6484 *
6485 * Logged from:
6486 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6487 */
6488message DocsUIPickerLaunchedFromReported {
6489 optional string package_name = 1;
6490}
6491
6492/**
6493 * Logs the search type.
6494 *
6495 * Logged from:
6496 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6497 */
6498message DocsUISearchTypeReported {
6499 optional android.stats.docsui.SearchType search_type = 1;
6500}
6501
6502/**
6503 * Logs the search mode.
6504 *
6505 * Logged from:
6506 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6507 */
6508message DocsUISearchModeReported {
6509 optional android.stats.docsui.SearchMode search_mode = 1;
6510}
6511
6512/**
6513 * Logs the pick result information.
6514 *
6515 * Logged from:
6516 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6517 */
6518message DocsUIPickResultReported {
6519 optional int32 total_action_count = 1;
6520 optional int64 duration_millis = 2;
6521 optional int32 file_count= 3;
6522 optional bool is_searching = 4;
6523 optional android.stats.docsui.Root picked_from = 5;
6524 optional android.stats.docsui.MimeType mime_type = 6;
6525 optional int32 repeatedly_pick_times = 7;
6526}
6527
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006528/** Logs the drag and drop of files.
6529
6530 * Logged from:
6531 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6532 */
6533message DocsUIDragAndDropReported {
6534 optional bool drag_initiated_from_docsui = 1;
6535}
6536
shawnlina75e82d2019-01-07 10:31:12 +08006537/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006538 * Logs when an app's memory is compacted.
6539 *
6540 * Logged from:
6541 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6542 */
6543message AppCompacted {
6544 // The pid of the process being compacted.
6545 optional int32 pid = 1;
6546
6547 // The name of the process being compacted.
6548 optional string process_name = 2;
6549
6550 // The type of compaction.
6551 enum Action {
6552 UNKNOWN = 0;
6553 SOME = 1;
6554 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006555 PERSISTENT = 3;
6556 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006557 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006558 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006559
6560 // Total RSS in kilobytes consumed by the process prior to compaction.
6561 optional int64 before_rss_total_kilobytes = 4;
6562
6563 // File RSS in kilobytes consumed by the process prior to compaction.
6564 optional int64 before_rss_file_kilobytes = 5;
6565
6566 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6567 optional int64 before_rss_anon_kilobytes = 6;
6568
6569 // Swap in kilobytes consumed by the process prior to compaction.
6570 optional int64 before_swap_kilobytes = 7;
6571
6572 // Total RSS in kilobytes consumed by the process after compaction.
6573 optional int64 after_rss_total_kilobytes = 8;
6574
6575 // File RSS in kilobytes consumed by the process after compaction.
6576 optional int64 after_rss_file_kilobytes = 9;
6577
6578 // Anonymous RSS in kilobytes consumed by the process after compaction.
6579 optional int64 after_rss_anon_kilobytes = 10;
6580
6581 // Swap in kilobytes consumed by the process after compaction.
6582 optional int64 after_swap_kilobytes = 11;
6583
6584 // The time taken to perform compaction in milliseconds.
6585 optional int64 time_to_compact_millis = 12;
6586
6587 // The last compaction action performed for this app.
6588 optional Action last_action = 13;
6589
Ben Murdoch01720b82018-12-19 18:03:44 +00006590 // The last time that compaction was attempted on this process in milliseconds
6591 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6592 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006593
Ben Murdoch885c21b2019-03-15 18:02:04 +00006594 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006595 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006596
6597 // The process state at the time of compaction.
6598 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006599
6600 // Free ZRAM in kilobytes before compaction.
6601 optional int64 before_zram_free_kilobytes = 17;
6602
6603 // Free ZRAM in kilobytes after compaction.
6604 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006605}
lifr157fc552018-12-12 16:38:04 +08006606
6607/**
lifrb6b90b62019-03-29 00:40:17 +08006608 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6609 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6610 *
lifr1f74b052019-04-16 22:16:30 +08006611 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6612 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6613 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6614 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006615 */
6616message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006617 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006618
lifr1f74b052019-04-16 22:16:30 +08006619 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006620
6621 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006622 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006623
lifr1f74b052019-04-16 22:16:30 +08006624 // Only valid for event_type = EVENT_GETADDRINFO.
6625 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006626
lifr1f74b052019-04-16 22:16:30 +08006627 // Flags passed to android_res_nsend() defined in multinetwork.h
6628 // Only valid for event_type = EVENT_RESNSEND.
6629 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006630
lifrad9becc2019-05-20 11:04:41 +08006631 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006632
6633 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006634 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006635
6636 // Additional pass-through fields opaque to statsd.
6637 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006638 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006639
6640 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6641 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006642}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006643
6644/**
6645 * Logs when a data stall event occurs.
6646 *
6647 * Log from:
6648 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6649 */
6650message DataStallEvent {
6651 // Data stall evaluation type.
6652 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6653 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6654 optional int32 evaluation_type = 1;
6655 // See definition in data_stall_event.proto.
6656 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6657 // See definition in data_stall_event.proto.
6658 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6659 // See definition in data_stall_event.proto.
6660 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6661 // See definition in data_stall_event.proto.
6662 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6663 // See definition in data_stall_event.proto.
6664 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6665}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006666
6667/*
6668 * Logs when RescueParty resets some set of experiment flags.
6669 *
6670 * Logged from:
6671 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6672 */
6673message RescuePartyResetReported {
6674 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6675 optional int32 rescue_level = 1;
6676}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006677
6678/**
6679 * Logs when signed config is received from an APK, and if that config was applied successfully.
6680 * Logged from:
6681 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6682 */
6683message SignedConfigReported {
6684 enum Type {
6685 UNKNOWN_TYPE = 0;
6686 GLOBAL_SETTINGS = 1;
6687 }
6688 optional Type type = 1;
6689
6690 // The final status of the signed config received.
6691 enum Status {
6692 UNKNOWN_STATUS = 0;
6693 APPLIED = 1;
6694 BASE64_FAILURE_CONFIG = 2;
6695 BASE64_FAILURE_SIGNATURE = 3;
6696 SECURITY_EXCEPTION = 4;
6697 INVALID_CONFIG = 5;
6698 OLD_CONFIG = 6;
6699 SIGNATURE_CHECK_FAILED = 7;
6700 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006701 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006702 }
6703 optional Status status = 2;
6704
6705 // The version of the signed config processed.
6706 optional int32 version = 3;
6707
6708 // The package name that the config was extracted from.
6709 optional string from_package = 4;
6710
6711 enum Key {
6712 NO_KEY = 0;
6713 DEBUG = 1;
6714 PRODUCTION = 2;
6715 }
6716 // Which key was used to verify the config.
6717 optional Key verified_with = 5;
6718}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006719
6720/*
6721 * Logs GNSS Network-Initiated (NI) location events.
6722 *
6723 * Logged from:
6724 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6725 */
6726message GnssNiEventReported {
6727 // The type of GnssNiEvent.
6728 enum EventType {
6729 UNKNOWN = 0;
6730 NI_REQUEST = 1;
6731 NI_RESPONSE = 2;
6732 }
6733 optional EventType event_type = 1;
6734
6735 // An ID generated by HAL to associate NI notifications and UI responses.
6736 optional int32 notification_id = 2;
6737
6738 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006739 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006740
6741 // NI requires notification.
6742 optional bool need_notify = 4;
6743
6744 // NI requires verification.
6745 optional bool need_verify = 5;
6746
6747 // NI requires privacy override, no notification/minimal trace.
6748 optional bool privacy_override = 6;
6749
6750 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6751 // seconds.
6752 optional int32 timeout = 7;
6753
6754 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006755 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006756
6757 // String representing the requester of the network inititated location request.
6758 optional string requestor_id = 9;
6759
6760 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6761 // network initiated location request.
6762 optional string text = 10;
6763
6764 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006765 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006766
6767 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006768 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006769
6770 // True if SUPL ES is enabled.
6771 optional bool is_supl_es_enabled = 13;
6772
6773 // True if GNSS location is enabled.
6774 optional bool is_location_enabled = 14;
6775
6776 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006777 optional android.server.location.GnssUserResponseType user_response = 15;
6778}
6779
6780/**
6781 * Logs GNSS non-framework (NFW) location notification.
6782 *
6783 * Logged from:
6784 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6785 */
6786message GnssNfwNotificationReported {
6787 // Package name of the Android proxy application representing the non-framework entity that
6788 // requested location. Set to empty string if unknown.
6789 optional string proxy_app_package_name = 1;
6790
6791 // Protocol stack that initiated the non-framework location request.
6792 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6793
6794 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6795 // set to empty string. This field is opaque to the framework and used for logging purposes.
6796 optional string other_protocol_stack_name = 3;
6797
6798 // Source initiating/receiving the location information.
6799 optional android.server.location.NfwRequestor requestor = 4;
6800
6801 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6802 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6803 // and used for logging purposes.
6804 optional string requestor_id = 5;
6805
6806 // Indicates whether location information was provided for this request.
6807 optional android.server.location.NfwResponseType response_type = 6;
6808
6809 // True if the device is in user initiated emergency session.
6810 optional bool in_emergency_mode = 7;
6811
6812 // True if cached location is provided.
6813 optional bool is_cached_location = 8;
6814
6815 // True if proxy app permission mismatch between framework and GNSS HAL.
6816 optional bool is_permission_mismatched = 9;
6817}
6818
6819/**
6820 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6821 *
6822 * Logged from:
6823 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6824 */
6825message GnssConfigurationReported {
6826 // SUPL host name.
6827 optional string supl_host = 1;
6828
6829 // SUPL port number.
6830 optional int32 supl_port = 2;
6831
6832 // C2K host name.
6833 optional string c2k_host = 3;
6834
6835 // C2K port number.
6836 optional int32 c2k_port = 4;
6837
6838 // The SUPL version requested by Carrier.
6839 optional int32 supl_ver = 5;
6840
6841 // The SUPL mode.
6842 optional android.server.location.SuplMode supl_mode = 6;
6843
6844 // True if NI emergency SUPL restrictions is enabled.
6845 optional bool supl_es = 7;
6846
6847 // LTE Positioning Profile settings
6848 optional android.server.location.LppProfile lpp_profile = 8;
6849
6850 // Positioning protocol on A-Glonass system.
6851 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6852
6853 // True if emergency PDN is used. Otherwise, regular PDN is used.
6854 optional bool use_emergency_pdn_for_emergency_supl= 10;
6855
6856 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6857 optional android.server.location.GpsLock gps_lock = 11;
6858
6859 // Number of seconds to extend the emergency session duration post emergency call.
6860 optional int32 es_extension_sec = 12;
6861
6862 // The full list of package names of proxy Android applications representing the non-framework
6863 // location access entities (on/off the device) for which the framework user has granted
6864 // non-framework location access permission. The package names are concatenated in one string
6865 // with spaces as separators.
6866 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006867}
Jack Yu95b64f32018-12-13 18:26:11 +08006868
6869/**
6870 * Logs when a NFC device's error occurred.
6871 * Logged from:
6872 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6873 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6874 */
6875message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006876 enum Type {
6877 UNKNOWN = 0;
6878 CMD_TIMEOUT = 1;
6879 ERROR_NOTIFICATION = 2;
6880 AID_OVERFLOW = 3;
6881 }
6882 optional Type type = 1;
6883 // If it's nci cmd timeout, log the timeout command.
6884 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006885
Alex Salod7c3eef2019-01-25 14:43:27 -08006886 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006887}
6888
6889/**
6890 * Logs when a NFC device's state changed event
6891 * Logged from:
6892 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6893 */
6894message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006895 enum State {
6896 UNKNOWN = 0;
6897 OFF = 1;
6898 ON = 2;
6899 ON_LOCKED = 3; // Secure Nfc enabled.
6900 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6901 }
6902 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006903}
6904
6905/**
6906 * Logs when a NFC Beam Transaction occurred.
6907 * Logged from:
6908 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6909 */
6910message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006911 enum Operation {
6912 UNKNOWN = 0;
6913 SEND = 1;
6914 RECEIVE = 2;
6915 }
6916 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006917}
6918
6919/**
6920 * Logs when a NFC Card Emulation Transaction occurred.
6921 * Logged from:
6922 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6923 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6924 */
6925message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006926 enum Category {
6927 UNKNOWN = 0;
6928 HCE_PAYMENT = 1;
6929 HCE_OTHER = 2;
6930 OFFHOST = 3;
6931 }
6932 // Transaction belongs to HCE payment or HCE other category, or offhost.
6933 optional Category category = 1;
6934 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6935 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006936}
6937
6938/**
6939 * Logs when a NFC Tag event occurred.
6940 * Logged from:
6941 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6942 */
6943message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006944 enum Type {
6945 UNKNOWN = 0;
6946 URL = 1;
6947 BT_PAIRING = 2;
6948 PROVISION = 3;
6949 WIFI_CONNECT = 4;
6950 APP_LAUNCH = 5;
6951 OTHERS = 6;
6952 }
6953 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006954}
6955
6956/**
6957 * Logs when Hce transaction triggered
6958 * Logged from:
6959 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6960 */
6961message NfcHceTransactionOccurred {
6962 // The latency period(in microseconds) it took for the first HCE data
6963 // exchange.
6964 optional uint32 latency_micros = 1;
6965}
6966
6967/**
6968 * Logs when SecureElement state event changed
6969 * Logged from:
6970 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6971 */
6972message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006973 enum State {
6974 UNKNOWN = 0;
6975 INITIALIZED = 1;
6976 DISCONNECTED = 2;
6977 CONNECTED = 3;
6978 HALCRASH = 4;
6979 }
6980 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006981
Alex Salod7c3eef2019-01-25 14:43:27 -08006982 optional string state_change_reason = 2;
6983 // SIMx or eSEx.
6984 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006985}
6986
6987/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006988 * Information about a permission grant request
6989 */
6990message PermissionGrantRequestResultReported {
6991 // unique value identifying an API call. A API call might result in multiple of these atoms
6992 optional int64 request_id = 1;
6993
6994 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006995 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006996
6997 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006998 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006999
7000 // The permission to be granted
7001 optional string permission_name = 4;
7002
7003 // If the permission was explicitly requested via the API or added by the system
7004 optional bool is_implicit = 5;
7005
7006 enum Result {
7007 UNDEFINED = 0;
7008 // permission request was ignored
7009 IGNORED = 1;
7010 // permission request was ignored because it was user fixed
7011 IGNORED_USER_FIXED = 2;
7012 // permission request was ignored because it was policy fixed
7013 IGNORED_POLICY_FIXED = 3;
7014 // permission was granted by user action
7015 USER_GRANTED = 4;
7016 // permission was automatically granted
7017 AUTO_GRANTED = 5;
7018 // permission was denied by user action
7019 USER_DENIED = 6;
7020 // permission was denied with prejudice by the user
7021 USER_DENIED_WITH_PREJUDICE = 7;
7022 // permission was automatically denied
7023 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007024 // permission request was ignored because permission is restricted
7025 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007026 // one time permission was granted by user action
7027 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007028 // user ignored request by leaving the request screen without choosing any option
7029 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007030 // user granted the permission after being linked to settings
7031 USER_GRANTED_IN_SETTINGS = 12;
7032 // user denied the permission after being linked to settings
7033 USER_DENIED_IN_SETTINGS = 13;
7034 // user denied the permission with prejudice after being linked to settings
7035 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7036 // permission was automatically revoked after one-time permission expired
7037 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007038 // permission was automatically revoked for unused app
7039 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007040 }
7041 // The result of the permission grant
7042 optional Result result = 6;
7043}
7044
7045/**
Jack Yu95b64f32018-12-13 18:26:11 +08007046 * Logs when Omapi API used
7047 * Logged from:
7048 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7049 */
7050message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007051 enum Operation {
7052 UNKNOWN = 0;
7053 OPEN_CHANNEL = 1;
7054 }
7055 optional Operation operation = 1;
7056 // SIMx or eSEx.
7057 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007058
Alex Salod7c3eef2019-01-25 14:43:27 -08007059 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007060}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007061
7062/**
Alex Saloa060aee2019-01-21 14:36:41 -08007063 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7064 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007065 * Logged from:
7066 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7067 */
7068message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007069 optional int64 dispatch_latency_millis = 1;
7070}
7071
7072/**
7073 * Logs AttentionManagerService attention check result.
7074 *
7075 * Logged from:
7076 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7077 */
7078message AttentionManagerServiceResultReported {
7079 // See core/java/android/service/attention/AttentionService.java
7080 enum AttentionCheckResult {
7081 UNKNOWN = 20;
7082 ATTENTION_SUCCESS_ABSENT = 0;
7083 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007084 ATTENTION_FAILURE_UNKNOWN = 2;
7085 ATTENTION_FAILURE_CANCELLED = 3;
7086 ATTENTION_FAILURE_PREEMPTED = 4;
7087 ATTENTION_FAILURE_TIMED_OUT = 5;
7088 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007089 }
7090 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007091}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007092
7093/**
7094 * Logs when an adb connection changes state.
7095 *
7096 * Logged from:
7097 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7098 */
7099message AdbConnectionChanged {
7100 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7101 // previously selected for this system.
7102 optional int64 last_connection_time_millis = 1;
7103
7104 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7105 // to reconnect via adb without user interaction.
7106 optional int64 auth_window_millis = 2;
7107
7108 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7109 optional android.debug.AdbConnectionStateEnum state = 3;
7110
7111 // True if the 'always allow' option was selected for this system.
7112 optional bool always_allow = 4;
7113}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007114
7115/*
7116 * Logs the reported speech DSP status.
7117 *
7118 * Logged from:
7119 * Vendor audio implementation.
7120 */
7121message SpeechDspStatReported {
7122 // The total Speech DSP uptime in milliseconds.
7123 optional int32 total_uptime_millis = 1;
7124 // The total Speech DSP downtime in milliseconds.
7125 optional int32 total_downtime_millis = 2;
7126 optional int32 total_crash_count = 3;
7127 optional int32 total_recover_count = 4;
7128}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007129
7130/**
7131 * Logs USB connector contaminant status.
7132 *
7133 * Logged from: USB Service.
7134 */
7135message UsbContaminantReported {
7136 optional string id = 1;
7137 optional android.service.usb.ContaminantPresenceStatus status = 2;
7138}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007139
7140/**
7141 * This atom is for debugging purpose.
7142 */
7143message DebugElapsedClock {
7144 // Monotically increasing value for each pull.
7145 optional int64 pull_count = 1;
7146 // Time from System.elapsedRealtime.
7147 optional int64 elapsed_clock_millis = 2;
7148 // Time from System.elapsedRealtime.
7149 optional int64 same_elapsed_clock_millis = 3;
7150 // Diff between current elapsed time and elapsed time from previous pull.
7151 optional int64 elapsed_clock_diff_millis = 4;
7152
7153 enum Type {
7154 TYPE_UNKNOWN = 0;
7155 ALWAYS_PRESENT = 1;
7156 PRESENT_ON_ODD_PULLS = 2;
7157 }
7158 // Type of behavior for the pulled data.
7159 optional Type type = 5;
7160}
7161
7162/**
7163 * This atom is for debugging purpose.
7164 */
7165message DebugFailingElapsedClock {
7166 // Monotically increasing value for each pull.
7167 optional int64 pull_count = 1;
7168 // Time from System.elapsedRealtime.
7169 optional int64 elapsed_clock_millis = 2;
7170 // Time from System.elapsedRealtime.
7171 optional int64 same_elapsed_clock_millis = 3;
7172 // Diff between current elapsed time and elapsed time from previous pull.
7173 optional int64 elapsed_clock_diff_millis = 4;
7174}
Steven Wuacef6bb2019-01-23 14:21:17 -05007175
7176/** Logs System UI bubbles event changed.
7177 *
7178 * Logged from:
7179 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7180 */
7181message BubbleUIChanged {
7182
7183 // The app package that is posting the bubble.
7184 optional string package_name = 1;
7185
7186 // The notification channel that is posting the bubble.
7187 optional string notification_channel = 2;
7188
7189 // The notification id associated with the posted bubble.
7190 optional int32 notification_id = 3;
7191
7192 // The position of the bubble within the bubble stack.
7193 optional int32 position = 4;
7194
7195 // The total number of bubbles within the bubble stack.
7196 optional int32 total_number = 5;
7197
7198 // User interactions with the bubble.
7199 enum Action {
7200 UNKNOWN = 0;
7201 POSTED = 1;
7202 UPDATED = 2;
7203 EXPANDED = 3;
7204 COLLAPSED = 4;
7205 DISMISSED = 5;
7206 STACK_DISMISSED = 6;
7207 STACK_MOVED = 7;
7208 HEADER_GO_TO_APP = 8;
7209 HEADER_GO_TO_SETTINGS = 9;
7210 PERMISSION_OPT_IN = 10;
7211 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007212 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007213 SWIPE_LEFT = 13;
7214 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007215 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04007216 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007217 }
7218 optional Action action = 6;
7219
7220 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7221 optional float normalized_x_position = 7;
7222 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007223
7224 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7225 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007226
7227 // Whether the bubble is an on-going one.
7228 optional bool is_ongoing = 10;
7229
7230 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007231 // This is deprecated and the value should be ignored.
7232 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007233}
Kweku Adams8845d012018-12-11 20:06:45 -08007234
7235/**
Steven Wu552f63f2019-02-05 13:41:36 -05007236 * Logs System UI bubbles developer errors.
7237 *
7238 * Logged from:
7239 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7240 */
7241message BubbleDeveloperErrorReported {
7242
7243 // The app package that is posting the bubble.
7244 optional string package_name = 1;
7245
7246 // Bubble developer error type enums.
7247 enum Error {
7248 UNKNOWN = 0;
7249 ACTIVITY_INFO_MISSING = 1;
7250 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7251 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7252 }
7253 optional Error error = 2 [default = UNKNOWN];
7254}
7255
7256/**
Kweku Adams8845d012018-12-11 20:06:45 -08007257 * Logs that a constraint for a scheduled job has changed.
7258 *
7259 * Logged from:
7260 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7261 */
7262message ScheduledJobConstraintChanged {
7263 repeated AttributionNode attribution_node = 1;
7264
7265 // Name of the job.
7266 optional string job_name = 2;
7267
7268 optional com.android.server.job.ConstraintEnum constraint = 3;
7269
7270 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007271 UNKNOWN = 0;
7272 UNSATISFIED = 1;
7273 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007274 }
7275 optional State state = 4;
7276}
Alex Salod7c3eef2019-01-25 14:43:27 -08007277
7278/**
7279 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7280 * returns true.
7281 *
7282 * Logged from:
7283 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7284 */
7285message ScreenTimeoutExtensionReported {
7286 // Describes how many times in a row did the power manager reset the screen off timeout.
7287 optional uint32 consecutive_timeout_extended_count = 1;
7288}
Hui Yu885aca12019-01-10 17:11:34 -08007289
7290/*
7291* Logs number of milliseconds it takes to start a process.
7292* The definition of app process start time is from the app launch time to
7293* the time that Zygote finished forking the app process and loaded the
7294* application package's java classes.
7295
7296* This metric is different from AppStartOccurred which is for foreground
7297* activity only.
7298
7299* ProcessStartTime can report all processes (both foreground and background)
7300* start time.
7301*
7302* Logged from:
7303* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7304*/
7305message ProcessStartTime {
7306 // The uid of the ProcessRecord.
7307 optional int32 uid = 1 [(is_uid) = true];
7308
7309 // The process pid.
7310 optional int32 pid = 2;
7311
7312 // The process name.
7313 // Usually package name, "system" for system server.
7314 // Provided by ActivityManagerService.
7315 optional string process_name = 3;
7316
7317 enum StartType {
7318 UNKNOWN = 0;
7319 WARM = 1;
7320 HOT = 2;
7321 COLD = 3;
7322 }
7323
7324 // The start type.
7325 optional StartType type = 4;
7326
7327 // The elapsed realtime at the start of the process.
7328 optional int64 process_start_time_millis = 5;
7329
7330 // Number of milliseconds it takes to reach bind application.
7331 optional int32 bind_application_delay_millis = 6;
7332
7333 // Number of milliseconds it takes to finish start of the process.
7334 optional int32 process_start_delay_millis = 7;
7335
7336 // hostingType field in ProcessRecord, the component type such as "activity",
7337 // "service", "content provider", "broadcast" or other strings.
7338 optional string hosting_type = 8;
7339
7340 // hostingNameStr field in ProcessRecord. The component class name that runs
7341 // in this process.
7342 optional string hosting_name = 9;
7343}
7344
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007345/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007346 * Track Media Codec usage
7347 * Logged from:
7348 * frameworks/av/media/libstagefright/MediaCodec.cpp
7349 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7350 */
7351message MediametricsCodecReported {
7352 optional int64 timestamp_nanos = 1;
7353 optional string package_name = 2;
7354 optional int64 package_version_code = 3;
7355 optional int64 media_apex_version = 4;
7356
7357 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7358}
7359
7360/**
7361 * Track Media Extractor (pulling video/audio streams out of containers) usage
7362 * Logged from:
7363 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7364 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7365 */
7366message MediametricsExtractorReported {
7367 optional int64 timestamp_nanos = 1;
7368 optional string package_name = 2;
7369 optional int64 package_version_code = 3;
7370 optional int64 media_apex_version = 4;
7371
7372 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7373}
7374
7375/**
7376 * Track how we arbitrate between microphone/input requests.
7377 * Logged from
7378 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7379 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7380 */
7381message MediametricsAudiopolicyReported {
7382 optional int64 timestamp_nanos = 1;
7383 optional string package_name = 2;
7384 optional int64 package_version_code = 3;
7385 optional int64 media_apex_version = 4;
7386
7387 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7388}
7389
7390/**
7391 * Track how we arbitrate between microphone requests.
7392 * Logged from
7393 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7394 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7395 */
7396message MediametricsAudiorecordReported {
7397 optional int64 timestamp_nanos = 1;
7398 optional string package_name = 2;
7399 optional int64 package_version_code = 3;
7400 optional int64 media_apex_version = 4;
7401
7402 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7403}
7404
7405/**
7406 * Track how we arbitrate between microphone/input requests.
7407 * Logged from
7408 * frameworks/av/media/libnblog/ReportPerformance.cpp
7409 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7410 */
7411message MediametricsAudiothreadReported {
7412 optional int64 timestamp_nanos = 1;
7413 optional string package_name = 2;
7414 optional int64 package_version_code = 3;
7415 optional int64 media_apex_version = 4;
7416
7417 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7418}
7419
7420/**
7421 * Track how we arbitrate between microphone/input requests.
7422 * Logged from
7423 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7424 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7425 */
7426message MediametricsAudiotrackReported {
7427 optional int64 timestamp_nanos = 1;
7428 optional string package_name = 2;
7429 optional int64 package_version_code = 3;
7430 optional int64 media_apex_version = 4;
7431
7432 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7433}
7434
7435/**
7436 * Track information about DRM framework performance
7437 * Logged from
7438 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7439 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7440 */
7441message MediametricsMediadrmReported {
7442 optional int64 timestamp_nanos = 1;
7443 optional string package_name = 2;
7444 optional int64 package_version_code = 3;
7445 optional int64 media_apex_version = 4;
7446
7447 // vendor+description tell about which DRM plugin is in use on this device
7448 optional string vendor = 5;
7449 optional string description = 6;
7450 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7451 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7452}
7453
7454/**
7455 * Track information about the widevine DRM plugin performance
7456 * Logged from
7457 * vendor/widevine/libwvdrmengine/cdm/metrics
7458 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7459 */
7460message MediametricsDrmWidevineReported {
7461 optional int64 timestamp_nanos = 1;
7462 optional string package_name = 2;
7463 optional int64 package_version_code = 3;
7464 optional int64 media_apex_version = 4;
7465
7466 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7467}
7468
7469/**
7470 * Track information about recordings (e.g. camcorder)
7471 * Logged from
7472 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7473 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7474 */
7475message MediametricsRecorderReported {
7476 optional int64 timestamp_nanos = 1;
7477 optional string package_name = 2;
7478 optional int64 package_version_code = 3;
7479 optional int64 media_apex_version = 4;
7480
7481 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7482}
7483
7484/**
7485 * Track Media Player usage
7486 * Logged from:
7487 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7488 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7489 */
7490message MediametricsNuPlayerReported {
7491 optional int64 timestamp_nanos = 1;
7492 optional string package_name = 2;
7493 optional int64 package_version_code = 3;
7494 optional int64 media_apex_version = 4;
7495
7496 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7497}
7498
7499/**
Robert Shiha4beed32019-08-19 14:15:23 -07007500 * Track Legacy DRM usage
7501 * Logged from
7502 * frameworks/av/drm/drmserver/DrmManager.cpp
7503 */
7504message MediametricsDrmManagerReported {
7505 optional int64 timestamp_nanos = 1;
7506 optional string package_name = 2;
7507 optional int64 package_version_code = 3;
7508 optional int64 media_apex_version = 4;
7509
7510 enum Method {
7511 METHOD_NOT_FOUND = -1;
7512 GET_CONSTRAINTS = 0;
7513 GET_METADATA = 1;
7514 CAN_HANDLE = 2;
7515 PROCESS_DRM_INFO = 3;
7516 ACQUIRE_DRM_INFO = 4;
7517 SAVE_RIGHTS = 5;
7518 GET_ORIGINAL_MIME_TYPE = 6;
7519 GET_DRM_OBJECT_TYPE = 7;
7520 CHECK_RIGHTS_STATUS = 8;
7521 REMOVE_RIGHTS = 9;
7522 REMOVE_ALL_RIGHTS = 10;
7523 OPEN_CONVERT_SESSION = 11;
7524 OPEN_DECRYPT_SESSION = 12;
7525 }
7526
7527 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7528 optional string plugin_id = 5;
7529 optional string description = 6;
7530 optional Method method = 7;
7531 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007532
7533 optional int64 get_constraints_count = 9;
7534 optional int64 get_metadata_count = 10;
7535 optional int64 can_handle_count = 11;
7536 optional int64 process_drm_info_count = 12;
7537 optional int64 acquire_drm_info_count = 13;
7538 optional int64 save_rights_count = 14;
7539 optional int64 get_original_mime_type_count = 15;
7540 optional int64 get_drm_object_type_count = 16;
7541 optional int64 check_rights_status_count = 17;
7542 optional int64 remove_rights_count = 18;
7543 optional int64 remove_all_rights_count = 19;
7544 optional int64 open_convert_session_count = 20;
7545 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007546}
7547
7548/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007549 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007550 * Pulled from: StatsCompanionService
7551*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007552message DangerousPermissionState {
7553 // Name of the permission
7554 optional string permission_name = 1;
7555
7556 // Uid of the package
7557 optional int32 uid = 2 [(is_uid) = true];
7558
7559 // Package requesting the permission
7560 optional string package_name = 3;
7561
7562 // If the permission is granted to the uid
7563 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007564
7565 // Permission flags as per android.content.pm.PermissionFlags
7566 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007567}
7568
Michael Groover4a0ca942019-01-24 17:41:25 -08007569/**
7570 * Logs when a package is denied access to a device identifier based on the new access requirements.
7571 *
7572 * Logged from:
7573 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7574 */
7575message DeviceIdentifierAccessDenied {
7576 // The name of the package denied access to the requested device identifier.
7577 optional string package_name = 1;
7578
7579 // The name of the device identifier method the package attempted to invoke.
7580 optional string method_name = 2;
7581
7582 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007583 // Starting from Android 11, this boolean is not set and will always be false.
7584 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007585
7586 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007587 // Starting from Android 11, this boolean is not set and will always be false.
7588 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007589}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007590
7591/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007592 * Pulls the ongoing mainline install train version code.
7593 * Pulled from StatsCompanionService
7594 */
7595message TrainInfo {
7596 optional int64 train_version_code = 1;
7597
7598 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007599
7600 optional string train_name = 3;
7601
7602 enum Status {
7603 UNKNOWN = 0;
7604 INSTALL_REQUESTED = 1;
7605 INSTALL_STARTED = 2;
7606 INSTALL_STAGED_NOT_READY = 3;
7607 INSTALL_STAGED_READY = 4;
7608 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007609 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7610 // and INSTALL_FAILURE_COMMIT.
7611 INSTALL_FAILURE = 6 [deprecated = true];
7612 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007613 INSTALL_CANCELLED = 7;
7614 INSTALLER_ROLLBACK_REQUESTED = 8;
7615 INSTALLER_ROLLBACK_INITIATED = 9;
7616 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7617 INSTALLER_ROLLBACK_STAGED = 11;
7618 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7619 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7620 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7621 INSTALLER_ROLLBACK_SUCCESS = 15;
7622 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007623 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7624 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7625 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7626 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7627 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7628 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007629 INSTALL_FAILURE_DOWNLOAD = 23;
7630 INSTALL_FAILURE_STATE_MISMATCH = 24;
7631 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007632 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007633 }
7634 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007635}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007636
7637/**
7638 * Logs the gesture stage changed event.
7639 *
7640 * Logged from:
7641 * frameworks/base/packages/SystemUI/
7642 */
7643message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007644 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007645}
7646
7647/**
7648 * Logs the feedback type.
7649 *
7650 * Logged from:
7651 * frameworks/base/packages/SystemUI/
7652 */
7653message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007654 // Whether or not the gesture was used.
7655 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007656}
7657
7658/**
7659 * Logs the progress.
7660 *
7661 * Logged from:
7662 * frameworks/base/packages/SystemUI/
7663 */
7664message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007665 // [0,100] progress for the assist gesture.
7666 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007667}
Neil Fullerdb14b482019-02-05 19:44:44 +00007668
7669/*
7670 * Information about the time zone data on a device.
7671 */
7672message TimeZoneDataInfo {
7673 // A version identifier for the data set on device. e.g. "2018i"
7674 optional string tzdb_version = 1;
7675}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007676
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007677/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007678 * Logs the GPU stats global health information.
7679 *
7680 * Logged from:
7681 * frameworks/native/services/gpuservice/gpustats/
7682 */
7683message GpuStatsGlobalInfo {
7684 // Package name of the gpu driver.
7685 optional string driver_package_name = 1;
7686
7687 // Version name of the gpu driver.
7688 optional string driver_version_name = 2;
7689
7690 // Version code of the gpu driver.
7691 optional int64 driver_version_code = 3;
7692
7693 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7694 optional int64 driver_build_time = 4;
7695
7696 // Total count of the gl driver gets loaded.
7697 optional int64 gl_loading_count = 5;
7698
7699 // Total count of the gl driver fails to be loaded.
7700 optional int64 gl_loading_failure_count = 6;
7701
7702 // Total count of the Vulkan driver gets loaded.
7703 optional int64 vk_loading_count = 7;
7704
7705 // Total count of the Vulkan driver fails to be loaded.
7706 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007707
7708 // Api version of the system Vulkan driver.
7709 optional int32 vulkan_version = 9;
7710
7711 // Api version of the system CPU Vulkan driver.
7712 optional int32 cpu_vulkan_version = 10;
7713
7714 // Api version of the system GLES driver.
7715 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007716
7717 // Total count of the angle driver gets loaded.
7718 optional int64 angle_loading_count = 12;
7719
7720 // Total count of the angle driver fails to be loaded.
7721 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007722}
7723
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007724/**
7725 * GPU driver loading time info.
7726 */
7727message GpuDriverLoadingTime {
7728 // List of all the driver loading times for this app. The list size is
7729 // capped at 50.
7730 repeated int64 driver_loading_time = 1;
7731}
7732
7733/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007734 * Logs the GPU stats per app health information.
7735 *
7736 * Logged from:
7737 * frameworks/native/services/gpuservice/gpustats/
7738 */
7739message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007740 // Package name of the application that loads the gpu driver. Total number
7741 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007742 optional string app_package_name = 1;
7743
7744 // Version code of the gpu driver this app loads.
7745 optional int64 driver_version_code = 2;
7746
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007747 // gl driver loading time info.
7748 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7749 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007750
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007751 // Vulkan driver loading time info.
7752 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7753 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007754
7755 // Angle driver loading time info.
7756 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7757 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007758
7759 // CPU Vulkan implementation is in use.
7760 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007761
7762 // App is not doing pre-rotation correctly.
7763 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007764
7765 // App creates GLESv1 context.
7766 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007767}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007768
7769/*
7770 * Logs the size of the system ion heap.
7771 *
7772 * Pulled from StatsCompanionService.
7773 */
7774message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007775 // Deprecated due to limited support of ion stats in debugfs.
7776 // Use `IonHeapSize` instead.
7777 option deprecated = true;
7778
Rafal Slawikd4e87572019-03-12 13:08:38 +00007779 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007780 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007781 optional int64 size_in_bytes = 1;
7782}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007783
Rafal Slawik77987ed2019-06-17 12:28:23 +01007784/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007785 * Logs the total size of the ion heap.
7786 *
7787 * Pulled from StatsCompanionService.
7788 */
7789message IonHeapSize {
7790 // Total size of all ion heaps in kilobytes.
7791 // Read from: /sys/kernel/ion/total_heaps_kb.
7792 optional int32 total_size_kb = 1;
7793}
7794
7795/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007796 * Logs the per-process size of the system ion heap.
7797 *
7798 * Pulled from StatsCompanionService.
7799 */
7800message ProcessSystemIonHeapSize {
7801 // The uid if available. -1 means not available.
7802 optional int32 uid = 1 [(is_uid) = true];
7803
7804 // The process name (from /proc/PID/cmdline).
7805 optional string process_name = 2;
7806
7807 // Sum of sizes of all allocations.
7808 optional int32 total_size_in_kilobytes = 3;
7809
7810 // Number of allocations.
7811 optional int32 allocation_count = 4;
7812
7813 // Size of the largest allocation.
7814 optional int32 max_size_in_kilobytes = 5;
7815}
7816
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007817/**
7818 * Push network stack events.
7819 *
7820 * Log from:
7821 * frameworks/base/packages/NetworkStack/
7822 */
7823message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007824 // The id that indicates the event reported from NetworkStack.
7825 optional int32 event_id = 1;
7826 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007827 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7828}
Carmen Agimofa769c152019-03-04 14:39:14 +00007829
7830/**
7831 * Logs the apps that are installed on the external storage.
7832 * Pulled from:
7833 * StatsCompanionService
7834 */
7835message AppsOnExternalStorageInfo {
7836 // The type of the external storage.
7837 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7838 // The name of the package that is installed on the external storage.
7839 optional string package_name = 2;
7840}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007841
7842/**
7843 * Logs the settings related to Face.
7844 * Logged from:
7845 * frameworks/base/services/core/java/com/android/server/stats
7846 */
7847message FaceSettings {
7848 // Whether or not face unlock is allowed on Keyguard.
7849 optional bool unlock_keyguard_enabled = 1;
7850 // Whether or not face unlock dismisses the Keyguard.
7851 optional bool unlock_dismisses_keyguard = 2;
7852 // Whether or not face unlock requires attention.
7853 optional bool unlock_attention_required = 3;
7854 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7855 optional bool unlock_app_enabled = 4;
7856 // Whether or not face unlock always requires user confirmation.
7857 optional bool unlock_always_require_confirmation = 5;
7858 // Whether or not a diverse set of poses are required during enrollment.
7859 optional bool unlock_diversity_required = 6;
7860}
Maggie White442b6312019-04-05 16:26:44 -07007861
7862/**
7863 * Logs cooling devices maintained by the kernel.
7864 *
7865 * Pulled from StatsCompanionService.java
7866 */
7867message CoolingDevice {
7868 // The type of cooling device being reported. Eg. CPU, GPU...
7869 optional android.os.CoolingTypeEnum device_location = 1;
7870 // The name of the cooling device source. Eg. CPU0
7871 optional string device_name = 2;
7872 // Current throttle state of the cooling device. The value can any unsigned
7873 // integer between 0 and max_state defined in its driver. 0 means device is
7874 // not in throttling, higher value means deeper throttling.
7875 optional int32 state = 3;
7876}
Ben Blount763a5d52019-04-10 11:48:58 -07007877
7878/**
7879 * Intelligence has several counter-type events that don't warrant a
7880 * full separate atom. These are primarily API call counters but also include
7881 * counters for feature usage and specific failure modes.
7882 *
7883 * Logged from the Intelligence mainline module.
7884 */
7885message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007886 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007887 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007888 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007889 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007890 // How many times the event occured (to report a batch of high frequency events).
7891 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007892 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007893 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007894}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007895
7896/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007897 * Logs when Car Power state changed.
7898 *
7899 * Logged from:
7900 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7901 */
7902message CarPowerStateChanged {
7903 // States come from CpmsState in CarPowerManagementService.java.
7904 enum State {
7905 WAIT_FOR_VHAL = 0;
7906 ON = 1;
7907 SHUTDOWN_PREPARE = 2;
7908 WAIT_FOR_FINISH = 3;
7909 SUSPEND = 4;
7910 SIMULATE_SLEEP = 5;
7911 }
7912 optional State state = 1;
7913}
7914
7915/**
7916 * Logs whether GarageMode is entered.
7917 *
7918 * Logged from:
7919 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7920 */
7921message GarageModeInfo {
7922 // Whether GarageMode is entered.
7923 optional bool is_garage_mode = 1;
7924}
Martijn Coenencd95d462019-04-25 17:09:45 +02007925
7926/**
7927 * Historical app ops data per package.
7928 */
7929message AppOps {
7930 // Uid of the package requesting the op
7931 optional int32 uid = 1 [(is_uid) = true];
7932
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007933 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007934 optional string package_name = 2;
7935
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00007936 // operation id
7937 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007938
7939 // The number of times the op was granted while the app was in the
7940 // foreground (only for trusted requests)
7941 optional int64 trusted_foreground_granted_count = 4;
7942
7943 // The number of times the op was granted while the app was in the
7944 // background (only for trusted requests)
7945 optional int64 trusted_background_granted_count = 5;
7946
7947 // The number of times the op was rejected while the app was in the
7948 // foreground (only for trusted requests)
7949 optional int64 trusted_foreground_rejected_count = 6;
7950
7951 // The number of times the op was rejected while the app was in the
7952 // background (only for trusted requests)
7953 optional int64 trusted_background_rejected_count = 7;
7954
7955 // For long-running operations, total duration of the operation
7956 // while the app was in the foreground (only for trusted requests)
7957 optional int64 trusted_foreground_duration_millis = 8;
7958
7959 // For long-running operations, total duration of the operation
7960 // while the app was in the background (only for trusted requests)
7961 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007962
7963 // Whether AppOps is guarded by Runtime permission
7964 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007965}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007966
7967/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007968 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007969 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007970message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007971 // Uid of the package requesting the op
7972 optional int32 uid = 1 [(is_uid) = true];
7973
7974 // Name of the package performing the op
7975 optional string package_name = 2;
7976
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007977 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7978 // Attributions must be provided through manifest using <attribution> tag available in R and
7979 // above.
7980 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007981
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00007982 // operation id
7983 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007984
7985 // The number of times the op was granted while the app was in the
7986 // foreground (only for trusted requests)
7987 optional int64 trusted_foreground_granted_count = 5;
7988
7989 // The number of times the op was granted while the app was in the
7990 // background (only for trusted requests)
7991 optional int64 trusted_background_granted_count = 6;
7992
7993 // The number of times the op was rejected while the app was in the
7994 // foreground (only for trusted requests)
7995 optional int64 trusted_foreground_rejected_count = 7;
7996
7997 // The number of times the op was rejected while the app was in the
7998 // background (only for trusted requests)
7999 optional int64 trusted_background_rejected_count = 8;
8000
8001 // For long-running operations, total duration of the operation
8002 // while the app was in the foreground (only for trusted requests)
8003 optional int64 trusted_foreground_duration_millis = 9;
8004
8005 // For long-running operations, total duration of the operation
8006 // while the app was in the background (only for trusted requests)
8007 optional int64 trusted_background_duration_millis = 10;
8008
8009 // Whether AppOps is guarded by Runtime permission
8010 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008011
8012 // Sampling rate used on device, from 0 to 100
8013 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008014}
8015
8016/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008017 * Location Manager API Usage information(e.g. API under usage,
8018 * API call's parameters).
8019 * Logged from:
8020 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8021 */
8022message LocationManagerApiUsageReported {
8023
8024 // Indicating if usage starts or usage ends.
8025 optional android.stats.location.UsageState state = 1;
8026
8027 // LocationManagerService's API in use.
8028 // We can identify which API from LocationManager is
8029 // invoking current LMS API by the combination of
8030 // API parameter(e.g. is_listener_null, is_intent_null,
8031 // is_location_request_null)
8032 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8033
8034 // Name of the package calling the API.
8035 optional string calling_package_name = 3;
8036
8037 // Type of the location provider.
8038 optional android.stats.location.ProviderType provider = 4;
8039
8040 // Quality of the location request
8041 optional android.stats.location.LocationRequestQuality quality = 5;
8042
8043 // The desired interval for active location updates, in milliseconds.
8044 // Bucketized to reduce cardinality.
8045 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8046
8047 // Minimum distance between location updates, in meters.
8048 // Bucketized to reduce cardinality.
8049 optional android.stats.location.SmallestDisplacementBucket
8050 bucketized_smallest_displacement = 7;
8051
8052 // The number of location updates.
8053 optional int64 num_updates = 8;
8054
8055 // The request expiration time, in millisecond since boot.
8056 // Bucketized to reduce cardinality.
8057 optional android.stats.location.ExpirationBucket
8058 bucketized_expire_in = 9;
8059
8060 // Type of Callback passed in for this API.
8061 optional android.stats.location.CallbackType callback_type = 10;
8062
8063 // The radius of the central point of the alert
8064 // region, in meters. Only for API REQUEST_GEOFENCE.
8065 // Bucketized to reduce cardinality.
8066 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8067
8068 // Activity Importance of API caller.
8069 // Categorized to 3 types that are interesting from location's perspective.
8070 optional android.stats.location.ActivityImportance activiy_importance = 12;
8071}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008072
8073/**
8074 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8075 */
8076message ReviewPermissionsFragmentResultReported {
8077 // unique value identifying a permission group change. A permission group change might result
8078 // in multiple of these atoms
8079 optional int64 change_id = 1;
8080
8081 // UID of package the permission belongs to
8082 optional int32 uid = 2 [(is_uid) = true];
8083
8084 // Name of package the permission belongs to
8085 optional string package_name = 3;
8086
8087 // The permission to be granted
8088 optional string permission_name = 4;
8089
8090 // The result of the permission grant
8091 optional bool permission_granted = 5;
8092}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008093
8094/**
8095* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8096* Logged from: RuntimePermissionUpdgradeController
8097*/
8098message RuntimePermissionsUpgradeResult {
8099 // Permission granted as result of upgrade
8100 optional string permission_name = 1;
8101
8102 // UID of package granted permission
8103 optional int32 uid = 2 [(is_uid) = true];
8104
8105 // Name of package granted permission
8106 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008107}
8108
8109/**
8110* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8111*/
8112message GrantPermissionsActivityButtonActions {
8113 // Permission granted as result of upgrade
8114 optional string permission_group_name = 1;
8115
8116 // UID of package granted permission
8117 optional int32 uid = 2 [(is_uid) = true];
8118
8119 // Name of package requesting permission
8120 optional string package_name = 3;
8121
8122 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8123 // LABEL_ constants in GrantPermissionActivity.java
8124 optional int32 buttons_presented = 4;
8125
8126 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8127 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008128
8129 // id which identifies single session of user interacting with permission controller
8130 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008131}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008132
8133/**
8134 * Information about LocationAccessCheck notification presented to user
8135 */
8136message LocationAccessCheckNotificationAction {
8137
8138 // id which identifies single session of user interacting with permission controller
8139 optional int64 session_id = 1;
8140
8141 // Uid of package for which location access check is presented
8142 optional int32 package_uid = 2;
8143
8144 // Name of package for which location access check is presented
8145 optional string package_name = 3;
8146
8147 enum Result {
8148 UNDEFINED = 0;
8149 // notification was presented to the user
8150 NOTIFICATION_PRESENTED = 1;
8151 // notification was declined by the user
8152 NOTIFICATION_DECLINED = 2;
8153 // notification was clicked by the user
8154 NOTIFICATION_CLICKED = 3;
8155 }
8156
8157 // View / interaction recorded
8158 optional Result result = 4;
8159}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008160
8161/**
8162 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8163 */
8164message AppPermissionFragmentActionReported {
8165 // id which identifies single session of user interacting with permission controller
8166 optional int64 session_id = 1;
8167
8168 // unique value identifying a permission group change. A permission group change might result
8169 // in multiple of these atoms
8170 optional int64 change_id = 2;
8171
8172 // UID of package the permission belongs to
8173 optional int32 uid = 3 [(is_uid) = true];
8174
8175 // Name of package the permission belongs to
8176 optional string package_name = 4;
8177
8178 // The permission to be granted
8179 optional string permission_name = 5;
8180
8181 // The result of the permission grant
8182 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008183
8184 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8185 optional int32 permission_flags = 7;
8186
8187 enum Button {
8188 UNDEFINED = 0;
8189 // Allow button
8190 ALLOW = 1;
8191 // Deny button
8192 DENY = 2;
8193 // Ask every time button
8194 ASK_EVERY_TIME = 3;
8195 // Allow all the time button
8196 ALLOW_ALWAYS = 4;
8197 // Allow only while using the app button
8198 ALLOW_FOREGROUND = 5;
8199 // Same is Deny button but shown in while in use dialog
8200 DENY_FOREGROUND = 6;
8201 }
8202
8203 // Button pressed in the dialog
8204 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008205}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008206
8207/**
8208* Information about a AppPermissionFragment viewed by user
8209*/
8210message AppPermissionFragmentViewed {
8211 // id which identifies single session of user interacting with permission controller
8212 optional int64 session_id = 1;
8213
8214 // UID of package for which permissions are viewed
8215 optional int32 uid = 2 [(is_uid) = true];
8216
8217 // Name of package for which permissions are viewed
8218 optional string package_name = 3;
8219
8220 // Permission group viewed
8221 optional string permission_group_name = 4;
8222}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008223
8224/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008225* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8226* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008227*/
8228message AppPermissionsFragmentViewed {
8229 // id which identifies single session of user interacting with permission controller
8230 optional int64 session_id = 1;
8231
8232 // id which identifies single view as every view might have several logging records
8233 // with different package information attached
8234 optional int64 view_id = 2;
8235
8236 // Permission group viewed
8237 optional string permission_group_name = 3;
8238
8239 // UID of package for which permissions are viewed
8240 optional int32 uid = 4 [(is_uid) = true];
8241
8242 // Name of package for which permissions are viewed
8243 optional string package_name = 5;
8244
8245 // Category in which permission is included
8246 enum Category {
8247 UNDEFINED = 0;
8248 ALLOWED = 1;
8249 ALLOWED_FOREGROUND = 2;
8250 DENIED = 3;
8251 }
8252 optional Category category = 6;
8253}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008254/**
8255* Information about a PermissionAppsFragment viewed by user.
8256* Logged from ui/handheld/PermissionAppsFragment.java
8257*/
8258message PermissionAppsFragmentViewed {
8259 // id which identifies single session of user interacting with permission controller
8260 optional int64 session_id = 1;
8261
8262 // id which identifies single view as every view might have several logging records
8263 // with different package information attached
8264 optional int64 view_id = 2;
8265
8266 // Permission group viewed
8267 optional string permission_group_name = 3;
8268
8269 // UID of package for which permissions are viewed
8270 optional int32 uid = 4 [(is_uid) = true];
8271
8272 // Name of package for which permissions are viewed
8273 optional string package_name = 5;
8274
8275 // Category in which app is included
8276 enum Category {
8277 UNDEFINED = 0;
8278 ALLOWED = 1;
8279 ALLOWED_FOREGROUND = 2;
8280 DENIED = 3;
8281 }
8282 optional Category category = 6;
8283}
Tony Make2b1b672019-07-29 16:59:47 +01008284
8285/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008286* Log that the Auto Revoke notification has been clicked
8287* Logged from ui/ManagePermissionsActivity
8288*/
8289message AutoRevokeNotificationClicked {
8290 // id which identifies single session of user interacting with permission controller
8291 optional int64 session_id = 1;
8292}
8293
8294/**
8295* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8296* auto revoked for it.
8297* Logged from ui/handheld/AutoRevokeFragment
8298*/
8299message AutoRevokeFragmentAppViewed {
8300 // id which identifies single session of user interacting with permission controller
8301 optional int64 session_id = 1;
8302
8303 // UID of package for which permissions are viewed
8304 optional int32 uid = 2 [(is_uid) = true];
8305
8306 // Name of package for which permissions are viewed
8307 optional string package_name = 3;
8308
8309 // The name of a permission group that has been revoked
8310 optional string permission_group_name = 4;
8311
8312 // The age of the app- more than three months old, or more than six months
8313 enum Age {
8314 UNDEFINED = 0;
8315 NEWER_BUCKET = 1;
8316 OLDER_BUCKET = 2;
8317 }
8318
8319 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8320 optional Age age = 5;
8321}
8322
8323/**
8324* Log that the user has interacted with an app on the auto revoke fragment
8325* Logged from ui/handheld/AutoRevokeFragment
8326*/
8327message AutoRevokedAppInteraction {
8328 // id which identifies single session of user interacting with permission controller
8329 optional int64 session_id = 1;
8330
8331 // UID of package for which permissions are viewed
8332 optional int32 uid = 2 [(is_uid) = true];
8333
8334 // Name of package for which permissions are viewed
8335 optional string package_name = 3;
8336
8337 enum Action {
8338 UNDEFINED = 0;
8339 REMOVE = 1;
8340 OPEN = 2;
8341 APP_INFO = 3;
8342 PERMISSIONS = 4;
8343 REMOVE_IN_SETTINGS = 5;
8344 OPEN_IN_SETTINGS = 6;
8345 }
8346
8347 // The action the user took to interact with the app
8348 optional Action action = 4;
8349}
8350
8351/**
8352* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8353* auto revoke, or that the auto revoke switch has been changed
8354* Logged from ui/handheld/AppPermissionGroupsFragment
8355 */
8356message AppPermissionGroupsFragmentAutoRevokeAction {
8357 // id which identifies single session of user interacting with permission controller
8358 optional int64 session_id = 1;
8359
8360 // UID of package for which permissions are viewed
8361 optional int32 uid = 2 [(is_uid) = true];
8362
8363 // Name of package for which permissions are viewed
8364 optional string package_name = 3;
8365
8366 enum Action {
8367 UNDEFINED = 0;
8368 OPENED_FOR_AUTO_REVOKE = 1;
8369 OPENED_FROM_INTENT = 2;
8370 SWITCH_ENABLED = 3;
8371 SWITCH_DISABLED = 4;
8372 }
8373
8374 // The action the user took to interact with the fragment
8375 optional Action action = 4;
8376}
8377
8378/**
Tony Make2b1b672019-07-29 16:59:47 +01008379 * Logs when there is a smart selection related event.
8380 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8381 * Logged from: TextClassifierEventLogger.java
8382 */
8383message TextSelectionEvent {
8384 // A session ID.
8385 optional string session_id = 1;
8386
8387 // Event type of this event.
8388 optional android.stats.textclassifier.EventType event_type = 2;
8389
Tony Mak9c84bd22019-12-09 07:27:25 +00008390 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008391 optional string model_name = 3;
8392
8393 // Type of widget that was involved in triggering this event.
8394 optional android.stats.textclassifier.WidgetType widget_type = 4;
8395
8396 // Index of this event in a session.
8397 optional int32 event_index = 5;
8398
8399 // Entity type that is involved.
8400 optional string entity_type = 6;
8401
8402 // Relative word index of the start of the selection.
8403 optional int32 relative_word_start_index = 7;
8404
8405 // Relative word (exclusive) index of the end of the selection.
8406 optional int32 relative_word_end_index = 8;
8407
8408 // Relative word index of the start of the smart selection.
8409 optional int32 relative_suggested_word_start_index = 9;
8410
8411 // Relative word (exclusive) index of the end of the smart selection.
8412 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008413
8414 // Name of source package.
8415 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008416
8417 // Name of the LangID model that is involved in this event.
8418 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008419}
8420
8421/**
8422 * Logs when there is a smart linkify related event.
8423 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8424 * Logged from: TextClassifierEventLogger.java
8425 */
8426message TextLinkifyEvent {
8427 // A session ID.
8428 optional string session_id = 1;
8429
8430 // Event type of this event.
8431 optional android.stats.textclassifier.EventType event_type = 2;
8432
Tony Mak9c84bd22019-12-09 07:27:25 +00008433 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008434 optional string model_name = 3;
8435
8436 // Type of widget that was involved in triggering this event.
8437 optional android.stats.textclassifier.WidgetType widget_type = 4;
8438
8439 // Index of this event in a session.
8440 optional int32 event_index = 5;
8441
8442 // Entity type that is involved.
8443 optional string entity_type = 6;
8444
8445 // Number of links detected.
8446 optional int32 num_links = 7;
8447
8448 // The total length of all links.
8449 optional int32 linked_text_length = 8;
8450
8451 // Length of input text.
8452 optional int32 text_length = 9;
8453
8454 // Time spent on generating links in ms.
8455 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008456
8457 // Name of source package.
8458 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008459
8460 // Name of the LangID model that is involved in this event.
8461 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008462}
8463
8464/**
8465 * Logs when there is a conversation actions related event.
8466 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8467 * Logged from: TextClassifierEventLogger.java
8468 */
8469message ConversationActionsEvent {
8470 // A session ID.
8471 optional string session_id = 1;
8472
8473 // Event type of this event.
8474 optional android.stats.textclassifier.EventType event_type = 2;
8475
Tony Mak9c84bd22019-12-09 07:27:25 +00008476 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008477 optional string model_name = 3;
8478
8479 // Type of widget that was involved in triggering this event.
8480 optional android.stats.textclassifier.WidgetType widget_type = 4;
8481
8482 // The first entity type that is involved.
8483 optional string first_entity_type = 5;
8484
8485 // The second entity type that is involved.
8486 optional string second_entity_type = 6;
8487
8488 // The third entity type that is involved.
8489 optional string third_entity_type = 7;
8490
8491 // The score of the first entity type.
8492 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008493
8494 // Name of source package.
8495 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008496
8497 // Name of the annotator model that is involved in this event.
8498 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008499
8500 // Name of the LangID model that is involved in this event.
8501 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008502}
8503
8504/**
8505 * Logs when there is a language detection related event.
8506 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8507 * Logged from: TextClassifierEventLogger.java
8508 */
8509message LanguageDetectionEvent {
8510 // A session ID.
8511 optional string session_id = 1;
8512
8513 // Event type of this event.
8514 optional android.stats.textclassifier.EventType event_type = 2;
8515
Tony Mak9c84bd22019-12-09 07:27:25 +00008516 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008517 optional string model_name = 3;
8518
8519 // Type of widget that was involved in triggering this event.
8520 optional android.stats.textclassifier.WidgetType widget_type = 4;
8521
8522 // Detected language.
8523 optional string language_tag = 5;
8524
8525 // Score of the detected language.
8526 optional float score = 6;
8527
8528 // Position of this action.
8529 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008530
8531 // Name of source package.
8532 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008533}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008534
8535/**
8536 * Information about an OTA update attempt by update_engine.
8537 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8538 */
8539message UpdateEngineUpdateAttemptReported {
8540 // The number of attempts for the update engine to apply a given payload.
8541 optional int32 attempt_number = 1;
8542
8543 optional android.stats.otaupdate.PayloadType payload_type = 2;
8544
8545 // The total time in minutes for the update engine to apply a given payload.
8546 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8547 // it's increased when the system is sleeping.
8548 optional int32 duration_boottime_in_minutes = 3;
8549
8550 // The total time in minutes for the update engine to apply a given payload.
8551 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8552 // and it's not increased when the system is sleeping.
8553 optional int32 duration_monotonic_in_minutes = 4;
8554
8555 // The size of the payload in MiBs.
8556 optional int32 payload_size_mib = 5;
8557
8558 // The attempt result reported by the update engine for an OTA update.
8559 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8560
8561 // The error code reported by the update engine after an OTA update attempt
8562 // on A/B devices.
8563 optional android.stats.otaupdate.ErrorCode error_code = 7;
8564
8565 // The build fingerprint of the source system. The value is read from a
8566 // system property when the device takes the update. e.g.
8567 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8568 optional string source_fingerprint = 8;
8569}
8570
8571/**
8572 * Information about all the attempts the device make before finishing the
8573 * successful update.
8574 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8575 */
8576message UpdateEngineSuccessfulUpdateReported {
8577 // The number of attempts for the update engine to apply the payload for a
8578 // successful update.
8579 optional int32 attempt_count = 1;
8580
8581 optional android.stats.otaupdate.PayloadType payload_type = 2;
8582
8583 optional int32 payload_size_mib = 3;
8584
8585 // The total number of bytes downloaded by update_engine since the last
8586 // successful update.
8587 optional int32 total_bytes_downloaded_mib = 4;
8588
8589 // The ratio in percentage of the over-downloaded bytes compared to the
8590 // total bytes needed to successfully install the update. e.g. 200 if we
8591 // download 200MiB in total for a 100MiB package.
8592 optional int32 download_overhead_percentage = 5;
8593
8594 // The total time in minutes for the update engine to apply the payload for a
8595 // successful update.
8596 optional int32 total_duration_minutes = 6;
8597
8598 // The number of reboot of the device during a successful update.
8599 optional int32 reboot_count = 7;
8600}
Alec Mourie088e762019-07-02 13:10:55 -07008601
8602/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008603 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8604 * key to indicate whether it was successful or not.
8605 *
8606 * Logged from:
8607 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8608 */
8609message RebootEscrowRecoveryReported {
8610 optional bool successful = 1;
8611}
8612
8613/**
Alec Mourie088e762019-07-02 13:10:55 -07008614 * Global display pipeline metrics reported by SurfaceFlinger.
8615 * Pulled from:
8616 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8617 */
8618message SurfaceflingerStatsGlobalInfo {
8619 // Total number of frames presented during the tracing period
8620 optional int64 total_frames = 1;
8621 // Total number of frames missed
8622 optional int64 missed_frames = 2;
8623 // Total number of frames that fell back to client composition
8624 optional int64 client_composition_frames = 3;
8625 // Total time the display was turned on
8626 optional int64 display_on_millis = 4;
8627 // Total time that was spent performing animations.
8628 // This is derived from the present-to-present layer histogram
8629 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008630 // Total number of event connections tracked by SurfaceFlinger at the time
8631 // of this pull. If this number grows prohibitively large, then this can
8632 // cause jank due to resource contention.
8633 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008634 // Set of timings measured from when SurfaceFlinger began compositing a
8635 // frame, until the frame was requested to be presented to the display. This
8636 // measures SurfaceFlinger's total CPU walltime on the critical path per
8637 // frame.
8638 optional FrameTimingHistogram frame_duration = 7
8639 [(android.os.statsd.log_mode) = MODE_BYTES];
8640 // Set of timings measured from when SurfaceFlinger first began using the
8641 // GPU to composite a frame, until the GPU has finished compositing that
8642 // frame. This measures the total additional time SurfaceFlinger needed to
8643 // perform due to falling back into GPU composition.
8644 optional FrameTimingHistogram render_engine_timing = 8
8645 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008646}
8647
8648/**
8649 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8650 * The number of layers uploaded will be restricted due to size limitations.
8651 * Pulled from:
8652 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8653 */
8654message SurfaceflingerStatsLayerInfo {
8655 // The layer for this set of metrics
8656 // For now we can infer that the package name is included in the layer
8657 // name.
8658 optional string layer_name = 1;
8659 // Total number of frames presented
8660 optional int64 total_frames = 2;
8661 // Total number of dropped frames while latching a buffer for this layer.
8662 optional int64 dropped_frames = 3;
8663 // Set of timings measured between successive presentation timestamps.
8664 optional FrameTimingHistogram present_to_present = 4
8665 [(android.os.statsd.log_mode) = MODE_BYTES];
8666 // Set of timings measured from when an app queued a buffer for
8667 // presentation, until the buffer was actually presented to the
8668 // display.
8669 optional FrameTimingHistogram post_to_present = 5
8670 [(android.os.statsd.log_mode) = MODE_BYTES];
8671 // Set of timings measured from when a buffer is ready to be presented,
8672 // until the buffer was actually presented to the display.
8673 optional FrameTimingHistogram acquire_to_present = 6
8674 [(android.os.statsd.log_mode) = MODE_BYTES];
8675 // Set of timings measured from when a buffer was latched by
8676 // SurfaceFlinger, until the buffer was presented to the display
8677 optional FrameTimingHistogram latch_to_present = 7
8678 [(android.os.statsd.log_mode) = MODE_BYTES];
8679 // Set of timings measured from the desired presentation to the actual
8680 // presentation time
8681 optional FrameTimingHistogram desired_to_present = 8
8682 [(android.os.statsd.log_mode) = MODE_BYTES];
8683 // Set of timings measured from when an app queued a buffer for
8684 // presentation, until the buffer was ready to be presented.
8685 optional FrameTimingHistogram post_to_acquire = 9
8686 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008687 // Frames missed latch because the acquire fence didn't fire
8688 optional int64 late_acquire_frames = 10;
8689 // Frames latched early because the desired present time was bad
8690 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008691}
8692
8693/**
8694 * Histogram of frame counts bucketed by time in milliseconds.
8695 * Because of size limitations, we hard-cap the number of buckets, with
8696 * buckets for corresponding to larger milliseconds being less precise.
8697 */
8698message FrameTimingHistogram {
8699 // Timings in milliseconds that describes a set of histogram buckets
8700 repeated int32 time_millis_buckets = 1;
8701 // Number of frames that match to each time_millis, i.e. the bucket
8702 // contents
8703 // It's required that len(time_millis) == len(frame_count)
8704 repeated int64 frame_counts = 2;
8705}
Emilian Peev6729f372019-08-29 09:14:09 -07008706
Emilian Peev6729f372019-08-29 09:14:09 -07008707/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008708 * Janky event as reported by SurfaceFlinger.
8709 * This event is intended to be consumed by a Perfetto subscriber for
8710 * automated trace collection.
8711 *
8712 * Logged from:
8713 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8714 */
8715message DisplayJankReported {
8716 // Informational field for how long the janky event lasted in milliseconds
8717 optional int64 event_duration_millis = 1;
8718 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8719 // the display on time.
8720 optional int32 present_deadlines_missed = 2;
8721}
8722
8723/**
Emilian Peev6729f372019-08-29 09:14:09 -07008724 * Information about camera facing and API level usage.
8725 * Logged from:
8726 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8727 */
8728message CameraActionEvent {
8729 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008730 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008731
8732 // Camera API level used
8733 optional int32 api_level = 2;
8734
8735 // Name of client package
8736 optional string package_name = 3;
8737
8738 // Camera facing
8739 enum Facing {
8740 UNKNOWN = 0;
8741 BACK = 1;
8742 FRONT = 2;
8743 EXTERNAL = 3;
8744 }
8745 optional Facing facing = 4;
8746}
atrost01a20932019-08-28 15:40:37 +01008747
8748/**
8749 * Logs when a compatibility change is affecting an app.
8750 *
8751 * Logged from:
8752 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8753 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8754 */
8755message AppCompatibilityChangeReported {
8756 // The UID of the app being affected by the compatibilty change.
8757 optional int32 uid = 1 [(is_uid) = true];
8758
8759 // The ID of the change affecting the app.
8760 optional int64 change_id = 2;
8761
8762 enum State {
8763 UNKNOWN_STATE = 0;
8764 ENABLED = 1;
8765 DISABLED = 2;
8766 LOGGED = 3;
8767 }
8768
8769 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8770 // logged otherwise.
8771 optional State state = 3;
8772
8773 enum Source {
8774 UNKNOWN_SOURCE = 0;
8775 APP_PROCESS = 1;
8776 SYSTEM_SERVER = 2;
8777 }
8778
8779 // Where it was logged from.
8780 optional Source source = 4;
8781
8782}
Hector Dearman40579f62019-11-01 13:19:30 +00008783
8784/**
8785 * Logged from
8786 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8787 */
8788message PerfettoUploaded {
8789 enum Event {
8790 PERFETTO_UNDEFINED = 0;
8791 PERFETTO_TRACE_BEGIN = 1;
8792 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8793 PERFETTO_ON_CONNECT = 3;
8794 PERFETTO_ON_TRACING_DISABLED = 4;
8795 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8796 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8797 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8798 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8799 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8800 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8801 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8802 PERFETTO_TRIGGER_BEGIN = 12;
8803 PERFETTO_TRIGGER_SUCCESS = 13;
8804 PERFETTO_TRIGGER_FAILURE = 14;
8805 PERFETTO_HIT_GUARDRAILS = 15;
8806 PERFETTO_ON_TIMEOUT = 16;
8807 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8808 }
8809
8810 // Which stage of the pipeline we are reporting from.
8811 optional Event event = 1;
8812
8813 // UUID matching the one set inside the SystemInfo trace packet.
8814 optional int64 trace_uuid_lsb = 2;
8815 optional int64 trace_uuid_msb = 3;
8816}
Mark Tabrya824a642019-11-05 12:26:12 -08008817
8818/**
8819 * Pulls client metrics on data transferred via Vehicle Maps Service.
8820 * Metrics are keyed by uid + layer.
8821 *
8822 * Pulled from:
8823 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8824 */
8825message VmsClientStats {
8826 // UID of the VMS client app
8827 optional int32 uid = 1 [(is_uid) = true];
8828
8829 // VMS layer definition
8830 optional int32 layer_type = 2;
8831 optional int32 layer_channel = 3;
8832 optional int32 layer_version = 4;
8833
8834 // Bytes and packets sent by the client for the layer
8835 optional int64 tx_bytes = 5;
8836 optional int64 tx_packets = 6;
8837
8838 // Bytes and packets received by the client for the layer
8839 optional int64 rx_bytes = 7;
8840 optional int64 rx_packets = 8;
8841
8842 // Bytes and packets dropped due to client error
8843 optional int64 dropped_bytes = 9;
8844 optional int64 dropped_packets = 10;
8845}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008846
8847/**
8848 * State of a dangerous permission requested by a package - sampled
8849 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8850*/
8851message DangerousPermissionStateSampled {
8852 // Name of the permission
8853 optional string permission_name = 1;
8854
8855 // Uid of the package
8856 optional int32 uid = 2 [(is_uid) = true];
8857
8858 // If the permission is granted to the uid
8859 optional bool is_granted = 3;
8860
8861 // Permission flags as per android.content.pm.PermissionFlags
8862 optional int32 permission_flags = 4;
8863}
8864
Stan Iliev637ba5e2019-08-16 13:43:08 -04008865/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008866 * HWUI stats for a given app.
8867 */
8868message GraphicsStats {
8869 // The package name of the app
8870 optional string package_name = 1;
8871
8872 // The version code of the app
8873 optional int64 version_code = 2;
8874
8875 // The start & end timestamps in UTC as
8876 // milliseconds since January 1, 1970
8877 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008878 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008879
Stan Ilievb6517192020-02-18 10:12:42 -05008880 optional int64 end_millis = 4;
8881
8882 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8883 enum PipelineType {
8884 UNKNOWN = 0;
8885 GL = 1;
8886 VULKAN = 2;
8887 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008888
8889 // HWUI renders pipeline type: GL or Vulkan.
8890 optional PipelineType pipeline = 5;
8891
8892 // Distinct frame count.
8893 optional int32 total_frames = 6;
8894
8895 // Number of "missed vsync" events.
8896 optional int32 missed_vsync_count = 7;
8897
8898 // Number of frames in triple-buffering scenario (high input latency)
8899 optional int32 high_input_latency_count = 8;
8900
8901 // Number of "slow UI thread" events.
8902 optional int32 slow_ui_thread_count = 9;
8903
8904 // Number of "slow bitmap upload" events.
8905 optional int32 slow_bitmap_upload_count = 10;
8906
8907 // Number of "slow draw" events.
8908 optional int32 slow_draw_count = 11;
8909
8910 // Number of frames that missed their deadline (aka, visibly janked)
8911 optional int32 missed_deadline_count = 12;
8912
8913 // The frame time histogram for the package
8914 optional FrameTimingHistogram cpu_histogram = 13
8915 [(android.os.statsd.log_mode) = MODE_BYTES];
8916
8917 // The gpu frame time histogram for the package
8918 optional FrameTimingHistogram gpu_histogram = 14
8919 [(android.os.statsd.log_mode) = MODE_BYTES];
8920
8921 // UI mainline module version.
8922 optional int64 version_ui_module = 15;
8923
8924 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8925 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8926 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8927 // more apps are running / rendering.
8928 optional bool is_today = 16;
8929}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008930
8931/**
8932 * Message related to dangerous (runtime) app ops access
8933 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008934message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008935 // Uid of the package accessing app op
8936 optional int32 uid = 1 [(is_uid) = true];
8937
8938 // Name of the package accessing app op
8939 optional string package_name = 2;
8940
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008941 // deprecated - set to empty string
8942 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008943
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008944 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008945 // API. Attributions must be provided through manifest using <attribution> tag available in R
8946 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008947 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008948
8949 // message related to app op access, limited to 600 chars by API
8950 optional string message = 5;
8951
8952 enum SamplingStrategy {
8953 DEFAULT = 0;
8954 UNIFORM = 1;
8955 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008956 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008957 }
8958
8959 // sampling strategy used to collect this message
8960 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008961
8962 // operation id
8963 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008964}
8965
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008966/*
8967 * Logs userspace reboot outcome and duration.
8968 *
8969 * Logged from:
8970 * frameworks/base/core/java/com/android/server/BootReceiver.java
8971 */
8972message UserspaceRebootReported {
8973 // Possible outcomes of userspace reboot.
8974 enum Outcome {
8975 // Default value in case platform failed to determine the outcome.
8976 OUTCOME_UNKNOWN = 0;
8977 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8978 SUCCESS = 1;
8979 // Userspace reboot shutdown sequence was aborted.
8980 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8981 // Remounting userdata into checkpointing mode failed.
8982 FAILED_USERDATA_REMOUNT = 3;
8983 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8984 // reboot.
8985 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8986 }
8987 // Outcome of userspace reboot. Always set.
8988 optional Outcome outcome = 1;
8989 // Duration of userspace reboot in case it has a successful outcome.
8990 // Duration is measured as time between userspace reboot was initiated and until boot completed
8991 // (e.g. sys.boot_completed=1).
8992 optional int64 duration_millis = 2;
8993 // State of primary user's (user0) credential encryption storage.
8994 enum UserEncryptionState {
8995 // Default value.
8996 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8997 // Credential encrypted storage is unlocked.
8998 UNLOCKED = 1;
8999 // Credential encrypted storage is locked.
9000 LOCKED = 2;
9001 }
9002 // State of primary user's encryption storage at the moment boot completed. Always set.
9003 optional UserEncryptionState user_encryption_state = 3;
9004}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009005
9006/*
9007 * Logs integrity check information during each install.
9008 *
9009 * Logged from:
9010 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9011 */
9012message IntegrityCheckResultReported {
9013 optional string package_name = 1;
9014 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009015 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009016 optional string installer_package_name = 4;
9017 enum Response {
9018 UNKNOWN = 0;
9019 ALLOWED = 1;
9020 REJECTED = 2;
9021 FORCE_ALLOWED = 3;
9022 }
9023 optional Response response = 5;
9024 // An estimate on the cause of the response. This will only be populated for
9025 // REJECTED and FORCE_ALLOWED
9026 optional bool caused_by_app_cert_rule = 6;
9027 optional bool caused_by_installer_rule = 7;
9028}
9029
9030/**
9031 * Logs the information about the rules and the provider whenever rules are
9032 * pushed into AppIntegrityManager.
9033 *
9034 * Logged from:
9035 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9036 */
9037message IntegrityRulesPushed {
9038 optional bool success = 1;
9039 // Package name of the app that pushed the rules.
9040 optional string rule_provider = 2;
9041 // Version string of arbitrary format provided by the rule provider to
9042 // identify the rules.
9043 optional string rule_version = 3;
9044}
Jordan Liubedfa702019-12-20 15:08:45 -08009045
9046/**
9047 * Logs when a cell broadcast message is received on the device.
9048 *
9049 * Logged from CellBroadcastService module:
9050 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9051 */
9052message CellBroadcastMessageReported {
9053 // The type of Cell Broadcast message
9054 enum CbType {
9055 UNKNOWN_TYPE = 0;
9056 GSM = 1;
9057 CDMA = 2;
9058 CDMA_SPC = 3;
9059 }
9060
9061 // GSM, CDMA, CDMA-SCP
9062 optional CbType type = 1;
9063}
9064
9065/**
9066 * Logs when an error occurs while handling a cell broadcast message;
9067 *
9068 * Logged from CellBroadcastService module:
9069 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9070 */
9071message CellBroadcastMessageError {
9072 // The type of error raised when trying to handle a cell broadcast message
9073 enum ErrorType {
9074 UNKNOWN_TYPE = 0;
9075 CDMA_DECODING_ERROR = 1;
9076 CDMA_SCP_EMPTY = 2;
9077 CDMA_SCP_HANDLING_ERROR = 3;
9078 GSM_INVALID_HEADER_LENGTH = 4;
9079 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9080 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9081 GSM_INVALID_PDU = 7;
9082 GSM_INVALID_GEO_FENCING_DATA = 8;
9083 GSM_UMTS_INVALID_WAC = 9;
9084 FAILED_TO_INSERT_TO_DB = 10;
9085 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9086 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9087 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9088 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9089 }
9090
9091 // What kind of error occurred
9092 optional ErrorType type = 1;
9093
9094 // Exception message (or log message) associated with the error (max 1000 chars)
9095 optional string exception_message = 2;
9096}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009097
9098/**
9099 * Logs when the SDK Extensions test app has polled the current version.
9100 * This is atom ID 354.
9101 *
9102 * Logged from:
9103 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
9104 */
9105message SdkExtensionStatus {
9106 enum ApiCallStatus {
9107 CALL_NOT_ATTEMPTED = 0;
9108 CALL_SUCCESSFUL = 1;
9109 CALL_FAILED = 2;
9110 }
9111
9112 optional ApiCallStatus result = 1;
9113
9114 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9115 optional int32 r_extension_version = 2;
9116
9117 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9118 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9119 optional int32 failed_call_symbol = 3;
9120}
Marco Ballesio497aff42020-01-24 08:39:42 -08009121
9122/**
9123 * Logs when an app is frozen or unfrozen.
9124 *
9125 * Logged from:
9126 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9127 */
9128message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009129 // The type of event.
9130 enum Action {
9131 UNKNOWN = 0;
9132 FREEZE_APP = 1;
9133 UNFREEZE_APP = 2;
9134 }
9135 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009136
Blake Kragten6ce382a2020-01-16 20:20:46 -08009137 // Pid of the process being frozen.
9138 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009139
Blake Kragten6ce382a2020-01-16 20:20:46 -08009140 // Name of the process being frozen.
9141 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009142
Blake Kragten6ce382a2020-01-16 20:20:46 -08009143 // Time since last unfrozen.
9144 optional int64 time_unfrozen_millis = 4;
9145}
9146
9147/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009148 * Pulls information for a single voice call.
9149 *
9150 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9151 *
9152 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009153 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009154 */
9155message VoiceCallSession {
9156 // Bearer (IMS or CS) when the call started.
9157 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9158
9159 // Bearer (IMS or CS) when the call ended.
9160 // The bearer may change during the call, e.g. due to SRVCC.
9161 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9162
9163 // Direction of the call (incoming or outgoing).
9164 optional android.telephony.CallDirectionEnum direction = 3;
9165
9166 // Time spent setting up the call.
9167 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9168
9169 // Whether the call ended before the setup was completed.
9170 optional bool setup_failed = 5;
9171
9172 // IMS reason code or CS disconnect cause.
9173 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9174 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9175 optional int32 disconnect_reason_code = 6;
9176
9177 // IMS extra code or CS precise disconnect cause.
9178 // For IMS, this code is vendor-specific
9179 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9180 optional int32 disconnect_extra_code = 7;
9181
9182 // IMS extra message or CS vendor cause.
9183 optional string disconnect_extra_message = 8;
9184
9185 // Radio access technology (RAT) used when call started.
9186 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9187
9188 // Radio access technology (RAT) used when call terminated.
9189 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9190
9191 // Number of times RAT changed during the call.
9192 optional int64 rat_switch_count = 11;
9193
9194 // A bitmask of all codecs used during the call.
9195 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9196 optional int64 codec_bitmask = 12;
9197
9198 // Number of other calls going on during call setup, for the same SIM slot.
9199 optional int32 concurrent_call_count_at_start = 13;
9200
9201 // Number of other calls going on during call termination, for the same SIM slot.
9202 optional int32 concurrent_call_count_at_end = 14;
9203
9204 // Index of the SIM is used, 0 for single-SIM devices.
9205 optional int32 sim_slot_index = 15;
9206
9207 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9208 optional bool is_multi_sim = 16;
9209
9210 // Whether the call was made with an eSIM profile.
9211 optional bool is_esim = 17;
9212
9213 // Carrier ID of the SIM card.
9214 // See https://source.android.com/devices/tech/config/carrierid.
9215 optional int32 carrier_id = 18;
9216
Chi Zhangba1b03a2020-04-21 17:17:56 -07009217 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009218 optional bool srvcc_completed = 19;
9219
9220 // Number of SRVCC failures.
9221 optional int64 srvcc_failure_count = 20;
9222
9223 // Number of SRVCC cancellations.
9224 optional int64 srvcc_cancellation_count = 21;
9225
Chi Zhangba1b03a2020-04-21 17:17:56 -07009226 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9227 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009228 optional bool rtt_enabled = 22;
9229
9230 // Whether this was an emergency call.
9231 optional bool is_emergency = 23;
9232
9233 // Whether the call was performed while roaming.
9234 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009235
9236 // A random number used as the dimension field to pull multiple atoms.
9237 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009238}
9239
9240/**
9241 * Pulls voice call radio access technology (RAT) usage.
9242 *
9243 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9244 * time. The atom will be skipped if not enough data is available.
9245 *
9246 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009247 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009248 */
9249message VoiceCallRatUsage {
9250 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9251 optional int32 carrier_id = 1;
9252
9253 // Radio access technology.
9254 optional android.telephony.NetworkTypeEnum rat = 2;
9255
9256 // Total duration that voice calls spent on this carrier and RAT.
9257 optional int64 total_duration_seconds = 3;
9258
9259 // Total number of calls using this carrier and RAT.
9260 // A call is counted once even if it used the RAT multiple times.
9261 optional int64 call_count = 4;
9262}
9263
9264/**
9265 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9266 *
9267 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009268 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009269 */
9270message SimSlotState {
9271 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9272 optional int32 active_slot_count = 1;
9273
9274 // Number of SIM cards (both physical and active eSIM profiles).
9275 // This number is always equal to or less than the number of active SIM slots.
9276 optional int32 sim_count = 2;
9277
9278 // Number of active eSIM profiles.
9279 // This number is always equal to or less than the number of SIMs.
9280 optional int32 esim_count = 3;
9281}
9282
9283/**
9284 * Pulls supported cellular radio access technologies.
9285 *
9286 * This atom reports the capabilities of the device, rather than the network it has access to.
9287 *
9288 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009289 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009290 */
9291message SupportedRadioAccessFamily {
9292 // A bitmask of supported radio technologies.
9293 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9294 optional int64 network_type_bitmask = 1;
9295}
9296
9297/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009298 * Logs gnss stats from location service provider
9299 *
9300 * Pulled from:
9301 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9302 */
9303
9304message GnssStats {
9305 // Number of location reports since boot
9306 optional int64 location_reports = 1;
9307
9308 // Total pulled reports of Location failures since boot
9309 optional int64 location_failure_reports = 2;
9310
9311 // Number of time to first fix reports since boot
9312 optional int64 time_to_first_fix_reports = 3;
9313
9314 // Total pulled reported time to first fix (in milli-seconds) since boot
9315 optional int64 time_to_first_fix_milli_s = 4;
9316
9317 // Number of position accuracy reports since boot
9318 optional int64 position_accuracy_reports = 5;
9319
9320 // Total pulled reported position accuracy (in meters) since boot
9321 optional int64 position_accuracy_meters = 6;
9322
9323 // Number of top 4 average CN0 reports since boot
9324 optional int64 top_four_average_cn0_reports = 7;
9325
9326 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9327 optional int64 top_four_average_cn0_db_mhz = 8;
9328
9329 // Number of l5 top 4 average CN0 reports since boot
9330 optional int64 l5_top_four_average_cn0_reports = 9;
9331
9332 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9333 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9334
9335 // Total number of sv status messages reports since boot
9336 optional int64 sv_status_reports = 11;
9337
9338 // Total number of sv status messages reports, where sv is used in fix since boot
9339 optional int64 sv_status_reports_used_in_fix = 12;
9340
9341 // Total number of L5 sv status messages reports since boot
9342 optional int64 l5_sv_status_reports = 13;
9343
9344 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9345 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009346}
Kweku Adams12752132020-02-18 15:36:48 -08009347
9348/**
9349 * Logs when an app is moved to a different standby bucket.
9350 *
9351 * Logged from:
9352 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9353 */
9354message AppStandbyBucketChanged {
9355 optional string package_name = 1;
9356
9357 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9358 optional int32 user_id = 2;
9359
9360 // These enum values match the constants defined in UsageStatsManager.java.
9361 enum Bucket {
9362 BUCKET_UNKNOWN = 0;
9363 BUCKET_EXEMPTED = 5;
9364 BUCKET_ACTIVE = 10;
9365 BUCKET_WORKING_SET = 20;
9366 BUCKET_FREQUENT = 30;
9367 BUCKET_RARE = 40;
9368 BUCKET_RESTRICTED = 45;
9369 BUCKET_NEVER = 50;
9370 }
9371 optional Bucket bucket = 3;
9372
9373 enum MainReason {
9374 MAIN_UNKNOWN = 0;
9375 MAIN_DEFAULT = 0x0100;
9376 MAIN_TIMEOUT = 0x0200;
9377 MAIN_USAGE = 0x0300;
9378 MAIN_FORCED_BY_USER = 0x0400;
9379 MAIN_PREDICTED = 0x0500;
9380 MAIN_FORCED_BY_SYSTEM = 0x0600;
9381 }
9382 optional MainReason main_reason = 4;
9383
9384 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9385 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9386 // UsageStatsManager.java.
9387 optional int32 sub_reason = 5;
9388}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009389
9390/**
9391* Reports a started sharesheet transaction.
9392*
9393* Logged from:
9394* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9395*/
9396message SharesheetStarted {
9397 // The event_id (as for UiEventReported).
9398 optional int32 event_id = 1;
9399 // The calling app's package name.
9400 optional string package_name = 2;
9401 // An identifier to tie together multiple logs relating to the same share event
9402 optional int32 instance_id = 3;
9403 // The mime type of the share
9404 optional string mime_type = 4;
9405 // The number of direct targets the calling app is providing that will be shown.
9406 optional int32 num_app_provided_direct_targets = 5;
9407 // The number of app targets the calling app is providing that will be shown.
9408 optional int32 num_app_provided_app_targets = 6;
9409 // True if the share originates from the workprofile
9410 optional bool is_workprofile = 7;
9411
9412 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009413 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009414 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9415 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9416 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9417 }
9418 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009419 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009420
9421 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9422 INTENT_DEFAULT = 0;
9423 INTENT_ACTION_VIEW = 1;
9424 INTENT_ACTION_EDIT = 2;
9425 INTENT_ACTION_SEND = 3;
9426 INTENT_ACTION_SENDTO = 4;
9427 INTENT_ACTION_SEND_MULTIPLE = 5;
9428 INTENT_ACTION_IMAGE_CAPTURE = 6;
9429 INTENT_ACTION_MAIN = 7;
9430 }
9431 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009432 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009433}
9434
9435/**
9436 * Reports a ranking selection event.
9437 *
9438 * Logged from:
9439 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9440 */
9441message RankingSelected {
9442 // The event_id (as for UiEventReported).
9443 optional int32 event_id = 1;
9444 // The relevant app's package name (can be source or picked package).
9445 optional string package_name = 2;
9446 // An identifier to tie together multiple logs relating to the same share event.
9447 optional int32 instance_id = 3;
9448 // Which of the ranked targets got picked, default starting position 0.
9449 optional int32 position_picked = 4;
9450}
Raff Tsaiea4db182020-03-06 07:45:43 +08009451
9452/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009453 * Logs when TvSettings UI is interacted at.
9454 *
9455 * Logged from: packages/apps/TvSettings
9456 */
9457message TvSettingsUIInteracted {
9458
9459 /** The UI action category */
9460 optional android.app.tvsettings.Action action = 1;
9461
9462 /** The ID of the entry that the users actioned on */
9463 optional android.app.tvsettings.ItemId item_id = 2;
9464
9465 /** Additional information (e.g., navigation direction on page focused) */
9466 optional string additional_info = 3;
9467}
9468
9469/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009470 * Logs information about a package installation using package installer V2 APIs.
9471 *
9472 * Logged from:
9473 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9474 */
9475message PackageInstallerV2Reported {
9476 // Whether this installation uses Incremental File System
9477 optional bool is_incremental = 1;
9478 // Name of the package that is intended to be installed
9479 optional string package_name = 2;
9480 // The duration between when the install was requested to when the install has completed
9481 optional int64 duration_millis = 3;
9482 // Installation result in final integer, which are SystemApi's.
9483 // Return_code 1 indicates success.
9484 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9485 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009486 // Total size of the APKs installed for this package
9487 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009488}
9489
9490/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009491 * Logs settings provider values.
9492 *
9493 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9494 * then write the value to proto.
9495 *
9496 */
9497message SettingSnapshot {
9498
9499 // Setting key
9500 optional string name = 1;
9501
9502 enum SettingsValueType {
9503 NOTASSIGNED = 0;
9504 ASSIGNED_BOOL_TYPE = 1;
9505 ASSIGNED_INT_TYPE = 2;
9506 ASSIGNED_FLOAT_TYPE = 3;
9507 ASSIGNED_STRING_TYPE = 4;
9508 };
9509 // Setting value type
9510 optional SettingsValueType type = 2;
9511
9512 optional bool bool_value = 3;
9513
9514 optional int32 int_value = 4;
9515
9516 optional float float_value = 5;
9517
9518 optional string str_value = 6;
9519
9520 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9521 optional int32 user_id = 7;
9522}
Varun Shahacb56342019-12-18 11:45:38 -08009523
9524/**
9525 * An event logged to indicate that a user journey is about to be performed. This atom includes
9526 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9527 * will immediately follow this atom which will describe the event(s) and its state.
9528 *
9529 * Logged from:
9530 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9531 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9532 */
9533message UserLifecycleJourneyReported {
9534 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9535 // UserLifecycleEventOccurred atom)
9536 optional int64 session_id = 1;
9537
9538 // Indicates what type of user journey this session is related to
9539 enum Journey {
9540 UNKNOWN = 0; // Undefined user lifecycle journey
9541 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9542 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9543 USER_START = 3; // A user start journey
9544 USER_CREATE = 4; // A user creation journey
9545 }
9546 optional Journey journey = 2;
9547 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9548 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9549 optional int32 origin_user = 3;
9550 // Which user the journey is targeting
9551 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9552 optional int32 target_user = 4;
9553
9554 // What is the user type of the target user
9555 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9556 enum UserType {
9557 TYPE_UNKNOWN = 0;
9558 FULL_SYSTEM = 1;
9559 FULL_SECONDARY = 2;
9560 FULL_GUEST = 3;
9561 FULL_DEMO = 4;
9562 FULL_RESTRICTED = 5;
9563 PROFILE_MANAGED = 6;
9564 SYSTEM_HEADLESS = 7;
9565 }
9566 optional UserType user_type = 5;
9567 // What are the flags attached to the target user
9568 optional int32 user_flags = 6;
9569}
9570
9571/**
9572 * An event logged when a specific user lifecycle event is performed. These events should be
9573 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9574 * Note: journeys can span over multiple events, hence some events may share a single session id.
9575 *
9576 * Logged from:
9577 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9578 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9579 */
9580message UserLifecycleEventOccurred {
9581 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9582 optional int64 session_id = 1;
9583 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9584 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9585 optional int32 user_id = 2;
9586
9587 enum Event {
9588 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9589 SWITCH_USER = 1; // Indicates that this is a user switch event
9590 START_USER = 2; // Indicates that this is a user start event
9591 CREATE_USER = 3; // Indicates that this is a user create event
9592 }
9593 optional Event event = 3;
9594
9595 enum State {
9596 NONE = 0; // Indicates the associated event has no start/end defined
9597 BEGIN = 1;
9598 FINISH = 2;
9599 }
9600 optional State state = 4; // Represents the state of an event (beginning/ending)
9601}
jasonwshsu81173e32020-03-27 15:22:03 +08009602
9603/**
9604 * Logs when accessibility shortcut clicked.
9605 *
9606 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009607 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009608 */
9609message AccessibilityShortcutReported {
9610 // The accessibility feature(including installed a11y service, framework a11y feature,
9611 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9612 optional string package_name = 1;
9613
9614 // The definition of the accessibility shortcut.
9615 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9616 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9617
9618 // The definition of the service status.
9619 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9620 optional android.stats.accessibility.ServiceStatus service_status = 3;
9621}
9622
9623/**
9624 * Logs when accessibility service status changed.
9625 *
9626 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009627 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009628 */
9629message AccessibilityServiceReported {
9630 // The accessibility service package name.
9631 optional string package_name = 1;
9632
9633 // The definition of the service status.
9634 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9635 optional android.stats.accessibility.ServiceStatus service_status = 2;
9636}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009637
9638/**
9639 * Logs app usage events.
9640 */
9641message AppUsageEventOccurred {
9642 optional int32 uid = 1 [(is_uid) = true];
9643 optional string package_name = 2;
9644 optional string class_name = 3;
9645
9646 enum EventType {
9647 NONE = 0;
9648 MOVE_TO_FOREGROUND = 1;
9649 MOVE_TO_BACKGROUND = 2;
9650 }
9651 optional EventType event_type = 4;
9652}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009653
9654/*
9655 * Quality metrics logged when EVS cameras are active.
9656 *
9657 * Logged from:
9658 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9659 */
9660message EvsUsageStatsReported {
9661
9662 // Camera identifier to distinguish the source camera device. This is not
9663 // globally unique and therefore cannot be used to identify the user and/or
9664 // the device.
9665 optional int32 device_id = 1;
9666
9667 // Peak number of clients during the service
9668 optional int32 peak_num_clients = 2;
9669
9670 // Number of erroneous events during the service
9671 optional int32 num_errors = 3;
9672
9673 // Round trip latency of the very first frame
9674 optional int64 first_latency_millis = 4;
9675
9676 // Average frame round trip latency
9677 optional float avg_latency_millis = 5;
9678
9679 // Peak frame round trip latency
9680 optional int64 peak_latency_millis = 6;
9681
9682 // Total number of frames received
9683 optional int64 total_frames = 7;
9684
9685 // Number of frames ignored
9686 optional int64 ignored_frames = 8;
9687
9688 // Number of dropped frames to synchronize camera devices
9689 optional int64 dropped_frames_to_sync = 9;
9690
9691 // The duration of the service
9692 optional int64 duration_millis = 10;
9693}
Robert Leecccdc152020-04-23 13:22:46 +08009694
9695/**
9696 * Logs audio power usage stats.
9697 *
9698 * Pushed from:
9699 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9700 */
9701message AudioPowerUsageDataReported {
9702 /**
9703 * Device used for input/output
9704 *
9705 * All audio devices please refer to below file:
9706 * system/media/audio/include/system/audio-base.h
9707 *
9708 * Define our own enum values because we don't report all audio devices.
9709 * Currently, we only report built-in audio devices such as handset, speaker,
9710 * built-in mics, common audio devices such as wired headset, usb headset
9711 * and bluetooth devices.
9712 */
9713 enum AudioDevice {
9714 OUTPUT_EARPIECE = 0x1; // handset
9715 OUTPUT_SPEAKER = 0x2; // dual speaker
9716 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9717 OUTPUT_USB_HEADSET = 0x8; // usb headset
9718 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9719 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9720 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9721
9722 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9723 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9724 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9725 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9726 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9727 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9728 }
9729 optional AudioDevice audio_device = 1;
9730
9731 // Duration of the audio in seconds
9732 optional int32 duration_secs = 2;
9733
9734 // Average volume (0 ... 1.0)
9735 optional float average_volume = 3;
9736
9737 enum AudioType {
9738 UNKNOWN_TYPE = 0;
9739 VOICE_CALL_TYPE = 1; // voice call
9740 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9741 MEDIA_TYPE = 3; // music and system sound
9742 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9743 ALARM_TYPE = 5; // alarm type
9744 // record type
9745 CAMCORDER_TYPE = 6; // camcorder
9746 RECORD_TYPE = 7; // other recording
9747 }
9748 optional AudioType type = 4;
9749}