blob: a14c012b2da3875ee3d9ab21fbd1635767d57139 [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";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070081 BleScanStateChanged ble_scan_state_changed = 2
82 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080083 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080084 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070085 SensorStateChanged sensor_state_changed =
86 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080087 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
89 ScheduledJobStateChanged scheduled_job_state_changed =
90 8 [(module) = "framework", (module) = "statsdtest"];
91 ScreenBrightnessChanged screen_brightness_changed =
92 9 [(module) = "framework", (module) = "statsdtest"];
93 WakelockStateChanged wakelock_state_changed =
94 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080095 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
96 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070097 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
98 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080099 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
100 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
101 14 [(module) = "framework"];
102 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
103 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
104 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
105 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800106 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700107 BatterySaverModeStateChanged battery_saver_mode_state_changed =
108 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800109 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
110 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700111 AudioStateChanged audio_state_changed =
112 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800113 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
114 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
115 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700116 UidProcessStateChanged uid_process_state_changed =
117 27 [(module) = "framework", (module) = "statsdtest"];
118 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
119 28 [(module) = "framework", (module) = "statsdtest"];
120 ScreenStateChanged screen_state_changed =
121 29 [(module) = "framework", (module) = "statsdtest"];
122 BatteryLevelChanged battery_level_changed =
123 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800124 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
125 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
126 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800127 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
129 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800130 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
131 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
132 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700133 PhoneSignalStrengthChanged phone_signal_strength_changed =
134 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 SettingChanged setting_changed = 41 [(module) = "framework"];
136 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700137 42 [(module) = "framework", (module) = "statsdtest"];
138 IsolatedUidChanged isolated_uid_changed =
139 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800140 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
141 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800142 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800144 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700145 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
147 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800148 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800150 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
153 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800154 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800155 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700156 OverlayStateChanged overlay_state_changed =
157 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800158 ForegroundServiceStateChanged foreground_service_state_changed
159 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700160 CallStateChanged call_state_changed =
161 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800162 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
163 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
164 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800165 AppDied app_died = 65 [(module) = "framework"];
166 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
167 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800168 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
169 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
171 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800172 SpeakerImpedanceReported speaker_impedance_reported = 71;
173 HardwareFailed hardware_failed = 72;
174 PhysicalDropDetected physical_drop_detected = 73;
175 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800176 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
177 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800178 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700179 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 ANROccurred anr_occurred = 79 [(module) = "framework"];
181 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
182 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700183 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800185 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800186 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
187 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700188 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
190 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
191 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
192 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700193 BatteryHealthSnapshot battery_health_snapshot = 91;
194 SlowIo slow_io = 92;
195 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800196 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
197 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100198 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800199 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700201 // TODO: service state change is very noisy shortly after boot, as well
202 // as at other transitions - coming out of doze, device plugged in, etc.
203 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
205 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
206 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800207 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800209 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
210 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
211 105 [(module) = "docsui"];
212 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
213 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
214 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
215 108 [(module) = "docsui"];
216 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
217 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
218 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
219 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800220 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800221 WifiRunningStateChanged wifi_running_state_changed = 114
222 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800224 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800225 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800226 117 [(module) = "docsui"];
227 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
228 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
229 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
230 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800231 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
232 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
233 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800234 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
235 125 [(module) = "bluetooth"];
236 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
237 126 [(module) = "bluetooth"];
238 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
239 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800240 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000241 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800242 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
243 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
244 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800245 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800246 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
247 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
248 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
249 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
250 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
251 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800252 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
253 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800254 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
255 142 [(module) = "framework"];
256 AttentionManagerServiceResultReported attention_manager_service_result_reported =
257 143 [(module) = "framework"];
258 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800259 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800260 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800261 WatchdogRollbackOccurred watchdog_rollback_occurred =
262 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
264 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800265 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
267 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800268 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
269 151 [(module) = "bluetooth"];
270 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
271 152 [(module) = "bluetooth"];
272 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
273 153 [(module) = "bluetooth"];
274 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
275 154 [(module) = "bluetooth"];
276 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
277 155 [(module) = "bluetooth"];
278 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
279 156 [(module) = "bluetooth"];
280 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
281 157 [(module) = "bluetooth"];
282 BluetoothDeviceFailedContactCounterReported
283 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
284 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
285 159 [(module) = "bluetooth"];
286 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
287 160 [(module) = "bluetooth"];
288 BluetoothQualityReportReported bluetooth_quality_report_reported =
289 161 [(module) = "bluetooth"];
290 BluetoothDeviceInfoReported bluetooth_device_info_reported =
291 162 [(module) = "bluetooth"];
292 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
293 163 [(module) = "bluetooth"];
294 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
295 164 [(module) = "bluetooth"];
296 BluetoothBondStateChanged bluetooth_bond_state_changed =
297 165 [(module) = "bluetooth"];
298 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
299 166 [(module) = "bluetooth"];
300 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
301 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
303 168 [(module) = "framework"];
304 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700305 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800307 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800308 DeviceIdentifierAccessDenied device_identifier_access_denied =
309 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800311 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
312 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
313 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
315 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800316 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700317 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 180 [(module) = "permissioncontroller"];
319 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
320 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800321 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
323 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
324 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
325 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800326 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
327 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700328 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800329 188 [(module) = "intelligence"];
330 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
331 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800332 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800334 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
335 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
336 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
337 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
338 MediametricsCodecReported mediametrics_codec_reported = 195;
339 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
340 MediametricsExtractorReported mediametrics_extractor_reported = 197;
341 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
342 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
343 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700344 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800345 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
346 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800347 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
349 206 [(module) = "framework"];
350 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
351 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
352 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
353 LocationManagerApiUsageReported location_manager_api_usage_reported =
354 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100355 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800356 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100357 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100361 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100363 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100365 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100367 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100369 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
372 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
373 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
374 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800376 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700377 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
378 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100380 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800382 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800383 VmsClientConnectionStateChanged vms_client_connection_state_changed =
384 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
386 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700387 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800388 235 [(module) = "mediaprovider"];
389 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700390 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800392 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
393 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
394 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
395 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800396 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800397 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000398 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800399 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500400 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
401 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800402 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
403 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800404 CellBroadcastMessageReported cb_message_reported =
405 249 [(module) = "cellbroadcast"];
406 CellBroadcastMessageError cb_message_error =
407 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700408 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
409 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
410 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800411 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000412 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800413 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
414 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800415 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800416 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500417 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
418 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000419 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000420 }
David Chenc8a43242017-10-17 16:23:28 -0700421
David Chen6e3e6cb2018-01-03 16:14:06 -0800422 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700423 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700424 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800425 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
426 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700427 MobileBytesTransfer mobile_bytes_transfer =
428 10002 [(module) = "framework", (truncate_timestamp) = true];
429 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
430 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
432 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700433 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800434 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700435 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800436 CpuTimePerUidFreq cpu_time_per_uid_freq =
437 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800438 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
439 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
440 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
441 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
442 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700443 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700444 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700445 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
446 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
448 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800450 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800452 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 DiskStats disk_stats = 10025 [(module) = "framework"];
454 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
455 AppSize app_size = 10027 [(module) = "framework"];
456 CategorySize category_size = 10028 [(module) = "framework"];
457 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800458 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
460 DiskIo disk_io = 10032 [(module) = "framework"];
461 PowerProfile power_profile = 10033 [(module) = "framework"];
462 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
463 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
464 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700465 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
467 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
468 10040 [(module) = "framework"];
469 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
470 10041 [(module) = "framework"];
471 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800472 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
476 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
477 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
478 RoleHolder role_holder = 10049 [(module) = "framework"];
479 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800480 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
482 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800483 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
484 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
486 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
487 FaceSettings face_settings = 10058 [(module) = "framework"];
488 CoolingDevice cooling_device = 10059 [(module) = "framework"];
489 AppOps app_ops = 10060 [(module) = "framework"];
490 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700491 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
492 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800493 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800494 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
496 DangerousPermissionStateSampled dangerous_permission_state_sampled =
497 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400498 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000499 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000500 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200501 PackageNotificationPreferences package_notification_preferences =
502 10071 [(module) = "framework"];
503 PackageNotificationChannelPreferences package_notification_channel_preferences =
504 10072 [(module) = "framework"];
505 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
506 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800507 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800508 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700509 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
510 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
511 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
512 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800513 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700514 }
yroa1fe77c2018-02-26 14:22:54 -0800515
Bookatz76aafcf2018-09-17 16:17:10 -0700516 // DO NOT USE field numbers above 100,000 in AOSP.
517 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
518 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100519
520 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700521}
522
Yao Chend54f9dd2017-10-17 17:37:48 +0000523/**
Yangster-mac20877162017-12-22 17:19:39 -0800524 * This proto represents a node of an attribution chain.
525 * Note: All attribution chains are represented as a repeated field of type
526 * AttributionNode. It is understood that in such arrays, the order is that
527 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000528 */
Yangster-mac20877162017-12-22 17:19:39 -0800529message AttributionNode {
530 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800531 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800532
Yangster-mac20877162017-12-22 17:19:39 -0800533 // The (optional) string tag for an element in the attribution chain. If the
534 // element has no tag, it is encoded as an empty string.
535 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700536}
537
Yangster-mac48b3d622018-08-18 12:38:11 -0700538message KeyValuePair {
539 optional int32 key = 1;
540 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700541 int32 value_int = 2;
542 int64 value_long = 3;
543 string value_str = 4;
544 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700545 }
546}
547
548message KeyValuePairsAtom {
549 optional int32 uid = 1;
550 repeated KeyValuePair pairs = 2;
551}
552
Yao Chend54f9dd2017-10-17 17:37:48 +0000553/*
554 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800555 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 *
557 * RULES:
558 * - The field ids for each atom must start at 1, and count upwards by 1.
559 * Skipping field ids is not allowed.
560 * - These form an API, so renaming, renumbering or removing fields is
561 * not allowed between android releases. (This is not currently enforced,
562 * but there will be a tool to enforce this restriction).
563 * - The types must be built-in protocol buffer types, namely, no sub-messages
564 * are allowed (yet). The bytes type is also not allowed.
565 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800566 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000567 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800568 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * - A field that is a uid should be a string field, tagged with the [xxx]
570 * annotation. The generated code on android will be represented by UIDs,
571 * and those UIDs will be translated in xxx to those strings.
572 *
573 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700574 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000575 * - If there is a UID, it goes first. Think in an object-oriented fashion.
576 * *****************************************************************************
577 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578
Yao Chend54f9dd2017-10-17 17:37:48 +0000579/**
Tej Singha72344992019-04-17 18:55:08 -0700580 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700581 * Logs when the Thermal service HAL notifies the throttling start/stop events.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
585 */
586message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700587 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700588 optional android.os.TemperatureTypeEnum sensor_type = 1;
589
Maggie White442b6312019-04-05 16:26:44 -0700590 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700591 enum State {
592 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700593 START = 1; // START indicated that throttling was triggered.
594 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700595 }
Yangster-mace16189a2018-08-26 12:20:16 -0700596 optional State state = 2;
597
598 optional float temperature = 3;
599}
600
601/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000602 * Logs when the screen state changes.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
606 */
607message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800608 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800609 optional android.view.DisplayStateEnum state = 1
610 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700611}
Yao Chend54f9dd2017-10-17 17:37:48 +0000612
613/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700614 * Logs that the process state of the uid, as determined by ActivityManager
615 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 *
617 * Logged from:
618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
619 */
Bookatzc1a050a2017-10-10 15:49:28 -0700620message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800621 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000622
Bookatzdb026a22018-01-10 19:01:56 -0800623 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional android.app.ProcessStateEnum state = 2
625 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000626}
627
628/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629 * Logs process state change of a process, as per the activity manager.
630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
633 */
634message ProcessStateChanged {
635 optional int32 uid = 1;
636 optional string process_name = 2;
637 optional string package_name = 3;
638 // TODO: remove this when validation is done
639 optional int64 version = 5;
640 // The state, from frameworks/base/core/proto/android/app/enums.proto.
641 optional android.app.ProcessStateEnum state = 4;
642}
643
644/**
645 * Logs when ActivityManagerService sleep state is changed.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
649 */
650message ActivityManagerSleepStateChanged {
651 // TODO: import frameworks proto
652 enum State {
653 UNKNOWN = 0;
654 ASLEEP = 1;
655 AWAKE = 2;
656 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800657 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700658}
659
660/**
661 * Logs when system memory state changes.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message MemoryFactorStateChanged {
667 // TODO: import frameworks proto
668 enum State {
669 MEMORY_UNKNOWN = 0;
670 NORMAL = 1; // normal.
671 MODERATE = 2; // moderate memory pressure.
672 LOW = 3; // low memory.
673 CRITICAL = 4; // critical memory.
674
675 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800676 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700677}
678
679/**
680 * Logs when app is using too much cpu, according to ActivityManagerService.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
684 */
685message ExcessiveCpuUsageReported {
686 optional int32 uid = 1;
687 optional string process_name = 2;
688 optional string package_name = 3;
689 // package version. TODO: remove this when validation is done
690 optional int64 version = 4;
691}
692
693/**
694 * Logs when a cached process is killed, along with its pss.
695 *
696 * Logged from:
697 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
698 */
699message CachedKillReported {
700 optional int32 uid = 1;
701 optional string process_name = 2;
702 optional string package_name = 3;
703 // TODO: remove this when validation is done
704 optional int64 version = 5;
705 optional int64 pss = 4;
706}
707
708/**
xshu2c3d9e42019-09-26 17:54:02 -0700709 * Logs the change in wifi health.
710 *
711 * Logged from:
712 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
713 */
714message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800715 enum Band {
716 UNKNOWN = 0;
717 // All of 2.4GHz band
718 BAND_2G = 1;
719 // Frequencies in the range of [5150, 5250) GHz
720 BAND_5G_LOW = 2;
721 // Frequencies in the range of [5250, 5725) GHz
722 BAND_5G_MIDDLE = 3;
723 // Frequencies in the range of [5725, 5850) GHz
724 BAND_5G_HIGH = 4;
725 // Frequencies in the range of [5925, 6425) GHz
726 BAND_6G_LOW = 5;
727 // Frequencies in the range of [6425, 6875) GHz
728 BAND_6G_MIDDLE = 6;
729 // Frequencies in the range of [6875, 7125) GHz
730 BAND_6G_HIGH = 7;
731 }
xshu2c3d9e42019-09-26 17:54:02 -0700732 // duration this stat is obtained over in milliseconds
733 optional int32 duration_millis = 1;
734 // whether wifi is classified as sufficient for the user's data traffic, determined
735 // by whether the calculated throughput exceeds the average demand within |duration_millis|
736 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700737 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800738 optional bool is_cell_data_available = 3;
739 // the Band bucket the connected network is on
740 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700741}
742
743/**
744 * Logged when wifi detects a significant change in connection failure rate.
745 *
746 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
747 *
748 */
749message WifiFailureStatReported {
750 enum AbnormalityType {
751 UNKNOWN = 0;
752 SIGNIFICANT_INCREASE = 1;
753 SIGNIFICANT_DECREASE = 2;
754 SIMPLY_HIGH = 3;
755 }
756 enum FailureType {
757 FAILURE_UNKNOWN = 0;
758 FAILURE_CONNECTION = 1;
759 FAILURE_ASSOCIATION_REJECTION = 2;
760 FAILURE_ASSOCIATION_TIMEOUT = 3;
761 FAILURE_AUTHENTICATION = 4;
762 FAILURE_NON_LOCAL_DISCONNECTION = 5;
763 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
764 }
765 // Reason for uploading this stat
766 optional AbnormalityType abnormality_type = 1;
767 // The particular type of failure
768 optional FailureType failure_type = 2;
769 // How many times we have encountered this combination of AbnormalityType and FailureType
770 optional int32 failure_count = 3;
771}
772
773/**
774 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
775 *
776 * Logged from:
777 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
778 */
779message WifiConnectionResultReported {
780 enum FailureCode {
781 FAILURE_UNKNOWN = 0;
782 FAILURE_ASSOCIATION_TIMEOUT = 1;
783 FAILURE_ASSOCIATION_REJECTION = 2;
784 FAILURE_AUTHENTICATION_GENERAL = 3;
785 FAILURE_AUTHENTICATION_EAP = 4;
786 FAILURE_DHCP = 5;
787 FAILURE_NETWORK_DISCONNECTION = 6;
788 FAILURE_ROAM_TIMEOUT = 7;
789 }
790 // true represents a successful connection
791 optional bool connection_result = 1;
792 // reason for the connection failure
793 optional FailureCode failure_code = 2;
794 // scan rssi before the connection attempt
795 optional int32 rssi = 3;
796}
797
798/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700799 * Logs when memory stats of a process is reported.
800 *
801 * Logged from:
802 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
803 */
804message ProcessMemoryStatReported {
805 optional int32 uid = 1;
806 optional string process_name = 2;
807 optional string package_name = 3;
808 //TODO: remove this when validation is done
809 optional int64 version = 9;
810 optional int64 pss = 4;
811 optional int64 uss = 5;
812 optional int64 rss = 6;
813 enum Type {
814 ADD_PSS_INTERNAL_SINGLE = 0;
815 ADD_PSS_INTERNAL_ALL_MEM = 1;
816 ADD_PSS_INTERNAL_ALL_POLL = 2;
817 ADD_PSS_EXTERNAL = 3;
818 ADD_PSS_EXTERNAL_SLOW = 4;
819 }
820 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800821 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700822}
823
824/**
Bookatzc1a050a2017-10-10 15:49:28 -0700825 * Logs that a process started, finished, crashed, or ANRed.
826 *
827 * Logged from:
828 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
829 */
830message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700831 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700832
David Chen0b5c90c2018-01-25 16:51:49 -0800833 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800834 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700835
Bookatzddccf0a2017-11-28 16:48:14 -0800836 // What lifecycle state the process changed to.
837 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838 enum State {
839 FINISHED = 0;
840 STARTED = 1;
841 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800842 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800843 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700844}
845
Bookatzc1a050a2017-10-10 15:49:28 -0700846/**
847 * Logs when the ble scan state changes.
848 *
849 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700850 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700851 */
852message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 repeated AttributionNode attribution_node = 1
854 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 enum State {
857 OFF = 0;
858 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700859 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
860 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800862 optional State state = 2 [
863 (state_field_option).option = EXCLUSIVE_STATE,
864 (state_field_option).default_state_value = 0 /* State.OFF */,
865 (state_field_option).reset_state_value = 2 /* State.RESET */,
866 (state_field_option).nested = true
867 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700868
Bookatze5ec0b42018-03-26 13:34:56 -0700869 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800870 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700871 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800872 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700873 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800874 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700875}
876
877/**
878 * Logs reporting of a ble scan finding results.
879 *
880 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700881 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700882 */
Bookatzae6738e2018-09-13 11:38:56 -0700883// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700884message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800885 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700886
887 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800888 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889}
890
891/**
892 * Logs when a sensor state changes.
893 *
894 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700895 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
897message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
Bookatzc1a050a2017-10-10 15:49:28 -0700900 // The id (int) of the sensor.
901 optional int32 sensor_id = 2;
902
903 enum State {
904 OFF = 0;
905 ON = 1;
906 }
907 optional State state = 3;
908}
909
Bookatzc1a050a2017-10-10 15:49:28 -0700910/**
911 * Logs when GPS state changes.
912 *
913 * Logged from:
914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
915 */
916message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700918
919 enum State {
920 OFF = 0;
921 ON = 1;
922 }
923 optional State state = 2;
924}
925
Bookatz48d362e2018-11-06 15:49:08 -0800926/**
927 * Logs when GPS signal quality.
928 *
929 * Logged from:
930 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
931 */
932message GpsSignalQualityChanged {
933 optional android.server.location.GpsSignalQualityEnum level = 1;
934}
935
Bookatzc1a050a2017-10-10 15:49:28 -0700936
937/**
938 * Logs when a sync manager sync state changes.
939 *
940 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700941 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700942 */
943message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945
David Chen0b5c90c2018-01-25 16:51:49 -0800946 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800947 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 3;
954}
955
Yangster-mac96353002018-09-05 11:18:55 -0700956/*
957 * Deferred job stats.
958 *
959 * Logged from:
960 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
961*/
962message DeferredJobStatsReported {
963 repeated AttributionNode attribution_node = 1;
964
965 // Number of jobs deferred.
966 optional int32 num_jobs_deferred = 2;
967
968 // Time since the last job runs.
969 optional int64 time_since_last_job_millis = 3;
970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972/**
973 * Logs when a job scheduler job state changes.
974 *
975 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700976 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
981 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800982 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
984 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800985 FINISHED = 0;
986 STARTED = 1;
987 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700988 }
989 optional State state = 3;
990
Tej Singh33a412b2018-03-16 18:43:59 -0700991 // The reason a job has stopped.
992 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700993 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700994 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100995
996 // The standby bucket of the app that scheduled the job. These match the framework constants
997 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
998 // already assigned 0.
999 enum Bucket {
1000 UNKNOWN = -1;
1001 ACTIVE = 0;
1002 WORKING_SET = 1;
1003 FREQUENT = 2;
1004 RARE = 3;
1005 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001006 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001007 }
1008 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1009
1010 // The job id (as assigned by the app).
1011 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001012
1013 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1014 // constraints as they are always assumed to be set.
1015 optional bool has_charging_constraint = 7;
1016 optional bool has_battery_not_low_constraint = 8;
1017 optional bool has_storage_not_low_constraint = 9;
1018 optional bool has_timing_delay_constraint = 10;
1019 optional bool has_deadline_constraint = 11;
1020 optional bool has_idle_constraint = 12;
1021 optional bool has_connectivity_constraint = 13;
1022 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001023}
1024
1025/**
1026 * Logs when the audio state changes.
1027 *
1028 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001029 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001030 */
1031message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001032 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001037 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1038 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001039 }
1040 optional State state = 2;
1041}
1042
1043/**
1044 * Logs when the video codec state changes.
1045 *
1046 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001047 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001048 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001049message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001050 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001051
1052 enum State {
1053 OFF = 0;
1054 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001055 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1056 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001057 }
1058 optional State state = 2;
1059}
1060
1061/**
1062 * Logs when the flashlight state changes.
1063 *
1064 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001065 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001066 */
1067message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001068 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 enum State {
1071 OFF = 0;
1072 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001073 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1074 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001075 }
1076 optional State state = 2;
1077}
1078
1079/**
1080 * Logs when the camera state changes.
1081 *
1082 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001084 */
1085message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001087
1088 enum State {
1089 OFF = 0;
1090 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001091 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1092 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001093 }
1094 optional State state = 2;
1095}
1096
1097/**
1098 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001099 *
1100 * Logged from:
1101 * TODO
1102 */
Bookatzd6746242017-10-24 18:39:35 -07001103message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001104 repeated AttributionNode attribution_node = 1
1105 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001106
Bookatz1a1b0462018-01-12 11:47:03 -08001107 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1108 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001109 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001110 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001111
1112 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001113 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001114
1115 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001116 RELEASE = 0;
1117 ACQUIRE = 1;
1118 CHANGE_RELEASE = 2;
1119 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001120 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001121 optional State state = 4 [
1122 (state_field_option).option = EXCLUSIVE_STATE,
1123 (state_field_option).default_state_value = 0,
1124 (state_field_option).nested = true
1125 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001126}
1127
1128/**
Bookatzc1a050a2017-10-10 15:49:28 -07001129 * Logs when a partial wakelock is considered 'long' (over 1 min).
1130 *
1131 * Logged from:
1132 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1133 */
1134message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001135 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001136
Yao Chend54f9dd2017-10-17 17:37:48 +00001137 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1138 optional string tag = 2;
1139
Bookatzc1a050a2017-10-10 15:49:28 -07001140 // TODO: I have no idea what this is.
1141 optional string history_tag = 3;
1142
1143 enum State {
1144 OFF = 0;
1145 ON = 1;
1146 }
1147 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001148}
1149
Bookatzc1a050a2017-10-10 15:49:28 -07001150/**
Bookatza66083f2018-09-20 17:24:00 -07001151 * Logs when the device is interactive, according to the PowerManager Notifier.
1152 *
1153 * Logged from:
1154 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1155 */
1156message InteractiveStateChanged {
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 1;
1162}
1163
1164/**
Bookatzc1a050a2017-10-10 15:49:28 -07001165 * Logs Battery Saver state change.
1166 *
1167 * Logged from:
1168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1169 */
1170message BatterySaverModeStateChanged {
1171 enum State {
1172 OFF = 0;
1173 ON = 1;
1174 }
1175 optional State state = 1;
1176}
1177
1178/**
1179 * Logs Doze mode state change.
1180 *
1181 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001182 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001183 */
1184message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001185 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001186}
1187
1188
1189/**
1190 * Logs state change of Doze mode including maintenance windows.
1191 *
1192 * Logged from:
1193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1194 */
1195message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001196 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001197}
1198
1199/**
1200 * Logs screen brightness level.
1201 *
1202 * Logged from:
1203 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1204 */
1205message ScreenBrightnessChanged {
1206 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1207 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001208}
1209
1210/**
1211 * Logs battery level (percent full, from 0 to 100).
1212 *
1213 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001214 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001215 */
1216message BatteryLevelChanged {
1217 // Battery level. Should be in [0, 100].
1218 optional int32 battery_level = 1;
1219}
1220
1221/**
1222 * Logs change in charging status of the device.
1223 *
1224 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001225 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001226 */
1227message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001228 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1229 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001230}
1231
1232/**
1233 * Logs whether the device is plugged in, and what power source it is using.
1234 *
1235 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001236 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001237 */
1238message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001239 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1240 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001241}
1242
Bookatz8c6571b2017-10-24 15:04:41 -07001243/**
1244 * Logs when an app's wakeup alarm fires.
1245 *
1246 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001247 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001248 */
1249message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001250 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001251
1252 // Name of the wakeup alarm.
1253 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001254
1255 // Name of source package (for historical reasons, since BatteryStats tracked it).
1256 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001257
Ben Murdoch3389f1522019-05-21 15:05:34 +01001258 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001259 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001260}
1261
1262/**
1263 * Logs when an an app causes the mobile radio to change state.
1264 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1265 *
1266 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001267 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001268 */
1269message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001270 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001271
Bookatz1a1b0462018-01-12 11:47:03 -08001272 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1273 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001274}
1275
1276/**
1277 * Logs when an an app causes the wifi radio to change state.
1278 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1279 *
1280 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001281 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001282 */
1283message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001284 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001285
Bookatz1a1b0462018-01-12 11:47:03 -08001286 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1287 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001288}
1289
1290/**
1291 * Logs kernel wakeup reasons and aborts.
1292 *
1293 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001295 */
1296message KernelWakeupReported {
1297 // Name of the kernel wakeup reason (or abort).
1298 optional string wakeup_reason_name = 1;
1299
1300 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001301 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001302}
1303
1304/**
Bookatzda1798c2018-12-13 14:16:00 -08001305 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001306 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001307 *
1308 * Logged from:
1309 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1310 */
1311message WifiEnabledStateChanged {
1312 enum State {
1313 OFF = 0;
1314 ON = 1;
1315 }
1316 optional State state = 1;
1317}
1318
1319/**
tsaichristinececebdc2020-02-04 14:05:56 -08001320 * This atom is deprecated starting in R.
1321 *
Bookatzda1798c2018-12-13 14:16:00 -08001322 * 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 -08001323 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1324 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001325 *
1326 * Logged from:
1327 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1328 */
1329message WifiRunningStateChanged {
1330 repeated AttributionNode attribution_node = 1;
1331
1332 enum State {
1333 OFF = 0;
1334 ON = 1;
1335 }
1336 optional State state = 2;
1337}
1338
1339/**
Bookatze5885242017-10-24 20:10:31 -07001340 * Logs wifi locks held by an app.
1341 *
1342 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001343 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001344 */
1345message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001346 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001347
1348 enum State {
1349 OFF = 0;
1350 ON = 1;
1351 }
1352 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001353
1354 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1355 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001356}
1357
1358/**
1359 * Logs wifi signal strength changes.
1360 *
1361 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001362 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001363 */
1364message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001365 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1366 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001367}
1368
1369/**
1370 * Logs wifi scans performed by an app.
1371 *
1372 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001373 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001374 */
1375message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001376 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001377
1378 enum State {
1379 OFF = 0;
1380 ON = 1;
1381 }
1382 optional State state = 2;
1383}
1384
1385/**
Tej Singh4503e102018-01-04 14:35:01 -08001386 * Logs wifi multicast locks held by an app
1387 *
1388 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001389 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001390 */
1391message WifiMulticastLockStateChanged {
1392 repeated AttributionNode attribution_node = 1;
1393
1394 enum State {
1395 OFF = 0;
1396 ON = 1;
1397 }
1398 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001399
1400 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001401}
1402
1403/**
Tej Singh1ea42892018-01-19 09:27:00 -08001404 * Logs shutdown reason and duration on next boot.
1405 *
1406 * Logged from:
1407 * frameworks/base/core/java/com/android/server/BootReceiver.java
1408 */
1409message ShutdownSequenceReported {
1410 // True if shutdown is for a reboot. Default: false if we do not know.
1411 optional bool reboot = 1;
1412
1413 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1414 optional string reason = 2;
1415
1416 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1417 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001418 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001419
1420 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001421 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001422}
1423
Tej Singh6483ea42018-01-25 17:45:49 -08001424
1425/**
1426 * Logs boot reason and duration.
1427 *
1428 * Logged from:
1429 * system/core/bootstat/bootstat.cpp
1430 */
1431message BootSequenceReported {
1432 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1433 // Default: "<EMPTY>" if not available.
1434 optional string bootloader_reason = 1;
1435
1436 // Reason for system boot. Eg. bootloader, reboot,userrequested
1437 // Default: "<EMPTY>" if not available.
1438 optional string system_reason = 2;
1439
1440 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001441 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001442
1443 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001444 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001445
1446 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001447 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001448
1449 // Time since last boot in ms. Default: 0 if not available.
1450 optional int64 time_since_last_boot = 6;
1451}
1452
Tej Singhc477d9c2018-02-05 18:31:39 -08001453
1454/**
1455 * Logs call state and disconnect cause (if applicable).
1456 *
1457 * Logged from:
1458 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1459 */
1460message CallStateChanged {
1461 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1462 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1463 optional android.telecom.CallStateEnum call_state = 1;
1464
1465 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1466 // This value is only applicable when the call_state is DISCONNECTED, and
1467 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1468 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1469 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1470
1471 // True if the call is self-managed, which are apps that use the
1472 // telecom infrastructure to make their own calls.
1473 optional bool self_managed = 3;
1474
1475 // True if call is external. External calls are calls on connected Wear
1476 // devices but show up in Telecom so the user can pull them onto the device.
1477 optional bool external_call = 4;
1478}
1479
Tej Singh1ea42892018-01-19 09:27:00 -08001480/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001481 * Logs keyguard state. The keyguard is the lock screen.
1482 *
1483 * Logged from:
1484 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1485 */
1486message KeyguardStateChanged {
1487 enum State {
1488 UNKNOWN = 0;
1489 // The keyguard is hidden when the phone is unlocked.
1490 HIDDEN = 1;
1491 // The keyguard is shown when the phone is locked (screen turns off).
1492 SHOWN= 2;
1493 // The keyguard is occluded when something is overlaying the keyguard.
1494 // Eg. Opening the camera while on the lock screen.
1495 OCCLUDED = 3;
1496 }
1497 optional State state = 1;
1498}
1499
1500/**
1501 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1502 * prompts the user to enter a password (pattern, pin, etc).
1503 *
1504 * Logged from:
1505 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1506 */
1507
1508message KeyguardBouncerStateChanged {
1509 enum State {
1510 UNKNOWN = 0;
1511 // Bouncer is hidden, either as a result of successfully entering the
1512 // password, screen timing out, or user going back to lock screen.
1513 HIDDEN = 1;
1514 // This is when the user is being prompted to enter the password.
1515 SHOWN = 2;
1516 }
1517 optional State state = 1;
1518}
1519
1520/**
1521 * Logs the result of entering a password into the keyguard bouncer.
1522 *
1523 * Logged from:
1524 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1525 */
1526message KeyguardBouncerPasswordEntered {
1527 enum BouncerResult {
1528 UNKNOWN = 0;
1529 // The password entered was incorrect.
1530 FAILURE = 1;
1531 // The password entered was correct.
1532 SUCCESS = 2;
1533 }
1534 optional BouncerResult result = 1;
1535}
1536
Tej Singha883b372018-02-15 11:30:01 -08001537/*
1538 * Logs changes to the configuration of the device. The configuration is defined
1539 * in frameworks/base/core/java/android/content/res/Configuration.java
1540 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1541 * Please go there to interpret the possible values each field can be.
1542 *
1543 * Logged from:
1544 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1545 */
1546message ResourceConfigurationChanged {
1547 // Bit mask of color capabilities of the screen.
1548 // Contains information about the color gamut and hdr mode of the screen.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001550 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001551
1552 // The target screen density being rendered to.
1553 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001554 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001555
1556 // Current user preference for the scaling factor for fonts,
1557 // relative to the base density scaling.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // Flag indicating whether the hard keyboard is hidden.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // The type of keyboard attached to the device.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1567 optional int32 keyboard = 5;
1568
1569 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1574 // 0 if undefined.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1576 optional int32 mcc = 7;
1577
1578 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1579 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1580 // MNC_ZERO symbol defined in Configuration.java.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1582 optional int32 mnc = 8;
1583
1584 // The kind of navigation available on the device.
1585 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1586 optional int32 navigation = 9;
1587
1588 // Flag indicating whether the navigation is available.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // Overall orientation of the screen.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1594 optional int32 orientation = 11;
1595
1596 // The current height of the available screen space, in dp units.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Bit mask of overall layout of the screen.
1601 // Contains information about screen size, whether the screen is wider/taller
1602 // than normal, whether the screen layout is right-tl-left or left-to-right,
1603 // and whether the screen has a rounded shape.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001606
1607 // Current width of the available screen space, in dp units.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001609 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001610
1611 // The smallest screen size an application will see in normal operation.
1612 // This is the smallest value of both screenWidthDp and screenHeightDp
1613 // in portrait and landscape.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // The type of touch screen attached to the device.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1619 optional int32 touchscreen = 16;
1620
1621 // Bit mask of the ui mode.
1622 // Contains information about the overall ui mode of the device.
1623 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1624 // Also contains information about whether the device is in night mode.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001626 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001627}
1628
Tej Singheee317b2018-03-07 19:28:05 -08001629
1630/**
1631 * Logs changes in the connection state of the mobile radio.
1632 *
1633 * Logged from:
1634 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1635 */
1636message MobileConnectionStateChanged {
1637 // States are from the state machine DataConnection.java.
1638 enum State {
1639 UNKNOWN = 0;
1640 // The connection is inactive, or disconnected.
1641 INACTIVE = 1;
1642 // The connection is being activated, or connecting.
1643 ACTIVATING = 2;
1644 // The connection is active, or connected.
1645 ACTIVE = 3;
1646 // The connection is disconnecting.
1647 DISCONNECTING = 4;
1648 // The connection is disconnecting after creating a connection.
1649 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1650 }
1651 optional State state = 1;
1652 // For multi-sim phones, this distinguishes between the sim cards.
1653 optional int32 sim_slot_index = 2;
1654 // Used to identify the connection. Starts at 0 and increments by 1 for
1655 // every new network created. Resets whenever the device reboots.
1656 optional int32 data_connection_id = 3;
1657 // A bitmask for the capabilities of this connection.
1658 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1659 // Default value (if we have no information): 0
1660 optional int64 capabilities = 4;
1661 // If this connection has internet.
1662 // This just checks if the DEFAULT bit of capabilities is set.
1663 optional bool has_internet = 5;
1664}
1665
1666/**
1667 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1668 *
1669 * Logged from:
1670 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1671 */
1672message MobileRadioTechnologyChanged {
1673 optional android.telephony.NetworkTypeEnum state = 1;
1674 // For multi-sim phones, this distinguishes between the sim cards.
1675 optional int32 sim_slot_index = 2;
1676}
1677
Andrew Chantb56388b2018-03-22 21:07:33 -07001678/**
1679 * Logs the VID and PID of any connected USB devices.
1680 *
1681 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1682 *
1683 * Logged by Vendor.
1684 */
1685message UsbDeviceAttached {
1686 optional int32 vid = 1;
1687 optional int32 pid = 2;
1688 optional bool has_audio = 3;
1689 optional bool has_hid = 4;
1690 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001691 enum State {
1692 STATE_DISCONNECTED = 0;
1693 STATE_CONNECTED = 1;
1694 }
1695 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001696 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001697}
1698
Tej Singheee317b2018-03-07 19:28:05 -08001699
Tej Singhdd7bd352018-02-09 19:33:15 -08001700/**
Tej Singh5d991e12018-03-09 19:48:11 -08001701 * Logs when Bluetooth is enabled and disabled.
1702 *
1703 * Logged from:
1704 * services/core/java/com/android/server/BluetoothManagerService.java
1705 */
1706message BluetoothEnabledStateChanged {
1707 repeated AttributionNode attribution_node = 1;
1708 // Whether or not bluetooth is enabled on the device.
1709 enum State {
1710 UNKNOWN = 0;
1711 ENABLED = 1;
1712 DISABLED = 2;
1713 }
1714 optional State state = 2;
1715 // The reason for being enabled/disabled.
1716 // Eg. Airplane mode, crash, application request.
1717 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1718 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001719 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001720}
1721
1722/**
Jack Hed9837c82019-01-09 01:19:13 -08001723 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001724 *
1725 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1727 *
1728 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001729 */
1730message BluetoothConnectionStateChanged {
1731 // The state of the connection.
1732 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1733 optional android.bluetooth.ConnectionStateEnum state = 1;
1734 // An identifier that can be used to match connect and disconnect events.
1735 // Currently is last two bytes of a hash of a device level ID and
1736 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001737 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001738 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001739 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1740 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001741 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001742 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001749 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001750}
1751
1752/**
1753 * Logs when a Bluetooth device connects and disconnects over ACL
1754 *
1755 * Logged from:
1756 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1757 *
1758 * Next Tag: 3
1759 */
1760message BluetoothAclConnectionStateChanged {
1761 // An identifier that can be used to match events for this device.
1762 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1763 // Salt: Randomly generated 256 bit value
1764 // Hash algorithm: HMAC-SHA256
1765 // Size: 32 byte
1766 // Default: null or empty if the device identifier is not known
1767 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1768 // The state of the connection.
1769 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1770 optional android.bluetooth.ConnectionStateEnum state = 2;
1771}
1772
1773/**
1774 * Logs when a Bluetooth device connects and disconnects over SCO
1775 *
1776 * Logged from:
1777 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1778 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1779 *
1780 * Next Tag: 4
1781 */
1782message BluetoothScoConnectionStateChanged {
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;
1793 // Codec used for this SCO connection
1794 // Default: UNKNOWN
1795 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001796}
1797
Jack Hec27040a2019-01-09 20:54:41 -08001798/**
1799 * Logged when active device of a profile changes
1800 *
1801 * Logged from:
1802 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1803 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1804 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1805 */
1806message BluetoothActiveDeviceChanged {
1807 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1808 // From android.bluetooth.BluetoothProfile
1809 optional int32 bt_profile = 1;
1810 // An identifier that can be used to match events for this new active device.
1811 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1812 // Salt: Randomly generated 256 bit value
1813 // Hash algorithm: HMAC-SHA256
1814 // Size: 32 byte
1815 // Default: null or empty if there is no active device for this profile
1816 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1817}
1818
Jack Heab86dbd22018-12-18 15:43:27 -08001819// Logs when there is an event affecting Bluetooth device's link layer connection.
1820// - This event is triggered when there is a related HCI command or event
1821// - Users of this metrics can deduce Bluetooth device's connection state from these events
1822// - HCI commands are logged before the command is sent, after receiving command status, and after
1823// receiving command complete
1824// - HCI events are logged when they arrive
1825//
1826// Low level log from system/bt
1827//
1828// Bluetooth classic commands:
1829// - CMD_CREATE_CONNECTION
1830// - CMD_DISCONNECT
1831// - CMD_CREATE_CONNECTION_CANCEL
1832// - CMD_ACCEPT_CONNECTION_REQUEST
1833// - CMD_REJECT_CONNECTION_REQUEST
1834// - CMD_SETUP_ESCO_CONNECTION
1835// - CMD_ACCEPT_ESCO_CONNECTION
1836// - CMD_REJECT_ESCO_CONNECTION
1837// - CMD_ENH_SETUP_ESCO_CONNECTION
1838// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1839//
1840// Bluetooth low energy commands:
1841// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1842// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1843// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1844// - CMD_BLE_CLEAR_WHITE_LIST
1845// - CMD_BLE_ADD_WHITE_LIST
1846// - CMD_BLE_REMOVE_WHITE_LIST
1847//
1848// Bluetooth classic events:
1849// - EVT_CONNECTION_COMP
1850// - EVT_CONNECTION_REQUEST
1851// - EVT_DISCONNECTION_COMP
1852// - EVT_ESCO_CONNECTION_COMP
1853// - EVT_ESCO_CONNECTION_CHANGED
1854//
1855// Bluetooth low energy meta events:
1856// - BLE_EVT_CONN_COMPLETE_EVT
1857// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1858//
1859// Next tag: 10
1860message BluetoothLinkLayerConnectionEvent {
1861 // An identifier that can be used to match events for this device.
1862 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1863 // Salt: Randomly generated 256 bit value
1864 // Hash algorithm: HMAC-SHA256
1865 // Size: 32 byte
1866 // Default: null or empty if the device identifier is not known
1867 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1868 // Connection handle of this connection if available
1869 // Range: 0x0000 - 0x0EFF (12 bits)
1870 // Default: 0xFFFF if the handle is unknown
1871 optional int32 connection_handle = 2;
1872 // Direction of the link
1873 // Default: DIRECTION_UNKNOWN
1874 optional android.bluetooth.DirectionEnum direction = 3;
1875 // Type of this link
1876 // Default: LINK_TYPE_UNKNOWN
1877 optional android.bluetooth.LinkTypeEnum type = 4;
1878
1879 // Reason metadata for this link layer connection event, rules for interpretation:
1880 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1881 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1882 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1883 // set and valid, ignore hci_ble_event
1884
1885 // HCI command associated with this event
1886 // Default: CMD_UNKNOWN
1887 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1888 // HCI event associated with this event
1889 // Default: EVT_UNKNOWN
1890 optional android.bluetooth.hci.EventEnum hci_event = 6;
1891 // HCI BLE meta event associated with this event
1892 // Default: BLE_EVT_UNKNOWN
1893 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1894 // HCI command status code if this is triggerred by hci_cmd
1895 // Default: STATUS_UNKNOWN
1896 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1897 // HCI reason code associated with this event
1898 // Default: STATUS_UNKNOWN
1899 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1900}
1901
Howard Roe103fe22019-01-17 16:52:16 -08001902/**
1903 * Logs when a module is rolled back by Watchdog.
1904 *
1905 * Logged from: Rollback Manager
1906 */
1907message WatchdogRollbackOccurred {
1908 enum RollbackType {
1909 UNKNOWN = 0;
1910 ROLLBACK_INITIATE = 1;
1911 ROLLBACK_SUCCESS = 2;
1912 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001913 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001914 }
1915 optional RollbackType rollback_type = 1;
1916
1917 optional string package_name = 2;
1918
1919 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001920
1921 enum RollbackReasonType {
1922 REASON_UNKNOWN = 0;
1923 REASON_NATIVE_CRASH = 1;
1924 REASON_EXPLICIT_HEALTH_CHECK = 2;
1925 REASON_APP_CRASH = 3;
1926 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001927 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001928 }
1929 optional RollbackReasonType rollback_reason = 4;
1930
1931 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1932 // is initiated. Empty if the package is unknown.
1933 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001934
1935 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001936}
1937
Jack Hec27040a2019-01-09 20:54:41 -08001938/**
1939 * Logs when there is a change in Bluetooth A2DP playback state
1940 *
1941 * Logged from:
1942 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1943 */
1944message BluetoothA2dpPlaybackStateChanged {
1945 // An identifier that can be used to match events for this device.
1946 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1947 // Salt: Randomly generated 256 bit value
1948 // Hash algorithm: HMAC-SHA256
1949 // Size: 32 byte
1950 // Default: null or empty if the device identifier is not known
1951 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1952 // Current playback state
1953 // Default: PLAYBACK_STATE_UNKNOWN
1954 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1955 // Current audio coding mode
1956 // Default: AUDIO_CODING_MODE_UNKNOWN
1957 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1958}
1959
1960/**
1961 * Logs when there is a change in A2DP codec config for a particular remote device
1962 *
1963 * Logged from:
1964 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1965 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1966 */
1967message BluetoothA2dpCodecConfigChanged {
1968 // An identifier that can be used to match events for this device.
1969 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1970 // Salt: Randomly generated 256 bit value
1971 // Hash algorithm: HMAC-SHA256
1972 // Size: 32 byte
1973 // Default: null or empty if the device identifier is not known
1974 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1975 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1976 // Default SOURCE_CODEC_TYPE_INVALID
1977 optional int32 codec_type = 2;
1978 // Codec priroity, the higher the more preferred, -1 for disabled
1979 // Default: CODEC_PRIORITY_DEFAULT
1980 optional int32 codec_priority = 3;
1981 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1982 // Default: SAMPLE_RATE_NONE
1983 optional int32 sample_rate = 4;
1984 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1985 // Default: BITS_PER_SAMPLE_NONE
1986 optional int32 bits_per_sample = 5;
1987 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1988 // Default: CHANNEL_MODE_NONE
1989 optional int32 channel_mode = 6;
1990 // Codec specific values
1991 // Default 0
1992 optional int64 codec_specific_1 = 7;
1993 optional int64 codec_specific_2 = 8;
1994 optional int64 codec_specific_3 = 9;
1995 optional int64 codec_specific_4 = 10;
1996}
1997
1998/**
1999 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2000 * Each codec's capability is logged separately due to statsd restriction
2001 *
2002 * Logged from:
2003 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2004 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2005 */
2006message BluetoothA2dpCodecCapabilityChanged {
2007 // An identifier that can be used to match events for this device.
2008 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2009 // Salt: Randomly generated 256 bit value
2010 // Hash algorithm: HMAC-SHA256
2011 // Size: 32 byte
2012 // Default: null or empty if the device identifier is not known
2013 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2014 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2015 // Default SOURCE_CODEC_TYPE_INVALID
2016 optional int32 codec_type = 2;
2017 // Codec priroity, the higher the more preferred, -1 for disabled
2018 // Default: CODEC_PRIORITY_DEFAULT
2019 optional int32 codec_priority = 3;
2020 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2021 // in BluetoothCodecConfig
2022 // Default: empty and SAMPLE_RATE_NONE for individual item
2023 optional int32 sample_rate = 4;
2024 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2025 // in BluetoothCodecConfig
2026 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2027 optional int32 bits_per_sample = 5;
2028 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2029 // BluetoothCodecConfig
2030 // Default: empty and CHANNEL_MODE_NONE for individual item
2031 optional int32 channel_mode = 6;
2032 // Codec specific values
2033 // Default 0
2034 optional int64 codec_specific_1 = 7;
2035 optional int64 codec_specific_2 = 8;
2036 optional int64 codec_specific_3 = 9;
2037 optional int64 codec_specific_4 = 10;
2038}
2039
2040/**
2041 * Logs when A2DP failed to read from PCM source.
2042 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2043 *
2044 * Logged from:
2045 * system/bt
2046 */
2047message BluetoothA2dpAudioUnderrunReported {
2048 // An identifier that can be used to match events for this device.
2049 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2050 // Salt: Randomly generated 256 bit value
2051 // Hash algorithm: HMAC-SHA256
2052 // Size: 32 byte
2053 // Default: null or empty if the device identifier is not known
2054 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2055 // Encoding interval in nanoseconds
2056 // Default: 0
2057 optional int64 encoding_interval_nanos = 2;
2058 // Number of bytes of PCM data that could not be read from the source
2059 // Default: 0
2060 optional int32 num_missing_pcm_bytes = 3;
2061}
2062
2063/**
2064 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2065 * buffer queue is full and we have to drop data
2066 *
2067 * Logged from:
2068 * system/bt
2069 */
2070message BluetoothA2dpAudioOverrunReported {
2071 // An identifier that can be used to match events for this device.
2072 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2073 // Salt: Randomly generated 256 bit value
2074 // Hash algorithm: HMAC-SHA256
2075 // Size: 32 byte
2076 // Default: null or empty if the device identifier is not known
2077 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2078 // Encoding interval in nanoseconds
2079 // Default: 0
2080 optional int64 encoding_interval_nanos = 2;
2081 // Number of buffers dropped in this event
2082 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2083 // Default: 0
2084 optional int32 num_dropped_buffers = 3;
2085 // Number of encoded buffers dropped in this event
2086 // Default 0
2087 optional int32 num_dropped_encoded_frames = 4;
2088 // Number of encoded bytes dropped in this event
2089 // Default: 0
2090 optional int32 num_dropped_encoded_bytes = 5;
2091}
2092
2093/**
2094 * Logs when we receive reports regarding a device's RSSI value
2095 *
2096 * Logged from:
2097 * system/bt
2098 */
2099message BluetoothDeviceRssiReported {
2100 // An identifier that can be used to match events for this device.
2101 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2102 // Salt: Randomly generated 256 bit value
2103 // Hash algorithm: HMAC-SHA256
2104 // Size: 32 byte
2105 // Default: null or empty if the device identifier is not known
2106 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2107 // Connection handle of this connection if available
2108 // Range: 0x0000 - 0x0EFF (12 bits)
2109 // Default: 0xFFFF if the handle is unknown
2110 optional int32 connection_handle = 2;
2111 // HCI command status code if this is triggerred by hci_cmd
2112 // Default: STATUS_UNKNOWN
2113 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2114 // BR/EDR
2115 // Range: -128 ≤ N ≤ 127 (signed integer)
2116 // Units: dB
2117 // LE:
2118 // Range: -127 to 20, 127 (signed integer)
2119 // Units: dBm
2120 // Invalid when an out of range value is reported
2121 optional int32 rssi = 4;
2122}
2123
2124/**
2125 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothDeviceFailedContactCounterReported {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Connection handle of this connection if available
2139 // Range: 0x0000 - 0x0EFF (12 bits)
2140 // Default: 0xFFFF if the handle is unknown
2141 optional int32 connection_handle = 2;
2142 // HCI command status code if this is triggerred by hci_cmd
2143 // Default: STATUS_UNKNOWN
2144 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2145 // Number of consecutive failed contacts for a connection corresponding to the Handle
2146 // Range: uint16_t, 0-0xFFFF
2147 // Default: 0xFFFFF
2148 optional int32 failed_contact_counter = 4;
2149}
2150
2151/**
2152 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothDeviceTxPowerLevelReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 // Size: 32 byte
2163 // Default: null or empty if the device identifier is not known
2164 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2165 // Connection handle of this connection if available
2166 // Range: 0x0000 - 0x0EFF (12 bits)
2167 // Default: 0xFFFF if the handle is unknown
2168 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002169 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002170 // Default: STATUS_UNKNOWN
2171 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2172 // Range: -30 ≤ N ≤ 20
2173 // Units: dBm
2174 // Invalid when an out of range value is reported
2175 optional int32 transmit_power_level = 4;
2176}
Jack Heab86dbd22018-12-18 15:43:27 -08002177
Tej Singh5d991e12018-03-09 19:48:11 -08002178/**
Jack He1021a612019-01-20 21:22:46 -08002179 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2180 * receiving an HCI command from the host
2181 *
2182 * Logged from: system/bt
2183 */
2184message BluetoothHciTimeoutReported {
2185 // HCI command associated with this event
2186 // Default: CMD_UNKNOWN
2187 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2188}
2189
2190/**
2191 * Logs when we receive Bluetooth Link Quality Report event from the controller
2192 * See Android Bluetooth HCI specification for more details
2193 *
2194 * Note: all count and bytes field are counted since last event
2195 *
2196 * Logged from: system/bt
2197 */
2198message BluetoothQualityReportReported {
2199 // Quality report ID
2200 // Original type: uint8_t
2201 // Default: BQR_ID_UNKNOWN
2202 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2203 // Packet type of the connection
2204 // Original type: uint8_t
2205 // Default: BQR_PACKET_TYPE_UNKNOWN
2206 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2207 // Connection handle of the connection
2208 // Original type: uint16_t
2209 optional int32 connection_handle = 3;
2210 // Performing Role for the connection
2211 // Original type: uint8_t
2212 optional int32 connection_role = 4;
2213 // Current Transmit Power Level for the connection. This value is the same as the controller's
2214 // response to the HCI_Read_Transmit_Power_Level HCI command
2215 // Original type: uint8_t
2216 optional int32 tx_power_level = 5;
2217 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2218 // absolute receiver signal strength value
2219 // Original type: int8_t
2220 optional int32 rssi = 6;
2221 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2222 // channels used by the link currently
2223 // Original type: uint8_t
2224 optional int32 snr = 7;
2225 // Indicates the number of unused channels in AFH_channel_map
2226 // Original type: uint8_t
2227 optional int32 unused_afh_channel_count = 8;
2228 // Indicates the number of the channels which are interfered and quality is bad but are still
2229 // selected for AFH
2230 // Original type: uint8_t
2231 optional int32 afh_select_unideal_channel_count = 9;
2232 // Current Link Supervision Timeout Setting
2233 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2234 // Original type: uint16_t
2235 optional int32 lsto = 10;
2236 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2237 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2238 // 0x01 (Piconet Clock)
2239 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2240 // Original type: uint32_t
2241 optional int64 connection_piconet_clock = 11;
2242 // The count of retransmission
2243 // Original type: uint32_t
2244 optional int64 retransmission_count = 12;
2245 // The count of no RX
2246 // Original type: uint32_t
2247 optional int64 no_rx_count = 13;
2248 // The count of NAK (Negative Acknowledge)
2249 // Original type: uint32_t
2250 optional int64 nak_count = 14;
2251 // Controller timestamp of last TX ACK
2252 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2253 // Original type: uint32_t
2254 optional int64 last_tx_ack_timestamp = 15;
2255 // The count of Flow-off (STOP)
2256 // Original type: uint32_t
2257 optional int64 flow_off_count = 16;
2258 // Controller timestamp of last Flow-on (GO)
2259 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2260 // Original type: uint32_t
2261 optional int64 last_flow_on_timestamp = 17;
2262 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2263 // Original type: uint32_t
2264 optional int64 buffer_overflow_bytes = 18;
2265 // Buffer underflow count (in byte) since last event
2266 // Original type: uint32_t
2267 optional int64 buffer_underflow_bytes = 19;
2268}
2269
2270/**
2271 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2272 *
2273 * Notes:
2274 * - Each event can be partially filled as we might learn different pieces of device
2275 * information at different time
2276 * - Multiple device info events can be combined to give more complete picture
2277 * - When multiple device info events tries to describe the same information, the
2278 * later one wins
2279 *
2280 * Logged from:
2281 * packages/apps/Bluetooth
2282 */
Jack Heaea26982019-04-04 11:19:48 -07002283message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002284 // An identifier that can be used to match events for this device.
2285 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2286 // Salt: Randomly generated 256 bit value
2287 // Hash algorithm: HMAC-SHA256
2288 // Size: 32 byte
2289 // Default: null or empty if the device identifier is not known
2290 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2291 // Where is this device info obtained from
2292 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2293 // Name of the data source
2294 // For EXTERNAL: package name of the data source
2295 // For INTERNAL: null for general case, component name otherwise
2296 optional string source_name = 3;
2297 // Name of the manufacturer of this device
2298 optional string manufacturer = 4;
2299 // Model of this device
2300 optional string model = 5;
2301 // Hardware version of this device
2302 optional string hardware_version = 6;
2303 // Software version of this device
2304 optional string software_version = 7;
2305}
2306
2307/**
2308 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2309 * device, as documented by the Bluetooth Core HCI specification
2310 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2311 * Vol 2, Part E, Page 1118
2312 *
2313 * Logged from:
2314 * system/bt
2315 */
2316message BluetoothRemoteVersionInfoReported {
2317 // Connection handle of the connection
2318 // Original type: uint16_t
2319 optional int32 connection_handle = 1;
2320 // HCI command status code
2321 // Default: STATUS_UNKNOWN
2322 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2323 // 1 byte Version of current LMP in the remote controller
2324 optional int32 lmp_version = 3;
2325 // 2 bytes LMP manufacturer code of the remote controller
2326 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2327 optional int32 lmp_manufacturer_code = 4;
2328 // 4 bytes subversion of the LMP in the remote controller
2329 optional int32 lmp_subversion = 5;
2330}
2331
2332/**
2333 * Logs when certain Bluetooth SDP attributes are discovered
2334 * Constant definitions are from:
2335 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2336 *
2337 * Current logged attributes:
2338 * - BluetoothProfileDescriptorList
2339 * - Supported Features Bitmask
2340 *
2341 * Logged from:
2342 * system/bt
2343 */
2344message BluetoothSdpAttributeReported {
2345 // An identifier that can be used to match events for this device.
2346 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2347 // Salt: Randomly generated 256 bit value
2348 // Hash algorithm: HMAC-SHA256
2349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2350 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2351 // Original type: uint16_t
2352 optional int32 protocol_uuid = 2;
2353 // Short form UUIDs used to identify Bluetooth SDP attribute types
2354 // Original type: uint16_t
2355 optional int32 attribute_id = 3;
2356 // Attribute value for the particular attribute
2357 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2358}
2359
2360/**
2361 * Logs when bond state of a Bluetooth device changes
2362 *
2363 * Logged from:
2364 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2365 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2366 */
2367message BluetoothBondStateChanged {
2368 // An identifier that can be used to match events for this device.
2369 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2370 // Salt: Randomly generated 256 bit value
2371 // Hash algorithm: HMAC-SHA256
2372 // Size: 32 byte
2373 // Default: null or empty if the device identifier is not known
2374 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2375 // Preferred transport type to remote dual mode device
2376 // Default: TRANSPORT_AUTO means no preference
2377 optional android.bluetooth.TransportTypeEnum transport = 2;
2378 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2379 // Default: UNKNOWN
2380 optional android.bluetooth.DeviceTypeEnum type = 3;
2381 // Current bond state (NONE, BONDING, BONDED)
2382 // Default: BOND_STATE_UNKNOWN
2383 optional android.bluetooth.BondStateEnum bond_state = 4;
2384 // Bonding sub state
2385 // Default: BOND_SUB_STATE_UNKNOWN
2386 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2387 // Unbond Reason
2388 // Default: UNBOND_REASON_UNKNOWN
2389 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2390}
2391
2392/**
2393 * Logs there is an event related Bluetooth classic pairing
2394 *
2395 * Logged from:
2396 * system/bt
2397 */
2398message BluetoothClassicPairingEventReported {
2399 // An identifier that can be used to match events for this device.
2400 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2401 // Salt: Randomly generated 256 bit value
2402 // Hash algorithm: HMAC-SHA256
2403 // Size: 32 byte
2404 // Default: null or empty if the device identifier is not known
2405 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2406 // Connection handle of this connection if available
2407 // Range: 0x0000 - 0x0EFF (12 bits)
2408 // Default: 0xFFFF if the handle is unknown
2409 optional int32 connection_handle = 2;
2410 // HCI command associated with this event
2411 // Default: CMD_UNKNOWN
2412 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2413 // HCI event associated with this event
2414 // Default: EVT_UNKNOWN
2415 optional android.bluetooth.hci.EventEnum hci_event = 4;
2416 // HCI command status code if this is triggerred by hci_cmd
2417 // Default: STATUS_UNKNOWN
2418 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2419 // HCI reason code associated with this event
2420 // Default: STATUS_UNKNOWN
2421 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002422 // A status value related to this specific event
2423 // Default: 0
2424 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002425}
2426
2427/**
2428 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2429 *
2430 * Logged from:
2431 * system/bt
2432 */
2433message BluetoothSmpPairingEventReported {
2434 // An identifier that can be used to match events for this device.
2435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2436 // Salt: Randomly generated 256 bit value
2437 // Hash algorithm: HMAC-SHA256
2438 // Size: 32 byte
2439 // Default: null or empty if the device identifier is not known
2440 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2441 // SMP command sent or received over L2CAP
2442 // Default: CMD_UNKNOWN
2443 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2444 // Whether this command is sent or received
2445 // Default: DIRECTION_UNKNOWN
2446 optional android.bluetooth.DirectionEnum direction = 3;
2447 // SMP failure reason code
2448 // Default: PAIRING_FAIL_REASON_DEFAULT
2449 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2450}
2451
2452/**
Jack He815cdba2019-01-30 17:24:55 -08002453 * Logs when a Bluetooth socket’s connection state changed
2454 *
2455 * Logged from:
2456 * system/bt
2457 */
2458message BluetoothSocketConnectionStateChanged {
2459 // An identifier that can be used to match events for this device.
2460 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2461 // Salt: Randomly generated 256 bit value
2462 // Hash algorithm: HMAC-SHA256
2463 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002464 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002465 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002466 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002467 // Default 0 when unknown or don't care
2468 optional int32 port = 2;
2469 // Socket type as mentioned in
2470 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2471 // Default: SOCKET_TYPE_UNKNOWN
2472 optional android.bluetooth.SocketTypeEnum type = 3;
2473 // Socket connection state
2474 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2475 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2476 // Number of bytes sent to remote device during this connection
2477 optional int64 tx_bytes = 5;
2478 // Number of bytes received from remote device during this connection
2479 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002480 // Socket owner's UID
2481 optional int32 uid = 7 [(is_uid) = true];
2482 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2483 // |port| must be spawned by |server_port|
2484 // Default 0 when unknown or don't care
2485 optional int32 server_port = 8;
2486 // Whether this is a server listener socket
2487 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002488}
2489
2490/**
Jack He71426802019-04-02 13:32:52 -07002491 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2492 *
2493 * Logged from:
2494 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2495 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2496 *
2497 */
2498message BluetoothClassOfDeviceReported {
2499 // An identifier that can be used to match events for this device.
2500 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2501 // Salt: Randomly generated 256 bit value
2502 // Hash algorithm: HMAC-SHA256
2503 // Size: 32 byte
2504 // Default: null or empty if this is a server listener socket
2505 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2506 // Class of Device (CoD) value including both Major, Minor device class and service class
2507 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2508 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2509 // Default: 0
2510 optional int32 class_of_device = 2;
2511}
2512
2513/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002514 * Logs when something is plugged into or removed from the USB-C connector.
2515 *
2516 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002517 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002518 */
2519message UsbConnectorStateChanged {
2520 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002521 STATE_DISCONNECTED = 0;
2522 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002523 }
2524 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002525 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002526 // Last active session in ms.
2527 // 0 when the port is in connected state.
2528 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002529}
2530
2531/**
2532 * Logs the reported speaker impedance.
2533 *
2534 * Logged from:
2535 * Vendor audio implementation.
2536 */
2537message SpeakerImpedanceReported {
2538 optional int32 speaker_location = 1;
2539 optional int32 impedance = 2;
2540}
2541
2542/**
2543 * Logs the report of a failed hardware.
2544 *
2545 * Logged from:
2546 * Vendor HALs.
2547 *
2548 */
2549message HardwareFailed {
2550 enum HardwareType {
2551 HARDWARE_FAILED_UNKNOWN = 0;
2552 HARDWARE_FAILED_MICROPHONE = 1;
2553 HARDWARE_FAILED_CODEC = 2;
2554 HARDWARE_FAILED_SPEAKER = 3;
2555 HARDWARE_FAILED_FINGERPRINT = 4;
2556 }
2557 optional HardwareType hardware_type = 1;
2558
Maggie White6dcd8572019-01-31 14:11:50 -08002559 /**
2560 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002561 * the same hardware_type. The specific locations are vendor defined integers,
2562 * referring to board-specific numbering schemes.
2563 */
2564 optional int32 hardware_location = 2;
2565
Maggie White6dcd8572019-01-31 14:11:50 -08002566 /**
2567 * failure_code is specific to the HardwareType of the failed hardware.
2568 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002569 */
Maggie White6dcd8572019-01-31 14:11:50 -08002570 enum HardwareErrorCode {
2571 UNKNOWN = 0;
2572 COMPLETE = 1;
2573 SPEAKER_HIGH_Z = 2;
2574 SPEAKER_SHORT = 3;
2575 FINGERPRINT_SENSOR_BROKEN = 4;
2576 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002577 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002578 }
2579 optional int32 failure_code = 3;
2580}
2581
2582/**
2583 * Log an event when the device has been physically dropped.
2584 * Reported from the /vendor partition.
2585 */
2586message PhysicalDropDetected {
2587 // Confidence that the event was actually a drop, 0 -> 100
2588 optional int32 confidence_pctg = 1;
2589 // Peak acceleration of the drop, in 1/1000s of a g.
2590 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002591 // Duration of freefall in ms
2592 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002593}
2594
2595/**
2596 * Log bucketed battery charge cycles.
2597 *
2598 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002599 * a given charge point. For example, if 10 cycle buckets are
2600 * initialized, bucket 1 is the lowest 1/10th of the battery,
2601 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002602 *
2603 * Logged from:
2604 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2605 */
2606message ChargeCyclesReported {
2607 optional int32 cycle_bucket_1 = 1;
2608 optional int32 cycle_bucket_2 = 2;
2609 optional int32 cycle_bucket_3 = 3;
2610 optional int32 cycle_bucket_4 = 4;
2611 optional int32 cycle_bucket_5 = 5;
2612 optional int32 cycle_bucket_6 = 6;
2613 optional int32 cycle_bucket_7 = 7;
2614 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002615 optional int32 cycle_bucket_9 = 9;
2616 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002617}
2618
2619/**
Howard Roa46b6582018-09-18 16:45:02 -07002620 * Log battery health snapshot.
2621 *
2622 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2623 * are snapshotted periodically over 24hrs.
2624 */
2625message BatteryHealthSnapshot {
2626 enum BatterySnapshotType {
2627 UNKNOWN = 0;
2628 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2629 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2630 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2631 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2632 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2633 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2634 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2635 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2636 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2637 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2638 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2639 }
2640 optional BatterySnapshotType type = 1;
2641 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002642 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002643 // Voltage Battery Voltage, in microVolts.
2644 optional int32 voltage_micro_volt = 3;
2645 // Current Battery current, in microAmps.
2646 optional int32 current_micro_amps = 4;
2647 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2648 optional int32 open_circuit_micro_volt = 5;
2649 // Resistance Battery Resistance, in microOhms.
2650 optional int32 resistance_micro_ohm = 6;
2651 // Level Battery Level, as % of full.
2652 optional int32 level_percent = 7;
2653}
2654
2655/**
2656 * Log slow I/O operations on the primary storage.
2657 */
2658message SlowIo {
2659 // Classifications of IO Operations.
2660 enum IoOperation {
2661 UNKNOWN = 0;
2662 READ = 1;
2663 WRITE = 2;
2664 UNMAP = 3;
2665 SYNC = 4;
2666 }
2667 optional IoOperation operation = 1;
2668
2669 // The number of slow IO operations of this type over 24 hours.
2670 optional int32 count = 2;
2671}
2672
2673/**
2674 * Log battery caused shutdown with the last recorded voltage.
2675 */
2676message BatteryCausedShutdown {
2677 // The last recorded battery voltage prior to shutdown.
2678 optional int32 last_recorded_micro_volt = 1;
2679}
2680
2681/**
Tej Singha72344992019-04-17 18:55:08 -07002682 * Logs when ThermalService receives throttling events.
2683 *
2684 * Logged from:
2685 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2686 */
2687message ThermalThrottlingSeverityStateChanged {
2688 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2689 optional android.os.TemperatureTypeEnum sensor_type = 1;
2690
2691 // The name of the temperature source. Eg. CPU0
2692 optional string sensor_name = 2;
2693
2694 // Temperature in tenths of a degree C.
2695 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2696 optional int32 temperature_deci_celsius = 3;
2697
2698 // Relative severity of the throttling, see enum definition.
2699 optional android.os.ThrottlingSeverityEnum severity = 4;
2700}
2701
2702/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002703 * Logs the duration of a davey (jank of >=700ms) when it occurs
2704 *
2705 * Logged from:
2706 * frameworks/base/libs/hwui/JankTracker.cpp
2707 */
2708message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002709 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002710 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002711
Tej Singhbb8554a2018-01-26 11:59:14 -08002712 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002713 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002714}
2715
2716/**
Bookatze5885242017-10-24 20:10:31 -07002717 * Logs phone signal strength changes.
2718 *
2719 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002720 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002721 */
2722message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002723 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2724 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002725}
2726
Yangster4ccebea2018-10-09 17:09:02 -07002727
2728/**
2729 * Logs when the phone state, sim state or signal strength changes
2730 *
2731 * Logged from:
2732 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2733 */
2734message PhoneServiceStateChanged {
2735 optional android.telephony.ServiceStateEnum state = 1;
2736 optional android.telephony.SimStateEnum sim_state = 2;
2737 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2738}
2739
2740/**
2741 * Logs when the phone becomes on or off.
2742 *
2743 * Logged from:
2744 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2745 */
2746message PhoneStateChanged {
2747 enum State {
2748 OFF = 0;
2749 ON = 1;
2750 }
2751 optional State state = 1;
2752}
2753
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002754message BackGesture {
2755 enum BackType {
2756 DEFAULT_BACK_TYPE = 0;
2757 COMPLETED = 1;
2758 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2759 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2760 INCOMPLETE = 4;
2761 }
2762 optional BackType type = 1;
2763
2764 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2765 enum WindowHorizontalLocation {
2766 DEFAULT_LOCATION = 0;
2767 LEFT = 1;
2768 RIGHT = 2;
2769 }
2770 optional WindowHorizontalLocation x_location = 3;
2771}
2772
2773message ExclusionRectStateChanged {
2774 optional string component_name = 1; // if not available, simply packageName
2775 optional int32 requested_height = 2; // px
2776 optional int32 rejected_height = 3; // px
2777
2778 enum WindowHorizontalLocation {
2779 DEFAULT_LOCATION = 0;
2780 LEFT = 1;
2781 RIGHT = 2;
2782 }
2783 optional WindowHorizontalLocation x_location = 4;
2784 optional bool landscape = 5;
2785 optional bool splitscreen = 6;
2786 optional int32 duration_millis = 7;
2787}
2788
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002789message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002790 optional android.stats.launcher.LauncherAction action = 1;
2791 optional android.stats.launcher.LauncherState src_state = 2;
2792 optional android.stats.launcher.LauncherState dst_state = 3;
2793 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002794 optional bool is_swipe_up_enabled = 5;
2795}
2796
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002797message StyleUIChanged {
2798 optional android.stats.style.Action action = 1;
2799 optional int32 color_package_hash = 2;
2800 optional int32 font_package_hash = 3;
2801 optional int32 shape_package_hash = 4;
2802 optional int32 clock_package_hash = 5;
2803 optional int32 launcher_grid = 6;
2804 optional int32 wallpaper_category_hash = 7;
2805 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002806 optional int32 color_preference = 9;
2807 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002808}
2809
David Chenc28b2bb2017-10-24 12:52:52 -07002810/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002811 * Logs when Settings UI has changed.
2812 *
2813 * Logged from:
2814 * packages/apps/Settings
2815 */
2816message SettingsUIChanged {
2817 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002818 * Where this SettingsUIChange event comes from. For example, if
2819 * it's a PAGE_VISIBLE event, where the page is opened from.
2820 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002821 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002822
2823 /**
2824 * What the UI action is.
2825 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002826 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002827
2828 /**
2829 * Where the action is happening
2830 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002831 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002832
2833 /**
2834 * What preference changed in this event.
2835 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002836 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002837
2838 /**
2839 * The new value of the changed preference.
2840 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002841 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002842}
2843
2844/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002845 * Logs basic timing information about touch events.
2846 * Reported at most every 5 minutes while device is being interacted with.
2847 *
2848 * Logged from:
2849 * frameworks/native/services/inputflinger
2850 */
2851message TouchEventReported {
2852 /**
2853 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002854 * and the standard deviation of the time spent processing touchscreen events
2855 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002856 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002857 * On supported devices, the starting point is taken during the hard interrupt inside the
2858 * kernel touch driver. On all other devices, the starting point is taken inside
2859 * the kernel's input event subsystem upon receipt of the input event.
2860 * The ending point is taken inside InputDispatcher, just after the input event
2861 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002862 */
2863 // Minimum value
2864 optional float latency_min_micros = 1;
2865 // Maximum value
2866 optional float latency_max_micros = 2;
2867 // Average value
2868 optional float latency_mean_micros = 3;
2869 // Standard deviation
2870 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002871 // Number of touch events (input_event) in this report
2872 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002873}
2874
2875/**
Philip Quinn0eded622019-01-29 12:46:28 -08002876 * Logs gesture classification and timing information for touch events.
2877 *
2878 * Logged from:
2879 * frameworks/base/core/java/android/view/GestureDetector.java
2880 * frameworks/base/core/java/android/view/View.java
2881 */
2882message TouchGestureClassified {
2883 // The source of the classification (e.g. Java class name).
2884 optional string source = 1;
2885
2886 enum Classification {
2887 UNKNOWN_CLASSIFICATION = 0;
2888 SINGLE_TAP = 1;
2889 DOUBLE_TAP = 2;
2890 LONG_PRESS = 3;
2891 DEEP_PRESS = 4;
2892 SCROLL = 5;
2893 }
2894 // The classification of the gesture.
2895 optional Classification classification = 2;
2896
2897 // The interval from the start of a touch event stream until the
2898 // classification was made.
2899 optional int32 latency_millis = 3;
2900
2901 // The distance from the location of the first touch event to the
2902 // location of the touch event when the classification was made.
2903 optional float displacement_px = 4;
2904}
2905
2906/**
David Chenc28b2bb2017-10-24 12:52:52 -07002907 * Logs that a setting was updated.
2908 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002909 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002910 * The tag and is_default allow resetting of settings to default values based on the specified
2911 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2912 */
2913message SettingChanged {
2914 // The name of the setting.
2915 optional string setting = 1;
2916
2917 // The change being imposed on this setting. May represent a number, eg "3".
2918 optional string value = 2;
2919
2920 // The new value of this setting. For most settings, this is same as value. For some settings,
2921 // value is +X or -X where X represents an element in a set. For example, if the previous value
2922 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2923 // The +/- feature is currently only used for location_providers_allowed.
2924 optional string new_value = 3;
2925
2926 // The previous value of this setting.
2927 optional string prev_value = 4;
2928
2929 // The tag used with the is_default for resetting sets of settings. This is generally null.
2930 optional string tag = 5;
2931
Bookatz90867622018-01-31 15:05:57 -08002932 // True if this setting with tag should be resettable.
2933 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002934
David Chenbd789912018-03-16 17:19:55 -07002935 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002936 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002937
2938 enum ChangeReason {
2939 UPDATED = 1; // Updated can be an insertion or an update.
2940 DELETED = 2;
2941 }
2942 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002943}
Chenjie Yub3dda412017-10-24 13:41:59 -07002944
Chenjie Yu05013b32017-11-21 10:21:41 -08002945/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002946 * Logs activity going to foreground or background
2947 *
2948 * Logged from:
2949 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2950 */
2951message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002952 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002953 optional string pkg_name = 2;
2954 optional string class_name = 3;
2955
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002956 enum State {
2957 BACKGROUND = 0;
2958 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002959 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002960 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002961}
David Chenc8a43242017-10-17 16:23:28 -07002962
2963/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002964 * Logs when a volume entered low Storage state.
2965 * Logged from:
2966 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2967 */
2968message LowStorageStateChanged {
2969 // Volume that ran out of storage.
2970 optional string volume_description = 1;
2971
2972 enum State {
2973 UNKNOWN = 0;
2974 OFF = 1;
2975 ON = 2;
2976 }
2977 optional State state = 2;
2978}
2979
2980/**
2981 * Logs when an app is downgraded.
2982 * Logged from:
2983 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2984 */
2985message AppDowngraded {
2986 optional string package_name = 1;
2987 // Size of the package (all data) before being downgraded.
2988 optional int64 size_in_bytes_before = 2;
2989 // Size of the package (all data) after being downgraded.
2990 optional int64 size_in_bytes_after = 3;
2991
2992 optional bool aggressive = 4;
2993}
2994
2995/**
2996 * Logs when an app is optimized after being downgraded.
2997 * Logged from:
2998 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2999 */
3000message AppOptimizedAfterDowngraded {
3001 optional string package_name = 1;
3002}
3003
3004/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003005 * Logs whenever an app is installed on external storage.
3006 * Logged from:
3007 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3008 */
3009message AppInstallOnExternalStorageReported {
3010 // The type of external storage.
3011 optional android.stats.storage.ExternalStorageType storage_type = 1;
3012 // The name of the package that is installed on the sd card.
3013 optional string package_name = 2;
3014}
3015
3016/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003017 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003018 * Logged from:
3019 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3020 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003021message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003022 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003023
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003024 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003025
3026 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003027 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003028 optional string process_name = 3;
3029
3030 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003031 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003032
3033 optional string package_name = 5;
3034
3035 enum InstantApp {
3036 UNAVAILABLE = 0;
3037 FALSE = 1;
3038 TRUE = 2;
3039 }
3040 optional InstantApp is_instant_app = 6;
3041
3042 enum ForegroundState {
3043 UNKNOWN = 0;
3044 BACKGROUND = 1;
3045 FOREGROUND = 2;
3046 }
3047 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003048
3049 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003050}
David Chen9e3808c2017-11-20 17:25:34 -08003051
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003052/**
3053 * Logs when a WTF (What a Terrible Failure) happened.
3054 * Logged from:
3055 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3056 */
3057message WTFOccurred {
3058 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003059
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003060 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003061
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003062 // The name of the process.
3063 // system_server if it is not by an app
3064 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003065
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003066 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003067 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003068
3069 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003070}
3071
3072/**
3073 * Logs when system server reports low memory.
3074 * Logged from:
3075 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3076 */
3077message LowMemReported {
3078}
3079
3080/**
3081 * Logs when an app ANR (App Not Responding) occurs.
3082 * Logged from:
3083 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3084 */
3085message ANROccurred {
3086 optional int32 uid = 1 [(is_uid) = true];
3087
3088 optional string process_name = 2;
3089
3090 optional string short_component_name = 3;
3091
3092 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003093
3094 enum InstantApp {
3095 UNAVAILABLE = 0;
3096 FALSE = 1;
3097 TRUE = 2;
3098 }
3099 optional InstantApp is_instant_app = 5;
3100
3101 enum ForegroundState {
3102 UNKNOWN = 0;
3103 BACKGROUND = 1;
3104 FOREGROUND = 2;
3105 }
3106 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003107
3108 optional android.server.ErrorSource error_source = 7;
3109
3110 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003111}
3112
Bookatza7020bd2018-08-28 16:29:35 -07003113/**
3114 * Logs when the vibrator state changes.
3115 * Logged from:
3116 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3117 */
3118message VibratorStateChanged {
3119 repeated AttributionNode attribution_node = 1;
3120
3121 enum State {
3122 OFF = 0;
3123 ON = 1;
3124 }
3125 optional State state = 2;
3126
3127 // Duration (in milliseconds) requested to keep the vibrator on.
3128 // Only applicable for State == ON.
3129 optional int64 duration_millis = 3;
3130}
3131
David Chen0a368b22017-12-06 16:28:16 -08003132/*
3133 * Allows other apps to push events into statsd.
3134 * Logged from:
3135 * frameworks/base/core/java/android/util/StatsLog.java
3136 */
David Chen0b5c90c2018-01-25 16:51:49 -08003137message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003138 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003139 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003140
3141 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3142 optional int32 label = 2;
3143
3144 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3145 // predicates for the metrics).
3146 enum State {
3147 UNKNOWN = 0;
3148 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3149 STOP = 2;
3150 START = 3;
3151 }
3152 optional State state = 3;
3153}
3154
David Chen9e3808c2017-11-20 17:25:34 -08003155/**
Bookatz7948c872018-09-04 12:58:33 -07003156 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3157 * For example, this could be due to the user manually changing the time.
3158 *
3159 * Logged from:
3160 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3161 */
3162message WallClockTimeShifted {
3163 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3164 optional int64 wall_clock_timestamp_millis = 1;
3165}
3166
3167/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003168 * Logs when statsd detects an anomaly.
3169 *
3170 * Logged from:
3171 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3172 */
3173message AnomalyDetected {
3174 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003175 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003176
Yangster-mac94e197c2018-01-02 16:03:03 -08003177 // Id of the config whose anomaly detection alert fired.
3178 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003179
Yangster-mac94e197c2018-01-02 16:03:03 -08003180 // Id of the alert (i.e. name of the anomaly that was detected).
3181 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003182}
3183
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003184message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003186 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003187
3188 // The app package name.
3189 optional string pkg_name = 2;
3190
3191 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003192 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003193 WARM = 1;
3194 HOT = 2;
3195 COLD = 3;
3196 }
3197 // The transition type.
3198 optional TransitionType type = 3;
3199
3200 // The activity name.
3201 optional string activity_name = 4;
3202
3203 // The name of the calling app. Empty if not set.
3204 optional string calling_pkg_name = 5;
3205
3206 // Whether the app is an instant app.
3207 optional bool is_instant_app = 6;
3208
3209 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003210 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003211
Bookatz80d11a02018-01-16 10:46:35 -08003212 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213
David Chen0b5c90c2018-01-25 16:51:49 -08003214 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003215 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003216 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003217 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003218 optional int32 bind_application_delay_millis = 11;
3219 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003220
3221 // Empty if not set.
3222 optional string launch_token = 13;
3223
Calin Juravle759fbda2018-02-20 19:52:30 +00003224 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003225 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003226
3227 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003228 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003229}
3230
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003231message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003232 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003233 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003234
3235 // The app package name.
3236 optional string pkg_name = 2;
3237
3238 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003239 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003240 WARM = 1;
3241 HOT = 2;
3242 COLD = 3;
3243 }
3244 // The transition type.
3245 optional TransitionType type = 3;
3246
3247 // The activity name.
3248 optional string activity_name = 4;
3249}
3250
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003251message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003252 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003253 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003254
3255 // The app package name.
3256 optional string pkg_name = 2;
3257
3258 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003259 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003260 WITH_BUNDLE = 1;
3261 WITHOUT_BUNDLE = 2;
3262 }
3263 // The transition type.
3264 optional TransitionType type = 3;
3265
3266 // The activity name.
3267 optional string activity_name = 4;
3268
3269 optional bool transition_process_running = 5;
3270
3271 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003272 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003273}
3274
Bookatz8fcd09a2017-12-18 13:01:10 -08003275/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003276 * Logs a picture-in-picture action
3277 * Logged from:
3278 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3279 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3280 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3281 */
3282message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003283 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003284 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003285
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003286 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003287
Chenjie Yu52cacc62017-12-08 18:11:45 -08003288 enum State {
3289 ENTERED = 1;
3290 EXPANDED_TO_FULL_SCREEN = 2;
3291 MINIMIZED = 3;
3292 DISMISSED = 4;
3293 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003294 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003295}
3296
3297/**
Chenjie Yue8904192017-12-08 19:12:57 -08003298 * Logs overlay action
3299 * Logged from:
3300 * services/core/java/com/android/server/wm/Session.java
3301 */
3302message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003303 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003304
tsaichristine5adc7e02020-01-14 17:07:39 -08003305 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003306
3307 optional bool using_alert_window = 3;
3308
3309 enum State {
3310 ENTERED = 1;
3311 EXITED = 2;
3312 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003313 optional State state = 4 [
3314 (state_field_option).option = EXCLUSIVE_STATE,
3315 (state_field_option).nested = false,
3316 (state_field_option).default_state_value = 2
3317 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003318}
3319
Adam Bookatz38767932020-02-05 12:13:40 -08003320/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003321 * Logs foreground service starts and stops.
3322 * Note that this is not when a service starts or stops, but when it is
3323 * considered foreground.
3324 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003325 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003326 */
3327message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003328 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003329 // package_name + "/" + class_name
3330 optional string short_name = 2;
3331
3332 enum State {
3333 ENTER = 1;
3334 EXIT = 2;
3335 }
3336 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003337
3338 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3339 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3340 optional bool allow_while_in_use_permission = 4;
3341}
3342
3343/**
3344 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3345 * A foreground service session is any continuous period during which the uid holds at least one
3346 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3347 * Accesses initiated while the uid is in the TOP state are ignored.
3348 * Sessions with no attempted accesses are not logged.
3349 * Logged from
3350 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3351 */
3352message ForegroundServiceAppOpSessionEnded {
3353 optional int32 uid = 1 [(is_uid) = true];
3354
3355 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003356 // Only following four ops are logged
3357 // COARSE_LOCATION = 0
3358 // FINE_LOCATION = 1
3359 // CAMERA = 26
3360 // RECORD_AUDIO = 27
3361 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003362
3363 // The uid's permission mode for accessing the AppOp during this fgs session.
3364 enum Mode {
3365 MODE_UNKNOWN = 0;
3366 MODE_ALLOWED = 1; // Always allowed
3367 MODE_IGNORED = 2; // Denied
3368 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3369 }
3370 optional Mode app_op_mode = 3;
3371
3372 // Number of times this AppOp was requested and allowed.
3373 optional int32 count_ops_accepted = 4;
3374 // Number of times this AppOp was requested but denied.
3375 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003376}
3377
Chenjie Yue8904192017-12-08 19:12:57 -08003378/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003379 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3380 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3381 * attributed back to the parent (host) uid. One example is Chrome.
3382 *
3383 * Logged from:
3384 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3385 */
3386message IsolatedUidChanged {
3387 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003388 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003389 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003390 optional int32 parent_uid = 1;
3391
3392 optional int32 isolated_uid = 2;
3393
3394 // We expect an isolated uid to be removed before if it's used for another parent uid.
3395 enum Event {
3396 REMOVED = 0;
3397 CREATED = 1;
3398 }
3399 optional Event event = 3;
3400}
3401
3402/*
3403 * Logs the reception of an incoming network packet causing the main system to wake up for
3404 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3405 * and processed by WakeupController.cpp.
3406 */
3407message PacketWakeupOccurred {
3408 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3409 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003410 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003411 // The interface name on which the packet was received.
3412 optional string iface = 2;
3413 // The ethertype value of the packet.
3414 optional int32 ethertype = 3;
3415 // String representation of the destination MAC address of the packet.
3416 optional string destination_hardware_address = 4;
3417 // String representation of the source address of the packet if this was an IP packet.
3418 optional string source_ip = 5;
3419 // String representation of the destination address of the packet if this was an IP packet.
3420 optional string destination_ip = 6;
3421 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3422 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3423 // families.
3424 optional int32 ip_next_header = 7;
3425 // The source port if this was a TCP or UDP packet.
3426 optional int32 source_port = 8;
3427 // The destination port if this was a TCP or UDP packet.
3428 optional int32 destination_port = 9;
3429}
3430
3431/*
3432 * Logs the memory stats for an app on startup.
3433 * Logged from:
3434 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3435 */
3436message AppStartMemoryStateCaptured {
3437 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003438 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003439
3440 // The process name.
3441 optional string process_name = 2;
3442
3443 // The activity name.
3444 optional string activity_name = 3;
3445
3446 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003447 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003448
3449 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003450 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003451
3452 // RSS
3453 optional int64 rss_in_bytes = 6;
3454
3455 // CACHE
3456 optional int64 cache_in_bytes = 7;
3457
3458 // SWAP
3459 optional int64 swap_in_bytes = 8;
3460}
3461
3462/*
3463 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3464 * for LMK event.
3465 * Logged from:
3466 * system/core/lmkd/lmkd.c
3467 */
3468message LmkStateChanged {
3469 enum State {
3470 UNKNOWN = 0;
3471 START = 1;
3472 STOP = 2;
3473 }
3474 optional State state = 1;
3475}
3476
3477/*
3478 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3479 * Logged from:
3480 * system/core/lmkd/lmkd.c
3481 */
3482message LmkKillOccurred {
3483 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003484 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003485
3486 // The process name.
3487 optional string process_name = 2;
3488
3489 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003490 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003491
3492 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003493 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003494
3495 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003496 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003497
3498 // RSS
3499 optional int64 rss_in_bytes = 6;
3500
3501 // CACHE
3502 optional int64 cache_in_bytes = 7;
3503
3504 // SWAP
3505 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003506
3507 // The elapsed real time of start of the process.
3508 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003509
3510 // Min oom adj score considered by lmkd.
3511 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003512}
3513
Rajeev Kumar51b54602018-03-01 12:18:26 -08003514/*
3515 * Logs when the ActivityManagerService detects that an app died.
3516 *
3517 * Logged from:
3518 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3519 */
3520message AppDied {
3521 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003522 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003523}
3524
Howard Ro21a039c2018-08-06 14:55:47 -07003525/**
3526 * An atom for generic metrics logging. Available from Android Q.
3527 */
3528message GenericAtom {
3529 // The uid of the application that sent this custom atom.
3530 optional int32 uid = 1 [(is_uid) = true];
3531
3532 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003533 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003534}
3535
Tej Singhd6d6d772018-09-05 17:41:25 -07003536/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003537 * Atom for simple logging of user interaction and impression events, such as "the user touched
3538 * this button" or "this dialog was displayed".
3539 * Keep the UI event stream clean: don't use for system or background events.
3540 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003541 *
3542 * Logged from:
3543 * frameworks/base/services/core/java/com/android/server/
3544 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003545 */
3546message UiEventReported {
3547 // The event_id.
3548 optional int32 event_id = 1;
3549 // The event's source or target uid and package, if applicable.
3550 // For example, the package posting a notification, or the destination package of a share.
3551 optional int32 uid = 2 [(is_uid) = true];
3552 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003553 // An identifier used to disambiguate which logs refer to a particular instance of some
3554 // UI element. Useful when there might be multiple instances simultaneously active.
3555 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003556}
3557
3558/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003559 * Reports a notification was created or updated.
3560 *
3561 * Logged from:
3562 * frameworks/base/services/core/java/com/android/server/notification/
3563 */
3564message NotificationReported {
3565 // The event_id (as for UiEventReported).
3566 optional int32 event_id = 1;
3567 // The notifying app's uid and package.
3568 optional int32 uid = 2 [(is_uid) = true];
3569 optional string package_name = 3;
3570 // A small system-assigned identifier for the notification.
3571 // Locally probably-unique, but expect collisions across users and/or days.
3572 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003573 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3574 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003575
3576 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003577 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3578 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3579 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003580
3581 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003582 optional string category = 10; // App-assigned notification category (API-defined strings)
3583 optional int32 style = 11; // App-assigned notification style
3584 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003585
3586 // Ordering, importance and interruptiveness
3587
Will Brockman7614f6962020-02-10 19:43:03 -05003588 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003589
Will Brockman7614f6962020-02-10 19:43:03 -05003590 optional android.stats.sysui.NotificationImportance importance = 14;
3591 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003592
3593 enum NotificationImportanceExplanation {
3594 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3595 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3596 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3597 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3598 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3599 // Like _APP, but based on pre-channels priority signal.
3600 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3601 }
3602
Will Brockman7614f6962020-02-10 19:43:03 -05003603 optional NotificationImportanceExplanation importance_source = 16;
3604 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3605 optional NotificationImportanceExplanation importance_initial_source = 18;
3606 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3607 optional int32 assistant_hash = 20;
3608 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003609}
3610
3611message Notification {
3612 // The notifying app's uid and package.
3613 optional int32 uid = 1 [(is_uid) = true];
3614 optional string package_name = 2;
3615 // A small system-assigned identifier for the notification.
3616 optional int32 instance_id = 3;
3617
3618 // Grouping information.
3619 optional int32 group_instance_id = 4;
3620 optional bool is_group_summary = 5;
3621
3622 // The section of the shade that the notification is in.
3623 // See NotificationSectionsManager.PriorityBucket.
3624 enum NotificationSection {
3625 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003626 SECTION_HEADS_UP = 1;
3627 SECTION_PEOPLE = 2;
3628 SECTION_ALERTING = 3;
3629 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003630 }
3631 optional NotificationSection section = 6;
3632}
3633
3634message NotificationList {
3635 repeated Notification notifications = 1; // An ordered sequence of notifications.
3636}
3637
3638/**
3639 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3640 *
3641 * Logged from:
3642 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3643 */
3644message NotificationPanelReported {
3645 // The event_id (as for UiEventReported).
3646 optional int32 event_id = 1;
3647 optional int32 num_notifications = 2;
3648 // The notifications in the panel, in the order that they appear there.
3649 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3650}
3651
3652/**
3653 * Reports a notification channel, or channel group, was created, updated, or deleted.
3654 *
3655 * Logged from:
3656 * frameworks/base/services/core/java/com/android/server/notification/
3657 */
3658message NotificationChannelModified {
3659 // The event_id (as for UiEventReported).
3660 optional int32 event_id = 1;
3661 // The notifying app's uid and package.
3662 optional int32 uid = 2 [(is_uid) = true];
3663 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003664 // Hash of app-assigned notification channel ID or channel-group ID
3665 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003666 // Previous importance setting, if applicable
3667 optional android.stats.sysui.NotificationImportance old_importance = 5;
3668 // New importance setting
3669 optional android.stats.sysui.NotificationImportance importance = 6;
3670}
3671
3672
3673/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003674 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003675 *
3676 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003677 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003678 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003679message BiometricAcquired {
3680 // Biometric modality that was acquired.
3681 optional android.hardware.biometrics.ModalityEnum modality = 1;
3682 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3683 optional int32 user = 2;
3684 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3685 optional bool is_crypto = 3;
3686 // Action that the device is performing. Acquired messages are only expected for enroll and
3687 // authenticate. Other actions may indicate an error.
3688 optional android.hardware.biometrics.ActionEnum action = 4;
3689 // The client that this acquisition was received for.
3690 optional android.hardware.biometrics.ClientEnum client = 5;
3691 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3692 optional int32 acquire_info = 6;
3693 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3694 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003695 // Dictates if this message should trigger additional debugging.
3696 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003697}
3698
3699/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003700 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003701 *
3702 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003703 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003704 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003705message BiometricAuthenticated {
3706 // Biometric modality that was used.
3707 optional android.hardware.biometrics.ModalityEnum modality = 1;
3708 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3709 optional int32 user = 2;
3710 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3711 // storage.
3712 optional bool is_crypto = 3;
3713 // The client that this acquisition was received for.
3714 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003715 // If authentication requires user confirmation. See BiometricPrompt's
3716 // setRequireConfirmation(bool) method.
3717 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003718
Kevin Chyn1741a072019-01-17 11:54:40 -08003719 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003720 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003721 REJECTED = 1;
3722 PENDING_CONFIRMATION = 2;
3723 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003724 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003725
3726 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003727 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003728 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3729 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3730 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3731 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003732 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003733 // Dictates if this message should trigger additional debugging.
3734 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003735}
3736
3737/**
3738 * Logs when a biometric error occurs.
3739 *
3740 * Logged from:
3741 * frameworks/base/services/core/java/com/android/server/biometrics
3742 */
3743message BiometricErrorOccurred {
3744 // Biometric modality that was used.
3745 optional android.hardware.biometrics.ModalityEnum modality = 1;
3746 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3747 optional int32 user = 2;
3748 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3749 optional bool is_crypto = 3;
3750 // Action that the device is performing.
3751 optional android.hardware.biometrics.ActionEnum action = 4;
3752 // The client that this acquisition was received for.
3753 optional android.hardware.biometrics.ClientEnum client = 5;
3754 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3755 // are unique to modality.
3756 optional int32 error_info = 6;
3757 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3758 // by the vendor and not specified by the HIDL interface.
3759 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003760 // Dictates if this message should trigger additional debugging.
3761 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003762 // Time spent during the authentication attempt.
3763 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003764}
3765
3766/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003767 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003768 * Logged from:
3769 * frameworks/base/services/core/java/com/android/server/biometrics
3770 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003771message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003772 // Biometric modality.
3773 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003774 // Type of issue detected.
3775 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003776 // Dictates if this message should trigger additional debugging.
3777 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003778}
Howard Ro688ae182018-09-25 00:09:36 -07003779
joshmccloskey6f952b22019-03-25 20:59:35 -07003780/**
3781 * Logs when a biometric enrollment occurs.
3782 *
3783 * Logged from:
3784 * frameworks/base/services/core/java/com/android/server/biometrics
3785 */
3786message BiometricEnrolled {
3787 // Biometric modality that was used.
3788 optional android.hardware.biometrics.ModalityEnum modality = 1;
3789 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3790 optional int32 user = 2;
3791 // The amount of time the enrollment took in milliseconds.
3792 optional int64 latency_millis = 3;
3793 // Whether or not the enrollment was successful.
3794 optional bool success = 4;
3795}
3796
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003797/*
Tej Singh0d176952019-01-16 19:10:54 -08003798 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003799 */
Tej Singh0d176952019-01-16 19:10:54 -08003800message FlagFlipUpdateOccurred {
3801 // If the event is from a flag config package, specify the package name.
3802 optional string flag_flip_package_name = 1;
3803
3804 // The order id of the package
3805 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003806}
3807
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003808/**
3809 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003810 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003811 */
3812message TrainExperimentIds {
3813 repeated int64 experiment_id = 1;
3814}
3815
Yangster-macb89807e2018-11-15 21:10:57 -08003816/*
3817 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003818 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003819 */
3820message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003821 // Name of the train.
3822 optional string train_name = 1;
3823 // Version code for a "train" of packages that need to be installed atomically
3824 optional int64 train_version_code = 2;
3825 // After installation of this package, device requires a restart.
3826 optional bool requires_staging = 3;
3827 // Rollback should be enabled for this install.
3828 optional bool rollback_enabled = 4;
3829 // Requires low latency monitoring if possible.
3830 optional bool requires_low_latency_monitor = 5;
3831
Yangster-macb89807e2018-11-15 21:10:57 -08003832 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003833 UNKNOWN = 0;
3834 INSTALL_REQUESTED = 1;
3835 INSTALL_STARTED = 2;
3836 INSTALL_STAGED_NOT_READY = 3;
3837 INSTALL_STAGED_READY = 4;
3838 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003839 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3840 // and INSTALL_FAILURE_COMMIT.
3841 INSTALL_FAILURE = 6 [deprecated = true];
3842 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003843 INSTALL_CANCELLED = 7;
3844 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003845 INSTALLER_ROLLBACK_INITIATED = 9;
3846 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3847 INSTALLER_ROLLBACK_STAGED = 11;
3848 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3849 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3850 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3851 INSTALLER_ROLLBACK_SUCCESS = 15;
3852 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003853 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3854 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3855 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3856 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3857 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3858 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003859 INSTALL_FAILURE_DOWNLOAD = 23;
3860 INSTALL_FAILURE_STATE_MISMATCH = 24;
3861 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003862 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003863 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003864 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003865 // Possible experiment ids for monitoring this push.
3866 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3867 // user id
3868 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003869 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003870 // Whether or not this is a rollback event
3871 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003872}
3873
Tej Singhc9203082019-05-03 13:42:23 -07003874/* Test atom, is not logged anywhere */
3875message TestAtomReported {
3876 repeated AttributionNode attribution_node = 1;
3877 optional int32 int_field = 2;
3878 optional int64 long_field = 3;
3879 optional float float_field = 4;
3880 optional string string_field = 5;
3881 optional bool boolean_field = 6;
3882 enum State {
3883 UNKNOWN = 0;
3884 OFF = 1;
3885 ON = 2;
3886 }
3887 optional State state = 7;
3888 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3889}
3890
Maggie Whitefc1aa592018-11-28 21:55:23 -08003891/** Represents USB port overheat event. */
3892message UsbPortOverheatEvent {
3893 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3894 optional int32 plug_temperature_deci_c = 1;
3895
3896 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3897 optional int32 max_temperature_deci_c = 2;
3898
3899 /* Time between USB plug event and overheat threshold trip, in seconds. */
3900 optional int32 time_to_overheat_secs = 3;
3901
3902 /* Time between overheat threshold trip and hysteresis, in seconds. */
3903 optional int32 time_to_hysteresis_secs = 4;
3904
3905 /* Time between hysteresis and active mitigation ending, in seconds. */
3906 optional int32 time_to_inactive_secs = 5;
3907};
3908
Maggie White8735b852019-01-18 11:40:49 -08003909/**
3910 * Logs total effective full charge and discharge cycles on a battery.
3911 * Here are some examples of one effective cycle:
3912 * 1) the battery charges from 0% to 100% and drains back to 0%,
3913 * 2) charging from 50% to 100% and draining back to 50% twice.
3914 * Pulled from:
3915 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3916 */
3917message BatteryCycleCount {
3918 /* Number of total charge and discharge cycles on the system battery. */
3919 optional int32 cycle_count = 1;
3920}
3921
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003922/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003923 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3924 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003925 * Pulled from:
3926 * StatsCompanionService
3927 */
3928
Carmen Agimof12dec122019-03-06 16:14:38 +00003929message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003930
Carmen Agimof12dec122019-03-06 16:14:38 +00003931 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003932 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003933 PUBLIC = 1;
3934 PRIVATE = 2;
3935 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003936 }
3937
Carmen Agimof12dec122019-03-06 16:14:38 +00003938 // The type of external storage.
3939 optional android.stats.storage.ExternalStorageType storage_type = 1;
3940 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3941 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003942 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003943 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003944}
3945
Yangster-macb89807e2018-11-15 21:10:57 -08003946/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003947 * Logs when a connection becomes available and lost.
3948 * Logged in StatsCompanionService.java
3949 */
3950message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003951 // Id of the network.
3952 optional int32 net_id = 1;
3953
3954 enum State {
3955 UNKNOWN = 0;
3956 CONNECTED = 1;
3957 DISCONNECTED = 2;
3958 }
3959 // Connected state of a network.
3960 optional State state = 2;
3961}
3962
3963/**
3964 * Logs when a service starts and stops.
3965 * Logged from:
3966 * services/core/java/com/android/server/am/ActiveServices.java
3967 */
3968message ServiceStateChanged {
3969
3970 optional int32 uid = 1 [(is_uid) = true];
3971
3972 optional string package_name = 2;
3973
3974 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003975
3976 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003977 START = 1;
3978 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003979 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003980
3981 optional State state = 4;
3982}
3983
3984/**
3985 * Logs when a service is launched.
3986 * Logged from:
3987 * services/core/java/com/android/server/am/ActiveServices.java
3988 */
3989message ServiceLaunchReported {
3990
3991 optional int32 uid = 1 [(is_uid) = true];
3992
3993 optional string package_name = 2;
3994
3995 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003996}
Howard Ro688ae182018-09-25 00:09:36 -07003997
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003998/**
3999 * Logs when a hidden API is used.
4000 *
4001 * Logged from:
4002 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4003 */
4004message HiddenApiUsed {
4005 // The uid of the app making the hidden access.
4006 optional int32 uid = 1 [(is_uid) = true];
4007
4008 // Signature of the method or field accessed.
4009 optional string signature = 2;
4010
4011 enum AccessMethod {
4012 NONE = 0;
4013 REFLECTION = 1;
4014 JNI = 2;
4015 LINKING = 3;
4016 }
4017
4018 // Type of access.
4019 optional AccessMethod access_method = 3;
4020
4021 // Whether the access was prevented or not.
4022 optional bool access_denied = 4;
4023}
4024
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004025/**
4026 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4027 * - When user sees privacy chip
4028 * - When user clicks privacy chip
4029 * - How does the user exit the Privacy Dialog
4030 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004031 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4032 */
4033message PrivacyIndicatorsInteracted {
4034
4035 enum Type {
4036 UNKNOWN = 0;
4037 CHIP_VIEWED = 1;
4038 CHIP_CLICKED = 2;
4039 DIALOG_PRIVACY_SETTINGS = 3;
4040 DIALOG_DISMISS = 4;
4041 DIALOG_LINE_ITEM = 5;
4042 }
4043
tsaichristine5adc7e02020-01-14 17:07:39 -08004044 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004045
4046 // Used if the type is LINE_ITEM
4047 optional string package_name = 2;
4048}
4049
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004050/**
4051 * Logs information about a package that is moved from the internal to external storage and vice
4052 * versa.
4053 * It logs the package name, the type of the external storage where the package is installed
4054 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4055 * and the move type: if it's from internal to external or the other way around.
4056 *
4057 * Logged from:
4058 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4059 */
4060message AppMovedStorageReported {
4061 enum MoveType {
4062 UNKNOWN = 0;
4063 TO_EXTERNAL = 1;
4064 TO_INTERNAL = 2;
4065 }
4066 // The type of the external storage.
4067 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4068 // The type of move.
4069 optional MoveType move_type = 2;
4070 // The name of the package that was moved.
4071 optional string package_name = 3;
4072}
4073
jianjin8f2dee02019-03-29 14:03:08 -07004074/**
4075 * Logs when system server watchdog occurs.
4076 * Logged from:
4077 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4078 */
4079message SystemServerWatchdogOccurred {
4080 optional string subject = 1;
4081}
4082
4083/**
4084 * Logs when new file added to tombstones.
4085 * Logged from:
4086 * frameworks/base/core/java/com/android/server/BootReceiver.java
4087 */
4088message TombStoneOccurred {
4089}
4090
Hai Zhang5d3328d2019-04-13 21:25:06 +08004091/*
4092 * Information about a role request
4093 *
4094 * Logged from:
4095 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4096 */
4097message RoleRequestResultReported {
4098 // UID of application requesting the role
4099 optional int32 requesting_uid = 1;
4100
4101 // Package name of application requesting the role
4102 optional string requesting_package_name = 2;
4103
4104 // The role to be granted
4105 optional string role_name = 3;
4106
4107 // The count of applications qualifying for the role
4108 optional int32 qualifying_count = 4;
4109
4110 // UID of application current granted the role
4111 optional int32 current_uid = 5;
4112
4113 // Package name of application current granted the role
4114 optional string current_package_name = 6;
4115
4116 // UID of another application that user chose to grant the role to, instead of the requesting
4117 // application
4118 optional int32 granted_another_uid = 7;
4119
4120 // Package name of another application that user chose to grant the role to, instead of the
4121 // requesting application
4122 optional string granted_another_package_name = 8;
4123
4124 enum Result {
4125 UNDEFINED = 0;
4126 // role request was ignored
4127 IGNORED = 1;
4128 // role request was ignored because it's already granted
4129 IGNORED_ALREADY_GRANTED = 2;
4130 // role request was ignored because the application isn't qualified
4131 IGNORED_NOT_QUALIFIED = 3;
4132 // role request was ignored because user said it should be always denied
4133 IGNORED_USER_ALWAYS_DENIED = 4;
4134 // role was granted by user action
4135 USER_GRANTED = 5;
4136 // role was denied by user action
4137 USER_DENIED = 6;
4138 // role was denied by user granting another application the role
4139 USER_DENIED_GRANTED_ANOTHER = 7;
4140 // role was denied and set to be always denied by the user
4141 USER_DENIED_WITH_ALWAYS = 8;
4142 }
4143 // The result of the role request
4144 optional Result result = 9;
4145}
4146
Mark Tabrya824a642019-11-05 12:26:12 -08004147/**
4148 * Logs when a Vehicle Maps Service client's connection state has changed
4149 *
4150 * Logged from:
4151 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4152 */
4153message VmsClientConnectionStateChanged {
4154 // The UID of the VMS client app
4155 optional int32 uid = 1 [(is_uid) = true];
4156
4157 enum State {
4158 UNKNOWN = 0;
4159 // Attempting to connect to the client
4160 CONNECTING = 1;
4161 // Client connection established
4162 CONNECTED = 2;
4163 // Client connection closed unexpectedly
4164 DISCONNECTED = 3;
4165 // Client connection closed by VMS
4166 TERMINATED = 4;
4167 // Error establishing the client connection
4168 CONNECTION_ERROR = 5;
4169 }
4170
4171 optional State state = 2;
4172}
4173
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004174/**
4175 * Logs when MediaProvider has successfully finished scanning a storage volume.
4176 *
4177 * Logged from:
4178 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4179 */
4180message MediaProviderScanEvent {
4181 enum Reason {
4182 // Scan triggered due to unknown reason
4183 UNKNOWN = 0;
4184 // Scan triggered due to storage volume being mounted
4185 MOUNTED = 1;
4186 // Scan triggered due to explicit user action or app request
4187 DEMAND = 2;
4188 // Scan triggered due to idle maintenance
4189 IDLE = 3;
4190 }
4191
4192 // Volume type that this event pertains to
4193 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4194 // Reason why this scan was triggered
4195 optional Reason reason = 2;
4196 // Total number of files scanned
4197 optional int64 item_count = 3;
4198 // Duration of scan, normalized per file
4199 optional float normalized_duration_millis = 4;
4200 // Number of database inserts, normalized per file
4201 optional float normalized_insert_count = 5;
4202 // Number of database updates, normalized per file
4203 optional float normalized_update_count = 6;
4204 // Number of database deletes, normalized per file
4205 optional float normalized_delete_count = 7;
4206}
4207
4208/**
4209 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4210 *
4211 * Logged from:
4212 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4213 */
4214message MediaProviderDeletionEvent {
4215 // Volume type that this event pertains to
4216 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4217 // Device timestamp when this deletion event occurred
4218 optional int64 timestamp_millis = 2;
4219 // App that requested deletion
4220 optional string package_name = 3;
4221 // Number of items that were deleted
4222 optional int32 item_count = 4;
4223}
4224
4225/**
4226 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4227 *
4228 * Logged from:
4229 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4230 */
4231message MediaProviderPermissionEvent {
4232 enum Result {
4233 UNKNOWN = 0;
4234 USER_GRANTED = 1;
4235 AUTO_GRANTED = 2;
4236 USER_DENIED = 3;
4237 USER_DENIED_WITH_PREJUDICE = 4;
4238 AUTO_DENIED = 5;
4239 }
4240
4241 // Volume type that this event pertains to
4242 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4243 // Device timestamp when this permission event occurred
4244 optional int64 timestamp_millis = 2;
4245 // App that requested permission
4246 optional string package_name = 3;
4247 // Number of items that were requested
4248 optional int32 item_count = 4;
4249 // Result of this request
4250 optional Result result = 5;
4251}
4252
4253/**
4254 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4255 *
4256 * Logged from:
4257 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4258 */
4259message MediaProviderSchemaChange {
4260 // Volume type that this event pertains to
4261 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4262 // Old database version code
4263 optional int32 version_from = 2;
4264 // New database version code
4265 optional int32 version_to = 3;
4266 // Total number of files in database
4267 optional int64 item_count = 4;
4268 // Duration of schema change, normalized per file
4269 optional float normalized_duration_millis = 5;
4270}
4271
4272/**
4273 * Logs when MediaProvider has finished an idle maintenance job.
4274 *
4275 * Logged from:
4276 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4277 */
4278message MediaProviderIdleMaintenance {
4279 // Volume type that this event pertains to
4280 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4281
4282 // Total number of files in database
4283 optional int64 item_count = 2;
4284 // Duration of idle maintenance, normalized per file
4285 optional float normalized_duration_millis = 3;
4286 // Number of thumbnails found to be stale, normalized per file
4287 optional float normalized_stale_thumbnails = 4;
4288 // Number of items found to be expired, normalized per file
4289 optional float normalized_expired_media = 5;
4290}
4291
Keun young Park3e033cb2019-12-18 11:27:35 -08004292/**
4293 * Represents boot time event with duration in ms.
4294 *
4295 * Logged from: bootstat and various system server components. Check each enums for details.
4296 */
4297message BootTimeEventDuration {
4298 enum DurationEvent {
4299 UNKNOWN = 0;
4300 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4301 ABSOLUTE_BOOT_TIME = 1;
4302 // Bootloader's 1st stage execution time.
4303 // Logged from bootstat.
4304 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4305 // Bootloader's 1st stage loading time.
4306 // Logged from bootstat.
4307 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4308 // Bootloader's kernel loading time.
4309 // Logged from bootstat.
4310 BOOTLOADER_KERNEL_LOAD = 4;
4311 // Bootloader's 2nd stage execution time.
4312 // Logged from bootstat.
4313 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4314 // Bootloader's 2nd stage loading time.
4315 // Logged from bootstat.
4316 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4317 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4318 // for locked device.
4319 // Logged from bootstat.
4320 BOOTLOADER_UI_WAIT = 7;
4321 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4322 // Logged from bootstat.
4323 BOOTLOADER_TOTAL = 8;
4324 // Shutdown duration inside init for the reboot before the current boot up.
4325 // Logged from f/b/services/.../BootReceiver.java.
4326 SHUTDOWN_DURATION = 9;
4327 // Total time for mounting of disk devices during bootup.
4328 // Logged from f/b/services/.../BootReceiver.java.
4329 MOUNT_DEFAULT_DURATION = 10;
4330 // Total time for early stage mounting of disk devices during bootup.
4331 // Logged from f/b/services/.../BootReceiver.java.
4332 MOUNT_EARLY_DURATION = 11;
4333 // Total time for late stage mounting of disk devices during bootup.
4334 // Logged from f/b/services/.../BootReceiver.java.
4335 MOUNT_LATE_DURATION = 12;
4336 // Average time to scan non-system app after OTA
4337 // Logged from f/b/services/.../PackageManagerService.java
4338 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4339 // Time to initialize Package manager after OTA
4340 // Logged from f/b/services/.../PackageManagerService.java
4341 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4342 // Time to scan all system app from Package manager after OTA
4343 // Logged from f/b/services/.../PackageManagerService.java
4344 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4345 // Init's total time for cold boot stage.
4346 // Logged from bootstat.
4347 COLDBOOT_WAIT = 16;
4348 // Init's total time for initializing selinux.
4349 // Logged from bootstat.
4350 SELINUX_INIT = 17;
4351 // Time since last factory reset.
4352 // Logged from bootstat.
4353 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004354 // Init's total time spent for completing the 1st stage.
4355 // Logged from bootstat.
4356 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004357 }
4358
4359 // Type of the event.
4360 optional DurationEvent event = 1;
4361 // Duration of the event in ms.
4362 optional int64 duration_millis = 2;
4363}
4364
4365/**
4366 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4367 * since boot-up.
4368 *
4369 * Logged from: bootstat and various system server components. Check each enums for details.
4370 */
4371message BootTimeEventElapsedTime {
4372 enum ElapsedTimeEvent {
4373 UNKNOWN = 0;
4374 // Time when init starts 1st stage. Logged from bootstat.
4375 ANDROID_INIT_STAGE_1 = 1;
4376 // Time when sys.boot_completed prop is set.
4377 // Logged from bootstat.
4378 BOOT_COMPLETE = 2;
4379 // BOOT_COMPLETE for encrypted device.
4380 BOOT_COMPLETE_ENCRYPTION = 3;
4381 // BOOT_COMPLETE for device with no encryption.
4382 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4383 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004384 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004385 // BOOT_COMPLETE after factory reset.
4386 FACTORY_RESET_BOOT_COMPLETE = 6;
4387 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4388 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004389 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4390 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004391 // BOOT_COMPLETE after OTA.
4392 OTA_BOOT_COMPLETE = 9;
4393 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4394 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004395 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4396 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004397 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4398 // Logged from f/b/services/.../UserController.java
4399 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4400 // Time when the system starts sending BOOT_COMPLETED broadcast.
4401 // Logged from f/b/services/.../UserController.java
4402 FRAMEWORK_BOOT_COMPLETED = 13;
4403 // Time when the package manager starts init.
4404 // Logged from f/b/services/.../SystemServer.java
4405 PACKAGE_MANAGER_INIT_START = 14;
4406 // Time when package manager is ready
4407 // Logged from f/b/services/.../SystemServer.java
4408 PACKAGE_MANAGER_INIT_READY = 15;
4409 // Represents the time when user has entered unlock credential for system with user pin.
4410 // Logged from bootstat.
4411 POST_DECRYPT = 16;
4412 // Represents the start of zygote's init.
4413 // Logged from zygote itself.
4414 ZYGOTE_INIT_START = 17;
4415 // Represents the start of secondary zygote's init.
4416 // TODO: add logging to zygote
4417 SECONDARY_ZYGOTE_INIT_START = 18;
4418 // Represents the start of system server's init.
4419 // Logged from f/b/services/.../SystemServer.java
4420 SYSTEM_SERVER_INIT_START = 19;
4421 // Represents the completion of system server's init.
4422 // Logged from f/b/services/.../SystemServer.java
4423 SYSTEM_SERVER_READY = 20;
4424 // Represents the start of launcher during boot-up.
4425 // TODO: add logging
4426 LAUNCHER_START = 21;
4427 // Represents the completion of launcher's initial rendering. User can use other apps from
4428 // launcher from this point.
4429 // TODO: add logging
4430 LAUNCHER_SHOWN = 22;
4431 }
4432
4433 // Type of the event.
4434 optional ElapsedTimeEvent event = 1;
4435 // Time since bootup for the event.
4436 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4437 optional int64 time_millis = 2;
4438}
4439
4440/**
4441 * Boot time events with UTC time.
4442 *
4443 * Logged from: bootstat and various system server components. Check each enums for details.
4444 */
4445message BootTimeEventUtcTime {
4446 enum UtcTimeEvent {
4447 UNKNOWN = 0;
4448 // Time of the bootstat's marking of 1st boot after the last factory reset.
4449 // Logged from bootstat.
4450 FACTORY_RESET_RESET_TIME = 1;
4451 // The time when bootstat records FACTORY_RESET_* events. This is close to
4452 // BOOT_COMPLETE time for the current bootup.
4453 // Logged from bootstat.
4454 FACTORY_RESET_CURRENT_TIME = 2;
4455 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4456 // Logged from bootstat.
4457 FACTORY_RESET_RECORD_VALUE = 3;
4458 }
4459
4460 // Type of the event.
4461 optional UtcTimeEvent event = 1;
4462 // UTC time for the event.
4463 optional int64 utc_time_secs = 2;
4464}
4465
4466/**
4467 * Boot time events representing specific error code during bootup.
4468 * Meaning of error code can be different per each event type.
4469 *
4470 * Logged from: bootstat and various system server components. Check each enums for details.
4471 */
4472message BootTimeEventErrorCode {
4473 enum ErrorCodeEvent {
4474 UNKNOWN = 0;
4475 // Linux error code for time() call to get the current UTC time.
4476 // Logged from bootstat.
4477 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4478 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4479 // as UMOUNT_STAT_* from init/reboot.cpp.
4480 // Logged from f/b/services/.../BootReceiver.java.
4481 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004482 // Reprepsents fie system mounting error code of /data partition for the current boot.
4483 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004484 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004485 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004486 }
4487
4488 // Type of the event.
4489 optional ErrorCodeEvent event = 1;
4490 // error code defined per each event type.
4491 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4492 // FS_MGR_FS_STAT.
4493 optional int32 error_code = 2;
4494}
4495
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004496/**
4497 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4498 * after an OTA.
4499 *
4500 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004501 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004502 */
4503message SnapshotMergeReported {
4504 // Keep in sync with
4505 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4506 enum UpdateState {
4507 // No update or merge is in progress.
4508 NONE = 0;
4509 // An update is applying; snapshots may already exist.
4510 INITIATED = 1;
4511 // An update is pending, but has not been successfully booted yet.
4512 UNVERIFIED = 2;
4513 // The kernel is merging in the background.
4514 MERGING = 3;
4515 // Post-merge cleanup steps could not be completed due to a transient
4516 // error, but the next reboot will finish any pending operations.
4517 MERGE_NEEDS_REBOOT = 4;
4518 // Merging is complete, and needs to be acknowledged.
4519 MERGE_COMPLETED = 5;
4520 // Merging failed due to an unrecoverable error.
4521 MERGE_FAILED = 6;
4522 // The update was implicitly cancelled, either by a rollback or a flash
4523 // operation via fastboot. This state can only be returned by WaitForMerge.
4524 CANCELLED = 7;
4525 };
4526
4527 // Status of the update after the merge attempts.
4528 optional UpdateState final_state = 1;
4529
4530 // Time to complete a merge operation in milliseconds.
4531 // A negative value corresponds to the case in which the merge operation
4532 // was interrupted and resumed (e.g. in case of a system reboot during the
4533 // merge).
4534 optional int64 duration_millis = 2;
4535
4536 // Number of reboots that occurred after issuing and before completing the
4537 // merge of all the snapshot devices.
4538 optional int32 intermediate_reboots = 3;
4539}
4540
Chenjie Yubbcbc602018-02-05 16:51:52 -08004541//////////////////////////////////////////////////////////////////////
4542// Pulled atoms below this line //
4543//////////////////////////////////////////////////////////////////////
4544
4545/**
David Chenc8a43242017-10-17 16:23:28 -07004546 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4547 *
4548 * Pulled from:
4549 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4550 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004551message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004552 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004553
4554 optional int64 rx_bytes = 2;
4555
4556 optional int64 rx_packets = 3;
4557
4558 optional int64 tx_bytes = 4;
4559
4560 optional int64 tx_packets = 5;
4561}
4562
4563/**
4564 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4565 *
4566 * Pulled from:
4567 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4568 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004569message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004570 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004571
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004572 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4573 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004574
4575 optional int64 rx_bytes = 3;
4576
4577 optional int64 rx_packets = 4;
4578
4579 optional int64 tx_bytes = 5;
4580
4581 optional int64 tx_packets = 6;
4582}
4583
4584/**
4585 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4586 *
4587 * Pulled from:
4588 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4589 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004590message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004591 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004592
4593 optional int64 rx_bytes = 2;
4594
4595 optional int64 rx_packets = 3;
4596
4597 optional int64 tx_bytes = 4;
4598
4599 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004600
4601 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004602}
4603
4604/**
4605 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4606 *
4607 * Pulled from:
4608 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4609 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004610message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004611 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004612
Yao Chenc40a19d2018-03-15 16:48:25 -07004613 // 1 denotes foreground and 0 denotes background. This is called Set in
4614 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004615 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004616
4617 optional int64 rx_bytes = 3;
4618
4619 optional int64 rx_packets = 4;
4620
4621 optional int64 tx_bytes = 5;
4622
4623 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004624
4625 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004626}
4627
4628/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004629 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4630 *
4631 * Pulled from:
4632 * StatsCompanionService
4633 */
4634message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004635 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004636
4637 optional int64 rx_bytes = 2;
4638
4639 optional int64 tx_bytes = 3;
4640}
4641
4642/**
David Chenc8a43242017-10-17 16:23:28 -07004643 * Pulls the kernel wakelock durations. This atom is adapted from
4644 * android/internal/os/KernelWakelockStats.java
4645 *
4646 * Pulled from:
4647 * StatsCompanionService using KernelWakelockReader.
4648 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004649message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004650 optional string name = 1;
4651
4652 optional int32 count = 2;
4653
4654 optional int32 version = 3;
4655
Yangster-maca8a30442018-10-13 23:46:34 -07004656 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004657}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004658
Chenjie Yu05013b32017-11-21 10:21:41 -08004659/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004660 * Pulls low power state information. If power.stats HAL is not available, this
4661 * includes platform and subsystem sleep state information,
4662 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4663 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004664 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004665 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004666 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4667 * as defined in:
4668 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004669 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004670message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004671 // Subsystem name
4672 optional string subsystem_name = 1;
4673 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4674 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004675 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4676 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004677 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004678 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004679 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004680 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004681 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004682}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004683
Chenjie Yu05013b32017-11-21 10:21:41 -08004684/**
Bookatz92da2832018-11-01 18:10:03 -07004685 * Pulls on-device power measurement information.
4686 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4687 * Pulled from:
4688 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4689 */
4690message OnDevicePowerMeasurement {
4691 // Name of the subsystem (to which the rail belongs).
4692 optional string subsystem_name = 1;
4693
4694 // Rail name. The rail lies within the subsystem.
4695 optional string rail_name = 2;
4696
4697 // Time (in ms since boot) at which the rail energy value was measured.
4698 // This may differ slightly from the time that statsd logs this information.
4699 optional uint64 measurement_timestamp_millis = 3;
4700
4701 // Accumulated energy used via the rail since device boot in uWs.
4702 optional uint64 energy_microwatt_secs = 4;
4703}
4704
4705/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004706 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004707 * Pulls the time the cpu spend on the frequency index. Frequency index
4708 * starts from highest to lowest. The value should be monotonically
4709 * increasing since boot. However, if there is a cpu
4710 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004712message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004713 optional uint32 cluster = 1;
4714 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004715 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004716}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004717
Chenjie Yu05013b32017-11-21 10:21:41 -08004718/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004719 * Pulls Cpu Time Per Uid.
4720 * Note that isolated process uid time should be attributed to host uids.
4721 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004722message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004723 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004724 optional uint64 user_time_micros = 2;
4725 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004726}
4727
4728/**
4729 * Pulls Cpu Time Per Uid per frequency.
4730 * Note that isolated process uid time should be attributed to host uids.
4731 * For each uid, we order the time by descending frequencies.
4732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004733message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004734 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004735 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004736 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004737}
Hugo Benichi884970e2017-11-14 22:42:46 +09004738
Chenjie Yu05013b32017-11-21 10:21:41 -08004739/**
4740 * Pulls Wifi Controller Activity Energy Info
4741 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004742message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004743 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004744 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004745 // stack reported state
4746 // TODO: replace this with proto enum
4747 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004748 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004749 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004750 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004751 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004752 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004753 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004754 // product of current(mA), voltage(V) and time(ms)
4755 optional uint64 controller_energy_used = 6;
4756}
4757
4758/**
4759 * Pulls Modem Activity Energy Info
4760 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004761message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004762 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004763 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004764 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004765 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004766 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004767 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004768 /**
4769 * Tx power index
4770 * index 0 = tx_power < 0dBm
4771 * index 1 = 0dBm < tx_power < 5dBm
4772 * index 2 = 5dBm < tx_power < 15dBm
4773 * index 3 = 15dBm < tx_power < 20dBm
4774 * index 4 = tx_power > 20dBm
4775 */
4776 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004777 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004778 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004779 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004780 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004781 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004782 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004783 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004784 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004785 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004786 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004787 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004788 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004789 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004790}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004791
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004792/**
4793 * Pulls Bluetooth Activity Energy Info
4794 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4795 */
4796message BluetoothActivityInfo {
4797 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004798 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004799 // bluetooth stack state
4800 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004801 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004802 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004803 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004804 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004805 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004806 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004807 // product of current(mA), voltage(V) and time(ms)
4808 optional uint64 energy_used = 6;
4809}
4810
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004811/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004812 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004813 *
4814 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004815 */
4816message ProcessMemoryState {
4817 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004818 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004819
4820 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004821 // Usually package name, "system" for system server.
4822 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004823 optional string process_name = 2;
4824
Rafal Slawikda51b932018-12-13 16:31:33 +00004825 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004826 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004827
4828 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004829 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004830
4831 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004832 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004833
Rajeev Kumar90235992018-01-29 11:06:48 -08004834 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004835 // Value is read from memory.stat, field total_rss if per-app memory
4836 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004837 optional int64 rss_in_bytes = 6;
4838
4839 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004840 // Value is read from memory.stat, field total_cache if per-app memory
4841 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004842 optional int64 cache_in_bytes = 7;
4843
4844 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004845 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004846 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004847 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004848
Rafal Slawik203c3db2019-09-25 19:53:01 +01004849 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004850 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004851
Rafal Slawik203c3db2019-09-25 19:53:01 +01004852 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4853 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004854
Rafal Slawik203c3db2019-09-25 19:53:01 +01004855 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4856 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004857}
4858
4859/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004860 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004861 *
4862 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4863 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004864 *
4865 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004866 */
4867message ProcessMemoryHighWaterMark {
4868 // The uid if available. -1 means not available.
4869 optional int32 uid = 1 [(is_uid) = true];
4870
Rafal Slawikda51b932018-12-13 16:31:33 +00004871 // The process name.
4872 // Usually package name or process cmdline.
4873 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004874 optional string process_name = 2;
4875
Rafal Slawik239b6802019-09-09 18:46:01 +01004876 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4877 // computed by converting kilobytes to bytes.
4878 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4879
Rafal Slawik3bea8952018-11-15 12:39:33 +00004880 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4881 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004882 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004883}
4884
4885/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004886 * Logs the memory stats for a process.
4887 *
4888 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4889 * and for selected native processes.
4890 */
4891message ProcessMemorySnapshot {
4892 // The uid if available. -1 means not available.
4893 optional int32 uid = 1 [(is_uid) = true];
4894
4895 // The process name.
4896 // Usually package name or process cmdline.
4897 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4898 optional string process_name = 2;
4899
4900 // The pid of the process.
4901 // Allows to disambiguate instances of the process.
4902 optional int32 pid = 3;
4903
4904 // The current OOM score adjustment value.
4905 // Read from ProcessRecord for managed processes.
4906 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4907 optional int32 oom_score_adj = 4;
4908
4909 // The current RSS of the process.
4910 // VmRSS from /proc/pid/status.
4911 optional int32 rss_in_kilobytes = 5;
4912
4913 // The current anon RSS of the process.
4914 // RssAnon from /proc/pid/status.
4915 optional int32 anon_rss_in_kilobytes = 6;
4916
4917 // The current swap size of the process.
4918 // VmSwap from /proc/pid/status.
4919 optional int32 swap_in_kilobytes = 7;
4920
4921 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4922 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4923}
4924
4925/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004926 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004927 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004928message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004929 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004930}
4931
4932/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004933 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004934 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004935message SystemUptime {
4936 // Milliseconds since the system was booted.
4937 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4938 // for external input).
4939 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004940 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004941}
4942
4943/*
4944 * Reads from /proc/uid_concurrent_active_time which has the format:
4945 * active: X (X is # cores)
4946 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4947 * [uid1]: [time-0] [time-1] [time-2] ... ...
4948 * ...
4949 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4950 * The file contains a monotonically increasing count of time for a single boot.
4951 */
4952message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004953 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004954 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004955}
4956
4957/**
4958 * Reads from /proc/uid_concurrent_policy_time which has the format:
4959 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4960 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4961 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4962 * ...
4963 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4964 * The file contains a monotonically increasing count of time for a single boot.
4965 */
4966message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004967 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004968 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004969 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004970}
4971
4972/*
4973 * Pulls free disk space, for data, system partition and temporary directory.
4974 */
4975message DiskSpace {
4976 // available bytes in data partition
4977 optional uint64 data_available_bytes = 1;
4978 // available bytes in system partition
4979 optional uint64 system_available_bytes = 2;
4980 // available bytes in download cache or temp directories
4981 optional uint64 temp_available_bytes = 3;
4982}
Tej Singhbf972d92018-01-10 20:51:13 -08004983
4984/**
4985 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004986 *
4987 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004988 */
4989message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004990 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004991}
4992
4993/**
4994 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004995 * Pulled from:
4996 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004997 */
4998message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004999 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005000}
5001
5002/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005003 * Pulls battery voltage.
5004 * Pulled from:
5005 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5006 */
5007message BatteryVoltage {
5008 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005009 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005010}
5011
5012/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005013 * Pulls battery level (percent full, from 0 to 100).
5014 *
5015 * Pulled from:
5016 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5017 */
5018message BatteryLevel {
5019 // Battery level. Should be in [0, 100].
5020 optional int32 battery_level = 1;
5021}
5022
5023/**
Tej Singhd89137e2018-03-26 14:51:40 -07005024 * Pulls the temperature of various parts of the device.
5025 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005026 *
Maggie White442b6312019-04-05 16:26:44 -07005027 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005028 */
5029message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005030 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005031 optional android.os.TemperatureTypeEnum sensor_location = 1;
5032
5033 // The name of the temperature source. Eg. CPU0
5034 optional string sensor_name = 2;
5035
Tej Singhd89137e2018-03-26 14:51:40 -07005036 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005037 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005038 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005039
5040 // Relative severity of the throttling, see enum definition.
5041 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005042}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005043
5044/**
5045 * Pulls the statistics of calls to Binder.
5046 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005047 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5048 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005049 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005050 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005051 */
5052message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005053 // UID of the process responsible for the binder transaction. It will be set if the process
5054 // executing the binder transaction attribute the transaction to another uid using
5055 // Binder.setThreadWorkSource().
5056 //
5057 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005058 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005059 // UID of the process executing the binder transaction.
5060 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005061 // Fully qualified class name of the API call.
5062 //
5063 // This is a system server class name.
5064 //
5065 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5066 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5067 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5068 // commonly used APIs.
5069 optional string service_class_name = 2;
5070 // Method name of the API call. It can also be a transaction code if we cannot
5071 // resolve it to a name. See Binder#getTransactionName.
5072 //
5073 // This is a system server method name.
5074 optional string service_method_name = 3;
5075 // Total number of API calls.
5076 optional int64 call_count = 4;
5077 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5078 optional bool screen_interactive = 13;
5079 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5080 // call_count will be equal to recorded_call_count.
5081 //
5082 // If recorded_call_count is different than call_count, it means data collection has been
5083 // sampled. All the fields below will be sampled in this case.
5084 optional int64 recorded_call_count = 12;
5085 // Number of exceptions thrown by the API.
5086 optional int64 recorded_exception_count = 5;
5087 // Total latency of all API calls.
5088 // Average can be computed using total_latency_micros / recorded_call_count.
5089 optional int64 recorded_total_latency_micros = 6;
5090 // Maximum latency of one API call.
5091 optional int64 recorded_max_latency_micros = 7;
5092 // Total CPU usage of all API calls.
5093 // Average can be computed using total_cpu_micros / recorded_call_count.
5094 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5095 optional int64 recorded_total_cpu_micros = 8;
5096 // Maximum CPU usage of one API call.
5097 optional int64 recorded_max_cpu_micros = 9;
5098 // Maximum parcel reply size of one API call.
5099 optional int64 recorded_max_reply_size_bytes = 10;
5100 // Maximum parcel request size of one API call.
5101 optional int64 recorded_max_request_size_bytes = 11;
5102}
5103
5104/**
5105 * Pulls the statistics of exceptions during calls to Binder.
5106 *
5107 * Binder stats are cumulative from boot unless somebody reset the data using
5108 * > adb shell dumpsys binder_calls_stats --reset
5109 */
5110message BinderCallsExceptions {
5111 // Exception class name, e.g. java.lang.IllegalArgumentException.
5112 //
5113 // This is an exception class name thrown by the system server.
5114 optional string exception_class_name = 1;
5115 // Total number of exceptions.
5116 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005117}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005118
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005119/**
5120 * Pulls the statistics of message dispatching on HandlerThreads.
5121 *
5122 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5123 * config on the device.
5124 *
5125 * Next tag: 11
5126 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005127message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005128 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005129 optional int32 uid = 1 [(is_uid) = true];
5130
5131 // Fully qualified class name of the handler target class.
5132 //
5133 // This field does not contain PII. This is a system server class name.
5134 optional string handler_class_name = 2;
5135
5136 // The name of the thread that runs the Looper.
5137 //
5138 // This field does not contain PII. This is a system server thread name.
5139 optional string looper_thread_name = 3;
5140
5141 // The name of the dispatched message.
5142 //
5143 // This field does not contain PII. This is a system server constant or class
5144 // name.
5145 optional string message_name = 4;
5146
5147 // Total number of successfully dispatched messages.
5148 optional int64 message_count = 5;
5149
5150 // Total number of messages that failed dispatching.
5151 optional int64 exception_count = 6;
5152
5153 // Total number of processed messages we have data recorded for. If we
5154 // collected data for all the messages, message_count will be equal to
5155 // recorded_message_count.
5156 //
5157 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005158 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005159 optional int64 recorded_message_count = 7;
5160
5161 // Total latency of all processed messages.
5162 // Average can be computed using recorded_total_latency_micros /
5163 // recorded_message_count.
5164 optional int64 recorded_total_latency_micros = 8;
5165
5166 // Total CPU usage of all processed message.
5167 // Average can be computed using recorded_total_cpu_micros /
5168 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005169 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005170 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005171
5172 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5173 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005174
5175 // Max recorded CPU usage of all processed messages.
5176 optional int64 recorded_max_cpu_micros = 11;
5177
5178 // Max recorded latency of all processed messages.
5179 optional int64 recorded_max_latency_micros = 12;
5180
5181 // Total number of messages we tracked the dispatching delay for. If we
5182 // collected data for all the messages, message_count will be equal to
5183 // recorded_delay_message_count.
5184 //
5185 // If recorded_delay_message_count is different than message_count, it means data
5186 // collection has been sampled or/and not all messages specified the target dispatch time.
5187 // The fields below will be sampled in this case.
5188 optional int64 recorded_delay_message_count = 13;
5189
5190 // Total dispatching delay of all processed messages.
5191 // Calculated as a difference between the target dispatching time (Message.when)
5192 // and the actual dispatching time.
5193 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5194 optional int64 recorded_total_delay_millis = 14;
5195
5196 // Max dispatching delay of all processed messages.
5197 // Calculated as a difference between the target dispatching time (Message.when)
5198 // and the actual dispatching time.
5199 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005200}
Tej Singh86dc9db2018-09-06 00:39:57 +00005201
5202/**
5203 * Pulls disk information, such as write speed and latency.
5204 */
5205message DiskStats {
5206 // Time taken to open, write 512B to, and close a file.
5207 // -1 if error performing the check.
5208 optional int64 data_write_latency_millis = 1;
5209
5210 optional bool file_based_encryption = 2;
5211
5212 // Recent disk write speed in kB/s.
5213 // -1 if error querying storageed.
5214 // 0 if data is unavailable.
5215 optional int32 recent_disk_write_speed = 3;
5216}
5217
5218
5219/**
5220 * Free and total bytes of the Data, Cache, and System partition.
5221 */
5222message DirectoryUsage {
5223 enum Directory {
5224 UNKNOWN = 0;
5225 DATA = 1;
5226 CACHE = 2;
5227 SYSTEM = 3;
5228 }
5229 optional Directory directory = 1;
5230 optional int64 free_bytes = 2;
5231 optional int64 total_bytes = 3;
5232}
5233
5234
5235/**
5236 * Size of an application: apk size, data size, and cache size.
5237 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5238 * Information is only reported for apps with the primary user (user 0).
5239 * Sizes are aggregated by package name.
5240 */
5241message AppSize {
5242 // Including uids will involve modifying diskstats logic.
5243 optional string package_name = 1;
5244 // App size in bytes. -1 if unavailable.
5245 optional int64 app_size_bytes = 2;
5246 // App data size in bytes. -1 if unavailable.
5247 optional int64 app_data_size_bytes = 3;
5248 // App cache size in bytes. -1 if unavailable.
5249 optional int64 app_cache_size_bytes = 4;
5250 // Time that the cache file was produced.
5251 // Uses System.currentTimeMillis(), which is wall clock time.
5252 optional int64 cache_time_millis = 5;
5253}
5254
5255
5256/**
5257 * Size of a particular category. Eg: photos, videos.
5258 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5259 */
5260message CategorySize {
5261 enum Category {
5262 UNKNOWN = 0;
5263 APP_SIZE = 1;
5264 APP_DATA_SIZE = 2;
5265 APP_CACHE_SIZE = 3;
5266 PHOTOS = 4;
5267 VIDEOS = 5;
5268 AUDIO = 6;
5269 DOWNLOADS = 7;
5270 SYSTEM = 8;
5271 OTHER = 9;
5272 }
5273 optional Category category = 1;
5274 // Category size in bytes.
5275 optional int64 size_bytes = 2;
5276 // Time that the cache file was produced.
5277 // Uses System.currentTimeMillis(), which is wall clock time.
5278 optional int64 cache_time_millis = 3;
5279}
Tej Singhd6d6d772018-09-05 17:41:25 -07005280
5281/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005282 * Pulls per uid I/O stats. The stats are cumulative since boot.
5283 *
5284 * Read/write bytes are I/O events from a storage device
5285 * Read/write chars are data requested by read/write syscalls, and can be
5286 * satisfied by caching.
5287 *
5288 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5289 */
5290message DiskIo {
5291 optional int32 uid = 1 [(is_uid) = true];
5292 optional int64 fg_chars_read = 2;
5293 optional int64 fg_chars_write = 3;
5294 optional int64 fg_bytes_read = 4;
5295 optional int64 fg_bytes_write = 5;
5296 optional int64 bg_chars_read = 6;
5297 optional int64 bg_chars_write = 7;
5298 optional int64 bg_bytes_read = 8;
5299 optional int64 bg_bytes_write = 9;
5300 optional int64 fg_fsync = 10;
5301 optional int64 bg_fsync= 11;
5302}
5303
5304
5305/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005306 * Pulls the number of fingerprints for each user.
5307 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005308 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005309 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005310message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005311 // The associated user. Eg: 0 for owners, 10+ for others.
5312 // Defined in android/os/UserHandle.java
5313 optional int32 user = 1;
5314 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005315 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005316}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005317
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005318/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005319 * Pulls the number of faces for each user.
5320 *
5321 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5322 */
5323message NumFacesEnrolled {
5324 // The associated user. Eg: 0 for owners, 10+ for others.
5325 // Defined in android/os/UserHandle.java
5326 optional int32 user = 1;
5327 // Number of faces registered to that user.
5328 optional int32 num_faces_enrolled = 2;
5329}
5330/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005331 * A mapping of role holder -> role
5332 */
5333message RoleHolder {
5334 // uid of the role holder
5335 optional int32 uid = 1 [(is_uid) = true];
5336
5337 // package name of the role holder
5338 optional string package_name = 2;
5339
5340 // the role held
5341 optional string role = 3;
5342}
5343
Yangsteraf9aee72018-10-12 09:26:16 -07005344message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005345 // These are all in byte resolution.
5346 optional int64 min = 1 [deprecated = true];
5347 optional int64 average = 2 [deprecated = true];
5348 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005349
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005350 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5351 // int64 fields.
5352 optional int32 mean_kb = 4;
5353 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005354}
5355
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005356// A reduced subset of process states; reducing the number of possible states allows more
5357// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5358enum ProcessStateAggregated {
5359 PROCESS_STATE_UNKNOWN = 0;
5360 // Persistent system process.
5361 PROCESS_STATE_PERSISTENT = 1;
5362 // Top activity; actually any visible activity.
5363 PROCESS_STATE_TOP = 2;
5364 // Process binding to top or a foreground service.
5365 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5366 // Processing running a foreground service.
5367 PROCESS_STATE_FGS = 4;
5368 // Important foreground process (ime, wallpaper, etc).
5369 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5370 // Important background process.
5371 PROCESS_STATE_BACKGROUND = 6;
5372 // Process running a receiver.
5373 PROCESS_STATE_RECEIVER = 7;
5374 // All kinds of cached processes.
5375 PROCESS_STATE_CACHED = 8;
5376}
5377
5378// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005379message ProcessStatsStateProto {
5380 optional android.service.procstats.ScreenState screen_state = 1;
5381
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005382 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005383
5384 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5385 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005386 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5387
5388 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005389
5390 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005391 optional int64 duration_millis = 4 [deprecated = true];
5392 // Same as above, but with minute resolution so it fits into an int32.
5393 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005394
5395 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005396 optional int64 realtime_duration_millis = 9 [deprecated = true];
5397 // Same as above, but with minute resolution so it fits into an int32.
5398 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005399
5400 // # of samples taken
5401 optional int32 sample_size = 5;
5402
5403 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005404 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005405
5406 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005407 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005408
5409 // RSS is memory resident for this process
5410 optional AggStats rss = 8;
5411}
5412
5413// Next Tag: 7
5414message ProcessStatsProto {
5415 // Name of process.
5416 optional string process = 1;
5417
5418 // Uid of the process.
5419 optional int32 uid = 2;
5420
5421 // Information about how often kills occurred
5422 message Kill {
5423 // Count of excessive CPU kills
5424 optional int32 cpu = 1;
5425
5426 // Count of kills when cached
5427 optional int32 cached = 2;
5428
5429 // PSS stats during cached kill
5430 optional AggStats cached_pss = 3;
5431 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005432 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005433
5434 // Time and memory spent in various states.
5435 repeated ProcessStatsStateProto states = 5;
5436
5437 // Total time process has been running... screen_state, memory_state, and process_state
5438 // will not be set.
5439 optional ProcessStatsStateProto total_running_state = 6;
5440}
5441
5442message PackageServiceOperationStatsProto {
5443 // Operate enum: Started, Foreground, Bound, Executing
5444 optional android.service.procstats.ServiceOperationState operation = 1;
5445
5446 // Number of times the service was in this operation.
5447 optional int32 count = 2;
5448
5449 // Information about a state the service can be in.
5450 message StateStats {
5451 // Screen state enum.
5452 optional android.service.procstats.ScreenState screen_state = 1;
5453 // Memory state enum.
5454 optional android.service.procstats.MemoryState memory_state = 2;
5455
5456 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005457 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005458 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005459 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005460 }
5461 repeated StateStats state_stats = 3;
5462}
5463
5464message PackageServiceStatsProto {
5465 // Name of service component.
5466 optional string service_name = 1;
5467
5468 // The operation stats.
5469 // The package_name, package_uid, package_version, service_name will not be set to save space.
5470 repeated PackageServiceOperationStatsProto operation_stats = 2;
5471}
5472
5473message PackageAssociationSourceProcessStatsProto {
5474 // Uid of the process.
5475 optional int32 process_uid = 1;
5476 // Process name.
5477 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005478 // Package name.
5479 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005480 // Total count of the times this association appeared.
5481 optional int32 total_count = 3;
5482
5483 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005484 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005485
5486 // Total count of the times this association became actively impacting its target process.
5487 optional int32 active_count = 5;
5488
5489 // Information on one source in this association.
5490 message StateStats {
5491 // Process state enum.
5492 optional android.service.procstats.ProcessState process_state = 1;
5493 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005494 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005495 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005496 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005497 }
5498 repeated StateStats active_state_stats = 6;
5499}
5500
5501message PackageAssociationProcessStatsProto {
5502 // Name of the target component.
5503 optional string component_name = 1;
5504 // Information on one source in this association.
5505 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5506}
5507
5508
5509message ProcessStatsPackageProto {
5510 // Name of package.
5511 optional string package = 1;
5512
5513 // Uid of the package.
5514 optional int32 uid = 2;
5515
5516 // Version of the package.
5517 optional int64 version = 3;
5518
5519 // Stats for each process running with the package loaded in to it.
5520 repeated ProcessStatsProto process_stats = 4;
5521
5522 // Stats for each of the package's services.
5523 repeated PackageServiceStatsProto service_stats = 5;
5524
5525 // Stats for each association with the package.
5526 repeated PackageAssociationProcessStatsProto association_stats = 6;
5527}
5528
5529message ProcessStatsSectionProto {
5530 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005531 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005532
5533 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005534 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005535
5536 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005537 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005538
5539 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005540 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005541
5542 // System runtime library. e.g. "libdvm.so", "libart.so".
5543 optional string runtime = 5;
5544
5545 // whether kernel reports swapped pss.
5546 optional bool has_swapped_pss = 6;
5547
5548 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5549 enum Status {
5550 STATUS_UNKNOWN = 0;
5551 STATUS_COMPLETE = 1;
5552 STATUS_PARTIAL = 2;
5553 STATUS_SHUTDOWN = 3;
5554 STATUS_SYSPROPS = 4;
5555 }
5556 repeated Status status = 7;
5557
Chenjie Yub2ecc792019-01-17 10:27:26 -08005558 // Number of pages available of various types and sizes, representation fragmentation.
5559 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5560
Yangsteraf9aee72018-10-12 09:26:16 -07005561 // Stats for each process.
5562 repeated ProcessStatsProto process_stats = 8;
5563
5564 // Stats for each package.
5565 repeated ProcessStatsPackageProto package_stats = 9;
5566}
5567
Chenjie Yub2ecc792019-01-17 10:27:26 -08005568message ProcessStatsAvailablePagesProto {
5569 // Node these pages are in (as per /proc/pagetypeinfo)
5570 optional int32 node = 1;
5571
5572 // Zone these pages are in (as per /proc/pagetypeinfo)
5573 optional string zone = 2;
5574
5575 // Label for the type of these pages (as per /proc/pagetypeinfo)
5576 optional string label = 3;
5577
5578 // Distribution of number of pages available by order size. First entry in array is
5579 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5580 repeated int32 pages_per_order = 4;
5581}
5582
Chenjie Yu12e5e672018-09-14 15:54:59 -07005583/**
5584 * Pulled from ProcessStatsService.java
5585 */
5586message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005587 optional ProcessStatsSectionProto proc_stats_section = 1;
5588}
5589
Chenjie Yuf910b7802019-01-11 16:08:20 -08005590/**
5591 * Pulled from ProcessStatsService.java
5592 */
5593message ProcStatsPkgProc {
5594 optional ProcessStatsSectionProto proc_stats_section = 1;
5595}
5596
Chris Wrencdea3b72019-11-22 16:58:17 -05005597// Next Tag: 2
5598message PackageRemoteViewInfoProto {
5599 optional string package_name = 1;
5600 // add per-package additional info here (like channels)
5601}
5602
5603// Next Tag: 2
5604message NotificationRemoteViewsProto {
5605 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5606}
5607
5608/**
5609 * Pulled from NotificationManagerService.java
5610 */
5611message NotificationRemoteViews {
5612 optional NotificationRemoteViewsProto notification_remote_views = 1;
5613}
5614
Yotam Aron74299972020-01-16 16:20:58 +02005615/**
5616 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5617 */
5618message PackageNotificationPreferences {
5619 // Uid under which the package is installed.
5620 optional int32 uid = 1;
5621 // Notification importance, which specifies when and how a notification is displayed.
5622 // Specified under core/java/android/app/NotificationManager.java.
5623 optional int32 importance = 2;
5624 // Lockscreen visibility as set by the user.
5625 optional int32 visibility = 3;
5626 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5627 // PreferencesHelper.java)
5628 optional int32 user_locked_fields = 4;
5629}
5630
5631/**
5632 * Atom that contains a list of a package's channel preferences, pulled from
5633 * NotificationManagerService.java.
5634 */
5635message PackageNotificationChannelPreferences {
5636 // Uid under which the package is installed.
5637 optional int32 uid = 1;
5638 // Channel's ID. Should always be available.
5639 optional string channel_id = 2;
5640 // Channel's name. Should always be available.
5641 optional string channel_name = 3;
5642 // Channel's description. Optionally set by the channel creator.
5643 optional string description = 4;
5644 // Notification importance, which specifies when and how a notification is displayed. Specified
5645 // under core/java/android/app/NotificationManager.java.
5646 optional int32 importance = 5;
5647 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5648 // at core/java/android/app/NotificationChannel.java
5649 optional int32 user_locked_fields = 6;
5650 // Indicates if the channel was deleted by the app.
5651 optional bool is_deleted = 7;
5652}
5653
5654/**
5655 * Atom that contains a list of a package's channel group preferences, pulled from
5656 * NotificationManagerService.java.
5657 */
5658message PackageNotificationChannelGroupPreferences {
5659 // Uid under which the package is installed.
5660 optional int32 uid = 1;
5661 // Channel Group's ID. Should always be available.
5662 optional string group_id = 2;
5663 // Channel Group's name. Should always be available.
5664 optional string group_name = 3;
5665 // Channel Group's description. Optionally set by group creator.
5666 optional string description = 4;
5667 // Indicates if notifications from this channel group are blocked.
5668 optional bool is_blocked = 5;
5669 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5670 // at core/java/android/app/NotificationChannelGroup.java
5671 optional int32 user_locked_fields = 6;
5672}
5673
Yangsteraf9aee72018-10-12 09:26:16 -07005674message PowerProfileProto {
5675 optional double cpu_suspend = 1;
5676
5677 optional double cpu_idle = 2;
5678
5679 optional double cpu_active = 3;
5680
5681 message CpuCluster {
5682 optional int32 id = 1;
5683 optional double cluster_power = 2;
5684 optional int32 cores = 3;
5685 repeated int64 speed = 4;
5686 repeated double core_power = 5;
5687 }
5688
5689 repeated CpuCluster cpu_cluster = 40;
5690
5691 optional double wifi_scan = 4;
5692
5693 optional double wifi_on = 5;
5694
5695 optional double wifi_active = 6;
5696
5697 optional double wifi_controller_idle = 7;
5698
5699 optional double wifi_controller_rx = 8;
5700
5701 optional double wifi_controller_tx = 9;
5702
5703 repeated double wifi_controller_tx_levels = 10;
5704
5705 optional double wifi_controller_operating_voltage = 11;
5706
5707 optional double bluetooth_controller_idle = 12;
5708
5709 optional double bluetooth_controller_rx = 13;
5710
5711 optional double bluetooth_controller_tx = 14;
5712
5713 optional double bluetooth_controller_operating_voltage = 15;
5714
5715 optional double modem_controller_sleep = 16;
5716
5717 optional double modem_controller_idle = 17;
5718
5719 optional double modem_controller_rx = 18;
5720
5721 repeated double modem_controller_tx = 19;
5722
5723 optional double modem_controller_operating_voltage = 20;
5724
5725 optional double gps_on = 21;
5726
5727 repeated double gps_signal_quality_based = 22;
5728
5729 optional double gps_operating_voltage = 23;
5730
5731 optional double bluetooth_on = 24;
5732
5733 optional double bluetooth_active = 25;
5734
5735 optional double bluetooth_at_cmd = 26;
5736
5737 optional double ambient_display = 27;
5738
5739 optional double screen_on = 28;
5740
5741 optional double radio_on = 29;
5742
5743 optional double radio_scanning = 30;
5744
5745 optional double radio_active = 31;
5746
5747 optional double screen_full = 32;
5748
5749 optional double audio = 33;
5750
5751 optional double video = 34;
5752
5753 optional double flashlight = 35;
5754
5755 optional double memory = 36;
5756
5757 optional double camera = 37;
5758
5759 optional double wifi_batched_scan = 38;
5760
5761 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005762}
Chenjie Yuab530202018-09-26 12:39:20 -07005763
5764/**
5765 * power_profile.xml and other constants for power model calculations.
5766 * Pulled from PowerProfile.java
5767 */
5768message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005769 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005770}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005771
5772/**
arangelovd5db50e2018-10-12 20:24:39 +01005773 * Logs when a user restriction was added or removed.
5774 *
5775 * Logged from:
5776 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5777 */
5778message UserRestrictionChanged {
5779 // The raw string of the user restriction as defined in UserManager.
5780 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5781 optional string restriction = 1;
5782 // Whether the restriction is enabled or disabled.
5783 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005784}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005785
5786/**
5787 * Pulls process user time and system time. Puller takes a snapshot of all pids
5788 * in the system and returns cpu stats for those that are working at the time.
5789 * Dead pids will be dropped. Kernel processes are excluded.
5790 * Min cool-down is 5 sec.
5791 */
5792message ProcessCpuTime {
5793 optional int32 uid = 1 [(is_uid) = true];
5794
5795 optional string process_name = 2;
5796 // Process cpu time in user space, cumulative from boot/process start
5797 optional int64 user_time_millis = 3;
5798 // Process cpu time in system space, cumulative from boot/process start
5799 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005800}
Misha Wagner5a51e002018-10-03 15:04:09 +01005801
5802/**
5803 * Pulls the CPU usage for each thread.
5804 *
5805 * Read from /proc/$PID/task/$TID/time_in_state files.
5806 *
5807 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5808 * time_in_state files not being present on some phones, have not been addressed. These should be
5809 * considered before a public release.
5810 */
5811message CpuTimePerThreadFreq {
5812 // UID that owns the process.
5813 optional int32 uid = 1 [(is_uid) = true];
5814 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005815 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005816 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005817 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005818 // Name of the process taken from `/proc/$PID/cmdline`.
5819 optional string process_name = 4;
5820 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5821 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005822
5823 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5824 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5825 // frequencies are given here as the alternative is sending eight separate atoms. This method
5826 // significantly reduces the amount of data created
5827 optional int32 frequency1_khz = 6;
5828 optional int32 time1_millis = 7;
5829 optional int32 frequency2_khz = 8;
5830 optional int32 time2_millis = 9;
5831 optional int32 frequency3_khz = 10;
5832 optional int32 time3_millis = 11;
5833 optional int32 frequency4_khz = 12;
5834 optional int32 time4_millis = 13;
5835 optional int32 frequency5_khz = 14;
5836 optional int32 time5_millis = 15;
5837 optional int32 frequency6_khz = 16;
5838 optional int32 time6_millis = 17;
5839 optional int32 frequency7_khz = 18;
5840 optional int32 time7_millis = 19;
5841 optional int32 frequency8_khz = 20;
5842 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005843}
Bookatz75ee60422018-11-09 12:27:37 -08005844
5845/**
Bookatz366a4432018-11-20 09:42:33 -08005846 * Pulls information about the device's build.
5847 */
5848message BuildInformation {
5849 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5850 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5851 optional string fingerprint = 1;
5852
5853 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5854 optional string brand = 2;
5855
5856 // Build.PRODUCT. The name of the overall product.
5857 optional string product = 3;
5858
5859 // Build.DEVICE. The name of the industrial design.
5860 optional string device = 4;
5861
5862 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5863 optional string version_release = 5;
5864
5865 // Build.ID. E.g. a label like "M4-rc20".
5866 optional string id = 6;
5867
5868 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5869 // represent this build.
5870 optional string version_incremental = 7;
5871
5872 // Build.TYPE. The type of build, like "user" or "eng".
5873 optional string type = 8;
5874
5875 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5876 optional string tags = 9;
5877}
5878
5879/**
Adam He420947c2019-01-23 15:59:09 -08005880 * Logs information about mismatched caller for content capture.
5881 *
5882 * Logged from:
5883 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5884 */
5885message ContentCaptureCallerMismatchReported {
5886 optional string intended_package = 1;
5887 optional string calling_package = 2;
5888}
5889
5890/**
5891 * Logs information about content capture service events.
5892 *
5893 * Logged from:
5894 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5895 */
5896message ContentCaptureServiceEvents {
5897 // The type of event.
5898 enum Event {
5899 UNKNOWN = 0;
5900 ON_CONNECTED = 1;
5901 ON_DISCONNECTED = 2;
5902 SET_WHITELIST = 3;
5903 SET_DISABLED = 4;
5904 ON_USER_DATA_REMOVED = 5;
5905 }
5906 optional Event event = 1;
5907 // component/package of content capture service.
5908 optional string service_info = 2;
5909 // component/package of target.
5910 // it's a concatenated list of component/package for SET_WHITELIST event
5911 // separated by " ".
5912 optional string target_info = 3;
5913}
5914
5915/**
5916 * Logs information about content capture session events.
5917 *
5918 * Logged from:
5919 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5920 */
5921message ContentCaptureSessionEvents {
5922 // The type of event.
5923 enum Event {
5924 UNKNOWN = 0;
5925 ON_SESSION_STARTED = 1;
5926 ON_SESSION_FINISHED = 2;
5927 SESSION_NOT_CREATED = 3;
5928 }
5929 optional int32 session_id = 1;
5930 optional Event event = 2;
5931 // (n/a on session finished)
5932 optional int32 state_flags = 3;
5933 // component/package of content capture service.
5934 optional string service_info = 4;
5935 // component/package of app.
5936 // (n/a on session finished)
5937 optional string app_info = 5;
5938 optional bool is_child_session = 6;
5939}
5940
5941/**
5942 * Logs information about session being flushed.
5943 *
5944 * Logged from:
5945 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5946 */
5947message ContentCaptureFlushed {
5948 optional int32 session_id = 1;
5949 // component/package of content capture service.
5950 optional string service_info = 2;
5951 // component/package of app.
5952 optional string app_info = 3;
5953 // session start/finish events
5954 optional int32 child_session_started = 4;
5955 optional int32 child_session_finished = 5;
5956 // count of view events.
5957 optional int32 view_appeared_count = 6;
5958 optional int32 view_disappeared_count = 7;
5959 optional int32 view_text_changed_count = 8;
5960
5961 // Flush stats.
5962 optional int32 max_events = 9;
5963 optional int32 idle_flush_freq = 10;
5964 optional int32 text_flush_freq = 11;
5965 optional int32 flush_reason = 12;
5966}
5967
5968/**
Bookatz75ee60422018-11-09 12:27:37 -08005969 * Pulls on-device BatteryStats power use calculations for the overall device.
5970 */
5971message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005972 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5973 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5974 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5975 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005976}
5977
5978/**
5979 * Pulls on-device BatteryStats power use calculations broken down by uid.
5980 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5981 * that is attributed to non-uid items. They must all be included to get the total power use.
5982 */
5983message DeviceCalculatedPowerBlameUid {
5984 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5985 optional int32 uid = 1 [(is_uid) = true];
5986
Bookatz3dbc13a2018-12-21 12:16:51 -08005987 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5988 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5989 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005990}
5991
5992/**
5993 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5994 * drain type.
5995 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5996 * is attributed uids. They must all be included to get the total power use.
5997 */
5998message DeviceCalculatedPowerBlameOther {
5999 // The type of item whose power use is being reported.
6000 enum DrainType {
6001 AMBIENT_DISPLAY = 0;
6002 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6003 BLUETOOTH = 2;
6004 CAMERA = 3;
6005 // Cell-standby
6006 CELL = 4;
6007 FLASHLIGHT = 5;
6008 IDLE = 6;
6009 MEMORY = 7;
6010 // Amount that total computed drain exceeded the drain estimated using the
6011 // battery level changes and capacity.
6012 OVERCOUNTED = 8;
6013 PHONE = 9;
6014 SCREEN = 10;
6015 // Amount that total computed drain was below the drain estimated using the
6016 // battery level changes and capacity.
6017 UNACCOUNTED = 11;
6018 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6019 WIFI = 13;
6020 }
6021 optional DrainType drain_type = 1;
6022
Bookatz3dbc13a2018-12-21 12:16:51 -08006023 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6024 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6025 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006026}
arangelov4e994062018-11-13 16:12:38 +00006027
6028/**
6029 * Logs device policy features.
6030 *
6031 * Logged from:
6032 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6033 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6034 */
6035message DevicePolicyEvent {
6036 // The event id - unique for each event.
6037 optional android.stats.devicepolicy.EventId event_id = 1;
6038 // The admin package name.
6039 optional string admin_package_name = 2;
6040 // A generic integer parameter.
6041 optional int32 integer_value = 3;
6042 // A generic boolean parameter.
6043 optional bool boolean_value = 4;
6044 // A parameter specifying a time period in milliseconds.
6045 optional uint64 time_period_millis = 5;
6046 // A parameter specifying a list of package names, bundle extras or string parameters.
6047 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6048}
shawnlinea5b66b2018-11-13 15:05:29 +08006049
6050/**
6051 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6052 *
6053 * Logged from:
6054 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6055 */
6056message DocsUILaunchReported {
6057 optional android.stats.docsui.LaunchAction launch_action = 1;
6058 optional bool has_initial_uri = 2;
6059 optional android.stats.docsui.MimeType mime_type = 3;
6060 optional android.stats.docsui.Root initial_root = 4;
6061}
6062
6063/**
6064 * Logs root/app visited event in file managers/picker. Call this when the user
6065 * taps on root/app in hamburger menu.
6066 *
6067 * Logged from:
6068 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6069 */
6070message DocsUIRootVisitedReported {
6071 optional android.stats.docsui.ContextScope scope = 1;
6072 optional android.stats.docsui.Root root = 2;
6073}
6074
6075/**
6076 * Logs file operation stats. Call this when a file operation has completed.
6077 *
6078 * Logged from:
6079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6080 */
6081message DocsUIFileOperationReported {
6082 optional android.stats.docsui.Provider provider = 1;
6083 optional android.stats.docsui.FileOperation file_op = 2;
6084}
6085
6086/**
6087 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6088 * mode.
6089 *
6090 * Logged from:
6091 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6092 */
6093message DocsUIFileOperationCopyMoveModeReported {
6094 optional android.stats.docsui.FileOperation file_op = 1;
6095 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6096}
6097
6098
6099/**
6100 * Logs file sub operation stats. Call this when a file operation has failed.
6101 *
6102 * Logged from:
6103 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6104 */
6105message DocsUIFileOperationFailureReported {
6106 optional android.stats.docsui.Authority authority = 1;
6107 optional android.stats.docsui.SubFileOperation sub_op = 2;
6108}
6109
6110/**
6111* Logs the cancellation of a file operation. Call this when a job is canceled
6112*
6113* Logged from:
6114* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6115*/
6116message DocsUIFileOperationCanceledReported {
6117 optional android.stats.docsui.FileOperation file_op = 1;
6118}
6119
6120/**
6121 * Logs startup time in milliseconds.
6122 *
6123 * Logged from:
6124 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6125 */
6126message DocsUIStartupMsReported {
6127 optional int32 startup_millis = 1;
6128}
6129
6130/**
6131 * Logs the action that was started by user.
6132 *
6133 * Logged from:
6134 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6135 */
6136message DocsUIUserActionReported {
6137 optional android.stats.docsui.UserAction action = 1;
6138}
6139
6140/**
6141 * Logs the invalid type when invalid scoped access is requested.
6142 *
6143 * Logged from:
6144 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6145 */
6146message DocsUIInvalidScopedAccessRequestReported {
6147 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006148}
Ben Murdochbab399f62018-12-06 11:01:38 +00006149
6150/**
shawnlina75e82d2019-01-07 10:31:12 +08006151 * Logs the package name that launches docsui picker mode.
6152 *
6153 * Logged from:
6154 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6155 */
6156message DocsUIPickerLaunchedFromReported {
6157 optional string package_name = 1;
6158}
6159
6160/**
6161 * Logs the search type.
6162 *
6163 * Logged from:
6164 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6165 */
6166message DocsUISearchTypeReported {
6167 optional android.stats.docsui.SearchType search_type = 1;
6168}
6169
6170/**
6171 * Logs the search mode.
6172 *
6173 * Logged from:
6174 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6175 */
6176message DocsUISearchModeReported {
6177 optional android.stats.docsui.SearchMode search_mode = 1;
6178}
6179
6180/**
6181 * Logs the pick result information.
6182 *
6183 * Logged from:
6184 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6185 */
6186message DocsUIPickResultReported {
6187 optional int32 total_action_count = 1;
6188 optional int64 duration_millis = 2;
6189 optional int32 file_count= 3;
6190 optional bool is_searching = 4;
6191 optional android.stats.docsui.Root picked_from = 5;
6192 optional android.stats.docsui.MimeType mime_type = 6;
6193 optional int32 repeatedly_pick_times = 7;
6194}
6195
6196/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006197 * Logs when an app's memory is compacted.
6198 *
6199 * Logged from:
6200 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6201 */
6202message AppCompacted {
6203 // The pid of the process being compacted.
6204 optional int32 pid = 1;
6205
6206 // The name of the process being compacted.
6207 optional string process_name = 2;
6208
6209 // The type of compaction.
6210 enum Action {
6211 UNKNOWN = 0;
6212 SOME = 1;
6213 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006214 PERSISTENT = 3;
6215 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006216 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006217 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006218
6219 // Total RSS in kilobytes consumed by the process prior to compaction.
6220 optional int64 before_rss_total_kilobytes = 4;
6221
6222 // File RSS in kilobytes consumed by the process prior to compaction.
6223 optional int64 before_rss_file_kilobytes = 5;
6224
6225 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6226 optional int64 before_rss_anon_kilobytes = 6;
6227
6228 // Swap in kilobytes consumed by the process prior to compaction.
6229 optional int64 before_swap_kilobytes = 7;
6230
6231 // Total RSS in kilobytes consumed by the process after compaction.
6232 optional int64 after_rss_total_kilobytes = 8;
6233
6234 // File RSS in kilobytes consumed by the process after compaction.
6235 optional int64 after_rss_file_kilobytes = 9;
6236
6237 // Anonymous RSS in kilobytes consumed by the process after compaction.
6238 optional int64 after_rss_anon_kilobytes = 10;
6239
6240 // Swap in kilobytes consumed by the process after compaction.
6241 optional int64 after_swap_kilobytes = 11;
6242
6243 // The time taken to perform compaction in milliseconds.
6244 optional int64 time_to_compact_millis = 12;
6245
6246 // The last compaction action performed for this app.
6247 optional Action last_action = 13;
6248
Ben Murdoch01720b82018-12-19 18:03:44 +00006249 // The last time that compaction was attempted on this process in milliseconds
6250 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6251 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006252
Ben Murdoch885c21b2019-03-15 18:02:04 +00006253 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006254 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006255
6256 // The process state at the time of compaction.
6257 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006258
6259 // Free ZRAM in kilobytes before compaction.
6260 optional int64 before_zram_free_kilobytes = 17;
6261
6262 // Free ZRAM in kilobytes after compaction.
6263 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006264}
lifr157fc552018-12-12 16:38:04 +08006265
6266/**
lifrb6b90b62019-03-29 00:40:17 +08006267 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6268 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6269 *
lifr1f74b052019-04-16 22:16:30 +08006270 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6271 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6272 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6273 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006274 */
6275message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006276 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006277
lifr1f74b052019-04-16 22:16:30 +08006278 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006279
6280 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006281 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006282
lifr1f74b052019-04-16 22:16:30 +08006283 // Only valid for event_type = EVENT_GETADDRINFO.
6284 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006285
lifr1f74b052019-04-16 22:16:30 +08006286 // Flags passed to android_res_nsend() defined in multinetwork.h
6287 // Only valid for event_type = EVENT_RESNSEND.
6288 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006289
lifrad9becc2019-05-20 11:04:41 +08006290 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006291
6292 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006293 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006294
6295 // Additional pass-through fields opaque to statsd.
6296 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006297 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006298
6299 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6300 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006301}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006302
6303/**
6304 * Logs when a data stall event occurs.
6305 *
6306 * Log from:
6307 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6308 */
6309message DataStallEvent {
6310 // Data stall evaluation type.
6311 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6312 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6313 optional int32 evaluation_type = 1;
6314 // See definition in data_stall_event.proto.
6315 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6316 // See definition in data_stall_event.proto.
6317 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6318 // See definition in data_stall_event.proto.
6319 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6320 // See definition in data_stall_event.proto.
6321 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6322 // See definition in data_stall_event.proto.
6323 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6324}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006325
6326/*
6327 * Logs when RescueParty resets some set of experiment flags.
6328 *
6329 * Logged from:
6330 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6331 */
6332message RescuePartyResetReported {
6333 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6334 optional int32 rescue_level = 1;
6335}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006336
6337/**
6338 * Logs when signed config is received from an APK, and if that config was applied successfully.
6339 * Logged from:
6340 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6341 */
6342message SignedConfigReported {
6343 enum Type {
6344 UNKNOWN_TYPE = 0;
6345 GLOBAL_SETTINGS = 1;
6346 }
6347 optional Type type = 1;
6348
6349 // The final status of the signed config received.
6350 enum Status {
6351 UNKNOWN_STATUS = 0;
6352 APPLIED = 1;
6353 BASE64_FAILURE_CONFIG = 2;
6354 BASE64_FAILURE_SIGNATURE = 3;
6355 SECURITY_EXCEPTION = 4;
6356 INVALID_CONFIG = 5;
6357 OLD_CONFIG = 6;
6358 SIGNATURE_CHECK_FAILED = 7;
6359 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006360 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006361 }
6362 optional Status status = 2;
6363
6364 // The version of the signed config processed.
6365 optional int32 version = 3;
6366
6367 // The package name that the config was extracted from.
6368 optional string from_package = 4;
6369
6370 enum Key {
6371 NO_KEY = 0;
6372 DEBUG = 1;
6373 PRODUCTION = 2;
6374 }
6375 // Which key was used to verify the config.
6376 optional Key verified_with = 5;
6377}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006378
6379/*
6380 * Logs GNSS Network-Initiated (NI) location events.
6381 *
6382 * Logged from:
6383 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6384 */
6385message GnssNiEventReported {
6386 // The type of GnssNiEvent.
6387 enum EventType {
6388 UNKNOWN = 0;
6389 NI_REQUEST = 1;
6390 NI_RESPONSE = 2;
6391 }
6392 optional EventType event_type = 1;
6393
6394 // An ID generated by HAL to associate NI notifications and UI responses.
6395 optional int32 notification_id = 2;
6396
6397 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006398 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006399
6400 // NI requires notification.
6401 optional bool need_notify = 4;
6402
6403 // NI requires verification.
6404 optional bool need_verify = 5;
6405
6406 // NI requires privacy override, no notification/minimal trace.
6407 optional bool privacy_override = 6;
6408
6409 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6410 // seconds.
6411 optional int32 timeout = 7;
6412
6413 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006414 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006415
6416 // String representing the requester of the network inititated location request.
6417 optional string requestor_id = 9;
6418
6419 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6420 // network initiated location request.
6421 optional string text = 10;
6422
6423 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006424 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006425
6426 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006427 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006428
6429 // True if SUPL ES is enabled.
6430 optional bool is_supl_es_enabled = 13;
6431
6432 // True if GNSS location is enabled.
6433 optional bool is_location_enabled = 14;
6434
6435 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006436 optional android.server.location.GnssUserResponseType user_response = 15;
6437}
6438
6439/**
6440 * Logs GNSS non-framework (NFW) location notification.
6441 *
6442 * Logged from:
6443 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6444 */
6445message GnssNfwNotificationReported {
6446 // Package name of the Android proxy application representing the non-framework entity that
6447 // requested location. Set to empty string if unknown.
6448 optional string proxy_app_package_name = 1;
6449
6450 // Protocol stack that initiated the non-framework location request.
6451 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6452
6453 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6454 // set to empty string. This field is opaque to the framework and used for logging purposes.
6455 optional string other_protocol_stack_name = 3;
6456
6457 // Source initiating/receiving the location information.
6458 optional android.server.location.NfwRequestor requestor = 4;
6459
6460 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6461 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6462 // and used for logging purposes.
6463 optional string requestor_id = 5;
6464
6465 // Indicates whether location information was provided for this request.
6466 optional android.server.location.NfwResponseType response_type = 6;
6467
6468 // True if the device is in user initiated emergency session.
6469 optional bool in_emergency_mode = 7;
6470
6471 // True if cached location is provided.
6472 optional bool is_cached_location = 8;
6473
6474 // True if proxy app permission mismatch between framework and GNSS HAL.
6475 optional bool is_permission_mismatched = 9;
6476}
6477
6478/**
6479 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6480 *
6481 * Logged from:
6482 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6483 */
6484message GnssConfigurationReported {
6485 // SUPL host name.
6486 optional string supl_host = 1;
6487
6488 // SUPL port number.
6489 optional int32 supl_port = 2;
6490
6491 // C2K host name.
6492 optional string c2k_host = 3;
6493
6494 // C2K port number.
6495 optional int32 c2k_port = 4;
6496
6497 // The SUPL version requested by Carrier.
6498 optional int32 supl_ver = 5;
6499
6500 // The SUPL mode.
6501 optional android.server.location.SuplMode supl_mode = 6;
6502
6503 // True if NI emergency SUPL restrictions is enabled.
6504 optional bool supl_es = 7;
6505
6506 // LTE Positioning Profile settings
6507 optional android.server.location.LppProfile lpp_profile = 8;
6508
6509 // Positioning protocol on A-Glonass system.
6510 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6511
6512 // True if emergency PDN is used. Otherwise, regular PDN is used.
6513 optional bool use_emergency_pdn_for_emergency_supl= 10;
6514
6515 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6516 optional android.server.location.GpsLock gps_lock = 11;
6517
6518 // Number of seconds to extend the emergency session duration post emergency call.
6519 optional int32 es_extension_sec = 12;
6520
6521 // The full list of package names of proxy Android applications representing the non-framework
6522 // location access entities (on/off the device) for which the framework user has granted
6523 // non-framework location access permission. The package names are concatenated in one string
6524 // with spaces as separators.
6525 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006526}
Jack Yu95b64f32018-12-13 18:26:11 +08006527
6528/**
6529 * Logs when a NFC device's error occurred.
6530 * Logged from:
6531 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6532 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6533 */
6534message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006535 enum Type {
6536 UNKNOWN = 0;
6537 CMD_TIMEOUT = 1;
6538 ERROR_NOTIFICATION = 2;
6539 AID_OVERFLOW = 3;
6540 }
6541 optional Type type = 1;
6542 // If it's nci cmd timeout, log the timeout command.
6543 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006544
Alex Salod7c3eef2019-01-25 14:43:27 -08006545 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006546}
6547
6548/**
6549 * Logs when a NFC device's state changed event
6550 * Logged from:
6551 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6552 */
6553message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006554 enum State {
6555 UNKNOWN = 0;
6556 OFF = 1;
6557 ON = 2;
6558 ON_LOCKED = 3; // Secure Nfc enabled.
6559 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6560 }
6561 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006562}
6563
6564/**
6565 * Logs when a NFC Beam Transaction occurred.
6566 * Logged from:
6567 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6568 */
6569message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006570 enum Operation {
6571 UNKNOWN = 0;
6572 SEND = 1;
6573 RECEIVE = 2;
6574 }
6575 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006576}
6577
6578/**
6579 * Logs when a NFC Card Emulation Transaction occurred.
6580 * Logged from:
6581 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6582 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6583 */
6584message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006585 enum Category {
6586 UNKNOWN = 0;
6587 HCE_PAYMENT = 1;
6588 HCE_OTHER = 2;
6589 OFFHOST = 3;
6590 }
6591 // Transaction belongs to HCE payment or HCE other category, or offhost.
6592 optional Category category = 1;
6593 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6594 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006595}
6596
6597/**
6598 * Logs when a NFC Tag event occurred.
6599 * Logged from:
6600 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6601 */
6602message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006603 enum Type {
6604 UNKNOWN = 0;
6605 URL = 1;
6606 BT_PAIRING = 2;
6607 PROVISION = 3;
6608 WIFI_CONNECT = 4;
6609 APP_LAUNCH = 5;
6610 OTHERS = 6;
6611 }
6612 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006613}
6614
6615/**
6616 * Logs when Hce transaction triggered
6617 * Logged from:
6618 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6619 */
6620message NfcHceTransactionOccurred {
6621 // The latency period(in microseconds) it took for the first HCE data
6622 // exchange.
6623 optional uint32 latency_micros = 1;
6624}
6625
6626/**
6627 * Logs when SecureElement state event changed
6628 * Logged from:
6629 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6630 */
6631message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006632 enum State {
6633 UNKNOWN = 0;
6634 INITIALIZED = 1;
6635 DISCONNECTED = 2;
6636 CONNECTED = 3;
6637 HALCRASH = 4;
6638 }
6639 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006640
Alex Salod7c3eef2019-01-25 14:43:27 -08006641 optional string state_change_reason = 2;
6642 // SIMx or eSEx.
6643 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006644}
6645
6646/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006647 * Information about a permission grant request
6648 */
6649message PermissionGrantRequestResultReported {
6650 // unique value identifying an API call. A API call might result in multiple of these atoms
6651 optional int64 request_id = 1;
6652
6653 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006654 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006655
6656 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006657 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006658
6659 // The permission to be granted
6660 optional string permission_name = 4;
6661
6662 // If the permission was explicitly requested via the API or added by the system
6663 optional bool is_implicit = 5;
6664
6665 enum Result {
6666 UNDEFINED = 0;
6667 // permission request was ignored
6668 IGNORED = 1;
6669 // permission request was ignored because it was user fixed
6670 IGNORED_USER_FIXED = 2;
6671 // permission request was ignored because it was policy fixed
6672 IGNORED_POLICY_FIXED = 3;
6673 // permission was granted by user action
6674 USER_GRANTED = 4;
6675 // permission was automatically granted
6676 AUTO_GRANTED = 5;
6677 // permission was denied by user action
6678 USER_DENIED = 6;
6679 // permission was denied with prejudice by the user
6680 USER_DENIED_WITH_PREJUDICE = 7;
6681 // permission was automatically denied
6682 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006683 // permission request was ignored because permission is restricted
6684 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006685 // one time permission was granted by user action
6686 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006687 // user ignored request by leaving the request screen without choosing any option
6688 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006689 // user granted the permission after being linked to settings
6690 USER_GRANTED_IN_SETTINGS = 12;
6691 // user denied the permission after being linked to settings
6692 USER_DENIED_IN_SETTINGS = 13;
6693 // user denied the permission with prejudice after being linked to settings
6694 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6695 // permission was automatically revoked after one-time permission expired
6696 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006697 // permission was automatically revoked for unused app
6698 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006699 }
6700 // The result of the permission grant
6701 optional Result result = 6;
6702}
6703
6704/**
Jack Yu95b64f32018-12-13 18:26:11 +08006705 * Logs when Omapi API used
6706 * Logged from:
6707 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6708 */
6709message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006710 enum Operation {
6711 UNKNOWN = 0;
6712 OPEN_CHANNEL = 1;
6713 }
6714 optional Operation operation = 1;
6715 // SIMx or eSEx.
6716 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006717
Alex Salod7c3eef2019-01-25 14:43:27 -08006718 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006719}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006720
6721/**
Alex Saloa060aee2019-01-21 14:36:41 -08006722 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6723 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006724 * Logged from:
6725 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6726 */
6727message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006728 optional int64 dispatch_latency_millis = 1;
6729}
6730
6731/**
6732 * Logs AttentionManagerService attention check result.
6733 *
6734 * Logged from:
6735 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6736 */
6737message AttentionManagerServiceResultReported {
6738 // See core/java/android/service/attention/AttentionService.java
6739 enum AttentionCheckResult {
6740 UNKNOWN = 20;
6741 ATTENTION_SUCCESS_ABSENT = 0;
6742 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006743 ATTENTION_FAILURE_UNKNOWN = 2;
6744 ATTENTION_FAILURE_CANCELLED = 3;
6745 ATTENTION_FAILURE_PREEMPTED = 4;
6746 ATTENTION_FAILURE_TIMED_OUT = 5;
6747 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006748 }
6749 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006750}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006751
6752/**
6753 * Logs when an adb connection changes state.
6754 *
6755 * Logged from:
6756 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6757 */
6758message AdbConnectionChanged {
6759 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6760 // previously selected for this system.
6761 optional int64 last_connection_time_millis = 1;
6762
6763 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6764 // to reconnect via adb without user interaction.
6765 optional int64 auth_window_millis = 2;
6766
6767 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6768 optional android.debug.AdbConnectionStateEnum state = 3;
6769
6770 // True if the 'always allow' option was selected for this system.
6771 optional bool always_allow = 4;
6772}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006773
6774/*
6775 * Logs the reported speech DSP status.
6776 *
6777 * Logged from:
6778 * Vendor audio implementation.
6779 */
6780message SpeechDspStatReported {
6781 // The total Speech DSP uptime in milliseconds.
6782 optional int32 total_uptime_millis = 1;
6783 // The total Speech DSP downtime in milliseconds.
6784 optional int32 total_downtime_millis = 2;
6785 optional int32 total_crash_count = 3;
6786 optional int32 total_recover_count = 4;
6787}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006788
6789/**
6790 * Logs USB connector contaminant status.
6791 *
6792 * Logged from: USB Service.
6793 */
6794message UsbContaminantReported {
6795 optional string id = 1;
6796 optional android.service.usb.ContaminantPresenceStatus status = 2;
6797}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006798
6799/**
6800 * This atom is for debugging purpose.
6801 */
6802message DebugElapsedClock {
6803 // Monotically increasing value for each pull.
6804 optional int64 pull_count = 1;
6805 // Time from System.elapsedRealtime.
6806 optional int64 elapsed_clock_millis = 2;
6807 // Time from System.elapsedRealtime.
6808 optional int64 same_elapsed_clock_millis = 3;
6809 // Diff between current elapsed time and elapsed time from previous pull.
6810 optional int64 elapsed_clock_diff_millis = 4;
6811
6812 enum Type {
6813 TYPE_UNKNOWN = 0;
6814 ALWAYS_PRESENT = 1;
6815 PRESENT_ON_ODD_PULLS = 2;
6816 }
6817 // Type of behavior for the pulled data.
6818 optional Type type = 5;
6819}
6820
6821/**
6822 * This atom is for debugging purpose.
6823 */
6824message DebugFailingElapsedClock {
6825 // Monotically increasing value for each pull.
6826 optional int64 pull_count = 1;
6827 // Time from System.elapsedRealtime.
6828 optional int64 elapsed_clock_millis = 2;
6829 // Time from System.elapsedRealtime.
6830 optional int64 same_elapsed_clock_millis = 3;
6831 // Diff between current elapsed time and elapsed time from previous pull.
6832 optional int64 elapsed_clock_diff_millis = 4;
6833}
Steven Wuacef6bb2019-01-23 14:21:17 -05006834
6835/** Logs System UI bubbles event changed.
6836 *
6837 * Logged from:
6838 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6839 */
6840message BubbleUIChanged {
6841
6842 // The app package that is posting the bubble.
6843 optional string package_name = 1;
6844
6845 // The notification channel that is posting the bubble.
6846 optional string notification_channel = 2;
6847
6848 // The notification id associated with the posted bubble.
6849 optional int32 notification_id = 3;
6850
6851 // The position of the bubble within the bubble stack.
6852 optional int32 position = 4;
6853
6854 // The total number of bubbles within the bubble stack.
6855 optional int32 total_number = 5;
6856
6857 // User interactions with the bubble.
6858 enum Action {
6859 UNKNOWN = 0;
6860 POSTED = 1;
6861 UPDATED = 2;
6862 EXPANDED = 3;
6863 COLLAPSED = 4;
6864 DISMISSED = 5;
6865 STACK_DISMISSED = 6;
6866 STACK_MOVED = 7;
6867 HEADER_GO_TO_APP = 8;
6868 HEADER_GO_TO_SETTINGS = 9;
6869 PERMISSION_OPT_IN = 10;
6870 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006871 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006872 SWIPE_LEFT = 13;
6873 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006874 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006875 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006876 }
6877 optional Action action = 6;
6878
6879 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6880 optional float normalized_x_position = 7;
6881 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006882
6883 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6884 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006885
6886 // Whether the bubble is an on-going one.
6887 optional bool is_ongoing = 10;
6888
6889 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006890 // This is deprecated and the value should be ignored.
6891 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006892}
Kweku Adams8845d012018-12-11 20:06:45 -08006893
6894/**
Steven Wu552f63f2019-02-05 13:41:36 -05006895 * Logs System UI bubbles developer errors.
6896 *
6897 * Logged from:
6898 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6899 */
6900message BubbleDeveloperErrorReported {
6901
6902 // The app package that is posting the bubble.
6903 optional string package_name = 1;
6904
6905 // Bubble developer error type enums.
6906 enum Error {
6907 UNKNOWN = 0;
6908 ACTIVITY_INFO_MISSING = 1;
6909 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6910 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6911 }
6912 optional Error error = 2 [default = UNKNOWN];
6913}
6914
6915/**
Kweku Adams8845d012018-12-11 20:06:45 -08006916 * Logs that a constraint for a scheduled job has changed.
6917 *
6918 * Logged from:
6919 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6920 */
6921message ScheduledJobConstraintChanged {
6922 repeated AttributionNode attribution_node = 1;
6923
6924 // Name of the job.
6925 optional string job_name = 2;
6926
6927 optional com.android.server.job.ConstraintEnum constraint = 3;
6928
6929 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006930 UNKNOWN = 0;
6931 UNSATISFIED = 1;
6932 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006933 }
6934 optional State state = 4;
6935}
Alex Salod7c3eef2019-01-25 14:43:27 -08006936
6937/**
6938 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6939 * returns true.
6940 *
6941 * Logged from:
6942 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6943 */
6944message ScreenTimeoutExtensionReported {
6945 // Describes how many times in a row did the power manager reset the screen off timeout.
6946 optional uint32 consecutive_timeout_extended_count = 1;
6947}
Hui Yu885aca12019-01-10 17:11:34 -08006948
6949/*
6950* Logs number of milliseconds it takes to start a process.
6951* The definition of app process start time is from the app launch time to
6952* the time that Zygote finished forking the app process and loaded the
6953* application package's java classes.
6954
6955* This metric is different from AppStartOccurred which is for foreground
6956* activity only.
6957
6958* ProcessStartTime can report all processes (both foreground and background)
6959* start time.
6960*
6961* Logged from:
6962* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6963*/
6964message ProcessStartTime {
6965 // The uid of the ProcessRecord.
6966 optional int32 uid = 1 [(is_uid) = true];
6967
6968 // The process pid.
6969 optional int32 pid = 2;
6970
6971 // The process name.
6972 // Usually package name, "system" for system server.
6973 // Provided by ActivityManagerService.
6974 optional string process_name = 3;
6975
6976 enum StartType {
6977 UNKNOWN = 0;
6978 WARM = 1;
6979 HOT = 2;
6980 COLD = 3;
6981 }
6982
6983 // The start type.
6984 optional StartType type = 4;
6985
6986 // The elapsed realtime at the start of the process.
6987 optional int64 process_start_time_millis = 5;
6988
6989 // Number of milliseconds it takes to reach bind application.
6990 optional int32 bind_application_delay_millis = 6;
6991
6992 // Number of milliseconds it takes to finish start of the process.
6993 optional int32 process_start_delay_millis = 7;
6994
6995 // hostingType field in ProcessRecord, the component type such as "activity",
6996 // "service", "content provider", "broadcast" or other strings.
6997 optional string hosting_type = 8;
6998
6999 // hostingNameStr field in ProcessRecord. The component class name that runs
7000 // in this process.
7001 optional string hosting_name = 9;
7002}
7003
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007004/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007005 * Track Media Codec usage
7006 * Logged from:
7007 * frameworks/av/media/libstagefright/MediaCodec.cpp
7008 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7009 */
7010message MediametricsCodecReported {
7011 optional int64 timestamp_nanos = 1;
7012 optional string package_name = 2;
7013 optional int64 package_version_code = 3;
7014 optional int64 media_apex_version = 4;
7015
7016 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7017}
7018
7019/**
7020 * Track Media Extractor (pulling video/audio streams out of containers) usage
7021 * Logged from:
7022 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7023 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7024 */
7025message MediametricsExtractorReported {
7026 optional int64 timestamp_nanos = 1;
7027 optional string package_name = 2;
7028 optional int64 package_version_code = 3;
7029 optional int64 media_apex_version = 4;
7030
7031 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7032}
7033
7034/**
7035 * Track how we arbitrate between microphone/input requests.
7036 * Logged from
7037 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7038 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7039 */
7040message MediametricsAudiopolicyReported {
7041 optional int64 timestamp_nanos = 1;
7042 optional string package_name = 2;
7043 optional int64 package_version_code = 3;
7044 optional int64 media_apex_version = 4;
7045
7046 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7047}
7048
7049/**
7050 * Track how we arbitrate between microphone requests.
7051 * Logged from
7052 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7053 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7054 */
7055message MediametricsAudiorecordReported {
7056 optional int64 timestamp_nanos = 1;
7057 optional string package_name = 2;
7058 optional int64 package_version_code = 3;
7059 optional int64 media_apex_version = 4;
7060
7061 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7062}
7063
7064/**
7065 * Track how we arbitrate between microphone/input requests.
7066 * Logged from
7067 * frameworks/av/media/libnblog/ReportPerformance.cpp
7068 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7069 */
7070message MediametricsAudiothreadReported {
7071 optional int64 timestamp_nanos = 1;
7072 optional string package_name = 2;
7073 optional int64 package_version_code = 3;
7074 optional int64 media_apex_version = 4;
7075
7076 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7077}
7078
7079/**
7080 * Track how we arbitrate between microphone/input requests.
7081 * Logged from
7082 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7083 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7084 */
7085message MediametricsAudiotrackReported {
7086 optional int64 timestamp_nanos = 1;
7087 optional string package_name = 2;
7088 optional int64 package_version_code = 3;
7089 optional int64 media_apex_version = 4;
7090
7091 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7092}
7093
7094/**
7095 * Track information about DRM framework performance
7096 * Logged from
7097 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7098 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7099 */
7100message MediametricsMediadrmReported {
7101 optional int64 timestamp_nanos = 1;
7102 optional string package_name = 2;
7103 optional int64 package_version_code = 3;
7104 optional int64 media_apex_version = 4;
7105
7106 // vendor+description tell about which DRM plugin is in use on this device
7107 optional string vendor = 5;
7108 optional string description = 6;
7109 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7110 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7111}
7112
7113/**
7114 * Track information about the widevine DRM plugin performance
7115 * Logged from
7116 * vendor/widevine/libwvdrmengine/cdm/metrics
7117 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7118 */
7119message MediametricsDrmWidevineReported {
7120 optional int64 timestamp_nanos = 1;
7121 optional string package_name = 2;
7122 optional int64 package_version_code = 3;
7123 optional int64 media_apex_version = 4;
7124
7125 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7126}
7127
7128/**
7129 * Track information about recordings (e.g. camcorder)
7130 * Logged from
7131 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7132 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7133 */
7134message MediametricsRecorderReported {
7135 optional int64 timestamp_nanos = 1;
7136 optional string package_name = 2;
7137 optional int64 package_version_code = 3;
7138 optional int64 media_apex_version = 4;
7139
7140 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7141}
7142
7143/**
7144 * Track Media Player usage
7145 * Logged from:
7146 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7147 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7148 */
7149message MediametricsNuPlayerReported {
7150 optional int64 timestamp_nanos = 1;
7151 optional string package_name = 2;
7152 optional int64 package_version_code = 3;
7153 optional int64 media_apex_version = 4;
7154
7155 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7156}
7157
7158/**
Robert Shiha4beed32019-08-19 14:15:23 -07007159 * Track Legacy DRM usage
7160 * Logged from
7161 * frameworks/av/drm/drmserver/DrmManager.cpp
7162 */
7163message MediametricsDrmManagerReported {
7164 optional int64 timestamp_nanos = 1;
7165 optional string package_name = 2;
7166 optional int64 package_version_code = 3;
7167 optional int64 media_apex_version = 4;
7168
7169 enum Method {
7170 METHOD_NOT_FOUND = -1;
7171 GET_CONSTRAINTS = 0;
7172 GET_METADATA = 1;
7173 CAN_HANDLE = 2;
7174 PROCESS_DRM_INFO = 3;
7175 ACQUIRE_DRM_INFO = 4;
7176 SAVE_RIGHTS = 5;
7177 GET_ORIGINAL_MIME_TYPE = 6;
7178 GET_DRM_OBJECT_TYPE = 7;
7179 CHECK_RIGHTS_STATUS = 8;
7180 REMOVE_RIGHTS = 9;
7181 REMOVE_ALL_RIGHTS = 10;
7182 OPEN_CONVERT_SESSION = 11;
7183 OPEN_DECRYPT_SESSION = 12;
7184 }
7185
7186 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7187 optional string plugin_id = 5;
7188 optional string description = 6;
7189 optional Method method = 7;
7190 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007191
7192 optional int64 get_constraints_count = 9;
7193 optional int64 get_metadata_count = 10;
7194 optional int64 can_handle_count = 11;
7195 optional int64 process_drm_info_count = 12;
7196 optional int64 acquire_drm_info_count = 13;
7197 optional int64 save_rights_count = 14;
7198 optional int64 get_original_mime_type_count = 15;
7199 optional int64 get_drm_object_type_count = 16;
7200 optional int64 check_rights_status_count = 17;
7201 optional int64 remove_rights_count = 18;
7202 optional int64 remove_all_rights_count = 19;
7203 optional int64 open_convert_session_count = 20;
7204 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007205}
7206
7207/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007208 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007209 * Pulled from: StatsCompanionService
7210*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007211message DangerousPermissionState {
7212 // Name of the permission
7213 optional string permission_name = 1;
7214
7215 // Uid of the package
7216 optional int32 uid = 2 [(is_uid) = true];
7217
7218 // Package requesting the permission
7219 optional string package_name = 3;
7220
7221 // If the permission is granted to the uid
7222 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007223
7224 // Permission flags as per android.content.pm.PermissionFlags
7225 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007226}
7227
Michael Groover4a0ca942019-01-24 17:41:25 -08007228/**
7229 * Logs when a package is denied access to a device identifier based on the new access requirements.
7230 *
7231 * Logged from:
7232 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7233 */
7234message DeviceIdentifierAccessDenied {
7235 // The name of the package denied access to the requested device identifier.
7236 optional string package_name = 1;
7237
7238 // The name of the device identifier method the package attempted to invoke.
7239 optional string method_name = 2;
7240
7241 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007242 // Starting from Android 11, this boolean is not set and will always be false.
7243 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007244
7245 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007246 // Starting from Android 11, this boolean is not set and will always be false.
7247 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007248}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007249
7250/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007251 * Pulls the ongoing mainline install train version code.
7252 * Pulled from StatsCompanionService
7253 */
7254message TrainInfo {
7255 optional int64 train_version_code = 1;
7256
7257 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007258
7259 optional string train_name = 3;
7260
7261 enum Status {
7262 UNKNOWN = 0;
7263 INSTALL_REQUESTED = 1;
7264 INSTALL_STARTED = 2;
7265 INSTALL_STAGED_NOT_READY = 3;
7266 INSTALL_STAGED_READY = 4;
7267 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007268 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7269 // and INSTALL_FAILURE_COMMIT.
7270 INSTALL_FAILURE = 6 [deprecated = true];
7271 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007272 INSTALL_CANCELLED = 7;
7273 INSTALLER_ROLLBACK_REQUESTED = 8;
7274 INSTALLER_ROLLBACK_INITIATED = 9;
7275 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7276 INSTALLER_ROLLBACK_STAGED = 11;
7277 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7278 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7279 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7280 INSTALLER_ROLLBACK_SUCCESS = 15;
7281 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007282 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7283 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7284 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7285 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7286 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7287 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007288 INSTALL_FAILURE_DOWNLOAD = 23;
7289 INSTALL_FAILURE_STATE_MISMATCH = 24;
7290 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007291 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007292 }
7293 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007294}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007295
7296/**
7297 * Logs the gesture stage changed event.
7298 *
7299 * Logged from:
7300 * frameworks/base/packages/SystemUI/
7301 */
7302message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007303 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007304}
7305
7306/**
7307 * Logs the feedback type.
7308 *
7309 * Logged from:
7310 * frameworks/base/packages/SystemUI/
7311 */
7312message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007313 // Whether or not the gesture was used.
7314 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007315}
7316
7317/**
7318 * Logs the progress.
7319 *
7320 * Logged from:
7321 * frameworks/base/packages/SystemUI/
7322 */
7323message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007324 // [0,100] progress for the assist gesture.
7325 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007326}
Neil Fullerdb14b482019-02-05 19:44:44 +00007327
7328/*
7329 * Information about the time zone data on a device.
7330 */
7331message TimeZoneDataInfo {
7332 // A version identifier for the data set on device. e.g. "2018i"
7333 optional string tzdb_version = 1;
7334}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007335
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007336/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007337 * Logs the GPU stats global health information.
7338 *
7339 * Logged from:
7340 * frameworks/native/services/gpuservice/gpustats/
7341 */
7342message GpuStatsGlobalInfo {
7343 // Package name of the gpu driver.
7344 optional string driver_package_name = 1;
7345
7346 // Version name of the gpu driver.
7347 optional string driver_version_name = 2;
7348
7349 // Version code of the gpu driver.
7350 optional int64 driver_version_code = 3;
7351
7352 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7353 optional int64 driver_build_time = 4;
7354
7355 // Total count of the gl driver gets loaded.
7356 optional int64 gl_loading_count = 5;
7357
7358 // Total count of the gl driver fails to be loaded.
7359 optional int64 gl_loading_failure_count = 6;
7360
7361 // Total count of the Vulkan driver gets loaded.
7362 optional int64 vk_loading_count = 7;
7363
7364 // Total count of the Vulkan driver fails to be loaded.
7365 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007366
7367 // Api version of the system Vulkan driver.
7368 optional int32 vulkan_version = 9;
7369
7370 // Api version of the system CPU Vulkan driver.
7371 optional int32 cpu_vulkan_version = 10;
7372
7373 // Api version of the system GLES driver.
7374 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007375
7376 // Total count of the angle driver gets loaded.
7377 optional int64 angle_loading_count = 12;
7378
7379 // Total count of the angle driver fails to be loaded.
7380 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007381}
7382
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007383/**
7384 * GPU driver loading time info.
7385 */
7386message GpuDriverLoadingTime {
7387 // List of all the driver loading times for this app. The list size is
7388 // capped at 50.
7389 repeated int64 driver_loading_time = 1;
7390}
7391
7392/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007393 * Logs the GPU stats per app health information.
7394 *
7395 * Logged from:
7396 * frameworks/native/services/gpuservice/gpustats/
7397 */
7398message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007399 // Package name of the application that loads the gpu driver. Total number
7400 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007401 optional string app_package_name = 1;
7402
7403 // Version code of the gpu driver this app loads.
7404 optional int64 driver_version_code = 2;
7405
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007406 // gl driver loading time info.
7407 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7408 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007409
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007410 // Vulkan driver loading time info.
7411 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7412 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007413
7414 // Angle driver loading time info.
7415 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7416 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007417
7418 // CPU Vulkan implementation is in use.
7419 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007420
7421 // App is not doing pre-rotation correctly.
7422 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007423
7424 // App creates GLESv1 context.
7425 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007426}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007427
7428/*
7429 * Logs the size of the system ion heap.
7430 *
7431 * Pulled from StatsCompanionService.
7432 */
7433message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007434 // Deprecated due to limited support of ion stats in debugfs.
7435 // Use `IonHeapSize` instead.
7436 option deprecated = true;
7437
Rafal Slawikd4e87572019-03-12 13:08:38 +00007438 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007439 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007440 optional int64 size_in_bytes = 1;
7441}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007442
Rafal Slawik77987ed2019-06-17 12:28:23 +01007443/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007444 * Logs the total size of the ion heap.
7445 *
7446 * Pulled from StatsCompanionService.
7447 */
7448message IonHeapSize {
7449 // Total size of all ion heaps in kilobytes.
7450 // Read from: /sys/kernel/ion/total_heaps_kb.
7451 optional int32 total_size_kb = 1;
7452}
7453
7454/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007455 * Logs the per-process size of the system ion heap.
7456 *
7457 * Pulled from StatsCompanionService.
7458 */
7459message ProcessSystemIonHeapSize {
7460 // The uid if available. -1 means not available.
7461 optional int32 uid = 1 [(is_uid) = true];
7462
7463 // The process name (from /proc/PID/cmdline).
7464 optional string process_name = 2;
7465
7466 // Sum of sizes of all allocations.
7467 optional int32 total_size_in_kilobytes = 3;
7468
7469 // Number of allocations.
7470 optional int32 allocation_count = 4;
7471
7472 // Size of the largest allocation.
7473 optional int32 max_size_in_kilobytes = 5;
7474}
7475
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007476/**
7477 * Push network stack events.
7478 *
7479 * Log from:
7480 * frameworks/base/packages/NetworkStack/
7481 */
7482message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007483 // The id that indicates the event reported from NetworkStack.
7484 optional int32 event_id = 1;
7485 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007486 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7487}
Carmen Agimofa769c152019-03-04 14:39:14 +00007488
7489/**
7490 * Logs the apps that are installed on the external storage.
7491 * Pulled from:
7492 * StatsCompanionService
7493 */
7494message AppsOnExternalStorageInfo {
7495 // The type of the external storage.
7496 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7497 // The name of the package that is installed on the external storage.
7498 optional string package_name = 2;
7499}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007500
7501/**
7502 * Logs the settings related to Face.
7503 * Logged from:
7504 * frameworks/base/services/core/java/com/android/server/stats
7505 */
7506message FaceSettings {
7507 // Whether or not face unlock is allowed on Keyguard.
7508 optional bool unlock_keyguard_enabled = 1;
7509 // Whether or not face unlock dismisses the Keyguard.
7510 optional bool unlock_dismisses_keyguard = 2;
7511 // Whether or not face unlock requires attention.
7512 optional bool unlock_attention_required = 3;
7513 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7514 optional bool unlock_app_enabled = 4;
7515 // Whether or not face unlock always requires user confirmation.
7516 optional bool unlock_always_require_confirmation = 5;
7517 // Whether or not a diverse set of poses are required during enrollment.
7518 optional bool unlock_diversity_required = 6;
7519}
Maggie White442b6312019-04-05 16:26:44 -07007520
7521/**
7522 * Logs cooling devices maintained by the kernel.
7523 *
7524 * Pulled from StatsCompanionService.java
7525 */
7526message CoolingDevice {
7527 // The type of cooling device being reported. Eg. CPU, GPU...
7528 optional android.os.CoolingTypeEnum device_location = 1;
7529 // The name of the cooling device source. Eg. CPU0
7530 optional string device_name = 2;
7531 // Current throttle state of the cooling device. The value can any unsigned
7532 // integer between 0 and max_state defined in its driver. 0 means device is
7533 // not in throttling, higher value means deeper throttling.
7534 optional int32 state = 3;
7535}
Ben Blount763a5d52019-04-10 11:48:58 -07007536
7537/**
7538 * Intelligence has several counter-type events that don't warrant a
7539 * full separate atom. These are primarily API call counters but also include
7540 * counters for feature usage and specific failure modes.
7541 *
7542 * Logged from the Intelligence mainline module.
7543 */
7544message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007545 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007546 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007547 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007548 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007549 // How many times the event occured (to report a batch of high frequency events).
7550 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007551 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007552 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007553}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007554
7555/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007556 * Logs when Car Power state changed.
7557 *
7558 * Logged from:
7559 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7560 */
7561message CarPowerStateChanged {
7562 // States come from CpmsState in CarPowerManagementService.java.
7563 enum State {
7564 WAIT_FOR_VHAL = 0;
7565 ON = 1;
7566 SHUTDOWN_PREPARE = 2;
7567 WAIT_FOR_FINISH = 3;
7568 SUSPEND = 4;
7569 SIMULATE_SLEEP = 5;
7570 }
7571 optional State state = 1;
7572}
7573
7574/**
7575 * Logs whether GarageMode is entered.
7576 *
7577 * Logged from:
7578 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7579 */
7580message GarageModeInfo {
7581 // Whether GarageMode is entered.
7582 optional bool is_garage_mode = 1;
7583}
Martijn Coenencd95d462019-04-25 17:09:45 +02007584
7585/**
7586 * Historical app ops data per package.
7587 */
7588message AppOps {
7589 // Uid of the package requesting the op
7590 optional int32 uid = 1 [(is_uid) = true];
7591
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007592 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007593 optional string package_name = 2;
7594
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007595 // operation id
7596 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007597
7598 // The number of times the op was granted while the app was in the
7599 // foreground (only for trusted requests)
7600 optional int64 trusted_foreground_granted_count = 4;
7601
7602 // The number of times the op was granted while the app was in the
7603 // background (only for trusted requests)
7604 optional int64 trusted_background_granted_count = 5;
7605
7606 // The number of times the op was rejected while the app was in the
7607 // foreground (only for trusted requests)
7608 optional int64 trusted_foreground_rejected_count = 6;
7609
7610 // The number of times the op was rejected while the app was in the
7611 // background (only for trusted requests)
7612 optional int64 trusted_background_rejected_count = 7;
7613
7614 // For long-running operations, total duration of the operation
7615 // while the app was in the foreground (only for trusted requests)
7616 optional int64 trusted_foreground_duration_millis = 8;
7617
7618 // For long-running operations, total duration of the operation
7619 // while the app was in the background (only for trusted requests)
7620 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007621
7622 // Whether AppOps is guarded by Runtime permission
7623 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007624}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007625
7626/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007627 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007628 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007629message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007630 // Uid of the package requesting the op
7631 optional int32 uid = 1 [(is_uid) = true];
7632
7633 // Name of the package performing the op
7634 optional string package_name = 2;
7635
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007636 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7637 // Attributions must be provided through manifest using <attribution> tag available in R and
7638 // above.
7639 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007640
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007641 // operation id
7642 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007643
7644 // The number of times the op was granted while the app was in the
7645 // foreground (only for trusted requests)
7646 optional int64 trusted_foreground_granted_count = 5;
7647
7648 // The number of times the op was granted while the app was in the
7649 // background (only for trusted requests)
7650 optional int64 trusted_background_granted_count = 6;
7651
7652 // The number of times the op was rejected while the app was in the
7653 // foreground (only for trusted requests)
7654 optional int64 trusted_foreground_rejected_count = 7;
7655
7656 // The number of times the op was rejected while the app was in the
7657 // background (only for trusted requests)
7658 optional int64 trusted_background_rejected_count = 8;
7659
7660 // For long-running operations, total duration of the operation
7661 // while the app was in the foreground (only for trusted requests)
7662 optional int64 trusted_foreground_duration_millis = 9;
7663
7664 // For long-running operations, total duration of the operation
7665 // while the app was in the background (only for trusted requests)
7666 optional int64 trusted_background_duration_millis = 10;
7667
7668 // Whether AppOps is guarded by Runtime permission
7669 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007670
7671 // Sampling rate used on device, from 0 to 100
7672 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007673}
7674
7675/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007676 * Location Manager API Usage information(e.g. API under usage,
7677 * API call's parameters).
7678 * Logged from:
7679 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7680 */
7681message LocationManagerApiUsageReported {
7682
7683 // Indicating if usage starts or usage ends.
7684 optional android.stats.location.UsageState state = 1;
7685
7686 // LocationManagerService's API in use.
7687 // We can identify which API from LocationManager is
7688 // invoking current LMS API by the combination of
7689 // API parameter(e.g. is_listener_null, is_intent_null,
7690 // is_location_request_null)
7691 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7692
7693 // Name of the package calling the API.
7694 optional string calling_package_name = 3;
7695
7696 // Type of the location provider.
7697 optional android.stats.location.ProviderType provider = 4;
7698
7699 // Quality of the location request
7700 optional android.stats.location.LocationRequestQuality quality = 5;
7701
7702 // The desired interval for active location updates, in milliseconds.
7703 // Bucketized to reduce cardinality.
7704 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7705
7706 // Minimum distance between location updates, in meters.
7707 // Bucketized to reduce cardinality.
7708 optional android.stats.location.SmallestDisplacementBucket
7709 bucketized_smallest_displacement = 7;
7710
7711 // The number of location updates.
7712 optional int64 num_updates = 8;
7713
7714 // The request expiration time, in millisecond since boot.
7715 // Bucketized to reduce cardinality.
7716 optional android.stats.location.ExpirationBucket
7717 bucketized_expire_in = 9;
7718
7719 // Type of Callback passed in for this API.
7720 optional android.stats.location.CallbackType callback_type = 10;
7721
7722 // The radius of the central point of the alert
7723 // region, in meters. Only for API REQUEST_GEOFENCE.
7724 // Bucketized to reduce cardinality.
7725 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7726
7727 // Activity Importance of API caller.
7728 // Categorized to 3 types that are interesting from location's perspective.
7729 optional android.stats.location.ActivityImportance activiy_importance = 12;
7730}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007731
7732/**
7733 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7734 */
7735message ReviewPermissionsFragmentResultReported {
7736 // unique value identifying a permission group change. A permission group change might result
7737 // in multiple of these atoms
7738 optional int64 change_id = 1;
7739
7740 // UID of package the permission belongs to
7741 optional int32 uid = 2 [(is_uid) = true];
7742
7743 // Name of package the permission belongs to
7744 optional string package_name = 3;
7745
7746 // The permission to be granted
7747 optional string permission_name = 4;
7748
7749 // The result of the permission grant
7750 optional bool permission_granted = 5;
7751}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007752
7753/**
7754* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7755* Logged from: RuntimePermissionUpdgradeController
7756*/
7757message RuntimePermissionsUpgradeResult {
7758 // Permission granted as result of upgrade
7759 optional string permission_name = 1;
7760
7761 // UID of package granted permission
7762 optional int32 uid = 2 [(is_uid) = true];
7763
7764 // Name of package granted permission
7765 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007766}
7767
7768/**
7769* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7770*/
7771message GrantPermissionsActivityButtonActions {
7772 // Permission granted as result of upgrade
7773 optional string permission_group_name = 1;
7774
7775 // UID of package granted permission
7776 optional int32 uid = 2 [(is_uid) = true];
7777
7778 // Name of package requesting permission
7779 optional string package_name = 3;
7780
7781 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7782 // LABEL_ constants in GrantPermissionActivity.java
7783 optional int32 buttons_presented = 4;
7784
7785 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7786 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007787
7788 // id which identifies single session of user interacting with permission controller
7789 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007790}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007791
7792/**
7793 * Information about LocationAccessCheck notification presented to user
7794 */
7795message LocationAccessCheckNotificationAction {
7796
7797 // id which identifies single session of user interacting with permission controller
7798 optional int64 session_id = 1;
7799
7800 // Uid of package for which location access check is presented
7801 optional int32 package_uid = 2;
7802
7803 // Name of package for which location access check is presented
7804 optional string package_name = 3;
7805
7806 enum Result {
7807 UNDEFINED = 0;
7808 // notification was presented to the user
7809 NOTIFICATION_PRESENTED = 1;
7810 // notification was declined by the user
7811 NOTIFICATION_DECLINED = 2;
7812 // notification was clicked by the user
7813 NOTIFICATION_CLICKED = 3;
7814 }
7815
7816 // View / interaction recorded
7817 optional Result result = 4;
7818}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007819
7820/**
7821 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7822 */
7823message AppPermissionFragmentActionReported {
7824 // id which identifies single session of user interacting with permission controller
7825 optional int64 session_id = 1;
7826
7827 // unique value identifying a permission group change. A permission group change might result
7828 // in multiple of these atoms
7829 optional int64 change_id = 2;
7830
7831 // UID of package the permission belongs to
7832 optional int32 uid = 3 [(is_uid) = true];
7833
7834 // Name of package the permission belongs to
7835 optional string package_name = 4;
7836
7837 // The permission to be granted
7838 optional string permission_name = 5;
7839
7840 // The result of the permission grant
7841 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007842
7843 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7844 optional int32 permission_flags = 7;
7845
7846 enum Button {
7847 UNDEFINED = 0;
7848 // Allow button
7849 ALLOW = 1;
7850 // Deny button
7851 DENY = 2;
7852 // Ask every time button
7853 ASK_EVERY_TIME = 3;
7854 // Allow all the time button
7855 ALLOW_ALWAYS = 4;
7856 // Allow only while using the app button
7857 ALLOW_FOREGROUND = 5;
7858 // Same is Deny button but shown in while in use dialog
7859 DENY_FOREGROUND = 6;
7860 }
7861
7862 // Button pressed in the dialog
7863 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007864}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007865
7866/**
7867* Information about a AppPermissionFragment viewed by user
7868*/
7869message AppPermissionFragmentViewed {
7870 // id which identifies single session of user interacting with permission controller
7871 optional int64 session_id = 1;
7872
7873 // UID of package for which permissions are viewed
7874 optional int32 uid = 2 [(is_uid) = true];
7875
7876 // Name of package for which permissions are viewed
7877 optional string package_name = 3;
7878
7879 // Permission group viewed
7880 optional string permission_group_name = 4;
7881}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007882
7883/**
7884* Information about a AppPermissionsFragment viewed by user
7885*/
7886message AppPermissionsFragmentViewed {
7887 // id which identifies single session of user interacting with permission controller
7888 optional int64 session_id = 1;
7889
7890 // id which identifies single view as every view might have several logging records
7891 // with different package information attached
7892 optional int64 view_id = 2;
7893
7894 // Permission group viewed
7895 optional string permission_group_name = 3;
7896
7897 // UID of package for which permissions are viewed
7898 optional int32 uid = 4 [(is_uid) = true];
7899
7900 // Name of package for which permissions are viewed
7901 optional string package_name = 5;
7902
7903 // Category in which permission is included
7904 enum Category {
7905 UNDEFINED = 0;
7906 ALLOWED = 1;
7907 ALLOWED_FOREGROUND = 2;
7908 DENIED = 3;
7909 }
7910 optional Category category = 6;
7911}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007912
7913/**
7914* Information about a PermissionAppsFragment viewed by user.
7915* Logged from ui/handheld/PermissionAppsFragment.java
7916*/
7917message PermissionAppsFragmentViewed {
7918 // id which identifies single session of user interacting with permission controller
7919 optional int64 session_id = 1;
7920
7921 // id which identifies single view as every view might have several logging records
7922 // with different package information attached
7923 optional int64 view_id = 2;
7924
7925 // Permission group viewed
7926 optional string permission_group_name = 3;
7927
7928 // UID of package for which permissions are viewed
7929 optional int32 uid = 4 [(is_uid) = true];
7930
7931 // Name of package for which permissions are viewed
7932 optional string package_name = 5;
7933
7934 // Category in which app is included
7935 enum Category {
7936 UNDEFINED = 0;
7937 ALLOWED = 1;
7938 ALLOWED_FOREGROUND = 2;
7939 DENIED = 3;
7940 }
7941 optional Category category = 6;
7942}
Tony Make2b1b672019-07-29 16:59:47 +01007943
7944/**
7945 * Logs when there is a smart selection related event.
7946 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7947 * Logged from: TextClassifierEventLogger.java
7948 */
7949message TextSelectionEvent {
7950 // A session ID.
7951 optional string session_id = 1;
7952
7953 // Event type of this event.
7954 optional android.stats.textclassifier.EventType event_type = 2;
7955
Tony Mak9c84bd22019-12-09 07:27:25 +00007956 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007957 optional string model_name = 3;
7958
7959 // Type of widget that was involved in triggering this event.
7960 optional android.stats.textclassifier.WidgetType widget_type = 4;
7961
7962 // Index of this event in a session.
7963 optional int32 event_index = 5;
7964
7965 // Entity type that is involved.
7966 optional string entity_type = 6;
7967
7968 // Relative word index of the start of the selection.
7969 optional int32 relative_word_start_index = 7;
7970
7971 // Relative word (exclusive) index of the end of the selection.
7972 optional int32 relative_word_end_index = 8;
7973
7974 // Relative word index of the start of the smart selection.
7975 optional int32 relative_suggested_word_start_index = 9;
7976
7977 // Relative word (exclusive) index of the end of the smart selection.
7978 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007979
7980 // Name of source package.
7981 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007982}
7983
7984/**
7985 * Logs when there is a smart linkify related event.
7986 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7987 * Logged from: TextClassifierEventLogger.java
7988 */
7989message TextLinkifyEvent {
7990 // A session ID.
7991 optional string session_id = 1;
7992
7993 // Event type of this event.
7994 optional android.stats.textclassifier.EventType event_type = 2;
7995
Tony Mak9c84bd22019-12-09 07:27:25 +00007996 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007997 optional string model_name = 3;
7998
7999 // Type of widget that was involved in triggering this event.
8000 optional android.stats.textclassifier.WidgetType widget_type = 4;
8001
8002 // Index of this event in a session.
8003 optional int32 event_index = 5;
8004
8005 // Entity type that is involved.
8006 optional string entity_type = 6;
8007
8008 // Number of links detected.
8009 optional int32 num_links = 7;
8010
8011 // The total length of all links.
8012 optional int32 linked_text_length = 8;
8013
8014 // Length of input text.
8015 optional int32 text_length = 9;
8016
8017 // Time spent on generating links in ms.
8018 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008019
8020 // Name of source package.
8021 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008022}
8023
8024/**
8025 * Logs when there is a conversation actions related event.
8026 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8027 * Logged from: TextClassifierEventLogger.java
8028 */
8029message ConversationActionsEvent {
8030 // A session ID.
8031 optional string session_id = 1;
8032
8033 // Event type of this event.
8034 optional android.stats.textclassifier.EventType event_type = 2;
8035
Tony Mak9c84bd22019-12-09 07:27:25 +00008036 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008037 optional string model_name = 3;
8038
8039 // Type of widget that was involved in triggering this event.
8040 optional android.stats.textclassifier.WidgetType widget_type = 4;
8041
8042 // The first entity type that is involved.
8043 optional string first_entity_type = 5;
8044
8045 // The second entity type that is involved.
8046 optional string second_entity_type = 6;
8047
8048 // The third entity type that is involved.
8049 optional string third_entity_type = 7;
8050
8051 // The score of the first entity type.
8052 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008053
8054 // Name of source package.
8055 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008056
8057 // Name of the annotator model that is involved in this event.
8058 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008059}
8060
8061/**
8062 * Logs when there is a language detection related event.
8063 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8064 * Logged from: TextClassifierEventLogger.java
8065 */
8066message LanguageDetectionEvent {
8067 // A session ID.
8068 optional string session_id = 1;
8069
8070 // Event type of this event.
8071 optional android.stats.textclassifier.EventType event_type = 2;
8072
Tony Mak9c84bd22019-12-09 07:27:25 +00008073 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008074 optional string model_name = 3;
8075
8076 // Type of widget that was involved in triggering this event.
8077 optional android.stats.textclassifier.WidgetType widget_type = 4;
8078
8079 // Detected language.
8080 optional string language_tag = 5;
8081
8082 // Score of the detected language.
8083 optional float score = 6;
8084
8085 // Position of this action.
8086 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008087
8088 // Name of source package.
8089 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008090}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008091
8092/**
8093 * Information about an OTA update attempt by update_engine.
8094 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8095 */
8096message UpdateEngineUpdateAttemptReported {
8097 // The number of attempts for the update engine to apply a given payload.
8098 optional int32 attempt_number = 1;
8099
8100 optional android.stats.otaupdate.PayloadType payload_type = 2;
8101
8102 // The total time in minutes for the update engine to apply a given payload.
8103 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8104 // it's increased when the system is sleeping.
8105 optional int32 duration_boottime_in_minutes = 3;
8106
8107 // The total time in minutes for the update engine to apply a given payload.
8108 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8109 // and it's not increased when the system is sleeping.
8110 optional int32 duration_monotonic_in_minutes = 4;
8111
8112 // The size of the payload in MiBs.
8113 optional int32 payload_size_mib = 5;
8114
8115 // The attempt result reported by the update engine for an OTA update.
8116 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8117
8118 // The error code reported by the update engine after an OTA update attempt
8119 // on A/B devices.
8120 optional android.stats.otaupdate.ErrorCode error_code = 7;
8121
8122 // The build fingerprint of the source system. The value is read from a
8123 // system property when the device takes the update. e.g.
8124 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8125 optional string source_fingerprint = 8;
8126}
8127
8128/**
8129 * Information about all the attempts the device make before finishing the
8130 * successful update.
8131 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8132 */
8133message UpdateEngineSuccessfulUpdateReported {
8134 // The number of attempts for the update engine to apply the payload for a
8135 // successful update.
8136 optional int32 attempt_count = 1;
8137
8138 optional android.stats.otaupdate.PayloadType payload_type = 2;
8139
8140 optional int32 payload_size_mib = 3;
8141
8142 // The total number of bytes downloaded by update_engine since the last
8143 // successful update.
8144 optional int32 total_bytes_downloaded_mib = 4;
8145
8146 // The ratio in percentage of the over-downloaded bytes compared to the
8147 // total bytes needed to successfully install the update. e.g. 200 if we
8148 // download 200MiB in total for a 100MiB package.
8149 optional int32 download_overhead_percentage = 5;
8150
8151 // The total time in minutes for the update engine to apply the payload for a
8152 // successful update.
8153 optional int32 total_duration_minutes = 6;
8154
8155 // The number of reboot of the device during a successful update.
8156 optional int32 reboot_count = 7;
8157}
Alec Mourie088e762019-07-02 13:10:55 -07008158
8159/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008160 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8161 * key to indicate whether it was successful or not.
8162 *
8163 * Logged from:
8164 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8165 */
8166message RebootEscrowRecoveryReported {
8167 optional bool successful = 1;
8168}
8169
8170/**
Alec Mourie088e762019-07-02 13:10:55 -07008171 * Global display pipeline metrics reported by SurfaceFlinger.
8172 * Pulled from:
8173 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8174 */
8175message SurfaceflingerStatsGlobalInfo {
8176 // Total number of frames presented during the tracing period
8177 optional int64 total_frames = 1;
8178 // Total number of frames missed
8179 optional int64 missed_frames = 2;
8180 // Total number of frames that fell back to client composition
8181 optional int64 client_composition_frames = 3;
8182 // Total time the display was turned on
8183 optional int64 display_on_millis = 4;
8184 // Total time that was spent performing animations.
8185 // This is derived from the present-to-present layer histogram
8186 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008187 // Total number of event connections tracked by SurfaceFlinger at the time
8188 // of this pull. If this number grows prohibitively large, then this can
8189 // cause jank due to resource contention.
8190 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008191 // Set of timings measured from when SurfaceFlinger began compositing a
8192 // frame, until the frame was requested to be presented to the display. This
8193 // measures SurfaceFlinger's total CPU walltime on the critical path per
8194 // frame.
8195 optional FrameTimingHistogram frame_duration = 7
8196 [(android.os.statsd.log_mode) = MODE_BYTES];
8197 // Set of timings measured from when SurfaceFlinger first began using the
8198 // GPU to composite a frame, until the GPU has finished compositing that
8199 // frame. This measures the total additional time SurfaceFlinger needed to
8200 // perform due to falling back into GPU composition.
8201 optional FrameTimingHistogram render_engine_timing = 8
8202 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008203}
8204
8205/**
8206 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8207 * The number of layers uploaded will be restricted due to size limitations.
8208 * Pulled from:
8209 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8210 */
8211message SurfaceflingerStatsLayerInfo {
8212 // The layer for this set of metrics
8213 // For now we can infer that the package name is included in the layer
8214 // name.
8215 optional string layer_name = 1;
8216 // Total number of frames presented
8217 optional int64 total_frames = 2;
8218 // Total number of dropped frames while latching a buffer for this layer.
8219 optional int64 dropped_frames = 3;
8220 // Set of timings measured between successive presentation timestamps.
8221 optional FrameTimingHistogram present_to_present = 4
8222 [(android.os.statsd.log_mode) = MODE_BYTES];
8223 // Set of timings measured from when an app queued a buffer for
8224 // presentation, until the buffer was actually presented to the
8225 // display.
8226 optional FrameTimingHistogram post_to_present = 5
8227 [(android.os.statsd.log_mode) = MODE_BYTES];
8228 // Set of timings measured from when a buffer is ready to be presented,
8229 // until the buffer was actually presented to the display.
8230 optional FrameTimingHistogram acquire_to_present = 6
8231 [(android.os.statsd.log_mode) = MODE_BYTES];
8232 // Set of timings measured from when a buffer was latched by
8233 // SurfaceFlinger, until the buffer was presented to the display
8234 optional FrameTimingHistogram latch_to_present = 7
8235 [(android.os.statsd.log_mode) = MODE_BYTES];
8236 // Set of timings measured from the desired presentation to the actual
8237 // presentation time
8238 optional FrameTimingHistogram desired_to_present = 8
8239 [(android.os.statsd.log_mode) = MODE_BYTES];
8240 // Set of timings measured from when an app queued a buffer for
8241 // presentation, until the buffer was ready to be presented.
8242 optional FrameTimingHistogram post_to_acquire = 9
8243 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008244 // Frames missed latch because the acquire fence didn't fire
8245 optional int64 late_acquire_frames = 10;
8246 // Frames latched early because the desired present time was bad
8247 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008248}
8249
8250/**
8251 * Histogram of frame counts bucketed by time in milliseconds.
8252 * Because of size limitations, we hard-cap the number of buckets, with
8253 * buckets for corresponding to larger milliseconds being less precise.
8254 */
8255message FrameTimingHistogram {
8256 // Timings in milliseconds that describes a set of histogram buckets
8257 repeated int32 time_millis_buckets = 1;
8258 // Number of frames that match to each time_millis, i.e. the bucket
8259 // contents
8260 // It's required that len(time_millis) == len(frame_count)
8261 repeated int64 frame_counts = 2;
8262}
Emilian Peev6729f372019-08-29 09:14:09 -07008263
Emilian Peev6729f372019-08-29 09:14:09 -07008264/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008265 * Janky event as reported by SurfaceFlinger.
8266 * This event is intended to be consumed by a Perfetto subscriber for
8267 * automated trace collection.
8268 *
8269 * Logged from:
8270 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8271 */
8272message DisplayJankReported {
8273 // Informational field for how long the janky event lasted in milliseconds
8274 optional int64 event_duration_millis = 1;
8275 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8276 // the display on time.
8277 optional int32 present_deadlines_missed = 2;
8278}
8279
8280/**
Emilian Peev6729f372019-08-29 09:14:09 -07008281 * Information about camera facing and API level usage.
8282 * Logged from:
8283 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8284 */
8285message CameraActionEvent {
8286 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008287 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008288
8289 // Camera API level used
8290 optional int32 api_level = 2;
8291
8292 // Name of client package
8293 optional string package_name = 3;
8294
8295 // Camera facing
8296 enum Facing {
8297 UNKNOWN = 0;
8298 BACK = 1;
8299 FRONT = 2;
8300 EXTERNAL = 3;
8301 }
8302 optional Facing facing = 4;
8303}
atrost01a20932019-08-28 15:40:37 +01008304
8305/**
8306 * Logs when a compatibility change is affecting an app.
8307 *
8308 * Logged from:
8309 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8310 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8311 */
8312message AppCompatibilityChangeReported {
8313 // The UID of the app being affected by the compatibilty change.
8314 optional int32 uid = 1 [(is_uid) = true];
8315
8316 // The ID of the change affecting the app.
8317 optional int64 change_id = 2;
8318
8319 enum State {
8320 UNKNOWN_STATE = 0;
8321 ENABLED = 1;
8322 DISABLED = 2;
8323 LOGGED = 3;
8324 }
8325
8326 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8327 // logged otherwise.
8328 optional State state = 3;
8329
8330 enum Source {
8331 UNKNOWN_SOURCE = 0;
8332 APP_PROCESS = 1;
8333 SYSTEM_SERVER = 2;
8334 }
8335
8336 // Where it was logged from.
8337 optional Source source = 4;
8338
8339}
Hector Dearman40579f62019-11-01 13:19:30 +00008340
8341/**
8342 * Logged from
8343 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8344 */
8345message PerfettoUploaded {
8346 enum Event {
8347 PERFETTO_UNDEFINED = 0;
8348 PERFETTO_TRACE_BEGIN = 1;
8349 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8350 PERFETTO_ON_CONNECT = 3;
8351 PERFETTO_ON_TRACING_DISABLED = 4;
8352 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8353 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8354 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8355 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8356 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8357 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8358 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8359 PERFETTO_TRIGGER_BEGIN = 12;
8360 PERFETTO_TRIGGER_SUCCESS = 13;
8361 PERFETTO_TRIGGER_FAILURE = 14;
8362 PERFETTO_HIT_GUARDRAILS = 15;
8363 PERFETTO_ON_TIMEOUT = 16;
8364 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8365 }
8366
8367 // Which stage of the pipeline we are reporting from.
8368 optional Event event = 1;
8369
8370 // UUID matching the one set inside the SystemInfo trace packet.
8371 optional int64 trace_uuid_lsb = 2;
8372 optional int64 trace_uuid_msb = 3;
8373}
Mark Tabrya824a642019-11-05 12:26:12 -08008374
8375/**
8376 * Pulls client metrics on data transferred via Vehicle Maps Service.
8377 * Metrics are keyed by uid + layer.
8378 *
8379 * Pulled from:
8380 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8381 */
8382message VmsClientStats {
8383 // UID of the VMS client app
8384 optional int32 uid = 1 [(is_uid) = true];
8385
8386 // VMS layer definition
8387 optional int32 layer_type = 2;
8388 optional int32 layer_channel = 3;
8389 optional int32 layer_version = 4;
8390
8391 // Bytes and packets sent by the client for the layer
8392 optional int64 tx_bytes = 5;
8393 optional int64 tx_packets = 6;
8394
8395 // Bytes and packets received by the client for the layer
8396 optional int64 rx_bytes = 7;
8397 optional int64 rx_packets = 8;
8398
8399 // Bytes and packets dropped due to client error
8400 optional int64 dropped_bytes = 9;
8401 optional int64 dropped_packets = 10;
8402}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008403
8404/**
8405 * State of a dangerous permission requested by a package - sampled
8406 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8407*/
8408message DangerousPermissionStateSampled {
8409 // Name of the permission
8410 optional string permission_name = 1;
8411
8412 // Uid of the package
8413 optional int32 uid = 2 [(is_uid) = true];
8414
8415 // If the permission is granted to the uid
8416 optional bool is_granted = 3;
8417
8418 // Permission flags as per android.content.pm.PermissionFlags
8419 optional int32 permission_flags = 4;
8420}
8421
Stan Iliev637ba5e2019-08-16 13:43:08 -04008422/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008423 * HWUI stats for a given app.
8424 */
8425message GraphicsStats {
8426 // The package name of the app
8427 optional string package_name = 1;
8428
8429 // The version code of the app
8430 optional int64 version_code = 2;
8431
8432 // The start & end timestamps in UTC as
8433 // milliseconds since January 1, 1970
8434 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008435 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008436
Stan Ilievb6517192020-02-18 10:12:42 -05008437 optional int64 end_millis = 4;
8438
8439 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8440 enum PipelineType {
8441 UNKNOWN = 0;
8442 GL = 1;
8443 VULKAN = 2;
8444 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008445
8446 // HWUI renders pipeline type: GL or Vulkan.
8447 optional PipelineType pipeline = 5;
8448
8449 // Distinct frame count.
8450 optional int32 total_frames = 6;
8451
8452 // Number of "missed vsync" events.
8453 optional int32 missed_vsync_count = 7;
8454
8455 // Number of frames in triple-buffering scenario (high input latency)
8456 optional int32 high_input_latency_count = 8;
8457
8458 // Number of "slow UI thread" events.
8459 optional int32 slow_ui_thread_count = 9;
8460
8461 // Number of "slow bitmap upload" events.
8462 optional int32 slow_bitmap_upload_count = 10;
8463
8464 // Number of "slow draw" events.
8465 optional int32 slow_draw_count = 11;
8466
8467 // Number of frames that missed their deadline (aka, visibly janked)
8468 optional int32 missed_deadline_count = 12;
8469
8470 // The frame time histogram for the package
8471 optional FrameTimingHistogram cpu_histogram = 13
8472 [(android.os.statsd.log_mode) = MODE_BYTES];
8473
8474 // The gpu frame time histogram for the package
8475 optional FrameTimingHistogram gpu_histogram = 14
8476 [(android.os.statsd.log_mode) = MODE_BYTES];
8477
8478 // UI mainline module version.
8479 optional int64 version_ui_module = 15;
8480
8481 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8482 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8483 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8484 // more apps are running / rendering.
8485 optional bool is_today = 16;
8486}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008487
8488/**
8489 * Message related to dangerous (runtime) app ops access
8490 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008491message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008492 // Uid of the package accessing app op
8493 optional int32 uid = 1 [(is_uid) = true];
8494
8495 // Name of the package accessing app op
8496 optional string package_name = 2;
8497
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008498 // operation string id per OPSTR_ constants in AppOpsManager.java
8499 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008500
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008501 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8502 // API.
8503 // Attributions must be provided through manifest using <attribution> tag available in R and
8504 // above.
8505 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008506
8507 // message related to app op access, limited to 600 chars by API
8508 optional string message = 5;
8509
8510 enum SamplingStrategy {
8511 DEFAULT = 0;
8512 UNIFORM = 1;
8513 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008514 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008515 }
8516
8517 // sampling strategy used to collect this message
8518 optional SamplingStrategy sampling_strategy = 6;
8519}
8520
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008521/*
8522 * Logs userspace reboot outcome and duration.
8523 *
8524 * Logged from:
8525 * frameworks/base/core/java/com/android/server/BootReceiver.java
8526 */
8527message UserspaceRebootReported {
8528 // Possible outcomes of userspace reboot.
8529 enum Outcome {
8530 // Default value in case platform failed to determine the outcome.
8531 OUTCOME_UNKNOWN = 0;
8532 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8533 SUCCESS = 1;
8534 // Userspace reboot shutdown sequence was aborted.
8535 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8536 // Remounting userdata into checkpointing mode failed.
8537 FAILED_USERDATA_REMOUNT = 3;
8538 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8539 // reboot.
8540 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8541 }
8542 // Outcome of userspace reboot. Always set.
8543 optional Outcome outcome = 1;
8544 // Duration of userspace reboot in case it has a successful outcome.
8545 // Duration is measured as time between userspace reboot was initiated and until boot completed
8546 // (e.g. sys.boot_completed=1).
8547 optional int64 duration_millis = 2;
8548 // State of primary user's (user0) credential encryption storage.
8549 enum UserEncryptionState {
8550 // Default value.
8551 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8552 // Credential encrypted storage is unlocked.
8553 UNLOCKED = 1;
8554 // Credential encrypted storage is locked.
8555 LOCKED = 2;
8556 }
8557 // State of primary user's encryption storage at the moment boot completed. Always set.
8558 optional UserEncryptionState user_encryption_state = 3;
8559}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008560
8561/*
8562 * Logs integrity check information during each install.
8563 *
8564 * Logged from:
8565 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8566 */
8567message IntegrityCheckResultReported {
8568 optional string package_name = 1;
8569 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008570 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008571 optional string installer_package_name = 4;
8572 enum Response {
8573 UNKNOWN = 0;
8574 ALLOWED = 1;
8575 REJECTED = 2;
8576 FORCE_ALLOWED = 3;
8577 }
8578 optional Response response = 5;
8579 // An estimate on the cause of the response. This will only be populated for
8580 // REJECTED and FORCE_ALLOWED
8581 optional bool caused_by_app_cert_rule = 6;
8582 optional bool caused_by_installer_rule = 7;
8583}
8584
8585/**
8586 * Logs the information about the rules and the provider whenever rules are
8587 * pushed into AppIntegrityManager.
8588 *
8589 * Logged from:
8590 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8591 */
8592message IntegrityRulesPushed {
8593 optional bool success = 1;
8594 // Package name of the app that pushed the rules.
8595 optional string rule_provider = 2;
8596 // Version string of arbitrary format provided by the rule provider to
8597 // identify the rules.
8598 optional string rule_version = 3;
8599}
Jordan Liubedfa702019-12-20 15:08:45 -08008600
8601/**
8602 * Logs when a cell broadcast message is received on the device.
8603 *
8604 * Logged from CellBroadcastService module:
8605 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8606 */
8607message CellBroadcastMessageReported {
8608 // The type of Cell Broadcast message
8609 enum CbType {
8610 UNKNOWN_TYPE = 0;
8611 GSM = 1;
8612 CDMA = 2;
8613 CDMA_SPC = 3;
8614 }
8615
8616 // GSM, CDMA, CDMA-SCP
8617 optional CbType type = 1;
8618}
8619
8620/**
8621 * Logs when an error occurs while handling a cell broadcast message;
8622 *
8623 * Logged from CellBroadcastService module:
8624 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8625 */
8626message CellBroadcastMessageError {
8627 // The type of error raised when trying to handle a cell broadcast message
8628 enum ErrorType {
8629 UNKNOWN_TYPE = 0;
8630 CDMA_DECODING_ERROR = 1;
8631 CDMA_SCP_EMPTY = 2;
8632 CDMA_SCP_HANDLING_ERROR = 3;
8633 GSM_INVALID_HEADER_LENGTH = 4;
8634 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8635 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8636 GSM_INVALID_PDU = 7;
8637 GSM_INVALID_GEO_FENCING_DATA = 8;
8638 GSM_UMTS_INVALID_WAC = 9;
8639 FAILED_TO_INSERT_TO_DB = 10;
8640 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8641 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8642 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8643 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8644 }
8645
8646 // What kind of error occurred
8647 optional ErrorType type = 1;
8648
8649 // Exception message (or log message) associated with the error (max 1000 chars)
8650 optional string exception_message = 2;
8651}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008652
8653/**
8654 * Logs when the SDK Extensions test app has polled the current version.
8655 * This is atom ID 354.
8656 *
8657 * Logged from:
8658 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8659 */
8660message SdkExtensionStatus {
8661 enum ApiCallStatus {
8662 CALL_NOT_ATTEMPTED = 0;
8663 CALL_SUCCESSFUL = 1;
8664 CALL_FAILED = 2;
8665 }
8666
8667 optional ApiCallStatus result = 1;
8668
8669 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8670 optional int32 r_extension_version = 2;
8671
8672 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8673 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8674 optional int32 failed_call_symbol = 3;
8675}
Marco Ballesio497aff42020-01-24 08:39:42 -08008676
8677/**
8678 * Logs when an app is frozen or unfrozen.
8679 *
8680 * Logged from:
8681 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8682 */
8683message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008684 // The type of event.
8685 enum Action {
8686 UNKNOWN = 0;
8687 FREEZE_APP = 1;
8688 UNFREEZE_APP = 2;
8689 }
8690 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008691
Blake Kragten6ce382a2020-01-16 20:20:46 -08008692 // Pid of the process being frozen.
8693 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008694
Blake Kragten6ce382a2020-01-16 20:20:46 -08008695 // Name of the process being frozen.
8696 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008697
Blake Kragten6ce382a2020-01-16 20:20:46 -08008698 // Time since last unfrozen.
8699 optional int64 time_unfrozen_millis = 4;
8700}
8701
8702/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008703 * Pulls information for a single voice call.
8704 *
8705 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8706 *
8707 * Pulled from:
8708 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8709 */
8710message VoiceCallSession {
8711 // Bearer (IMS or CS) when the call started.
8712 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8713
8714 // Bearer (IMS or CS) when the call ended.
8715 // The bearer may change during the call, e.g. due to SRVCC.
8716 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8717
8718 // Direction of the call (incoming or outgoing).
8719 optional android.telephony.CallDirectionEnum direction = 3;
8720
8721 // Time spent setting up the call.
8722 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8723
8724 // Whether the call ended before the setup was completed.
8725 optional bool setup_failed = 5;
8726
8727 // IMS reason code or CS disconnect cause.
8728 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8729 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8730 optional int32 disconnect_reason_code = 6;
8731
8732 // IMS extra code or CS precise disconnect cause.
8733 // For IMS, this code is vendor-specific
8734 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8735 optional int32 disconnect_extra_code = 7;
8736
8737 // IMS extra message or CS vendor cause.
8738 optional string disconnect_extra_message = 8;
8739
8740 // Radio access technology (RAT) used when call started.
8741 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8742
8743 // Radio access technology (RAT) used when call terminated.
8744 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8745
8746 // Number of times RAT changed during the call.
8747 optional int64 rat_switch_count = 11;
8748
8749 // A bitmask of all codecs used during the call.
8750 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8751 optional int64 codec_bitmask = 12;
8752
8753 // Number of other calls going on during call setup, for the same SIM slot.
8754 optional int32 concurrent_call_count_at_start = 13;
8755
8756 // Number of other calls going on during call termination, for the same SIM slot.
8757 optional int32 concurrent_call_count_at_end = 14;
8758
8759 // Index of the SIM is used, 0 for single-SIM devices.
8760 optional int32 sim_slot_index = 15;
8761
8762 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8763 optional bool is_multi_sim = 16;
8764
8765 // Whether the call was made with an eSIM profile.
8766 optional bool is_esim = 17;
8767
8768 // Carrier ID of the SIM card.
8769 // See https://source.android.com/devices/tech/config/carrierid.
8770 optional int32 carrier_id = 18;
8771
8772 // Whether an SRVCC has been completed successfully.
8773 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8774 // events once the call is switched to CS.
8775 optional bool srvcc_completed = 19;
8776
8777 // Number of SRVCC failures.
8778 optional int64 srvcc_failure_count = 20;
8779
8780 // Number of SRVCC cancellations.
8781 optional int64 srvcc_cancellation_count = 21;
8782
8783 // Whether the Real-Time Text (RTT) was ever used in the call.
8784 optional bool rtt_enabled = 22;
8785
8786 // Whether this was an emergency call.
8787 optional bool is_emergency = 23;
8788
8789 // Whether the call was performed while roaming.
8790 optional bool is_roaming = 24;
8791}
8792
8793/**
8794 * Pulls voice call radio access technology (RAT) usage.
8795 *
8796 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8797 * time. The atom will be skipped if not enough data is available.
8798 *
8799 * Pulled from:
8800 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8801 */
8802message VoiceCallRatUsage {
8803 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8804 optional int32 carrier_id = 1;
8805
8806 // Radio access technology.
8807 optional android.telephony.NetworkTypeEnum rat = 2;
8808
8809 // Total duration that voice calls spent on this carrier and RAT.
8810 optional int64 total_duration_seconds = 3;
8811
8812 // Total number of calls using this carrier and RAT.
8813 // A call is counted once even if it used the RAT multiple times.
8814 optional int64 call_count = 4;
8815}
8816
8817/**
8818 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8819 *
8820 * Pulled from:
8821 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8822 */
8823message SimSlotState {
8824 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8825 optional int32 active_slot_count = 1;
8826
8827 // Number of SIM cards (both physical and active eSIM profiles).
8828 // This number is always equal to or less than the number of active SIM slots.
8829 optional int32 sim_count = 2;
8830
8831 // Number of active eSIM profiles.
8832 // This number is always equal to or less than the number of SIMs.
8833 optional int32 esim_count = 3;
8834}
8835
8836/**
8837 * Pulls supported cellular radio access technologies.
8838 *
8839 * This atom reports the capabilities of the device, rather than the network it has access to.
8840 *
8841 * Pulled from:
8842 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8843 */
8844message SupportedRadioAccessFamily {
8845 // A bitmask of supported radio technologies.
8846 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8847 optional int64 network_type_bitmask = 1;
8848}
8849
8850/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008851 * Logs gnss stats from location service provider
8852 *
8853 * Pulled from:
8854 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8855 */
8856
8857message GnssStats {
8858 // Number of location reports since boot
8859 optional int64 location_reports = 1;
8860
8861 // Total pulled reports of Location failures since boot
8862 optional int64 location_failure_reports = 2;
8863
8864 // Number of time to first fix reports since boot
8865 optional int64 time_to_first_fix_reports = 3;
8866
8867 // Total pulled reported time to first fix (in milli-seconds) since boot
8868 optional int64 time_to_first_fix_milli_s = 4;
8869
8870 // Number of position accuracy reports since boot
8871 optional int64 position_accuracy_reports = 5;
8872
8873 // Total pulled reported position accuracy (in meters) since boot
8874 optional int64 position_accuracy_meters = 6;
8875
8876 // Number of top 4 average CN0 reports since boot
8877 optional int64 top_four_average_cn0_reports = 7;
8878
8879 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8880 optional int64 top_four_average_cn0_db_mhz = 8;
8881
8882 // Number of l5 top 4 average CN0 reports since boot
8883 optional int64 l5_top_four_average_cn0_reports = 9;
8884
8885 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8886 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8887
8888 // Total number of sv status messages reports since boot
8889 optional int64 sv_status_reports = 11;
8890
8891 // Total number of sv status messages reports, where sv is used in fix since boot
8892 optional int64 sv_status_reports_used_in_fix = 12;
8893
8894 // Total number of L5 sv status messages reports since boot
8895 optional int64 l5_sv_status_reports = 13;
8896
8897 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8898 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008899}
Kweku Adams12752132020-02-18 15:36:48 -08008900
8901/**
8902 * Logs when an app is moved to a different standby bucket.
8903 *
8904 * Logged from:
8905 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8906 */
8907message AppStandbyBucketChanged {
8908 optional string package_name = 1;
8909
8910 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8911 optional int32 user_id = 2;
8912
8913 // These enum values match the constants defined in UsageStatsManager.java.
8914 enum Bucket {
8915 BUCKET_UNKNOWN = 0;
8916 BUCKET_EXEMPTED = 5;
8917 BUCKET_ACTIVE = 10;
8918 BUCKET_WORKING_SET = 20;
8919 BUCKET_FREQUENT = 30;
8920 BUCKET_RARE = 40;
8921 BUCKET_RESTRICTED = 45;
8922 BUCKET_NEVER = 50;
8923 }
8924 optional Bucket bucket = 3;
8925
8926 enum MainReason {
8927 MAIN_UNKNOWN = 0;
8928 MAIN_DEFAULT = 0x0100;
8929 MAIN_TIMEOUT = 0x0200;
8930 MAIN_USAGE = 0x0300;
8931 MAIN_FORCED_BY_USER = 0x0400;
8932 MAIN_PREDICTED = 0x0500;
8933 MAIN_FORCED_BY_SYSTEM = 0x0600;
8934 }
8935 optional MainReason main_reason = 4;
8936
8937 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8938 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8939 // UsageStatsManager.java.
8940 optional int32 sub_reason = 5;
8941}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05008942
8943/**
8944* Reports a started sharesheet transaction.
8945*
8946* Logged from:
8947* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8948*/
8949message SharesheetStarted {
8950 // The event_id (as for UiEventReported).
8951 optional int32 event_id = 1;
8952 // The calling app's package name.
8953 optional string package_name = 2;
8954 // An identifier to tie together multiple logs relating to the same share event
8955 optional int32 instance_id = 3;
8956 // The mime type of the share
8957 optional string mime_type = 4;
8958 // The number of direct targets the calling app is providing that will be shown.
8959 optional int32 num_app_provided_direct_targets = 5;
8960 // The number of app targets the calling app is providing that will be shown.
8961 optional int32 num_app_provided_app_targets = 6;
8962 // True if the share originates from the workprofile
8963 optional bool is_workprofile = 7;
8964
8965 enum SharesheetPreviewType { // Constants from ChooserActivity.java
8966 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
8967 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
8968 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
8969 }
8970 // How the sharesheet preview is presented.
8971 optional SharesheetPreviewType previewType = 8;
8972
8973 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
8974 INTENT_DEFAULT = 0;
8975 INTENT_ACTION_VIEW = 1;
8976 INTENT_ACTION_EDIT = 2;
8977 INTENT_ACTION_SEND = 3;
8978 INTENT_ACTION_SENDTO = 4;
8979 INTENT_ACTION_SEND_MULTIPLE = 5;
8980 INTENT_ACTION_IMAGE_CAPTURE = 6;
8981 INTENT_ACTION_MAIN = 7;
8982 }
8983 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
8984 optional ResolverActivityIntent intentType = 9;
8985}
8986
8987/**
8988 * Reports a ranking selection event.
8989 *
8990 * Logged from:
8991 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
8992 */
8993message RankingSelected {
8994 // The event_id (as for UiEventReported).
8995 optional int32 event_id = 1;
8996 // The relevant app's package name (can be source or picked package).
8997 optional string package_name = 2;
8998 // An identifier to tie together multiple logs relating to the same share event.
8999 optional int32 instance_id = 3;
9000 // Which of the ranked targets got picked, default starting position 0.
9001 optional int32 position_picked = 4;
9002}
Raff Tsaiea4db182020-03-06 07:45:43 +08009003
9004/**
9005 * Logs settings provider values.
9006 *
9007 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9008 * then write the value to proto.
9009 *
9010 */
9011message SettingSnapshot {
9012
9013 // Setting key
9014 optional string name = 1;
9015
9016 enum SettingsValueType {
9017 NOTASSIGNED = 0;
9018 ASSIGNED_BOOL_TYPE = 1;
9019 ASSIGNED_INT_TYPE = 2;
9020 ASSIGNED_FLOAT_TYPE = 3;
9021 ASSIGNED_STRING_TYPE = 4;
9022 };
9023 // Setting value type
9024 optional SettingsValueType type = 2;
9025
9026 optional bool bool_value = 3;
9027
9028 optional int32 int_value = 4;
9029
9030 optional float float_value = 5;
9031
9032 optional string str_value = 6;
9033
9034 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9035 optional int32 user_id = 7;
9036}