blob: 64d42bbd093d16337b63e1b1d597d632ee76090f [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"];
429 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000430 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700431
432 // StatsdStats tracks platform atoms with ids upto 500.
433 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000434 }
David Chenc8a43242017-10-17 16:23:28 -0700435
David Chen6e3e6cb2018-01-03 16:14:06 -0800436 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700437 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700438 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
440 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700441 MobileBytesTransfer mobile_bytes_transfer =
442 10002 [(module) = "framework", (truncate_timestamp) = true];
443 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
444 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800445 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
446 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700447 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800450 CpuTimePerUidFreq cpu_time_per_uid_freq =
451 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
453 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
454 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
455 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
456 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700457 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700458 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700459 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700460 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800461 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
462 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700463 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800464 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800466 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 DiskStats disk_stats = 10025 [(module) = "framework"];
468 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
469 AppSize app_size = 10027 [(module) = "framework"];
470 CategorySize category_size = 10028 [(module) = "framework"];
471 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800472 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
474 DiskIo disk_io = 10032 [(module) = "framework"];
475 PowerProfile power_profile = 10033 [(module) = "framework"];
476 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
477 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
478 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700479 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
481 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
482 10040 [(module) = "framework"];
483 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
484 10041 [(module) = "framework"];
485 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800486 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800488 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
490 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
491 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
492 RoleHolder role_holder = 10049 [(module) = "framework"];
493 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800494 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
496 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800497 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
498 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800499 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
500 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
501 FaceSettings face_settings = 10058 [(module) = "framework"];
502 CoolingDevice cooling_device = 10059 [(module) = "framework"];
503 AppOps app_ops = 10060 [(module) = "framework"];
504 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700505 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
506 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800508 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
510 DangerousPermissionStateSampled dangerous_permission_state_sampled =
511 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400512 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000513 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000514 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200515 PackageNotificationPreferences package_notification_preferences =
516 10071 [(module) = "framework"];
517 PackageNotificationChannelPreferences package_notification_channel_preferences =
518 10072 [(module) = "framework"];
519 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
520 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800521 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800522 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700523 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
524 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
525 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
526 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800527 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700528 }
yroa1fe77c2018-02-26 14:22:54 -0800529
Bookatz76aafcf2018-09-17 16:17:10 -0700530 // DO NOT USE field numbers above 100,000 in AOSP.
531 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
532 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100533
534 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700535}
536
Yao Chend54f9dd2017-10-17 17:37:48 +0000537/**
Yangster-mac20877162017-12-22 17:19:39 -0800538 * This proto represents a node of an attribution chain.
539 * Note: All attribution chains are represented as a repeated field of type
540 * AttributionNode. It is understood that in such arrays, the order is that
541 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 */
Yangster-mac20877162017-12-22 17:19:39 -0800543message AttributionNode {
544 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800545 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800546
Yangster-mac20877162017-12-22 17:19:39 -0800547 // The (optional) string tag for an element in the attribution chain. If the
548 // element has no tag, it is encoded as an empty string.
549 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700550}
551
Yangster-mac48b3d622018-08-18 12:38:11 -0700552message KeyValuePair {
553 optional int32 key = 1;
554 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700555 int32 value_int = 2;
556 int64 value_long = 3;
557 string value_str = 4;
558 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700559 }
560}
561
562message KeyValuePairsAtom {
563 optional int32 uid = 1;
564 repeated KeyValuePair pairs = 2;
565}
566
Yao Chend54f9dd2017-10-17 17:37:48 +0000567/*
568 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800569 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000570 *
571 * RULES:
572 * - The field ids for each atom must start at 1, and count upwards by 1.
573 * Skipping field ids is not allowed.
574 * - These form an API, so renaming, renumbering or removing fields is
575 * not allowed between android releases. (This is not currently enforced,
576 * but there will be a tool to enforce this restriction).
577 * - The types must be built-in protocol buffer types, namely, no sub-messages
578 * are allowed (yet). The bytes type is also not allowed.
579 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800580 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000581 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800582 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 * - A field that is a uid should be a string field, tagged with the [xxx]
584 * annotation. The generated code on android will be represented by UIDs,
585 * and those UIDs will be translated in xxx to those strings.
586 *
587 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700588 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000589 * - If there is a UID, it goes first. Think in an object-oriented fashion.
590 * *****************************************************************************
591 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700592
Yao Chend54f9dd2017-10-17 17:37:48 +0000593/**
Tej Singha72344992019-04-17 18:55:08 -0700594 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700595 * Logs when the Thermal service HAL notifies the throttling start/stop events.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
599 */
600message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700601 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700602 optional android.os.TemperatureTypeEnum sensor_type = 1;
603
Maggie White442b6312019-04-05 16:26:44 -0700604 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700605 enum State {
606 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700607 START = 1; // START indicated that throttling was triggered.
608 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700609 }
Yangster-mace16189a2018-08-26 12:20:16 -0700610 optional State state = 2;
611
612 optional float temperature = 3;
613}
614
615/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 * Logs when the screen state changes.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
620 */
621message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800622 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800623 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700624 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700625}
Yao Chend54f9dd2017-10-17 17:37:48 +0000626
627/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700628 * Logs that the process state of the uid, as determined by ActivityManager
629 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
633 */
Bookatzc1a050a2017-10-10 15:49:28 -0700634message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700635 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000636
Bookatzdb026a22018-01-10 19:01:56 -0800637 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800638 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700639 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000640}
641
642/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700643 * Logs process state change of a process, as per the activity manager.
644 *
645 * Logged from:
646 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
647 */
648message ProcessStateChanged {
649 optional int32 uid = 1;
650 optional string process_name = 2;
651 optional string package_name = 3;
652 // TODO: remove this when validation is done
653 optional int64 version = 5;
654 // The state, from frameworks/base/core/proto/android/app/enums.proto.
655 optional android.app.ProcessStateEnum state = 4;
656}
657
658/**
659 * Logs when ActivityManagerService sleep state is changed.
660 *
661 * Logged from:
662 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
663 */
664message ActivityManagerSleepStateChanged {
665 // TODO: import frameworks proto
666 enum State {
667 UNKNOWN = 0;
668 ASLEEP = 1;
669 AWAKE = 2;
670 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700671 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700672}
673
674/**
675 * Logs when system memory state changes.
676 *
677 * Logged from:
678 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
679 */
680message MemoryFactorStateChanged {
681 // TODO: import frameworks proto
682 enum State {
683 MEMORY_UNKNOWN = 0;
684 NORMAL = 1; // normal.
685 MODERATE = 2; // moderate memory pressure.
686 LOW = 3; // low memory.
687 CRITICAL = 4; // critical memory.
688
689 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700690 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700691}
692
693/**
694 * Logs when app is using too much cpu, according to ActivityManagerService.
695 *
696 * Logged from:
697 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
698 */
699message ExcessiveCpuUsageReported {
700 optional int32 uid = 1;
701 optional string process_name = 2;
702 optional string package_name = 3;
703 // package version. TODO: remove this when validation is done
704 optional int64 version = 4;
705}
706
707/**
708 * Logs when a cached process is killed, along with its pss.
709 *
710 * Logged from:
711 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
712 */
713message CachedKillReported {
714 optional int32 uid = 1;
715 optional string process_name = 2;
716 optional string package_name = 3;
717 // TODO: remove this when validation is done
718 optional int64 version = 5;
719 optional int64 pss = 4;
720}
721
722/**
xshu2c3d9e42019-09-26 17:54:02 -0700723 * Logs the change in wifi health.
724 *
725 * Logged from:
726 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
727 */
728message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800729 enum Band {
730 UNKNOWN = 0;
731 // All of 2.4GHz band
732 BAND_2G = 1;
733 // Frequencies in the range of [5150, 5250) GHz
734 BAND_5G_LOW = 2;
735 // Frequencies in the range of [5250, 5725) GHz
736 BAND_5G_MIDDLE = 3;
737 // Frequencies in the range of [5725, 5850) GHz
738 BAND_5G_HIGH = 4;
739 // Frequencies in the range of [5925, 6425) GHz
740 BAND_6G_LOW = 5;
741 // Frequencies in the range of [6425, 6875) GHz
742 BAND_6G_MIDDLE = 6;
743 // Frequencies in the range of [6875, 7125) GHz
744 BAND_6G_HIGH = 7;
745 }
xshu2c3d9e42019-09-26 17:54:02 -0700746 // duration this stat is obtained over in milliseconds
747 optional int32 duration_millis = 1;
748 // whether wifi is classified as sufficient for the user's data traffic, determined
749 // by whether the calculated throughput exceeds the average demand within |duration_millis|
750 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700751 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800752 optional bool is_cell_data_available = 3;
753 // the Band bucket the connected network is on
754 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700755}
756
757/**
758 * Logged when wifi detects a significant change in connection failure rate.
759 *
760 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
761 *
762 */
763message WifiFailureStatReported {
764 enum AbnormalityType {
765 UNKNOWN = 0;
766 SIGNIFICANT_INCREASE = 1;
767 SIGNIFICANT_DECREASE = 2;
768 SIMPLY_HIGH = 3;
769 }
770 enum FailureType {
771 FAILURE_UNKNOWN = 0;
772 FAILURE_CONNECTION = 1;
773 FAILURE_ASSOCIATION_REJECTION = 2;
774 FAILURE_ASSOCIATION_TIMEOUT = 3;
775 FAILURE_AUTHENTICATION = 4;
776 FAILURE_NON_LOCAL_DISCONNECTION = 5;
777 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
778 }
779 // Reason for uploading this stat
780 optional AbnormalityType abnormality_type = 1;
781 // The particular type of failure
782 optional FailureType failure_type = 2;
783 // How many times we have encountered this combination of AbnormalityType and FailureType
784 optional int32 failure_count = 3;
785}
786
787/**
788 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
789 *
790 * Logged from:
791 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
792 */
793message WifiConnectionResultReported {
794 enum FailureCode {
795 FAILURE_UNKNOWN = 0;
796 FAILURE_ASSOCIATION_TIMEOUT = 1;
797 FAILURE_ASSOCIATION_REJECTION = 2;
798 FAILURE_AUTHENTICATION_GENERAL = 3;
799 FAILURE_AUTHENTICATION_EAP = 4;
800 FAILURE_DHCP = 5;
801 FAILURE_NETWORK_DISCONNECTION = 6;
802 FAILURE_ROAM_TIMEOUT = 7;
803 }
804 // true represents a successful connection
805 optional bool connection_result = 1;
806 // reason for the connection failure
807 optional FailureCode failure_code = 2;
808 // scan rssi before the connection attempt
809 optional int32 rssi = 3;
810}
811
812/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700813 * Logs when memory stats of a process is reported.
814 *
815 * Logged from:
816 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
817 */
818message ProcessMemoryStatReported {
819 optional int32 uid = 1;
820 optional string process_name = 2;
821 optional string package_name = 3;
822 //TODO: remove this when validation is done
823 optional int64 version = 9;
824 optional int64 pss = 4;
825 optional int64 uss = 5;
826 optional int64 rss = 6;
827 enum Type {
828 ADD_PSS_INTERNAL_SINGLE = 0;
829 ADD_PSS_INTERNAL_ALL_MEM = 1;
830 ADD_PSS_INTERNAL_ALL_POLL = 2;
831 ADD_PSS_EXTERNAL = 3;
832 ADD_PSS_EXTERNAL_SLOW = 4;
833 }
834 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800835 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700836}
837
838/**
Bookatzc1a050a2017-10-10 15:49:28 -0700839 * Logs that a process started, finished, crashed, or ANRed.
840 *
841 * Logged from:
842 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
843 */
844message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700845 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700846
David Chen0b5c90c2018-01-25 16:51:49 -0800847 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800848 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700849
Bookatzddccf0a2017-11-28 16:48:14 -0800850 // What lifecycle state the process changed to.
851 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800852 enum State {
853 FINISHED = 0;
854 STARTED = 1;
855 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800856 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800857 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700858}
859
Bookatzc1a050a2017-10-10 15:49:28 -0700860/**
861 * Logs when the ble scan state changes.
862 *
863 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700864 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700865 */
866message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800867 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700868 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700869
870 enum State {
871 OFF = 0;
872 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700873 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
874 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700875 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800876 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700877 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800878 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700879 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800880 (state_field_option).nested = true
881 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700882
Bookatze5ec0b42018-03-26 13:34:56 -0700883 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700884 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700885 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700886 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700887 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700888 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700889}
890
891/**
892 * Logs reporting of a ble scan finding results.
893 *
894 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700895 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
Bookatzae6738e2018-09-13 11:38:56 -0700897// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700898message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800899 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700900
901 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800902 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700903}
904
905/**
906 * Logs when a sensor state changes.
907 *
908 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700909 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700910 */
911message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800912 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
Bookatzc1a050a2017-10-10 15:49:28 -0700914 // The id (int) of the sensor.
915 optional int32 sensor_id = 2;
916
917 enum State {
918 OFF = 0;
919 ON = 1;
920 }
921 optional State state = 3;
922}
923
Bookatzc1a050a2017-10-10 15:49:28 -0700924/**
925 * Logs when GPS state changes.
926 *
927 * Logged from:
928 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
929 */
930message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800931 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700932
933 enum State {
934 OFF = 0;
935 ON = 1;
936 }
937 optional State state = 2;
938}
939
Bookatz48d362e2018-11-06 15:49:08 -0800940/**
941 * Logs when GPS signal quality.
942 *
943 * Logged from:
944 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
945 */
946message GpsSignalQualityChanged {
947 optional android.server.location.GpsSignalQualityEnum level = 1;
948}
949
Bookatzc1a050a2017-10-10 15:49:28 -0700950
951/**
952 * Logs when a sync manager sync state changes.
953 *
954 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700955 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700956 */
957message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700959
David Chen0b5c90c2018-01-25 16:51:49 -0800960 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800961 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700962
963 enum State {
964 OFF = 0;
965 ON = 1;
966 }
967 optional State state = 3;
968}
969
Yangster-mac96353002018-09-05 11:18:55 -0700970/*
971 * Deferred job stats.
972 *
973 * Logged from:
974 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
975*/
976message DeferredJobStatsReported {
977 repeated AttributionNode attribution_node = 1;
978
979 // Number of jobs deferred.
980 optional int32 num_jobs_deferred = 2;
981
982 // Time since the last job runs.
983 optional int64 time_since_last_job_millis = 3;
984}
985
Bookatzc1a050a2017-10-10 15:49:28 -0700986/**
987 * Logs when a job scheduler job state changes.
988 *
989 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700990 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700991 */
992message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800993 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700994
995 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800996 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700997
998 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800999 FINISHED = 0;
1000 STARTED = 1;
1001 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001002 }
1003 optional State state = 3;
1004
Tej Singh33a412b2018-03-16 18:43:59 -07001005 // The reason a job has stopped.
1006 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001007 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001008 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001009
1010 // The standby bucket of the app that scheduled the job. These match the framework constants
1011 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1012 // already assigned 0.
1013 enum Bucket {
1014 UNKNOWN = -1;
1015 ACTIVE = 0;
1016 WORKING_SET = 1;
1017 FREQUENT = 2;
1018 RARE = 3;
1019 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001020 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001021 }
1022 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1023
1024 // The job id (as assigned by the app).
1025 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001026
1027 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1028 // constraints as they are always assumed to be set.
1029 optional bool has_charging_constraint = 7;
1030 optional bool has_battery_not_low_constraint = 8;
1031 optional bool has_storage_not_low_constraint = 9;
1032 optional bool has_timing_delay_constraint = 10;
1033 optional bool has_deadline_constraint = 11;
1034 optional bool has_idle_constraint = 12;
1035 optional bool has_connectivity_constraint = 13;
1036 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001037}
1038
1039/**
1040 * Logs when the audio state changes.
1041 *
1042 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001043 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001044 */
1045message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001046 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001047
1048 enum State {
1049 OFF = 0;
1050 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001051 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1052 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001053 }
1054 optional State state = 2;
1055}
1056
1057/**
1058 * Logs when the video codec state changes.
1059 *
1060 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001061 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001062 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001063message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001064 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001065
1066 enum State {
1067 OFF = 0;
1068 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001069 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1070 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001071 }
1072 optional State state = 2;
1073}
1074
1075/**
1076 * Logs when the flashlight state changes.
1077 *
1078 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001079 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001080 */
1081message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001082 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001083
1084 enum State {
1085 OFF = 0;
1086 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001087 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1088 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001089 }
1090 optional State state = 2;
1091}
1092
1093/**
1094 * Logs when the camera state changes.
1095 *
1096 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001097 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001098 */
1099message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001100 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001101
1102 enum State {
1103 OFF = 0;
1104 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001105 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1106 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001107 }
1108 optional State state = 2;
1109}
1110
1111/**
1112 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001113 *
1114 * Logged from:
1115 * TODO
1116 */
Bookatzd6746242017-10-24 18:39:35 -07001117message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001118 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001119 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001120
Bookatz1a1b0462018-01-12 11:47:03 -08001121 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1122 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001123 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001124
1125 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001126 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001127
1128 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001129 RELEASE = 0;
1130 ACQUIRE = 1;
1131 CHANGE_RELEASE = 2;
1132 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001133 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001134 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001135 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001136 (state_field_option).default_state_value = 0,
1137 (state_field_option).nested = true
1138 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001139}
1140
1141/**
Bookatzc1a050a2017-10-10 15:49:28 -07001142 * Logs when a partial wakelock is considered 'long' (over 1 min).
1143 *
1144 * Logged from:
1145 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1146 */
1147message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001148 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001149
Yao Chend54f9dd2017-10-17 17:37:48 +00001150 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1151 optional string tag = 2;
1152
Bookatzc1a050a2017-10-10 15:49:28 -07001153 // TODO: I have no idea what this is.
1154 optional string history_tag = 3;
1155
1156 enum State {
1157 OFF = 0;
1158 ON = 1;
1159 }
1160 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001161}
1162
Bookatzc1a050a2017-10-10 15:49:28 -07001163/**
Bookatza66083f2018-09-20 17:24:00 -07001164 * Logs when the device is interactive, according to the PowerManager Notifier.
1165 *
1166 * Logged from:
1167 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1168 */
1169message InteractiveStateChanged {
1170 enum State {
1171 OFF = 0;
1172 ON = 1;
1173 }
1174 optional State state = 1;
1175}
1176
1177/**
Bookatzc1a050a2017-10-10 15:49:28 -07001178 * Logs Battery Saver state change.
1179 *
1180 * Logged from:
1181 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1182 */
1183message BatterySaverModeStateChanged {
1184 enum State {
1185 OFF = 0;
1186 ON = 1;
1187 }
1188 optional State state = 1;
1189}
1190
1191/**
1192 * Logs Doze mode state change.
1193 *
1194 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001195 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001196 */
1197message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001198 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001199}
1200
1201
1202/**
1203 * Logs state change of Doze mode including maintenance windows.
1204 *
1205 * Logged from:
1206 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1207 */
1208message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001209 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001210}
1211
1212/**
1213 * Logs screen brightness level.
1214 *
1215 * Logged from:
1216 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1217 */
1218message ScreenBrightnessChanged {
1219 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1220 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001221}
1222
1223/**
1224 * Logs battery level (percent full, from 0 to 100).
1225 *
1226 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001227 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001228 */
1229message BatteryLevelChanged {
1230 // Battery level. Should be in [0, 100].
1231 optional int32 battery_level = 1;
1232}
1233
1234/**
1235 * Logs change in charging status of the device.
1236 *
1237 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001238 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001239 */
1240message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001241 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1242 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001243}
1244
1245/**
1246 * Logs whether the device is plugged in, and what power source it is using.
1247 *
1248 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001249 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001250 */
1251message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001252 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1253 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001254}
1255
Bookatz8c6571b2017-10-24 15:04:41 -07001256/**
1257 * Logs when an app's wakeup alarm fires.
1258 *
1259 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001260 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001261 */
1262message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001263 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001264
1265 // Name of the wakeup alarm.
1266 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001267
1268 // Name of source package (for historical reasons, since BatteryStats tracked it).
1269 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001270
Ben Murdoch3389f1522019-05-21 15:05:34 +01001271 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001272 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001273}
1274
1275/**
1276 * Logs when an an app causes the mobile radio to change state.
1277 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1278 *
1279 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001280 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001281 */
1282message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001283 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001284
Bookatz1a1b0462018-01-12 11:47:03 -08001285 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1286 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001287}
1288
1289/**
1290 * Logs when an an app causes the wifi radio to change state.
1291 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1292 *
1293 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001294 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001295 */
1296message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001297 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001298
Bookatz1a1b0462018-01-12 11:47:03 -08001299 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1300 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001301}
1302
1303/**
1304 * Logs kernel wakeup reasons and aborts.
1305 *
1306 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001307 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001308 */
1309message KernelWakeupReported {
1310 // Name of the kernel wakeup reason (or abort).
1311 optional string wakeup_reason_name = 1;
1312
1313 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001314 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001315}
1316
1317/**
Bookatzda1798c2018-12-13 14:16:00 -08001318 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001319 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001320 *
1321 * Logged from:
1322 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1323 */
1324message WifiEnabledStateChanged {
1325 enum State {
1326 OFF = 0;
1327 ON = 1;
1328 }
1329 optional State state = 1;
1330}
1331
1332/**
tsaichristinececebdc2020-02-04 14:05:56 -08001333 * This atom is deprecated starting in R.
1334 *
Bookatzda1798c2018-12-13 14:16:00 -08001335 * 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 -08001336 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1337 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001338 *
1339 * Logged from:
1340 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1341 */
1342message WifiRunningStateChanged {
1343 repeated AttributionNode attribution_node = 1;
1344
1345 enum State {
1346 OFF = 0;
1347 ON = 1;
1348 }
1349 optional State state = 2;
1350}
1351
1352/**
Bookatze5885242017-10-24 20:10:31 -07001353 * Logs wifi locks held by an app.
1354 *
1355 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001356 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001357 */
1358message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001359 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001360
1361 enum State {
1362 OFF = 0;
1363 ON = 1;
1364 }
1365 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001366
1367 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1368 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001369}
1370
1371/**
1372 * Logs wifi signal strength changes.
1373 *
1374 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001375 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001376 */
1377message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001378 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1379 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001380}
1381
1382/**
1383 * Logs wifi scans performed by an app.
1384 *
1385 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001386 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001387 */
1388message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001389 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001390
1391 enum State {
1392 OFF = 0;
1393 ON = 1;
1394 }
1395 optional State state = 2;
1396}
1397
1398/**
Tej Singh4503e102018-01-04 14:35:01 -08001399 * Logs wifi multicast locks held by an app
1400 *
1401 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001402 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001403 */
1404message WifiMulticastLockStateChanged {
1405 repeated AttributionNode attribution_node = 1;
1406
1407 enum State {
1408 OFF = 0;
1409 ON = 1;
1410 }
1411 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001412
1413 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001414}
1415
1416/**
Tej Singh1ea42892018-01-19 09:27:00 -08001417 * Logs shutdown reason and duration on next boot.
1418 *
1419 * Logged from:
1420 * frameworks/base/core/java/com/android/server/BootReceiver.java
1421 */
1422message ShutdownSequenceReported {
1423 // True if shutdown is for a reboot. Default: false if we do not know.
1424 optional bool reboot = 1;
1425
1426 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1427 optional string reason = 2;
1428
1429 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1430 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001431 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001432
1433 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001434 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001435}
1436
Tej Singh6483ea42018-01-25 17:45:49 -08001437
1438/**
1439 * Logs boot reason and duration.
1440 *
1441 * Logged from:
1442 * system/core/bootstat/bootstat.cpp
1443 */
1444message BootSequenceReported {
1445 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1446 // Default: "<EMPTY>" if not available.
1447 optional string bootloader_reason = 1;
1448
1449 // Reason for system boot. Eg. bootloader, reboot,userrequested
1450 // Default: "<EMPTY>" if not available.
1451 optional string system_reason = 2;
1452
1453 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001454 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001455
1456 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001457 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001458
1459 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001460 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001461
1462 // Time since last boot in ms. Default: 0 if not available.
1463 optional int64 time_since_last_boot = 6;
1464}
1465
Tej Singhc477d9c2018-02-05 18:31:39 -08001466
1467/**
1468 * Logs call state and disconnect cause (if applicable).
1469 *
1470 * Logged from:
1471 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1472 */
1473message CallStateChanged {
1474 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1475 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1476 optional android.telecom.CallStateEnum call_state = 1;
1477
1478 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1479 // This value is only applicable when the call_state is DISCONNECTED, and
1480 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1481 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1482 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1483
1484 // True if the call is self-managed, which are apps that use the
1485 // telecom infrastructure to make their own calls.
1486 optional bool self_managed = 3;
1487
1488 // True if call is external. External calls are calls on connected Wear
1489 // devices but show up in Telecom so the user can pull them onto the device.
1490 optional bool external_call = 4;
1491}
1492
Tej Singh1ea42892018-01-19 09:27:00 -08001493/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001494 * Logs keyguard state. The keyguard is the lock screen.
1495 *
1496 * Logged from:
1497 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1498 */
1499message KeyguardStateChanged {
1500 enum State {
1501 UNKNOWN = 0;
1502 // The keyguard is hidden when the phone is unlocked.
1503 HIDDEN = 1;
1504 // The keyguard is shown when the phone is locked (screen turns off).
1505 SHOWN= 2;
1506 // The keyguard is occluded when something is overlaying the keyguard.
1507 // Eg. Opening the camera while on the lock screen.
1508 OCCLUDED = 3;
1509 }
1510 optional State state = 1;
1511}
1512
1513/**
1514 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1515 * prompts the user to enter a password (pattern, pin, etc).
1516 *
1517 * Logged from:
1518 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1519 */
1520
1521message KeyguardBouncerStateChanged {
1522 enum State {
1523 UNKNOWN = 0;
1524 // Bouncer is hidden, either as a result of successfully entering the
1525 // password, screen timing out, or user going back to lock screen.
1526 HIDDEN = 1;
1527 // This is when the user is being prompted to enter the password.
1528 SHOWN = 2;
1529 }
1530 optional State state = 1;
1531}
1532
1533/**
1534 * Logs the result of entering a password into the keyguard bouncer.
1535 *
1536 * Logged from:
1537 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1538 */
1539message KeyguardBouncerPasswordEntered {
1540 enum BouncerResult {
1541 UNKNOWN = 0;
1542 // The password entered was incorrect.
1543 FAILURE = 1;
1544 // The password entered was correct.
1545 SUCCESS = 2;
1546 }
1547 optional BouncerResult result = 1;
1548}
1549
Tej Singha883b372018-02-15 11:30:01 -08001550/*
1551 * Logs changes to the configuration of the device. The configuration is defined
1552 * in frameworks/base/core/java/android/content/res/Configuration.java
1553 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1554 * Please go there to interpret the possible values each field can be.
1555 *
1556 * Logged from:
1557 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1558 */
1559message ResourceConfigurationChanged {
1560 // Bit mask of color capabilities of the screen.
1561 // Contains information about the color gamut and hdr mode of the screen.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // The target screen density being rendered to.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001567 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001568
1569 // Current user preference for the scaling factor for fonts,
1570 // relative to the base density scaling.
1571 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001572 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001573
1574 // Flag indicating whether the hard keyboard is hidden.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001576 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001577
1578 // The type of keyboard attached to the device.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1580 optional int32 keyboard = 5;
1581
1582 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001584 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001585
1586 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1587 // 0 if undefined.
1588 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1589 optional int32 mcc = 7;
1590
1591 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1592 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1593 // MNC_ZERO symbol defined in Configuration.java.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1595 optional int32 mnc = 8;
1596
1597 // The kind of navigation available on the device.
1598 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1599 optional int32 navigation = 9;
1600
1601 // Flag indicating whether the navigation is available.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001603 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001604
1605 // Overall orientation of the screen.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1607 optional int32 orientation = 11;
1608
1609 // The current height of the available screen space, in dp units.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001611 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001612
1613 // Bit mask of overall layout of the screen.
1614 // Contains information about screen size, whether the screen is wider/taller
1615 // than normal, whether the screen layout is right-tl-left or left-to-right,
1616 // and whether the screen has a rounded shape.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001618 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001619
1620 // Current width of the available screen space, in dp units.
1621 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001622 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001623
1624 // The smallest screen size an application will see in normal operation.
1625 // This is the smallest value of both screenWidthDp and screenHeightDp
1626 // in portrait and landscape.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001628 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001629
1630 // The type of touch screen attached to the device.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1632 optional int32 touchscreen = 16;
1633
1634 // Bit mask of the ui mode.
1635 // Contains information about the overall ui mode of the device.
1636 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1637 // Also contains information about whether the device is in night mode.
1638 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001639 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001640}
1641
Tej Singheee317b2018-03-07 19:28:05 -08001642
1643/**
1644 * Logs changes in the connection state of the mobile radio.
1645 *
1646 * Logged from:
1647 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1648 */
1649message MobileConnectionStateChanged {
1650 // States are from the state machine DataConnection.java.
1651 enum State {
1652 UNKNOWN = 0;
1653 // The connection is inactive, or disconnected.
1654 INACTIVE = 1;
1655 // The connection is being activated, or connecting.
1656 ACTIVATING = 2;
1657 // The connection is active, or connected.
1658 ACTIVE = 3;
1659 // The connection is disconnecting.
1660 DISCONNECTING = 4;
1661 // The connection is disconnecting after creating a connection.
1662 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1663 }
1664 optional State state = 1;
1665 // For multi-sim phones, this distinguishes between the sim cards.
1666 optional int32 sim_slot_index = 2;
1667 // Used to identify the connection. Starts at 0 and increments by 1 for
1668 // every new network created. Resets whenever the device reboots.
1669 optional int32 data_connection_id = 3;
1670 // A bitmask for the capabilities of this connection.
1671 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1672 // Default value (if we have no information): 0
1673 optional int64 capabilities = 4;
1674 // If this connection has internet.
1675 // This just checks if the DEFAULT bit of capabilities is set.
1676 optional bool has_internet = 5;
1677}
1678
1679/**
1680 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1681 *
1682 * Logged from:
1683 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1684 */
1685message MobileRadioTechnologyChanged {
1686 optional android.telephony.NetworkTypeEnum state = 1;
1687 // For multi-sim phones, this distinguishes between the sim cards.
1688 optional int32 sim_slot_index = 2;
1689}
1690
Andrew Chantb56388b2018-03-22 21:07:33 -07001691/**
1692 * Logs the VID and PID of any connected USB devices.
1693 *
1694 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1695 *
1696 * Logged by Vendor.
1697 */
1698message UsbDeviceAttached {
1699 optional int32 vid = 1;
1700 optional int32 pid = 2;
1701 optional bool has_audio = 3;
1702 optional bool has_hid = 4;
1703 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001704 enum State {
1705 STATE_DISCONNECTED = 0;
1706 STATE_CONNECTED = 1;
1707 }
1708 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001709 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001710}
1711
Tej Singheee317b2018-03-07 19:28:05 -08001712
Tej Singhdd7bd352018-02-09 19:33:15 -08001713/**
Tej Singh5d991e12018-03-09 19:48:11 -08001714 * Logs when Bluetooth is enabled and disabled.
1715 *
1716 * Logged from:
1717 * services/core/java/com/android/server/BluetoothManagerService.java
1718 */
1719message BluetoothEnabledStateChanged {
1720 repeated AttributionNode attribution_node = 1;
1721 // Whether or not bluetooth is enabled on the device.
1722 enum State {
1723 UNKNOWN = 0;
1724 ENABLED = 1;
1725 DISABLED = 2;
1726 }
1727 optional State state = 2;
1728 // The reason for being enabled/disabled.
1729 // Eg. Airplane mode, crash, application request.
1730 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1731 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001732 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001733}
1734
1735/**
Jack Hed9837c82019-01-09 01:19:13 -08001736 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001737 *
1738 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001739 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1740 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001741 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001742 */
1743message BluetoothConnectionStateChanged {
1744 // The state of the connection.
1745 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1746 optional android.bluetooth.ConnectionStateEnum state = 1;
1747 // An identifier that can be used to match connect and disconnect events.
1748 // Currently is last two bytes of a hash of a device level ID and
1749 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001750 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001751 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001752 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1753 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001754 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001755 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001756 // An identifier that can be used to match events for this device.
1757 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1758 // Salt: Randomly generated 256 bit value
1759 // Hash algorithm: HMAC-SHA256
1760 // Size: 32 byte
1761 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001762 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001763 // An identifier that can be used to match events for this device.
1764 // The incremental identifier is locally generated and guaranteed not derived
1765 // from any globally unique hardware id.
1766 // For paired devices, it stays consistent between Bluetooth toggling for the
1767 // same remote device.
1768 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1769 // session for the same remote device.
1770 // Default: 0 if the device's metric id is unknown.
1771 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001772}
1773
1774/**
1775 * Logs when a Bluetooth device connects and disconnects over ACL
1776 *
1777 * Logged from:
1778 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1779 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001780 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001781 */
1782message BluetoothAclConnectionStateChanged {
1783 // An identifier that can be used to match events for this device.
1784 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1785 // Salt: Randomly generated 256 bit value
1786 // Hash algorithm: HMAC-SHA256
1787 // Size: 32 byte
1788 // Default: null or empty if the device identifier is not known
1789 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1790 // The state of the connection.
1791 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1792 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001793 // An identifier that can be used to match events for this device.
1794 // The incremental identifier is locally generated and guaranteed not derived
1795 // from any globally unique hardware id.
1796 // For paired devices, it stays consistent between Bluetooth toggling for the
1797 // same remote device.
1798 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1799 // session for the same remote device.
1800 // Default: 0 if the device's metric id is unknown.
1801 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001802}
1803
1804/**
1805 * Logs when a Bluetooth device connects and disconnects over SCO
1806 *
1807 * Logged from:
1808 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1809 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1810 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001811 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001812 */
1813message BluetoothScoConnectionStateChanged {
1814 // An identifier that can be used to match events for this device.
1815 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1816 // Salt: Randomly generated 256 bit value
1817 // Hash algorithm: HMAC-SHA256
1818 // Size: 32 byte
1819 // Default: null or empty if the device identifier is not known
1820 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1821 // The state of the connection.
1822 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1823 optional android.bluetooth.ConnectionStateEnum state = 2;
1824 // Codec used for this SCO connection
1825 // Default: UNKNOWN
1826 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001827 // An identifier that can be used to match events for this device.
1828 // The incremental identifier is locally generated and guaranteed not derived
1829 // from any globally unique hardware id.
1830 // For paired devices, it stays consistent between Bluetooth toggling for the
1831 // same remote device.
1832 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1833 // session for the same remote device.
1834 // Default: 0 if the device's metric id is unknown.
1835 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001836}
1837
Jack Hec27040a2019-01-09 20:54:41 -08001838/**
1839 * Logged when active device of a profile changes
1840 *
1841 * Logged from:
1842 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1843 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1844 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1845 */
1846message BluetoothActiveDeviceChanged {
1847 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1848 // From android.bluetooth.BluetoothProfile
1849 optional int32 bt_profile = 1;
1850 // An identifier that can be used to match events for this new active device.
1851 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1852 // Salt: Randomly generated 256 bit value
1853 // Hash algorithm: HMAC-SHA256
1854 // Size: 32 byte
1855 // Default: null or empty if there is no active device for this profile
1856 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001857 // An identifier that can be used to match events for this device.
1858 // The incremental identifier is locally generated and guaranteed not derived
1859 // from any globally unique hardware id.
1860 // For paired devices, it stays consistent between Bluetooth toggling for the
1861 // same remote device.
1862 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1863 // session for the same remote device.
1864 // Default: 0 if the device's metric id is unknown.
1865 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001866}
1867
Jack Heab86dbd22018-12-18 15:43:27 -08001868// Logs when there is an event affecting Bluetooth device's link layer connection.
1869// - This event is triggered when there is a related HCI command or event
1870// - Users of this metrics can deduce Bluetooth device's connection state from these events
1871// - HCI commands are logged before the command is sent, after receiving command status, and after
1872// receiving command complete
1873// - HCI events are logged when they arrive
1874//
1875// Low level log from system/bt
1876//
1877// Bluetooth classic commands:
1878// - CMD_CREATE_CONNECTION
1879// - CMD_DISCONNECT
1880// - CMD_CREATE_CONNECTION_CANCEL
1881// - CMD_ACCEPT_CONNECTION_REQUEST
1882// - CMD_REJECT_CONNECTION_REQUEST
1883// - CMD_SETUP_ESCO_CONNECTION
1884// - CMD_ACCEPT_ESCO_CONNECTION
1885// - CMD_REJECT_ESCO_CONNECTION
1886// - CMD_ENH_SETUP_ESCO_CONNECTION
1887// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1888//
1889// Bluetooth low energy commands:
1890// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1891// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1892// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1893// - CMD_BLE_CLEAR_WHITE_LIST
1894// - CMD_BLE_ADD_WHITE_LIST
1895// - CMD_BLE_REMOVE_WHITE_LIST
1896//
1897// Bluetooth classic events:
1898// - EVT_CONNECTION_COMP
1899// - EVT_CONNECTION_REQUEST
1900// - EVT_DISCONNECTION_COMP
1901// - EVT_ESCO_CONNECTION_COMP
1902// - EVT_ESCO_CONNECTION_CHANGED
1903//
1904// Bluetooth low energy meta events:
1905// - BLE_EVT_CONN_COMPLETE_EVT
1906// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1907//
1908// Next tag: 10
1909message BluetoothLinkLayerConnectionEvent {
1910 // An identifier that can be used to match events for this device.
1911 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1912 // Salt: Randomly generated 256 bit value
1913 // Hash algorithm: HMAC-SHA256
1914 // Size: 32 byte
1915 // Default: null or empty if the device identifier is not known
1916 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1917 // Connection handle of this connection if available
1918 // Range: 0x0000 - 0x0EFF (12 bits)
1919 // Default: 0xFFFF if the handle is unknown
1920 optional int32 connection_handle = 2;
1921 // Direction of the link
1922 // Default: DIRECTION_UNKNOWN
1923 optional android.bluetooth.DirectionEnum direction = 3;
1924 // Type of this link
1925 // Default: LINK_TYPE_UNKNOWN
1926 optional android.bluetooth.LinkTypeEnum type = 4;
1927
1928 // Reason metadata for this link layer connection event, rules for interpretation:
1929 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1930 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1931 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1932 // set and valid, ignore hci_ble_event
1933
1934 // HCI command associated with this event
1935 // Default: CMD_UNKNOWN
1936 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1937 // HCI event associated with this event
1938 // Default: EVT_UNKNOWN
1939 optional android.bluetooth.hci.EventEnum hci_event = 6;
1940 // HCI BLE meta event associated with this event
1941 // Default: BLE_EVT_UNKNOWN
1942 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1943 // HCI command status code if this is triggerred by hci_cmd
1944 // Default: STATUS_UNKNOWN
1945 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1946 // HCI reason code associated with this event
1947 // Default: STATUS_UNKNOWN
1948 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001949 // An identifier that can be used to match events for this device.
1950 // The incremental identifier is locally generated and guaranteed not derived
1951 // from any globally unique hardware id.
1952 // For paired devices, it stays consistent between Bluetooth toggling for the
1953 // same remote device.
1954 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1955 // session for the same remote device.
1956 // Default: 0 if the device's metric id is unknown.
1957 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001958}
1959
Howard Roe103fe22019-01-17 16:52:16 -08001960/**
1961 * Logs when a module is rolled back by Watchdog.
1962 *
1963 * Logged from: Rollback Manager
1964 */
1965message WatchdogRollbackOccurred {
1966 enum RollbackType {
1967 UNKNOWN = 0;
1968 ROLLBACK_INITIATE = 1;
1969 ROLLBACK_SUCCESS = 2;
1970 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001971 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001972 }
1973 optional RollbackType rollback_type = 1;
1974
1975 optional string package_name = 2;
1976
1977 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001978
1979 enum RollbackReasonType {
1980 REASON_UNKNOWN = 0;
1981 REASON_NATIVE_CRASH = 1;
1982 REASON_EXPLICIT_HEALTH_CHECK = 2;
1983 REASON_APP_CRASH = 3;
1984 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001985 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001986 }
1987 optional RollbackReasonType rollback_reason = 4;
1988
1989 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1990 // is initiated. Empty if the package is unknown.
1991 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001992
1993 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001994}
1995
Jack Hec27040a2019-01-09 20:54:41 -08001996/**
1997 * Logs when there is a change in Bluetooth A2DP playback state
1998 *
1999 * Logged from:
2000 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2001 */
2002message BluetoothA2dpPlaybackStateChanged {
2003 // An identifier that can be used to match events for this device.
2004 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2005 // Salt: Randomly generated 256 bit value
2006 // Hash algorithm: HMAC-SHA256
2007 // Size: 32 byte
2008 // Default: null or empty if the device identifier is not known
2009 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2010 // Current playback state
2011 // Default: PLAYBACK_STATE_UNKNOWN
2012 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2013 // Current audio coding mode
2014 // Default: AUDIO_CODING_MODE_UNKNOWN
2015 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002016 // An identifier that can be used to match events for this device.
2017 // The incremental identifier is locally generated and guaranteed not derived
2018 // from any globally unique hardware id.
2019 // For paired devices, it stays consistent between Bluetooth toggling for the
2020 // same remote device.
2021 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2022 // session for the same remote device.
2023 // Default: 0 if the device's metric id is unknown.
2024 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002025}
2026
2027/**
2028 * Logs when there is a change in A2DP codec config for a particular remote device
2029 *
2030 * Logged from:
2031 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2032 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2033 */
2034message BluetoothA2dpCodecConfigChanged {
2035 // An identifier that can be used to match events for this device.
2036 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2037 // Salt: Randomly generated 256 bit value
2038 // Hash algorithm: HMAC-SHA256
2039 // Size: 32 byte
2040 // Default: null or empty if the device identifier is not known
2041 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2042 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2043 // Default SOURCE_CODEC_TYPE_INVALID
2044 optional int32 codec_type = 2;
2045 // Codec priroity, the higher the more preferred, -1 for disabled
2046 // Default: CODEC_PRIORITY_DEFAULT
2047 optional int32 codec_priority = 3;
2048 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2049 // Default: SAMPLE_RATE_NONE
2050 optional int32 sample_rate = 4;
2051 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2052 // Default: BITS_PER_SAMPLE_NONE
2053 optional int32 bits_per_sample = 5;
2054 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2055 // Default: CHANNEL_MODE_NONE
2056 optional int32 channel_mode = 6;
2057 // Codec specific values
2058 // Default 0
2059 optional int64 codec_specific_1 = 7;
2060 optional int64 codec_specific_2 = 8;
2061 optional int64 codec_specific_3 = 9;
2062 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002063 // An identifier that can be used to match events for this device.
2064 // The incremental identifier is locally generated and guaranteed not derived
2065 // from any globally unique hardware id.
2066 // For paired devices, it stays consistent between Bluetooth toggling for the
2067 // same remote device.
2068 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2069 // session for the same remote device.
2070 // Default: 0 if the device's metric id is unknown.
2071 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002072}
2073
2074/**
2075 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2076 * Each codec's capability is logged separately due to statsd restriction
2077 *
2078 * Logged from:
2079 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2080 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2081 */
2082message BluetoothA2dpCodecCapabilityChanged {
2083 // An identifier that can be used to match events for this device.
2084 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2085 // Salt: Randomly generated 256 bit value
2086 // Hash algorithm: HMAC-SHA256
2087 // Size: 32 byte
2088 // Default: null or empty if the device identifier is not known
2089 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2090 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2091 // Default SOURCE_CODEC_TYPE_INVALID
2092 optional int32 codec_type = 2;
2093 // Codec priroity, the higher the more preferred, -1 for disabled
2094 // Default: CODEC_PRIORITY_DEFAULT
2095 optional int32 codec_priority = 3;
2096 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2097 // in BluetoothCodecConfig
2098 // Default: empty and SAMPLE_RATE_NONE for individual item
2099 optional int32 sample_rate = 4;
2100 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2101 // in BluetoothCodecConfig
2102 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2103 optional int32 bits_per_sample = 5;
2104 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2105 // BluetoothCodecConfig
2106 // Default: empty and CHANNEL_MODE_NONE for individual item
2107 optional int32 channel_mode = 6;
2108 // Codec specific values
2109 // Default 0
2110 optional int64 codec_specific_1 = 7;
2111 optional int64 codec_specific_2 = 8;
2112 optional int64 codec_specific_3 = 9;
2113 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002114 // An identifier that can be used to match events for this device.
2115 // The incremental identifier is locally generated and guaranteed not derived
2116 // from any globally unique hardware id.
2117 // For paired devices, it stays consistent between Bluetooth toggling for the
2118 // same remote device.
2119 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2120 // session for the same remote device.
2121 // Default: 0 if the device's metric id is unknown.
2122 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002123}
2124
2125/**
2126 * Logs when A2DP failed to read from PCM source.
2127 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2128 *
2129 * Logged from:
2130 * system/bt
2131 */
2132message BluetoothA2dpAudioUnderrunReported {
2133 // An identifier that can be used to match events for this device.
2134 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2135 // Salt: Randomly generated 256 bit value
2136 // Hash algorithm: HMAC-SHA256
2137 // Size: 32 byte
2138 // Default: null or empty if the device identifier is not known
2139 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2140 // Encoding interval in nanoseconds
2141 // Default: 0
2142 optional int64 encoding_interval_nanos = 2;
2143 // Number of bytes of PCM data that could not be read from the source
2144 // Default: 0
2145 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002146 // An identifier that can be used to match events for this device.
2147 // The incremental identifier is locally generated and guaranteed not derived
2148 // from any globally unique hardware id.
2149 // For paired devices, it stays consistent between Bluetooth toggling for the
2150 // same remote device.
2151 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2152 // session for the same remote device.
2153 // Default: 0 if the device's metric id is unknown.
2154 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002155}
2156
2157/**
2158 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2159 * buffer queue is full and we have to drop data
2160 *
2161 * Logged from:
2162 * system/bt
2163 */
2164message BluetoothA2dpAudioOverrunReported {
2165 // An identifier that can be used to match events for this device.
2166 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2167 // Salt: Randomly generated 256 bit value
2168 // Hash algorithm: HMAC-SHA256
2169 // Size: 32 byte
2170 // Default: null or empty if the device identifier is not known
2171 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2172 // Encoding interval in nanoseconds
2173 // Default: 0
2174 optional int64 encoding_interval_nanos = 2;
2175 // Number of buffers dropped in this event
2176 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2177 // Default: 0
2178 optional int32 num_dropped_buffers = 3;
2179 // Number of encoded buffers dropped in this event
2180 // Default 0
2181 optional int32 num_dropped_encoded_frames = 4;
2182 // Number of encoded bytes dropped in this event
2183 // Default: 0
2184 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002185 // An identifier that can be used to match events for this device.
2186 // The incremental identifier is locally generated and guaranteed not derived
2187 // from any globally unique hardware id.
2188 // For paired devices, it stays consistent between Bluetooth toggling for the
2189 // same remote device.
2190 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2191 // session for the same remote device.
2192 // Default: 0 if the device's metric id is unknown.
2193 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002194}
2195
2196/**
2197 * Logs when we receive reports regarding a device's RSSI value
2198 *
2199 * Logged from:
2200 * system/bt
2201 */
2202message BluetoothDeviceRssiReported {
2203 // An identifier that can be used to match events for this device.
2204 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2205 // Salt: Randomly generated 256 bit value
2206 // Hash algorithm: HMAC-SHA256
2207 // Size: 32 byte
2208 // Default: null or empty if the device identifier is not known
2209 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2210 // Connection handle of this connection if available
2211 // Range: 0x0000 - 0x0EFF (12 bits)
2212 // Default: 0xFFFF if the handle is unknown
2213 optional int32 connection_handle = 2;
2214 // HCI command status code if this is triggerred by hci_cmd
2215 // Default: STATUS_UNKNOWN
2216 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2217 // BR/EDR
2218 // Range: -128 ≤ N ≤ 127 (signed integer)
2219 // Units: dB
2220 // LE:
2221 // Range: -127 to 20, 127 (signed integer)
2222 // Units: dBm
2223 // Invalid when an out of range value is reported
2224 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002225 // An identifier that can be used to match events for this device.
2226 // The incremental identifier is locally generated and guaranteed not derived
2227 // from any globally unique hardware id.
2228 // For paired devices, it stays consistent between Bluetooth toggling for the
2229 // same remote device.
2230 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2231 // session for the same remote device.
2232 // Default: 0 if the device's metric id is unknown.
2233 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002234}
2235
2236/**
2237 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2238 *
2239 * Logged from:
2240 * system/bt
2241 */
2242message BluetoothDeviceFailedContactCounterReported {
2243 // An identifier that can be used to match events for this device.
2244 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2245 // Salt: Randomly generated 256 bit value
2246 // Hash algorithm: HMAC-SHA256
2247 // Size: 32 byte
2248 // Default: null or empty if the device identifier is not known
2249 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2250 // Connection handle of this connection if available
2251 // Range: 0x0000 - 0x0EFF (12 bits)
2252 // Default: 0xFFFF if the handle is unknown
2253 optional int32 connection_handle = 2;
2254 // HCI command status code if this is triggerred by hci_cmd
2255 // Default: STATUS_UNKNOWN
2256 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2257 // Number of consecutive failed contacts for a connection corresponding to the Handle
2258 // Range: uint16_t, 0-0xFFFF
2259 // Default: 0xFFFFF
2260 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002261 // An identifier that can be used to match events for this device.
2262 // The incremental identifier is locally generated and guaranteed not derived
2263 // from any globally unique hardware id.
2264 // For paired devices, it stays consistent between Bluetooth toggling for the
2265 // same remote device.
2266 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2267 // session for the same remote device.
2268 // Default: 0 if the device's metric id is unknown.
2269 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002270}
2271
2272/**
2273 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2274 *
2275 * Logged from:
2276 * system/bt
2277 */
2278message BluetoothDeviceTxPowerLevelReported {
2279 // An identifier that can be used to match events for this device.
2280 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2281 // Salt: Randomly generated 256 bit value
2282 // Hash algorithm: HMAC-SHA256
2283 // Size: 32 byte
2284 // Default: null or empty if the device identifier is not known
2285 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2286 // Connection handle of this connection if available
2287 // Range: 0x0000 - 0x0EFF (12 bits)
2288 // Default: 0xFFFF if the handle is unknown
2289 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002290 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002291 // Default: STATUS_UNKNOWN
2292 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2293 // Range: -30 ≤ N ≤ 20
2294 // Units: dBm
2295 // Invalid when an out of range value is reported
2296 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002297 // An identifier that can be used to match events for this device.
2298 // The incremental identifier is locally generated and guaranteed not derived
2299 // from any globally unique hardware id.
2300 // For paired devices, it stays consistent between Bluetooth toggling for the
2301 // same remote device.
2302 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2303 // session for the same remote device.
2304 // Default: 0 if the device's metric id is unknown.
2305 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002306}
Jack Heab86dbd22018-12-18 15:43:27 -08002307
Tej Singh5d991e12018-03-09 19:48:11 -08002308/**
Jack He1021a612019-01-20 21:22:46 -08002309 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2310 * receiving an HCI command from the host
2311 *
2312 * Logged from: system/bt
2313 */
2314message BluetoothHciTimeoutReported {
2315 // HCI command associated with this event
2316 // Default: CMD_UNKNOWN
2317 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2318}
2319
2320/**
2321 * Logs when we receive Bluetooth Link Quality Report event from the controller
2322 * See Android Bluetooth HCI specification for more details
2323 *
2324 * Note: all count and bytes field are counted since last event
2325 *
2326 * Logged from: system/bt
2327 */
2328message BluetoothQualityReportReported {
2329 // Quality report ID
2330 // Original type: uint8_t
2331 // Default: BQR_ID_UNKNOWN
2332 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2333 // Packet type of the connection
2334 // Original type: uint8_t
2335 // Default: BQR_PACKET_TYPE_UNKNOWN
2336 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2337 // Connection handle of the connection
2338 // Original type: uint16_t
2339 optional int32 connection_handle = 3;
2340 // Performing Role for the connection
2341 // Original type: uint8_t
2342 optional int32 connection_role = 4;
2343 // Current Transmit Power Level for the connection. This value is the same as the controller's
2344 // response to the HCI_Read_Transmit_Power_Level HCI command
2345 // Original type: uint8_t
2346 optional int32 tx_power_level = 5;
2347 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2348 // absolute receiver signal strength value
2349 // Original type: int8_t
2350 optional int32 rssi = 6;
2351 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2352 // channels used by the link currently
2353 // Original type: uint8_t
2354 optional int32 snr = 7;
2355 // Indicates the number of unused channels in AFH_channel_map
2356 // Original type: uint8_t
2357 optional int32 unused_afh_channel_count = 8;
2358 // Indicates the number of the channels which are interfered and quality is bad but are still
2359 // selected for AFH
2360 // Original type: uint8_t
2361 optional int32 afh_select_unideal_channel_count = 9;
2362 // Current Link Supervision Timeout Setting
2363 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2364 // Original type: uint16_t
2365 optional int32 lsto = 10;
2366 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2367 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2368 // 0x01 (Piconet Clock)
2369 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2370 // Original type: uint32_t
2371 optional int64 connection_piconet_clock = 11;
2372 // The count of retransmission
2373 // Original type: uint32_t
2374 optional int64 retransmission_count = 12;
2375 // The count of no RX
2376 // Original type: uint32_t
2377 optional int64 no_rx_count = 13;
2378 // The count of NAK (Negative Acknowledge)
2379 // Original type: uint32_t
2380 optional int64 nak_count = 14;
2381 // Controller timestamp of last TX ACK
2382 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2383 // Original type: uint32_t
2384 optional int64 last_tx_ack_timestamp = 15;
2385 // The count of Flow-off (STOP)
2386 // Original type: uint32_t
2387 optional int64 flow_off_count = 16;
2388 // Controller timestamp of last Flow-on (GO)
2389 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2390 // Original type: uint32_t
2391 optional int64 last_flow_on_timestamp = 17;
2392 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2393 // Original type: uint32_t
2394 optional int64 buffer_overflow_bytes = 18;
2395 // Buffer underflow count (in byte) since last event
2396 // Original type: uint32_t
2397 optional int64 buffer_underflow_bytes = 19;
2398}
2399
2400/**
2401 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2402 *
2403 * Notes:
2404 * - Each event can be partially filled as we might learn different pieces of device
2405 * information at different time
2406 * - Multiple device info events can be combined to give more complete picture
2407 * - When multiple device info events tries to describe the same information, the
2408 * later one wins
2409 *
2410 * Logged from:
2411 * packages/apps/Bluetooth
2412 */
Jack Heaea26982019-04-04 11:19:48 -07002413message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002414 // An identifier that can be used to match events for this device.
2415 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2416 // Salt: Randomly generated 256 bit value
2417 // Hash algorithm: HMAC-SHA256
2418 // Size: 32 byte
2419 // Default: null or empty if the device identifier is not known
2420 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2421 // Where is this device info obtained from
2422 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2423 // Name of the data source
2424 // For EXTERNAL: package name of the data source
2425 // For INTERNAL: null for general case, component name otherwise
2426 optional string source_name = 3;
2427 // Name of the manufacturer of this device
2428 optional string manufacturer = 4;
2429 // Model of this device
2430 optional string model = 5;
2431 // Hardware version of this device
2432 optional string hardware_version = 6;
2433 // Software version of this device
2434 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002435 // An identifier that can be used to match events for this device.
2436 // The incremental identifier is locally generated and guaranteed not derived
2437 // from any globally unique hardware id.
2438 // For paired devices, it stays consistent between Bluetooth toggling for the
2439 // same remote device.
2440 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2441 // session for the same remote device.
2442 // Default: 0 if the device's metric id is unknown.
2443 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002444}
2445
2446/**
2447 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2448 * device, as documented by the Bluetooth Core HCI specification
2449 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2450 * Vol 2, Part E, Page 1118
2451 *
2452 * Logged from:
2453 * system/bt
2454 */
2455message BluetoothRemoteVersionInfoReported {
2456 // Connection handle of the connection
2457 // Original type: uint16_t
2458 optional int32 connection_handle = 1;
2459 // HCI command status code
2460 // Default: STATUS_UNKNOWN
2461 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2462 // 1 byte Version of current LMP in the remote controller
2463 optional int32 lmp_version = 3;
2464 // 2 bytes LMP manufacturer code of the remote controller
2465 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2466 optional int32 lmp_manufacturer_code = 4;
2467 // 4 bytes subversion of the LMP in the remote controller
2468 optional int32 lmp_subversion = 5;
2469}
2470
2471/**
2472 * Logs when certain Bluetooth SDP attributes are discovered
2473 * Constant definitions are from:
2474 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2475 *
2476 * Current logged attributes:
2477 * - BluetoothProfileDescriptorList
2478 * - Supported Features Bitmask
2479 *
2480 * Logged from:
2481 * system/bt
2482 */
2483message BluetoothSdpAttributeReported {
2484 // An identifier that can be used to match events for this device.
2485 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2486 // Salt: Randomly generated 256 bit value
2487 // Hash algorithm: HMAC-SHA256
2488 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2489 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2490 // Original type: uint16_t
2491 optional int32 protocol_uuid = 2;
2492 // Short form UUIDs used to identify Bluetooth SDP attribute types
2493 // Original type: uint16_t
2494 optional int32 attribute_id = 3;
2495 // Attribute value for the particular attribute
2496 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002497 // An identifier that can be used to match events for this device.
2498 // The incremental identifier is locally generated and guaranteed not derived
2499 // from any globally unique hardware id.
2500 // For paired devices, it stays consistent between Bluetooth toggling for the
2501 // same remote device.
2502 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2503 // session for the same remote device.
2504 // Default: 0 if the device's metric id is unknown.
2505 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002506}
2507
2508/**
2509 * Logs when bond state of a Bluetooth device changes
2510 *
2511 * Logged from:
2512 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2513 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2514 */
2515message BluetoothBondStateChanged {
2516 // An identifier that can be used to match events for this device.
2517 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2518 // Salt: Randomly generated 256 bit value
2519 // Hash algorithm: HMAC-SHA256
2520 // Size: 32 byte
2521 // Default: null or empty if the device identifier is not known
2522 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2523 // Preferred transport type to remote dual mode device
2524 // Default: TRANSPORT_AUTO means no preference
2525 optional android.bluetooth.TransportTypeEnum transport = 2;
2526 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2527 // Default: UNKNOWN
2528 optional android.bluetooth.DeviceTypeEnum type = 3;
2529 // Current bond state (NONE, BONDING, BONDED)
2530 // Default: BOND_STATE_UNKNOWN
2531 optional android.bluetooth.BondStateEnum bond_state = 4;
2532 // Bonding sub state
2533 // Default: BOND_SUB_STATE_UNKNOWN
2534 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2535 // Unbond Reason
2536 // Default: UNBOND_REASON_UNKNOWN
2537 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002538 // An identifier that can be used to match events for this device.
2539 // The incremental identifier is locally generated and guaranteed not derived
2540 // from any globally unique hardware id.
2541 // For paired devices, it stays consistent between Bluetooth toggling for the
2542 // same remote device.
2543 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2544 // session for the same remote device.
2545 // Default: 0 if the device's metric id is unknown.
2546 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002547}
2548
2549/**
2550 * Logs there is an event related Bluetooth classic pairing
2551 *
2552 * Logged from:
2553 * system/bt
2554 */
2555message BluetoothClassicPairingEventReported {
2556 // An identifier that can be used to match events for this device.
2557 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2558 // Salt: Randomly generated 256 bit value
2559 // Hash algorithm: HMAC-SHA256
2560 // Size: 32 byte
2561 // Default: null or empty if the device identifier is not known
2562 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2563 // Connection handle of this connection if available
2564 // Range: 0x0000 - 0x0EFF (12 bits)
2565 // Default: 0xFFFF if the handle is unknown
2566 optional int32 connection_handle = 2;
2567 // HCI command associated with this event
2568 // Default: CMD_UNKNOWN
2569 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2570 // HCI event associated with this event
2571 // Default: EVT_UNKNOWN
2572 optional android.bluetooth.hci.EventEnum hci_event = 4;
2573 // HCI command status code if this is triggerred by hci_cmd
2574 // Default: STATUS_UNKNOWN
2575 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2576 // HCI reason code associated with this event
2577 // Default: STATUS_UNKNOWN
2578 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002579 // A status value related to this specific event
2580 // Default: 0
2581 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002582 // An identifier that can be used to match events for this device.
2583 // The incremental identifier is locally generated and guaranteed not derived
2584 // from any globally unique hardware id.
2585 // For paired devices, it stays consistent between Bluetooth toggling for the
2586 // same remote device.
2587 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2588 // session for the same remote device.
2589 // Default: 0 if the device's metric id is unknown.
2590 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002591}
2592
2593/**
2594 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2595 *
2596 * Logged from:
2597 * system/bt
2598 */
2599message BluetoothSmpPairingEventReported {
2600 // An identifier that can be used to match events for this device.
2601 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2602 // Salt: Randomly generated 256 bit value
2603 // Hash algorithm: HMAC-SHA256
2604 // Size: 32 byte
2605 // Default: null or empty if the device identifier is not known
2606 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2607 // SMP command sent or received over L2CAP
2608 // Default: CMD_UNKNOWN
2609 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2610 // Whether this command is sent or received
2611 // Default: DIRECTION_UNKNOWN
2612 optional android.bluetooth.DirectionEnum direction = 3;
2613 // SMP failure reason code
2614 // Default: PAIRING_FAIL_REASON_DEFAULT
2615 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002616 // An identifier that can be used to match events for this device.
2617 // The incremental identifier is locally generated and guaranteed not derived
2618 // from any globally unique hardware id.
2619 // For paired devices, it stays consistent between Bluetooth toggling for the
2620 // same remote device.
2621 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2622 // session for the same remote device.
2623 // Default: 0 if the device's metric id is unknown.
2624 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002625}
2626
2627/**
Jack He815cdba2019-01-30 17:24:55 -08002628 * Logs when a Bluetooth socket’s connection state changed
2629 *
2630 * Logged from:
2631 * system/bt
2632 */
2633message BluetoothSocketConnectionStateChanged {
2634 // An identifier that can be used to match events for this device.
2635 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2636 // Salt: Randomly generated 256 bit value
2637 // Hash algorithm: HMAC-SHA256
2638 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002639 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002640 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002641 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002642 // Default 0 when unknown or don't care
2643 optional int32 port = 2;
2644 // Socket type as mentioned in
2645 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2646 // Default: SOCKET_TYPE_UNKNOWN
2647 optional android.bluetooth.SocketTypeEnum type = 3;
2648 // Socket connection state
2649 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2650 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2651 // Number of bytes sent to remote device during this connection
2652 optional int64 tx_bytes = 5;
2653 // Number of bytes received from remote device during this connection
2654 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002655 // Socket owner's UID
2656 optional int32 uid = 7 [(is_uid) = true];
2657 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2658 // |port| must be spawned by |server_port|
2659 // Default 0 when unknown or don't care
2660 optional int32 server_port = 8;
2661 // Whether this is a server listener socket
2662 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002663 // An identifier that can be used to match events for this device.
2664 // The incremental identifier is locally generated and guaranteed not derived
2665 // from any globally unique hardware id.
2666 // For paired devices, it stays consistent between Bluetooth toggling for the
2667 // same remote device.
2668 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2669 // session for the same remote device.
2670 // Default: 0 if the device's metric id is unknown.
2671 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002672}
2673
2674/**
Jack He71426802019-04-02 13:32:52 -07002675 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2676 *
2677 * Logged from:
2678 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2679 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2680 *
2681 */
2682message BluetoothClassOfDeviceReported {
2683 // An identifier that can be used to match events for this device.
2684 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2685 // Salt: Randomly generated 256 bit value
2686 // Hash algorithm: HMAC-SHA256
2687 // Size: 32 byte
2688 // Default: null or empty if this is a server listener socket
2689 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2690 // Class of Device (CoD) value including both Major, Minor device class and service class
2691 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2692 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2693 // Default: 0
2694 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002695 // An identifier that can be used to match events for this device.
2696 // The incremental identifier is locally generated and guaranteed not derived
2697 // from any globally unique hardware id.
2698 // For paired devices, it stays consistent between Bluetooth toggling for the
2699 // same remote device.
2700 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2701 // session for the same remote device.
2702 // Default: 0 if the device's metric id is unknown.
2703 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002704}
2705
2706/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002707 * Logs when something is plugged into or removed from the USB-C connector.
2708 *
2709 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002710 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002711 */
2712message UsbConnectorStateChanged {
2713 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002714 STATE_DISCONNECTED = 0;
2715 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002716 }
2717 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002718 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002719 // Last active session in ms.
2720 // 0 when the port is in connected state.
2721 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002722}
2723
2724/**
2725 * Logs the reported speaker impedance.
2726 *
2727 * Logged from:
2728 * Vendor audio implementation.
2729 */
2730message SpeakerImpedanceReported {
2731 optional int32 speaker_location = 1;
2732 optional int32 impedance = 2;
2733}
2734
2735/**
2736 * Logs the report of a failed hardware.
2737 *
2738 * Logged from:
2739 * Vendor HALs.
2740 *
2741 */
2742message HardwareFailed {
2743 enum HardwareType {
2744 HARDWARE_FAILED_UNKNOWN = 0;
2745 HARDWARE_FAILED_MICROPHONE = 1;
2746 HARDWARE_FAILED_CODEC = 2;
2747 HARDWARE_FAILED_SPEAKER = 3;
2748 HARDWARE_FAILED_FINGERPRINT = 4;
2749 }
2750 optional HardwareType hardware_type = 1;
2751
Maggie White6dcd8572019-01-31 14:11:50 -08002752 /**
2753 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002754 * the same hardware_type. The specific locations are vendor defined integers,
2755 * referring to board-specific numbering schemes.
2756 */
2757 optional int32 hardware_location = 2;
2758
Maggie White6dcd8572019-01-31 14:11:50 -08002759 /**
2760 * failure_code is specific to the HardwareType of the failed hardware.
2761 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002762 */
Maggie White6dcd8572019-01-31 14:11:50 -08002763 enum HardwareErrorCode {
2764 UNKNOWN = 0;
2765 COMPLETE = 1;
2766 SPEAKER_HIGH_Z = 2;
2767 SPEAKER_SHORT = 3;
2768 FINGERPRINT_SENSOR_BROKEN = 4;
2769 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002770 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002771 }
2772 optional int32 failure_code = 3;
2773}
2774
2775/**
2776 * Log an event when the device has been physically dropped.
2777 * Reported from the /vendor partition.
2778 */
2779message PhysicalDropDetected {
2780 // Confidence that the event was actually a drop, 0 -> 100
2781 optional int32 confidence_pctg = 1;
2782 // Peak acceleration of the drop, in 1/1000s of a g.
2783 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002784 // Duration of freefall in ms
2785 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002786}
2787
2788/**
2789 * Log bucketed battery charge cycles.
2790 *
2791 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002792 * a given charge point. For example, if 10 cycle buckets are
2793 * initialized, bucket 1 is the lowest 1/10th of the battery,
2794 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002795 *
2796 * Logged from:
2797 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2798 */
2799message ChargeCyclesReported {
2800 optional int32 cycle_bucket_1 = 1;
2801 optional int32 cycle_bucket_2 = 2;
2802 optional int32 cycle_bucket_3 = 3;
2803 optional int32 cycle_bucket_4 = 4;
2804 optional int32 cycle_bucket_5 = 5;
2805 optional int32 cycle_bucket_6 = 6;
2806 optional int32 cycle_bucket_7 = 7;
2807 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002808 optional int32 cycle_bucket_9 = 9;
2809 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002810}
2811
2812/**
Howard Roa46b6582018-09-18 16:45:02 -07002813 * Log battery health snapshot.
2814 *
2815 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2816 * are snapshotted periodically over 24hrs.
2817 */
2818message BatteryHealthSnapshot {
2819 enum BatterySnapshotType {
2820 UNKNOWN = 0;
2821 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2822 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2823 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2824 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2825 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2826 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2827 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2828 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2829 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2830 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2831 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2832 }
2833 optional BatterySnapshotType type = 1;
2834 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002835 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002836 // Voltage Battery Voltage, in microVolts.
2837 optional int32 voltage_micro_volt = 3;
2838 // Current Battery current, in microAmps.
2839 optional int32 current_micro_amps = 4;
2840 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2841 optional int32 open_circuit_micro_volt = 5;
2842 // Resistance Battery Resistance, in microOhms.
2843 optional int32 resistance_micro_ohm = 6;
2844 // Level Battery Level, as % of full.
2845 optional int32 level_percent = 7;
2846}
2847
2848/**
2849 * Log slow I/O operations on the primary storage.
2850 */
2851message SlowIo {
2852 // Classifications of IO Operations.
2853 enum IoOperation {
2854 UNKNOWN = 0;
2855 READ = 1;
2856 WRITE = 2;
2857 UNMAP = 3;
2858 SYNC = 4;
2859 }
2860 optional IoOperation operation = 1;
2861
2862 // The number of slow IO operations of this type over 24 hours.
2863 optional int32 count = 2;
2864}
2865
2866/**
2867 * Log battery caused shutdown with the last recorded voltage.
2868 */
2869message BatteryCausedShutdown {
2870 // The last recorded battery voltage prior to shutdown.
2871 optional int32 last_recorded_micro_volt = 1;
2872}
2873
2874/**
Tej Singha72344992019-04-17 18:55:08 -07002875 * Logs when ThermalService receives throttling events.
2876 *
2877 * Logged from:
2878 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2879 */
2880message ThermalThrottlingSeverityStateChanged {
2881 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2882 optional android.os.TemperatureTypeEnum sensor_type = 1;
2883
2884 // The name of the temperature source. Eg. CPU0
2885 optional string sensor_name = 2;
2886
2887 // Temperature in tenths of a degree C.
2888 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2889 optional int32 temperature_deci_celsius = 3;
2890
2891 // Relative severity of the throttling, see enum definition.
2892 optional android.os.ThrottlingSeverityEnum severity = 4;
2893}
2894
2895/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002896 * Logs the duration of a davey (jank of >=700ms) when it occurs
2897 *
2898 * Logged from:
2899 * frameworks/base/libs/hwui/JankTracker.cpp
2900 */
2901message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002902 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002903 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002904
Tej Singhbb8554a2018-01-26 11:59:14 -08002905 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002906 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002907}
2908
2909/**
Bookatze5885242017-10-24 20:10:31 -07002910 * Logs phone signal strength changes.
2911 *
2912 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002913 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002914 */
2915message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002916 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2917 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002918}
2919
Yangster4ccebea2018-10-09 17:09:02 -07002920
2921/**
2922 * Logs when the phone state, sim state or signal strength changes
2923 *
2924 * Logged from:
2925 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2926 */
2927message PhoneServiceStateChanged {
2928 optional android.telephony.ServiceStateEnum state = 1;
2929 optional android.telephony.SimStateEnum sim_state = 2;
2930 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2931}
2932
2933/**
2934 * Logs when the phone becomes on or off.
2935 *
2936 * Logged from:
2937 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2938 */
2939message PhoneStateChanged {
2940 enum State {
2941 OFF = 0;
2942 ON = 1;
2943 }
2944 optional State state = 1;
2945}
2946
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002947message BackGesture {
2948 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002949 DEFAULT_BACK_TYPE = 0;
2950 COMPLETED = 1;
2951 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2952 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2953 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2954 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2955 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2956 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2957 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002958 }
2959 optional BackType type = 1;
2960
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002961 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2962 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2963 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2964 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2965 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2966 optional int32 left_boundary = 8; // left edge width + left inset
2967 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2968
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002969 enum WindowHorizontalLocation {
2970 DEFAULT_LOCATION = 0;
2971 LEFT = 1;
2972 RIGHT = 2;
2973 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002974 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002975}
2976
2977message ExclusionRectStateChanged {
2978 optional string component_name = 1; // if not available, simply packageName
2979 optional int32 requested_height = 2; // px
2980 optional int32 rejected_height = 3; // px
2981
2982 enum WindowHorizontalLocation {
2983 DEFAULT_LOCATION = 0;
2984 LEFT = 1;
2985 RIGHT = 2;
2986 }
2987 optional WindowHorizontalLocation x_location = 4;
2988 optional bool landscape = 5;
2989 optional bool splitscreen = 6;
2990 optional int32 duration_millis = 7;
2991}
2992
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002993/**
2994 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
2995 *
2996 * Logged from:
2997 * packages/apps/Launcher3
2998 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002999message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003000 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003001 optional android.stats.launcher.LauncherState src_state = 2;
3002 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003003 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3004 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3005
3006 // The event id (e.g., app launch, drag and drop, long press)
3007 optional int32 event_id = 6;
3008 // The event's source or target id (e.g., icon, task, button)
3009 optional int32 target_id = 7;
3010 // If the target needs to be tracked, use this id field
3011 optional int32 instance_id = 8;
3012 optional int32 uid = 9 [(is_uid) = true];
3013 optional string package_name = 10;
3014 optional string component_name = 11;
3015
3016 // (x, y) coordinate and the index information of the target on the container
3017 optional int32 grid_x = 12;
3018 optional int32 grid_y = 13;
3019 optional int32 page_id = 14;
3020
3021 // e.g., folder icon's (x, y) location and index information on the workspace
3022 optional int32 grid_x_parent = 15;
3023 optional int32 grid_y_parent = 16;
3024 optional int32 page_id_parent = 17;
3025
3026 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3027 optional int32 hierarchy = 18;
3028
3029 optional bool is_work_profile = 19;
3030
3031 // Used to store the predicted rank of the target
3032 optional int32 rank = 20;
3033
3034 // e.g., folderLabelState can be captured in the following two fields
3035 optional int32 from_state = 21;
3036 optional int32 to_state = 22;
3037
3038 // e.g., autofilled or suggested texts that are not user entered
3039 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003040}
3041
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003042/**
3043 * Used for snapshot of the HomeScreen UI elements
3044 *
3045 * Logged from:
3046 * packages/apps/Launcher3
3047 */
3048message LauncherStaticLayout {
3049 // The event id (e.g., snapshot, drag and drop)
3050 optional int32 event_id = 1;
3051 // The event's source or target id (e.g., icon, shortcut, widget)
3052 optional int32 target_id = 2;
3053 // If the target needs to be tracked, use this id field
3054 optional int32 instance_id = 3;
3055 optional int32 uid = 4 [(is_uid) = true];
3056 optional string package_name = 5;
3057 optional string component_name = 6;
3058
3059 // (x, y) coordinate and the index information of the target on the container
3060 optional int32 grid_x = 7;
3061 optional int32 grid_y = 8;
3062 optional int32 page_id = 9;
3063
3064 // e.g., folder icon's (x, y) location and index information on the workspace
3065 optional int32 grid_x_parent = 10;
3066 optional int32 grid_y_parent = 11;
3067 optional int32 page_id_parent = 12;
3068
3069 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3070 optional int32 hierarchy = 13;
3071
3072 optional bool is_work_profile = 14;
3073
3074 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3075 optional int32 origin = 15;
3076}
3077
3078/**
3079 * Logs when Wallpaper or ThemePicker UI has changed.
3080 *
3081 * Logged from:
3082 * packages/apps/ThemePicker
3083 * packages/apps/WallpaperPicker2
3084 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003085message StyleUIChanged {
3086 optional android.stats.style.Action action = 1;
3087 optional int32 color_package_hash = 2;
3088 optional int32 font_package_hash = 3;
3089 optional int32 shape_package_hash = 4;
3090 optional int32 clock_package_hash = 5;
3091 optional int32 launcher_grid = 6;
3092 optional int32 wallpaper_category_hash = 7;
3093 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003094 optional int32 color_preference = 9;
3095 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003096}
3097
David Chenc28b2bb2017-10-24 12:52:52 -07003098/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003099 * Logs when Settings UI has changed.
3100 *
3101 * Logged from:
3102 * packages/apps/Settings
3103 */
3104message SettingsUIChanged {
3105 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003106 * Where this SettingsUIChange event comes from. For example, if
3107 * it's a PAGE_VISIBLE event, where the page is opened from.
3108 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003109 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003110
3111 /**
3112 * What the UI action is.
3113 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003114 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003115
3116 /**
3117 * Where the action is happening
3118 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003119 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003120
3121 /**
3122 * What preference changed in this event.
3123 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003124 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003125
3126 /**
3127 * The new value of the changed preference.
3128 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003129 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003130}
3131
3132/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003133 * Logs basic timing information about touch events.
3134 * Reported at most every 5 minutes while device is being interacted with.
3135 *
3136 * Logged from:
3137 * frameworks/native/services/inputflinger
3138 */
3139message TouchEventReported {
3140 /**
3141 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003142 * and the standard deviation of the time spent processing touchscreen events
3143 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003144 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003145 * On supported devices, the starting point is taken during the hard interrupt inside the
3146 * kernel touch driver. On all other devices, the starting point is taken inside
3147 * the kernel's input event subsystem upon receipt of the input event.
3148 * The ending point is taken inside InputDispatcher, just after the input event
3149 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003150 */
3151 // Minimum value
3152 optional float latency_min_micros = 1;
3153 // Maximum value
3154 optional float latency_max_micros = 2;
3155 // Average value
3156 optional float latency_mean_micros = 3;
3157 // Standard deviation
3158 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003159 // Number of touch events (input_event) in this report
3160 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003161}
3162
3163/**
Philip Quinn0eded622019-01-29 12:46:28 -08003164 * Logs gesture classification and timing information for touch events.
3165 *
3166 * Logged from:
3167 * frameworks/base/core/java/android/view/GestureDetector.java
3168 * frameworks/base/core/java/android/view/View.java
3169 */
3170message TouchGestureClassified {
3171 // The source of the classification (e.g. Java class name).
3172 optional string source = 1;
3173
3174 enum Classification {
3175 UNKNOWN_CLASSIFICATION = 0;
3176 SINGLE_TAP = 1;
3177 DOUBLE_TAP = 2;
3178 LONG_PRESS = 3;
3179 DEEP_PRESS = 4;
3180 SCROLL = 5;
3181 }
3182 // The classification of the gesture.
3183 optional Classification classification = 2;
3184
3185 // The interval from the start of a touch event stream until the
3186 // classification was made.
3187 optional int32 latency_millis = 3;
3188
3189 // The distance from the location of the first touch event to the
3190 // location of the touch event when the classification was made.
3191 optional float displacement_px = 4;
3192}
3193
3194/**
David Chenc28b2bb2017-10-24 12:52:52 -07003195 * Logs that a setting was updated.
3196 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003197 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003198 * The tag and is_default allow resetting of settings to default values based on the specified
3199 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3200 */
3201message SettingChanged {
3202 // The name of the setting.
3203 optional string setting = 1;
3204
3205 // The change being imposed on this setting. May represent a number, eg "3".
3206 optional string value = 2;
3207
3208 // The new value of this setting. For most settings, this is same as value. For some settings,
3209 // value is +X or -X where X represents an element in a set. For example, if the previous value
3210 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3211 // The +/- feature is currently only used for location_providers_allowed.
3212 optional string new_value = 3;
3213
3214 // The previous value of this setting.
3215 optional string prev_value = 4;
3216
3217 // The tag used with the is_default for resetting sets of settings. This is generally null.
3218 optional string tag = 5;
3219
Bookatz90867622018-01-31 15:05:57 -08003220 // True if this setting with tag should be resettable.
3221 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003222
David Chenbd789912018-03-16 17:19:55 -07003223 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003224 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003225
3226 enum ChangeReason {
3227 UPDATED = 1; // Updated can be an insertion or an update.
3228 DELETED = 2;
3229 }
3230 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003231}
Chenjie Yub3dda412017-10-24 13:41:59 -07003232
Chenjie Yu05013b32017-11-21 10:21:41 -08003233/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003234 * Logs activity going to foreground or background
3235 *
3236 * Logged from:
3237 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3238 */
3239message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003240 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003241 optional string pkg_name = 2;
3242 optional string class_name = 3;
3243
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003244 enum State {
3245 BACKGROUND = 0;
3246 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003247 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003248 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003249}
David Chenc8a43242017-10-17 16:23:28 -07003250
3251/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003252 * Logs when a volume entered low Storage state.
3253 * Logged from:
3254 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3255 */
3256message LowStorageStateChanged {
3257 // Volume that ran out of storage.
3258 optional string volume_description = 1;
3259
3260 enum State {
3261 UNKNOWN = 0;
3262 OFF = 1;
3263 ON = 2;
3264 }
3265 optional State state = 2;
3266}
3267
3268/**
3269 * Logs when an app is downgraded.
3270 * Logged from:
3271 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3272 */
3273message AppDowngraded {
3274 optional string package_name = 1;
3275 // Size of the package (all data) before being downgraded.
3276 optional int64 size_in_bytes_before = 2;
3277 // Size of the package (all data) after being downgraded.
3278 optional int64 size_in_bytes_after = 3;
3279
3280 optional bool aggressive = 4;
3281}
3282
3283/**
3284 * Logs when an app is optimized after being downgraded.
3285 * Logged from:
3286 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3287 */
3288message AppOptimizedAfterDowngraded {
3289 optional string package_name = 1;
3290}
3291
3292/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003293 * Logs whenever an app is installed on external storage.
3294 * Logged from:
3295 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3296 */
3297message AppInstallOnExternalStorageReported {
3298 // The type of external storage.
3299 optional android.stats.storage.ExternalStorageType storage_type = 1;
3300 // The name of the package that is installed on the sd card.
3301 optional string package_name = 2;
3302}
3303
3304/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003305 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003306 * Logged from:
3307 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3308 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003309message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003310 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003311
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003312 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003313
3314 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003315 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003316 optional string process_name = 3;
3317
3318 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003319 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003320
3321 optional string package_name = 5;
3322
3323 enum InstantApp {
3324 UNAVAILABLE = 0;
3325 FALSE = 1;
3326 TRUE = 2;
3327 }
3328 optional InstantApp is_instant_app = 6;
3329
3330 enum ForegroundState {
3331 UNKNOWN = 0;
3332 BACKGROUND = 1;
3333 FOREGROUND = 2;
3334 }
3335 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003336
3337 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003338}
David Chen9e3808c2017-11-20 17:25:34 -08003339
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003340/**
3341 * Logs when a WTF (What a Terrible Failure) happened.
3342 * Logged from:
3343 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3344 */
3345message WTFOccurred {
3346 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003347
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003349
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003350 // The name of the process.
3351 // system_server if it is not by an app
3352 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003353
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003355 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003356
3357 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003358}
3359
3360/**
3361 * Logs when system server reports low memory.
3362 * Logged from:
3363 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3364 */
3365message LowMemReported {
3366}
3367
3368/**
3369 * Logs when an app ANR (App Not Responding) occurs.
3370 * Logged from:
3371 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3372 */
3373message ANROccurred {
3374 optional int32 uid = 1 [(is_uid) = true];
3375
3376 optional string process_name = 2;
3377
3378 optional string short_component_name = 3;
3379
3380 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003381
3382 enum InstantApp {
3383 UNAVAILABLE = 0;
3384 FALSE = 1;
3385 TRUE = 2;
3386 }
3387 optional InstantApp is_instant_app = 5;
3388
3389 enum ForegroundState {
3390 UNKNOWN = 0;
3391 BACKGROUND = 1;
3392 FOREGROUND = 2;
3393 }
3394 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003395
3396 optional android.server.ErrorSource error_source = 7;
3397
3398 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003399}
3400
Bookatza7020bd2018-08-28 16:29:35 -07003401/**
3402 * Logs when the vibrator state changes.
3403 * Logged from:
3404 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3405 */
3406message VibratorStateChanged {
3407 repeated AttributionNode attribution_node = 1;
3408
3409 enum State {
3410 OFF = 0;
3411 ON = 1;
3412 }
3413 optional State state = 2;
3414
3415 // Duration (in milliseconds) requested to keep the vibrator on.
3416 // Only applicable for State == ON.
3417 optional int64 duration_millis = 3;
3418}
3419
David Chen0a368b22017-12-06 16:28:16 -08003420/*
3421 * Allows other apps to push events into statsd.
3422 * Logged from:
3423 * frameworks/base/core/java/android/util/StatsLog.java
3424 */
David Chen0b5c90c2018-01-25 16:51:49 -08003425message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003426 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003427 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003428
3429 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3430 optional int32 label = 2;
3431
3432 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3433 // predicates for the metrics).
3434 enum State {
3435 UNKNOWN = 0;
3436 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3437 STOP = 2;
3438 START = 3;
3439 }
3440 optional State state = 3;
3441}
3442
David Chen9e3808c2017-11-20 17:25:34 -08003443/**
Bookatz7948c872018-09-04 12:58:33 -07003444 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3445 * For example, this could be due to the user manually changing the time.
3446 *
3447 * Logged from:
3448 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3449 */
3450message WallClockTimeShifted {
3451 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3452 optional int64 wall_clock_timestamp_millis = 1;
3453}
3454
3455/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003456 * Logs when statsd detects an anomaly.
3457 *
3458 * Logged from:
3459 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3460 */
3461message AnomalyDetected {
3462 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003463 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003464
Yangster-mac94e197c2018-01-02 16:03:03 -08003465 // Id of the config whose anomaly detection alert fired.
3466 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003467
Yangster-mac94e197c2018-01-02 16:03:03 -08003468 // Id of the alert (i.e. name of the anomaly that was detected).
3469 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003470}
3471
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003472message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003473 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003474 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003475
3476 // The app package name.
3477 optional string pkg_name = 2;
3478
3479 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003480 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003481 WARM = 1;
3482 HOT = 2;
3483 COLD = 3;
3484 }
3485 // The transition type.
3486 optional TransitionType type = 3;
3487
3488 // The activity name.
3489 optional string activity_name = 4;
3490
3491 // The name of the calling app. Empty if not set.
3492 optional string calling_pkg_name = 5;
3493
3494 // Whether the app is an instant app.
3495 optional bool is_instant_app = 6;
3496
3497 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003498 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003499
Bookatz80d11a02018-01-16 10:46:35 -08003500 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003501
David Chen0b5c90c2018-01-25 16:51:49 -08003502 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003503 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003504 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003505 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003506 optional int32 bind_application_delay_millis = 11;
3507 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003508
3509 // Empty if not set.
3510 optional string launch_token = 13;
3511
Calin Juravle759fbda2018-02-20 19:52:30 +00003512 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003513 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003514
3515 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003516 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003517}
3518
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003519message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003520 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003521 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003522
3523 // The app package name.
3524 optional string pkg_name = 2;
3525
3526 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003527 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003528 WARM = 1;
3529 HOT = 2;
3530 COLD = 3;
3531 }
3532 // The transition type.
3533 optional TransitionType type = 3;
3534
3535 // The activity name.
3536 optional string activity_name = 4;
3537}
3538
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003539message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003540 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003541 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003542
3543 // The app package name.
3544 optional string pkg_name = 2;
3545
3546 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003547 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003548 WITH_BUNDLE = 1;
3549 WITHOUT_BUNDLE = 2;
3550 }
3551 // The transition type.
3552 optional TransitionType type = 3;
3553
3554 // The activity name.
3555 optional string activity_name = 4;
3556
3557 optional bool transition_process_running = 5;
3558
3559 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003560 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003561}
3562
Bookatz8fcd09a2017-12-18 13:01:10 -08003563/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003564 * Logs a picture-in-picture action
3565 * Logged from:
3566 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3567 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3568 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3569 */
3570message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003571 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003572 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003573
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003574 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003575
Chenjie Yu52cacc62017-12-08 18:11:45 -08003576 enum State {
3577 ENTERED = 1;
3578 EXPANDED_TO_FULL_SCREEN = 2;
3579 MINIMIZED = 3;
3580 DISMISSED = 4;
3581 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003582 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003583}
3584
3585/**
Chenjie Yue8904192017-12-08 19:12:57 -08003586 * Logs overlay action
3587 * Logged from:
3588 * services/core/java/com/android/server/wm/Session.java
3589 */
3590message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003591 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003592
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003593 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003594
3595 optional bool using_alert_window = 3;
3596
3597 enum State {
3598 ENTERED = 1;
3599 EXITED = 2;
3600 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003601 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003602 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003603 (state_field_option).nested = false,
3604 (state_field_option).default_state_value = 2
3605 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003606}
3607
Adam Bookatz38767932020-02-05 12:13:40 -08003608/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003609 * Logs foreground service starts and stops.
3610 * Note that this is not when a service starts or stops, but when it is
3611 * considered foreground.
3612 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003613 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003614 */
3615message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003616 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003617 // package_name + "/" + class_name
3618 optional string short_name = 2;
3619
3620 enum State {
3621 ENTER = 1;
3622 EXIT = 2;
3623 }
3624 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003625
3626 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3627 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3628 optional bool allow_while_in_use_permission = 4;
3629}
3630
3631/**
3632 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3633 * A foreground service session is any continuous period during which the uid holds at least one
3634 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3635 * Accesses initiated while the uid is in the TOP state are ignored.
3636 * Sessions with no attempted accesses are not logged.
3637 * Logged from
3638 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3639 */
3640message ForegroundServiceAppOpSessionEnded {
3641 optional int32 uid = 1 [(is_uid) = true];
3642
3643 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003644 // Only following four ops are logged
3645 // COARSE_LOCATION = 0
3646 // FINE_LOCATION = 1
3647 // CAMERA = 26
3648 // RECORD_AUDIO = 27
3649 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003650
3651 // The uid's permission mode for accessing the AppOp during this fgs session.
3652 enum Mode {
3653 MODE_UNKNOWN = 0;
3654 MODE_ALLOWED = 1; // Always allowed
3655 MODE_IGNORED = 2; // Denied
3656 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3657 }
3658 optional Mode app_op_mode = 3;
3659
3660 // Number of times this AppOp was requested and allowed.
3661 optional int32 count_ops_accepted = 4;
3662 // Number of times this AppOp was requested but denied.
3663 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003664}
3665
Chenjie Yue8904192017-12-08 19:12:57 -08003666/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003667 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3668 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3669 * attributed back to the parent (host) uid. One example is Chrome.
3670 *
3671 * Logged from:
3672 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3673 */
3674message IsolatedUidChanged {
3675 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003676 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003677 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003678 optional int32 parent_uid = 1;
3679
3680 optional int32 isolated_uid = 2;
3681
3682 // We expect an isolated uid to be removed before if it's used for another parent uid.
3683 enum Event {
3684 REMOVED = 0;
3685 CREATED = 1;
3686 }
3687 optional Event event = 3;
3688}
3689
3690/*
3691 * Logs the reception of an incoming network packet causing the main system to wake up for
3692 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3693 * and processed by WakeupController.cpp.
3694 */
3695message PacketWakeupOccurred {
3696 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3697 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003698 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003699 // The interface name on which the packet was received.
3700 optional string iface = 2;
3701 // The ethertype value of the packet.
3702 optional int32 ethertype = 3;
3703 // String representation of the destination MAC address of the packet.
3704 optional string destination_hardware_address = 4;
3705 // String representation of the source address of the packet if this was an IP packet.
3706 optional string source_ip = 5;
3707 // String representation of the destination address of the packet if this was an IP packet.
3708 optional string destination_ip = 6;
3709 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3710 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3711 // families.
3712 optional int32 ip_next_header = 7;
3713 // The source port if this was a TCP or UDP packet.
3714 optional int32 source_port = 8;
3715 // The destination port if this was a TCP or UDP packet.
3716 optional int32 destination_port = 9;
3717}
3718
3719/*
3720 * Logs the memory stats for an app on startup.
3721 * Logged from:
3722 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3723 */
3724message AppStartMemoryStateCaptured {
3725 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003726 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003727
3728 // The process name.
3729 optional string process_name = 2;
3730
3731 // The activity name.
3732 optional string activity_name = 3;
3733
3734 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003735 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003736
3737 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003738 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003739
3740 // RSS
3741 optional int64 rss_in_bytes = 6;
3742
3743 // CACHE
3744 optional int64 cache_in_bytes = 7;
3745
3746 // SWAP
3747 optional int64 swap_in_bytes = 8;
3748}
3749
3750/*
3751 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3752 * for LMK event.
3753 * Logged from:
3754 * system/core/lmkd/lmkd.c
3755 */
3756message LmkStateChanged {
3757 enum State {
3758 UNKNOWN = 0;
3759 START = 1;
3760 STOP = 2;
3761 }
3762 optional State state = 1;
3763}
3764
3765/*
3766 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3767 * Logged from:
3768 * system/core/lmkd/lmkd.c
3769 */
3770message LmkKillOccurred {
3771 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003772 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003773
3774 // The process name.
3775 optional string process_name = 2;
3776
3777 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003778 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003779
3780 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003781 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003782
3783 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003784 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003785
3786 // RSS
3787 optional int64 rss_in_bytes = 6;
3788
3789 // CACHE
3790 optional int64 cache_in_bytes = 7;
3791
3792 // SWAP
3793 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003794
3795 // The elapsed real time of start of the process.
3796 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003797
3798 // Min oom adj score considered by lmkd.
3799 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003800}
3801
Rajeev Kumar51b54602018-03-01 12:18:26 -08003802/*
3803 * Logs when the ActivityManagerService detects that an app died.
3804 *
3805 * Logged from:
3806 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3807 */
3808message AppDied {
3809 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003810 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003811}
3812
Howard Ro21a039c2018-08-06 14:55:47 -07003813/**
3814 * An atom for generic metrics logging. Available from Android Q.
3815 */
3816message GenericAtom {
3817 // The uid of the application that sent this custom atom.
3818 optional int32 uid = 1 [(is_uid) = true];
3819
3820 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003821 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003822}
3823
Tej Singhd6d6d772018-09-05 17:41:25 -07003824/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003825 * Atom for simple logging of user interaction and impression events, such as "the user touched
3826 * this button" or "this dialog was displayed".
3827 * Keep the UI event stream clean: don't use for system or background events.
3828 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003829 *
3830 * Logged from:
3831 * frameworks/base/services/core/java/com/android/server/
3832 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003833 */
3834message UiEventReported {
3835 // The event_id.
3836 optional int32 event_id = 1;
3837 // The event's source or target uid and package, if applicable.
3838 // For example, the package posting a notification, or the destination package of a share.
3839 optional int32 uid = 2 [(is_uid) = true];
3840 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003841 // An identifier used to disambiguate which logs refer to a particular instance of some
3842 // UI element. Useful when there might be multiple instances simultaneously active.
3843 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003844}
3845
3846/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003847 * Reports a notification was created or updated.
3848 *
3849 * Logged from:
3850 * frameworks/base/services/core/java/com/android/server/notification/
3851 */
3852message NotificationReported {
3853 // The event_id (as for UiEventReported).
3854 optional int32 event_id = 1;
3855 // The notifying app's uid and package.
3856 optional int32 uid = 2 [(is_uid) = true];
3857 optional string package_name = 3;
3858 // A small system-assigned identifier for the notification.
3859 // Locally probably-unique, but expect collisions across users and/or days.
3860 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003861 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3862 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003863
3864 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003865 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3866 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3867 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003868
3869 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003870 optional string category = 10; // App-assigned notification category (API-defined strings)
3871 optional int32 style = 11; // App-assigned notification style
3872 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003873
3874 // Ordering, importance and interruptiveness
3875
Will Brockman7614f6962020-02-10 19:43:03 -05003876 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003877
Will Brockman7614f6962020-02-10 19:43:03 -05003878 optional android.stats.sysui.NotificationImportance importance = 14;
3879 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003880
3881 enum NotificationImportanceExplanation {
3882 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3883 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3884 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3885 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3886 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3887 // Like _APP, but based on pre-channels priority signal.
3888 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3889 }
3890
Will Brockman7614f6962020-02-10 19:43:03 -05003891 optional NotificationImportanceExplanation importance_source = 16;
3892 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3893 optional NotificationImportanceExplanation importance_initial_source = 18;
3894 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3895 optional int32 assistant_hash = 20;
3896 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003897}
3898
3899message Notification {
3900 // The notifying app's uid and package.
3901 optional int32 uid = 1 [(is_uid) = true];
3902 optional string package_name = 2;
3903 // A small system-assigned identifier for the notification.
3904 optional int32 instance_id = 3;
3905
3906 // Grouping information.
3907 optional int32 group_instance_id = 4;
3908 optional bool is_group_summary = 5;
3909
3910 // The section of the shade that the notification is in.
3911 // See NotificationSectionsManager.PriorityBucket.
3912 enum NotificationSection {
3913 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003914 SECTION_HEADS_UP = 1;
3915 SECTION_PEOPLE = 2;
3916 SECTION_ALERTING = 3;
3917 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003918 }
3919 optional NotificationSection section = 6;
3920}
3921
3922message NotificationList {
3923 repeated Notification notifications = 1; // An ordered sequence of notifications.
3924}
3925
3926/**
3927 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3928 *
3929 * Logged from:
3930 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3931 */
3932message NotificationPanelReported {
3933 // The event_id (as for UiEventReported).
3934 optional int32 event_id = 1;
3935 optional int32 num_notifications = 2;
3936 // The notifications in the panel, in the order that they appear there.
3937 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3938}
3939
3940/**
3941 * Reports a notification channel, or channel group, was created, updated, or deleted.
3942 *
3943 * Logged from:
3944 * frameworks/base/services/core/java/com/android/server/notification/
3945 */
3946message NotificationChannelModified {
3947 // The event_id (as for UiEventReported).
3948 optional int32 event_id = 1;
3949 // The notifying app's uid and package.
3950 optional int32 uid = 2 [(is_uid) = true];
3951 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003952 // Hash of app-assigned notification channel ID or channel-group ID
3953 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003954 // Previous importance setting, if applicable
3955 optional android.stats.sysui.NotificationImportance old_importance = 5;
3956 // New importance setting
3957 optional android.stats.sysui.NotificationImportance importance = 6;
3958}
3959
3960
3961/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003962 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003963 *
3964 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003965 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003966 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003967message BiometricAcquired {
3968 // Biometric modality that was acquired.
3969 optional android.hardware.biometrics.ModalityEnum modality = 1;
3970 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3971 optional int32 user = 2;
3972 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3973 optional bool is_crypto = 3;
3974 // Action that the device is performing. Acquired messages are only expected for enroll and
3975 // authenticate. Other actions may indicate an error.
3976 optional android.hardware.biometrics.ActionEnum action = 4;
3977 // The client that this acquisition was received for.
3978 optional android.hardware.biometrics.ClientEnum client = 5;
3979 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3980 optional int32 acquire_info = 6;
3981 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3982 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003983 // Dictates if this message should trigger additional debugging.
3984 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003985}
3986
3987/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003988 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003989 *
3990 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003991 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003992 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003993message BiometricAuthenticated {
3994 // Biometric modality that was used.
3995 optional android.hardware.biometrics.ModalityEnum modality = 1;
3996 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3997 optional int32 user = 2;
3998 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3999 // storage.
4000 optional bool is_crypto = 3;
4001 // The client that this acquisition was received for.
4002 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004003 // If authentication requires user confirmation. See BiometricPrompt's
4004 // setRequireConfirmation(bool) method.
4005 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004006
Kevin Chyn1741a072019-01-17 11:54:40 -08004007 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004008 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004009 REJECTED = 1;
4010 PENDING_CONFIRMATION = 2;
4011 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004012 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004013
4014 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004015 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004016 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4017 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4018 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4019 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004020 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004021 // Dictates if this message should trigger additional debugging.
4022 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004023}
4024
4025/**
4026 * Logs when a biometric error occurs.
4027 *
4028 * Logged from:
4029 * frameworks/base/services/core/java/com/android/server/biometrics
4030 */
4031message BiometricErrorOccurred {
4032 // Biometric modality that was used.
4033 optional android.hardware.biometrics.ModalityEnum modality = 1;
4034 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4035 optional int32 user = 2;
4036 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4037 optional bool is_crypto = 3;
4038 // Action that the device is performing.
4039 optional android.hardware.biometrics.ActionEnum action = 4;
4040 // The client that this acquisition was received for.
4041 optional android.hardware.biometrics.ClientEnum client = 5;
4042 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4043 // are unique to modality.
4044 optional int32 error_info = 6;
4045 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4046 // by the vendor and not specified by the HIDL interface.
4047 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004048 // Dictates if this message should trigger additional debugging.
4049 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004050 // Time spent during the authentication attempt.
4051 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004052}
4053
4054/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004055 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004056 * Logged from:
4057 * frameworks/base/services/core/java/com/android/server/biometrics
4058 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004059message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004060 // Biometric modality.
4061 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004062 // Type of issue detected.
4063 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004064 // Dictates if this message should trigger additional debugging.
4065 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004066}
Howard Ro688ae182018-09-25 00:09:36 -07004067
joshmccloskey6f952b22019-03-25 20:59:35 -07004068/**
4069 * Logs when a biometric enrollment occurs.
4070 *
4071 * Logged from:
4072 * frameworks/base/services/core/java/com/android/server/biometrics
4073 */
4074message BiometricEnrolled {
4075 // Biometric modality that was used.
4076 optional android.hardware.biometrics.ModalityEnum modality = 1;
4077 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4078 optional int32 user = 2;
4079 // The amount of time the enrollment took in milliseconds.
4080 optional int64 latency_millis = 3;
4081 // Whether or not the enrollment was successful.
4082 optional bool success = 4;
4083}
4084
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004085/*
Tej Singh0d176952019-01-16 19:10:54 -08004086 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004087 */
Tej Singh0d176952019-01-16 19:10:54 -08004088message FlagFlipUpdateOccurred {
4089 // If the event is from a flag config package, specify the package name.
4090 optional string flag_flip_package_name = 1;
4091
4092 // The order id of the package
4093 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004094}
4095
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004096/**
4097 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004098 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004099 */
4100message TrainExperimentIds {
4101 repeated int64 experiment_id = 1;
4102}
4103
Yangster-macb89807e2018-11-15 21:10:57 -08004104/*
4105 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004106 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004107 */
4108message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004109 // Name of the train.
4110 optional string train_name = 1;
4111 // Version code for a "train" of packages that need to be installed atomically
4112 optional int64 train_version_code = 2;
4113 // After installation of this package, device requires a restart.
4114 optional bool requires_staging = 3;
4115 // Rollback should be enabled for this install.
4116 optional bool rollback_enabled = 4;
4117 // Requires low latency monitoring if possible.
4118 optional bool requires_low_latency_monitor = 5;
4119
Yangster-macb89807e2018-11-15 21:10:57 -08004120 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004121 UNKNOWN = 0;
4122 INSTALL_REQUESTED = 1;
4123 INSTALL_STARTED = 2;
4124 INSTALL_STAGED_NOT_READY = 3;
4125 INSTALL_STAGED_READY = 4;
4126 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004127 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4128 // and INSTALL_FAILURE_COMMIT.
4129 INSTALL_FAILURE = 6 [deprecated = true];
4130 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004131 INSTALL_CANCELLED = 7;
4132 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004133 INSTALLER_ROLLBACK_INITIATED = 9;
4134 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4135 INSTALLER_ROLLBACK_STAGED = 11;
4136 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4137 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4138 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4139 INSTALLER_ROLLBACK_SUCCESS = 15;
4140 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004141 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4142 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4143 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4144 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4145 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4146 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004147 INSTALL_FAILURE_DOWNLOAD = 23;
4148 INSTALL_FAILURE_STATE_MISMATCH = 24;
4149 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004150 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004151 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004152 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004153 // Possible experiment ids for monitoring this push.
4154 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4155 // user id
4156 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004157 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004158 // Whether or not this is a rollback event
4159 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004160}
4161
Tej Singhc9203082019-05-03 13:42:23 -07004162/* Test atom, is not logged anywhere */
4163message TestAtomReported {
4164 repeated AttributionNode attribution_node = 1;
4165 optional int32 int_field = 2;
4166 optional int64 long_field = 3;
4167 optional float float_field = 4;
4168 optional string string_field = 5;
4169 optional bool boolean_field = 6;
4170 enum State {
4171 UNKNOWN = 0;
4172 OFF = 1;
4173 ON = 2;
4174 }
4175 optional State state = 7;
4176 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4177}
4178
Maggie Whitefc1aa592018-11-28 21:55:23 -08004179/** Represents USB port overheat event. */
4180message UsbPortOverheatEvent {
4181 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4182 optional int32 plug_temperature_deci_c = 1;
4183
4184 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4185 optional int32 max_temperature_deci_c = 2;
4186
4187 /* Time between USB plug event and overheat threshold trip, in seconds. */
4188 optional int32 time_to_overheat_secs = 3;
4189
4190 /* Time between overheat threshold trip and hysteresis, in seconds. */
4191 optional int32 time_to_hysteresis_secs = 4;
4192
4193 /* Time between hysteresis and active mitigation ending, in seconds. */
4194 optional int32 time_to_inactive_secs = 5;
4195};
4196
Maggie White8735b852019-01-18 11:40:49 -08004197/**
4198 * Logs total effective full charge and discharge cycles on a battery.
4199 * Here are some examples of one effective cycle:
4200 * 1) the battery charges from 0% to 100% and drains back to 0%,
4201 * 2) charging from 50% to 100% and draining back to 50% twice.
4202 * Pulled from:
4203 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4204 */
4205message BatteryCycleCount {
4206 /* Number of total charge and discharge cycles on the system battery. */
4207 optional int32 cycle_count = 1;
4208}
4209
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004210/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004211 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4212 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004213 * Pulled from:
4214 * StatsCompanionService
4215 */
4216
Carmen Agimof12dec122019-03-06 16:14:38 +00004217message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004218
Carmen Agimof12dec122019-03-06 16:14:38 +00004219 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004220 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004221 PUBLIC = 1;
4222 PRIVATE = 2;
4223 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004224 }
4225
Carmen Agimof12dec122019-03-06 16:14:38 +00004226 // The type of external storage.
4227 optional android.stats.storage.ExternalStorageType storage_type = 1;
4228 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4229 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004230 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004231 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004232}
4233
Yangster-macb89807e2018-11-15 21:10:57 -08004234/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004235 * Logs when a connection becomes available and lost.
4236 * Logged in StatsCompanionService.java
4237 */
4238message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004239 // Id of the network.
4240 optional int32 net_id = 1;
4241
4242 enum State {
4243 UNKNOWN = 0;
4244 CONNECTED = 1;
4245 DISCONNECTED = 2;
4246 }
4247 // Connected state of a network.
4248 optional State state = 2;
4249}
4250
4251/**
4252 * Logs when a service starts and stops.
4253 * Logged from:
4254 * services/core/java/com/android/server/am/ActiveServices.java
4255 */
4256message ServiceStateChanged {
4257
4258 optional int32 uid = 1 [(is_uid) = true];
4259
4260 optional string package_name = 2;
4261
4262 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004263
4264 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004265 START = 1;
4266 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004267 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004268
4269 optional State state = 4;
4270}
4271
4272/**
4273 * Logs when a service is launched.
4274 * Logged from:
4275 * services/core/java/com/android/server/am/ActiveServices.java
4276 */
4277message ServiceLaunchReported {
4278
4279 optional int32 uid = 1 [(is_uid) = true];
4280
4281 optional string package_name = 2;
4282
4283 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004284}
Howard Ro688ae182018-09-25 00:09:36 -07004285
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004286/**
4287 * Logs when a hidden API is used.
4288 *
4289 * Logged from:
4290 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4291 */
4292message HiddenApiUsed {
4293 // The uid of the app making the hidden access.
4294 optional int32 uid = 1 [(is_uid) = true];
4295
4296 // Signature of the method or field accessed.
4297 optional string signature = 2;
4298
4299 enum AccessMethod {
4300 NONE = 0;
4301 REFLECTION = 1;
4302 JNI = 2;
4303 LINKING = 3;
4304 }
4305
4306 // Type of access.
4307 optional AccessMethod access_method = 3;
4308
4309 // Whether the access was prevented or not.
4310 optional bool access_denied = 4;
4311}
4312
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004313/**
4314 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4315 * - When user sees privacy chip
4316 * - When user clicks privacy chip
4317 * - How does the user exit the Privacy Dialog
4318 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004319 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4320 */
4321message PrivacyIndicatorsInteracted {
4322
4323 enum Type {
4324 UNKNOWN = 0;
4325 CHIP_VIEWED = 1;
4326 CHIP_CLICKED = 2;
4327 DIALOG_PRIVACY_SETTINGS = 3;
4328 DIALOG_DISMISS = 4;
4329 DIALOG_LINE_ITEM = 5;
4330 }
4331
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004332 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004333
4334 // Used if the type is LINE_ITEM
4335 optional string package_name = 2;
4336}
4337
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004338/**
4339 * Logs information about a package that is moved from the internal to external storage and vice
4340 * versa.
4341 * It logs the package name, the type of the external storage where the package is installed
4342 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4343 * and the move type: if it's from internal to external or the other way around.
4344 *
4345 * Logged from:
4346 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4347 */
4348message AppMovedStorageReported {
4349 enum MoveType {
4350 UNKNOWN = 0;
4351 TO_EXTERNAL = 1;
4352 TO_INTERNAL = 2;
4353 }
4354 // The type of the external storage.
4355 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4356 // The type of move.
4357 optional MoveType move_type = 2;
4358 // The name of the package that was moved.
4359 optional string package_name = 3;
4360}
4361
jianjin8f2dee02019-03-29 14:03:08 -07004362/**
4363 * Logs when system server watchdog occurs.
4364 * Logged from:
4365 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4366 */
4367message SystemServerWatchdogOccurred {
4368 optional string subject = 1;
4369}
4370
4371/**
4372 * Logs when new file added to tombstones.
4373 * Logged from:
4374 * frameworks/base/core/java/com/android/server/BootReceiver.java
4375 */
4376message TombStoneOccurred {
4377}
4378
Hai Zhang5d3328d2019-04-13 21:25:06 +08004379/*
4380 * Information about a role request
4381 *
4382 * Logged from:
4383 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4384 */
4385message RoleRequestResultReported {
4386 // UID of application requesting the role
4387 optional int32 requesting_uid = 1;
4388
4389 // Package name of application requesting the role
4390 optional string requesting_package_name = 2;
4391
4392 // The role to be granted
4393 optional string role_name = 3;
4394
4395 // The count of applications qualifying for the role
4396 optional int32 qualifying_count = 4;
4397
4398 // UID of application current granted the role
4399 optional int32 current_uid = 5;
4400
4401 // Package name of application current granted the role
4402 optional string current_package_name = 6;
4403
4404 // UID of another application that user chose to grant the role to, instead of the requesting
4405 // application
4406 optional int32 granted_another_uid = 7;
4407
4408 // Package name of another application that user chose to grant the role to, instead of the
4409 // requesting application
4410 optional string granted_another_package_name = 8;
4411
4412 enum Result {
4413 UNDEFINED = 0;
4414 // role request was ignored
4415 IGNORED = 1;
4416 // role request was ignored because it's already granted
4417 IGNORED_ALREADY_GRANTED = 2;
4418 // role request was ignored because the application isn't qualified
4419 IGNORED_NOT_QUALIFIED = 3;
4420 // role request was ignored because user said it should be always denied
4421 IGNORED_USER_ALWAYS_DENIED = 4;
4422 // role was granted by user action
4423 USER_GRANTED = 5;
4424 // role was denied by user action
4425 USER_DENIED = 6;
4426 // role was denied by user granting another application the role
4427 USER_DENIED_GRANTED_ANOTHER = 7;
4428 // role was denied and set to be always denied by the user
4429 USER_DENIED_WITH_ALWAYS = 8;
4430 }
4431 // The result of the role request
4432 optional Result result = 9;
4433}
4434
Mark Tabrya824a642019-11-05 12:26:12 -08004435/**
4436 * Logs when a Vehicle Maps Service client's connection state has changed
4437 *
4438 * Logged from:
4439 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4440 */
4441message VmsClientConnectionStateChanged {
4442 // The UID of the VMS client app
4443 optional int32 uid = 1 [(is_uid) = true];
4444
4445 enum State {
4446 UNKNOWN = 0;
4447 // Attempting to connect to the client
4448 CONNECTING = 1;
4449 // Client connection established
4450 CONNECTED = 2;
4451 // Client connection closed unexpectedly
4452 DISCONNECTED = 3;
4453 // Client connection closed by VMS
4454 TERMINATED = 4;
4455 // Error establishing the client connection
4456 CONNECTION_ERROR = 5;
4457 }
4458
4459 optional State state = 2;
4460}
4461
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004462/**
4463 * Logs when MediaProvider has successfully finished scanning a storage volume.
4464 *
4465 * Logged from:
4466 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4467 */
shafik43825842020-04-02 17:30:24 +01004468message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004469 enum Reason {
4470 // Scan triggered due to unknown reason
4471 UNKNOWN = 0;
4472 // Scan triggered due to storage volume being mounted
4473 MOUNTED = 1;
4474 // Scan triggered due to explicit user action or app request
4475 DEMAND = 2;
4476 // Scan triggered due to idle maintenance
4477 IDLE = 3;
4478 }
4479
4480 // Volume type that this event pertains to
4481 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4482 // Reason why this scan was triggered
4483 optional Reason reason = 2;
4484 // Total number of files scanned
4485 optional int64 item_count = 3;
4486 // Duration of scan, normalized per file
4487 optional float normalized_duration_millis = 4;
4488 // Number of database inserts, normalized per file
4489 optional float normalized_insert_count = 5;
4490 // Number of database updates, normalized per file
4491 optional float normalized_update_count = 6;
4492 // Number of database deletes, normalized per file
4493 optional float normalized_delete_count = 7;
4494}
4495
4496/**
4497 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4498 *
4499 * Logged from:
4500 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4501 */
shafik43825842020-04-02 17:30:24 +01004502message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004503 // Volume type that this event pertains to
4504 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004505 // UID of app that requested deletion
4506 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004507 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004508 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004509}
4510
4511/**
4512 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4513 *
4514 * Logged from:
4515 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4516 */
shafik43825842020-04-02 17:30:24 +01004517message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004518 enum Result {
4519 UNKNOWN = 0;
4520 USER_GRANTED = 1;
4521 AUTO_GRANTED = 2;
4522 USER_DENIED = 3;
4523 USER_DENIED_WITH_PREJUDICE = 4;
4524 AUTO_DENIED = 5;
4525 }
4526
4527 // Volume type that this event pertains to
4528 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004529 // UID of app that requested permission
4530 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004531 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004532 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004533 // Result of this request
shafik43825842020-04-02 17:30:24 +01004534 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004535}
4536
4537/**
4538 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4539 *
4540 * Logged from:
4541 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4542 */
shafik43825842020-04-02 17:30:24 +01004543message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004544 // Volume type that this event pertains to
4545 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4546 // Old database version code
4547 optional int32 version_from = 2;
4548 // New database version code
4549 optional int32 version_to = 3;
4550 // Total number of files in database
4551 optional int64 item_count = 4;
4552 // Duration of schema change, normalized per file
4553 optional float normalized_duration_millis = 5;
4554}
4555
4556/**
4557 * Logs when MediaProvider has finished an idle maintenance job.
4558 *
4559 * Logged from:
4560 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4561 */
shafik43825842020-04-02 17:30:24 +01004562message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004563 // Volume type that this event pertains to
4564 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4565
4566 // Total number of files in database
4567 optional int64 item_count = 2;
4568 // Duration of idle maintenance, normalized per file
4569 optional float normalized_duration_millis = 3;
4570 // Number of thumbnails found to be stale, normalized per file
4571 optional float normalized_stale_thumbnails = 4;
4572 // Number of items found to be expired, normalized per file
4573 optional float normalized_expired_media = 5;
4574}
4575
Keun young Park3e033cb2019-12-18 11:27:35 -08004576/**
4577 * Represents boot time event with duration in ms.
4578 *
4579 * Logged from: bootstat and various system server components. Check each enums for details.
4580 */
4581message BootTimeEventDuration {
4582 enum DurationEvent {
4583 UNKNOWN = 0;
4584 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4585 ABSOLUTE_BOOT_TIME = 1;
4586 // Bootloader's 1st stage execution time.
4587 // Logged from bootstat.
4588 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4589 // Bootloader's 1st stage loading time.
4590 // Logged from bootstat.
4591 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4592 // Bootloader's kernel loading time.
4593 // Logged from bootstat.
4594 BOOTLOADER_KERNEL_LOAD = 4;
4595 // Bootloader's 2nd stage execution time.
4596 // Logged from bootstat.
4597 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4598 // Bootloader's 2nd stage loading time.
4599 // Logged from bootstat.
4600 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4601 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4602 // for locked device.
4603 // Logged from bootstat.
4604 BOOTLOADER_UI_WAIT = 7;
4605 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4606 // Logged from bootstat.
4607 BOOTLOADER_TOTAL = 8;
4608 // Shutdown duration inside init for the reboot before the current boot up.
4609 // Logged from f/b/services/.../BootReceiver.java.
4610 SHUTDOWN_DURATION = 9;
4611 // Total time for mounting of disk devices during bootup.
4612 // Logged from f/b/services/.../BootReceiver.java.
4613 MOUNT_DEFAULT_DURATION = 10;
4614 // Total time for early stage mounting of disk devices during bootup.
4615 // Logged from f/b/services/.../BootReceiver.java.
4616 MOUNT_EARLY_DURATION = 11;
4617 // Total time for late stage mounting of disk devices during bootup.
4618 // Logged from f/b/services/.../BootReceiver.java.
4619 MOUNT_LATE_DURATION = 12;
4620 // Average time to scan non-system app after OTA
4621 // Logged from f/b/services/.../PackageManagerService.java
4622 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4623 // Time to initialize Package manager after OTA
4624 // Logged from f/b/services/.../PackageManagerService.java
4625 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4626 // Time to scan all system app from Package manager after OTA
4627 // Logged from f/b/services/.../PackageManagerService.java
4628 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4629 // Init's total time for cold boot stage.
4630 // Logged from bootstat.
4631 COLDBOOT_WAIT = 16;
4632 // Init's total time for initializing selinux.
4633 // Logged from bootstat.
4634 SELINUX_INIT = 17;
4635 // Time since last factory reset.
4636 // Logged from bootstat.
4637 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004638 // Init's total time spent for completing the 1st stage.
4639 // Logged from bootstat.
4640 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004641 }
4642
4643 // Type of the event.
4644 optional DurationEvent event = 1;
4645 // Duration of the event in ms.
4646 optional int64 duration_millis = 2;
4647}
4648
4649/**
4650 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4651 * since boot-up.
4652 *
4653 * Logged from: bootstat and various system server components. Check each enums for details.
4654 */
4655message BootTimeEventElapsedTime {
4656 enum ElapsedTimeEvent {
4657 UNKNOWN = 0;
4658 // Time when init starts 1st stage. Logged from bootstat.
4659 ANDROID_INIT_STAGE_1 = 1;
4660 // Time when sys.boot_completed prop is set.
4661 // Logged from bootstat.
4662 BOOT_COMPLETE = 2;
4663 // BOOT_COMPLETE for encrypted device.
4664 BOOT_COMPLETE_ENCRYPTION = 3;
4665 // BOOT_COMPLETE for device with no encryption.
4666 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4667 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004668 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004669 // BOOT_COMPLETE after factory reset.
4670 FACTORY_RESET_BOOT_COMPLETE = 6;
4671 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4672 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004673 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4674 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004675 // BOOT_COMPLETE after OTA.
4676 OTA_BOOT_COMPLETE = 9;
4677 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4678 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004679 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4680 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004681 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4682 // Logged from f/b/services/.../UserController.java
4683 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4684 // Time when the system starts sending BOOT_COMPLETED broadcast.
4685 // Logged from f/b/services/.../UserController.java
4686 FRAMEWORK_BOOT_COMPLETED = 13;
4687 // Time when the package manager starts init.
4688 // Logged from f/b/services/.../SystemServer.java
4689 PACKAGE_MANAGER_INIT_START = 14;
4690 // Time when package manager is ready
4691 // Logged from f/b/services/.../SystemServer.java
4692 PACKAGE_MANAGER_INIT_READY = 15;
4693 // Represents the time when user has entered unlock credential for system with user pin.
4694 // Logged from bootstat.
4695 POST_DECRYPT = 16;
4696 // Represents the start of zygote's init.
4697 // Logged from zygote itself.
4698 ZYGOTE_INIT_START = 17;
4699 // Represents the start of secondary zygote's init.
4700 // TODO: add logging to zygote
4701 SECONDARY_ZYGOTE_INIT_START = 18;
4702 // Represents the start of system server's init.
4703 // Logged from f/b/services/.../SystemServer.java
4704 SYSTEM_SERVER_INIT_START = 19;
4705 // Represents the completion of system server's init.
4706 // Logged from f/b/services/.../SystemServer.java
4707 SYSTEM_SERVER_READY = 20;
4708 // Represents the start of launcher during boot-up.
4709 // TODO: add logging
4710 LAUNCHER_START = 21;
4711 // Represents the completion of launcher's initial rendering. User can use other apps from
4712 // launcher from this point.
4713 // TODO: add logging
4714 LAUNCHER_SHOWN = 22;
4715 }
4716
4717 // Type of the event.
4718 optional ElapsedTimeEvent event = 1;
4719 // Time since bootup for the event.
4720 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4721 optional int64 time_millis = 2;
4722}
4723
4724/**
4725 * Boot time events with UTC time.
4726 *
4727 * Logged from: bootstat and various system server components. Check each enums for details.
4728 */
4729message BootTimeEventUtcTime {
4730 enum UtcTimeEvent {
4731 UNKNOWN = 0;
4732 // Time of the bootstat's marking of 1st boot after the last factory reset.
4733 // Logged from bootstat.
4734 FACTORY_RESET_RESET_TIME = 1;
4735 // The time when bootstat records FACTORY_RESET_* events. This is close to
4736 // BOOT_COMPLETE time for the current bootup.
4737 // Logged from bootstat.
4738 FACTORY_RESET_CURRENT_TIME = 2;
4739 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4740 // Logged from bootstat.
4741 FACTORY_RESET_RECORD_VALUE = 3;
4742 }
4743
4744 // Type of the event.
4745 optional UtcTimeEvent event = 1;
4746 // UTC time for the event.
4747 optional int64 utc_time_secs = 2;
4748}
4749
4750/**
4751 * Boot time events representing specific error code during bootup.
4752 * Meaning of error code can be different per each event type.
4753 *
4754 * Logged from: bootstat and various system server components. Check each enums for details.
4755 */
4756message BootTimeEventErrorCode {
4757 enum ErrorCodeEvent {
4758 UNKNOWN = 0;
4759 // Linux error code for time() call to get the current UTC time.
4760 // Logged from bootstat.
4761 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4762 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4763 // as UMOUNT_STAT_* from init/reboot.cpp.
4764 // Logged from f/b/services/.../BootReceiver.java.
4765 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004766 // Reprepsents fie system mounting error code of /data partition for the current boot.
4767 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004768 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004769 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004770 }
4771
4772 // Type of the event.
4773 optional ErrorCodeEvent event = 1;
4774 // error code defined per each event type.
4775 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4776 // FS_MGR_FS_STAT.
4777 optional int32 error_code = 2;
4778}
4779
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004780/**
4781 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4782 * after an OTA.
4783 *
4784 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004785 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004786 */
4787message SnapshotMergeReported {
4788 // Keep in sync with
4789 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4790 enum UpdateState {
4791 // No update or merge is in progress.
4792 NONE = 0;
4793 // An update is applying; snapshots may already exist.
4794 INITIATED = 1;
4795 // An update is pending, but has not been successfully booted yet.
4796 UNVERIFIED = 2;
4797 // The kernel is merging in the background.
4798 MERGING = 3;
4799 // Post-merge cleanup steps could not be completed due to a transient
4800 // error, but the next reboot will finish any pending operations.
4801 MERGE_NEEDS_REBOOT = 4;
4802 // Merging is complete, and needs to be acknowledged.
4803 MERGE_COMPLETED = 5;
4804 // Merging failed due to an unrecoverable error.
4805 MERGE_FAILED = 6;
4806 // The update was implicitly cancelled, either by a rollback or a flash
4807 // operation via fastboot. This state can only be returned by WaitForMerge.
4808 CANCELLED = 7;
4809 };
4810
4811 // Status of the update after the merge attempts.
4812 optional UpdateState final_state = 1;
4813
4814 // Time to complete a merge operation in milliseconds.
4815 // A negative value corresponds to the case in which the merge operation
4816 // was interrupted and resumed (e.g. in case of a system reboot during the
4817 // merge).
4818 optional int64 duration_millis = 2;
4819
4820 // Number of reboots that occurred after issuing and before completing the
4821 // merge of all the snapshot devices.
4822 optional int32 intermediate_reboots = 3;
4823}
4824
Chenjie Yubbcbc602018-02-05 16:51:52 -08004825//////////////////////////////////////////////////////////////////////
4826// Pulled atoms below this line //
4827//////////////////////////////////////////////////////////////////////
4828
4829/**
David Chenc8a43242017-10-17 16:23:28 -07004830 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4831 *
4832 * Pulled from:
4833 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4834 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004835message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004836 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004837
4838 optional int64 rx_bytes = 2;
4839
4840 optional int64 rx_packets = 3;
4841
4842 optional int64 tx_bytes = 4;
4843
4844 optional int64 tx_packets = 5;
4845}
4846
4847/**
4848 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4849 *
4850 * Pulled from:
4851 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4852 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004853message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004854 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004855
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004856 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4857 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004858
4859 optional int64 rx_bytes = 3;
4860
4861 optional int64 rx_packets = 4;
4862
4863 optional int64 tx_bytes = 5;
4864
4865 optional int64 tx_packets = 6;
4866}
4867
4868/**
4869 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4870 *
4871 * Pulled from:
4872 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4873 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004874message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004875 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004876
4877 optional int64 rx_bytes = 2;
4878
4879 optional int64 rx_packets = 3;
4880
4881 optional int64 tx_bytes = 4;
4882
4883 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004884
4885 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004886}
4887
4888/**
4889 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4890 *
4891 * Pulled from:
4892 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4893 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004894message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004895 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004896
Yao Chenc40a19d2018-03-15 16:48:25 -07004897 // 1 denotes foreground and 0 denotes background. This is called Set in
4898 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004899 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004900
4901 optional int64 rx_bytes = 3;
4902
4903 optional int64 rx_packets = 4;
4904
4905 optional int64 tx_bytes = 5;
4906
4907 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004908
4909 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004910}
4911
4912/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004913 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4914 *
4915 * Pulled from:
4916 * StatsCompanionService
4917 */
4918message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004919 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004920
4921 optional int64 rx_bytes = 2;
4922
4923 optional int64 tx_bytes = 3;
4924}
4925
4926/**
David Chenc8a43242017-10-17 16:23:28 -07004927 * Pulls the kernel wakelock durations. This atom is adapted from
4928 * android/internal/os/KernelWakelockStats.java
4929 *
4930 * Pulled from:
4931 * StatsCompanionService using KernelWakelockReader.
4932 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004933message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004934 optional string name = 1;
4935
4936 optional int32 count = 2;
4937
4938 optional int32 version = 3;
4939
Yangster-maca8a30442018-10-13 23:46:34 -07004940 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004941}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004942
Chenjie Yu05013b32017-11-21 10:21:41 -08004943/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004944 * Pulls low power state information. If power.stats HAL is not available, this
4945 * includes platform and subsystem sleep state information,
4946 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4947 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004948 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004949 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004950 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4951 * as defined in:
4952 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004953 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004954message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004955 // Subsystem name
4956 optional string subsystem_name = 1;
4957 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4958 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004959 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4960 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004961 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004962 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004963 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004964 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004965 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004966}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004967
Chenjie Yu05013b32017-11-21 10:21:41 -08004968/**
Bookatz92da2832018-11-01 18:10:03 -07004969 * Pulls on-device power measurement information.
4970 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4971 * Pulled from:
4972 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4973 */
4974message OnDevicePowerMeasurement {
4975 // Name of the subsystem (to which the rail belongs).
4976 optional string subsystem_name = 1;
4977
4978 // Rail name. The rail lies within the subsystem.
4979 optional string rail_name = 2;
4980
4981 // Time (in ms since boot) at which the rail energy value was measured.
4982 // This may differ slightly from the time that statsd logs this information.
4983 optional uint64 measurement_timestamp_millis = 3;
4984
4985 // Accumulated energy used via the rail since device boot in uWs.
4986 optional uint64 energy_microwatt_secs = 4;
4987}
4988
4989/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004990 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004991 * Pulls the time the cpu spend on the frequency index. Frequency index
4992 * starts from highest to lowest. The value should be monotonically
4993 * increasing since boot. However, if there is a cpu
4994 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004995 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004996message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004997 optional uint32 cluster = 1;
4998 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004999 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005000}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005001
Chenjie Yu05013b32017-11-21 10:21:41 -08005002/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005003 * Pulls Cpu Time Per Uid.
5004 * Note that isolated process uid time should be attributed to host uids.
5005 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005006message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005007 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005008 optional uint64 user_time_micros = 2;
5009 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005010}
5011
5012/**
5013 * Pulls Cpu Time Per Uid per frequency.
5014 * Note that isolated process uid time should be attributed to host uids.
5015 * For each uid, we order the time by descending frequencies.
5016 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005017message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005018 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005019 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005020 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005021}
Hugo Benichi884970e2017-11-14 22:42:46 +09005022
Chenjie Yu05013b32017-11-21 10:21:41 -08005023/**
5024 * Pulls Wifi Controller Activity Energy Info
5025 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005026message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005027 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005028 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005029 // stack reported state
5030 // TODO: replace this with proto enum
5031 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005032 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005033 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005034 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005035 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005036 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005037 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005038 // product of current(mA), voltage(V) and time(ms)
5039 optional uint64 controller_energy_used = 6;
5040}
5041
5042/**
5043 * Pulls Modem Activity Energy Info
5044 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005045message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005046 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005047 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005048 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005049 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005050 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005051 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005052 /**
5053 * Tx power index
5054 * index 0 = tx_power < 0dBm
5055 * index 1 = 0dBm < tx_power < 5dBm
5056 * index 2 = 5dBm < tx_power < 15dBm
5057 * index 3 = 15dBm < tx_power < 20dBm
5058 * index 4 = tx_power > 20dBm
5059 */
5060 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005061 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005062 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005063 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005064 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005066 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005067 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005068 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005069 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005070 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005071 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005072 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005073 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005074}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005075
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005076/**
5077 * Pulls Bluetooth Activity Energy Info
5078 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5079 */
5080message BluetoothActivityInfo {
5081 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005082 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005083 // bluetooth stack state
5084 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005085 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005086 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005087 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005088 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005089 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005091 // product of current(mA), voltage(V) and time(ms)
5092 optional uint64 energy_used = 6;
5093}
5094
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005095/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005096 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005097 *
5098 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005099 */
5100message ProcessMemoryState {
5101 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005102 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005103
5104 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005105 // Usually package name, "system" for system server.
5106 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005107 optional string process_name = 2;
5108
Rafal Slawikda51b932018-12-13 16:31:33 +00005109 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005110 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005111
5112 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005113 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005114
5115 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005116 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005117
Rajeev Kumar90235992018-01-29 11:06:48 -08005118 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005119 // Value is read from memory.stat, field total_rss if per-app memory
5120 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005121 optional int64 rss_in_bytes = 6;
5122
5123 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005124 // Value is read from memory.stat, field total_cache if per-app memory
5125 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005126 optional int64 cache_in_bytes = 7;
5127
5128 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005129 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005130 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005131 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005132
Rafal Slawik203c3db2019-09-25 19:53:01 +01005133 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005134 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005135
Rafal Slawik203c3db2019-09-25 19:53:01 +01005136 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5137 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005138
Rafal Slawik203c3db2019-09-25 19:53:01 +01005139 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5140 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005141}
5142
5143/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005144 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005145 *
5146 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5147 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005148 *
5149 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005150 */
5151message ProcessMemoryHighWaterMark {
5152 // The uid if available. -1 means not available.
5153 optional int32 uid = 1 [(is_uid) = true];
5154
Rafal Slawikda51b932018-12-13 16:31:33 +00005155 // The process name.
5156 // Usually package name or process cmdline.
5157 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005158 optional string process_name = 2;
5159
Rafal Slawik239b6802019-09-09 18:46:01 +01005160 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5161 // computed by converting kilobytes to bytes.
5162 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5163
Rafal Slawik3bea8952018-11-15 12:39:33 +00005164 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5165 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005166 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005167}
5168
5169/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005170 * Logs the memory stats for a process.
5171 *
5172 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5173 * and for selected native processes.
5174 */
5175message ProcessMemorySnapshot {
5176 // The uid if available. -1 means not available.
5177 optional int32 uid = 1 [(is_uid) = true];
5178
5179 // The process name.
5180 // Usually package name or process cmdline.
5181 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5182 optional string process_name = 2;
5183
5184 // The pid of the process.
5185 // Allows to disambiguate instances of the process.
5186 optional int32 pid = 3;
5187
5188 // The current OOM score adjustment value.
5189 // Read from ProcessRecord for managed processes.
5190 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5191 optional int32 oom_score_adj = 4;
5192
5193 // The current RSS of the process.
5194 // VmRSS from /proc/pid/status.
5195 optional int32 rss_in_kilobytes = 5;
5196
5197 // The current anon RSS of the process.
5198 // RssAnon from /proc/pid/status.
5199 optional int32 anon_rss_in_kilobytes = 6;
5200
5201 // The current swap size of the process.
5202 // VmSwap from /proc/pid/status.
5203 optional int32 swap_in_kilobytes = 7;
5204
5205 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5206 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5207}
5208
5209/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005210 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005211 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005212message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005213 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005214}
5215
5216/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005217 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005218 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005219message SystemUptime {
5220 // Milliseconds since the system was booted.
5221 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5222 // for external input).
5223 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005224 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005225}
5226
5227/*
5228 * Reads from /proc/uid_concurrent_active_time which has the format:
5229 * active: X (X is # cores)
5230 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5231 * [uid1]: [time-0] [time-1] [time-2] ... ...
5232 * ...
5233 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5234 * The file contains a monotonically increasing count of time for a single boot.
5235 */
5236message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005237 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005238 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005239}
5240
5241/**
5242 * Reads from /proc/uid_concurrent_policy_time which has the format:
5243 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5244 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5245 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5246 * ...
5247 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5248 * The file contains a monotonically increasing count of time for a single boot.
5249 */
5250message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005251 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005252 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005253 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005254}
5255
5256/*
5257 * Pulls free disk space, for data, system partition and temporary directory.
5258 */
5259message DiskSpace {
5260 // available bytes in data partition
5261 optional uint64 data_available_bytes = 1;
5262 // available bytes in system partition
5263 optional uint64 system_available_bytes = 2;
5264 // available bytes in download cache or temp directories
5265 optional uint64 temp_available_bytes = 3;
5266}
Tej Singhbf972d92018-01-10 20:51:13 -08005267
5268/**
5269 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005270 *
5271 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005272 */
5273message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005274 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005275}
5276
5277/**
5278 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005279 * Pulled from:
5280 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005281 */
5282message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005283 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005284}
5285
5286/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005287 * Pulls battery voltage.
5288 * Pulled from:
5289 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5290 */
5291message BatteryVoltage {
5292 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005293 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005294}
5295
5296/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005297 * Pulls battery level (percent full, from 0 to 100).
5298 *
5299 * Pulled from:
5300 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5301 */
5302message BatteryLevel {
5303 // Battery level. Should be in [0, 100].
5304 optional int32 battery_level = 1;
5305}
5306
5307/**
Tej Singhd89137e2018-03-26 14:51:40 -07005308 * Pulls the temperature of various parts of the device.
5309 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005310 *
Maggie White442b6312019-04-05 16:26:44 -07005311 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005312 */
5313message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005314 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005315 optional android.os.TemperatureTypeEnum sensor_location = 1;
5316
5317 // The name of the temperature source. Eg. CPU0
5318 optional string sensor_name = 2;
5319
Tej Singhd89137e2018-03-26 14:51:40 -07005320 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005321 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005322 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005323
5324 // Relative severity of the throttling, see enum definition.
5325 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005326}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005327
5328/**
5329 * Pulls the statistics of calls to Binder.
5330 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005331 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5332 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005333 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005334 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005335 */
5336message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005337 // UID of the process responsible for the binder transaction. It will be set if the process
5338 // executing the binder transaction attribute the transaction to another uid using
5339 // Binder.setThreadWorkSource().
5340 //
5341 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005342 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005343 // UID of the process executing the binder transaction.
5344 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005345 // Fully qualified class name of the API call.
5346 //
5347 // This is a system server class name.
5348 //
5349 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5350 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5351 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5352 // commonly used APIs.
5353 optional string service_class_name = 2;
5354 // Method name of the API call. It can also be a transaction code if we cannot
5355 // resolve it to a name. See Binder#getTransactionName.
5356 //
5357 // This is a system server method name.
5358 optional string service_method_name = 3;
5359 // Total number of API calls.
5360 optional int64 call_count = 4;
5361 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5362 optional bool screen_interactive = 13;
5363 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5364 // call_count will be equal to recorded_call_count.
5365 //
5366 // If recorded_call_count is different than call_count, it means data collection has been
5367 // sampled. All the fields below will be sampled in this case.
5368 optional int64 recorded_call_count = 12;
5369 // Number of exceptions thrown by the API.
5370 optional int64 recorded_exception_count = 5;
5371 // Total latency of all API calls.
5372 // Average can be computed using total_latency_micros / recorded_call_count.
5373 optional int64 recorded_total_latency_micros = 6;
5374 // Maximum latency of one API call.
5375 optional int64 recorded_max_latency_micros = 7;
5376 // Total CPU usage of all API calls.
5377 // Average can be computed using total_cpu_micros / recorded_call_count.
5378 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5379 optional int64 recorded_total_cpu_micros = 8;
5380 // Maximum CPU usage of one API call.
5381 optional int64 recorded_max_cpu_micros = 9;
5382 // Maximum parcel reply size of one API call.
5383 optional int64 recorded_max_reply_size_bytes = 10;
5384 // Maximum parcel request size of one API call.
5385 optional int64 recorded_max_request_size_bytes = 11;
5386}
5387
5388/**
5389 * Pulls the statistics of exceptions during calls to Binder.
5390 *
5391 * Binder stats are cumulative from boot unless somebody reset the data using
5392 * > adb shell dumpsys binder_calls_stats --reset
5393 */
5394message BinderCallsExceptions {
5395 // Exception class name, e.g. java.lang.IllegalArgumentException.
5396 //
5397 // This is an exception class name thrown by the system server.
5398 optional string exception_class_name = 1;
5399 // Total number of exceptions.
5400 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005401}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005402
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005403/**
5404 * Pulls the statistics of message dispatching on HandlerThreads.
5405 *
5406 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5407 * config on the device.
5408 *
5409 * Next tag: 11
5410 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005411message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005412 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005413 optional int32 uid = 1 [(is_uid) = true];
5414
5415 // Fully qualified class name of the handler target class.
5416 //
5417 // This field does not contain PII. This is a system server class name.
5418 optional string handler_class_name = 2;
5419
5420 // The name of the thread that runs the Looper.
5421 //
5422 // This field does not contain PII. This is a system server thread name.
5423 optional string looper_thread_name = 3;
5424
5425 // The name of the dispatched message.
5426 //
5427 // This field does not contain PII. This is a system server constant or class
5428 // name.
5429 optional string message_name = 4;
5430
5431 // Total number of successfully dispatched messages.
5432 optional int64 message_count = 5;
5433
5434 // Total number of messages that failed dispatching.
5435 optional int64 exception_count = 6;
5436
5437 // Total number of processed messages we have data recorded for. If we
5438 // collected data for all the messages, message_count will be equal to
5439 // recorded_message_count.
5440 //
5441 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005442 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005443 optional int64 recorded_message_count = 7;
5444
5445 // Total latency of all processed messages.
5446 // Average can be computed using recorded_total_latency_micros /
5447 // recorded_message_count.
5448 optional int64 recorded_total_latency_micros = 8;
5449
5450 // Total CPU usage of all processed message.
5451 // Average can be computed using recorded_total_cpu_micros /
5452 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005453 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005454 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005455
5456 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5457 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005458
5459 // Max recorded CPU usage of all processed messages.
5460 optional int64 recorded_max_cpu_micros = 11;
5461
5462 // Max recorded latency of all processed messages.
5463 optional int64 recorded_max_latency_micros = 12;
5464
5465 // Total number of messages we tracked the dispatching delay for. If we
5466 // collected data for all the messages, message_count will be equal to
5467 // recorded_delay_message_count.
5468 //
5469 // If recorded_delay_message_count is different than message_count, it means data
5470 // collection has been sampled or/and not all messages specified the target dispatch time.
5471 // The fields below will be sampled in this case.
5472 optional int64 recorded_delay_message_count = 13;
5473
5474 // Total dispatching delay of all processed messages.
5475 // Calculated as a difference between the target dispatching time (Message.when)
5476 // and the actual dispatching time.
5477 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5478 optional int64 recorded_total_delay_millis = 14;
5479
5480 // Max dispatching delay of all processed messages.
5481 // Calculated as a difference between the target dispatching time (Message.when)
5482 // and the actual dispatching time.
5483 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005484}
Tej Singh86dc9db2018-09-06 00:39:57 +00005485
5486/**
5487 * Pulls disk information, such as write speed and latency.
5488 */
5489message DiskStats {
5490 // Time taken to open, write 512B to, and close a file.
5491 // -1 if error performing the check.
5492 optional int64 data_write_latency_millis = 1;
5493
5494 optional bool file_based_encryption = 2;
5495
5496 // Recent disk write speed in kB/s.
5497 // -1 if error querying storageed.
5498 // 0 if data is unavailable.
5499 optional int32 recent_disk_write_speed = 3;
5500}
5501
5502
5503/**
5504 * Free and total bytes of the Data, Cache, and System partition.
5505 */
5506message DirectoryUsage {
5507 enum Directory {
5508 UNKNOWN = 0;
5509 DATA = 1;
5510 CACHE = 2;
5511 SYSTEM = 3;
5512 }
5513 optional Directory directory = 1;
5514 optional int64 free_bytes = 2;
5515 optional int64 total_bytes = 3;
5516}
5517
5518
5519/**
5520 * Size of an application: apk size, data size, and cache size.
5521 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5522 * Information is only reported for apps with the primary user (user 0).
5523 * Sizes are aggregated by package name.
5524 */
5525message AppSize {
5526 // Including uids will involve modifying diskstats logic.
5527 optional string package_name = 1;
5528 // App size in bytes. -1 if unavailable.
5529 optional int64 app_size_bytes = 2;
5530 // App data size in bytes. -1 if unavailable.
5531 optional int64 app_data_size_bytes = 3;
5532 // App cache size in bytes. -1 if unavailable.
5533 optional int64 app_cache_size_bytes = 4;
5534 // Time that the cache file was produced.
5535 // Uses System.currentTimeMillis(), which is wall clock time.
5536 optional int64 cache_time_millis = 5;
5537}
5538
5539
5540/**
5541 * Size of a particular category. Eg: photos, videos.
5542 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5543 */
5544message CategorySize {
5545 enum Category {
5546 UNKNOWN = 0;
5547 APP_SIZE = 1;
5548 APP_DATA_SIZE = 2;
5549 APP_CACHE_SIZE = 3;
5550 PHOTOS = 4;
5551 VIDEOS = 5;
5552 AUDIO = 6;
5553 DOWNLOADS = 7;
5554 SYSTEM = 8;
5555 OTHER = 9;
5556 }
5557 optional Category category = 1;
5558 // Category size in bytes.
5559 optional int64 size_bytes = 2;
5560 // Time that the cache file was produced.
5561 // Uses System.currentTimeMillis(), which is wall clock time.
5562 optional int64 cache_time_millis = 3;
5563}
Tej Singhd6d6d772018-09-05 17:41:25 -07005564
5565/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005566 * Pulls per uid I/O stats. The stats are cumulative since boot.
5567 *
5568 * Read/write bytes are I/O events from a storage device
5569 * Read/write chars are data requested by read/write syscalls, and can be
5570 * satisfied by caching.
5571 *
5572 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5573 */
5574message DiskIo {
5575 optional int32 uid = 1 [(is_uid) = true];
5576 optional int64 fg_chars_read = 2;
5577 optional int64 fg_chars_write = 3;
5578 optional int64 fg_bytes_read = 4;
5579 optional int64 fg_bytes_write = 5;
5580 optional int64 bg_chars_read = 6;
5581 optional int64 bg_chars_write = 7;
5582 optional int64 bg_bytes_read = 8;
5583 optional int64 bg_bytes_write = 9;
5584 optional int64 fg_fsync = 10;
5585 optional int64 bg_fsync= 11;
5586}
5587
5588
5589/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005590 * Pulls the number of fingerprints for each user.
5591 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005592 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005593 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005594message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005595 // The associated user. Eg: 0 for owners, 10+ for others.
5596 // Defined in android/os/UserHandle.java
5597 optional int32 user = 1;
5598 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005599 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005600}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005601
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005602/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005603 * Pulls the number of faces for each user.
5604 *
5605 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5606 */
5607message NumFacesEnrolled {
5608 // The associated user. Eg: 0 for owners, 10+ for others.
5609 // Defined in android/os/UserHandle.java
5610 optional int32 user = 1;
5611 // Number of faces registered to that user.
5612 optional int32 num_faces_enrolled = 2;
5613}
5614/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005615 * A mapping of role holder -> role
5616 */
5617message RoleHolder {
5618 // uid of the role holder
5619 optional int32 uid = 1 [(is_uid) = true];
5620
5621 // package name of the role holder
5622 optional string package_name = 2;
5623
5624 // the role held
5625 optional string role = 3;
5626}
5627
Yangsteraf9aee72018-10-12 09:26:16 -07005628message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005629 // These are all in byte resolution.
5630 optional int64 min = 1 [deprecated = true];
5631 optional int64 average = 2 [deprecated = true];
5632 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005633
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005634 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5635 // int64 fields.
5636 optional int32 mean_kb = 4;
5637 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005638}
5639
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005640// A reduced subset of process states; reducing the number of possible states allows more
5641// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5642enum ProcessStateAggregated {
5643 PROCESS_STATE_UNKNOWN = 0;
5644 // Persistent system process.
5645 PROCESS_STATE_PERSISTENT = 1;
5646 // Top activity; actually any visible activity.
5647 PROCESS_STATE_TOP = 2;
5648 // Process binding to top or a foreground service.
5649 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5650 // Processing running a foreground service.
5651 PROCESS_STATE_FGS = 4;
5652 // Important foreground process (ime, wallpaper, etc).
5653 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5654 // Important background process.
5655 PROCESS_STATE_BACKGROUND = 6;
5656 // Process running a receiver.
5657 PROCESS_STATE_RECEIVER = 7;
5658 // All kinds of cached processes.
5659 PROCESS_STATE_CACHED = 8;
5660}
5661
5662// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005663message ProcessStatsStateProto {
5664 optional android.service.procstats.ScreenState screen_state = 1;
5665
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005666 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005667
5668 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5669 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005670 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5671
5672 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005673
5674 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005675 optional int64 duration_millis = 4 [deprecated = true];
5676 // Same as above, but with minute resolution so it fits into an int32.
5677 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005678
5679 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005680 optional int64 realtime_duration_millis = 9 [deprecated = true];
5681 // Same as above, but with minute resolution so it fits into an int32.
5682 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005683
5684 // # of samples taken
5685 optional int32 sample_size = 5;
5686
5687 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005688 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005689
5690 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005691 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005692
5693 // RSS is memory resident for this process
5694 optional AggStats rss = 8;
5695}
5696
5697// Next Tag: 7
5698message ProcessStatsProto {
5699 // Name of process.
5700 optional string process = 1;
5701
5702 // Uid of the process.
5703 optional int32 uid = 2;
5704
5705 // Information about how often kills occurred
5706 message Kill {
5707 // Count of excessive CPU kills
5708 optional int32 cpu = 1;
5709
5710 // Count of kills when cached
5711 optional int32 cached = 2;
5712
5713 // PSS stats during cached kill
5714 optional AggStats cached_pss = 3;
5715 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005716 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005717
5718 // Time and memory spent in various states.
5719 repeated ProcessStatsStateProto states = 5;
5720
5721 // Total time process has been running... screen_state, memory_state, and process_state
5722 // will not be set.
5723 optional ProcessStatsStateProto total_running_state = 6;
5724}
5725
5726message PackageServiceOperationStatsProto {
5727 // Operate enum: Started, Foreground, Bound, Executing
5728 optional android.service.procstats.ServiceOperationState operation = 1;
5729
5730 // Number of times the service was in this operation.
5731 optional int32 count = 2;
5732
5733 // Information about a state the service can be in.
5734 message StateStats {
5735 // Screen state enum.
5736 optional android.service.procstats.ScreenState screen_state = 1;
5737 // Memory state enum.
5738 optional android.service.procstats.MemoryState memory_state = 2;
5739
5740 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005741 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005742 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005743 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005744 }
5745 repeated StateStats state_stats = 3;
5746}
5747
5748message PackageServiceStatsProto {
5749 // Name of service component.
5750 optional string service_name = 1;
5751
5752 // The operation stats.
5753 // The package_name, package_uid, package_version, service_name will not be set to save space.
5754 repeated PackageServiceOperationStatsProto operation_stats = 2;
5755}
5756
5757message PackageAssociationSourceProcessStatsProto {
5758 // Uid of the process.
5759 optional int32 process_uid = 1;
5760 // Process name.
5761 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005762 // Package name.
5763 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005764 // Total count of the times this association appeared.
5765 optional int32 total_count = 3;
5766
5767 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005768 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005769
5770 // Total count of the times this association became actively impacting its target process.
5771 optional int32 active_count = 5;
5772
5773 // Information on one source in this association.
5774 message StateStats {
5775 // Process state enum.
5776 optional android.service.procstats.ProcessState process_state = 1;
5777 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005778 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005779 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005780 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005781 }
5782 repeated StateStats active_state_stats = 6;
5783}
5784
5785message PackageAssociationProcessStatsProto {
5786 // Name of the target component.
5787 optional string component_name = 1;
5788 // Information on one source in this association.
5789 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5790}
5791
5792
5793message ProcessStatsPackageProto {
5794 // Name of package.
5795 optional string package = 1;
5796
5797 // Uid of the package.
5798 optional int32 uid = 2;
5799
5800 // Version of the package.
5801 optional int64 version = 3;
5802
5803 // Stats for each process running with the package loaded in to it.
5804 repeated ProcessStatsProto process_stats = 4;
5805
5806 // Stats for each of the package's services.
5807 repeated PackageServiceStatsProto service_stats = 5;
5808
5809 // Stats for each association with the package.
5810 repeated PackageAssociationProcessStatsProto association_stats = 6;
5811}
5812
5813message ProcessStatsSectionProto {
5814 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005815 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005816
5817 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005818 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005819
5820 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005821 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005822
5823 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005824 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005825
5826 // System runtime library. e.g. "libdvm.so", "libart.so".
5827 optional string runtime = 5;
5828
5829 // whether kernel reports swapped pss.
5830 optional bool has_swapped_pss = 6;
5831
5832 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5833 enum Status {
5834 STATUS_UNKNOWN = 0;
5835 STATUS_COMPLETE = 1;
5836 STATUS_PARTIAL = 2;
5837 STATUS_SHUTDOWN = 3;
5838 STATUS_SYSPROPS = 4;
5839 }
5840 repeated Status status = 7;
5841
Chenjie Yub2ecc792019-01-17 10:27:26 -08005842 // Number of pages available of various types and sizes, representation fragmentation.
5843 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5844
Yangsteraf9aee72018-10-12 09:26:16 -07005845 // Stats for each process.
5846 repeated ProcessStatsProto process_stats = 8;
5847
5848 // Stats for each package.
5849 repeated ProcessStatsPackageProto package_stats = 9;
5850}
5851
Chenjie Yub2ecc792019-01-17 10:27:26 -08005852message ProcessStatsAvailablePagesProto {
5853 // Node these pages are in (as per /proc/pagetypeinfo)
5854 optional int32 node = 1;
5855
5856 // Zone these pages are in (as per /proc/pagetypeinfo)
5857 optional string zone = 2;
5858
5859 // Label for the type of these pages (as per /proc/pagetypeinfo)
5860 optional string label = 3;
5861
5862 // Distribution of number of pages available by order size. First entry in array is
5863 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5864 repeated int32 pages_per_order = 4;
5865}
5866
Chenjie Yu12e5e672018-09-14 15:54:59 -07005867/**
5868 * Pulled from ProcessStatsService.java
5869 */
5870message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005871 optional ProcessStatsSectionProto proc_stats_section = 1;
5872}
5873
Chenjie Yuf910b7802019-01-11 16:08:20 -08005874/**
5875 * Pulled from ProcessStatsService.java
5876 */
5877message ProcStatsPkgProc {
5878 optional ProcessStatsSectionProto proc_stats_section = 1;
5879}
5880
Chris Wrencdea3b72019-11-22 16:58:17 -05005881// Next Tag: 2
5882message PackageRemoteViewInfoProto {
5883 optional string package_name = 1;
5884 // add per-package additional info here (like channels)
5885}
5886
5887// Next Tag: 2
5888message NotificationRemoteViewsProto {
5889 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5890}
5891
5892/**
5893 * Pulled from NotificationManagerService.java
5894 */
5895message NotificationRemoteViews {
5896 optional NotificationRemoteViewsProto notification_remote_views = 1;
5897}
5898
Yotam Aron74299972020-01-16 16:20:58 +02005899/**
5900 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5901 */
5902message PackageNotificationPreferences {
5903 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005904 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005905 // Notification importance, which specifies when and how a notification is displayed.
5906 // Specified under core/java/android/app/NotificationManager.java.
5907 optional int32 importance = 2;
5908 // Lockscreen visibility as set by the user.
5909 optional int32 visibility = 3;
5910 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5911 // PreferencesHelper.java)
5912 optional int32 user_locked_fields = 4;
5913}
5914
5915/**
5916 * Atom that contains a list of a package's channel preferences, pulled from
5917 * NotificationManagerService.java.
5918 */
5919message PackageNotificationChannelPreferences {
5920 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005921 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005922 // Channel's ID. Should always be available.
5923 optional string channel_id = 2;
5924 // Channel's name. Should always be available.
5925 optional string channel_name = 3;
5926 // Channel's description. Optionally set by the channel creator.
5927 optional string description = 4;
5928 // Notification importance, which specifies when and how a notification is displayed. Specified
5929 // under core/java/android/app/NotificationManager.java.
5930 optional int32 importance = 5;
5931 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5932 // at core/java/android/app/NotificationChannel.java
5933 optional int32 user_locked_fields = 6;
5934 // Indicates if the channel was deleted by the app.
5935 optional bool is_deleted = 7;
5936}
5937
5938/**
5939 * Atom that contains a list of a package's channel group preferences, pulled from
5940 * NotificationManagerService.java.
5941 */
5942message PackageNotificationChannelGroupPreferences {
5943 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005944 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005945 // Channel Group's ID. Should always be available.
5946 optional string group_id = 2;
5947 // Channel Group's name. Should always be available.
5948 optional string group_name = 3;
5949 // Channel Group's description. Optionally set by group creator.
5950 optional string description = 4;
5951 // Indicates if notifications from this channel group are blocked.
5952 optional bool is_blocked = 5;
5953 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5954 // at core/java/android/app/NotificationChannelGroup.java
5955 optional int32 user_locked_fields = 6;
5956}
5957
Yangsteraf9aee72018-10-12 09:26:16 -07005958message PowerProfileProto {
5959 optional double cpu_suspend = 1;
5960
5961 optional double cpu_idle = 2;
5962
5963 optional double cpu_active = 3;
5964
5965 message CpuCluster {
5966 optional int32 id = 1;
5967 optional double cluster_power = 2;
5968 optional int32 cores = 3;
5969 repeated int64 speed = 4;
5970 repeated double core_power = 5;
5971 }
5972
5973 repeated CpuCluster cpu_cluster = 40;
5974
5975 optional double wifi_scan = 4;
5976
5977 optional double wifi_on = 5;
5978
5979 optional double wifi_active = 6;
5980
5981 optional double wifi_controller_idle = 7;
5982
5983 optional double wifi_controller_rx = 8;
5984
5985 optional double wifi_controller_tx = 9;
5986
5987 repeated double wifi_controller_tx_levels = 10;
5988
5989 optional double wifi_controller_operating_voltage = 11;
5990
5991 optional double bluetooth_controller_idle = 12;
5992
5993 optional double bluetooth_controller_rx = 13;
5994
5995 optional double bluetooth_controller_tx = 14;
5996
5997 optional double bluetooth_controller_operating_voltage = 15;
5998
5999 optional double modem_controller_sleep = 16;
6000
6001 optional double modem_controller_idle = 17;
6002
6003 optional double modem_controller_rx = 18;
6004
6005 repeated double modem_controller_tx = 19;
6006
6007 optional double modem_controller_operating_voltage = 20;
6008
6009 optional double gps_on = 21;
6010
6011 repeated double gps_signal_quality_based = 22;
6012
6013 optional double gps_operating_voltage = 23;
6014
6015 optional double bluetooth_on = 24;
6016
6017 optional double bluetooth_active = 25;
6018
6019 optional double bluetooth_at_cmd = 26;
6020
6021 optional double ambient_display = 27;
6022
6023 optional double screen_on = 28;
6024
6025 optional double radio_on = 29;
6026
6027 optional double radio_scanning = 30;
6028
6029 optional double radio_active = 31;
6030
6031 optional double screen_full = 32;
6032
6033 optional double audio = 33;
6034
6035 optional double video = 34;
6036
6037 optional double flashlight = 35;
6038
6039 optional double memory = 36;
6040
6041 optional double camera = 37;
6042
6043 optional double wifi_batched_scan = 38;
6044
6045 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006046}
Chenjie Yuab530202018-09-26 12:39:20 -07006047
6048/**
6049 * power_profile.xml and other constants for power model calculations.
6050 * Pulled from PowerProfile.java
6051 */
6052message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006053 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006054}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006055
6056/**
arangelovd5db50e2018-10-12 20:24:39 +01006057 * Logs when a user restriction was added or removed.
6058 *
6059 * Logged from:
6060 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6061 */
6062message UserRestrictionChanged {
6063 // The raw string of the user restriction as defined in UserManager.
6064 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6065 optional string restriction = 1;
6066 // Whether the restriction is enabled or disabled.
6067 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006068}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006069
6070/**
6071 * Pulls process user time and system time. Puller takes a snapshot of all pids
6072 * in the system and returns cpu stats for those that are working at the time.
6073 * Dead pids will be dropped. Kernel processes are excluded.
6074 * Min cool-down is 5 sec.
6075 */
6076message ProcessCpuTime {
6077 optional int32 uid = 1 [(is_uid) = true];
6078
6079 optional string process_name = 2;
6080 // Process cpu time in user space, cumulative from boot/process start
6081 optional int64 user_time_millis = 3;
6082 // Process cpu time in system space, cumulative from boot/process start
6083 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006084}
Misha Wagner5a51e002018-10-03 15:04:09 +01006085
6086/**
6087 * Pulls the CPU usage for each thread.
6088 *
6089 * Read from /proc/$PID/task/$TID/time_in_state files.
6090 *
6091 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6092 * time_in_state files not being present on some phones, have not been addressed. These should be
6093 * considered before a public release.
6094 */
6095message CpuTimePerThreadFreq {
6096 // UID that owns the process.
6097 optional int32 uid = 1 [(is_uid) = true];
6098 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006099 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006100 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006101 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006102 // Name of the process taken from `/proc/$PID/cmdline`.
6103 optional string process_name = 4;
6104 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6105 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006106
6107 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6108 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6109 // frequencies are given here as the alternative is sending eight separate atoms. This method
6110 // significantly reduces the amount of data created
6111 optional int32 frequency1_khz = 6;
6112 optional int32 time1_millis = 7;
6113 optional int32 frequency2_khz = 8;
6114 optional int32 time2_millis = 9;
6115 optional int32 frequency3_khz = 10;
6116 optional int32 time3_millis = 11;
6117 optional int32 frequency4_khz = 12;
6118 optional int32 time4_millis = 13;
6119 optional int32 frequency5_khz = 14;
6120 optional int32 time5_millis = 15;
6121 optional int32 frequency6_khz = 16;
6122 optional int32 time6_millis = 17;
6123 optional int32 frequency7_khz = 18;
6124 optional int32 time7_millis = 19;
6125 optional int32 frequency8_khz = 20;
6126 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006127}
Bookatz75ee60422018-11-09 12:27:37 -08006128
6129/**
Bookatz366a4432018-11-20 09:42:33 -08006130 * Pulls information about the device's build.
6131 */
6132message BuildInformation {
6133 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6134 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6135 optional string fingerprint = 1;
6136
6137 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6138 optional string brand = 2;
6139
6140 // Build.PRODUCT. The name of the overall product.
6141 optional string product = 3;
6142
6143 // Build.DEVICE. The name of the industrial design.
6144 optional string device = 4;
6145
6146 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6147 optional string version_release = 5;
6148
6149 // Build.ID. E.g. a label like "M4-rc20".
6150 optional string id = 6;
6151
6152 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6153 // represent this build.
6154 optional string version_incremental = 7;
6155
6156 // Build.TYPE. The type of build, like "user" or "eng".
6157 optional string type = 8;
6158
6159 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6160 optional string tags = 9;
6161}
6162
6163/**
Adam He420947c2019-01-23 15:59:09 -08006164 * Logs information about mismatched caller for content capture.
6165 *
6166 * Logged from:
6167 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6168 */
6169message ContentCaptureCallerMismatchReported {
6170 optional string intended_package = 1;
6171 optional string calling_package = 2;
6172}
6173
6174/**
6175 * Logs information about content capture service events.
6176 *
6177 * Logged from:
6178 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6179 */
6180message ContentCaptureServiceEvents {
6181 // The type of event.
6182 enum Event {
6183 UNKNOWN = 0;
6184 ON_CONNECTED = 1;
6185 ON_DISCONNECTED = 2;
6186 SET_WHITELIST = 3;
6187 SET_DISABLED = 4;
6188 ON_USER_DATA_REMOVED = 5;
6189 }
6190 optional Event event = 1;
6191 // component/package of content capture service.
6192 optional string service_info = 2;
6193 // component/package of target.
6194 // it's a concatenated list of component/package for SET_WHITELIST event
6195 // separated by " ".
6196 optional string target_info = 3;
6197}
6198
6199/**
6200 * Logs information about content capture session events.
6201 *
6202 * Logged from:
6203 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6204 */
6205message ContentCaptureSessionEvents {
6206 // The type of event.
6207 enum Event {
6208 UNKNOWN = 0;
6209 ON_SESSION_STARTED = 1;
6210 ON_SESSION_FINISHED = 2;
6211 SESSION_NOT_CREATED = 3;
6212 }
6213 optional int32 session_id = 1;
6214 optional Event event = 2;
6215 // (n/a on session finished)
6216 optional int32 state_flags = 3;
6217 // component/package of content capture service.
6218 optional string service_info = 4;
6219 // component/package of app.
6220 // (n/a on session finished)
6221 optional string app_info = 5;
6222 optional bool is_child_session = 6;
6223}
6224
6225/**
6226 * Logs information about session being flushed.
6227 *
6228 * Logged from:
6229 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6230 */
6231message ContentCaptureFlushed {
6232 optional int32 session_id = 1;
6233 // component/package of content capture service.
6234 optional string service_info = 2;
6235 // component/package of app.
6236 optional string app_info = 3;
6237 // session start/finish events
6238 optional int32 child_session_started = 4;
6239 optional int32 child_session_finished = 5;
6240 // count of view events.
6241 optional int32 view_appeared_count = 6;
6242 optional int32 view_disappeared_count = 7;
6243 optional int32 view_text_changed_count = 8;
6244
6245 // Flush stats.
6246 optional int32 max_events = 9;
6247 optional int32 idle_flush_freq = 10;
6248 optional int32 text_flush_freq = 11;
6249 optional int32 flush_reason = 12;
6250}
6251
6252/**
Bookatz75ee60422018-11-09 12:27:37 -08006253 * Pulls on-device BatteryStats power use calculations for the overall device.
6254 */
6255message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006256 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6257 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6258 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6259 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006260}
6261
6262/**
6263 * Pulls on-device BatteryStats power use calculations broken down by uid.
6264 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6265 * that is attributed to non-uid items. They must all be included to get the total power use.
6266 */
6267message DeviceCalculatedPowerBlameUid {
6268 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6269 optional int32 uid = 1 [(is_uid) = true];
6270
Bookatz3dbc13a2018-12-21 12:16:51 -08006271 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6272 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6273 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006274}
6275
6276/**
6277 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6278 * drain type.
6279 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6280 * is attributed uids. They must all be included to get the total power use.
6281 */
6282message DeviceCalculatedPowerBlameOther {
6283 // The type of item whose power use is being reported.
6284 enum DrainType {
6285 AMBIENT_DISPLAY = 0;
6286 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6287 BLUETOOTH = 2;
6288 CAMERA = 3;
6289 // Cell-standby
6290 CELL = 4;
6291 FLASHLIGHT = 5;
6292 IDLE = 6;
6293 MEMORY = 7;
6294 // Amount that total computed drain exceeded the drain estimated using the
6295 // battery level changes and capacity.
6296 OVERCOUNTED = 8;
6297 PHONE = 9;
6298 SCREEN = 10;
6299 // Amount that total computed drain was below the drain estimated using the
6300 // battery level changes and capacity.
6301 UNACCOUNTED = 11;
6302 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6303 WIFI = 13;
6304 }
6305 optional DrainType drain_type = 1;
6306
Bookatz3dbc13a2018-12-21 12:16:51 -08006307 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6308 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6309 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006310}
arangelov4e994062018-11-13 16:12:38 +00006311
6312/**
6313 * Logs device policy features.
6314 *
6315 * Logged from:
6316 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6317 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6318 */
6319message DevicePolicyEvent {
6320 // The event id - unique for each event.
6321 optional android.stats.devicepolicy.EventId event_id = 1;
6322 // The admin package name.
6323 optional string admin_package_name = 2;
6324 // A generic integer parameter.
6325 optional int32 integer_value = 3;
6326 // A generic boolean parameter.
6327 optional bool boolean_value = 4;
6328 // A parameter specifying a time period in milliseconds.
6329 optional uint64 time_period_millis = 5;
6330 // A parameter specifying a list of package names, bundle extras or string parameters.
6331 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6332}
shawnlinea5b66b2018-11-13 15:05:29 +08006333
6334/**
6335 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6336 *
6337 * Logged from:
6338 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6339 */
6340message DocsUILaunchReported {
6341 optional android.stats.docsui.LaunchAction launch_action = 1;
6342 optional bool has_initial_uri = 2;
6343 optional android.stats.docsui.MimeType mime_type = 3;
6344 optional android.stats.docsui.Root initial_root = 4;
6345}
6346
6347/**
6348 * Logs root/app visited event in file managers/picker. Call this when the user
6349 * taps on root/app in hamburger menu.
6350 *
6351 * Logged from:
6352 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6353 */
6354message DocsUIRootVisitedReported {
6355 optional android.stats.docsui.ContextScope scope = 1;
6356 optional android.stats.docsui.Root root = 2;
6357}
6358
6359/**
6360 * Logs file operation stats. Call this when a file operation has completed.
6361 *
6362 * Logged from:
6363 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6364 */
6365message DocsUIFileOperationReported {
6366 optional android.stats.docsui.Provider provider = 1;
6367 optional android.stats.docsui.FileOperation file_op = 2;
6368}
6369
6370/**
6371 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6372 * mode.
6373 *
6374 * Logged from:
6375 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6376 */
6377message DocsUIFileOperationCopyMoveModeReported {
6378 optional android.stats.docsui.FileOperation file_op = 1;
6379 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6380}
6381
6382
6383/**
6384 * Logs file sub operation stats. Call this when a file operation has failed.
6385 *
6386 * Logged from:
6387 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6388 */
6389message DocsUIFileOperationFailureReported {
6390 optional android.stats.docsui.Authority authority = 1;
6391 optional android.stats.docsui.SubFileOperation sub_op = 2;
6392}
6393
6394/**
6395* Logs the cancellation of a file operation. Call this when a job is canceled
6396*
6397* Logged from:
6398* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6399*/
6400message DocsUIFileOperationCanceledReported {
6401 optional android.stats.docsui.FileOperation file_op = 1;
6402}
6403
6404/**
6405 * Logs startup time in milliseconds.
6406 *
6407 * Logged from:
6408 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6409 */
6410message DocsUIStartupMsReported {
6411 optional int32 startup_millis = 1;
6412}
6413
6414/**
6415 * Logs the action that was started by user.
6416 *
6417 * Logged from:
6418 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6419 */
6420message DocsUIUserActionReported {
6421 optional android.stats.docsui.UserAction action = 1;
6422}
6423
6424/**
6425 * Logs the invalid type when invalid scoped access is requested.
6426 *
6427 * Logged from:
6428 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6429 */
6430message DocsUIInvalidScopedAccessRequestReported {
6431 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006432}
Ben Murdochbab399f62018-12-06 11:01:38 +00006433
6434/**
shawnlina75e82d2019-01-07 10:31:12 +08006435 * Logs the package name that launches docsui picker mode.
6436 *
6437 * Logged from:
6438 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6439 */
6440message DocsUIPickerLaunchedFromReported {
6441 optional string package_name = 1;
6442}
6443
6444/**
6445 * Logs the search type.
6446 *
6447 * Logged from:
6448 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6449 */
6450message DocsUISearchTypeReported {
6451 optional android.stats.docsui.SearchType search_type = 1;
6452}
6453
6454/**
6455 * Logs the search mode.
6456 *
6457 * Logged from:
6458 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6459 */
6460message DocsUISearchModeReported {
6461 optional android.stats.docsui.SearchMode search_mode = 1;
6462}
6463
6464/**
6465 * Logs the pick result information.
6466 *
6467 * Logged from:
6468 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6469 */
6470message DocsUIPickResultReported {
6471 optional int32 total_action_count = 1;
6472 optional int64 duration_millis = 2;
6473 optional int32 file_count= 3;
6474 optional bool is_searching = 4;
6475 optional android.stats.docsui.Root picked_from = 5;
6476 optional android.stats.docsui.MimeType mime_type = 6;
6477 optional int32 repeatedly_pick_times = 7;
6478}
6479
6480/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006481 * Logs when an app's memory is compacted.
6482 *
6483 * Logged from:
6484 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6485 */
6486message AppCompacted {
6487 // The pid of the process being compacted.
6488 optional int32 pid = 1;
6489
6490 // The name of the process being compacted.
6491 optional string process_name = 2;
6492
6493 // The type of compaction.
6494 enum Action {
6495 UNKNOWN = 0;
6496 SOME = 1;
6497 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006498 PERSISTENT = 3;
6499 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006500 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006501 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006502
6503 // Total RSS in kilobytes consumed by the process prior to compaction.
6504 optional int64 before_rss_total_kilobytes = 4;
6505
6506 // File RSS in kilobytes consumed by the process prior to compaction.
6507 optional int64 before_rss_file_kilobytes = 5;
6508
6509 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6510 optional int64 before_rss_anon_kilobytes = 6;
6511
6512 // Swap in kilobytes consumed by the process prior to compaction.
6513 optional int64 before_swap_kilobytes = 7;
6514
6515 // Total RSS in kilobytes consumed by the process after compaction.
6516 optional int64 after_rss_total_kilobytes = 8;
6517
6518 // File RSS in kilobytes consumed by the process after compaction.
6519 optional int64 after_rss_file_kilobytes = 9;
6520
6521 // Anonymous RSS in kilobytes consumed by the process after compaction.
6522 optional int64 after_rss_anon_kilobytes = 10;
6523
6524 // Swap in kilobytes consumed by the process after compaction.
6525 optional int64 after_swap_kilobytes = 11;
6526
6527 // The time taken to perform compaction in milliseconds.
6528 optional int64 time_to_compact_millis = 12;
6529
6530 // The last compaction action performed for this app.
6531 optional Action last_action = 13;
6532
Ben Murdoch01720b82018-12-19 18:03:44 +00006533 // The last time that compaction was attempted on this process in milliseconds
6534 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6535 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006536
Ben Murdoch885c21b2019-03-15 18:02:04 +00006537 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006538 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006539
6540 // The process state at the time of compaction.
6541 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006542
6543 // Free ZRAM in kilobytes before compaction.
6544 optional int64 before_zram_free_kilobytes = 17;
6545
6546 // Free ZRAM in kilobytes after compaction.
6547 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006548}
lifr157fc552018-12-12 16:38:04 +08006549
6550/**
lifrb6b90b62019-03-29 00:40:17 +08006551 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6552 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6553 *
lifr1f74b052019-04-16 22:16:30 +08006554 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6555 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6556 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6557 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006558 */
6559message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006560 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006561
lifr1f74b052019-04-16 22:16:30 +08006562 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006563
6564 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006565 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006566
lifr1f74b052019-04-16 22:16:30 +08006567 // Only valid for event_type = EVENT_GETADDRINFO.
6568 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006569
lifr1f74b052019-04-16 22:16:30 +08006570 // Flags passed to android_res_nsend() defined in multinetwork.h
6571 // Only valid for event_type = EVENT_RESNSEND.
6572 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006573
lifrad9becc2019-05-20 11:04:41 +08006574 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006575
6576 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006577 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006578
6579 // Additional pass-through fields opaque to statsd.
6580 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006581 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006582
6583 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6584 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006585}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006586
6587/**
6588 * Logs when a data stall event occurs.
6589 *
6590 * Log from:
6591 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6592 */
6593message DataStallEvent {
6594 // Data stall evaluation type.
6595 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6596 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6597 optional int32 evaluation_type = 1;
6598 // See definition in data_stall_event.proto.
6599 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6600 // See definition in data_stall_event.proto.
6601 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6602 // See definition in data_stall_event.proto.
6603 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6604 // See definition in data_stall_event.proto.
6605 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6606 // See definition in data_stall_event.proto.
6607 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6608}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006609
6610/*
6611 * Logs when RescueParty resets some set of experiment flags.
6612 *
6613 * Logged from:
6614 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6615 */
6616message RescuePartyResetReported {
6617 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6618 optional int32 rescue_level = 1;
6619}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006620
6621/**
6622 * Logs when signed config is received from an APK, and if that config was applied successfully.
6623 * Logged from:
6624 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6625 */
6626message SignedConfigReported {
6627 enum Type {
6628 UNKNOWN_TYPE = 0;
6629 GLOBAL_SETTINGS = 1;
6630 }
6631 optional Type type = 1;
6632
6633 // The final status of the signed config received.
6634 enum Status {
6635 UNKNOWN_STATUS = 0;
6636 APPLIED = 1;
6637 BASE64_FAILURE_CONFIG = 2;
6638 BASE64_FAILURE_SIGNATURE = 3;
6639 SECURITY_EXCEPTION = 4;
6640 INVALID_CONFIG = 5;
6641 OLD_CONFIG = 6;
6642 SIGNATURE_CHECK_FAILED = 7;
6643 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006644 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006645 }
6646 optional Status status = 2;
6647
6648 // The version of the signed config processed.
6649 optional int32 version = 3;
6650
6651 // The package name that the config was extracted from.
6652 optional string from_package = 4;
6653
6654 enum Key {
6655 NO_KEY = 0;
6656 DEBUG = 1;
6657 PRODUCTION = 2;
6658 }
6659 // Which key was used to verify the config.
6660 optional Key verified_with = 5;
6661}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006662
6663/*
6664 * Logs GNSS Network-Initiated (NI) location events.
6665 *
6666 * Logged from:
6667 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6668 */
6669message GnssNiEventReported {
6670 // The type of GnssNiEvent.
6671 enum EventType {
6672 UNKNOWN = 0;
6673 NI_REQUEST = 1;
6674 NI_RESPONSE = 2;
6675 }
6676 optional EventType event_type = 1;
6677
6678 // An ID generated by HAL to associate NI notifications and UI responses.
6679 optional int32 notification_id = 2;
6680
6681 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006682 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006683
6684 // NI requires notification.
6685 optional bool need_notify = 4;
6686
6687 // NI requires verification.
6688 optional bool need_verify = 5;
6689
6690 // NI requires privacy override, no notification/minimal trace.
6691 optional bool privacy_override = 6;
6692
6693 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6694 // seconds.
6695 optional int32 timeout = 7;
6696
6697 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006698 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006699
6700 // String representing the requester of the network inititated location request.
6701 optional string requestor_id = 9;
6702
6703 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6704 // network initiated location request.
6705 optional string text = 10;
6706
6707 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006708 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006709
6710 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006711 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006712
6713 // True if SUPL ES is enabled.
6714 optional bool is_supl_es_enabled = 13;
6715
6716 // True if GNSS location is enabled.
6717 optional bool is_location_enabled = 14;
6718
6719 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006720 optional android.server.location.GnssUserResponseType user_response = 15;
6721}
6722
6723/**
6724 * Logs GNSS non-framework (NFW) location notification.
6725 *
6726 * Logged from:
6727 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6728 */
6729message GnssNfwNotificationReported {
6730 // Package name of the Android proxy application representing the non-framework entity that
6731 // requested location. Set to empty string if unknown.
6732 optional string proxy_app_package_name = 1;
6733
6734 // Protocol stack that initiated the non-framework location request.
6735 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6736
6737 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6738 // set to empty string. This field is opaque to the framework and used for logging purposes.
6739 optional string other_protocol_stack_name = 3;
6740
6741 // Source initiating/receiving the location information.
6742 optional android.server.location.NfwRequestor requestor = 4;
6743
6744 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6745 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6746 // and used for logging purposes.
6747 optional string requestor_id = 5;
6748
6749 // Indicates whether location information was provided for this request.
6750 optional android.server.location.NfwResponseType response_type = 6;
6751
6752 // True if the device is in user initiated emergency session.
6753 optional bool in_emergency_mode = 7;
6754
6755 // True if cached location is provided.
6756 optional bool is_cached_location = 8;
6757
6758 // True if proxy app permission mismatch between framework and GNSS HAL.
6759 optional bool is_permission_mismatched = 9;
6760}
6761
6762/**
6763 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6764 *
6765 * Logged from:
6766 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6767 */
6768message GnssConfigurationReported {
6769 // SUPL host name.
6770 optional string supl_host = 1;
6771
6772 // SUPL port number.
6773 optional int32 supl_port = 2;
6774
6775 // C2K host name.
6776 optional string c2k_host = 3;
6777
6778 // C2K port number.
6779 optional int32 c2k_port = 4;
6780
6781 // The SUPL version requested by Carrier.
6782 optional int32 supl_ver = 5;
6783
6784 // The SUPL mode.
6785 optional android.server.location.SuplMode supl_mode = 6;
6786
6787 // True if NI emergency SUPL restrictions is enabled.
6788 optional bool supl_es = 7;
6789
6790 // LTE Positioning Profile settings
6791 optional android.server.location.LppProfile lpp_profile = 8;
6792
6793 // Positioning protocol on A-Glonass system.
6794 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6795
6796 // True if emergency PDN is used. Otherwise, regular PDN is used.
6797 optional bool use_emergency_pdn_for_emergency_supl= 10;
6798
6799 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6800 optional android.server.location.GpsLock gps_lock = 11;
6801
6802 // Number of seconds to extend the emergency session duration post emergency call.
6803 optional int32 es_extension_sec = 12;
6804
6805 // The full list of package names of proxy Android applications representing the non-framework
6806 // location access entities (on/off the device) for which the framework user has granted
6807 // non-framework location access permission. The package names are concatenated in one string
6808 // with spaces as separators.
6809 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006810}
Jack Yu95b64f32018-12-13 18:26:11 +08006811
6812/**
6813 * Logs when a NFC device's error occurred.
6814 * Logged from:
6815 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6816 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6817 */
6818message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006819 enum Type {
6820 UNKNOWN = 0;
6821 CMD_TIMEOUT = 1;
6822 ERROR_NOTIFICATION = 2;
6823 AID_OVERFLOW = 3;
6824 }
6825 optional Type type = 1;
6826 // If it's nci cmd timeout, log the timeout command.
6827 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006828
Alex Salod7c3eef2019-01-25 14:43:27 -08006829 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006830}
6831
6832/**
6833 * Logs when a NFC device's state changed event
6834 * Logged from:
6835 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6836 */
6837message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006838 enum State {
6839 UNKNOWN = 0;
6840 OFF = 1;
6841 ON = 2;
6842 ON_LOCKED = 3; // Secure Nfc enabled.
6843 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6844 }
6845 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006846}
6847
6848/**
6849 * Logs when a NFC Beam Transaction occurred.
6850 * Logged from:
6851 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6852 */
6853message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006854 enum Operation {
6855 UNKNOWN = 0;
6856 SEND = 1;
6857 RECEIVE = 2;
6858 }
6859 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006860}
6861
6862/**
6863 * Logs when a NFC Card Emulation Transaction occurred.
6864 * Logged from:
6865 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6866 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6867 */
6868message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006869 enum Category {
6870 UNKNOWN = 0;
6871 HCE_PAYMENT = 1;
6872 HCE_OTHER = 2;
6873 OFFHOST = 3;
6874 }
6875 // Transaction belongs to HCE payment or HCE other category, or offhost.
6876 optional Category category = 1;
6877 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6878 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006879}
6880
6881/**
6882 * Logs when a NFC Tag event occurred.
6883 * Logged from:
6884 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6885 */
6886message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006887 enum Type {
6888 UNKNOWN = 0;
6889 URL = 1;
6890 BT_PAIRING = 2;
6891 PROVISION = 3;
6892 WIFI_CONNECT = 4;
6893 APP_LAUNCH = 5;
6894 OTHERS = 6;
6895 }
6896 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006897}
6898
6899/**
6900 * Logs when Hce transaction triggered
6901 * Logged from:
6902 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6903 */
6904message NfcHceTransactionOccurred {
6905 // The latency period(in microseconds) it took for the first HCE data
6906 // exchange.
6907 optional uint32 latency_micros = 1;
6908}
6909
6910/**
6911 * Logs when SecureElement state event changed
6912 * Logged from:
6913 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6914 */
6915message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006916 enum State {
6917 UNKNOWN = 0;
6918 INITIALIZED = 1;
6919 DISCONNECTED = 2;
6920 CONNECTED = 3;
6921 HALCRASH = 4;
6922 }
6923 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006924
Alex Salod7c3eef2019-01-25 14:43:27 -08006925 optional string state_change_reason = 2;
6926 // SIMx or eSEx.
6927 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006928}
6929
6930/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006931 * Information about a permission grant request
6932 */
6933message PermissionGrantRequestResultReported {
6934 // unique value identifying an API call. A API call might result in multiple of these atoms
6935 optional int64 request_id = 1;
6936
6937 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006938 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006939
6940 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006941 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006942
6943 // The permission to be granted
6944 optional string permission_name = 4;
6945
6946 // If the permission was explicitly requested via the API or added by the system
6947 optional bool is_implicit = 5;
6948
6949 enum Result {
6950 UNDEFINED = 0;
6951 // permission request was ignored
6952 IGNORED = 1;
6953 // permission request was ignored because it was user fixed
6954 IGNORED_USER_FIXED = 2;
6955 // permission request was ignored because it was policy fixed
6956 IGNORED_POLICY_FIXED = 3;
6957 // permission was granted by user action
6958 USER_GRANTED = 4;
6959 // permission was automatically granted
6960 AUTO_GRANTED = 5;
6961 // permission was denied by user action
6962 USER_DENIED = 6;
6963 // permission was denied with prejudice by the user
6964 USER_DENIED_WITH_PREJUDICE = 7;
6965 // permission was automatically denied
6966 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006967 // permission request was ignored because permission is restricted
6968 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006969 // one time permission was granted by user action
6970 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006971 // user ignored request by leaving the request screen without choosing any option
6972 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006973 // user granted the permission after being linked to settings
6974 USER_GRANTED_IN_SETTINGS = 12;
6975 // user denied the permission after being linked to settings
6976 USER_DENIED_IN_SETTINGS = 13;
6977 // user denied the permission with prejudice after being linked to settings
6978 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6979 // permission was automatically revoked after one-time permission expired
6980 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006981 // permission was automatically revoked for unused app
6982 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006983 }
6984 // The result of the permission grant
6985 optional Result result = 6;
6986}
6987
6988/**
Jack Yu95b64f32018-12-13 18:26:11 +08006989 * Logs when Omapi API used
6990 * Logged from:
6991 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6992 */
6993message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006994 enum Operation {
6995 UNKNOWN = 0;
6996 OPEN_CHANNEL = 1;
6997 }
6998 optional Operation operation = 1;
6999 // SIMx or eSEx.
7000 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007001
Alex Salod7c3eef2019-01-25 14:43:27 -08007002 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007003}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007004
7005/**
Alex Saloa060aee2019-01-21 14:36:41 -08007006 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7007 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007008 * Logged from:
7009 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7010 */
7011message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007012 optional int64 dispatch_latency_millis = 1;
7013}
7014
7015/**
7016 * Logs AttentionManagerService attention check result.
7017 *
7018 * Logged from:
7019 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7020 */
7021message AttentionManagerServiceResultReported {
7022 // See core/java/android/service/attention/AttentionService.java
7023 enum AttentionCheckResult {
7024 UNKNOWN = 20;
7025 ATTENTION_SUCCESS_ABSENT = 0;
7026 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007027 ATTENTION_FAILURE_UNKNOWN = 2;
7028 ATTENTION_FAILURE_CANCELLED = 3;
7029 ATTENTION_FAILURE_PREEMPTED = 4;
7030 ATTENTION_FAILURE_TIMED_OUT = 5;
7031 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007032 }
7033 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007034}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007035
7036/**
7037 * Logs when an adb connection changes state.
7038 *
7039 * Logged from:
7040 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7041 */
7042message AdbConnectionChanged {
7043 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7044 // previously selected for this system.
7045 optional int64 last_connection_time_millis = 1;
7046
7047 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7048 // to reconnect via adb without user interaction.
7049 optional int64 auth_window_millis = 2;
7050
7051 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7052 optional android.debug.AdbConnectionStateEnum state = 3;
7053
7054 // True if the 'always allow' option was selected for this system.
7055 optional bool always_allow = 4;
7056}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007057
7058/*
7059 * Logs the reported speech DSP status.
7060 *
7061 * Logged from:
7062 * Vendor audio implementation.
7063 */
7064message SpeechDspStatReported {
7065 // The total Speech DSP uptime in milliseconds.
7066 optional int32 total_uptime_millis = 1;
7067 // The total Speech DSP downtime in milliseconds.
7068 optional int32 total_downtime_millis = 2;
7069 optional int32 total_crash_count = 3;
7070 optional int32 total_recover_count = 4;
7071}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007072
7073/**
7074 * Logs USB connector contaminant status.
7075 *
7076 * Logged from: USB Service.
7077 */
7078message UsbContaminantReported {
7079 optional string id = 1;
7080 optional android.service.usb.ContaminantPresenceStatus status = 2;
7081}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007082
7083/**
7084 * This atom is for debugging purpose.
7085 */
7086message DebugElapsedClock {
7087 // Monotically increasing value for each pull.
7088 optional int64 pull_count = 1;
7089 // Time from System.elapsedRealtime.
7090 optional int64 elapsed_clock_millis = 2;
7091 // Time from System.elapsedRealtime.
7092 optional int64 same_elapsed_clock_millis = 3;
7093 // Diff between current elapsed time and elapsed time from previous pull.
7094 optional int64 elapsed_clock_diff_millis = 4;
7095
7096 enum Type {
7097 TYPE_UNKNOWN = 0;
7098 ALWAYS_PRESENT = 1;
7099 PRESENT_ON_ODD_PULLS = 2;
7100 }
7101 // Type of behavior for the pulled data.
7102 optional Type type = 5;
7103}
7104
7105/**
7106 * This atom is for debugging purpose.
7107 */
7108message DebugFailingElapsedClock {
7109 // Monotically increasing value for each pull.
7110 optional int64 pull_count = 1;
7111 // Time from System.elapsedRealtime.
7112 optional int64 elapsed_clock_millis = 2;
7113 // Time from System.elapsedRealtime.
7114 optional int64 same_elapsed_clock_millis = 3;
7115 // Diff between current elapsed time and elapsed time from previous pull.
7116 optional int64 elapsed_clock_diff_millis = 4;
7117}
Steven Wuacef6bb2019-01-23 14:21:17 -05007118
7119/** Logs System UI bubbles event changed.
7120 *
7121 * Logged from:
7122 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7123 */
7124message BubbleUIChanged {
7125
7126 // The app package that is posting the bubble.
7127 optional string package_name = 1;
7128
7129 // The notification channel that is posting the bubble.
7130 optional string notification_channel = 2;
7131
7132 // The notification id associated with the posted bubble.
7133 optional int32 notification_id = 3;
7134
7135 // The position of the bubble within the bubble stack.
7136 optional int32 position = 4;
7137
7138 // The total number of bubbles within the bubble stack.
7139 optional int32 total_number = 5;
7140
7141 // User interactions with the bubble.
7142 enum Action {
7143 UNKNOWN = 0;
7144 POSTED = 1;
7145 UPDATED = 2;
7146 EXPANDED = 3;
7147 COLLAPSED = 4;
7148 DISMISSED = 5;
7149 STACK_DISMISSED = 6;
7150 STACK_MOVED = 7;
7151 HEADER_GO_TO_APP = 8;
7152 HEADER_GO_TO_SETTINGS = 9;
7153 PERMISSION_OPT_IN = 10;
7154 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007155 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007156 SWIPE_LEFT = 13;
7157 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007158 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007159 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007160 }
7161 optional Action action = 6;
7162
7163 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7164 optional float normalized_x_position = 7;
7165 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007166
7167 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7168 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007169
7170 // Whether the bubble is an on-going one.
7171 optional bool is_ongoing = 10;
7172
7173 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007174 // This is deprecated and the value should be ignored.
7175 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007176}
Kweku Adams8845d012018-12-11 20:06:45 -08007177
7178/**
Steven Wu552f63f2019-02-05 13:41:36 -05007179 * Logs System UI bubbles developer errors.
7180 *
7181 * Logged from:
7182 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7183 */
7184message BubbleDeveloperErrorReported {
7185
7186 // The app package that is posting the bubble.
7187 optional string package_name = 1;
7188
7189 // Bubble developer error type enums.
7190 enum Error {
7191 UNKNOWN = 0;
7192 ACTIVITY_INFO_MISSING = 1;
7193 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7194 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7195 }
7196 optional Error error = 2 [default = UNKNOWN];
7197}
7198
7199/**
Kweku Adams8845d012018-12-11 20:06:45 -08007200 * Logs that a constraint for a scheduled job has changed.
7201 *
7202 * Logged from:
7203 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7204 */
7205message ScheduledJobConstraintChanged {
7206 repeated AttributionNode attribution_node = 1;
7207
7208 // Name of the job.
7209 optional string job_name = 2;
7210
7211 optional com.android.server.job.ConstraintEnum constraint = 3;
7212
7213 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007214 UNKNOWN = 0;
7215 UNSATISFIED = 1;
7216 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007217 }
7218 optional State state = 4;
7219}
Alex Salod7c3eef2019-01-25 14:43:27 -08007220
7221/**
7222 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7223 * returns true.
7224 *
7225 * Logged from:
7226 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7227 */
7228message ScreenTimeoutExtensionReported {
7229 // Describes how many times in a row did the power manager reset the screen off timeout.
7230 optional uint32 consecutive_timeout_extended_count = 1;
7231}
Hui Yu885aca12019-01-10 17:11:34 -08007232
7233/*
7234* Logs number of milliseconds it takes to start a process.
7235* The definition of app process start time is from the app launch time to
7236* the time that Zygote finished forking the app process and loaded the
7237* application package's java classes.
7238
7239* This metric is different from AppStartOccurred which is for foreground
7240* activity only.
7241
7242* ProcessStartTime can report all processes (both foreground and background)
7243* start time.
7244*
7245* Logged from:
7246* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7247*/
7248message ProcessStartTime {
7249 // The uid of the ProcessRecord.
7250 optional int32 uid = 1 [(is_uid) = true];
7251
7252 // The process pid.
7253 optional int32 pid = 2;
7254
7255 // The process name.
7256 // Usually package name, "system" for system server.
7257 // Provided by ActivityManagerService.
7258 optional string process_name = 3;
7259
7260 enum StartType {
7261 UNKNOWN = 0;
7262 WARM = 1;
7263 HOT = 2;
7264 COLD = 3;
7265 }
7266
7267 // The start type.
7268 optional StartType type = 4;
7269
7270 // The elapsed realtime at the start of the process.
7271 optional int64 process_start_time_millis = 5;
7272
7273 // Number of milliseconds it takes to reach bind application.
7274 optional int32 bind_application_delay_millis = 6;
7275
7276 // Number of milliseconds it takes to finish start of the process.
7277 optional int32 process_start_delay_millis = 7;
7278
7279 // hostingType field in ProcessRecord, the component type such as "activity",
7280 // "service", "content provider", "broadcast" or other strings.
7281 optional string hosting_type = 8;
7282
7283 // hostingNameStr field in ProcessRecord. The component class name that runs
7284 // in this process.
7285 optional string hosting_name = 9;
7286}
7287
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007288/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007289 * Track Media Codec usage
7290 * Logged from:
7291 * frameworks/av/media/libstagefright/MediaCodec.cpp
7292 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7293 */
7294message MediametricsCodecReported {
7295 optional int64 timestamp_nanos = 1;
7296 optional string package_name = 2;
7297 optional int64 package_version_code = 3;
7298 optional int64 media_apex_version = 4;
7299
7300 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7301}
7302
7303/**
7304 * Track Media Extractor (pulling video/audio streams out of containers) usage
7305 * Logged from:
7306 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7307 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7308 */
7309message MediametricsExtractorReported {
7310 optional int64 timestamp_nanos = 1;
7311 optional string package_name = 2;
7312 optional int64 package_version_code = 3;
7313 optional int64 media_apex_version = 4;
7314
7315 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7316}
7317
7318/**
7319 * Track how we arbitrate between microphone/input requests.
7320 * Logged from
7321 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7322 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7323 */
7324message MediametricsAudiopolicyReported {
7325 optional int64 timestamp_nanos = 1;
7326 optional string package_name = 2;
7327 optional int64 package_version_code = 3;
7328 optional int64 media_apex_version = 4;
7329
7330 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7331}
7332
7333/**
7334 * Track how we arbitrate between microphone requests.
7335 * Logged from
7336 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7337 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7338 */
7339message MediametricsAudiorecordReported {
7340 optional int64 timestamp_nanos = 1;
7341 optional string package_name = 2;
7342 optional int64 package_version_code = 3;
7343 optional int64 media_apex_version = 4;
7344
7345 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7346}
7347
7348/**
7349 * Track how we arbitrate between microphone/input requests.
7350 * Logged from
7351 * frameworks/av/media/libnblog/ReportPerformance.cpp
7352 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7353 */
7354message MediametricsAudiothreadReported {
7355 optional int64 timestamp_nanos = 1;
7356 optional string package_name = 2;
7357 optional int64 package_version_code = 3;
7358 optional int64 media_apex_version = 4;
7359
7360 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7361}
7362
7363/**
7364 * Track how we arbitrate between microphone/input requests.
7365 * Logged from
7366 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7367 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7368 */
7369message MediametricsAudiotrackReported {
7370 optional int64 timestamp_nanos = 1;
7371 optional string package_name = 2;
7372 optional int64 package_version_code = 3;
7373 optional int64 media_apex_version = 4;
7374
7375 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7376}
7377
7378/**
7379 * Track information about DRM framework performance
7380 * Logged from
7381 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7382 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7383 */
7384message MediametricsMediadrmReported {
7385 optional int64 timestamp_nanos = 1;
7386 optional string package_name = 2;
7387 optional int64 package_version_code = 3;
7388 optional int64 media_apex_version = 4;
7389
7390 // vendor+description tell about which DRM plugin is in use on this device
7391 optional string vendor = 5;
7392 optional string description = 6;
7393 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7394 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7395}
7396
7397/**
7398 * Track information about the widevine DRM plugin performance
7399 * Logged from
7400 * vendor/widevine/libwvdrmengine/cdm/metrics
7401 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7402 */
7403message MediametricsDrmWidevineReported {
7404 optional int64 timestamp_nanos = 1;
7405 optional string package_name = 2;
7406 optional int64 package_version_code = 3;
7407 optional int64 media_apex_version = 4;
7408
7409 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7410}
7411
7412/**
7413 * Track information about recordings (e.g. camcorder)
7414 * Logged from
7415 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7416 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7417 */
7418message MediametricsRecorderReported {
7419 optional int64 timestamp_nanos = 1;
7420 optional string package_name = 2;
7421 optional int64 package_version_code = 3;
7422 optional int64 media_apex_version = 4;
7423
7424 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7425}
7426
7427/**
7428 * Track Media Player usage
7429 * Logged from:
7430 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7431 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7432 */
7433message MediametricsNuPlayerReported {
7434 optional int64 timestamp_nanos = 1;
7435 optional string package_name = 2;
7436 optional int64 package_version_code = 3;
7437 optional int64 media_apex_version = 4;
7438
7439 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7440}
7441
7442/**
Robert Shiha4beed32019-08-19 14:15:23 -07007443 * Track Legacy DRM usage
7444 * Logged from
7445 * frameworks/av/drm/drmserver/DrmManager.cpp
7446 */
7447message MediametricsDrmManagerReported {
7448 optional int64 timestamp_nanos = 1;
7449 optional string package_name = 2;
7450 optional int64 package_version_code = 3;
7451 optional int64 media_apex_version = 4;
7452
7453 enum Method {
7454 METHOD_NOT_FOUND = -1;
7455 GET_CONSTRAINTS = 0;
7456 GET_METADATA = 1;
7457 CAN_HANDLE = 2;
7458 PROCESS_DRM_INFO = 3;
7459 ACQUIRE_DRM_INFO = 4;
7460 SAVE_RIGHTS = 5;
7461 GET_ORIGINAL_MIME_TYPE = 6;
7462 GET_DRM_OBJECT_TYPE = 7;
7463 CHECK_RIGHTS_STATUS = 8;
7464 REMOVE_RIGHTS = 9;
7465 REMOVE_ALL_RIGHTS = 10;
7466 OPEN_CONVERT_SESSION = 11;
7467 OPEN_DECRYPT_SESSION = 12;
7468 }
7469
7470 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7471 optional string plugin_id = 5;
7472 optional string description = 6;
7473 optional Method method = 7;
7474 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007475
7476 optional int64 get_constraints_count = 9;
7477 optional int64 get_metadata_count = 10;
7478 optional int64 can_handle_count = 11;
7479 optional int64 process_drm_info_count = 12;
7480 optional int64 acquire_drm_info_count = 13;
7481 optional int64 save_rights_count = 14;
7482 optional int64 get_original_mime_type_count = 15;
7483 optional int64 get_drm_object_type_count = 16;
7484 optional int64 check_rights_status_count = 17;
7485 optional int64 remove_rights_count = 18;
7486 optional int64 remove_all_rights_count = 19;
7487 optional int64 open_convert_session_count = 20;
7488 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007489}
7490
7491/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007492 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007493 * Pulled from: StatsCompanionService
7494*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007495message DangerousPermissionState {
7496 // Name of the permission
7497 optional string permission_name = 1;
7498
7499 // Uid of the package
7500 optional int32 uid = 2 [(is_uid) = true];
7501
7502 // Package requesting the permission
7503 optional string package_name = 3;
7504
7505 // If the permission is granted to the uid
7506 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007507
7508 // Permission flags as per android.content.pm.PermissionFlags
7509 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007510}
7511
Michael Groover4a0ca942019-01-24 17:41:25 -08007512/**
7513 * Logs when a package is denied access to a device identifier based on the new access requirements.
7514 *
7515 * Logged from:
7516 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7517 */
7518message DeviceIdentifierAccessDenied {
7519 // The name of the package denied access to the requested device identifier.
7520 optional string package_name = 1;
7521
7522 // The name of the device identifier method the package attempted to invoke.
7523 optional string method_name = 2;
7524
7525 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007526 // Starting from Android 11, this boolean is not set and will always be false.
7527 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007528
7529 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007530 // Starting from Android 11, this boolean is not set and will always be false.
7531 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007532}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007533
7534/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007535 * Pulls the ongoing mainline install train version code.
7536 * Pulled from StatsCompanionService
7537 */
7538message TrainInfo {
7539 optional int64 train_version_code = 1;
7540
7541 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007542
7543 optional string train_name = 3;
7544
7545 enum Status {
7546 UNKNOWN = 0;
7547 INSTALL_REQUESTED = 1;
7548 INSTALL_STARTED = 2;
7549 INSTALL_STAGED_NOT_READY = 3;
7550 INSTALL_STAGED_READY = 4;
7551 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007552 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7553 // and INSTALL_FAILURE_COMMIT.
7554 INSTALL_FAILURE = 6 [deprecated = true];
7555 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007556 INSTALL_CANCELLED = 7;
7557 INSTALLER_ROLLBACK_REQUESTED = 8;
7558 INSTALLER_ROLLBACK_INITIATED = 9;
7559 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7560 INSTALLER_ROLLBACK_STAGED = 11;
7561 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7562 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7563 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7564 INSTALLER_ROLLBACK_SUCCESS = 15;
7565 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007566 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7567 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7568 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7569 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7570 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7571 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007572 INSTALL_FAILURE_DOWNLOAD = 23;
7573 INSTALL_FAILURE_STATE_MISMATCH = 24;
7574 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007575 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007576 }
7577 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007578}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007579
7580/**
7581 * Logs the gesture stage changed event.
7582 *
7583 * Logged from:
7584 * frameworks/base/packages/SystemUI/
7585 */
7586message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007587 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007588}
7589
7590/**
7591 * Logs the feedback type.
7592 *
7593 * Logged from:
7594 * frameworks/base/packages/SystemUI/
7595 */
7596message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007597 // Whether or not the gesture was used.
7598 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007599}
7600
7601/**
7602 * Logs the progress.
7603 *
7604 * Logged from:
7605 * frameworks/base/packages/SystemUI/
7606 */
7607message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007608 // [0,100] progress for the assist gesture.
7609 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007610}
Neil Fullerdb14b482019-02-05 19:44:44 +00007611
7612/*
7613 * Information about the time zone data on a device.
7614 */
7615message TimeZoneDataInfo {
7616 // A version identifier for the data set on device. e.g. "2018i"
7617 optional string tzdb_version = 1;
7618}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007619
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007620/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007621 * Logs the GPU stats global health information.
7622 *
7623 * Logged from:
7624 * frameworks/native/services/gpuservice/gpustats/
7625 */
7626message GpuStatsGlobalInfo {
7627 // Package name of the gpu driver.
7628 optional string driver_package_name = 1;
7629
7630 // Version name of the gpu driver.
7631 optional string driver_version_name = 2;
7632
7633 // Version code of the gpu driver.
7634 optional int64 driver_version_code = 3;
7635
7636 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7637 optional int64 driver_build_time = 4;
7638
7639 // Total count of the gl driver gets loaded.
7640 optional int64 gl_loading_count = 5;
7641
7642 // Total count of the gl driver fails to be loaded.
7643 optional int64 gl_loading_failure_count = 6;
7644
7645 // Total count of the Vulkan driver gets loaded.
7646 optional int64 vk_loading_count = 7;
7647
7648 // Total count of the Vulkan driver fails to be loaded.
7649 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007650
7651 // Api version of the system Vulkan driver.
7652 optional int32 vulkan_version = 9;
7653
7654 // Api version of the system CPU Vulkan driver.
7655 optional int32 cpu_vulkan_version = 10;
7656
7657 // Api version of the system GLES driver.
7658 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007659
7660 // Total count of the angle driver gets loaded.
7661 optional int64 angle_loading_count = 12;
7662
7663 // Total count of the angle driver fails to be loaded.
7664 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007665}
7666
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007667/**
7668 * GPU driver loading time info.
7669 */
7670message GpuDriverLoadingTime {
7671 // List of all the driver loading times for this app. The list size is
7672 // capped at 50.
7673 repeated int64 driver_loading_time = 1;
7674}
7675
7676/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007677 * Logs the GPU stats per app health information.
7678 *
7679 * Logged from:
7680 * frameworks/native/services/gpuservice/gpustats/
7681 */
7682message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007683 // Package name of the application that loads the gpu driver. Total number
7684 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007685 optional string app_package_name = 1;
7686
7687 // Version code of the gpu driver this app loads.
7688 optional int64 driver_version_code = 2;
7689
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007690 // gl driver loading time info.
7691 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7692 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007693
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007694 // Vulkan driver loading time info.
7695 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7696 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007697
7698 // Angle driver loading time info.
7699 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7700 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007701
7702 // CPU Vulkan implementation is in use.
7703 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007704
7705 // App is not doing pre-rotation correctly.
7706 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007707
7708 // App creates GLESv1 context.
7709 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007710}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007711
7712/*
7713 * Logs the size of the system ion heap.
7714 *
7715 * Pulled from StatsCompanionService.
7716 */
7717message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007718 // Deprecated due to limited support of ion stats in debugfs.
7719 // Use `IonHeapSize` instead.
7720 option deprecated = true;
7721
Rafal Slawikd4e87572019-03-12 13:08:38 +00007722 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007723 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007724 optional int64 size_in_bytes = 1;
7725}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007726
Rafal Slawik77987ed2019-06-17 12:28:23 +01007727/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007728 * Logs the total size of the ion heap.
7729 *
7730 * Pulled from StatsCompanionService.
7731 */
7732message IonHeapSize {
7733 // Total size of all ion heaps in kilobytes.
7734 // Read from: /sys/kernel/ion/total_heaps_kb.
7735 optional int32 total_size_kb = 1;
7736}
7737
7738/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007739 * Logs the per-process size of the system ion heap.
7740 *
7741 * Pulled from StatsCompanionService.
7742 */
7743message ProcessSystemIonHeapSize {
7744 // The uid if available. -1 means not available.
7745 optional int32 uid = 1 [(is_uid) = true];
7746
7747 // The process name (from /proc/PID/cmdline).
7748 optional string process_name = 2;
7749
7750 // Sum of sizes of all allocations.
7751 optional int32 total_size_in_kilobytes = 3;
7752
7753 // Number of allocations.
7754 optional int32 allocation_count = 4;
7755
7756 // Size of the largest allocation.
7757 optional int32 max_size_in_kilobytes = 5;
7758}
7759
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007760/**
7761 * Push network stack events.
7762 *
7763 * Log from:
7764 * frameworks/base/packages/NetworkStack/
7765 */
7766message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007767 // The id that indicates the event reported from NetworkStack.
7768 optional int32 event_id = 1;
7769 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007770 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7771}
Carmen Agimofa769c152019-03-04 14:39:14 +00007772
7773/**
7774 * Logs the apps that are installed on the external storage.
7775 * Pulled from:
7776 * StatsCompanionService
7777 */
7778message AppsOnExternalStorageInfo {
7779 // The type of the external storage.
7780 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7781 // The name of the package that is installed on the external storage.
7782 optional string package_name = 2;
7783}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007784
7785/**
7786 * Logs the settings related to Face.
7787 * Logged from:
7788 * frameworks/base/services/core/java/com/android/server/stats
7789 */
7790message FaceSettings {
7791 // Whether or not face unlock is allowed on Keyguard.
7792 optional bool unlock_keyguard_enabled = 1;
7793 // Whether or not face unlock dismisses the Keyguard.
7794 optional bool unlock_dismisses_keyguard = 2;
7795 // Whether or not face unlock requires attention.
7796 optional bool unlock_attention_required = 3;
7797 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7798 optional bool unlock_app_enabled = 4;
7799 // Whether or not face unlock always requires user confirmation.
7800 optional bool unlock_always_require_confirmation = 5;
7801 // Whether or not a diverse set of poses are required during enrollment.
7802 optional bool unlock_diversity_required = 6;
7803}
Maggie White442b6312019-04-05 16:26:44 -07007804
7805/**
7806 * Logs cooling devices maintained by the kernel.
7807 *
7808 * Pulled from StatsCompanionService.java
7809 */
7810message CoolingDevice {
7811 // The type of cooling device being reported. Eg. CPU, GPU...
7812 optional android.os.CoolingTypeEnum device_location = 1;
7813 // The name of the cooling device source. Eg. CPU0
7814 optional string device_name = 2;
7815 // Current throttle state of the cooling device. The value can any unsigned
7816 // integer between 0 and max_state defined in its driver. 0 means device is
7817 // not in throttling, higher value means deeper throttling.
7818 optional int32 state = 3;
7819}
Ben Blount763a5d52019-04-10 11:48:58 -07007820
7821/**
7822 * Intelligence has several counter-type events that don't warrant a
7823 * full separate atom. These are primarily API call counters but also include
7824 * counters for feature usage and specific failure modes.
7825 *
7826 * Logged from the Intelligence mainline module.
7827 */
7828message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007829 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007830 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007831 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007832 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007833 // How many times the event occured (to report a batch of high frequency events).
7834 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007835 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007836 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007837}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007838
7839/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007840 * Logs when Car Power state changed.
7841 *
7842 * Logged from:
7843 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7844 */
7845message CarPowerStateChanged {
7846 // States come from CpmsState in CarPowerManagementService.java.
7847 enum State {
7848 WAIT_FOR_VHAL = 0;
7849 ON = 1;
7850 SHUTDOWN_PREPARE = 2;
7851 WAIT_FOR_FINISH = 3;
7852 SUSPEND = 4;
7853 SIMULATE_SLEEP = 5;
7854 }
7855 optional State state = 1;
7856}
7857
7858/**
7859 * Logs whether GarageMode is entered.
7860 *
7861 * Logged from:
7862 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7863 */
7864message GarageModeInfo {
7865 // Whether GarageMode is entered.
7866 optional bool is_garage_mode = 1;
7867}
Martijn Coenencd95d462019-04-25 17:09:45 +02007868
7869/**
7870 * Historical app ops data per package.
7871 */
7872message AppOps {
7873 // Uid of the package requesting the op
7874 optional int32 uid = 1 [(is_uid) = true];
7875
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007876 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007877 optional string package_name = 2;
7878
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007879 // operation id
7880 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007881
7882 // The number of times the op was granted while the app was in the
7883 // foreground (only for trusted requests)
7884 optional int64 trusted_foreground_granted_count = 4;
7885
7886 // The number of times the op was granted while the app was in the
7887 // background (only for trusted requests)
7888 optional int64 trusted_background_granted_count = 5;
7889
7890 // The number of times the op was rejected while the app was in the
7891 // foreground (only for trusted requests)
7892 optional int64 trusted_foreground_rejected_count = 6;
7893
7894 // The number of times the op was rejected while the app was in the
7895 // background (only for trusted requests)
7896 optional int64 trusted_background_rejected_count = 7;
7897
7898 // For long-running operations, total duration of the operation
7899 // while the app was in the foreground (only for trusted requests)
7900 optional int64 trusted_foreground_duration_millis = 8;
7901
7902 // For long-running operations, total duration of the operation
7903 // while the app was in the background (only for trusted requests)
7904 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007905
7906 // Whether AppOps is guarded by Runtime permission
7907 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007908}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007909
7910/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007911 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007912 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007913message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007914 // Uid of the package requesting the op
7915 optional int32 uid = 1 [(is_uid) = true];
7916
7917 // Name of the package performing the op
7918 optional string package_name = 2;
7919
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007920 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7921 // Attributions must be provided through manifest using <attribution> tag available in R and
7922 // above.
7923 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007924
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007925 // operation id
7926 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007927
7928 // The number of times the op was granted while the app was in the
7929 // foreground (only for trusted requests)
7930 optional int64 trusted_foreground_granted_count = 5;
7931
7932 // The number of times the op was granted while the app was in the
7933 // background (only for trusted requests)
7934 optional int64 trusted_background_granted_count = 6;
7935
7936 // The number of times the op was rejected while the app was in the
7937 // foreground (only for trusted requests)
7938 optional int64 trusted_foreground_rejected_count = 7;
7939
7940 // The number of times the op was rejected while the app was in the
7941 // background (only for trusted requests)
7942 optional int64 trusted_background_rejected_count = 8;
7943
7944 // For long-running operations, total duration of the operation
7945 // while the app was in the foreground (only for trusted requests)
7946 optional int64 trusted_foreground_duration_millis = 9;
7947
7948 // For long-running operations, total duration of the operation
7949 // while the app was in the background (only for trusted requests)
7950 optional int64 trusted_background_duration_millis = 10;
7951
7952 // Whether AppOps is guarded by Runtime permission
7953 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007954
7955 // Sampling rate used on device, from 0 to 100
7956 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007957}
7958
7959/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007960 * Location Manager API Usage information(e.g. API under usage,
7961 * API call's parameters).
7962 * Logged from:
7963 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7964 */
7965message LocationManagerApiUsageReported {
7966
7967 // Indicating if usage starts or usage ends.
7968 optional android.stats.location.UsageState state = 1;
7969
7970 // LocationManagerService's API in use.
7971 // We can identify which API from LocationManager is
7972 // invoking current LMS API by the combination of
7973 // API parameter(e.g. is_listener_null, is_intent_null,
7974 // is_location_request_null)
7975 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7976
7977 // Name of the package calling the API.
7978 optional string calling_package_name = 3;
7979
7980 // Type of the location provider.
7981 optional android.stats.location.ProviderType provider = 4;
7982
7983 // Quality of the location request
7984 optional android.stats.location.LocationRequestQuality quality = 5;
7985
7986 // The desired interval for active location updates, in milliseconds.
7987 // Bucketized to reduce cardinality.
7988 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7989
7990 // Minimum distance between location updates, in meters.
7991 // Bucketized to reduce cardinality.
7992 optional android.stats.location.SmallestDisplacementBucket
7993 bucketized_smallest_displacement = 7;
7994
7995 // The number of location updates.
7996 optional int64 num_updates = 8;
7997
7998 // The request expiration time, in millisecond since boot.
7999 // Bucketized to reduce cardinality.
8000 optional android.stats.location.ExpirationBucket
8001 bucketized_expire_in = 9;
8002
8003 // Type of Callback passed in for this API.
8004 optional android.stats.location.CallbackType callback_type = 10;
8005
8006 // The radius of the central point of the alert
8007 // region, in meters. Only for API REQUEST_GEOFENCE.
8008 // Bucketized to reduce cardinality.
8009 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8010
8011 // Activity Importance of API caller.
8012 // Categorized to 3 types that are interesting from location's perspective.
8013 optional android.stats.location.ActivityImportance activiy_importance = 12;
8014}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008015
8016/**
8017 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8018 */
8019message ReviewPermissionsFragmentResultReported {
8020 // unique value identifying a permission group change. A permission group change might result
8021 // in multiple of these atoms
8022 optional int64 change_id = 1;
8023
8024 // UID of package the permission belongs to
8025 optional int32 uid = 2 [(is_uid) = true];
8026
8027 // Name of package the permission belongs to
8028 optional string package_name = 3;
8029
8030 // The permission to be granted
8031 optional string permission_name = 4;
8032
8033 // The result of the permission grant
8034 optional bool permission_granted = 5;
8035}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008036
8037/**
8038* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8039* Logged from: RuntimePermissionUpdgradeController
8040*/
8041message RuntimePermissionsUpgradeResult {
8042 // Permission granted as result of upgrade
8043 optional string permission_name = 1;
8044
8045 // UID of package granted permission
8046 optional int32 uid = 2 [(is_uid) = true];
8047
8048 // Name of package granted permission
8049 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008050}
8051
8052/**
8053* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8054*/
8055message GrantPermissionsActivityButtonActions {
8056 // Permission granted as result of upgrade
8057 optional string permission_group_name = 1;
8058
8059 // UID of package granted permission
8060 optional int32 uid = 2 [(is_uid) = true];
8061
8062 // Name of package requesting permission
8063 optional string package_name = 3;
8064
8065 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8066 // LABEL_ constants in GrantPermissionActivity.java
8067 optional int32 buttons_presented = 4;
8068
8069 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8070 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008071
8072 // id which identifies single session of user interacting with permission controller
8073 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008074}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008075
8076/**
8077 * Information about LocationAccessCheck notification presented to user
8078 */
8079message LocationAccessCheckNotificationAction {
8080
8081 // id which identifies single session of user interacting with permission controller
8082 optional int64 session_id = 1;
8083
8084 // Uid of package for which location access check is presented
8085 optional int32 package_uid = 2;
8086
8087 // Name of package for which location access check is presented
8088 optional string package_name = 3;
8089
8090 enum Result {
8091 UNDEFINED = 0;
8092 // notification was presented to the user
8093 NOTIFICATION_PRESENTED = 1;
8094 // notification was declined by the user
8095 NOTIFICATION_DECLINED = 2;
8096 // notification was clicked by the user
8097 NOTIFICATION_CLICKED = 3;
8098 }
8099
8100 // View / interaction recorded
8101 optional Result result = 4;
8102}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008103
8104/**
8105 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8106 */
8107message AppPermissionFragmentActionReported {
8108 // id which identifies single session of user interacting with permission controller
8109 optional int64 session_id = 1;
8110
8111 // unique value identifying a permission group change. A permission group change might result
8112 // in multiple of these atoms
8113 optional int64 change_id = 2;
8114
8115 // UID of package the permission belongs to
8116 optional int32 uid = 3 [(is_uid) = true];
8117
8118 // Name of package the permission belongs to
8119 optional string package_name = 4;
8120
8121 // The permission to be granted
8122 optional string permission_name = 5;
8123
8124 // The result of the permission grant
8125 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008126
8127 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8128 optional int32 permission_flags = 7;
8129
8130 enum Button {
8131 UNDEFINED = 0;
8132 // Allow button
8133 ALLOW = 1;
8134 // Deny button
8135 DENY = 2;
8136 // Ask every time button
8137 ASK_EVERY_TIME = 3;
8138 // Allow all the time button
8139 ALLOW_ALWAYS = 4;
8140 // Allow only while using the app button
8141 ALLOW_FOREGROUND = 5;
8142 // Same is Deny button but shown in while in use dialog
8143 DENY_FOREGROUND = 6;
8144 }
8145
8146 // Button pressed in the dialog
8147 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008148}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008149
8150/**
8151* Information about a AppPermissionFragment viewed by user
8152*/
8153message AppPermissionFragmentViewed {
8154 // id which identifies single session of user interacting with permission controller
8155 optional int64 session_id = 1;
8156
8157 // UID of package for which permissions are viewed
8158 optional int32 uid = 2 [(is_uid) = true];
8159
8160 // Name of package for which permissions are viewed
8161 optional string package_name = 3;
8162
8163 // Permission group viewed
8164 optional string permission_group_name = 4;
8165}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008166
8167/**
8168* Information about a AppPermissionsFragment viewed by user
8169*/
8170message AppPermissionsFragmentViewed {
8171 // id which identifies single session of user interacting with permission controller
8172 optional int64 session_id = 1;
8173
8174 // id which identifies single view as every view might have several logging records
8175 // with different package information attached
8176 optional int64 view_id = 2;
8177
8178 // Permission group viewed
8179 optional string permission_group_name = 3;
8180
8181 // UID of package for which permissions are viewed
8182 optional int32 uid = 4 [(is_uid) = true];
8183
8184 // Name of package for which permissions are viewed
8185 optional string package_name = 5;
8186
8187 // Category in which permission is included
8188 enum Category {
8189 UNDEFINED = 0;
8190 ALLOWED = 1;
8191 ALLOWED_FOREGROUND = 2;
8192 DENIED = 3;
8193 }
8194 optional Category category = 6;
8195}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008196
8197/**
8198* Information about a PermissionAppsFragment viewed by user.
8199* Logged from ui/handheld/PermissionAppsFragment.java
8200*/
8201message PermissionAppsFragmentViewed {
8202 // id which identifies single session of user interacting with permission controller
8203 optional int64 session_id = 1;
8204
8205 // id which identifies single view as every view might have several logging records
8206 // with different package information attached
8207 optional int64 view_id = 2;
8208
8209 // Permission group viewed
8210 optional string permission_group_name = 3;
8211
8212 // UID of package for which permissions are viewed
8213 optional int32 uid = 4 [(is_uid) = true];
8214
8215 // Name of package for which permissions are viewed
8216 optional string package_name = 5;
8217
8218 // Category in which app is included
8219 enum Category {
8220 UNDEFINED = 0;
8221 ALLOWED = 1;
8222 ALLOWED_FOREGROUND = 2;
8223 DENIED = 3;
8224 }
8225 optional Category category = 6;
8226}
Tony Make2b1b672019-07-29 16:59:47 +01008227
8228/**
8229 * Logs when there is a smart selection related event.
8230 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8231 * Logged from: TextClassifierEventLogger.java
8232 */
8233message TextSelectionEvent {
8234 // A session ID.
8235 optional string session_id = 1;
8236
8237 // Event type of this event.
8238 optional android.stats.textclassifier.EventType event_type = 2;
8239
Tony Mak9c84bd22019-12-09 07:27:25 +00008240 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008241 optional string model_name = 3;
8242
8243 // Type of widget that was involved in triggering this event.
8244 optional android.stats.textclassifier.WidgetType widget_type = 4;
8245
8246 // Index of this event in a session.
8247 optional int32 event_index = 5;
8248
8249 // Entity type that is involved.
8250 optional string entity_type = 6;
8251
8252 // Relative word index of the start of the selection.
8253 optional int32 relative_word_start_index = 7;
8254
8255 // Relative word (exclusive) index of the end of the selection.
8256 optional int32 relative_word_end_index = 8;
8257
8258 // Relative word index of the start of the smart selection.
8259 optional int32 relative_suggested_word_start_index = 9;
8260
8261 // Relative word (exclusive) index of the end of the smart selection.
8262 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008263
8264 // Name of source package.
8265 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008266
8267 // Name of the LangID model that is involved in this event.
8268 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008269}
8270
8271/**
8272 * Logs when there is a smart linkify related event.
8273 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8274 * Logged from: TextClassifierEventLogger.java
8275 */
8276message TextLinkifyEvent {
8277 // A session ID.
8278 optional string session_id = 1;
8279
8280 // Event type of this event.
8281 optional android.stats.textclassifier.EventType event_type = 2;
8282
Tony Mak9c84bd22019-12-09 07:27:25 +00008283 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008284 optional string model_name = 3;
8285
8286 // Type of widget that was involved in triggering this event.
8287 optional android.stats.textclassifier.WidgetType widget_type = 4;
8288
8289 // Index of this event in a session.
8290 optional int32 event_index = 5;
8291
8292 // Entity type that is involved.
8293 optional string entity_type = 6;
8294
8295 // Number of links detected.
8296 optional int32 num_links = 7;
8297
8298 // The total length of all links.
8299 optional int32 linked_text_length = 8;
8300
8301 // Length of input text.
8302 optional int32 text_length = 9;
8303
8304 // Time spent on generating links in ms.
8305 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008306
8307 // Name of source package.
8308 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008309
8310 // Name of the LangID model that is involved in this event.
8311 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008312}
8313
8314/**
8315 * Logs when there is a conversation actions related event.
8316 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8317 * Logged from: TextClassifierEventLogger.java
8318 */
8319message ConversationActionsEvent {
8320 // A session ID.
8321 optional string session_id = 1;
8322
8323 // Event type of this event.
8324 optional android.stats.textclassifier.EventType event_type = 2;
8325
Tony Mak9c84bd22019-12-09 07:27:25 +00008326 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008327 optional string model_name = 3;
8328
8329 // Type of widget that was involved in triggering this event.
8330 optional android.stats.textclassifier.WidgetType widget_type = 4;
8331
8332 // The first entity type that is involved.
8333 optional string first_entity_type = 5;
8334
8335 // The second entity type that is involved.
8336 optional string second_entity_type = 6;
8337
8338 // The third entity type that is involved.
8339 optional string third_entity_type = 7;
8340
8341 // The score of the first entity type.
8342 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008343
8344 // Name of source package.
8345 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008346
8347 // Name of the annotator model that is involved in this event.
8348 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008349
8350 // Name of the LangID model that is involved in this event.
8351 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008352}
8353
8354/**
8355 * Logs when there is a language detection related event.
8356 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8357 * Logged from: TextClassifierEventLogger.java
8358 */
8359message LanguageDetectionEvent {
8360 // A session ID.
8361 optional string session_id = 1;
8362
8363 // Event type of this event.
8364 optional android.stats.textclassifier.EventType event_type = 2;
8365
Tony Mak9c84bd22019-12-09 07:27:25 +00008366 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008367 optional string model_name = 3;
8368
8369 // Type of widget that was involved in triggering this event.
8370 optional android.stats.textclassifier.WidgetType widget_type = 4;
8371
8372 // Detected language.
8373 optional string language_tag = 5;
8374
8375 // Score of the detected language.
8376 optional float score = 6;
8377
8378 // Position of this action.
8379 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008380
8381 // Name of source package.
8382 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008383}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008384
8385/**
8386 * Information about an OTA update attempt by update_engine.
8387 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8388 */
8389message UpdateEngineUpdateAttemptReported {
8390 // The number of attempts for the update engine to apply a given payload.
8391 optional int32 attempt_number = 1;
8392
8393 optional android.stats.otaupdate.PayloadType payload_type = 2;
8394
8395 // The total time in minutes for the update engine to apply a given payload.
8396 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8397 // it's increased when the system is sleeping.
8398 optional int32 duration_boottime_in_minutes = 3;
8399
8400 // The total time in minutes for the update engine to apply a given payload.
8401 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8402 // and it's not increased when the system is sleeping.
8403 optional int32 duration_monotonic_in_minutes = 4;
8404
8405 // The size of the payload in MiBs.
8406 optional int32 payload_size_mib = 5;
8407
8408 // The attempt result reported by the update engine for an OTA update.
8409 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8410
8411 // The error code reported by the update engine after an OTA update attempt
8412 // on A/B devices.
8413 optional android.stats.otaupdate.ErrorCode error_code = 7;
8414
8415 // The build fingerprint of the source system. The value is read from a
8416 // system property when the device takes the update. e.g.
8417 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8418 optional string source_fingerprint = 8;
8419}
8420
8421/**
8422 * Information about all the attempts the device make before finishing the
8423 * successful update.
8424 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8425 */
8426message UpdateEngineSuccessfulUpdateReported {
8427 // The number of attempts for the update engine to apply the payload for a
8428 // successful update.
8429 optional int32 attempt_count = 1;
8430
8431 optional android.stats.otaupdate.PayloadType payload_type = 2;
8432
8433 optional int32 payload_size_mib = 3;
8434
8435 // The total number of bytes downloaded by update_engine since the last
8436 // successful update.
8437 optional int32 total_bytes_downloaded_mib = 4;
8438
8439 // The ratio in percentage of the over-downloaded bytes compared to the
8440 // total bytes needed to successfully install the update. e.g. 200 if we
8441 // download 200MiB in total for a 100MiB package.
8442 optional int32 download_overhead_percentage = 5;
8443
8444 // The total time in minutes for the update engine to apply the payload for a
8445 // successful update.
8446 optional int32 total_duration_minutes = 6;
8447
8448 // The number of reboot of the device during a successful update.
8449 optional int32 reboot_count = 7;
8450}
Alec Mourie088e762019-07-02 13:10:55 -07008451
8452/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008453 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8454 * key to indicate whether it was successful or not.
8455 *
8456 * Logged from:
8457 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8458 */
8459message RebootEscrowRecoveryReported {
8460 optional bool successful = 1;
8461}
8462
8463/**
Alec Mourie088e762019-07-02 13:10:55 -07008464 * Global display pipeline metrics reported by SurfaceFlinger.
8465 * Pulled from:
8466 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8467 */
8468message SurfaceflingerStatsGlobalInfo {
8469 // Total number of frames presented during the tracing period
8470 optional int64 total_frames = 1;
8471 // Total number of frames missed
8472 optional int64 missed_frames = 2;
8473 // Total number of frames that fell back to client composition
8474 optional int64 client_composition_frames = 3;
8475 // Total time the display was turned on
8476 optional int64 display_on_millis = 4;
8477 // Total time that was spent performing animations.
8478 // This is derived from the present-to-present layer histogram
8479 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008480 // Total number of event connections tracked by SurfaceFlinger at the time
8481 // of this pull. If this number grows prohibitively large, then this can
8482 // cause jank due to resource contention.
8483 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008484 // Set of timings measured from when SurfaceFlinger began compositing a
8485 // frame, until the frame was requested to be presented to the display. This
8486 // measures SurfaceFlinger's total CPU walltime on the critical path per
8487 // frame.
8488 optional FrameTimingHistogram frame_duration = 7
8489 [(android.os.statsd.log_mode) = MODE_BYTES];
8490 // Set of timings measured from when SurfaceFlinger first began using the
8491 // GPU to composite a frame, until the GPU has finished compositing that
8492 // frame. This measures the total additional time SurfaceFlinger needed to
8493 // perform due to falling back into GPU composition.
8494 optional FrameTimingHistogram render_engine_timing = 8
8495 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008496}
8497
8498/**
8499 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8500 * The number of layers uploaded will be restricted due to size limitations.
8501 * Pulled from:
8502 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8503 */
8504message SurfaceflingerStatsLayerInfo {
8505 // The layer for this set of metrics
8506 // For now we can infer that the package name is included in the layer
8507 // name.
8508 optional string layer_name = 1;
8509 // Total number of frames presented
8510 optional int64 total_frames = 2;
8511 // Total number of dropped frames while latching a buffer for this layer.
8512 optional int64 dropped_frames = 3;
8513 // Set of timings measured between successive presentation timestamps.
8514 optional FrameTimingHistogram present_to_present = 4
8515 [(android.os.statsd.log_mode) = MODE_BYTES];
8516 // Set of timings measured from when an app queued a buffer for
8517 // presentation, until the buffer was actually presented to the
8518 // display.
8519 optional FrameTimingHistogram post_to_present = 5
8520 [(android.os.statsd.log_mode) = MODE_BYTES];
8521 // Set of timings measured from when a buffer is ready to be presented,
8522 // until the buffer was actually presented to the display.
8523 optional FrameTimingHistogram acquire_to_present = 6
8524 [(android.os.statsd.log_mode) = MODE_BYTES];
8525 // Set of timings measured from when a buffer was latched by
8526 // SurfaceFlinger, until the buffer was presented to the display
8527 optional FrameTimingHistogram latch_to_present = 7
8528 [(android.os.statsd.log_mode) = MODE_BYTES];
8529 // Set of timings measured from the desired presentation to the actual
8530 // presentation time
8531 optional FrameTimingHistogram desired_to_present = 8
8532 [(android.os.statsd.log_mode) = MODE_BYTES];
8533 // Set of timings measured from when an app queued a buffer for
8534 // presentation, until the buffer was ready to be presented.
8535 optional FrameTimingHistogram post_to_acquire = 9
8536 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008537 // Frames missed latch because the acquire fence didn't fire
8538 optional int64 late_acquire_frames = 10;
8539 // Frames latched early because the desired present time was bad
8540 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008541}
8542
8543/**
8544 * Histogram of frame counts bucketed by time in milliseconds.
8545 * Because of size limitations, we hard-cap the number of buckets, with
8546 * buckets for corresponding to larger milliseconds being less precise.
8547 */
8548message FrameTimingHistogram {
8549 // Timings in milliseconds that describes a set of histogram buckets
8550 repeated int32 time_millis_buckets = 1;
8551 // Number of frames that match to each time_millis, i.e. the bucket
8552 // contents
8553 // It's required that len(time_millis) == len(frame_count)
8554 repeated int64 frame_counts = 2;
8555}
Emilian Peev6729f372019-08-29 09:14:09 -07008556
Emilian Peev6729f372019-08-29 09:14:09 -07008557/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008558 * Janky event as reported by SurfaceFlinger.
8559 * This event is intended to be consumed by a Perfetto subscriber for
8560 * automated trace collection.
8561 *
8562 * Logged from:
8563 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8564 */
8565message DisplayJankReported {
8566 // Informational field for how long the janky event lasted in milliseconds
8567 optional int64 event_duration_millis = 1;
8568 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8569 // the display on time.
8570 optional int32 present_deadlines_missed = 2;
8571}
8572
8573/**
Emilian Peev6729f372019-08-29 09:14:09 -07008574 * Information about camera facing and API level usage.
8575 * Logged from:
8576 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8577 */
8578message CameraActionEvent {
8579 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008580 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008581
8582 // Camera API level used
8583 optional int32 api_level = 2;
8584
8585 // Name of client package
8586 optional string package_name = 3;
8587
8588 // Camera facing
8589 enum Facing {
8590 UNKNOWN = 0;
8591 BACK = 1;
8592 FRONT = 2;
8593 EXTERNAL = 3;
8594 }
8595 optional Facing facing = 4;
8596}
atrost01a20932019-08-28 15:40:37 +01008597
8598/**
8599 * Logs when a compatibility change is affecting an app.
8600 *
8601 * Logged from:
8602 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8603 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8604 */
8605message AppCompatibilityChangeReported {
8606 // The UID of the app being affected by the compatibilty change.
8607 optional int32 uid = 1 [(is_uid) = true];
8608
8609 // The ID of the change affecting the app.
8610 optional int64 change_id = 2;
8611
8612 enum State {
8613 UNKNOWN_STATE = 0;
8614 ENABLED = 1;
8615 DISABLED = 2;
8616 LOGGED = 3;
8617 }
8618
8619 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8620 // logged otherwise.
8621 optional State state = 3;
8622
8623 enum Source {
8624 UNKNOWN_SOURCE = 0;
8625 APP_PROCESS = 1;
8626 SYSTEM_SERVER = 2;
8627 }
8628
8629 // Where it was logged from.
8630 optional Source source = 4;
8631
8632}
Hector Dearman40579f62019-11-01 13:19:30 +00008633
8634/**
8635 * Logged from
8636 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8637 */
8638message PerfettoUploaded {
8639 enum Event {
8640 PERFETTO_UNDEFINED = 0;
8641 PERFETTO_TRACE_BEGIN = 1;
8642 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8643 PERFETTO_ON_CONNECT = 3;
8644 PERFETTO_ON_TRACING_DISABLED = 4;
8645 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8646 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8647 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8648 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8649 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8650 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8651 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8652 PERFETTO_TRIGGER_BEGIN = 12;
8653 PERFETTO_TRIGGER_SUCCESS = 13;
8654 PERFETTO_TRIGGER_FAILURE = 14;
8655 PERFETTO_HIT_GUARDRAILS = 15;
8656 PERFETTO_ON_TIMEOUT = 16;
8657 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8658 }
8659
8660 // Which stage of the pipeline we are reporting from.
8661 optional Event event = 1;
8662
8663 // UUID matching the one set inside the SystemInfo trace packet.
8664 optional int64 trace_uuid_lsb = 2;
8665 optional int64 trace_uuid_msb = 3;
8666}
Mark Tabrya824a642019-11-05 12:26:12 -08008667
8668/**
8669 * Pulls client metrics on data transferred via Vehicle Maps Service.
8670 * Metrics are keyed by uid + layer.
8671 *
8672 * Pulled from:
8673 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8674 */
8675message VmsClientStats {
8676 // UID of the VMS client app
8677 optional int32 uid = 1 [(is_uid) = true];
8678
8679 // VMS layer definition
8680 optional int32 layer_type = 2;
8681 optional int32 layer_channel = 3;
8682 optional int32 layer_version = 4;
8683
8684 // Bytes and packets sent by the client for the layer
8685 optional int64 tx_bytes = 5;
8686 optional int64 tx_packets = 6;
8687
8688 // Bytes and packets received by the client for the layer
8689 optional int64 rx_bytes = 7;
8690 optional int64 rx_packets = 8;
8691
8692 // Bytes and packets dropped due to client error
8693 optional int64 dropped_bytes = 9;
8694 optional int64 dropped_packets = 10;
8695}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008696
8697/**
8698 * State of a dangerous permission requested by a package - sampled
8699 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8700*/
8701message DangerousPermissionStateSampled {
8702 // Name of the permission
8703 optional string permission_name = 1;
8704
8705 // Uid of the package
8706 optional int32 uid = 2 [(is_uid) = true];
8707
8708 // If the permission is granted to the uid
8709 optional bool is_granted = 3;
8710
8711 // Permission flags as per android.content.pm.PermissionFlags
8712 optional int32 permission_flags = 4;
8713}
8714
Stan Iliev637ba5e2019-08-16 13:43:08 -04008715/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008716 * HWUI stats for a given app.
8717 */
8718message GraphicsStats {
8719 // The package name of the app
8720 optional string package_name = 1;
8721
8722 // The version code of the app
8723 optional int64 version_code = 2;
8724
8725 // The start & end timestamps in UTC as
8726 // milliseconds since January 1, 1970
8727 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008728 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008729
Stan Ilievb6517192020-02-18 10:12:42 -05008730 optional int64 end_millis = 4;
8731
8732 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8733 enum PipelineType {
8734 UNKNOWN = 0;
8735 GL = 1;
8736 VULKAN = 2;
8737 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008738
8739 // HWUI renders pipeline type: GL or Vulkan.
8740 optional PipelineType pipeline = 5;
8741
8742 // Distinct frame count.
8743 optional int32 total_frames = 6;
8744
8745 // Number of "missed vsync" events.
8746 optional int32 missed_vsync_count = 7;
8747
8748 // Number of frames in triple-buffering scenario (high input latency)
8749 optional int32 high_input_latency_count = 8;
8750
8751 // Number of "slow UI thread" events.
8752 optional int32 slow_ui_thread_count = 9;
8753
8754 // Number of "slow bitmap upload" events.
8755 optional int32 slow_bitmap_upload_count = 10;
8756
8757 // Number of "slow draw" events.
8758 optional int32 slow_draw_count = 11;
8759
8760 // Number of frames that missed their deadline (aka, visibly janked)
8761 optional int32 missed_deadline_count = 12;
8762
8763 // The frame time histogram for the package
8764 optional FrameTimingHistogram cpu_histogram = 13
8765 [(android.os.statsd.log_mode) = MODE_BYTES];
8766
8767 // The gpu frame time histogram for the package
8768 optional FrameTimingHistogram gpu_histogram = 14
8769 [(android.os.statsd.log_mode) = MODE_BYTES];
8770
8771 // UI mainline module version.
8772 optional int64 version_ui_module = 15;
8773
8774 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8775 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8776 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8777 // more apps are running / rendering.
8778 optional bool is_today = 16;
8779}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008780
8781/**
8782 * Message related to dangerous (runtime) app ops access
8783 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008784message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008785 // Uid of the package accessing app op
8786 optional int32 uid = 1 [(is_uid) = true];
8787
8788 // Name of the package accessing app op
8789 optional string package_name = 2;
8790
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008791 // deprecated - set to empty string
8792 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008793
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008794 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008795 // API. Attributions must be provided through manifest using <attribution> tag available in R
8796 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008797 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008798
8799 // message related to app op access, limited to 600 chars by API
8800 optional string message = 5;
8801
8802 enum SamplingStrategy {
8803 DEFAULT = 0;
8804 UNIFORM = 1;
8805 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008806 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008807 }
8808
8809 // sampling strategy used to collect this message
8810 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008811
8812 // operation id
8813 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008814}
8815
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008816/*
8817 * Logs userspace reboot outcome and duration.
8818 *
8819 * Logged from:
8820 * frameworks/base/core/java/com/android/server/BootReceiver.java
8821 */
8822message UserspaceRebootReported {
8823 // Possible outcomes of userspace reboot.
8824 enum Outcome {
8825 // Default value in case platform failed to determine the outcome.
8826 OUTCOME_UNKNOWN = 0;
8827 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8828 SUCCESS = 1;
8829 // Userspace reboot shutdown sequence was aborted.
8830 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8831 // Remounting userdata into checkpointing mode failed.
8832 FAILED_USERDATA_REMOUNT = 3;
8833 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8834 // reboot.
8835 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8836 }
8837 // Outcome of userspace reboot. Always set.
8838 optional Outcome outcome = 1;
8839 // Duration of userspace reboot in case it has a successful outcome.
8840 // Duration is measured as time between userspace reboot was initiated and until boot completed
8841 // (e.g. sys.boot_completed=1).
8842 optional int64 duration_millis = 2;
8843 // State of primary user's (user0) credential encryption storage.
8844 enum UserEncryptionState {
8845 // Default value.
8846 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8847 // Credential encrypted storage is unlocked.
8848 UNLOCKED = 1;
8849 // Credential encrypted storage is locked.
8850 LOCKED = 2;
8851 }
8852 // State of primary user's encryption storage at the moment boot completed. Always set.
8853 optional UserEncryptionState user_encryption_state = 3;
8854}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008855
8856/*
8857 * Logs integrity check information during each install.
8858 *
8859 * Logged from:
8860 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8861 */
8862message IntegrityCheckResultReported {
8863 optional string package_name = 1;
8864 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008865 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008866 optional string installer_package_name = 4;
8867 enum Response {
8868 UNKNOWN = 0;
8869 ALLOWED = 1;
8870 REJECTED = 2;
8871 FORCE_ALLOWED = 3;
8872 }
8873 optional Response response = 5;
8874 // An estimate on the cause of the response. This will only be populated for
8875 // REJECTED and FORCE_ALLOWED
8876 optional bool caused_by_app_cert_rule = 6;
8877 optional bool caused_by_installer_rule = 7;
8878}
8879
8880/**
8881 * Logs the information about the rules and the provider whenever rules are
8882 * pushed into AppIntegrityManager.
8883 *
8884 * Logged from:
8885 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8886 */
8887message IntegrityRulesPushed {
8888 optional bool success = 1;
8889 // Package name of the app that pushed the rules.
8890 optional string rule_provider = 2;
8891 // Version string of arbitrary format provided by the rule provider to
8892 // identify the rules.
8893 optional string rule_version = 3;
8894}
Jordan Liubedfa702019-12-20 15:08:45 -08008895
8896/**
8897 * Logs when a cell broadcast message is received on the device.
8898 *
8899 * Logged from CellBroadcastService module:
8900 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8901 */
8902message CellBroadcastMessageReported {
8903 // The type of Cell Broadcast message
8904 enum CbType {
8905 UNKNOWN_TYPE = 0;
8906 GSM = 1;
8907 CDMA = 2;
8908 CDMA_SPC = 3;
8909 }
8910
8911 // GSM, CDMA, CDMA-SCP
8912 optional CbType type = 1;
8913}
8914
8915/**
8916 * Logs when an error occurs while handling a cell broadcast message;
8917 *
8918 * Logged from CellBroadcastService module:
8919 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8920 */
8921message CellBroadcastMessageError {
8922 // The type of error raised when trying to handle a cell broadcast message
8923 enum ErrorType {
8924 UNKNOWN_TYPE = 0;
8925 CDMA_DECODING_ERROR = 1;
8926 CDMA_SCP_EMPTY = 2;
8927 CDMA_SCP_HANDLING_ERROR = 3;
8928 GSM_INVALID_HEADER_LENGTH = 4;
8929 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8930 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8931 GSM_INVALID_PDU = 7;
8932 GSM_INVALID_GEO_FENCING_DATA = 8;
8933 GSM_UMTS_INVALID_WAC = 9;
8934 FAILED_TO_INSERT_TO_DB = 10;
8935 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8936 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8937 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8938 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8939 }
8940
8941 // What kind of error occurred
8942 optional ErrorType type = 1;
8943
8944 // Exception message (or log message) associated with the error (max 1000 chars)
8945 optional string exception_message = 2;
8946}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008947
8948/**
8949 * Logs when the SDK Extensions test app has polled the current version.
8950 * This is atom ID 354.
8951 *
8952 * Logged from:
8953 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8954 */
8955message SdkExtensionStatus {
8956 enum ApiCallStatus {
8957 CALL_NOT_ATTEMPTED = 0;
8958 CALL_SUCCESSFUL = 1;
8959 CALL_FAILED = 2;
8960 }
8961
8962 optional ApiCallStatus result = 1;
8963
8964 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8965 optional int32 r_extension_version = 2;
8966
8967 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8968 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8969 optional int32 failed_call_symbol = 3;
8970}
Marco Ballesio497aff42020-01-24 08:39:42 -08008971
8972/**
8973 * Logs when an app is frozen or unfrozen.
8974 *
8975 * Logged from:
8976 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8977 */
8978message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008979 // The type of event.
8980 enum Action {
8981 UNKNOWN = 0;
8982 FREEZE_APP = 1;
8983 UNFREEZE_APP = 2;
8984 }
8985 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008986
Blake Kragten6ce382a2020-01-16 20:20:46 -08008987 // Pid of the process being frozen.
8988 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008989
Blake Kragten6ce382a2020-01-16 20:20:46 -08008990 // Name of the process being frozen.
8991 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008992
Blake Kragten6ce382a2020-01-16 20:20:46 -08008993 // Time since last unfrozen.
8994 optional int64 time_unfrozen_millis = 4;
8995}
8996
8997/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008998 * Pulls information for a single voice call.
8999 *
9000 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9001 *
9002 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009003 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009004 */
9005message VoiceCallSession {
9006 // Bearer (IMS or CS) when the call started.
9007 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9008
9009 // Bearer (IMS or CS) when the call ended.
9010 // The bearer may change during the call, e.g. due to SRVCC.
9011 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9012
9013 // Direction of the call (incoming or outgoing).
9014 optional android.telephony.CallDirectionEnum direction = 3;
9015
9016 // Time spent setting up the call.
9017 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9018
9019 // Whether the call ended before the setup was completed.
9020 optional bool setup_failed = 5;
9021
9022 // IMS reason code or CS disconnect cause.
9023 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9024 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9025 optional int32 disconnect_reason_code = 6;
9026
9027 // IMS extra code or CS precise disconnect cause.
9028 // For IMS, this code is vendor-specific
9029 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9030 optional int32 disconnect_extra_code = 7;
9031
9032 // IMS extra message or CS vendor cause.
9033 optional string disconnect_extra_message = 8;
9034
9035 // Radio access technology (RAT) used when call started.
9036 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9037
9038 // Radio access technology (RAT) used when call terminated.
9039 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9040
9041 // Number of times RAT changed during the call.
9042 optional int64 rat_switch_count = 11;
9043
9044 // A bitmask of all codecs used during the call.
9045 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9046 optional int64 codec_bitmask = 12;
9047
9048 // Number of other calls going on during call setup, for the same SIM slot.
9049 optional int32 concurrent_call_count_at_start = 13;
9050
9051 // Number of other calls going on during call termination, for the same SIM slot.
9052 optional int32 concurrent_call_count_at_end = 14;
9053
9054 // Index of the SIM is used, 0 for single-SIM devices.
9055 optional int32 sim_slot_index = 15;
9056
9057 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9058 optional bool is_multi_sim = 16;
9059
9060 // Whether the call was made with an eSIM profile.
9061 optional bool is_esim = 17;
9062
9063 // Carrier ID of the SIM card.
9064 // See https://source.android.com/devices/tech/config/carrierid.
9065 optional int32 carrier_id = 18;
9066
Chi Zhangba1b03a2020-04-21 17:17:56 -07009067 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009068 optional bool srvcc_completed = 19;
9069
9070 // Number of SRVCC failures.
9071 optional int64 srvcc_failure_count = 20;
9072
9073 // Number of SRVCC cancellations.
9074 optional int64 srvcc_cancellation_count = 21;
9075
Chi Zhangba1b03a2020-04-21 17:17:56 -07009076 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9077 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009078 optional bool rtt_enabled = 22;
9079
9080 // Whether this was an emergency call.
9081 optional bool is_emergency = 23;
9082
9083 // Whether the call was performed while roaming.
9084 optional bool is_roaming = 24;
9085}
9086
9087/**
9088 * Pulls voice call radio access technology (RAT) usage.
9089 *
9090 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9091 * time. The atom will be skipped if not enough data is available.
9092 *
9093 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009094 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009095 */
9096message VoiceCallRatUsage {
9097 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9098 optional int32 carrier_id = 1;
9099
9100 // Radio access technology.
9101 optional android.telephony.NetworkTypeEnum rat = 2;
9102
9103 // Total duration that voice calls spent on this carrier and RAT.
9104 optional int64 total_duration_seconds = 3;
9105
9106 // Total number of calls using this carrier and RAT.
9107 // A call is counted once even if it used the RAT multiple times.
9108 optional int64 call_count = 4;
9109}
9110
9111/**
9112 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9113 *
9114 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009115 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009116 */
9117message SimSlotState {
9118 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9119 optional int32 active_slot_count = 1;
9120
9121 // Number of SIM cards (both physical and active eSIM profiles).
9122 // This number is always equal to or less than the number of active SIM slots.
9123 optional int32 sim_count = 2;
9124
9125 // Number of active eSIM profiles.
9126 // This number is always equal to or less than the number of SIMs.
9127 optional int32 esim_count = 3;
9128}
9129
9130/**
9131 * Pulls supported cellular radio access technologies.
9132 *
9133 * This atom reports the capabilities of the device, rather than the network it has access to.
9134 *
9135 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009136 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009137 */
9138message SupportedRadioAccessFamily {
9139 // A bitmask of supported radio technologies.
9140 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9141 optional int64 network_type_bitmask = 1;
9142}
9143
9144/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009145 * Logs gnss stats from location service provider
9146 *
9147 * Pulled from:
9148 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9149 */
9150
9151message GnssStats {
9152 // Number of location reports since boot
9153 optional int64 location_reports = 1;
9154
9155 // Total pulled reports of Location failures since boot
9156 optional int64 location_failure_reports = 2;
9157
9158 // Number of time to first fix reports since boot
9159 optional int64 time_to_first_fix_reports = 3;
9160
9161 // Total pulled reported time to first fix (in milli-seconds) since boot
9162 optional int64 time_to_first_fix_milli_s = 4;
9163
9164 // Number of position accuracy reports since boot
9165 optional int64 position_accuracy_reports = 5;
9166
9167 // Total pulled reported position accuracy (in meters) since boot
9168 optional int64 position_accuracy_meters = 6;
9169
9170 // Number of top 4 average CN0 reports since boot
9171 optional int64 top_four_average_cn0_reports = 7;
9172
9173 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9174 optional int64 top_four_average_cn0_db_mhz = 8;
9175
9176 // Number of l5 top 4 average CN0 reports since boot
9177 optional int64 l5_top_four_average_cn0_reports = 9;
9178
9179 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9180 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9181
9182 // Total number of sv status messages reports since boot
9183 optional int64 sv_status_reports = 11;
9184
9185 // Total number of sv status messages reports, where sv is used in fix since boot
9186 optional int64 sv_status_reports_used_in_fix = 12;
9187
9188 // Total number of L5 sv status messages reports since boot
9189 optional int64 l5_sv_status_reports = 13;
9190
9191 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9192 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009193}
Kweku Adams12752132020-02-18 15:36:48 -08009194
9195/**
9196 * Logs when an app is moved to a different standby bucket.
9197 *
9198 * Logged from:
9199 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9200 */
9201message AppStandbyBucketChanged {
9202 optional string package_name = 1;
9203
9204 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9205 optional int32 user_id = 2;
9206
9207 // These enum values match the constants defined in UsageStatsManager.java.
9208 enum Bucket {
9209 BUCKET_UNKNOWN = 0;
9210 BUCKET_EXEMPTED = 5;
9211 BUCKET_ACTIVE = 10;
9212 BUCKET_WORKING_SET = 20;
9213 BUCKET_FREQUENT = 30;
9214 BUCKET_RARE = 40;
9215 BUCKET_RESTRICTED = 45;
9216 BUCKET_NEVER = 50;
9217 }
9218 optional Bucket bucket = 3;
9219
9220 enum MainReason {
9221 MAIN_UNKNOWN = 0;
9222 MAIN_DEFAULT = 0x0100;
9223 MAIN_TIMEOUT = 0x0200;
9224 MAIN_USAGE = 0x0300;
9225 MAIN_FORCED_BY_USER = 0x0400;
9226 MAIN_PREDICTED = 0x0500;
9227 MAIN_FORCED_BY_SYSTEM = 0x0600;
9228 }
9229 optional MainReason main_reason = 4;
9230
9231 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9232 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9233 // UsageStatsManager.java.
9234 optional int32 sub_reason = 5;
9235}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009236
9237/**
9238* Reports a started sharesheet transaction.
9239*
9240* Logged from:
9241* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9242*/
9243message SharesheetStarted {
9244 // The event_id (as for UiEventReported).
9245 optional int32 event_id = 1;
9246 // The calling app's package name.
9247 optional string package_name = 2;
9248 // An identifier to tie together multiple logs relating to the same share event
9249 optional int32 instance_id = 3;
9250 // The mime type of the share
9251 optional string mime_type = 4;
9252 // The number of direct targets the calling app is providing that will be shown.
9253 optional int32 num_app_provided_direct_targets = 5;
9254 // The number of app targets the calling app is providing that will be shown.
9255 optional int32 num_app_provided_app_targets = 6;
9256 // True if the share originates from the workprofile
9257 optional bool is_workprofile = 7;
9258
9259 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009260 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009261 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9262 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9263 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9264 }
9265 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009266 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009267
9268 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9269 INTENT_DEFAULT = 0;
9270 INTENT_ACTION_VIEW = 1;
9271 INTENT_ACTION_EDIT = 2;
9272 INTENT_ACTION_SEND = 3;
9273 INTENT_ACTION_SENDTO = 4;
9274 INTENT_ACTION_SEND_MULTIPLE = 5;
9275 INTENT_ACTION_IMAGE_CAPTURE = 6;
9276 INTENT_ACTION_MAIN = 7;
9277 }
9278 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009279 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009280}
9281
9282/**
9283 * Reports a ranking selection event.
9284 *
9285 * Logged from:
9286 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9287 */
9288message RankingSelected {
9289 // The event_id (as for UiEventReported).
9290 optional int32 event_id = 1;
9291 // The relevant app's package name (can be source or picked package).
9292 optional string package_name = 2;
9293 // An identifier to tie together multiple logs relating to the same share event.
9294 optional int32 instance_id = 3;
9295 // Which of the ranked targets got picked, default starting position 0.
9296 optional int32 position_picked = 4;
9297}
Raff Tsaiea4db182020-03-06 07:45:43 +08009298
9299/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009300 * Logs when TvSettings UI is interacted at.
9301 *
9302 * Logged from: packages/apps/TvSettings
9303 */
9304message TvSettingsUIInteracted {
9305
9306 /** The UI action category */
9307 optional android.app.tvsettings.Action action = 1;
9308
9309 /** The ID of the entry that the users actioned on */
9310 optional android.app.tvsettings.ItemId item_id = 2;
9311
9312 /** Additional information (e.g., navigation direction on page focused) */
9313 optional string additional_info = 3;
9314}
9315
9316/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009317 * Logs information about a package installation using package installer V2 APIs.
9318 *
9319 * Logged from:
9320 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9321 */
9322message PackageInstallerV2Reported {
9323 // Whether this installation uses Incremental File System
9324 optional bool is_incremental = 1;
9325 // Name of the package that is intended to be installed
9326 optional string package_name = 2;
9327 // The duration between when the install was requested to when the install has completed
9328 optional int64 duration_millis = 3;
9329 // Installation result in final integer, which are SystemApi's.
9330 // Return_code 1 indicates success.
9331 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9332 optional int32 return_code = 4;
9333}
9334
9335/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009336 * Logs settings provider values.
9337 *
9338 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9339 * then write the value to proto.
9340 *
9341 */
9342message SettingSnapshot {
9343
9344 // Setting key
9345 optional string name = 1;
9346
9347 enum SettingsValueType {
9348 NOTASSIGNED = 0;
9349 ASSIGNED_BOOL_TYPE = 1;
9350 ASSIGNED_INT_TYPE = 2;
9351 ASSIGNED_FLOAT_TYPE = 3;
9352 ASSIGNED_STRING_TYPE = 4;
9353 };
9354 // Setting value type
9355 optional SettingsValueType type = 2;
9356
9357 optional bool bool_value = 3;
9358
9359 optional int32 int_value = 4;
9360
9361 optional float float_value = 5;
9362
9363 optional string str_value = 6;
9364
9365 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9366 optional int32 user_id = 7;
9367}
Varun Shahacb56342019-12-18 11:45:38 -08009368
9369/**
9370 * An event logged to indicate that a user journey is about to be performed. This atom includes
9371 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9372 * will immediately follow this atom which will describe the event(s) and its state.
9373 *
9374 * Logged from:
9375 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9376 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9377 */
9378message UserLifecycleJourneyReported {
9379 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9380 // UserLifecycleEventOccurred atom)
9381 optional int64 session_id = 1;
9382
9383 // Indicates what type of user journey this session is related to
9384 enum Journey {
9385 UNKNOWN = 0; // Undefined user lifecycle journey
9386 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9387 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9388 USER_START = 3; // A user start journey
9389 USER_CREATE = 4; // A user creation journey
9390 }
9391 optional Journey journey = 2;
9392 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9393 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9394 optional int32 origin_user = 3;
9395 // Which user the journey is targeting
9396 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9397 optional int32 target_user = 4;
9398
9399 // What is the user type of the target user
9400 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9401 enum UserType {
9402 TYPE_UNKNOWN = 0;
9403 FULL_SYSTEM = 1;
9404 FULL_SECONDARY = 2;
9405 FULL_GUEST = 3;
9406 FULL_DEMO = 4;
9407 FULL_RESTRICTED = 5;
9408 PROFILE_MANAGED = 6;
9409 SYSTEM_HEADLESS = 7;
9410 }
9411 optional UserType user_type = 5;
9412 // What are the flags attached to the target user
9413 optional int32 user_flags = 6;
9414}
9415
9416/**
9417 * An event logged when a specific user lifecycle event is performed. These events should be
9418 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9419 * Note: journeys can span over multiple events, hence some events may share a single session id.
9420 *
9421 * Logged from:
9422 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9423 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9424 */
9425message UserLifecycleEventOccurred {
9426 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9427 optional int64 session_id = 1;
9428 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9429 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9430 optional int32 user_id = 2;
9431
9432 enum Event {
9433 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9434 SWITCH_USER = 1; // Indicates that this is a user switch event
9435 START_USER = 2; // Indicates that this is a user start event
9436 CREATE_USER = 3; // Indicates that this is a user create event
9437 }
9438 optional Event event = 3;
9439
9440 enum State {
9441 NONE = 0; // Indicates the associated event has no start/end defined
9442 BEGIN = 1;
9443 FINISH = 2;
9444 }
9445 optional State state = 4; // Represents the state of an event (beginning/ending)
9446}
jasonwshsu81173e32020-03-27 15:22:03 +08009447
9448/**
9449 * Logs when accessibility shortcut clicked.
9450 *
9451 * Logged from:
9452 * frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
9453 */
9454message AccessibilityShortcutReported {
9455 // The accessibility feature(including installed a11y service, framework a11y feature,
9456 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9457 optional string package_name = 1;
9458
9459 // The definition of the accessibility shortcut.
9460 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9461 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9462
9463 // The definition of the service status.
9464 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9465 optional android.stats.accessibility.ServiceStatus service_status = 3;
9466}
9467
9468/**
9469 * Logs when accessibility service status changed.
9470 *
9471 * Logged from:
9472 * frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
9473 */
9474message AccessibilityServiceReported {
9475 // The accessibility service package name.
9476 optional string package_name = 1;
9477
9478 // The definition of the service status.
9479 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9480 optional android.stats.accessibility.ServiceStatus service_status = 2;
9481}