blob: 22166337cb428e2ccedfa1a10e55c2d7d56f923e [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";
Robert Luo2f52f042020-05-11 16:39:24 +080027import "frameworks/base/core/proto/android/app/media_output_enum.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070028import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080029import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080030import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080031import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080032import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080033import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080034import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080035import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080036import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080039import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080040import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080041import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080042import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080044import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080045import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080046import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070049import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080050import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070051import "frameworks/base/core/proto/android/stats/enums.proto";
52import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070053import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070054import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080055import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070056import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000057import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080058import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050059import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080060import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080061import "frameworks/base/core/proto/android/telephony/enums.proto";
62import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080063import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010064import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070065import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080066
Yao Chend54f9dd2017-10-17 17:37:48 +000067/**
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * raw stats log events from the Android system, also known as "atoms."
70 *
71 * This field contains a single oneof with all of the available messages.
72 * The stats-log-api-gen tool runs as part of the Android build and
73 * generates the android.util.StatsLog class, which contains the constants
74 * and methods that Android uses to log.
75 *
Stefan Lafonae2df012017-11-14 09:17:21 -080076 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000077 * Instead, statsd on Android constructs these messages synthetically,
78 * in the format defined here and in stats_log.proto.
79 */
Stefan Lafonae2df012017-11-14 09:17:21 -080080message Atom {
81 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070082 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070083 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070084 BleScanStateChanged ble_scan_state_changed = 2
85 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080087 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SensorStateChanged sensor_state_changed =
89 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080090 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070091 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
92 ScheduledJobStateChanged scheduled_job_state_changed =
93 8 [(module) = "framework", (module) = "statsdtest"];
94 ScreenBrightnessChanged screen_brightness_changed =
95 9 [(module) = "framework", (module) = "statsdtest"];
96 WakelockStateChanged wakelock_state_changed =
97 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080098 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
99 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700100 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
101 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800102 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
103 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
104 14 [(module) = "framework"];
105 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
106 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
107 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
108 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800109 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700110 BatterySaverModeStateChanged battery_saver_mode_state_changed =
111 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800112 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
113 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700114 AudioStateChanged audio_state_changed =
115 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
117 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
118 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700119 UidProcessStateChanged uid_process_state_changed =
120 27 [(module) = "framework", (module) = "statsdtest"];
121 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
122 28 [(module) = "framework", (module) = "statsdtest"];
123 ScreenStateChanged screen_state_changed =
124 29 [(module) = "framework", (module) = "statsdtest"];
125 BatteryLevelChanged battery_level_changed =
126 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800127 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800128 PluggedStateChanged plugged_state_changed = 32
129 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800131 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800132 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
133 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800134 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
135 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
136 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700137 PhoneSignalStrengthChanged phone_signal_strength_changed =
138 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 SettingChanged setting_changed = 41 [(module) = "framework"];
140 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 42 [(module) = "framework", (module) = "statsdtest"];
142 IsolatedUidChanged isolated_uid_changed =
143 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800144 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
145 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800146 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800147 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800148 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700149 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800150 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
151 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800152 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800153 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800154 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800155 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800156 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
157 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800158 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800159 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700160 OverlayStateChanged overlay_state_changed =
161 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 ForegroundServiceStateChanged foreground_service_state_changed
163 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700164 CallStateChanged call_state_changed =
165 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800166 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
167 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
168 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800169 AppDied app_died = 65 [(module) = "framework"];
170 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
171 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800172 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
173 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
175 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800176 SpeakerImpedanceReported speaker_impedance_reported = 71;
177 HardwareFailed hardware_failed = 72;
178 PhysicalDropDetected physical_drop_detected = 73;
179 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800180 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
181 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700183 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ANROccurred anr_occurred = 79 [(module) = "framework"];
185 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
186 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700187 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800189 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800190 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
191 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700192 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800193 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
194 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
195 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
196 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700197 BatteryHealthSnapshot battery_health_snapshot = 91;
198 SlowIo slow_io = 92;
199 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100202 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800203 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700205 // TODO: service state change is very noisy shortly after boot, as well
206 // as at other transitions - coming out of doze, device plugged in, etc.
207 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
209 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
210 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800211 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800212 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800213 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
214 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
215 105 [(module) = "docsui"];
216 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
217 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
218 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
219 108 [(module) = "docsui"];
220 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
221 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
222 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
223 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800225 WifiRunningStateChanged wifi_running_state_changed = 114
226 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800229 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800230 117 [(module) = "docsui"];
231 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
232 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
233 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
234 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
236 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
237 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800238 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
239 125 [(module) = "bluetooth"];
240 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
241 126 [(module) = "bluetooth"];
242 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
243 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000245 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800246 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
247 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
248 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800249 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800250 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
251 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
252 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
253 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
254 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
255 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800256 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
257 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
259 142 [(module) = "framework"];
260 AttentionManagerServiceResultReported attention_manager_service_result_reported =
261 143 [(module) = "framework"];
262 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800263 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800264 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800265 WatchdogRollbackOccurred watchdog_rollback_occurred =
266 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800267 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
268 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800269 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800270 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
271 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800272 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
273 151 [(module) = "bluetooth"];
274 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
275 152 [(module) = "bluetooth"];
276 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
277 153 [(module) = "bluetooth"];
278 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
279 154 [(module) = "bluetooth"];
280 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
281 155 [(module) = "bluetooth"];
282 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
283 156 [(module) = "bluetooth"];
284 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
285 157 [(module) = "bluetooth"];
286 BluetoothDeviceFailedContactCounterReported
287 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
288 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
289 159 [(module) = "bluetooth"];
290 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
291 160 [(module) = "bluetooth"];
292 BluetoothQualityReportReported bluetooth_quality_report_reported =
293 161 [(module) = "bluetooth"];
294 BluetoothDeviceInfoReported bluetooth_device_info_reported =
295 162 [(module) = "bluetooth"];
296 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
297 163 [(module) = "bluetooth"];
298 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
299 164 [(module) = "bluetooth"];
300 BluetoothBondStateChanged bluetooth_bond_state_changed =
301 165 [(module) = "bluetooth"];
302 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
303 166 [(module) = "bluetooth"];
304 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
305 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
307 168 [(module) = "framework"];
308 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700309 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800311 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800312 DeviceIdentifierAccessDenied device_identifier_access_denied =
313 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800315 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
316 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
317 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
319 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700321 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 180 [(module) = "permissioncontroller"];
323 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
324 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800326 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
327 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
328 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
329 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800330 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
331 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700332 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 188 [(module) = "intelligence"];
334 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
335 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800336 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800337 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800338 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
339 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
340 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
341 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
342 MediametricsCodecReported mediametrics_codec_reported = 195;
343 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
344 MediametricsExtractorReported mediametrics_extractor_reported = 197;
345 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
346 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
347 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700348 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800349 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
350 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800351 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
353 206 [(module) = "framework"];
354 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
355 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
356 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
357 LocationManagerApiUsageReported location_manager_api_usage_reported =
358 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100361 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100363 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100365 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100367 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100369 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100371 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100373 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
376 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
377 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
378 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800380 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700381 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
382 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100384 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800385 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800387 VmsClientConnectionStateChanged vms_client_connection_state_changed =
388 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100389 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
390 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
391 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800392 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100393 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
394 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800395 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800396 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
397 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
398 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
399 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800400 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000402 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800403 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500404 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
405 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800406 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
407 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800408 CellBroadcastMessageReported cb_message_reported =
409 249 [(module) = "cellbroadcast"];
410 CellBroadcastMessageError cb_message_error =
411 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700412 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
413 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
414 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800415 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000416 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800417 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
418 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800419 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800420 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500421 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
422 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700449 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Henry Fangfd40c072020-06-01 14:59:17 -0700450 TvCasSessionOpenStatus tv_cas_session_open_status =
451 280 [(module) = "framework"];
Govinda Wassermane4640282020-04-30 09:30:56 -0400452 AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700453
454 // StatsdStats tracks platform atoms with ids upto 500.
455 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000456 }
David Chenc8a43242017-10-17 16:23:28 -0700457
David Chen6e3e6cb2018-01-03 16:14:06 -0800458 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700459 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700460 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
462 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700463 MobileBytesTransfer mobile_bytes_transfer =
464 10002 [(module) = "framework", (truncate_timestamp) = true];
465 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
466 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
468 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700469 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800470 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700471 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800472 CpuTimePerUidFreq cpu_time_per_uid_freq =
473 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800474 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
475 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
476 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
477 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
478 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700479 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700480 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700481 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700482 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800483 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
484 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700485 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800486 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800488 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 DiskStats disk_stats = 10025 [(module) = "framework"];
490 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
491 AppSize app_size = 10027 [(module) = "framework"];
492 CategorySize category_size = 10028 [(module) = "framework"];
493 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800494 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
496 DiskIo disk_io = 10032 [(module) = "framework"];
497 PowerProfile power_profile = 10033 [(module) = "framework"];
498 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
499 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
500 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700501 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
503 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
504 10040 [(module) = "framework"];
505 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
506 10041 [(module) = "framework"];
507 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800508 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800510 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800511 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
512 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
513 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
514 RoleHolder role_holder = 10049 [(module) = "framework"];
515 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800516 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800517 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
518 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800519 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
520 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800521 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
522 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
523 FaceSettings face_settings = 10058 [(module) = "framework"];
524 CoolingDevice cooling_device = 10059 [(module) = "framework"];
525 AppOps app_ops = 10060 [(module) = "framework"];
526 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700527 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
528 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800529 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800530 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800531 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
532 DangerousPermissionStateSampled dangerous_permission_state_sampled =
533 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400534 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000535 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000536 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200537 PackageNotificationPreferences package_notification_preferences =
538 10071 [(module) = "framework"];
539 PackageNotificationChannelPreferences package_notification_channel_preferences =
540 10072 [(module) = "framework"];
541 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
542 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800543 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800544 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700545 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
546 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
547 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
548 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800549 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800550 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800551 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700552 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
553 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700554 }
yroa1fe77c2018-02-26 14:22:54 -0800555
Bookatz76aafcf2018-09-17 16:17:10 -0700556 // DO NOT USE field numbers above 100,000 in AOSP.
557 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
558 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100559
560 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700561}
562
Yao Chend54f9dd2017-10-17 17:37:48 +0000563/**
Yangster-mac20877162017-12-22 17:19:39 -0800564 * This proto represents a node of an attribution chain.
565 * Note: All attribution chains are represented as a repeated field of type
566 * AttributionNode. It is understood that in such arrays, the order is that
567 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000568 */
Yangster-mac20877162017-12-22 17:19:39 -0800569message AttributionNode {
570 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800571 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800572
Yangster-mac20877162017-12-22 17:19:39 -0800573 // The (optional) string tag for an element in the attribution chain. If the
574 // element has no tag, it is encoded as an empty string.
575 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700576}
577
Yangster-mac48b3d622018-08-18 12:38:11 -0700578message KeyValuePair {
579 optional int32 key = 1;
580 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700581 int32 value_int = 2;
582 int64 value_long = 3;
583 string value_str = 4;
584 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700585 }
586}
587
588message KeyValuePairsAtom {
589 optional int32 uid = 1;
590 repeated KeyValuePair pairs = 2;
591}
592
Yao Chend54f9dd2017-10-17 17:37:48 +0000593/*
594 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800595 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000596 *
597 * RULES:
598 * - The field ids for each atom must start at 1, and count upwards by 1.
599 * Skipping field ids is not allowed.
600 * - These form an API, so renaming, renumbering or removing fields is
601 * not allowed between android releases. (This is not currently enforced,
602 * but there will be a tool to enforce this restriction).
603 * - The types must be built-in protocol buffer types, namely, no sub-messages
604 * are allowed (yet). The bytes type is also not allowed.
605 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800606 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000607 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800608 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000609 * - A field that is a uid should be a string field, tagged with the [xxx]
610 * annotation. The generated code on android will be represented by UIDs,
611 * and those UIDs will be translated in xxx to those strings.
612 *
613 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700614 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000615 * - If there is a UID, it goes first. Think in an object-oriented fashion.
616 * *****************************************************************************
617 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700618
Yao Chend54f9dd2017-10-17 17:37:48 +0000619/**
Tej Singha72344992019-04-17 18:55:08 -0700620 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700621 * Logs when the Thermal service HAL notifies the throttling start/stop events.
622 *
623 * Logged from:
624 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
625 */
626message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700627 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700628 optional android.os.TemperatureTypeEnum sensor_type = 1;
629
Maggie White442b6312019-04-05 16:26:44 -0700630 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700631 enum State {
632 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700633 START = 1; // START indicated that throttling was triggered.
634 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700635 }
Yangster-mace16189a2018-08-26 12:20:16 -0700636 optional State state = 2;
637
638 optional float temperature = 3;
639}
640
641/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000642 * Logs when the screen state changes.
643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
646 */
647message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800648 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800649 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700650 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700651}
Yao Chend54f9dd2017-10-17 17:37:48 +0000652
653/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700654 * Logs that the process state of the uid, as determined by ActivityManager
655 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000656 *
657 * Logged from:
658 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
659 */
Bookatzc1a050a2017-10-10 15:49:28 -0700660message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700661 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000662
Bookatzdb026a22018-01-10 19:01:56 -0800663 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800664 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700665 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000666}
667
668/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700669 * Logs process state change of a process, as per the activity manager.
670 *
671 * Logged from:
672 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
673 */
674message ProcessStateChanged {
675 optional int32 uid = 1;
676 optional string process_name = 2;
677 optional string package_name = 3;
678 // TODO: remove this when validation is done
679 optional int64 version = 5;
680 // The state, from frameworks/base/core/proto/android/app/enums.proto.
681 optional android.app.ProcessStateEnum state = 4;
682}
683
684/**
685 * Logs when ActivityManagerService sleep state is changed.
686 *
687 * Logged from:
688 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
689 */
690message ActivityManagerSleepStateChanged {
691 // TODO: import frameworks proto
692 enum State {
693 UNKNOWN = 0;
694 ASLEEP = 1;
695 AWAKE = 2;
696 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700697 optional State state = 1
698 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700699}
700
701/**
702 * Logs when system memory state changes.
703 *
704 * Logged from:
705 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
706 */
707message MemoryFactorStateChanged {
708 // TODO: import frameworks proto
709 enum State {
710 MEMORY_UNKNOWN = 0;
711 NORMAL = 1; // normal.
712 MODERATE = 2; // moderate memory pressure.
713 LOW = 3; // low memory.
714 CRITICAL = 4; // critical memory.
715
716 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700717 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700718}
719
720/**
721 * Logs when app is using too much cpu, according to ActivityManagerService.
722 *
723 * Logged from:
724 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
725 */
726message ExcessiveCpuUsageReported {
727 optional int32 uid = 1;
728 optional string process_name = 2;
729 optional string package_name = 3;
730 // package version. TODO: remove this when validation is done
731 optional int64 version = 4;
732}
733
734/**
735 * Logs when a cached process is killed, along with its pss.
736 *
737 * Logged from:
738 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
739 */
740message CachedKillReported {
741 optional int32 uid = 1;
742 optional string process_name = 2;
743 optional string package_name = 3;
744 // TODO: remove this when validation is done
745 optional int64 version = 5;
746 optional int64 pss = 4;
747}
748
749/**
xshu2c3d9e42019-09-26 17:54:02 -0700750 * Logs the change in wifi health.
751 *
752 * Logged from:
753 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
754 */
755message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800756 enum Band {
757 UNKNOWN = 0;
758 // All of 2.4GHz band
759 BAND_2G = 1;
760 // Frequencies in the range of [5150, 5250) GHz
761 BAND_5G_LOW = 2;
762 // Frequencies in the range of [5250, 5725) GHz
763 BAND_5G_MIDDLE = 3;
764 // Frequencies in the range of [5725, 5850) GHz
765 BAND_5G_HIGH = 4;
766 // Frequencies in the range of [5925, 6425) GHz
767 BAND_6G_LOW = 5;
768 // Frequencies in the range of [6425, 6875) GHz
769 BAND_6G_MIDDLE = 6;
770 // Frequencies in the range of [6875, 7125) GHz
771 BAND_6G_HIGH = 7;
772 }
xshu2c3d9e42019-09-26 17:54:02 -0700773 // duration this stat is obtained over in milliseconds
774 optional int32 duration_millis = 1;
775 // whether wifi is classified as sufficient for the user's data traffic, determined
776 // by whether the calculated throughput exceeds the average demand within |duration_millis|
777 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700778 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800779 optional bool is_cell_data_available = 3;
780 // the Band bucket the connected network is on
781 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700782}
783
784/**
785 * Logged when wifi detects a significant change in connection failure rate.
786 *
787 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
788 *
789 */
790message WifiFailureStatReported {
791 enum AbnormalityType {
792 UNKNOWN = 0;
793 SIGNIFICANT_INCREASE = 1;
794 SIGNIFICANT_DECREASE = 2;
795 SIMPLY_HIGH = 3;
796 }
797 enum FailureType {
798 FAILURE_UNKNOWN = 0;
799 FAILURE_CONNECTION = 1;
800 FAILURE_ASSOCIATION_REJECTION = 2;
801 FAILURE_ASSOCIATION_TIMEOUT = 3;
802 FAILURE_AUTHENTICATION = 4;
803 FAILURE_NON_LOCAL_DISCONNECTION = 5;
804 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
805 }
806 // Reason for uploading this stat
807 optional AbnormalityType abnormality_type = 1;
808 // The particular type of failure
809 optional FailureType failure_type = 2;
810 // How many times we have encountered this combination of AbnormalityType and FailureType
811 optional int32 failure_count = 3;
812}
813
814/**
815 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
816 *
817 * Logged from:
818 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
819 */
820message WifiConnectionResultReported {
821 enum FailureCode {
822 FAILURE_UNKNOWN = 0;
823 FAILURE_ASSOCIATION_TIMEOUT = 1;
824 FAILURE_ASSOCIATION_REJECTION = 2;
825 FAILURE_AUTHENTICATION_GENERAL = 3;
826 FAILURE_AUTHENTICATION_EAP = 4;
827 FAILURE_DHCP = 5;
828 FAILURE_NETWORK_DISCONNECTION = 6;
829 FAILURE_ROAM_TIMEOUT = 7;
830 }
831 // true represents a successful connection
832 optional bool connection_result = 1;
833 // reason for the connection failure
834 optional FailureCode failure_code = 2;
835 // scan rssi before the connection attempt
836 optional int32 rssi = 3;
837}
838
839/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700840 * Logs when memory stats of a process is reported.
841 *
842 * Logged from:
843 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
844 */
845message ProcessMemoryStatReported {
846 optional int32 uid = 1;
847 optional string process_name = 2;
848 optional string package_name = 3;
849 //TODO: remove this when validation is done
850 optional int64 version = 9;
851 optional int64 pss = 4;
852 optional int64 uss = 5;
853 optional int64 rss = 6;
854 enum Type {
855 ADD_PSS_INTERNAL_SINGLE = 0;
856 ADD_PSS_INTERNAL_ALL_MEM = 1;
857 ADD_PSS_INTERNAL_ALL_POLL = 2;
858 ADD_PSS_EXTERNAL = 3;
859 ADD_PSS_EXTERNAL_SLOW = 4;
860 }
861 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800862 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700863}
864
865/**
Bookatzc1a050a2017-10-10 15:49:28 -0700866 * Logs that a process started, finished, crashed, or ANRed.
867 *
868 * Logged from:
869 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
870 */
871message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700872 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700873
David Chen0b5c90c2018-01-25 16:51:49 -0800874 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700876
Bookatzddccf0a2017-11-28 16:48:14 -0800877 // What lifecycle state the process changed to.
878 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800879 enum State {
880 FINISHED = 0;
881 STARTED = 1;
882 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800883 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800884 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700885}
886
Bookatzc1a050a2017-10-10 15:49:28 -0700887/**
888 * Logs when the ble scan state changes.
889 *
890 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700891 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700892 */
893message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800894 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700895 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700896
897 enum State {
898 OFF = 0;
899 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700900 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
901 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700902 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800903 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700904 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800905 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700906 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800907 (state_field_option).nested = true
908 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700909
Bookatze5ec0b42018-03-26 13:34:56 -0700910 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700911 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700912 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700913 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700914 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700915 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700916}
917
918/**
919 * Logs reporting of a ble scan finding results.
920 *
921 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700922 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700923 */
Bookatzae6738e2018-09-13 11:38:56 -0700924// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700925message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700927
928 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800929 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700930}
931
932/**
933 * Logs when a sensor state changes.
934 *
935 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700936 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700937 */
938message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800939 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700940
Bookatzc1a050a2017-10-10 15:49:28 -0700941 // The id (int) of the sensor.
942 optional int32 sensor_id = 2;
943
944 enum State {
945 OFF = 0;
946 ON = 1;
947 }
948 optional State state = 3;
949}
950
Bookatzc1a050a2017-10-10 15:49:28 -0700951/**
952 * Logs when GPS state changes.
953 *
954 * Logged from:
955 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
956 */
957message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700959
960 enum State {
961 OFF = 0;
962 ON = 1;
963 }
964 optional State state = 2;
965}
966
Bookatz48d362e2018-11-06 15:49:08 -0800967/**
968 * Logs when GPS signal quality.
969 *
970 * Logged from:
971 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
972 */
973message GpsSignalQualityChanged {
974 optional android.server.location.GpsSignalQualityEnum level = 1;
975}
976
Bookatzc1a050a2017-10-10 15:49:28 -0700977
978/**
979 * Logs when a sync manager sync state changes.
980 *
981 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700982 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700983 */
984message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800985 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700986
David Chen0b5c90c2018-01-25 16:51:49 -0800987 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800988 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700989
990 enum State {
991 OFF = 0;
992 ON = 1;
993 }
994 optional State state = 3;
995}
996
Yangster-mac96353002018-09-05 11:18:55 -0700997/*
998 * Deferred job stats.
999 *
1000 * Logged from:
1001 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1002*/
1003message DeferredJobStatsReported {
1004 repeated AttributionNode attribution_node = 1;
1005
1006 // Number of jobs deferred.
1007 optional int32 num_jobs_deferred = 2;
1008
1009 // Time since the last job runs.
1010 optional int64 time_since_last_job_millis = 3;
1011}
1012
Bookatzc1a050a2017-10-10 15:49:28 -07001013/**
1014 * Logs when a job scheduler job state changes.
1015 *
1016 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001017 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001018 */
1019message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001020 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001021
1022 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001023 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001024
1025 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001026 FINISHED = 0;
1027 STARTED = 1;
1028 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001029 }
1030 optional State state = 3;
1031
Tej Singh33a412b2018-03-16 18:43:59 -07001032 // The reason a job has stopped.
1033 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001034 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001035 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001036
1037 // The standby bucket of the app that scheduled the job. These match the framework constants
1038 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1039 // already assigned 0.
1040 enum Bucket {
1041 UNKNOWN = -1;
1042 ACTIVE = 0;
1043 WORKING_SET = 1;
1044 FREQUENT = 2;
1045 RARE = 3;
1046 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001047 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001048 }
1049 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1050
1051 // The job id (as assigned by the app).
1052 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001053
1054 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1055 // constraints as they are always assumed to be set.
1056 optional bool has_charging_constraint = 7;
1057 optional bool has_battery_not_low_constraint = 8;
1058 optional bool has_storage_not_low_constraint = 9;
1059 optional bool has_timing_delay_constraint = 10;
1060 optional bool has_deadline_constraint = 11;
1061 optional bool has_idle_constraint = 12;
1062 optional bool has_connectivity_constraint = 13;
1063 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001064}
1065
1066/**
1067 * Logs when the audio state changes.
1068 *
1069 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001070 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001071 */
1072message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001073 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001074
1075 enum State {
1076 OFF = 0;
1077 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001078 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1079 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001080 }
1081 optional State state = 2;
1082}
1083
1084/**
1085 * Logs when the video codec state changes.
1086 *
1087 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001088 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001089 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001090message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001091 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001092
1093 enum State {
1094 OFF = 0;
1095 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001096 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1097 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001098 }
1099 optional State state = 2;
1100}
1101
1102/**
1103 * Logs when the flashlight state changes.
1104 *
1105 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001106 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001107 */
1108message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001109 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001110
1111 enum State {
1112 OFF = 0;
1113 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001114 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1115 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001116 }
1117 optional State state = 2;
1118}
1119
1120/**
1121 * Logs when the camera state changes.
1122 *
1123 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001124 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001125 */
1126message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001127 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001128
1129 enum State {
1130 OFF = 0;
1131 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001132 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1133 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001134 }
1135 optional State state = 2;
1136}
1137
1138/**
1139 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001140 *
1141 * Logged from:
1142 * TODO
1143 */
Bookatzd6746242017-10-24 18:39:35 -07001144message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001145 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001146 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001147
Bookatz1a1b0462018-01-12 11:47:03 -08001148 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1149 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001150 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001151
1152 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001153 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001154
1155 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001156 RELEASE = 0;
1157 ACQUIRE = 1;
1158 CHANGE_RELEASE = 2;
1159 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001160 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001161 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001162 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001163 (state_field_option).default_state_value = 0,
1164 (state_field_option).nested = true
1165 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001166}
1167
1168/**
Bookatzc1a050a2017-10-10 15:49:28 -07001169 * Logs when a partial wakelock is considered 'long' (over 1 min).
1170 *
1171 * Logged from:
1172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1173 */
1174message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001175 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001176
Yao Chend54f9dd2017-10-17 17:37:48 +00001177 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1178 optional string tag = 2;
1179
Bookatzc1a050a2017-10-10 15:49:28 -07001180 // TODO: I have no idea what this is.
1181 optional string history_tag = 3;
1182
1183 enum State {
1184 OFF = 0;
1185 ON = 1;
1186 }
1187 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001188}
1189
Bookatzc1a050a2017-10-10 15:49:28 -07001190/**
Bookatza66083f2018-09-20 17:24:00 -07001191 * Logs when the device is interactive, according to the PowerManager Notifier.
1192 *
1193 * Logged from:
1194 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1195 */
1196message InteractiveStateChanged {
1197 enum State {
1198 OFF = 0;
1199 ON = 1;
1200 }
1201 optional State state = 1;
1202}
1203
1204/**
Bookatzc1a050a2017-10-10 15:49:28 -07001205 * Logs Battery Saver state change.
1206 *
1207 * Logged from:
1208 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1209 */
1210message BatterySaverModeStateChanged {
1211 enum State {
1212 OFF = 0;
1213 ON = 1;
1214 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001215 optional State state = 1
1216 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001217}
1218
1219/**
1220 * Logs Doze mode state change.
1221 *
1222 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001223 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001224 */
1225message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001226 optional android.server.DeviceIdleModeEnum state = 1
1227 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001228}
1229
1230
1231/**
1232 * Logs state change of Doze mode including maintenance windows.
1233 *
1234 * Logged from:
1235 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1236 */
1237message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001238 optional android.server.DeviceIdleModeEnum state = 1
1239 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001240}
1241
1242/**
1243 * Logs screen brightness level.
1244 *
1245 * Logged from:
1246 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1247 */
1248message ScreenBrightnessChanged {
1249 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1250 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001251}
1252
1253/**
1254 * Logs battery level (percent full, from 0 to 100).
1255 *
1256 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001257 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001258 */
1259message BatteryLevelChanged {
1260 // Battery level. Should be in [0, 100].
1261 optional int32 battery_level = 1;
1262}
1263
1264/**
1265 * Logs change in charging status of the device.
1266 *
1267 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001268 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001269 */
1270message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001271 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001272 optional android.os.BatteryStatusEnum state = 1
1273 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001274}
1275
1276/**
1277 * Logs whether the device is plugged in, and what power source it is using.
1278 *
1279 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001280 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001281 */
1282message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001283 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001284 optional android.os.BatteryPluggedStateEnum state = 1
1285 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001286}
1287
Bookatz8c6571b2017-10-24 15:04:41 -07001288/**
1289 * Logs when an app's wakeup alarm fires.
1290 *
1291 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001292 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001293 */
1294message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001295 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001296
1297 // Name of the wakeup alarm.
1298 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001299
1300 // Name of source package (for historical reasons, since BatteryStats tracked it).
1301 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001302
Ben Murdoch3389f1522019-05-21 15:05:34 +01001303 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001304 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001305}
1306
1307/**
1308 * Logs when an an app causes the mobile radio to change state.
1309 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1310 *
1311 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001312 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001313 */
1314message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001315 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001316
Bookatz1a1b0462018-01-12 11:47:03 -08001317 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1318 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001319}
1320
1321/**
1322 * Logs when an an app causes the wifi radio to change state.
1323 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1324 *
1325 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001326 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001327 */
1328message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001329 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001330
Bookatz1a1b0462018-01-12 11:47:03 -08001331 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1332 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001333}
1334
1335/**
1336 * Logs kernel wakeup reasons and aborts.
1337 *
1338 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001339 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001340 */
1341message KernelWakeupReported {
1342 // Name of the kernel wakeup reason (or abort).
1343 optional string wakeup_reason_name = 1;
1344
1345 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001346 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001347}
1348
1349/**
Bookatzda1798c2018-12-13 14:16:00 -08001350 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001351 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001352 *
1353 * Logged from:
1354 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1355 */
1356message WifiEnabledStateChanged {
1357 enum State {
1358 OFF = 0;
1359 ON = 1;
1360 }
1361 optional State state = 1;
1362}
1363
1364/**
tsaichristinececebdc2020-02-04 14:05:56 -08001365 * This atom is deprecated starting in R.
1366 *
Bookatzda1798c2018-12-13 14:16:00 -08001367 * 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 -08001368 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1369 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001370 *
1371 * Logged from:
1372 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1373 */
1374message WifiRunningStateChanged {
1375 repeated AttributionNode attribution_node = 1;
1376
1377 enum State {
1378 OFF = 0;
1379 ON = 1;
1380 }
1381 optional State state = 2;
1382}
1383
1384/**
Bookatze5885242017-10-24 20:10:31 -07001385 * Logs wifi locks held by an app.
1386 *
1387 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001388 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001389 */
1390message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001391 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001392
1393 enum State {
1394 OFF = 0;
1395 ON = 1;
1396 }
1397 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001398
1399 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1400 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001401}
1402
1403/**
1404 * Logs wifi signal strength changes.
1405 *
1406 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001407 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001408 */
1409message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001410 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1411 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001412}
1413
1414/**
1415 * Logs wifi scans performed by an app.
1416 *
1417 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001418 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001419 */
1420message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001421 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001422
1423 enum State {
1424 OFF = 0;
1425 ON = 1;
1426 }
1427 optional State state = 2;
1428}
1429
1430/**
Tej Singh4503e102018-01-04 14:35:01 -08001431 * Logs wifi multicast locks held by an app
1432 *
1433 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001434 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001435 */
1436message WifiMulticastLockStateChanged {
1437 repeated AttributionNode attribution_node = 1;
1438
1439 enum State {
1440 OFF = 0;
1441 ON = 1;
1442 }
1443 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001444
1445 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001446}
1447
1448/**
Tej Singh1ea42892018-01-19 09:27:00 -08001449 * Logs shutdown reason and duration on next boot.
1450 *
1451 * Logged from:
1452 * frameworks/base/core/java/com/android/server/BootReceiver.java
1453 */
1454message ShutdownSequenceReported {
1455 // True if shutdown is for a reboot. Default: false if we do not know.
1456 optional bool reboot = 1;
1457
1458 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1459 optional string reason = 2;
1460
1461 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1462 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001463 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001464
1465 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001466 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001467}
1468
Tej Singh6483ea42018-01-25 17:45:49 -08001469
1470/**
1471 * Logs boot reason and duration.
1472 *
1473 * Logged from:
1474 * system/core/bootstat/bootstat.cpp
1475 */
1476message BootSequenceReported {
1477 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1478 // Default: "<EMPTY>" if not available.
1479 optional string bootloader_reason = 1;
1480
1481 // Reason for system boot. Eg. bootloader, reboot,userrequested
1482 // Default: "<EMPTY>" if not available.
1483 optional string system_reason = 2;
1484
1485 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001486 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001487
1488 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001489 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001490
1491 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001492 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001493
1494 // Time since last boot in ms. Default: 0 if not available.
1495 optional int64 time_since_last_boot = 6;
1496}
1497
Tej Singhc477d9c2018-02-05 18:31:39 -08001498
1499/**
1500 * Logs call state and disconnect cause (if applicable).
1501 *
1502 * Logged from:
1503 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1504 */
1505message CallStateChanged {
1506 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1507 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1508 optional android.telecom.CallStateEnum call_state = 1;
1509
1510 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1511 // This value is only applicable when the call_state is DISCONNECTED, and
1512 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1513 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1514 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1515
1516 // True if the call is self-managed, which are apps that use the
1517 // telecom infrastructure to make their own calls.
1518 optional bool self_managed = 3;
1519
1520 // True if call is external. External calls are calls on connected Wear
1521 // devices but show up in Telecom so the user can pull them onto the device.
1522 optional bool external_call = 4;
1523}
1524
Tej Singh1ea42892018-01-19 09:27:00 -08001525/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001526 * Logs keyguard state. The keyguard is the lock screen.
1527 *
1528 * Logged from:
1529 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1530 */
1531message KeyguardStateChanged {
1532 enum State {
1533 UNKNOWN = 0;
1534 // The keyguard is hidden when the phone is unlocked.
1535 HIDDEN = 1;
1536 // The keyguard is shown when the phone is locked (screen turns off).
1537 SHOWN= 2;
1538 // The keyguard is occluded when something is overlaying the keyguard.
1539 // Eg. Opening the camera while on the lock screen.
1540 OCCLUDED = 3;
1541 }
1542 optional State state = 1;
1543}
1544
1545/**
1546 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1547 * prompts the user to enter a password (pattern, pin, etc).
1548 *
1549 * Logged from:
1550 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1551 */
1552
1553message KeyguardBouncerStateChanged {
1554 enum State {
1555 UNKNOWN = 0;
1556 // Bouncer is hidden, either as a result of successfully entering the
1557 // password, screen timing out, or user going back to lock screen.
1558 HIDDEN = 1;
1559 // This is when the user is being prompted to enter the password.
1560 SHOWN = 2;
1561 }
1562 optional State state = 1;
1563}
1564
1565/**
1566 * Logs the result of entering a password into the keyguard bouncer.
1567 *
1568 * Logged from:
1569 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1570 */
1571message KeyguardBouncerPasswordEntered {
1572 enum BouncerResult {
1573 UNKNOWN = 0;
1574 // The password entered was incorrect.
1575 FAILURE = 1;
1576 // The password entered was correct.
1577 SUCCESS = 2;
1578 }
1579 optional BouncerResult result = 1;
1580}
1581
Tej Singha883b372018-02-15 11:30:01 -08001582/*
1583 * Logs changes to the configuration of the device. The configuration is defined
1584 * in frameworks/base/core/java/android/content/res/Configuration.java
1585 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1586 * Please go there to interpret the possible values each field can be.
1587 *
1588 * Logged from:
1589 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1590 */
1591message ResourceConfigurationChanged {
1592 // Bit mask of color capabilities of the screen.
1593 // Contains information about the color gamut and hdr mode of the screen.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001595 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001596
1597 // The target screen density being rendered to.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001600
1601 // Current user preference for the scaling factor for fonts,
1602 // relative to the base density scaling.
1603 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001604 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001605
1606 // Flag indicating whether the hard keyboard is hidden.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001608 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001609
1610 // The type of keyboard attached to the device.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1612 optional int32 keyboard = 5;
1613
1614 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1615 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001616 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001617
1618 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1619 // 0 if undefined.
1620 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1621 optional int32 mcc = 7;
1622
1623 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1624 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1625 // MNC_ZERO symbol defined in Configuration.java.
1626 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1627 optional int32 mnc = 8;
1628
1629 // The kind of navigation available on the device.
1630 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1631 optional int32 navigation = 9;
1632
1633 // Flag indicating whether the navigation is available.
1634 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001635 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001636
1637 // Overall orientation of the screen.
1638 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1639 optional int32 orientation = 11;
1640
1641 // The current height of the available screen space, in dp units.
1642 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001643 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001644
1645 // Bit mask of overall layout of the screen.
1646 // Contains information about screen size, whether the screen is wider/taller
1647 // than normal, whether the screen layout is right-tl-left or left-to-right,
1648 // and whether the screen has a rounded shape.
1649 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001650 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001651
1652 // Current width of the available screen space, in dp units.
1653 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001654 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001655
1656 // The smallest screen size an application will see in normal operation.
1657 // This is the smallest value of both screenWidthDp and screenHeightDp
1658 // in portrait and landscape.
1659 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001660 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001661
1662 // The type of touch screen attached to the device.
1663 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1664 optional int32 touchscreen = 16;
1665
1666 // Bit mask of the ui mode.
1667 // Contains information about the overall ui mode of the device.
1668 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1669 // Also contains information about whether the device is in night mode.
1670 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001671 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001672}
1673
Tej Singheee317b2018-03-07 19:28:05 -08001674
1675/**
1676 * Logs changes in the connection state of the mobile radio.
1677 *
1678 * Logged from:
1679 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1680 */
1681message MobileConnectionStateChanged {
1682 // States are from the state machine DataConnection.java.
1683 enum State {
1684 UNKNOWN = 0;
1685 // The connection is inactive, or disconnected.
1686 INACTIVE = 1;
1687 // The connection is being activated, or connecting.
1688 ACTIVATING = 2;
1689 // The connection is active, or connected.
1690 ACTIVE = 3;
1691 // The connection is disconnecting.
1692 DISCONNECTING = 4;
1693 // The connection is disconnecting after creating a connection.
1694 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1695 }
1696 optional State state = 1;
1697 // For multi-sim phones, this distinguishes between the sim cards.
1698 optional int32 sim_slot_index = 2;
1699 // Used to identify the connection. Starts at 0 and increments by 1 for
1700 // every new network created. Resets whenever the device reboots.
1701 optional int32 data_connection_id = 3;
1702 // A bitmask for the capabilities of this connection.
1703 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1704 // Default value (if we have no information): 0
1705 optional int64 capabilities = 4;
1706 // If this connection has internet.
1707 // This just checks if the DEFAULT bit of capabilities is set.
1708 optional bool has_internet = 5;
1709}
1710
1711/**
1712 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1713 *
1714 * Logged from:
1715 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1716 */
1717message MobileRadioTechnologyChanged {
1718 optional android.telephony.NetworkTypeEnum state = 1;
1719 // For multi-sim phones, this distinguishes between the sim cards.
1720 optional int32 sim_slot_index = 2;
1721}
1722
Andrew Chantb56388b2018-03-22 21:07:33 -07001723/**
1724 * Logs the VID and PID of any connected USB devices.
1725 *
1726 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1727 *
1728 * Logged by Vendor.
1729 */
1730message UsbDeviceAttached {
1731 optional int32 vid = 1;
1732 optional int32 pid = 2;
1733 optional bool has_audio = 3;
1734 optional bool has_hid = 4;
1735 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001736 enum State {
1737 STATE_DISCONNECTED = 0;
1738 STATE_CONNECTED = 1;
1739 }
1740 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001741 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001742}
1743
Tej Singheee317b2018-03-07 19:28:05 -08001744
Tej Singhdd7bd352018-02-09 19:33:15 -08001745/**
Tej Singh5d991e12018-03-09 19:48:11 -08001746 * Logs when Bluetooth is enabled and disabled.
1747 *
1748 * Logged from:
1749 * services/core/java/com/android/server/BluetoothManagerService.java
1750 */
1751message BluetoothEnabledStateChanged {
1752 repeated AttributionNode attribution_node = 1;
1753 // Whether or not bluetooth is enabled on the device.
1754 enum State {
1755 UNKNOWN = 0;
1756 ENABLED = 1;
1757 DISABLED = 2;
1758 }
1759 optional State state = 2;
1760 // The reason for being enabled/disabled.
1761 // Eg. Airplane mode, crash, application request.
1762 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1763 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001764 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001765}
1766
1767/**
Jack Hed9837c82019-01-09 01:19:13 -08001768 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001769 *
1770 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001771 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1772 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001773 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001774 */
1775message BluetoothConnectionStateChanged {
1776 // The state of the connection.
1777 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1778 optional android.bluetooth.ConnectionStateEnum state = 1;
1779 // An identifier that can be used to match connect and disconnect events.
1780 // Currently is last two bytes of a hash of a device level ID and
1781 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001782 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001783 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001784 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1785 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001786 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001787 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001788 // An identifier that can be used to match events for this device.
1789 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1790 // Salt: Randomly generated 256 bit value
1791 // Hash algorithm: HMAC-SHA256
1792 // Size: 32 byte
1793 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001794 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001795 // An identifier that can be used to match events for this device.
1796 // The incremental identifier is locally generated and guaranteed not derived
1797 // from any globally unique hardware id.
1798 // For paired devices, it stays consistent between Bluetooth toggling for the
1799 // same remote device.
1800 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1801 // session for the same remote device.
1802 // Default: 0 if the device's metric id is unknown.
1803 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001804}
1805
1806/**
1807 * Logs when a Bluetooth device connects and disconnects over ACL
1808 *
1809 * Logged from:
1810 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1811 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001812 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001813 */
1814message BluetoothAclConnectionStateChanged {
1815 // An identifier that can be used to match events for this device.
1816 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1817 // Salt: Randomly generated 256 bit value
1818 // Hash algorithm: HMAC-SHA256
1819 // Size: 32 byte
1820 // Default: null or empty if the device identifier is not known
1821 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1822 // The state of the connection.
1823 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1824 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001825 // An identifier that can be used to match events for this device.
1826 // The incremental identifier is locally generated and guaranteed not derived
1827 // from any globally unique hardware id.
1828 // For paired devices, it stays consistent between Bluetooth toggling for the
1829 // same remote device.
1830 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1831 // session for the same remote device.
1832 // Default: 0 if the device's metric id is unknown.
1833 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001834}
1835
1836/**
1837 * Logs when a Bluetooth device connects and disconnects over SCO
1838 *
1839 * Logged from:
1840 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1841 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1842 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001843 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001844 */
1845message BluetoothScoConnectionStateChanged {
1846 // An identifier that can be used to match events for this device.
1847 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1848 // Salt: Randomly generated 256 bit value
1849 // Hash algorithm: HMAC-SHA256
1850 // Size: 32 byte
1851 // Default: null or empty if the device identifier is not known
1852 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1853 // The state of the connection.
1854 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1855 optional android.bluetooth.ConnectionStateEnum state = 2;
1856 // Codec used for this SCO connection
1857 // Default: UNKNOWN
1858 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001859 // An identifier that can be used to match events for this device.
1860 // The incremental identifier is locally generated and guaranteed not derived
1861 // from any globally unique hardware id.
1862 // For paired devices, it stays consistent between Bluetooth toggling for the
1863 // same remote device.
1864 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1865 // session for the same remote device.
1866 // Default: 0 if the device's metric id is unknown.
1867 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001868}
1869
Jack Hec27040a2019-01-09 20:54:41 -08001870/**
1871 * Logged when active device of a profile changes
1872 *
1873 * Logged from:
1874 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1875 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1876 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1877 */
1878message BluetoothActiveDeviceChanged {
1879 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1880 // From android.bluetooth.BluetoothProfile
1881 optional int32 bt_profile = 1;
1882 // An identifier that can be used to match events for this new active device.
1883 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1884 // Salt: Randomly generated 256 bit value
1885 // Hash algorithm: HMAC-SHA256
1886 // Size: 32 byte
1887 // Default: null or empty if there is no active device for this profile
1888 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001889 // An identifier that can be used to match events for this device.
1890 // The incremental identifier is locally generated and guaranteed not derived
1891 // from any globally unique hardware id.
1892 // For paired devices, it stays consistent between Bluetooth toggling for the
1893 // same remote device.
1894 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1895 // session for the same remote device.
1896 // Default: 0 if the device's metric id is unknown.
1897 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001898}
1899
Jack Heab86dbd22018-12-18 15:43:27 -08001900// Logs when there is an event affecting Bluetooth device's link layer connection.
1901// - This event is triggered when there is a related HCI command or event
1902// - Users of this metrics can deduce Bluetooth device's connection state from these events
1903// - HCI commands are logged before the command is sent, after receiving command status, and after
1904// receiving command complete
1905// - HCI events are logged when they arrive
1906//
1907// Low level log from system/bt
1908//
1909// Bluetooth classic commands:
1910// - CMD_CREATE_CONNECTION
1911// - CMD_DISCONNECT
1912// - CMD_CREATE_CONNECTION_CANCEL
1913// - CMD_ACCEPT_CONNECTION_REQUEST
1914// - CMD_REJECT_CONNECTION_REQUEST
1915// - CMD_SETUP_ESCO_CONNECTION
1916// - CMD_ACCEPT_ESCO_CONNECTION
1917// - CMD_REJECT_ESCO_CONNECTION
1918// - CMD_ENH_SETUP_ESCO_CONNECTION
1919// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1920//
1921// Bluetooth low energy commands:
1922// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1923// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1924// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1925// - CMD_BLE_CLEAR_WHITE_LIST
1926// - CMD_BLE_ADD_WHITE_LIST
1927// - CMD_BLE_REMOVE_WHITE_LIST
1928//
1929// Bluetooth classic events:
1930// - EVT_CONNECTION_COMP
1931// - EVT_CONNECTION_REQUEST
1932// - EVT_DISCONNECTION_COMP
1933// - EVT_ESCO_CONNECTION_COMP
1934// - EVT_ESCO_CONNECTION_CHANGED
1935//
1936// Bluetooth low energy meta events:
1937// - BLE_EVT_CONN_COMPLETE_EVT
1938// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1939//
1940// Next tag: 10
1941message BluetoothLinkLayerConnectionEvent {
1942 // An identifier that can be used to match events for this device.
1943 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1944 // Salt: Randomly generated 256 bit value
1945 // Hash algorithm: HMAC-SHA256
1946 // Size: 32 byte
1947 // Default: null or empty if the device identifier is not known
1948 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1949 // Connection handle of this connection if available
1950 // Range: 0x0000 - 0x0EFF (12 bits)
1951 // Default: 0xFFFF if the handle is unknown
1952 optional int32 connection_handle = 2;
1953 // Direction of the link
1954 // Default: DIRECTION_UNKNOWN
1955 optional android.bluetooth.DirectionEnum direction = 3;
1956 // Type of this link
1957 // Default: LINK_TYPE_UNKNOWN
1958 optional android.bluetooth.LinkTypeEnum type = 4;
1959
1960 // Reason metadata for this link layer connection event, rules for interpretation:
1961 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1962 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1963 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1964 // set and valid, ignore hci_ble_event
1965
1966 // HCI command associated with this event
1967 // Default: CMD_UNKNOWN
1968 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1969 // HCI event associated with this event
1970 // Default: EVT_UNKNOWN
1971 optional android.bluetooth.hci.EventEnum hci_event = 6;
1972 // HCI BLE meta event associated with this event
1973 // Default: BLE_EVT_UNKNOWN
1974 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1975 // HCI command status code if this is triggerred by hci_cmd
1976 // Default: STATUS_UNKNOWN
1977 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1978 // HCI reason code associated with this event
1979 // Default: STATUS_UNKNOWN
1980 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001981 // An identifier that can be used to match events for this device.
1982 // The incremental identifier is locally generated and guaranteed not derived
1983 // from any globally unique hardware id.
1984 // For paired devices, it stays consistent between Bluetooth toggling for the
1985 // same remote device.
1986 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1987 // session for the same remote device.
1988 // Default: 0 if the device's metric id is unknown.
1989 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001990}
1991
Howard Roe103fe22019-01-17 16:52:16 -08001992/**
1993 * Logs when a module is rolled back by Watchdog.
1994 *
1995 * Logged from: Rollback Manager
1996 */
1997message WatchdogRollbackOccurred {
1998 enum RollbackType {
1999 UNKNOWN = 0;
2000 ROLLBACK_INITIATE = 1;
2001 ROLLBACK_SUCCESS = 2;
2002 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002003 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002004 }
2005 optional RollbackType rollback_type = 1;
2006
2007 optional string package_name = 2;
2008
2009 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002010
2011 enum RollbackReasonType {
2012 REASON_UNKNOWN = 0;
2013 REASON_NATIVE_CRASH = 1;
2014 REASON_EXPLICIT_HEALTH_CHECK = 2;
2015 REASON_APP_CRASH = 3;
2016 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002017 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002018 }
2019 optional RollbackReasonType rollback_reason = 4;
2020
2021 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2022 // is initiated. Empty if the package is unknown.
2023 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002024
2025 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002026}
2027
Jack Hec27040a2019-01-09 20:54:41 -08002028/**
2029 * Logs when there is a change in Bluetooth A2DP playback state
2030 *
2031 * Logged from:
2032 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2033 */
2034message BluetoothA2dpPlaybackStateChanged {
2035 // An identifier that can be used to match events for this device.
2036 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2037 // Salt: Randomly generated 256 bit value
2038 // Hash algorithm: HMAC-SHA256
2039 // Size: 32 byte
2040 // Default: null or empty if the device identifier is not known
2041 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2042 // Current playback state
2043 // Default: PLAYBACK_STATE_UNKNOWN
2044 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2045 // Current audio coding mode
2046 // Default: AUDIO_CODING_MODE_UNKNOWN
2047 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002048 // An identifier that can be used to match events for this device.
2049 // The incremental identifier is locally generated and guaranteed not derived
2050 // from any globally unique hardware id.
2051 // For paired devices, it stays consistent between Bluetooth toggling for the
2052 // same remote device.
2053 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2054 // session for the same remote device.
2055 // Default: 0 if the device's metric id is unknown.
2056 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002057}
2058
2059/**
2060 * Logs when there is a change in A2DP codec config for a particular remote device
2061 *
2062 * Logged from:
2063 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2064 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2065 */
2066message BluetoothA2dpCodecConfigChanged {
2067 // An identifier that can be used to match events for this device.
2068 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2069 // Salt: Randomly generated 256 bit value
2070 // Hash algorithm: HMAC-SHA256
2071 // Size: 32 byte
2072 // Default: null or empty if the device identifier is not known
2073 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2074 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2075 // Default SOURCE_CODEC_TYPE_INVALID
2076 optional int32 codec_type = 2;
2077 // Codec priroity, the higher the more preferred, -1 for disabled
2078 // Default: CODEC_PRIORITY_DEFAULT
2079 optional int32 codec_priority = 3;
2080 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2081 // Default: SAMPLE_RATE_NONE
2082 optional int32 sample_rate = 4;
2083 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2084 // Default: BITS_PER_SAMPLE_NONE
2085 optional int32 bits_per_sample = 5;
2086 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2087 // Default: CHANNEL_MODE_NONE
2088 optional int32 channel_mode = 6;
2089 // Codec specific values
2090 // Default 0
2091 optional int64 codec_specific_1 = 7;
2092 optional int64 codec_specific_2 = 8;
2093 optional int64 codec_specific_3 = 9;
2094 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002095 // An identifier that can be used to match events for this device.
2096 // The incremental identifier is locally generated and guaranteed not derived
2097 // from any globally unique hardware id.
2098 // For paired devices, it stays consistent between Bluetooth toggling for the
2099 // same remote device.
2100 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2101 // session for the same remote device.
2102 // Default: 0 if the device's metric id is unknown.
2103 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002104}
2105
2106/**
2107 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2108 * Each codec's capability is logged separately due to statsd restriction
2109 *
2110 * Logged from:
2111 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2112 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2113 */
2114message BluetoothA2dpCodecCapabilityChanged {
2115 // An identifier that can be used to match events for this device.
2116 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2117 // Salt: Randomly generated 256 bit value
2118 // Hash algorithm: HMAC-SHA256
2119 // Size: 32 byte
2120 // Default: null or empty if the device identifier is not known
2121 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2122 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2123 // Default SOURCE_CODEC_TYPE_INVALID
2124 optional int32 codec_type = 2;
2125 // Codec priroity, the higher the more preferred, -1 for disabled
2126 // Default: CODEC_PRIORITY_DEFAULT
2127 optional int32 codec_priority = 3;
2128 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2129 // in BluetoothCodecConfig
2130 // Default: empty and SAMPLE_RATE_NONE for individual item
2131 optional int32 sample_rate = 4;
2132 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2133 // in BluetoothCodecConfig
2134 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2135 optional int32 bits_per_sample = 5;
2136 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2137 // BluetoothCodecConfig
2138 // Default: empty and CHANNEL_MODE_NONE for individual item
2139 optional int32 channel_mode = 6;
2140 // Codec specific values
2141 // Default 0
2142 optional int64 codec_specific_1 = 7;
2143 optional int64 codec_specific_2 = 8;
2144 optional int64 codec_specific_3 = 9;
2145 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002146 // An identifier that can be used to match events for this device.
2147 // The incremental identifier is locally generated and guaranteed not derived
2148 // from any globally unique hardware id.
2149 // For paired devices, it stays consistent between Bluetooth toggling for the
2150 // same remote device.
2151 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2152 // session for the same remote device.
2153 // Default: 0 if the device's metric id is unknown.
2154 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002155}
2156
2157/**
2158 * Logs when A2DP failed to read from PCM source.
2159 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2160 *
2161 * Logged from:
2162 * system/bt
2163 */
2164message BluetoothA2dpAudioUnderrunReported {
2165 // An identifier that can be used to match events for this device.
2166 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2167 // Salt: Randomly generated 256 bit value
2168 // Hash algorithm: HMAC-SHA256
2169 // Size: 32 byte
2170 // Default: null or empty if the device identifier is not known
2171 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2172 // Encoding interval in nanoseconds
2173 // Default: 0
2174 optional int64 encoding_interval_nanos = 2;
2175 // Number of bytes of PCM data that could not be read from the source
2176 // Default: 0
2177 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002178 // An identifier that can be used to match events for this device.
2179 // The incremental identifier is locally generated and guaranteed not derived
2180 // from any globally unique hardware id.
2181 // For paired devices, it stays consistent between Bluetooth toggling for the
2182 // same remote device.
2183 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2184 // session for the same remote device.
2185 // Default: 0 if the device's metric id is unknown.
2186 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002187}
2188
2189/**
2190 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2191 * buffer queue is full and we have to drop data
2192 *
2193 * Logged from:
2194 * system/bt
2195 */
2196message BluetoothA2dpAudioOverrunReported {
2197 // An identifier that can be used to match events for this device.
2198 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2199 // Salt: Randomly generated 256 bit value
2200 // Hash algorithm: HMAC-SHA256
2201 // Size: 32 byte
2202 // Default: null or empty if the device identifier is not known
2203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2204 // Encoding interval in nanoseconds
2205 // Default: 0
2206 optional int64 encoding_interval_nanos = 2;
2207 // Number of buffers dropped in this event
2208 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2209 // Default: 0
2210 optional int32 num_dropped_buffers = 3;
2211 // Number of encoded buffers dropped in this event
2212 // Default 0
2213 optional int32 num_dropped_encoded_frames = 4;
2214 // Number of encoded bytes dropped in this event
2215 // Default: 0
2216 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002217 // An identifier that can be used to match events for this device.
2218 // The incremental identifier is locally generated and guaranteed not derived
2219 // from any globally unique hardware id.
2220 // For paired devices, it stays consistent between Bluetooth toggling for the
2221 // same remote device.
2222 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2223 // session for the same remote device.
2224 // Default: 0 if the device's metric id is unknown.
2225 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002226}
2227
2228/**
2229 * Logs when we receive reports regarding a device's RSSI value
2230 *
2231 * Logged from:
2232 * system/bt
2233 */
2234message BluetoothDeviceRssiReported {
2235 // An identifier that can be used to match events for this device.
2236 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2237 // Salt: Randomly generated 256 bit value
2238 // Hash algorithm: HMAC-SHA256
2239 // Size: 32 byte
2240 // Default: null or empty if the device identifier is not known
2241 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2242 // Connection handle of this connection if available
2243 // Range: 0x0000 - 0x0EFF (12 bits)
2244 // Default: 0xFFFF if the handle is unknown
2245 optional int32 connection_handle = 2;
2246 // HCI command status code if this is triggerred by hci_cmd
2247 // Default: STATUS_UNKNOWN
2248 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2249 // BR/EDR
2250 // Range: -128 ≤ N ≤ 127 (signed integer)
2251 // Units: dB
2252 // LE:
2253 // Range: -127 to 20, 127 (signed integer)
2254 // Units: dBm
2255 // Invalid when an out of range value is reported
2256 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002257 // An identifier that can be used to match events for this device.
2258 // The incremental identifier is locally generated and guaranteed not derived
2259 // from any globally unique hardware id.
2260 // For paired devices, it stays consistent between Bluetooth toggling for the
2261 // same remote device.
2262 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2263 // session for the same remote device.
2264 // Default: 0 if the device's metric id is unknown.
2265 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002266}
2267
2268/**
2269 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2270 *
2271 * Logged from:
2272 * system/bt
2273 */
2274message BluetoothDeviceFailedContactCounterReported {
2275 // An identifier that can be used to match events for this device.
2276 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2277 // Salt: Randomly generated 256 bit value
2278 // Hash algorithm: HMAC-SHA256
2279 // Size: 32 byte
2280 // Default: null or empty if the device identifier is not known
2281 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2282 // Connection handle of this connection if available
2283 // Range: 0x0000 - 0x0EFF (12 bits)
2284 // Default: 0xFFFF if the handle is unknown
2285 optional int32 connection_handle = 2;
2286 // HCI command status code if this is triggerred by hci_cmd
2287 // Default: STATUS_UNKNOWN
2288 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2289 // Number of consecutive failed contacts for a connection corresponding to the Handle
2290 // Range: uint16_t, 0-0xFFFF
2291 // Default: 0xFFFFF
2292 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002293 // An identifier that can be used to match events for this device.
2294 // The incremental identifier is locally generated and guaranteed not derived
2295 // from any globally unique hardware id.
2296 // For paired devices, it stays consistent between Bluetooth toggling for the
2297 // same remote device.
2298 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2299 // session for the same remote device.
2300 // Default: 0 if the device's metric id is unknown.
2301 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002302}
2303
2304/**
2305 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2306 *
2307 * Logged from:
2308 * system/bt
2309 */
2310message BluetoothDeviceTxPowerLevelReported {
2311 // An identifier that can be used to match events for this device.
2312 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2313 // Salt: Randomly generated 256 bit value
2314 // Hash algorithm: HMAC-SHA256
2315 // Size: 32 byte
2316 // Default: null or empty if the device identifier is not known
2317 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2318 // Connection handle of this connection if available
2319 // Range: 0x0000 - 0x0EFF (12 bits)
2320 // Default: 0xFFFF if the handle is unknown
2321 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002322 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002323 // Default: STATUS_UNKNOWN
2324 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2325 // Range: -30 ≤ N ≤ 20
2326 // Units: dBm
2327 // Invalid when an out of range value is reported
2328 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002329 // An identifier that can be used to match events for this device.
2330 // The incremental identifier is locally generated and guaranteed not derived
2331 // from any globally unique hardware id.
2332 // For paired devices, it stays consistent between Bluetooth toggling for the
2333 // same remote device.
2334 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2335 // session for the same remote device.
2336 // Default: 0 if the device's metric id is unknown.
2337 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002338}
Jack Heab86dbd22018-12-18 15:43:27 -08002339
Tej Singh5d991e12018-03-09 19:48:11 -08002340/**
Jack He1021a612019-01-20 21:22:46 -08002341 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2342 * receiving an HCI command from the host
2343 *
2344 * Logged from: system/bt
2345 */
2346message BluetoothHciTimeoutReported {
2347 // HCI command associated with this event
2348 // Default: CMD_UNKNOWN
2349 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2350}
2351
2352/**
2353 * Logs when we receive Bluetooth Link Quality Report event from the controller
2354 * See Android Bluetooth HCI specification for more details
2355 *
2356 * Note: all count and bytes field are counted since last event
2357 *
2358 * Logged from: system/bt
2359 */
2360message BluetoothQualityReportReported {
2361 // Quality report ID
2362 // Original type: uint8_t
2363 // Default: BQR_ID_UNKNOWN
2364 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2365 // Packet type of the connection
2366 // Original type: uint8_t
2367 // Default: BQR_PACKET_TYPE_UNKNOWN
2368 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2369 // Connection handle of the connection
2370 // Original type: uint16_t
2371 optional int32 connection_handle = 3;
2372 // Performing Role for the connection
2373 // Original type: uint8_t
2374 optional int32 connection_role = 4;
2375 // Current Transmit Power Level for the connection. This value is the same as the controller's
2376 // response to the HCI_Read_Transmit_Power_Level HCI command
2377 // Original type: uint8_t
2378 optional int32 tx_power_level = 5;
2379 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2380 // absolute receiver signal strength value
2381 // Original type: int8_t
2382 optional int32 rssi = 6;
2383 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2384 // channels used by the link currently
2385 // Original type: uint8_t
2386 optional int32 snr = 7;
2387 // Indicates the number of unused channels in AFH_channel_map
2388 // Original type: uint8_t
2389 optional int32 unused_afh_channel_count = 8;
2390 // Indicates the number of the channels which are interfered and quality is bad but are still
2391 // selected for AFH
2392 // Original type: uint8_t
2393 optional int32 afh_select_unideal_channel_count = 9;
2394 // Current Link Supervision Timeout Setting
2395 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2396 // Original type: uint16_t
2397 optional int32 lsto = 10;
2398 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2399 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2400 // 0x01 (Piconet Clock)
2401 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2402 // Original type: uint32_t
2403 optional int64 connection_piconet_clock = 11;
2404 // The count of retransmission
2405 // Original type: uint32_t
2406 optional int64 retransmission_count = 12;
2407 // The count of no RX
2408 // Original type: uint32_t
2409 optional int64 no_rx_count = 13;
2410 // The count of NAK (Negative Acknowledge)
2411 // Original type: uint32_t
2412 optional int64 nak_count = 14;
2413 // Controller timestamp of last TX ACK
2414 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2415 // Original type: uint32_t
2416 optional int64 last_tx_ack_timestamp = 15;
2417 // The count of Flow-off (STOP)
2418 // Original type: uint32_t
2419 optional int64 flow_off_count = 16;
2420 // Controller timestamp of last Flow-on (GO)
2421 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2422 // Original type: uint32_t
2423 optional int64 last_flow_on_timestamp = 17;
2424 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2425 // Original type: uint32_t
2426 optional int64 buffer_overflow_bytes = 18;
2427 // Buffer underflow count (in byte) since last event
2428 // Original type: uint32_t
2429 optional int64 buffer_underflow_bytes = 19;
2430}
2431
2432/**
2433 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2434 *
2435 * Notes:
2436 * - Each event can be partially filled as we might learn different pieces of device
2437 * information at different time
2438 * - Multiple device info events can be combined to give more complete picture
2439 * - When multiple device info events tries to describe the same information, the
2440 * later one wins
2441 *
2442 * Logged from:
2443 * packages/apps/Bluetooth
2444 */
Jack Heaea26982019-04-04 11:19:48 -07002445message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002446 // An identifier that can be used to match events for this device.
2447 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2448 // Salt: Randomly generated 256 bit value
2449 // Hash algorithm: HMAC-SHA256
2450 // Size: 32 byte
2451 // Default: null or empty if the device identifier is not known
2452 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2453 // Where is this device info obtained from
2454 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2455 // Name of the data source
2456 // For EXTERNAL: package name of the data source
2457 // For INTERNAL: null for general case, component name otherwise
2458 optional string source_name = 3;
2459 // Name of the manufacturer of this device
2460 optional string manufacturer = 4;
2461 // Model of this device
2462 optional string model = 5;
2463 // Hardware version of this device
2464 optional string hardware_version = 6;
2465 // Software version of this device
2466 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002467 // An identifier that can be used to match events for this device.
2468 // The incremental identifier is locally generated and guaranteed not derived
2469 // from any globally unique hardware id.
2470 // For paired devices, it stays consistent between Bluetooth toggling for the
2471 // same remote device.
2472 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2473 // session for the same remote device.
2474 // Default: 0 if the device's metric id is unknown.
2475 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002476}
2477
2478/**
2479 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2480 * device, as documented by the Bluetooth Core HCI specification
2481 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2482 * Vol 2, Part E, Page 1118
2483 *
2484 * Logged from:
2485 * system/bt
2486 */
2487message BluetoothRemoteVersionInfoReported {
2488 // Connection handle of the connection
2489 // Original type: uint16_t
2490 optional int32 connection_handle = 1;
2491 // HCI command status code
2492 // Default: STATUS_UNKNOWN
2493 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2494 // 1 byte Version of current LMP in the remote controller
2495 optional int32 lmp_version = 3;
2496 // 2 bytes LMP manufacturer code of the remote controller
2497 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2498 optional int32 lmp_manufacturer_code = 4;
2499 // 4 bytes subversion of the LMP in the remote controller
2500 optional int32 lmp_subversion = 5;
2501}
2502
2503/**
2504 * Logs when certain Bluetooth SDP attributes are discovered
2505 * Constant definitions are from:
2506 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2507 *
2508 * Current logged attributes:
2509 * - BluetoothProfileDescriptorList
2510 * - Supported Features Bitmask
2511 *
2512 * Logged from:
2513 * system/bt
2514 */
2515message BluetoothSdpAttributeReported {
2516 // An identifier that can be used to match events for this device.
2517 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2518 // Salt: Randomly generated 256 bit value
2519 // Hash algorithm: HMAC-SHA256
2520 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2521 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2522 // Original type: uint16_t
2523 optional int32 protocol_uuid = 2;
2524 // Short form UUIDs used to identify Bluetooth SDP attribute types
2525 // Original type: uint16_t
2526 optional int32 attribute_id = 3;
2527 // Attribute value for the particular attribute
2528 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002529 // An identifier that can be used to match events for this device.
2530 // The incremental identifier is locally generated and guaranteed not derived
2531 // from any globally unique hardware id.
2532 // For paired devices, it stays consistent between Bluetooth toggling for the
2533 // same remote device.
2534 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2535 // session for the same remote device.
2536 // Default: 0 if the device's metric id is unknown.
2537 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002538}
2539
2540/**
2541 * Logs when bond state of a Bluetooth device changes
2542 *
2543 * Logged from:
2544 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2545 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2546 */
2547message BluetoothBondStateChanged {
2548 // An identifier that can be used to match events for this device.
2549 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2550 // Salt: Randomly generated 256 bit value
2551 // Hash algorithm: HMAC-SHA256
2552 // Size: 32 byte
2553 // Default: null or empty if the device identifier is not known
2554 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2555 // Preferred transport type to remote dual mode device
2556 // Default: TRANSPORT_AUTO means no preference
2557 optional android.bluetooth.TransportTypeEnum transport = 2;
2558 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2559 // Default: UNKNOWN
2560 optional android.bluetooth.DeviceTypeEnum type = 3;
2561 // Current bond state (NONE, BONDING, BONDED)
2562 // Default: BOND_STATE_UNKNOWN
2563 optional android.bluetooth.BondStateEnum bond_state = 4;
2564 // Bonding sub state
2565 // Default: BOND_SUB_STATE_UNKNOWN
2566 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2567 // Unbond Reason
2568 // Default: UNBOND_REASON_UNKNOWN
2569 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002570 // An identifier that can be used to match events for this device.
2571 // The incremental identifier is locally generated and guaranteed not derived
2572 // from any globally unique hardware id.
2573 // For paired devices, it stays consistent between Bluetooth toggling for the
2574 // same remote device.
2575 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2576 // session for the same remote device.
2577 // Default: 0 if the device's metric id is unknown.
2578 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002579}
2580
2581/**
2582 * Logs there is an event related Bluetooth classic pairing
2583 *
2584 * Logged from:
2585 * system/bt
2586 */
2587message BluetoothClassicPairingEventReported {
2588 // An identifier that can be used to match events for this device.
2589 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2590 // Salt: Randomly generated 256 bit value
2591 // Hash algorithm: HMAC-SHA256
2592 // Size: 32 byte
2593 // Default: null or empty if the device identifier is not known
2594 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2595 // Connection handle of this connection if available
2596 // Range: 0x0000 - 0x0EFF (12 bits)
2597 // Default: 0xFFFF if the handle is unknown
2598 optional int32 connection_handle = 2;
2599 // HCI command associated with this event
2600 // Default: CMD_UNKNOWN
2601 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2602 // HCI event associated with this event
2603 // Default: EVT_UNKNOWN
2604 optional android.bluetooth.hci.EventEnum hci_event = 4;
2605 // HCI command status code if this is triggerred by hci_cmd
2606 // Default: STATUS_UNKNOWN
2607 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2608 // HCI reason code associated with this event
2609 // Default: STATUS_UNKNOWN
2610 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002611 // A status value related to this specific event
2612 // Default: 0
2613 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002614 // An identifier that can be used to match events for this device.
2615 // The incremental identifier is locally generated and guaranteed not derived
2616 // from any globally unique hardware id.
2617 // For paired devices, it stays consistent between Bluetooth toggling for the
2618 // same remote device.
2619 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2620 // session for the same remote device.
2621 // Default: 0 if the device's metric id is unknown.
2622 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002623}
2624
2625/**
2626 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2627 *
2628 * Logged from:
2629 * system/bt
2630 */
2631message BluetoothSmpPairingEventReported {
2632 // An identifier that can be used to match events for this device.
2633 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2634 // Salt: Randomly generated 256 bit value
2635 // Hash algorithm: HMAC-SHA256
2636 // Size: 32 byte
2637 // Default: null or empty if the device identifier is not known
2638 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2639 // SMP command sent or received over L2CAP
2640 // Default: CMD_UNKNOWN
2641 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2642 // Whether this command is sent or received
2643 // Default: DIRECTION_UNKNOWN
2644 optional android.bluetooth.DirectionEnum direction = 3;
2645 // SMP failure reason code
2646 // Default: PAIRING_FAIL_REASON_DEFAULT
2647 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002648 // An identifier that can be used to match events for this device.
2649 // The incremental identifier is locally generated and guaranteed not derived
2650 // from any globally unique hardware id.
2651 // For paired devices, it stays consistent between Bluetooth toggling for the
2652 // same remote device.
2653 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2654 // session for the same remote device.
2655 // Default: 0 if the device's metric id is unknown.
2656 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002657}
2658
2659/**
Jack He815cdba2019-01-30 17:24:55 -08002660 * Logs when a Bluetooth socket’s connection state changed
2661 *
2662 * Logged from:
2663 * system/bt
2664 */
2665message BluetoothSocketConnectionStateChanged {
2666 // An identifier that can be used to match events for this device.
2667 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2668 // Salt: Randomly generated 256 bit value
2669 // Hash algorithm: HMAC-SHA256
2670 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002671 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002672 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002673 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002674 // Default 0 when unknown or don't care
2675 optional int32 port = 2;
2676 // Socket type as mentioned in
2677 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2678 // Default: SOCKET_TYPE_UNKNOWN
2679 optional android.bluetooth.SocketTypeEnum type = 3;
2680 // Socket connection state
2681 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2682 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2683 // Number of bytes sent to remote device during this connection
2684 optional int64 tx_bytes = 5;
2685 // Number of bytes received from remote device during this connection
2686 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002687 // Socket owner's UID
2688 optional int32 uid = 7 [(is_uid) = true];
2689 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2690 // |port| must be spawned by |server_port|
2691 // Default 0 when unknown or don't care
2692 optional int32 server_port = 8;
2693 // Whether this is a server listener socket
2694 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002695 // An identifier that can be used to match events for this device.
2696 // The incremental identifier is locally generated and guaranteed not derived
2697 // from any globally unique hardware id.
2698 // For paired devices, it stays consistent between Bluetooth toggling for the
2699 // same remote device.
2700 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2701 // session for the same remote device.
2702 // Default: 0 if the device's metric id is unknown.
2703 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002704}
2705
2706/**
Jack He71426802019-04-02 13:32:52 -07002707 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2708 *
2709 * Logged from:
2710 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2711 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2712 *
2713 */
2714message BluetoothClassOfDeviceReported {
2715 // An identifier that can be used to match events for this device.
2716 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2717 // Salt: Randomly generated 256 bit value
2718 // Hash algorithm: HMAC-SHA256
2719 // Size: 32 byte
2720 // Default: null or empty if this is a server listener socket
2721 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2722 // Class of Device (CoD) value including both Major, Minor device class and service class
2723 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2724 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2725 // Default: 0
2726 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002727 // An identifier that can be used to match events for this device.
2728 // The incremental identifier is locally generated and guaranteed not derived
2729 // from any globally unique hardware id.
2730 // For paired devices, it stays consistent between Bluetooth toggling for the
2731 // same remote device.
2732 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2733 // session for the same remote device.
2734 // Default: 0 if the device's metric id is unknown.
2735 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002736}
2737
2738/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002739 * Logs when something is plugged into or removed from the USB-C connector.
2740 *
2741 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002742 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002743 */
2744message UsbConnectorStateChanged {
2745 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002746 STATE_DISCONNECTED = 0;
2747 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002748 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002749 optional State state = 1
2750 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2751 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002752 // Last active session in ms.
2753 // 0 when the port is in connected state.
2754 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002755}
2756
2757/**
2758 * Logs the reported speaker impedance.
2759 *
2760 * Logged from:
2761 * Vendor audio implementation.
2762 */
2763message SpeakerImpedanceReported {
2764 optional int32 speaker_location = 1;
2765 optional int32 impedance = 2;
2766}
2767
2768/**
2769 * Logs the report of a failed hardware.
2770 *
2771 * Logged from:
2772 * Vendor HALs.
2773 *
2774 */
2775message HardwareFailed {
2776 enum HardwareType {
2777 HARDWARE_FAILED_UNKNOWN = 0;
2778 HARDWARE_FAILED_MICROPHONE = 1;
2779 HARDWARE_FAILED_CODEC = 2;
2780 HARDWARE_FAILED_SPEAKER = 3;
2781 HARDWARE_FAILED_FINGERPRINT = 4;
2782 }
2783 optional HardwareType hardware_type = 1;
2784
Maggie White6dcd8572019-01-31 14:11:50 -08002785 /**
2786 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002787 * the same hardware_type. The specific locations are vendor defined integers,
2788 * referring to board-specific numbering schemes.
2789 */
2790 optional int32 hardware_location = 2;
2791
Maggie White6dcd8572019-01-31 14:11:50 -08002792 /**
2793 * failure_code is specific to the HardwareType of the failed hardware.
2794 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002795 */
Maggie White6dcd8572019-01-31 14:11:50 -08002796 enum HardwareErrorCode {
2797 UNKNOWN = 0;
2798 COMPLETE = 1;
2799 SPEAKER_HIGH_Z = 2;
2800 SPEAKER_SHORT = 3;
2801 FINGERPRINT_SENSOR_BROKEN = 4;
2802 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002803 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002804 }
2805 optional int32 failure_code = 3;
2806}
2807
2808/**
2809 * Log an event when the device has been physically dropped.
2810 * Reported from the /vendor partition.
2811 */
2812message PhysicalDropDetected {
2813 // Confidence that the event was actually a drop, 0 -> 100
2814 optional int32 confidence_pctg = 1;
2815 // Peak acceleration of the drop, in 1/1000s of a g.
2816 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002817 // Duration of freefall in ms
2818 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002819}
2820
2821/**
2822 * Log bucketed battery charge cycles.
2823 *
2824 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002825 * a given charge point. For example, if 10 cycle buckets are
2826 * initialized, bucket 1 is the lowest 1/10th of the battery,
2827 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002828 *
2829 * Logged from:
2830 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2831 */
2832message ChargeCyclesReported {
2833 optional int32 cycle_bucket_1 = 1;
2834 optional int32 cycle_bucket_2 = 2;
2835 optional int32 cycle_bucket_3 = 3;
2836 optional int32 cycle_bucket_4 = 4;
2837 optional int32 cycle_bucket_5 = 5;
2838 optional int32 cycle_bucket_6 = 6;
2839 optional int32 cycle_bucket_7 = 7;
2840 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002841 optional int32 cycle_bucket_9 = 9;
2842 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002843}
2844
2845/**
Howard Roa46b6582018-09-18 16:45:02 -07002846 * Log battery health snapshot.
2847 *
2848 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2849 * are snapshotted periodically over 24hrs.
2850 */
2851message BatteryHealthSnapshot {
2852 enum BatterySnapshotType {
2853 UNKNOWN = 0;
2854 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2855 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2856 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2857 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2858 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2859 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2860 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2861 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2862 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2863 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2864 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2865 }
2866 optional BatterySnapshotType type = 1;
2867 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002868 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002869 // Voltage Battery Voltage, in microVolts.
2870 optional int32 voltage_micro_volt = 3;
2871 // Current Battery current, in microAmps.
2872 optional int32 current_micro_amps = 4;
2873 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2874 optional int32 open_circuit_micro_volt = 5;
2875 // Resistance Battery Resistance, in microOhms.
2876 optional int32 resistance_micro_ohm = 6;
2877 // Level Battery Level, as % of full.
2878 optional int32 level_percent = 7;
2879}
2880
2881/**
2882 * Log slow I/O operations on the primary storage.
2883 */
2884message SlowIo {
2885 // Classifications of IO Operations.
2886 enum IoOperation {
2887 UNKNOWN = 0;
2888 READ = 1;
2889 WRITE = 2;
2890 UNMAP = 3;
2891 SYNC = 4;
2892 }
2893 optional IoOperation operation = 1;
2894
2895 // The number of slow IO operations of this type over 24 hours.
2896 optional int32 count = 2;
2897}
2898
2899/**
2900 * Log battery caused shutdown with the last recorded voltage.
2901 */
2902message BatteryCausedShutdown {
2903 // The last recorded battery voltage prior to shutdown.
2904 optional int32 last_recorded_micro_volt = 1;
2905}
2906
2907/**
Tej Singha72344992019-04-17 18:55:08 -07002908 * Logs when ThermalService receives throttling events.
2909 *
2910 * Logged from:
2911 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2912 */
2913message ThermalThrottlingSeverityStateChanged {
2914 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2915 optional android.os.TemperatureTypeEnum sensor_type = 1;
2916
2917 // The name of the temperature source. Eg. CPU0
2918 optional string sensor_name = 2;
2919
2920 // Temperature in tenths of a degree C.
2921 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2922 optional int32 temperature_deci_celsius = 3;
2923
2924 // Relative severity of the throttling, see enum definition.
2925 optional android.os.ThrottlingSeverityEnum severity = 4;
2926}
2927
2928/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002929 * Logs the duration of a davey (jank of >=700ms) when it occurs
2930 *
2931 * Logged from:
2932 * frameworks/base/libs/hwui/JankTracker.cpp
2933 */
2934message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002935 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002936 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002937
Tej Singhbb8554a2018-01-26 11:59:14 -08002938 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002939 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002940}
2941
2942/**
Bookatze5885242017-10-24 20:10:31 -07002943 * Logs phone signal strength changes.
2944 *
2945 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002946 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002947 */
2948message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002949 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2950 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002951}
2952
Yangster4ccebea2018-10-09 17:09:02 -07002953
2954/**
2955 * Logs when the phone state, sim state or signal strength changes
2956 *
2957 * Logged from:
2958 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2959 */
2960message PhoneServiceStateChanged {
2961 optional android.telephony.ServiceStateEnum state = 1;
2962 optional android.telephony.SimStateEnum sim_state = 2;
2963 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2964}
2965
2966/**
2967 * Logs when the phone becomes on or off.
2968 *
2969 * Logged from:
2970 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2971 */
2972message PhoneStateChanged {
2973 enum State {
2974 OFF = 0;
2975 ON = 1;
2976 }
2977 optional State state = 1;
2978}
2979
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002980message BackGesture {
2981 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002982 DEFAULT_BACK_TYPE = 0;
2983 COMPLETED = 1;
2984 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2985 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2986 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2987 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2988 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2989 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2990 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002991 }
2992 optional BackType type = 1;
2993
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002994 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2995 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2996 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2997 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2998 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2999 optional int32 left_boundary = 8; // left edge width + left inset
3000 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3001
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003002 enum WindowHorizontalLocation {
3003 DEFAULT_LOCATION = 0;
3004 LEFT = 1;
3005 RIGHT = 2;
3006 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003007 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003008}
3009
3010message ExclusionRectStateChanged {
3011 optional string component_name = 1; // if not available, simply packageName
3012 optional int32 requested_height = 2; // px
3013 optional int32 rejected_height = 3; // px
3014
3015 enum WindowHorizontalLocation {
3016 DEFAULT_LOCATION = 0;
3017 LEFT = 1;
3018 RIGHT = 2;
3019 }
3020 optional WindowHorizontalLocation x_location = 4;
3021 optional bool landscape = 5;
3022 optional bool splitscreen = 6;
3023 optional int32 duration_millis = 7;
3024}
3025
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003026/**
3027 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3028 *
3029 * Logged from:
3030 * packages/apps/Launcher3
3031 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003032message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003033 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003034 optional android.stats.launcher.LauncherState src_state = 2;
3035 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003036 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3037 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3038
3039 // The event id (e.g., app launch, drag and drop, long press)
3040 optional int32 event_id = 6;
3041 // The event's source or target id (e.g., icon, task, button)
3042 optional int32 target_id = 7;
3043 // If the target needs to be tracked, use this id field
3044 optional int32 instance_id = 8;
3045 optional int32 uid = 9 [(is_uid) = true];
3046 optional string package_name = 10;
3047 optional string component_name = 11;
3048
3049 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003050 optional int32 grid_x = 12 [default = -1];
3051 optional int32 grid_y = 13 [default = -1];
3052 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003053
3054 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003055 optional int32 grid_x_parent = 15 [default = -1];
3056 optional int32 grid_y_parent = 16 [default = -1];
3057 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003058
3059 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3060 optional int32 hierarchy = 18;
3061
3062 optional bool is_work_profile = 19;
3063
3064 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003065 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003066
3067 // e.g., folderLabelState can be captured in the following two fields
3068 optional int32 from_state = 21;
3069 optional int32 to_state = 22;
3070
3071 // e.g., autofilled or suggested texts that are not user entered
3072 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003073
3074 // e.g., number of contents inside a container (e.g., icons inside a folder)
3075 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003076}
3077
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003078/**
3079 * Used for snapshot of the HomeScreen UI elements
3080 *
3081 * Logged from:
3082 * packages/apps/Launcher3
3083 */
3084message LauncherStaticLayout {
3085 // The event id (e.g., snapshot, drag and drop)
3086 optional int32 event_id = 1;
3087 // The event's source or target id (e.g., icon, shortcut, widget)
3088 optional int32 target_id = 2;
3089 // If the target needs to be tracked, use this id field
3090 optional int32 instance_id = 3;
3091 optional int32 uid = 4 [(is_uid) = true];
3092 optional string package_name = 5;
3093 optional string component_name = 6;
3094
3095 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003096 optional int32 grid_x = 7 [default = -1];
3097 optional int32 grid_y = 8 [default = -1];
3098 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003099
3100 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003101 // e.g., when used with widgets target, use these values for (span_x, span_y)
3102 optional int32 grid_x_parent = 10 [default = -1];
3103 optional int32 grid_y_parent = 11 [default = -1];
3104 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003105
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003106 // UNKNOWN = 0
3107 // HOTSEAT = 1
3108 // WORKSPACE = 2
3109 // FOLDER_HOTSEAT = 3
3110 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003111 optional int32 hierarchy = 13;
3112
3113 optional bool is_work_profile = 14;
3114
3115 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3116 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003117
3118 // e.g., number of icons inside a folder
3119 optional int32 cardinality = 16;
3120
3121 // e.g., (x, y) span of the widget inside homescreen grid system
3122 optional int32 span_x = 17 [default = 1];
3123 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003124}
3125
3126/**
3127 * Logs when Wallpaper or ThemePicker UI has changed.
3128 *
3129 * Logged from:
3130 * packages/apps/ThemePicker
3131 * packages/apps/WallpaperPicker2
3132 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003133message StyleUIChanged {
3134 optional android.stats.style.Action action = 1;
3135 optional int32 color_package_hash = 2;
3136 optional int32 font_package_hash = 3;
3137 optional int32 shape_package_hash = 4;
3138 optional int32 clock_package_hash = 5;
3139 optional int32 launcher_grid = 6;
3140 optional int32 wallpaper_category_hash = 7;
3141 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003142 optional int32 color_preference = 9;
3143 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003144}
3145
David Chenc28b2bb2017-10-24 12:52:52 -07003146/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003147 * Logs when Settings UI has changed.
3148 *
3149 * Logged from:
3150 * packages/apps/Settings
3151 */
3152message SettingsUIChanged {
3153 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003154 * Where this SettingsUIChange event comes from. For example, if
3155 * it's a PAGE_VISIBLE event, where the page is opened from.
3156 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003157 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003158
3159 /**
3160 * What the UI action is.
3161 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003162 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003163
3164 /**
3165 * Where the action is happening
3166 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003167 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003168
3169 /**
3170 * What preference changed in this event.
3171 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003172 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003173
3174 /**
3175 * The new value of the changed preference.
3176 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003177 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003178}
3179
3180/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003181 * Logs basic timing information about touch events.
3182 * Reported at most every 5 minutes while device is being interacted with.
3183 *
3184 * Logged from:
3185 * frameworks/native/services/inputflinger
3186 */
3187message TouchEventReported {
3188 /**
3189 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003190 * and the standard deviation of the time spent processing touchscreen events
3191 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003192 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003193 * On supported devices, the starting point is taken during the hard interrupt inside the
3194 * kernel touch driver. On all other devices, the starting point is taken inside
3195 * the kernel's input event subsystem upon receipt of the input event.
3196 * The ending point is taken inside InputDispatcher, just after the input event
3197 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003198 */
3199 // Minimum value
3200 optional float latency_min_micros = 1;
3201 // Maximum value
3202 optional float latency_max_micros = 2;
3203 // Average value
3204 optional float latency_mean_micros = 3;
3205 // Standard deviation
3206 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003207 // Number of touch events (input_event) in this report
3208 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003209}
3210
3211/**
Philip Quinn0eded622019-01-29 12:46:28 -08003212 * Logs gesture classification and timing information for touch events.
3213 *
3214 * Logged from:
3215 * frameworks/base/core/java/android/view/GestureDetector.java
3216 * frameworks/base/core/java/android/view/View.java
3217 */
3218message TouchGestureClassified {
3219 // The source of the classification (e.g. Java class name).
3220 optional string source = 1;
3221
3222 enum Classification {
3223 UNKNOWN_CLASSIFICATION = 0;
3224 SINGLE_TAP = 1;
3225 DOUBLE_TAP = 2;
3226 LONG_PRESS = 3;
3227 DEEP_PRESS = 4;
3228 SCROLL = 5;
3229 }
3230 // The classification of the gesture.
3231 optional Classification classification = 2;
3232
3233 // The interval from the start of a touch event stream until the
3234 // classification was made.
3235 optional int32 latency_millis = 3;
3236
3237 // The distance from the location of the first touch event to the
3238 // location of the touch event when the classification was made.
3239 optional float displacement_px = 4;
3240}
3241
3242/**
David Chenc28b2bb2017-10-24 12:52:52 -07003243 * Logs that a setting was updated.
3244 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003245 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003246 * The tag and is_default allow resetting of settings to default values based on the specified
3247 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3248 */
3249message SettingChanged {
3250 // The name of the setting.
3251 optional string setting = 1;
3252
3253 // The change being imposed on this setting. May represent a number, eg "3".
3254 optional string value = 2;
3255
3256 // The new value of this setting. For most settings, this is same as value. For some settings,
3257 // value is +X or -X where X represents an element in a set. For example, if the previous value
3258 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3259 // The +/- feature is currently only used for location_providers_allowed.
3260 optional string new_value = 3;
3261
3262 // The previous value of this setting.
3263 optional string prev_value = 4;
3264
3265 // The tag used with the is_default for resetting sets of settings. This is generally null.
3266 optional string tag = 5;
3267
Bookatz90867622018-01-31 15:05:57 -08003268 // True if this setting with tag should be resettable.
3269 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003270
David Chenbd789912018-03-16 17:19:55 -07003271 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003272 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003273
3274 enum ChangeReason {
3275 UPDATED = 1; // Updated can be an insertion or an update.
3276 DELETED = 2;
3277 }
3278 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003279}
Chenjie Yub3dda412017-10-24 13:41:59 -07003280
Chenjie Yu05013b32017-11-21 10:21:41 -08003281/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003282 * Logs activity going to foreground or background
3283 *
3284 * Logged from:
3285 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3286 */
3287message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003288 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003289 optional string pkg_name = 2;
3290 optional string class_name = 3;
3291
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003292 enum State {
3293 BACKGROUND = 0;
3294 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003295 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003296 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003297}
David Chenc8a43242017-10-17 16:23:28 -07003298
3299/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003300 * Logs when a volume entered low Storage state.
3301 * Logged from:
3302 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3303 */
3304message LowStorageStateChanged {
3305 // Volume that ran out of storage.
3306 optional string volume_description = 1;
3307
3308 enum State {
3309 UNKNOWN = 0;
3310 OFF = 1;
3311 ON = 2;
3312 }
3313 optional State state = 2;
3314}
3315
3316/**
3317 * Logs when an app is downgraded.
3318 * Logged from:
3319 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3320 */
3321message AppDowngraded {
3322 optional string package_name = 1;
3323 // Size of the package (all data) before being downgraded.
3324 optional int64 size_in_bytes_before = 2;
3325 // Size of the package (all data) after being downgraded.
3326 optional int64 size_in_bytes_after = 3;
3327
3328 optional bool aggressive = 4;
3329}
3330
3331/**
3332 * Logs when an app is optimized after being downgraded.
3333 * Logged from:
3334 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3335 */
3336message AppOptimizedAfterDowngraded {
3337 optional string package_name = 1;
3338}
3339
3340/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003341 * Logs whenever an app is installed on external storage.
3342 * Logged from:
3343 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3344 */
3345message AppInstallOnExternalStorageReported {
3346 // The type of external storage.
3347 optional android.stats.storage.ExternalStorageType storage_type = 1;
3348 // The name of the package that is installed on the sd card.
3349 optional string package_name = 2;
3350}
3351
3352/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003353 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003354 * Logged from:
3355 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3356 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003357message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003358 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003359
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003360 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003361
3362 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003363 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003364 optional string process_name = 3;
3365
3366 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003367 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003368
3369 optional string package_name = 5;
3370
3371 enum InstantApp {
3372 UNAVAILABLE = 0;
3373 FALSE = 1;
3374 TRUE = 2;
3375 }
3376 optional InstantApp is_instant_app = 6;
3377
3378 enum ForegroundState {
3379 UNKNOWN = 0;
3380 BACKGROUND = 1;
3381 FOREGROUND = 2;
3382 }
3383 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003384
3385 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003386}
David Chen9e3808c2017-11-20 17:25:34 -08003387
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003388/**
3389 * Logs when a WTF (What a Terrible Failure) happened.
3390 * Logged from:
3391 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3392 */
3393message WTFOccurred {
3394 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003395
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003396 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003397
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003398 // The name of the process.
3399 // system_server if it is not by an app
3400 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003401
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003402 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003403 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003404
3405 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003406}
3407
3408/**
3409 * Logs when system server reports low memory.
3410 * Logged from:
3411 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3412 */
3413message LowMemReported {
3414}
3415
3416/**
3417 * Logs when an app ANR (App Not Responding) occurs.
3418 * Logged from:
3419 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3420 */
3421message ANROccurred {
3422 optional int32 uid = 1 [(is_uid) = true];
3423
3424 optional string process_name = 2;
3425
3426 optional string short_component_name = 3;
3427
3428 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003429
3430 enum InstantApp {
3431 UNAVAILABLE = 0;
3432 FALSE = 1;
3433 TRUE = 2;
3434 }
3435 optional InstantApp is_instant_app = 5;
3436
3437 enum ForegroundState {
3438 UNKNOWN = 0;
3439 BACKGROUND = 1;
3440 FOREGROUND = 2;
3441 }
3442 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003443
3444 optional android.server.ErrorSource error_source = 7;
3445
3446 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003447}
3448
Bookatza7020bd2018-08-28 16:29:35 -07003449/**
3450 * Logs when the vibrator state changes.
3451 * Logged from:
3452 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3453 */
3454message VibratorStateChanged {
3455 repeated AttributionNode attribution_node = 1;
3456
3457 enum State {
3458 OFF = 0;
3459 ON = 1;
3460 }
3461 optional State state = 2;
3462
3463 // Duration (in milliseconds) requested to keep the vibrator on.
3464 // Only applicable for State == ON.
3465 optional int64 duration_millis = 3;
3466}
3467
David Chen0a368b22017-12-06 16:28:16 -08003468/*
3469 * Allows other apps to push events into statsd.
3470 * Logged from:
3471 * frameworks/base/core/java/android/util/StatsLog.java
3472 */
David Chen0b5c90c2018-01-25 16:51:49 -08003473message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003474 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003475 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003476
3477 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3478 optional int32 label = 2;
3479
3480 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3481 // predicates for the metrics).
3482 enum State {
3483 UNKNOWN = 0;
3484 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3485 STOP = 2;
3486 START = 3;
3487 }
3488 optional State state = 3;
3489}
3490
David Chen9e3808c2017-11-20 17:25:34 -08003491/**
Bookatz7948c872018-09-04 12:58:33 -07003492 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3493 * For example, this could be due to the user manually changing the time.
3494 *
3495 * Logged from:
3496 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3497 */
3498message WallClockTimeShifted {
3499 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3500 optional int64 wall_clock_timestamp_millis = 1;
3501}
3502
3503/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003504 * Logs when statsd detects an anomaly.
3505 *
3506 * Logged from:
3507 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3508 */
3509message AnomalyDetected {
3510 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003511 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003512
Yangster-mac94e197c2018-01-02 16:03:03 -08003513 // Id of the config whose anomaly detection alert fired.
3514 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003515
Yangster-mac94e197c2018-01-02 16:03:03 -08003516 // Id of the alert (i.e. name of the anomaly that was detected).
3517 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003518}
3519
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003520message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003521 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003522 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003523
3524 // The app package name.
3525 optional string pkg_name = 2;
3526
3527 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003528 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003529 WARM = 1;
3530 HOT = 2;
3531 COLD = 3;
3532 }
3533 // The transition type.
3534 optional TransitionType type = 3;
3535
3536 // The activity name.
3537 optional string activity_name = 4;
3538
3539 // The name of the calling app. Empty if not set.
3540 optional string calling_pkg_name = 5;
3541
3542 // Whether the app is an instant app.
3543 optional bool is_instant_app = 6;
3544
3545 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003546 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003547
Bookatz80d11a02018-01-16 10:46:35 -08003548 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003549
David Chen0b5c90c2018-01-25 16:51:49 -08003550 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003551 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003552 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003553 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003554 optional int32 bind_application_delay_millis = 11;
3555 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003556
3557 // Empty if not set.
3558 optional string launch_token = 13;
3559
Calin Juravle759fbda2018-02-20 19:52:30 +00003560 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003561 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003562
3563 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003564 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003565}
3566
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003567message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003568 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003569 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003570
3571 // The app package name.
3572 optional string pkg_name = 2;
3573
3574 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003575 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003576 WARM = 1;
3577 HOT = 2;
3578 COLD = 3;
3579 }
3580 // The transition type.
3581 optional TransitionType type = 3;
3582
3583 // The activity name.
3584 optional string activity_name = 4;
3585}
3586
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003587message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003588 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003589 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003590
3591 // The app package name.
3592 optional string pkg_name = 2;
3593
3594 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003595 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003596 WITH_BUNDLE = 1;
3597 WITHOUT_BUNDLE = 2;
3598 }
3599 // The transition type.
3600 optional TransitionType type = 3;
3601
3602 // The activity name.
3603 optional string activity_name = 4;
3604
3605 optional bool transition_process_running = 5;
3606
3607 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003608 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003609}
3610
Bookatz8fcd09a2017-12-18 13:01:10 -08003611/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003612 * Logs a picture-in-picture action
3613 * Logged from:
3614 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3615 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3616 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3617 */
3618message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003619 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003620 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003621
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003622 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003623
Chenjie Yu52cacc62017-12-08 18:11:45 -08003624 enum State {
3625 ENTERED = 1;
3626 EXPANDED_TO_FULL_SCREEN = 2;
3627 MINIMIZED = 3;
3628 DISMISSED = 4;
3629 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003630 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003631}
3632
3633/**
Chenjie Yue8904192017-12-08 19:12:57 -08003634 * Logs overlay action
3635 * Logged from:
3636 * services/core/java/com/android/server/wm/Session.java
3637 */
3638message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003639 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003640
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003641 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003642
3643 optional bool using_alert_window = 3;
3644
3645 enum State {
3646 ENTERED = 1;
3647 EXITED = 2;
3648 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003649 optional State state = 4
3650 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003651}
3652
Adam Bookatz38767932020-02-05 12:13:40 -08003653/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003654 * Logs foreground service starts and stops.
3655 * Note that this is not when a service starts or stops, but when it is
3656 * considered foreground.
3657 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003658 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003659 */
3660message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003661 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003662 // package_name + "/" + class_name
3663 optional string short_name = 2;
3664
3665 enum State {
3666 ENTER = 1;
3667 EXIT = 2;
3668 }
3669 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003670
3671 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3672 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3673 optional bool allow_while_in_use_permission = 4;
3674}
3675
3676/**
3677 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3678 * A foreground service session is any continuous period during which the uid holds at least one
3679 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3680 * Accesses initiated while the uid is in the TOP state are ignored.
3681 * Sessions with no attempted accesses are not logged.
3682 * Logged from
3683 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3684 */
3685message ForegroundServiceAppOpSessionEnded {
3686 optional int32 uid = 1 [(is_uid) = true];
3687
3688 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003689 // Only following four ops are logged
3690 // COARSE_LOCATION = 0
3691 // FINE_LOCATION = 1
3692 // CAMERA = 26
3693 // RECORD_AUDIO = 27
3694 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003695
3696 // The uid's permission mode for accessing the AppOp during this fgs session.
3697 enum Mode {
3698 MODE_UNKNOWN = 0;
3699 MODE_ALLOWED = 1; // Always allowed
3700 MODE_IGNORED = 2; // Denied
3701 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3702 }
3703 optional Mode app_op_mode = 3;
3704
3705 // Number of times this AppOp was requested and allowed.
3706 optional int32 count_ops_accepted = 4;
3707 // Number of times this AppOp was requested but denied.
3708 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003709}
3710
Chenjie Yue8904192017-12-08 19:12:57 -08003711/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003712 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3713 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3714 * attributed back to the parent (host) uid. One example is Chrome.
3715 *
3716 * Logged from:
3717 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3718 */
3719message IsolatedUidChanged {
3720 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003721 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003722 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003723 optional int32 parent_uid = 1;
3724
3725 optional int32 isolated_uid = 2;
3726
3727 // We expect an isolated uid to be removed before if it's used for another parent uid.
3728 enum Event {
3729 REMOVED = 0;
3730 CREATED = 1;
3731 }
3732 optional Event event = 3;
3733}
3734
3735/*
3736 * Logs the reception of an incoming network packet causing the main system to wake up for
3737 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3738 * and processed by WakeupController.cpp.
3739 */
3740message PacketWakeupOccurred {
3741 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3742 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003743 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003744 // The interface name on which the packet was received.
3745 optional string iface = 2;
3746 // The ethertype value of the packet.
3747 optional int32 ethertype = 3;
3748 // String representation of the destination MAC address of the packet.
3749 optional string destination_hardware_address = 4;
3750 // String representation of the source address of the packet if this was an IP packet.
3751 optional string source_ip = 5;
3752 // String representation of the destination address of the packet if this was an IP packet.
3753 optional string destination_ip = 6;
3754 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3755 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3756 // families.
3757 optional int32 ip_next_header = 7;
3758 // The source port if this was a TCP or UDP packet.
3759 optional int32 source_port = 8;
3760 // The destination port if this was a TCP or UDP packet.
3761 optional int32 destination_port = 9;
3762}
3763
3764/*
3765 * Logs the memory stats for an app on startup.
3766 * Logged from:
3767 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3768 */
3769message AppStartMemoryStateCaptured {
3770 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003771 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772
3773 // The process name.
3774 optional string process_name = 2;
3775
3776 // The activity name.
3777 optional string activity_name = 3;
3778
3779 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003780 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003781
3782 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003783 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003784
3785 // RSS
3786 optional int64 rss_in_bytes = 6;
3787
3788 // CACHE
3789 optional int64 cache_in_bytes = 7;
3790
3791 // SWAP
3792 optional int64 swap_in_bytes = 8;
3793}
3794
3795/*
3796 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3797 * for LMK event.
3798 * Logged from:
3799 * system/core/lmkd/lmkd.c
3800 */
3801message LmkStateChanged {
3802 enum State {
3803 UNKNOWN = 0;
3804 START = 1;
3805 STOP = 2;
3806 }
3807 optional State state = 1;
3808}
3809
3810/*
3811 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3812 * Logged from:
3813 * system/core/lmkd/lmkd.c
3814 */
3815message LmkKillOccurred {
3816 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003817 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818
3819 // The process name.
3820 optional string process_name = 2;
3821
3822 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003823 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003824
3825 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003826 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003827
3828 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003829 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003830
3831 // RSS
3832 optional int64 rss_in_bytes = 6;
3833
3834 // CACHE
3835 optional int64 cache_in_bytes = 7;
3836
3837 // SWAP
3838 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003839
3840 // The elapsed real time of start of the process.
3841 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003842
3843 // Min oom adj score considered by lmkd.
3844 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003845}
3846
Rajeev Kumar51b54602018-03-01 12:18:26 -08003847/*
3848 * Logs when the ActivityManagerService detects that an app died.
3849 *
3850 * Logged from:
3851 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3852 */
3853message AppDied {
3854 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003855 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003856}
3857
Howard Ro21a039c2018-08-06 14:55:47 -07003858/**
3859 * An atom for generic metrics logging. Available from Android Q.
3860 */
3861message GenericAtom {
3862 // The uid of the application that sent this custom atom.
3863 optional int32 uid = 1 [(is_uid) = true];
3864
3865 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003866 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003867}
3868
Tej Singhd6d6d772018-09-05 17:41:25 -07003869/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003870 * Atom for simple logging of user interaction and impression events, such as "the user touched
3871 * this button" or "this dialog was displayed".
3872 * Keep the UI event stream clean: don't use for system or background events.
3873 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003874 *
3875 * Logged from:
3876 * frameworks/base/services/core/java/com/android/server/
3877 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003878 */
3879message UiEventReported {
3880 // The event_id.
3881 optional int32 event_id = 1;
3882 // The event's source or target uid and package, if applicable.
3883 // For example, the package posting a notification, or the destination package of a share.
3884 optional int32 uid = 2 [(is_uid) = true];
3885 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003886 // An identifier used to disambiguate which logs refer to a particular instance of some
3887 // UI element. Useful when there might be multiple instances simultaneously active.
3888 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003889}
3890
3891/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003892 * Reports a notification was created or updated.
3893 *
3894 * Logged from:
3895 * frameworks/base/services/core/java/com/android/server/notification/
3896 */
3897message NotificationReported {
3898 // The event_id (as for UiEventReported).
3899 optional int32 event_id = 1;
3900 // The notifying app's uid and package.
3901 optional int32 uid = 2 [(is_uid) = true];
3902 optional string package_name = 3;
3903 // A small system-assigned identifier for the notification.
3904 // Locally probably-unique, but expect collisions across users and/or days.
3905 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003906 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3907 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003908
3909 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003910 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3911 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3912 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003913
3914 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003915 optional string category = 10; // App-assigned notification category (API-defined strings)
3916 optional int32 style = 11; // App-assigned notification style
3917 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003918
3919 // Ordering, importance and interruptiveness
3920
Will Brockman7614f6962020-02-10 19:43:03 -05003921 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003922
Will Brockman7614f6962020-02-10 19:43:03 -05003923 optional android.stats.sysui.NotificationImportance importance = 14;
3924 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003925
3926 enum NotificationImportanceExplanation {
3927 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3928 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3929 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3930 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3931 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3932 // Like _APP, but based on pre-channels priority signal.
3933 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3934 }
3935
Will Brockman7614f6962020-02-10 19:43:03 -05003936 optional NotificationImportanceExplanation importance_source = 16;
3937 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3938 optional NotificationImportanceExplanation importance_initial_source = 18;
3939 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3940 optional int32 assistant_hash = 20;
3941 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003942}
3943
3944message Notification {
3945 // The notifying app's uid and package.
3946 optional int32 uid = 1 [(is_uid) = true];
3947 optional string package_name = 2;
3948 // A small system-assigned identifier for the notification.
3949 optional int32 instance_id = 3;
3950
3951 // Grouping information.
3952 optional int32 group_instance_id = 4;
3953 optional bool is_group_summary = 5;
3954
3955 // The section of the shade that the notification is in.
3956 // See NotificationSectionsManager.PriorityBucket.
3957 enum NotificationSection {
3958 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003959 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003960 SECTION_MEDIA_CONTROLS = 2;
3961 SECTION_PEOPLE = 3;
3962 SECTION_ALERTING = 4;
3963 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003964 }
3965 optional NotificationSection section = 6;
3966}
3967
3968message NotificationList {
3969 repeated Notification notifications = 1; // An ordered sequence of notifications.
3970}
3971
3972/**
3973 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3974 *
3975 * Logged from:
3976 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3977 */
3978message NotificationPanelReported {
3979 // The event_id (as for UiEventReported).
3980 optional int32 event_id = 1;
3981 optional int32 num_notifications = 2;
3982 // The notifications in the panel, in the order that they appear there.
3983 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3984}
3985
3986/**
3987 * Reports a notification channel, or channel group, was created, updated, or deleted.
3988 *
3989 * Logged from:
3990 * frameworks/base/services/core/java/com/android/server/notification/
3991 */
3992message NotificationChannelModified {
3993 // The event_id (as for UiEventReported).
3994 optional int32 event_id = 1;
3995 // The notifying app's uid and package.
3996 optional int32 uid = 2 [(is_uid) = true];
3997 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003998 // Hash of app-assigned notification channel ID or channel-group ID
3999 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004000 // Previous importance setting, if applicable
4001 optional android.stats.sysui.NotificationImportance old_importance = 5;
4002 // New importance setting
4003 optional android.stats.sysui.NotificationImportance importance = 6;
4004}
4005
4006
4007/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004008 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004009 *
4010 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004011 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004012 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004013message BiometricAcquired {
4014 // Biometric modality that was acquired.
4015 optional android.hardware.biometrics.ModalityEnum modality = 1;
4016 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4017 optional int32 user = 2;
4018 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4019 optional bool is_crypto = 3;
4020 // Action that the device is performing. Acquired messages are only expected for enroll and
4021 // authenticate. Other actions may indicate an error.
4022 optional android.hardware.biometrics.ActionEnum action = 4;
4023 // The client that this acquisition was received for.
4024 optional android.hardware.biometrics.ClientEnum client = 5;
4025 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4026 optional int32 acquire_info = 6;
4027 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4028 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004029 // Dictates if this message should trigger additional debugging.
4030 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004031}
4032
4033/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004034 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004035 *
4036 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004037 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004038 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004039message BiometricAuthenticated {
4040 // Biometric modality that was used.
4041 optional android.hardware.biometrics.ModalityEnum modality = 1;
4042 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4043 optional int32 user = 2;
4044 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4045 // storage.
4046 optional bool is_crypto = 3;
4047 // The client that this acquisition was received for.
4048 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004049 // If authentication requires user confirmation. See BiometricPrompt's
4050 // setRequireConfirmation(bool) method.
4051 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004052
Kevin Chyn1741a072019-01-17 11:54:40 -08004053 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004054 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004055 REJECTED = 1;
4056 PENDING_CONFIRMATION = 2;
4057 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004058 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004059
4060 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004061 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004062 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4063 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4064 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4065 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004066 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004067 // Dictates if this message should trigger additional debugging.
4068 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004069}
4070
4071/**
4072 * Logs when a biometric error occurs.
4073 *
4074 * Logged from:
4075 * frameworks/base/services/core/java/com/android/server/biometrics
4076 */
4077message BiometricErrorOccurred {
4078 // Biometric modality that was used.
4079 optional android.hardware.biometrics.ModalityEnum modality = 1;
4080 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4081 optional int32 user = 2;
4082 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4083 optional bool is_crypto = 3;
4084 // Action that the device is performing.
4085 optional android.hardware.biometrics.ActionEnum action = 4;
4086 // The client that this acquisition was received for.
4087 optional android.hardware.biometrics.ClientEnum client = 5;
4088 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4089 // are unique to modality.
4090 optional int32 error_info = 6;
4091 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4092 // by the vendor and not specified by the HIDL interface.
4093 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004094 // Dictates if this message should trigger additional debugging.
4095 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004096 // Time spent during the authentication attempt.
4097 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004098}
4099
4100/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004101 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004102 * Logged from:
4103 * frameworks/base/services/core/java/com/android/server/biometrics
4104 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004105message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004106 // Biometric modality.
4107 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004108 // Type of issue detected.
4109 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004110 // Dictates if this message should trigger additional debugging.
4111 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004112}
Howard Ro688ae182018-09-25 00:09:36 -07004113
joshmccloskey6f952b22019-03-25 20:59:35 -07004114/**
4115 * Logs when a biometric enrollment occurs.
4116 *
4117 * Logged from:
4118 * frameworks/base/services/core/java/com/android/server/biometrics
4119 */
4120message BiometricEnrolled {
4121 // Biometric modality that was used.
4122 optional android.hardware.biometrics.ModalityEnum modality = 1;
4123 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4124 optional int32 user = 2;
4125 // The amount of time the enrollment took in milliseconds.
4126 optional int64 latency_millis = 3;
4127 // Whether or not the enrollment was successful.
4128 optional bool success = 4;
4129}
4130
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004131/*
Tej Singh0d176952019-01-16 19:10:54 -08004132 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004133 */
Tej Singh0d176952019-01-16 19:10:54 -08004134message FlagFlipUpdateOccurred {
4135 // If the event is from a flag config package, specify the package name.
4136 optional string flag_flip_package_name = 1;
4137
4138 // The order id of the package
4139 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004140}
4141
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004142/**
4143 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004144 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004145 */
4146message TrainExperimentIds {
4147 repeated int64 experiment_id = 1;
4148}
4149
Yangster-macb89807e2018-11-15 21:10:57 -08004150/*
4151 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004152 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004153 */
4154message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004155 // Name of the train.
4156 optional string train_name = 1;
4157 // Version code for a "train" of packages that need to be installed atomically
4158 optional int64 train_version_code = 2;
4159 // After installation of this package, device requires a restart.
4160 optional bool requires_staging = 3;
4161 // Rollback should be enabled for this install.
4162 optional bool rollback_enabled = 4;
4163 // Requires low latency monitoring if possible.
4164 optional bool requires_low_latency_monitor = 5;
4165
Yangster-macb89807e2018-11-15 21:10:57 -08004166 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004167 UNKNOWN = 0;
4168 INSTALL_REQUESTED = 1;
4169 INSTALL_STARTED = 2;
4170 INSTALL_STAGED_NOT_READY = 3;
4171 INSTALL_STAGED_READY = 4;
4172 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004173 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4174 // and INSTALL_FAILURE_COMMIT.
4175 INSTALL_FAILURE = 6 [deprecated = true];
4176 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004177 INSTALL_CANCELLED = 7;
4178 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004179 INSTALLER_ROLLBACK_INITIATED = 9;
4180 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4181 INSTALLER_ROLLBACK_STAGED = 11;
4182 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4183 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4184 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4185 INSTALLER_ROLLBACK_SUCCESS = 15;
4186 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004187 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4188 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4189 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4190 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4191 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4192 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004193 INSTALL_FAILURE_DOWNLOAD = 23;
4194 INSTALL_FAILURE_STATE_MISMATCH = 24;
4195 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004196 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004197 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004198 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004199 // Possible experiment ids for monitoring this push.
4200 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4201 // user id
4202 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004203 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004204 // Whether or not this is a rollback event
4205 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004206}
4207
Tej Singhc9203082019-05-03 13:42:23 -07004208/* Test atom, is not logged anywhere */
4209message TestAtomReported {
4210 repeated AttributionNode attribution_node = 1;
4211 optional int32 int_field = 2;
4212 optional int64 long_field = 3;
4213 optional float float_field = 4;
4214 optional string string_field = 5;
4215 optional bool boolean_field = 6;
4216 enum State {
4217 UNKNOWN = 0;
4218 OFF = 1;
4219 ON = 2;
4220 }
4221 optional State state = 7;
4222 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4223}
4224
Maggie Whitefc1aa592018-11-28 21:55:23 -08004225/** Represents USB port overheat event. */
4226message UsbPortOverheatEvent {
4227 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4228 optional int32 plug_temperature_deci_c = 1;
4229
4230 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4231 optional int32 max_temperature_deci_c = 2;
4232
4233 /* Time between USB plug event and overheat threshold trip, in seconds. */
4234 optional int32 time_to_overheat_secs = 3;
4235
4236 /* Time between overheat threshold trip and hysteresis, in seconds. */
4237 optional int32 time_to_hysteresis_secs = 4;
4238
4239 /* Time between hysteresis and active mitigation ending, in seconds. */
4240 optional int32 time_to_inactive_secs = 5;
4241};
4242
Maggie White8735b852019-01-18 11:40:49 -08004243/**
4244 * Logs total effective full charge and discharge cycles on a battery.
4245 * Here are some examples of one effective cycle:
4246 * 1) the battery charges from 0% to 100% and drains back to 0%,
4247 * 2) charging from 50% to 100% and draining back to 50% twice.
4248 * Pulled from:
4249 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4250 */
4251message BatteryCycleCount {
4252 /* Number of total charge and discharge cycles on the system battery. */
4253 optional int32 cycle_count = 1;
4254}
4255
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004256/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004257 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4258 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004259 * Pulled from:
4260 * StatsCompanionService
4261 */
4262
Carmen Agimof12dec122019-03-06 16:14:38 +00004263message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004264
Carmen Agimof12dec122019-03-06 16:14:38 +00004265 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004266 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004267 PUBLIC = 1;
4268 PRIVATE = 2;
4269 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004270 }
4271
Carmen Agimof12dec122019-03-06 16:14:38 +00004272 // The type of external storage.
4273 optional android.stats.storage.ExternalStorageType storage_type = 1;
4274 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4275 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004276 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004277 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004278}
4279
Yangster-macb89807e2018-11-15 21:10:57 -08004280/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004281 * Logs when a connection becomes available and lost.
4282 * Logged in StatsCompanionService.java
4283 */
4284message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004285 // Id of the network.
4286 optional int32 net_id = 1;
4287
4288 enum State {
4289 UNKNOWN = 0;
4290 CONNECTED = 1;
4291 DISCONNECTED = 2;
4292 }
4293 // Connected state of a network.
4294 optional State state = 2;
4295}
4296
4297/**
4298 * Logs when a service starts and stops.
4299 * Logged from:
4300 * services/core/java/com/android/server/am/ActiveServices.java
4301 */
4302message ServiceStateChanged {
4303
4304 optional int32 uid = 1 [(is_uid) = true];
4305
4306 optional string package_name = 2;
4307
4308 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004309
4310 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004311 START = 1;
4312 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004313 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004314
4315 optional State state = 4;
4316}
4317
4318/**
4319 * Logs when a service is launched.
4320 * Logged from:
4321 * services/core/java/com/android/server/am/ActiveServices.java
4322 */
4323message ServiceLaunchReported {
4324
4325 optional int32 uid = 1 [(is_uid) = true];
4326
4327 optional string package_name = 2;
4328
4329 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004330}
Howard Ro688ae182018-09-25 00:09:36 -07004331
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004332/**
4333 * Logs when a hidden API is used.
4334 *
4335 * Logged from:
4336 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4337 */
4338message HiddenApiUsed {
4339 // The uid of the app making the hidden access.
4340 optional int32 uid = 1 [(is_uid) = true];
4341
4342 // Signature of the method or field accessed.
4343 optional string signature = 2;
4344
4345 enum AccessMethod {
4346 NONE = 0;
4347 REFLECTION = 1;
4348 JNI = 2;
4349 LINKING = 3;
4350 }
4351
4352 // Type of access.
4353 optional AccessMethod access_method = 3;
4354
4355 // Whether the access was prevented or not.
4356 optional bool access_denied = 4;
4357}
4358
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004359/**
4360 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4361 * - When user sees privacy chip
4362 * - When user clicks privacy chip
4363 * - How does the user exit the Privacy Dialog
4364 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004365 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4366 */
4367message PrivacyIndicatorsInteracted {
4368
4369 enum Type {
4370 UNKNOWN = 0;
4371 CHIP_VIEWED = 1;
4372 CHIP_CLICKED = 2;
4373 DIALOG_PRIVACY_SETTINGS = 3;
4374 DIALOG_DISMISS = 4;
4375 DIALOG_LINE_ITEM = 5;
4376 }
4377
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004378 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004379
4380 // Used if the type is LINE_ITEM
4381 optional string package_name = 2;
4382}
4383
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004384/**
4385 * Logs information about a package that is moved from the internal to external storage and vice
4386 * versa.
4387 * It logs the package name, the type of the external storage where the package is installed
4388 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4389 * and the move type: if it's from internal to external or the other way around.
4390 *
4391 * Logged from:
4392 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4393 */
4394message AppMovedStorageReported {
4395 enum MoveType {
4396 UNKNOWN = 0;
4397 TO_EXTERNAL = 1;
4398 TO_INTERNAL = 2;
4399 }
4400 // The type of the external storage.
4401 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4402 // The type of move.
4403 optional MoveType move_type = 2;
4404 // The name of the package that was moved.
4405 optional string package_name = 3;
4406}
4407
jianjin8f2dee02019-03-29 14:03:08 -07004408/**
4409 * Logs when system server watchdog occurs.
4410 * Logged from:
4411 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4412 */
4413message SystemServerWatchdogOccurred {
4414 optional string subject = 1;
4415}
4416
4417/**
4418 * Logs when new file added to tombstones.
4419 * Logged from:
4420 * frameworks/base/core/java/com/android/server/BootReceiver.java
4421 */
4422message TombStoneOccurred {
4423}
4424
Hai Zhang5d3328d2019-04-13 21:25:06 +08004425/*
4426 * Information about a role request
4427 *
4428 * Logged from:
4429 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4430 */
4431message RoleRequestResultReported {
4432 // UID of application requesting the role
4433 optional int32 requesting_uid = 1;
4434
4435 // Package name of application requesting the role
4436 optional string requesting_package_name = 2;
4437
4438 // The role to be granted
4439 optional string role_name = 3;
4440
4441 // The count of applications qualifying for the role
4442 optional int32 qualifying_count = 4;
4443
4444 // UID of application current granted the role
4445 optional int32 current_uid = 5;
4446
4447 // Package name of application current granted the role
4448 optional string current_package_name = 6;
4449
4450 // UID of another application that user chose to grant the role to, instead of the requesting
4451 // application
4452 optional int32 granted_another_uid = 7;
4453
4454 // Package name of another application that user chose to grant the role to, instead of the
4455 // requesting application
4456 optional string granted_another_package_name = 8;
4457
4458 enum Result {
4459 UNDEFINED = 0;
4460 // role request was ignored
4461 IGNORED = 1;
4462 // role request was ignored because it's already granted
4463 IGNORED_ALREADY_GRANTED = 2;
4464 // role request was ignored because the application isn't qualified
4465 IGNORED_NOT_QUALIFIED = 3;
4466 // role request was ignored because user said it should be always denied
4467 IGNORED_USER_ALWAYS_DENIED = 4;
4468 // role was granted by user action
4469 USER_GRANTED = 5;
4470 // role was denied by user action
4471 USER_DENIED = 6;
4472 // role was denied by user granting another application the role
4473 USER_DENIED_GRANTED_ANOTHER = 7;
4474 // role was denied and set to be always denied by the user
4475 USER_DENIED_WITH_ALWAYS = 8;
4476 }
4477 // The result of the role request
4478 optional Result result = 9;
4479}
4480
Mark Tabrya824a642019-11-05 12:26:12 -08004481/**
4482 * Logs when a Vehicle Maps Service client's connection state has changed
4483 *
4484 * Logged from:
4485 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4486 */
4487message VmsClientConnectionStateChanged {
4488 // The UID of the VMS client app
4489 optional int32 uid = 1 [(is_uid) = true];
4490
4491 enum State {
4492 UNKNOWN = 0;
4493 // Attempting to connect to the client
4494 CONNECTING = 1;
4495 // Client connection established
4496 CONNECTED = 2;
4497 // Client connection closed unexpectedly
4498 DISCONNECTED = 3;
4499 // Client connection closed by VMS
4500 TERMINATED = 4;
4501 // Error establishing the client connection
4502 CONNECTION_ERROR = 5;
4503 }
4504
4505 optional State state = 2;
4506}
4507
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004508/**
4509 * Logs when MediaProvider has successfully finished scanning a storage volume.
4510 *
4511 * Logged from:
4512 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4513 */
shafik43825842020-04-02 17:30:24 +01004514message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004515 enum Reason {
4516 // Scan triggered due to unknown reason
4517 UNKNOWN = 0;
4518 // Scan triggered due to storage volume being mounted
4519 MOUNTED = 1;
4520 // Scan triggered due to explicit user action or app request
4521 DEMAND = 2;
4522 // Scan triggered due to idle maintenance
4523 IDLE = 3;
4524 }
4525
4526 // Volume type that this event pertains to
4527 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4528 // Reason why this scan was triggered
4529 optional Reason reason = 2;
4530 // Total number of files scanned
4531 optional int64 item_count = 3;
4532 // Duration of scan, normalized per file
4533 optional float normalized_duration_millis = 4;
4534 // Number of database inserts, normalized per file
4535 optional float normalized_insert_count = 5;
4536 // Number of database updates, normalized per file
4537 optional float normalized_update_count = 6;
4538 // Number of database deletes, normalized per file
4539 optional float normalized_delete_count = 7;
4540}
4541
4542/**
4543 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4544 *
4545 * Logged from:
4546 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4547 */
shafik43825842020-04-02 17:30:24 +01004548message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004549 // Volume type that this event pertains to
4550 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004551 // UID of app that requested deletion
4552 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004553 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004554 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004555}
4556
4557/**
4558 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4559 *
4560 * Logged from:
4561 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4562 */
shafik43825842020-04-02 17:30:24 +01004563message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004564 enum Result {
4565 UNKNOWN = 0;
4566 USER_GRANTED = 1;
4567 AUTO_GRANTED = 2;
4568 USER_DENIED = 3;
4569 USER_DENIED_WITH_PREJUDICE = 4;
4570 AUTO_DENIED = 5;
4571 }
4572
4573 // Volume type that this event pertains to
4574 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004575 // UID of app that requested permission
4576 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004577 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004578 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004579 // Result of this request
shafik43825842020-04-02 17:30:24 +01004580 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004581}
4582
4583/**
4584 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4585 *
4586 * Logged from:
4587 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4588 */
shafik43825842020-04-02 17:30:24 +01004589message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004590 // Volume type that this event pertains to
4591 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4592 // Old database version code
4593 optional int32 version_from = 2;
4594 // New database version code
4595 optional int32 version_to = 3;
4596 // Total number of files in database
4597 optional int64 item_count = 4;
4598 // Duration of schema change, normalized per file
4599 optional float normalized_duration_millis = 5;
4600}
4601
4602/**
4603 * Logs when MediaProvider has finished an idle maintenance job.
4604 *
4605 * Logged from:
4606 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4607 */
shafik43825842020-04-02 17:30:24 +01004608message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004609 // Volume type that this event pertains to
4610 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4611
4612 // Total number of files in database
4613 optional int64 item_count = 2;
4614 // Duration of idle maintenance, normalized per file
4615 optional float normalized_duration_millis = 3;
4616 // Number of thumbnails found to be stale, normalized per file
4617 optional float normalized_stale_thumbnails = 4;
4618 // Number of items found to be expired, normalized per file
4619 optional float normalized_expired_media = 5;
4620}
4621
Keun young Park3e033cb2019-12-18 11:27:35 -08004622/**
4623 * Represents boot time event with duration in ms.
4624 *
4625 * Logged from: bootstat and various system server components. Check each enums for details.
4626 */
4627message BootTimeEventDuration {
4628 enum DurationEvent {
4629 UNKNOWN = 0;
4630 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4631 ABSOLUTE_BOOT_TIME = 1;
4632 // Bootloader's 1st stage execution time.
4633 // Logged from bootstat.
4634 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4635 // Bootloader's 1st stage loading time.
4636 // Logged from bootstat.
4637 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4638 // Bootloader's kernel loading time.
4639 // Logged from bootstat.
4640 BOOTLOADER_KERNEL_LOAD = 4;
4641 // Bootloader's 2nd stage execution time.
4642 // Logged from bootstat.
4643 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4644 // Bootloader's 2nd stage loading time.
4645 // Logged from bootstat.
4646 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4647 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4648 // for locked device.
4649 // Logged from bootstat.
4650 BOOTLOADER_UI_WAIT = 7;
4651 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4652 // Logged from bootstat.
4653 BOOTLOADER_TOTAL = 8;
4654 // Shutdown duration inside init for the reboot before the current boot up.
4655 // Logged from f/b/services/.../BootReceiver.java.
4656 SHUTDOWN_DURATION = 9;
4657 // Total time for mounting of disk devices during bootup.
4658 // Logged from f/b/services/.../BootReceiver.java.
4659 MOUNT_DEFAULT_DURATION = 10;
4660 // Total time for early stage mounting of disk devices during bootup.
4661 // Logged from f/b/services/.../BootReceiver.java.
4662 MOUNT_EARLY_DURATION = 11;
4663 // Total time for late stage mounting of disk devices during bootup.
4664 // Logged from f/b/services/.../BootReceiver.java.
4665 MOUNT_LATE_DURATION = 12;
4666 // Average time to scan non-system app after OTA
4667 // Logged from f/b/services/.../PackageManagerService.java
4668 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4669 // Time to initialize Package manager after OTA
4670 // Logged from f/b/services/.../PackageManagerService.java
4671 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4672 // Time to scan all system app from Package manager after OTA
4673 // Logged from f/b/services/.../PackageManagerService.java
4674 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4675 // Init's total time for cold boot stage.
4676 // Logged from bootstat.
4677 COLDBOOT_WAIT = 16;
4678 // Init's total time for initializing selinux.
4679 // Logged from bootstat.
4680 SELINUX_INIT = 17;
4681 // Time since last factory reset.
4682 // Logged from bootstat.
4683 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004684 // Init's total time spent for completing the 1st stage.
4685 // Logged from bootstat.
4686 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004687 }
4688
4689 // Type of the event.
4690 optional DurationEvent event = 1;
4691 // Duration of the event in ms.
4692 optional int64 duration_millis = 2;
4693}
4694
4695/**
4696 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4697 * since boot-up.
4698 *
4699 * Logged from: bootstat and various system server components. Check each enums for details.
4700 */
4701message BootTimeEventElapsedTime {
4702 enum ElapsedTimeEvent {
4703 UNKNOWN = 0;
4704 // Time when init starts 1st stage. Logged from bootstat.
4705 ANDROID_INIT_STAGE_1 = 1;
4706 // Time when sys.boot_completed prop is set.
4707 // Logged from bootstat.
4708 BOOT_COMPLETE = 2;
4709 // BOOT_COMPLETE for encrypted device.
4710 BOOT_COMPLETE_ENCRYPTION = 3;
4711 // BOOT_COMPLETE for device with no encryption.
4712 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4713 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004714 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004715 // BOOT_COMPLETE after factory reset.
4716 FACTORY_RESET_BOOT_COMPLETE = 6;
4717 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4718 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004719 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4720 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004721 // BOOT_COMPLETE after OTA.
4722 OTA_BOOT_COMPLETE = 9;
4723 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4724 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004725 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4726 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004727 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4728 // Logged from f/b/services/.../UserController.java
4729 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4730 // Time when the system starts sending BOOT_COMPLETED broadcast.
4731 // Logged from f/b/services/.../UserController.java
4732 FRAMEWORK_BOOT_COMPLETED = 13;
4733 // Time when the package manager starts init.
4734 // Logged from f/b/services/.../SystemServer.java
4735 PACKAGE_MANAGER_INIT_START = 14;
4736 // Time when package manager is ready
4737 // Logged from f/b/services/.../SystemServer.java
4738 PACKAGE_MANAGER_INIT_READY = 15;
4739 // Represents the time when user has entered unlock credential for system with user pin.
4740 // Logged from bootstat.
4741 POST_DECRYPT = 16;
4742 // Represents the start of zygote's init.
4743 // Logged from zygote itself.
4744 ZYGOTE_INIT_START = 17;
4745 // Represents the start of secondary zygote's init.
4746 // TODO: add logging to zygote
4747 SECONDARY_ZYGOTE_INIT_START = 18;
4748 // Represents the start of system server's init.
4749 // Logged from f/b/services/.../SystemServer.java
4750 SYSTEM_SERVER_INIT_START = 19;
4751 // Represents the completion of system server's init.
4752 // Logged from f/b/services/.../SystemServer.java
4753 SYSTEM_SERVER_READY = 20;
4754 // Represents the start of launcher during boot-up.
4755 // TODO: add logging
4756 LAUNCHER_START = 21;
4757 // Represents the completion of launcher's initial rendering. User can use other apps from
4758 // launcher from this point.
4759 // TODO: add logging
4760 LAUNCHER_SHOWN = 22;
4761 }
4762
4763 // Type of the event.
4764 optional ElapsedTimeEvent event = 1;
4765 // Time since bootup for the event.
4766 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4767 optional int64 time_millis = 2;
4768}
4769
4770/**
4771 * Boot time events with UTC time.
4772 *
4773 * Logged from: bootstat and various system server components. Check each enums for details.
4774 */
4775message BootTimeEventUtcTime {
4776 enum UtcTimeEvent {
4777 UNKNOWN = 0;
4778 // Time of the bootstat's marking of 1st boot after the last factory reset.
4779 // Logged from bootstat.
4780 FACTORY_RESET_RESET_TIME = 1;
4781 // The time when bootstat records FACTORY_RESET_* events. This is close to
4782 // BOOT_COMPLETE time for the current bootup.
4783 // Logged from bootstat.
4784 FACTORY_RESET_CURRENT_TIME = 2;
4785 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4786 // Logged from bootstat.
4787 FACTORY_RESET_RECORD_VALUE = 3;
4788 }
4789
4790 // Type of the event.
4791 optional UtcTimeEvent event = 1;
4792 // UTC time for the event.
4793 optional int64 utc_time_secs = 2;
4794}
4795
4796/**
4797 * Boot time events representing specific error code during bootup.
4798 * Meaning of error code can be different per each event type.
4799 *
4800 * Logged from: bootstat and various system server components. Check each enums for details.
4801 */
4802message BootTimeEventErrorCode {
4803 enum ErrorCodeEvent {
4804 UNKNOWN = 0;
4805 // Linux error code for time() call to get the current UTC time.
4806 // Logged from bootstat.
4807 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4808 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4809 // as UMOUNT_STAT_* from init/reboot.cpp.
4810 // Logged from f/b/services/.../BootReceiver.java.
4811 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004812 // Reprepsents fie system mounting error code of /data partition for the current boot.
4813 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004814 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004815 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004816 }
4817
4818 // Type of the event.
4819 optional ErrorCodeEvent event = 1;
4820 // error code defined per each event type.
4821 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4822 // FS_MGR_FS_STAT.
4823 optional int32 error_code = 2;
4824}
4825
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004826/**
4827 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4828 * after an OTA.
4829 *
4830 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004831 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004832 */
4833message SnapshotMergeReported {
4834 // Keep in sync with
4835 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4836 enum UpdateState {
4837 // No update or merge is in progress.
4838 NONE = 0;
4839 // An update is applying; snapshots may already exist.
4840 INITIATED = 1;
4841 // An update is pending, but has not been successfully booted yet.
4842 UNVERIFIED = 2;
4843 // The kernel is merging in the background.
4844 MERGING = 3;
4845 // Post-merge cleanup steps could not be completed due to a transient
4846 // error, but the next reboot will finish any pending operations.
4847 MERGE_NEEDS_REBOOT = 4;
4848 // Merging is complete, and needs to be acknowledged.
4849 MERGE_COMPLETED = 5;
4850 // Merging failed due to an unrecoverable error.
4851 MERGE_FAILED = 6;
4852 // The update was implicitly cancelled, either by a rollback or a flash
4853 // operation via fastboot. This state can only be returned by WaitForMerge.
4854 CANCELLED = 7;
4855 };
4856
4857 // Status of the update after the merge attempts.
4858 optional UpdateState final_state = 1;
4859
4860 // Time to complete a merge operation in milliseconds.
4861 // A negative value corresponds to the case in which the merge operation
4862 // was interrupted and resumed (e.g. in case of a system reboot during the
4863 // merge).
4864 optional int64 duration_millis = 2;
4865
4866 // Number of reboots that occurred after issuing and before completing the
4867 // merge of all the snapshot devices.
4868 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004869
4870 // The device has been upgraded to Virtual A/B.
4871 optional bool is_vab_retrofit = 4;
4872
4873 // Space that has been temporarily allocated in the /data partition
4874 // containing the dm-snapshot's copy-on-write data generated during a
4875 // Virtual A/B update.
4876 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004877}
4878
Chenjie Yubbcbc602018-02-05 16:51:52 -08004879//////////////////////////////////////////////////////////////////////
4880// Pulled atoms below this line //
4881//////////////////////////////////////////////////////////////////////
4882
4883/**
David Chenc8a43242017-10-17 16:23:28 -07004884 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4885 *
4886 * Pulled from:
4887 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4888 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004889message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004890 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004891
4892 optional int64 rx_bytes = 2;
4893
4894 optional int64 rx_packets = 3;
4895
4896 optional int64 tx_bytes = 4;
4897
4898 optional int64 tx_packets = 5;
4899}
4900
4901/**
4902 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4903 *
4904 * Pulled from:
4905 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4906 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004907message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004908 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004909
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004910 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4911 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004912
4913 optional int64 rx_bytes = 3;
4914
4915 optional int64 rx_packets = 4;
4916
4917 optional int64 tx_bytes = 5;
4918
4919 optional int64 tx_packets = 6;
4920}
4921
4922/**
4923 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4924 *
4925 * Pulled from:
4926 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4927 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004928message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004929 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004930
4931 optional int64 rx_bytes = 2;
4932
4933 optional int64 rx_packets = 3;
4934
4935 optional int64 tx_bytes = 4;
4936
4937 optional int64 tx_packets = 5;
4938}
4939
4940/**
4941 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4942 *
4943 * Pulled from:
4944 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4945 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004946message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004947 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004948
Yao Chenc40a19d2018-03-15 16:48:25 -07004949 // 1 denotes foreground and 0 denotes background. This is called Set in
4950 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004951 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004952
4953 optional int64 rx_bytes = 3;
4954
4955 optional int64 rx_packets = 4;
4956
4957 optional int64 tx_bytes = 5;
4958
4959 optional int64 tx_packets = 6;
4960}
4961
4962/**
junyulai8d1a6092020-05-07 13:38:15 +08004963 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004964 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4965 * the caller must not assume any row of data is one full report when filtering with a set of
4966 * matching conditions, because future data may represent with multiple rows what is currently
4967 * represented by one.
4968 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4969 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004970 *
4971 * Pulled from:
4972 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4973 */
4974message DataUsageBytesTransfer {
4975 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4976 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4977 // states combined, not including debug states. See NetworkStats#SET_*.
4978 optional int32 state = 1;
4979
4980 optional int64 rx_bytes = 2;
4981
4982 optional int64 rx_packets = 3;
4983
4984 optional int64 tx_bytes = 4;
4985
4986 optional int64 tx_packets = 5;
4987
4988 // Radio Access Technology (RAT) type of this record, should be one of
4989 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4990 // the record is for all rat types combined.
4991 optional int32 rat_type = 6;
4992
4993 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004994 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004995 optional string sim_mcc = 7;
4996 optional string sim_mnc = 8;
4997
junyulai8b794b72020-05-19 17:36:13 +08004998 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4999 // See TelephonyManager#getSimCarrierId.
5000 optional int32 carrier_id = 9;
5001
junyulai8d1a6092020-05-07 13:38:15 +08005002 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5003 // combined regardless of the boolean value in its field.
5004 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005005 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005006 ALL = 1;
5007 OPPORTUNISTIC = 2;
5008 NOT_OPPORTUNISTIC = 3;
5009 }
5010 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005011 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005012 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005013 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005014}
5015
5016/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005017 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5018 *
5019 * Pulled from:
5020 * StatsCompanionService
5021 */
5022message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005023 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005024
5025 optional int64 rx_bytes = 2;
5026
5027 optional int64 tx_bytes = 3;
5028}
5029
5030/**
David Chenc8a43242017-10-17 16:23:28 -07005031 * Pulls the kernel wakelock durations. This atom is adapted from
5032 * android/internal/os/KernelWakelockStats.java
5033 *
5034 * Pulled from:
5035 * StatsCompanionService using KernelWakelockReader.
5036 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005037message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005038 optional string name = 1;
5039
5040 optional int32 count = 2;
5041
5042 optional int32 version = 3;
5043
Yangster-maca8a30442018-10-13 23:46:34 -07005044 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005045}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005046
Chenjie Yu05013b32017-11-21 10:21:41 -08005047/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005048 * Pulls low power state information. If power.stats HAL is not available, this
5049 * includes platform and subsystem sleep state information,
5050 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5051 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005052 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005053 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005054 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5055 * as defined in:
5056 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005057 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005058message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005059 // Subsystem name
5060 optional string subsystem_name = 1;
5061 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5062 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005063 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5064 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005065 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005066 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005067 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005068 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005069 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005070}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005071
Chenjie Yu05013b32017-11-21 10:21:41 -08005072/**
Bookatz92da2832018-11-01 18:10:03 -07005073 * Pulls on-device power measurement information.
5074 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5075 * Pulled from:
5076 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5077 */
5078message OnDevicePowerMeasurement {
5079 // Name of the subsystem (to which the rail belongs).
5080 optional string subsystem_name = 1;
5081
5082 // Rail name. The rail lies within the subsystem.
5083 optional string rail_name = 2;
5084
5085 // Time (in ms since boot) at which the rail energy value was measured.
5086 // This may differ slightly from the time that statsd logs this information.
5087 optional uint64 measurement_timestamp_millis = 3;
5088
5089 // Accumulated energy used via the rail since device boot in uWs.
5090 optional uint64 energy_microwatt_secs = 4;
5091}
5092
5093/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005094 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005095 * Pulls the time the cpu spend on the frequency index. Frequency index
5096 * starts from highest to lowest. The value should be monotonically
5097 * increasing since boot. However, if there is a cpu
5098 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005099 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005100message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005101 optional uint32 cluster = 1;
5102 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005103 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005104}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005105
Chenjie Yu05013b32017-11-21 10:21:41 -08005106/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005107 * Pulls Cpu Time Per Uid.
5108 * Note that isolated process uid time should be attributed to host uids.
5109 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005110message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005111 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005112 optional uint64 user_time_micros = 2;
5113 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005114}
5115
5116/**
5117 * Pulls Cpu Time Per Uid per frequency.
5118 * Note that isolated process uid time should be attributed to host uids.
5119 * For each uid, we order the time by descending frequencies.
5120 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005121message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005122 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005123 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005124 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005125}
Hugo Benichi884970e2017-11-14 22:42:46 +09005126
Chenjie Yu05013b32017-11-21 10:21:41 -08005127/**
5128 * Pulls Wifi Controller Activity Energy Info
5129 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005130message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005131 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005132 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005133 // stack reported state
5134 // TODO: replace this with proto enum
5135 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005136 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005137 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005138 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005139 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005140 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005141 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005142 // product of current(mA), voltage(V) and time(ms)
5143 optional uint64 controller_energy_used = 6;
5144}
5145
5146/**
5147 * Pulls Modem Activity Energy Info
5148 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005149message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005150 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005151 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005152 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005153 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005154 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005155 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005156 /**
5157 * Tx power index
5158 * index 0 = tx_power < 0dBm
5159 * index 1 = 0dBm < tx_power < 5dBm
5160 * index 2 = 5dBm < tx_power < 15dBm
5161 * index 3 = 15dBm < tx_power < 20dBm
5162 * index 4 = tx_power > 20dBm
5163 */
5164 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005165 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005166 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005167 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005168 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005169 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005170 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005171 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005172 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005173 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005174 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005175 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005176 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005177 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005178}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005179
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005180/**
5181 * Pulls Bluetooth Activity Energy Info
5182 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5183 */
5184message BluetoothActivityInfo {
5185 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005186 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005187 // bluetooth stack state
5188 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005189 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005190 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005191 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005192 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005193 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005194 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005195 // product of current(mA), voltage(V) and time(ms)
5196 optional uint64 energy_used = 6;
5197}
5198
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005199/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005200 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005201 *
5202 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005203 */
5204message ProcessMemoryState {
5205 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005206 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005207
5208 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005209 // Usually package name, "system" for system server.
5210 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005211 optional string process_name = 2;
5212
Rafal Slawikda51b932018-12-13 16:31:33 +00005213 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005214 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005215
5216 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005217 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005218
5219 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005220 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005221
Rajeev Kumar90235992018-01-29 11:06:48 -08005222 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005223 // Value is read from memory.stat, field total_rss if per-app memory
5224 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005225 optional int64 rss_in_bytes = 6;
5226
5227 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005228 // Value is read from memory.stat, field total_cache if per-app memory
5229 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005230 optional int64 cache_in_bytes = 7;
5231
5232 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005233 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005234 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005235 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005236
Rafal Slawik203c3db2019-09-25 19:53:01 +01005237 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005238 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005239
Rafal Slawik203c3db2019-09-25 19:53:01 +01005240 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5241 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005242
Rafal Slawik203c3db2019-09-25 19:53:01 +01005243 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5244 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005245}
5246
5247/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005248 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005249 *
5250 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5251 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005252 *
5253 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005254 */
5255message ProcessMemoryHighWaterMark {
5256 // The uid if available. -1 means not available.
5257 optional int32 uid = 1 [(is_uid) = true];
5258
Rafal Slawikda51b932018-12-13 16:31:33 +00005259 // The process name.
5260 // Usually package name or process cmdline.
5261 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005262 optional string process_name = 2;
5263
Rafal Slawik239b6802019-09-09 18:46:01 +01005264 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5265 // computed by converting kilobytes to bytes.
5266 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5267
Rafal Slawik3bea8952018-11-15 12:39:33 +00005268 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5269 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005270 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005271}
5272
5273/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005274 * Logs the memory stats for a process.
5275 *
5276 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5277 * and for selected native processes.
5278 */
5279message ProcessMemorySnapshot {
5280 // The uid if available. -1 means not available.
5281 optional int32 uid = 1 [(is_uid) = true];
5282
5283 // The process name.
5284 // Usually package name or process cmdline.
5285 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5286 optional string process_name = 2;
5287
5288 // The pid of the process.
5289 // Allows to disambiguate instances of the process.
5290 optional int32 pid = 3;
5291
5292 // The current OOM score adjustment value.
5293 // Read from ProcessRecord for managed processes.
5294 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5295 optional int32 oom_score_adj = 4;
5296
5297 // The current RSS of the process.
5298 // VmRSS from /proc/pid/status.
5299 optional int32 rss_in_kilobytes = 5;
5300
5301 // The current anon RSS of the process.
5302 // RssAnon from /proc/pid/status.
5303 optional int32 anon_rss_in_kilobytes = 6;
5304
5305 // The current swap size of the process.
5306 // VmSwap from /proc/pid/status.
5307 optional int32 swap_in_kilobytes = 7;
5308
5309 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5310 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5311}
5312
5313/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005314 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005315 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005316message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005317 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005318}
5319
5320/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005321 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005322 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005323message SystemUptime {
5324 // Milliseconds since the system was booted.
5325 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5326 // for external input).
5327 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005328 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005329}
5330
5331/*
5332 * Reads from /proc/uid_concurrent_active_time which has the format:
5333 * active: X (X is # cores)
5334 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5335 * [uid1]: [time-0] [time-1] [time-2] ... ...
5336 * ...
5337 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5338 * The file contains a monotonically increasing count of time for a single boot.
5339 */
5340message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005341 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005342 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005343}
5344
5345/**
5346 * Reads from /proc/uid_concurrent_policy_time which has the format:
5347 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5348 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5349 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5350 * ...
5351 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5352 * The file contains a monotonically increasing count of time for a single boot.
5353 */
5354message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005355 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005356 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005357 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005358}
5359
5360/*
5361 * Pulls free disk space, for data, system partition and temporary directory.
5362 */
5363message DiskSpace {
5364 // available bytes in data partition
5365 optional uint64 data_available_bytes = 1;
5366 // available bytes in system partition
5367 optional uint64 system_available_bytes = 2;
5368 // available bytes in download cache or temp directories
5369 optional uint64 temp_available_bytes = 3;
5370}
Tej Singhbf972d92018-01-10 20:51:13 -08005371
5372/**
5373 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005374 *
5375 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005376 */
5377message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005378 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005379}
5380
5381/**
5382 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005383 * Pulled from:
5384 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005385 */
5386message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005387 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005388}
5389
5390/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005391 * Pulls battery voltage.
5392 * Pulled from:
5393 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5394 */
5395message BatteryVoltage {
5396 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005397 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005398}
5399
5400/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005401 * Pulls battery level (percent full, from 0 to 100).
5402 *
5403 * Pulled from:
5404 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5405 */
5406message BatteryLevel {
5407 // Battery level. Should be in [0, 100].
5408 optional int32 battery_level = 1;
5409}
5410
5411/**
Tej Singhd89137e2018-03-26 14:51:40 -07005412 * Pulls the temperature of various parts of the device.
5413 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005414 *
Maggie White442b6312019-04-05 16:26:44 -07005415 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005416 */
5417message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005418 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005419 optional android.os.TemperatureTypeEnum sensor_location = 1;
5420
5421 // The name of the temperature source. Eg. CPU0
5422 optional string sensor_name = 2;
5423
Tej Singhd89137e2018-03-26 14:51:40 -07005424 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005425 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005426 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005427
5428 // Relative severity of the throttling, see enum definition.
5429 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005430}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005431
5432/**
5433 * Pulls the statistics of calls to Binder.
5434 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005435 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5436 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005437 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005438 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005439 */
5440message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005441 // UID of the process responsible for the binder transaction. It will be set if the process
5442 // executing the binder transaction attribute the transaction to another uid using
5443 // Binder.setThreadWorkSource().
5444 //
5445 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005446 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005447 // UID of the process executing the binder transaction.
5448 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005449 // Fully qualified class name of the API call.
5450 //
5451 // This is a system server class name.
5452 //
5453 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5454 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5455 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5456 // commonly used APIs.
5457 optional string service_class_name = 2;
5458 // Method name of the API call. It can also be a transaction code if we cannot
5459 // resolve it to a name. See Binder#getTransactionName.
5460 //
5461 // This is a system server method name.
5462 optional string service_method_name = 3;
5463 // Total number of API calls.
5464 optional int64 call_count = 4;
5465 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5466 optional bool screen_interactive = 13;
5467 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5468 // call_count will be equal to recorded_call_count.
5469 //
5470 // If recorded_call_count is different than call_count, it means data collection has been
5471 // sampled. All the fields below will be sampled in this case.
5472 optional int64 recorded_call_count = 12;
5473 // Number of exceptions thrown by the API.
5474 optional int64 recorded_exception_count = 5;
5475 // Total latency of all API calls.
5476 // Average can be computed using total_latency_micros / recorded_call_count.
5477 optional int64 recorded_total_latency_micros = 6;
5478 // Maximum latency of one API call.
5479 optional int64 recorded_max_latency_micros = 7;
5480 // Total CPU usage of all API calls.
5481 // Average can be computed using total_cpu_micros / recorded_call_count.
5482 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5483 optional int64 recorded_total_cpu_micros = 8;
5484 // Maximum CPU usage of one API call.
5485 optional int64 recorded_max_cpu_micros = 9;
5486 // Maximum parcel reply size of one API call.
5487 optional int64 recorded_max_reply_size_bytes = 10;
5488 // Maximum parcel request size of one API call.
5489 optional int64 recorded_max_request_size_bytes = 11;
5490}
5491
5492/**
5493 * Pulls the statistics of exceptions during calls to Binder.
5494 *
5495 * Binder stats are cumulative from boot unless somebody reset the data using
5496 * > adb shell dumpsys binder_calls_stats --reset
5497 */
5498message BinderCallsExceptions {
5499 // Exception class name, e.g. java.lang.IllegalArgumentException.
5500 //
5501 // This is an exception class name thrown by the system server.
5502 optional string exception_class_name = 1;
5503 // Total number of exceptions.
5504 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005505}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005506
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005507/**
5508 * Pulls the statistics of message dispatching on HandlerThreads.
5509 *
5510 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5511 * config on the device.
5512 *
5513 * Next tag: 11
5514 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005515message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005516 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005517 optional int32 uid = 1 [(is_uid) = true];
5518
5519 // Fully qualified class name of the handler target class.
5520 //
5521 // This field does not contain PII. This is a system server class name.
5522 optional string handler_class_name = 2;
5523
5524 // The name of the thread that runs the Looper.
5525 //
5526 // This field does not contain PII. This is a system server thread name.
5527 optional string looper_thread_name = 3;
5528
5529 // The name of the dispatched message.
5530 //
5531 // This field does not contain PII. This is a system server constant or class
5532 // name.
5533 optional string message_name = 4;
5534
5535 // Total number of successfully dispatched messages.
5536 optional int64 message_count = 5;
5537
5538 // Total number of messages that failed dispatching.
5539 optional int64 exception_count = 6;
5540
5541 // Total number of processed messages we have data recorded for. If we
5542 // collected data for all the messages, message_count will be equal to
5543 // recorded_message_count.
5544 //
5545 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005546 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005547 optional int64 recorded_message_count = 7;
5548
5549 // Total latency of all processed messages.
5550 // Average can be computed using recorded_total_latency_micros /
5551 // recorded_message_count.
5552 optional int64 recorded_total_latency_micros = 8;
5553
5554 // Total CPU usage of all processed message.
5555 // Average can be computed using recorded_total_cpu_micros /
5556 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005557 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005558 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005559
5560 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5561 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005562
5563 // Max recorded CPU usage of all processed messages.
5564 optional int64 recorded_max_cpu_micros = 11;
5565
5566 // Max recorded latency of all processed messages.
5567 optional int64 recorded_max_latency_micros = 12;
5568
5569 // Total number of messages we tracked the dispatching delay for. If we
5570 // collected data for all the messages, message_count will be equal to
5571 // recorded_delay_message_count.
5572 //
5573 // If recorded_delay_message_count is different than message_count, it means data
5574 // collection has been sampled or/and not all messages specified the target dispatch time.
5575 // The fields below will be sampled in this case.
5576 optional int64 recorded_delay_message_count = 13;
5577
5578 // Total dispatching delay of all processed messages.
5579 // Calculated as a difference between the target dispatching time (Message.when)
5580 // and the actual dispatching time.
5581 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5582 optional int64 recorded_total_delay_millis = 14;
5583
5584 // Max dispatching delay of all processed messages.
5585 // Calculated as a difference between the target dispatching time (Message.when)
5586 // and the actual dispatching time.
5587 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005588}
Tej Singh86dc9db2018-09-06 00:39:57 +00005589
5590/**
5591 * Pulls disk information, such as write speed and latency.
5592 */
5593message DiskStats {
5594 // Time taken to open, write 512B to, and close a file.
5595 // -1 if error performing the check.
5596 optional int64 data_write_latency_millis = 1;
5597
5598 optional bool file_based_encryption = 2;
5599
5600 // Recent disk write speed in kB/s.
5601 // -1 if error querying storageed.
5602 // 0 if data is unavailable.
5603 optional int32 recent_disk_write_speed = 3;
5604}
5605
5606
5607/**
5608 * Free and total bytes of the Data, Cache, and System partition.
5609 */
5610message DirectoryUsage {
5611 enum Directory {
5612 UNKNOWN = 0;
5613 DATA = 1;
5614 CACHE = 2;
5615 SYSTEM = 3;
5616 }
5617 optional Directory directory = 1;
5618 optional int64 free_bytes = 2;
5619 optional int64 total_bytes = 3;
5620}
5621
5622
5623/**
5624 * Size of an application: apk size, data size, and cache size.
5625 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5626 * Information is only reported for apps with the primary user (user 0).
5627 * Sizes are aggregated by package name.
5628 */
5629message AppSize {
5630 // Including uids will involve modifying diskstats logic.
5631 optional string package_name = 1;
5632 // App size in bytes. -1 if unavailable.
5633 optional int64 app_size_bytes = 2;
5634 // App data size in bytes. -1 if unavailable.
5635 optional int64 app_data_size_bytes = 3;
5636 // App cache size in bytes. -1 if unavailable.
5637 optional int64 app_cache_size_bytes = 4;
5638 // Time that the cache file was produced.
5639 // Uses System.currentTimeMillis(), which is wall clock time.
5640 optional int64 cache_time_millis = 5;
5641}
5642
5643
5644/**
5645 * Size of a particular category. Eg: photos, videos.
5646 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5647 */
5648message CategorySize {
5649 enum Category {
5650 UNKNOWN = 0;
5651 APP_SIZE = 1;
5652 APP_DATA_SIZE = 2;
5653 APP_CACHE_SIZE = 3;
5654 PHOTOS = 4;
5655 VIDEOS = 5;
5656 AUDIO = 6;
5657 DOWNLOADS = 7;
5658 SYSTEM = 8;
5659 OTHER = 9;
5660 }
5661 optional Category category = 1;
5662 // Category size in bytes.
5663 optional int64 size_bytes = 2;
5664 // Time that the cache file was produced.
5665 // Uses System.currentTimeMillis(), which is wall clock time.
5666 optional int64 cache_time_millis = 3;
5667}
Tej Singhd6d6d772018-09-05 17:41:25 -07005668
5669/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005670 * Pulls per uid I/O stats. The stats are cumulative since boot.
5671 *
5672 * Read/write bytes are I/O events from a storage device
5673 * Read/write chars are data requested by read/write syscalls, and can be
5674 * satisfied by caching.
5675 *
5676 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5677 */
5678message DiskIo {
5679 optional int32 uid = 1 [(is_uid) = true];
5680 optional int64 fg_chars_read = 2;
5681 optional int64 fg_chars_write = 3;
5682 optional int64 fg_bytes_read = 4;
5683 optional int64 fg_bytes_write = 5;
5684 optional int64 bg_chars_read = 6;
5685 optional int64 bg_chars_write = 7;
5686 optional int64 bg_bytes_read = 8;
5687 optional int64 bg_bytes_write = 9;
5688 optional int64 fg_fsync = 10;
5689 optional int64 bg_fsync= 11;
5690}
5691
5692
5693/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005694 * Pulls the number of fingerprints for each user.
5695 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005696 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005697 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005698message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005699 // The associated user. Eg: 0 for owners, 10+ for others.
5700 // Defined in android/os/UserHandle.java
5701 optional int32 user = 1;
5702 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005703 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005704}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005705
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005706/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005707 * Pulls the number of faces for each user.
5708 *
5709 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5710 */
5711message NumFacesEnrolled {
5712 // The associated user. Eg: 0 for owners, 10+ for others.
5713 // Defined in android/os/UserHandle.java
5714 optional int32 user = 1;
5715 // Number of faces registered to that user.
5716 optional int32 num_faces_enrolled = 2;
5717}
5718/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005719 * A mapping of role holder -> role
5720 */
5721message RoleHolder {
5722 // uid of the role holder
5723 optional int32 uid = 1 [(is_uid) = true];
5724
5725 // package name of the role holder
5726 optional string package_name = 2;
5727
5728 // the role held
5729 optional string role = 3;
5730}
5731
Yangsteraf9aee72018-10-12 09:26:16 -07005732message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005733 // These are all in byte resolution.
5734 optional int64 min = 1 [deprecated = true];
5735 optional int64 average = 2 [deprecated = true];
5736 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005737
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005738 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5739 // int64 fields.
5740 optional int32 mean_kb = 4;
5741 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005742}
5743
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005744// A reduced subset of process states; reducing the number of possible states allows more
5745// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5746enum ProcessStateAggregated {
5747 PROCESS_STATE_UNKNOWN = 0;
5748 // Persistent system process.
5749 PROCESS_STATE_PERSISTENT = 1;
5750 // Top activity; actually any visible activity.
5751 PROCESS_STATE_TOP = 2;
5752 // Process binding to top or a foreground service.
5753 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5754 // Processing running a foreground service.
5755 PROCESS_STATE_FGS = 4;
5756 // Important foreground process (ime, wallpaper, etc).
5757 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5758 // Important background process.
5759 PROCESS_STATE_BACKGROUND = 6;
5760 // Process running a receiver.
5761 PROCESS_STATE_RECEIVER = 7;
5762 // All kinds of cached processes.
5763 PROCESS_STATE_CACHED = 8;
5764}
5765
5766// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005767message ProcessStatsStateProto {
5768 optional android.service.procstats.ScreenState screen_state = 1;
5769
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005770 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005771
5772 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5773 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005774 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5775
5776 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005777
5778 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005779 optional int64 duration_millis = 4 [deprecated = true];
5780 // Same as above, but with minute resolution so it fits into an int32.
5781 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005782
5783 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005784 optional int64 realtime_duration_millis = 9 [deprecated = true];
5785 // Same as above, but with minute resolution so it fits into an int32.
5786 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005787
5788 // # of samples taken
5789 optional int32 sample_size = 5;
5790
5791 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005792 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005793
5794 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005795 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005796
5797 // RSS is memory resident for this process
5798 optional AggStats rss = 8;
5799}
5800
Jing Ji060d6862020-04-13 19:36:31 -07005801// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005802message ProcessStatsProto {
5803 // Name of process.
5804 optional string process = 1;
5805
5806 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005807 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005808
5809 // Information about how often kills occurred
5810 message Kill {
5811 // Count of excessive CPU kills
5812 optional int32 cpu = 1;
5813
5814 // Count of kills when cached
5815 optional int32 cached = 2;
5816
5817 // PSS stats during cached kill
5818 optional AggStats cached_pss = 3;
5819 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005820 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005821
5822 // Time and memory spent in various states.
5823 repeated ProcessStatsStateProto states = 5;
5824
5825 // Total time process has been running... screen_state, memory_state, and process_state
5826 // will not be set.
5827 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005828
5829 // Association data for this process in this state;
5830 // each entry here is one association.
5831 repeated ProcessStatsAssociationProto assocs = 7;
5832}
5833
Jing Ji1cd1f602020-06-03 13:45:36 -07005834// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005835message ProcessStatsAssociationProto {
5836 // Procss Name of the associated process (client process of service binding)
5837 optional string assoc_process_name = 1;
5838
5839 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005840 optional string assoc_package_name = 2 [deprecated = true];
5841
5842 // UID of the associated process/package (client package of service binding)
5843 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005844
5845 // Total count of the times this association (service binding) appeared.
5846 optional int32 total_count = 3;
5847
5848 // Uptime total duration in seconds this association (service binding) was around.
5849 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005850}
5851
5852message PackageServiceOperationStatsProto {
5853 // Operate enum: Started, Foreground, Bound, Executing
5854 optional android.service.procstats.ServiceOperationState operation = 1;
5855
5856 // Number of times the service was in this operation.
5857 optional int32 count = 2;
5858
5859 // Information about a state the service can be in.
5860 message StateStats {
5861 // Screen state enum.
5862 optional android.service.procstats.ScreenState screen_state = 1;
5863 // Memory state enum.
5864 optional android.service.procstats.MemoryState memory_state = 2;
5865
5866 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005867 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005868 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005869 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005870 }
5871 repeated StateStats state_stats = 3;
5872}
5873
5874message PackageServiceStatsProto {
5875 // Name of service component.
5876 optional string service_name = 1;
5877
5878 // The operation stats.
5879 // The package_name, package_uid, package_version, service_name will not be set to save space.
5880 repeated PackageServiceOperationStatsProto operation_stats = 2;
5881}
5882
5883message PackageAssociationSourceProcessStatsProto {
5884 // Uid of the process.
5885 optional int32 process_uid = 1;
5886 // Process name.
5887 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005888 // Package name.
5889 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005890 // Total count of the times this association appeared.
5891 optional int32 total_count = 3;
5892
5893 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005894 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005895
5896 // Total count of the times this association became actively impacting its target process.
5897 optional int32 active_count = 5;
5898
5899 // Information on one source in this association.
5900 message StateStats {
5901 // Process state enum.
5902 optional android.service.procstats.ProcessState process_state = 1;
5903 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005904 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005905 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005906 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005907 }
5908 repeated StateStats active_state_stats = 6;
5909}
5910
5911message PackageAssociationProcessStatsProto {
5912 // Name of the target component.
5913 optional string component_name = 1;
5914 // Information on one source in this association.
5915 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5916}
5917
5918
5919message ProcessStatsPackageProto {
5920 // Name of package.
5921 optional string package = 1;
5922
5923 // Uid of the package.
5924 optional int32 uid = 2;
5925
5926 // Version of the package.
5927 optional int64 version = 3;
5928
5929 // Stats for each process running with the package loaded in to it.
5930 repeated ProcessStatsProto process_stats = 4;
5931
5932 // Stats for each of the package's services.
5933 repeated PackageServiceStatsProto service_stats = 5;
5934
5935 // Stats for each association with the package.
5936 repeated PackageAssociationProcessStatsProto association_stats = 6;
5937}
5938
5939message ProcessStatsSectionProto {
5940 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005941 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005942
5943 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005944 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005945
5946 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005947 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005948
5949 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005950 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005951
5952 // System runtime library. e.g. "libdvm.so", "libart.so".
5953 optional string runtime = 5;
5954
5955 // whether kernel reports swapped pss.
5956 optional bool has_swapped_pss = 6;
5957
5958 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5959 enum Status {
5960 STATUS_UNKNOWN = 0;
5961 STATUS_COMPLETE = 1;
5962 STATUS_PARTIAL = 2;
5963 STATUS_SHUTDOWN = 3;
5964 STATUS_SYSPROPS = 4;
5965 }
5966 repeated Status status = 7;
5967
Chenjie Yub2ecc792019-01-17 10:27:26 -08005968 // Number of pages available of various types and sizes, representation fragmentation.
5969 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5970
Yangsteraf9aee72018-10-12 09:26:16 -07005971 // Stats for each process.
5972 repeated ProcessStatsProto process_stats = 8;
5973
5974 // Stats for each package.
5975 repeated ProcessStatsPackageProto package_stats = 9;
5976}
5977
Chenjie Yub2ecc792019-01-17 10:27:26 -08005978message ProcessStatsAvailablePagesProto {
5979 // Node these pages are in (as per /proc/pagetypeinfo)
5980 optional int32 node = 1;
5981
5982 // Zone these pages are in (as per /proc/pagetypeinfo)
5983 optional string zone = 2;
5984
5985 // Label for the type of these pages (as per /proc/pagetypeinfo)
5986 optional string label = 3;
5987
5988 // Distribution of number of pages available by order size. First entry in array is
5989 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5990 repeated int32 pages_per_order = 4;
5991}
5992
Chenjie Yu12e5e672018-09-14 15:54:59 -07005993/**
5994 * Pulled from ProcessStatsService.java
5995 */
5996message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005997 optional ProcessStatsSectionProto proc_stats_section = 1;
5998}
5999
Chenjie Yuf910b7802019-01-11 16:08:20 -08006000/**
6001 * Pulled from ProcessStatsService.java
6002 */
6003message ProcStatsPkgProc {
6004 optional ProcessStatsSectionProto proc_stats_section = 1;
6005}
6006
Chris Wrencdea3b72019-11-22 16:58:17 -05006007// Next Tag: 2
6008message PackageRemoteViewInfoProto {
6009 optional string package_name = 1;
6010 // add per-package additional info here (like channels)
6011}
6012
6013// Next Tag: 2
6014message NotificationRemoteViewsProto {
6015 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6016}
6017
6018/**
6019 * Pulled from NotificationManagerService.java
6020 */
6021message NotificationRemoteViews {
6022 optional NotificationRemoteViewsProto notification_remote_views = 1;
6023}
6024
Yotam Aron74299972020-01-16 16:20:58 +02006025/**
6026 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6027 */
6028message PackageNotificationPreferences {
6029 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006030 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006031 // Notification importance, which specifies when and how a notification is displayed.
6032 // Specified under core/java/android/app/NotificationManager.java.
6033 optional int32 importance = 2;
6034 // Lockscreen visibility as set by the user.
6035 optional int32 visibility = 3;
6036 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6037 // PreferencesHelper.java)
6038 optional int32 user_locked_fields = 4;
6039}
6040
6041/**
6042 * Atom that contains a list of a package's channel preferences, pulled from
6043 * NotificationManagerService.java.
6044 */
6045message PackageNotificationChannelPreferences {
6046 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006047 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006048 // Channel's ID. Should always be available.
6049 optional string channel_id = 2;
6050 // Channel's name. Should always be available.
6051 optional string channel_name = 3;
6052 // Channel's description. Optionally set by the channel creator.
6053 optional string description = 4;
6054 // Notification importance, which specifies when and how a notification is displayed. Specified
6055 // under core/java/android/app/NotificationManager.java.
6056 optional int32 importance = 5;
6057 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6058 // at core/java/android/app/NotificationChannel.java
6059 optional int32 user_locked_fields = 6;
6060 // Indicates if the channel was deleted by the app.
6061 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006062 // Indicates if the channel was marked as a conversation by the app.
6063 optional bool is_conversation = 8;
6064 // Indicates if the channel is a conversation that was demoted by the user.
6065 optional bool is_demoted_conversation = 9;
6066 // Indicates if the channel is a conversation that was marked as important by the user.
6067 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006068}
6069
6070/**
6071 * Atom that contains a list of a package's channel group preferences, pulled from
6072 * NotificationManagerService.java.
6073 */
6074message PackageNotificationChannelGroupPreferences {
6075 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006076 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006077 // Channel Group's ID. Should always be available.
6078 optional string group_id = 2;
6079 // Channel Group's name. Should always be available.
6080 optional string group_name = 3;
6081 // Channel Group's description. Optionally set by group creator.
6082 optional string description = 4;
6083 // Indicates if notifications from this channel group are blocked.
6084 optional bool is_blocked = 5;
6085 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6086 // at core/java/android/app/NotificationChannelGroup.java
6087 optional int32 user_locked_fields = 6;
6088}
6089
Yangsteraf9aee72018-10-12 09:26:16 -07006090message PowerProfileProto {
6091 optional double cpu_suspend = 1;
6092
6093 optional double cpu_idle = 2;
6094
6095 optional double cpu_active = 3;
6096
6097 message CpuCluster {
6098 optional int32 id = 1;
6099 optional double cluster_power = 2;
6100 optional int32 cores = 3;
6101 repeated int64 speed = 4;
6102 repeated double core_power = 5;
6103 }
6104
6105 repeated CpuCluster cpu_cluster = 40;
6106
6107 optional double wifi_scan = 4;
6108
6109 optional double wifi_on = 5;
6110
6111 optional double wifi_active = 6;
6112
6113 optional double wifi_controller_idle = 7;
6114
6115 optional double wifi_controller_rx = 8;
6116
6117 optional double wifi_controller_tx = 9;
6118
6119 repeated double wifi_controller_tx_levels = 10;
6120
6121 optional double wifi_controller_operating_voltage = 11;
6122
6123 optional double bluetooth_controller_idle = 12;
6124
6125 optional double bluetooth_controller_rx = 13;
6126
6127 optional double bluetooth_controller_tx = 14;
6128
6129 optional double bluetooth_controller_operating_voltage = 15;
6130
6131 optional double modem_controller_sleep = 16;
6132
6133 optional double modem_controller_idle = 17;
6134
6135 optional double modem_controller_rx = 18;
6136
6137 repeated double modem_controller_tx = 19;
6138
6139 optional double modem_controller_operating_voltage = 20;
6140
6141 optional double gps_on = 21;
6142
6143 repeated double gps_signal_quality_based = 22;
6144
6145 optional double gps_operating_voltage = 23;
6146
6147 optional double bluetooth_on = 24;
6148
6149 optional double bluetooth_active = 25;
6150
6151 optional double bluetooth_at_cmd = 26;
6152
6153 optional double ambient_display = 27;
6154
6155 optional double screen_on = 28;
6156
6157 optional double radio_on = 29;
6158
6159 optional double radio_scanning = 30;
6160
6161 optional double radio_active = 31;
6162
6163 optional double screen_full = 32;
6164
6165 optional double audio = 33;
6166
6167 optional double video = 34;
6168
6169 optional double flashlight = 35;
6170
6171 optional double memory = 36;
6172
6173 optional double camera = 37;
6174
6175 optional double wifi_batched_scan = 38;
6176
6177 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006178}
Chenjie Yuab530202018-09-26 12:39:20 -07006179
6180/**
6181 * power_profile.xml and other constants for power model calculations.
6182 * Pulled from PowerProfile.java
6183 */
6184message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006185 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006186}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006187
6188/**
arangelovd5db50e2018-10-12 20:24:39 +01006189 * Logs when a user restriction was added or removed.
6190 *
6191 * Logged from:
6192 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6193 */
6194message UserRestrictionChanged {
6195 // The raw string of the user restriction as defined in UserManager.
6196 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6197 optional string restriction = 1;
6198 // Whether the restriction is enabled or disabled.
6199 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006200}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006201
6202/**
6203 * Pulls process user time and system time. Puller takes a snapshot of all pids
6204 * in the system and returns cpu stats for those that are working at the time.
6205 * Dead pids will be dropped. Kernel processes are excluded.
6206 * Min cool-down is 5 sec.
6207 */
6208message ProcessCpuTime {
6209 optional int32 uid = 1 [(is_uid) = true];
6210
6211 optional string process_name = 2;
6212 // Process cpu time in user space, cumulative from boot/process start
6213 optional int64 user_time_millis = 3;
6214 // Process cpu time in system space, cumulative from boot/process start
6215 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006216}
Misha Wagner5a51e002018-10-03 15:04:09 +01006217
6218/**
6219 * Pulls the CPU usage for each thread.
6220 *
6221 * Read from /proc/$PID/task/$TID/time_in_state files.
6222 *
6223 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6224 * time_in_state files not being present on some phones, have not been addressed. These should be
6225 * considered before a public release.
6226 */
6227message CpuTimePerThreadFreq {
6228 // UID that owns the process.
6229 optional int32 uid = 1 [(is_uid) = true];
6230 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006231 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006232 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006233 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006234 // Name of the process taken from `/proc/$PID/cmdline`.
6235 optional string process_name = 4;
6236 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6237 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006238
6239 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6240 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6241 // frequencies are given here as the alternative is sending eight separate atoms. This method
6242 // significantly reduces the amount of data created
6243 optional int32 frequency1_khz = 6;
6244 optional int32 time1_millis = 7;
6245 optional int32 frequency2_khz = 8;
6246 optional int32 time2_millis = 9;
6247 optional int32 frequency3_khz = 10;
6248 optional int32 time3_millis = 11;
6249 optional int32 frequency4_khz = 12;
6250 optional int32 time4_millis = 13;
6251 optional int32 frequency5_khz = 14;
6252 optional int32 time5_millis = 15;
6253 optional int32 frequency6_khz = 16;
6254 optional int32 time6_millis = 17;
6255 optional int32 frequency7_khz = 18;
6256 optional int32 time7_millis = 19;
6257 optional int32 frequency8_khz = 20;
6258 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006259}
Bookatz75ee60422018-11-09 12:27:37 -08006260
6261/**
Bookatz366a4432018-11-20 09:42:33 -08006262 * Pulls information about the device's build.
6263 */
6264message BuildInformation {
6265 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6266 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6267 optional string fingerprint = 1;
6268
6269 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6270 optional string brand = 2;
6271
6272 // Build.PRODUCT. The name of the overall product.
6273 optional string product = 3;
6274
6275 // Build.DEVICE. The name of the industrial design.
6276 optional string device = 4;
6277
6278 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6279 optional string version_release = 5;
6280
6281 // Build.ID. E.g. a label like "M4-rc20".
6282 optional string id = 6;
6283
6284 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6285 // represent this build.
6286 optional string version_incremental = 7;
6287
6288 // Build.TYPE. The type of build, like "user" or "eng".
6289 optional string type = 8;
6290
6291 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6292 optional string tags = 9;
6293}
6294
6295/**
Adam He420947c2019-01-23 15:59:09 -08006296 * Logs information about mismatched caller for content capture.
6297 *
6298 * Logged from:
6299 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6300 */
6301message ContentCaptureCallerMismatchReported {
6302 optional string intended_package = 1;
6303 optional string calling_package = 2;
6304}
6305
6306/**
6307 * Logs information about content capture service events.
6308 *
6309 * Logged from:
6310 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6311 */
6312message ContentCaptureServiceEvents {
6313 // The type of event.
6314 enum Event {
6315 UNKNOWN = 0;
6316 ON_CONNECTED = 1;
6317 ON_DISCONNECTED = 2;
6318 SET_WHITELIST = 3;
6319 SET_DISABLED = 4;
6320 ON_USER_DATA_REMOVED = 5;
6321 }
6322 optional Event event = 1;
6323 // component/package of content capture service.
6324 optional string service_info = 2;
6325 // component/package of target.
6326 // it's a concatenated list of component/package for SET_WHITELIST event
6327 // separated by " ".
6328 optional string target_info = 3;
6329}
6330
6331/**
6332 * Logs information about content capture session events.
6333 *
6334 * Logged from:
6335 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6336 */
6337message ContentCaptureSessionEvents {
6338 // The type of event.
6339 enum Event {
6340 UNKNOWN = 0;
6341 ON_SESSION_STARTED = 1;
6342 ON_SESSION_FINISHED = 2;
6343 SESSION_NOT_CREATED = 3;
6344 }
6345 optional int32 session_id = 1;
6346 optional Event event = 2;
6347 // (n/a on session finished)
6348 optional int32 state_flags = 3;
6349 // component/package of content capture service.
6350 optional string service_info = 4;
6351 // component/package of app.
6352 // (n/a on session finished)
6353 optional string app_info = 5;
6354 optional bool is_child_session = 6;
6355}
6356
6357/**
6358 * Logs information about session being flushed.
6359 *
6360 * Logged from:
6361 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6362 */
6363message ContentCaptureFlushed {
6364 optional int32 session_id = 1;
6365 // component/package of content capture service.
6366 optional string service_info = 2;
6367 // component/package of app.
6368 optional string app_info = 3;
6369 // session start/finish events
6370 optional int32 child_session_started = 4;
6371 optional int32 child_session_finished = 5;
6372 // count of view events.
6373 optional int32 view_appeared_count = 6;
6374 optional int32 view_disappeared_count = 7;
6375 optional int32 view_text_changed_count = 8;
6376
6377 // Flush stats.
6378 optional int32 max_events = 9;
6379 optional int32 idle_flush_freq = 10;
6380 optional int32 text_flush_freq = 11;
6381 optional int32 flush_reason = 12;
6382}
6383
6384/**
Bookatz75ee60422018-11-09 12:27:37 -08006385 * Pulls on-device BatteryStats power use calculations for the overall device.
6386 */
6387message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006388 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6389 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6390 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6391 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006392}
6393
6394/**
6395 * Pulls on-device BatteryStats power use calculations broken down by uid.
6396 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6397 * that is attributed to non-uid items. They must all be included to get the total power use.
6398 */
6399message DeviceCalculatedPowerBlameUid {
6400 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6401 optional int32 uid = 1 [(is_uid) = true];
6402
Bookatz3dbc13a2018-12-21 12:16:51 -08006403 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6404 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6405 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006406}
6407
6408/**
6409 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6410 * drain type.
6411 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6412 * is attributed uids. They must all be included to get the total power use.
6413 */
6414message DeviceCalculatedPowerBlameOther {
6415 // The type of item whose power use is being reported.
6416 enum DrainType {
6417 AMBIENT_DISPLAY = 0;
6418 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6419 BLUETOOTH = 2;
6420 CAMERA = 3;
6421 // Cell-standby
6422 CELL = 4;
6423 FLASHLIGHT = 5;
6424 IDLE = 6;
6425 MEMORY = 7;
6426 // Amount that total computed drain exceeded the drain estimated using the
6427 // battery level changes and capacity.
6428 OVERCOUNTED = 8;
6429 PHONE = 9;
6430 SCREEN = 10;
6431 // Amount that total computed drain was below the drain estimated using the
6432 // battery level changes and capacity.
6433 UNACCOUNTED = 11;
6434 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6435 WIFI = 13;
6436 }
6437 optional DrainType drain_type = 1;
6438
Bookatz3dbc13a2018-12-21 12:16:51 -08006439 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6440 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6441 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006442}
arangelov4e994062018-11-13 16:12:38 +00006443
6444/**
6445 * Logs device policy features.
6446 *
6447 * Logged from:
6448 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6449 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6450 */
6451message DevicePolicyEvent {
6452 // The event id - unique for each event.
6453 optional android.stats.devicepolicy.EventId event_id = 1;
6454 // The admin package name.
6455 optional string admin_package_name = 2;
6456 // A generic integer parameter.
6457 optional int32 integer_value = 3;
6458 // A generic boolean parameter.
6459 optional bool boolean_value = 4;
6460 // A parameter specifying a time period in milliseconds.
6461 optional uint64 time_period_millis = 5;
6462 // A parameter specifying a list of package names, bundle extras or string parameters.
6463 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6464}
shawnlinea5b66b2018-11-13 15:05:29 +08006465
6466/**
6467 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6468 *
6469 * Logged from:
6470 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6471 */
6472message DocsUILaunchReported {
6473 optional android.stats.docsui.LaunchAction launch_action = 1;
6474 optional bool has_initial_uri = 2;
6475 optional android.stats.docsui.MimeType mime_type = 3;
6476 optional android.stats.docsui.Root initial_root = 4;
6477}
6478
6479/**
6480 * Logs root/app visited event in file managers/picker. Call this when the user
6481 * taps on root/app in hamburger menu.
6482 *
6483 * Logged from:
6484 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6485 */
6486message DocsUIRootVisitedReported {
6487 optional android.stats.docsui.ContextScope scope = 1;
6488 optional android.stats.docsui.Root root = 2;
6489}
6490
6491/**
6492 * Logs file operation stats. Call this when a file operation has completed.
6493 *
6494 * Logged from:
6495 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6496 */
6497message DocsUIFileOperationReported {
6498 optional android.stats.docsui.Provider provider = 1;
6499 optional android.stats.docsui.FileOperation file_op = 2;
6500}
6501
6502/**
6503 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6504 * mode.
6505 *
6506 * Logged from:
6507 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6508 */
6509message DocsUIFileOperationCopyMoveModeReported {
6510 optional android.stats.docsui.FileOperation file_op = 1;
6511 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6512}
6513
6514
6515/**
6516 * Logs file sub operation stats. Call this when a file operation has failed.
6517 *
6518 * Logged from:
6519 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6520 */
6521message DocsUIFileOperationFailureReported {
6522 optional android.stats.docsui.Authority authority = 1;
6523 optional android.stats.docsui.SubFileOperation sub_op = 2;
6524}
6525
6526/**
6527* Logs the cancellation of a file operation. Call this when a job is canceled
6528*
6529* Logged from:
6530* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6531*/
6532message DocsUIFileOperationCanceledReported {
6533 optional android.stats.docsui.FileOperation file_op = 1;
6534}
6535
6536/**
6537 * Logs startup time in milliseconds.
6538 *
6539 * Logged from:
6540 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6541 */
6542message DocsUIStartupMsReported {
6543 optional int32 startup_millis = 1;
6544}
6545
6546/**
6547 * Logs the action that was started by user.
6548 *
6549 * Logged from:
6550 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6551 */
6552message DocsUIUserActionReported {
6553 optional android.stats.docsui.UserAction action = 1;
6554}
6555
6556/**
6557 * Logs the invalid type when invalid scoped access is requested.
6558 *
6559 * Logged from:
6560 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6561 */
6562message DocsUIInvalidScopedAccessRequestReported {
6563 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006564}
Ben Murdochbab399f2018-12-06 11:01:38 +00006565
6566/**
shawnlina75e82d2019-01-07 10:31:12 +08006567 * Logs the package name that launches docsui picker mode.
6568 *
6569 * Logged from:
6570 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6571 */
6572message DocsUIPickerLaunchedFromReported {
6573 optional string package_name = 1;
6574}
6575
6576/**
6577 * Logs the search type.
6578 *
6579 * Logged from:
6580 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6581 */
6582message DocsUISearchTypeReported {
6583 optional android.stats.docsui.SearchType search_type = 1;
6584}
6585
6586/**
6587 * Logs the search mode.
6588 *
6589 * Logged from:
6590 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6591 */
6592message DocsUISearchModeReported {
6593 optional android.stats.docsui.SearchMode search_mode = 1;
6594}
6595
6596/**
6597 * Logs the pick result information.
6598 *
6599 * Logged from:
6600 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6601 */
6602message DocsUIPickResultReported {
6603 optional int32 total_action_count = 1;
6604 optional int64 duration_millis = 2;
6605 optional int32 file_count= 3;
6606 optional bool is_searching = 4;
6607 optional android.stats.docsui.Root picked_from = 5;
6608 optional android.stats.docsui.MimeType mime_type = 6;
6609 optional int32 repeatedly_pick_times = 7;
6610}
6611
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006612/** Logs the drag and drop of files.
6613
6614 * Logged from:
6615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6616 */
6617message DocsUIDragAndDropReported {
6618 optional bool drag_initiated_from_docsui = 1;
6619}
6620
shawnlina75e82d2019-01-07 10:31:12 +08006621/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006622 * Logs when an app's memory is compacted.
6623 *
6624 * Logged from:
6625 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6626 */
6627message AppCompacted {
6628 // The pid of the process being compacted.
6629 optional int32 pid = 1;
6630
6631 // The name of the process being compacted.
6632 optional string process_name = 2;
6633
6634 // The type of compaction.
6635 enum Action {
6636 UNKNOWN = 0;
6637 SOME = 1;
6638 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006639 PERSISTENT = 3;
6640 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006641 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006642 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006643
6644 // Total RSS in kilobytes consumed by the process prior to compaction.
6645 optional int64 before_rss_total_kilobytes = 4;
6646
6647 // File RSS in kilobytes consumed by the process prior to compaction.
6648 optional int64 before_rss_file_kilobytes = 5;
6649
6650 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6651 optional int64 before_rss_anon_kilobytes = 6;
6652
6653 // Swap in kilobytes consumed by the process prior to compaction.
6654 optional int64 before_swap_kilobytes = 7;
6655
6656 // Total RSS in kilobytes consumed by the process after compaction.
6657 optional int64 after_rss_total_kilobytes = 8;
6658
6659 // File RSS in kilobytes consumed by the process after compaction.
6660 optional int64 after_rss_file_kilobytes = 9;
6661
6662 // Anonymous RSS in kilobytes consumed by the process after compaction.
6663 optional int64 after_rss_anon_kilobytes = 10;
6664
6665 // Swap in kilobytes consumed by the process after compaction.
6666 optional int64 after_swap_kilobytes = 11;
6667
6668 // The time taken to perform compaction in milliseconds.
6669 optional int64 time_to_compact_millis = 12;
6670
6671 // The last compaction action performed for this app.
6672 optional Action last_action = 13;
6673
Ben Murdoch01720b82018-12-19 18:03:44 +00006674 // The last time that compaction was attempted on this process in milliseconds
6675 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6676 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006677
Ben Murdoch885c21b2019-03-15 18:02:04 +00006678 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006679 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006680
6681 // The process state at the time of compaction.
6682 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006683
6684 // Free ZRAM in kilobytes before compaction.
6685 optional int64 before_zram_free_kilobytes = 17;
6686
6687 // Free ZRAM in kilobytes after compaction.
6688 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006689}
lifr157fc552018-12-12 16:38:04 +08006690
6691/**
lifrb6b90b62019-03-29 00:40:17 +08006692 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6693 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6694 *
lifr1f74b052019-04-16 22:16:30 +08006695 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6696 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6697 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6698 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006699 */
6700message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006701 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006702
lifr1f74b052019-04-16 22:16:30 +08006703 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006704
6705 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006706 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006707
lifr1f74b052019-04-16 22:16:30 +08006708 // Only valid for event_type = EVENT_GETADDRINFO.
6709 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006710
lifr1f74b052019-04-16 22:16:30 +08006711 // Flags passed to android_res_nsend() defined in multinetwork.h
6712 // Only valid for event_type = EVENT_RESNSEND.
6713 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006714
lifrad9becc2019-05-20 11:04:41 +08006715 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006716
6717 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006718 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006719
6720 // Additional pass-through fields opaque to statsd.
6721 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006722 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006723
6724 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6725 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006726}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006727
6728/**
6729 * Logs when a data stall event occurs.
6730 *
6731 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006732 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006733 */
6734message DataStallEvent {
6735 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006736 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006737 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6738 optional int32 evaluation_type = 1;
6739 // See definition in data_stall_event.proto.
6740 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6741 // See definition in data_stall_event.proto.
6742 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6743 // See definition in data_stall_event.proto.
6744 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6745 // See definition in data_stall_event.proto.
6746 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6747 // See definition in data_stall_event.proto.
6748 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006749 // The tcp packets fail rate from the latest tcp polling.
6750 optional int32 tcp_fail_rate = 7;
6751 // Number of packets sent since the last received packet.
6752 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006753}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006754
6755/*
6756 * Logs when RescueParty resets some set of experiment flags.
6757 *
6758 * Logged from:
6759 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6760 */
6761message RescuePartyResetReported {
6762 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6763 optional int32 rescue_level = 1;
6764}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006765
6766/**
6767 * Logs when signed config is received from an APK, and if that config was applied successfully.
6768 * Logged from:
6769 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6770 */
6771message SignedConfigReported {
6772 enum Type {
6773 UNKNOWN_TYPE = 0;
6774 GLOBAL_SETTINGS = 1;
6775 }
6776 optional Type type = 1;
6777
6778 // The final status of the signed config received.
6779 enum Status {
6780 UNKNOWN_STATUS = 0;
6781 APPLIED = 1;
6782 BASE64_FAILURE_CONFIG = 2;
6783 BASE64_FAILURE_SIGNATURE = 3;
6784 SECURITY_EXCEPTION = 4;
6785 INVALID_CONFIG = 5;
6786 OLD_CONFIG = 6;
6787 SIGNATURE_CHECK_FAILED = 7;
6788 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006789 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006790 }
6791 optional Status status = 2;
6792
6793 // The version of the signed config processed.
6794 optional int32 version = 3;
6795
6796 // The package name that the config was extracted from.
6797 optional string from_package = 4;
6798
6799 enum Key {
6800 NO_KEY = 0;
6801 DEBUG = 1;
6802 PRODUCTION = 2;
6803 }
6804 // Which key was used to verify the config.
6805 optional Key verified_with = 5;
6806}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006807
6808/*
6809 * Logs GNSS Network-Initiated (NI) location events.
6810 *
6811 * Logged from:
6812 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6813 */
6814message GnssNiEventReported {
6815 // The type of GnssNiEvent.
6816 enum EventType {
6817 UNKNOWN = 0;
6818 NI_REQUEST = 1;
6819 NI_RESPONSE = 2;
6820 }
6821 optional EventType event_type = 1;
6822
6823 // An ID generated by HAL to associate NI notifications and UI responses.
6824 optional int32 notification_id = 2;
6825
6826 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006827 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006828
6829 // NI requires notification.
6830 optional bool need_notify = 4;
6831
6832 // NI requires verification.
6833 optional bool need_verify = 5;
6834
6835 // NI requires privacy override, no notification/minimal trace.
6836 optional bool privacy_override = 6;
6837
6838 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6839 // seconds.
6840 optional int32 timeout = 7;
6841
6842 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006843 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006844
6845 // String representing the requester of the network inititated location request.
6846 optional string requestor_id = 9;
6847
6848 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6849 // network initiated location request.
6850 optional string text = 10;
6851
6852 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006853 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006854
6855 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006856 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006857
6858 // True if SUPL ES is enabled.
6859 optional bool is_supl_es_enabled = 13;
6860
6861 // True if GNSS location is enabled.
6862 optional bool is_location_enabled = 14;
6863
6864 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006865 optional android.server.location.GnssUserResponseType user_response = 15;
6866}
6867
6868/**
6869 * Logs GNSS non-framework (NFW) location notification.
6870 *
6871 * Logged from:
6872 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6873 */
6874message GnssNfwNotificationReported {
6875 // Package name of the Android proxy application representing the non-framework entity that
6876 // requested location. Set to empty string if unknown.
6877 optional string proxy_app_package_name = 1;
6878
6879 // Protocol stack that initiated the non-framework location request.
6880 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6881
6882 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6883 // set to empty string. This field is opaque to the framework and used for logging purposes.
6884 optional string other_protocol_stack_name = 3;
6885
6886 // Source initiating/receiving the location information.
6887 optional android.server.location.NfwRequestor requestor = 4;
6888
6889 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6890 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6891 // and used for logging purposes.
6892 optional string requestor_id = 5;
6893
6894 // Indicates whether location information was provided for this request.
6895 optional android.server.location.NfwResponseType response_type = 6;
6896
6897 // True if the device is in user initiated emergency session.
6898 optional bool in_emergency_mode = 7;
6899
6900 // True if cached location is provided.
6901 optional bool is_cached_location = 8;
6902
6903 // True if proxy app permission mismatch between framework and GNSS HAL.
6904 optional bool is_permission_mismatched = 9;
6905}
6906
6907/**
6908 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6909 *
6910 * Logged from:
6911 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6912 */
6913message GnssConfigurationReported {
6914 // SUPL host name.
6915 optional string supl_host = 1;
6916
6917 // SUPL port number.
6918 optional int32 supl_port = 2;
6919
6920 // C2K host name.
6921 optional string c2k_host = 3;
6922
6923 // C2K port number.
6924 optional int32 c2k_port = 4;
6925
6926 // The SUPL version requested by Carrier.
6927 optional int32 supl_ver = 5;
6928
6929 // The SUPL mode.
6930 optional android.server.location.SuplMode supl_mode = 6;
6931
6932 // True if NI emergency SUPL restrictions is enabled.
6933 optional bool supl_es = 7;
6934
6935 // LTE Positioning Profile settings
6936 optional android.server.location.LppProfile lpp_profile = 8;
6937
6938 // Positioning protocol on A-Glonass system.
6939 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6940
6941 // True if emergency PDN is used. Otherwise, regular PDN is used.
6942 optional bool use_emergency_pdn_for_emergency_supl= 10;
6943
6944 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6945 optional android.server.location.GpsLock gps_lock = 11;
6946
6947 // Number of seconds to extend the emergency session duration post emergency call.
6948 optional int32 es_extension_sec = 12;
6949
6950 // The full list of package names of proxy Android applications representing the non-framework
6951 // location access entities (on/off the device) for which the framework user has granted
6952 // non-framework location access permission. The package names are concatenated in one string
6953 // with spaces as separators.
6954 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006955}
Jack Yu95b64f32018-12-13 18:26:11 +08006956
6957/**
6958 * Logs when a NFC device's error occurred.
6959 * Logged from:
6960 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6961 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6962 */
6963message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006964 enum Type {
6965 UNKNOWN = 0;
6966 CMD_TIMEOUT = 1;
6967 ERROR_NOTIFICATION = 2;
6968 AID_OVERFLOW = 3;
6969 }
6970 optional Type type = 1;
6971 // If it's nci cmd timeout, log the timeout command.
6972 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006973
Alex Salod7c3eef2019-01-25 14:43:27 -08006974 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006975}
6976
6977/**
6978 * Logs when a NFC device's state changed event
6979 * Logged from:
6980 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6981 */
6982message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006983 enum State {
6984 UNKNOWN = 0;
6985 OFF = 1;
6986 ON = 2;
6987 ON_LOCKED = 3; // Secure Nfc enabled.
6988 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6989 }
6990 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006991}
6992
6993/**
6994 * Logs when a NFC Beam Transaction occurred.
6995 * Logged from:
6996 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6997 */
6998message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006999 enum Operation {
7000 UNKNOWN = 0;
7001 SEND = 1;
7002 RECEIVE = 2;
7003 }
7004 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007005}
7006
7007/**
7008 * Logs when a NFC Card Emulation Transaction occurred.
7009 * Logged from:
7010 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7011 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7012 */
7013message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007014 enum Category {
7015 UNKNOWN = 0;
7016 HCE_PAYMENT = 1;
7017 HCE_OTHER = 2;
7018 OFFHOST = 3;
7019 }
7020 // Transaction belongs to HCE payment or HCE other category, or offhost.
7021 optional Category category = 1;
7022 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7023 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007024}
7025
7026/**
7027 * Logs when a NFC Tag event occurred.
7028 * Logged from:
7029 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7030 */
7031message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007032 enum Type {
7033 UNKNOWN = 0;
7034 URL = 1;
7035 BT_PAIRING = 2;
7036 PROVISION = 3;
7037 WIFI_CONNECT = 4;
7038 APP_LAUNCH = 5;
7039 OTHERS = 6;
7040 }
7041 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007042}
7043
7044/**
7045 * Logs when Hce transaction triggered
7046 * Logged from:
7047 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7048 */
7049message NfcHceTransactionOccurred {
7050 // The latency period(in microseconds) it took for the first HCE data
7051 // exchange.
7052 optional uint32 latency_micros = 1;
7053}
7054
7055/**
7056 * Logs when SecureElement state event changed
7057 * Logged from:
7058 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7059 */
7060message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007061 enum State {
7062 UNKNOWN = 0;
7063 INITIALIZED = 1;
7064 DISCONNECTED = 2;
7065 CONNECTED = 3;
7066 HALCRASH = 4;
7067 }
7068 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007069
Alex Salod7c3eef2019-01-25 14:43:27 -08007070 optional string state_change_reason = 2;
7071 // SIMx or eSEx.
7072 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007073}
7074
7075/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007076 * Information about a permission grant request
7077 */
7078message PermissionGrantRequestResultReported {
7079 // unique value identifying an API call. A API call might result in multiple of these atoms
7080 optional int64 request_id = 1;
7081
7082 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007083 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007084
7085 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007086 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007087
7088 // The permission to be granted
7089 optional string permission_name = 4;
7090
7091 // If the permission was explicitly requested via the API or added by the system
7092 optional bool is_implicit = 5;
7093
7094 enum Result {
7095 UNDEFINED = 0;
7096 // permission request was ignored
7097 IGNORED = 1;
7098 // permission request was ignored because it was user fixed
7099 IGNORED_USER_FIXED = 2;
7100 // permission request was ignored because it was policy fixed
7101 IGNORED_POLICY_FIXED = 3;
7102 // permission was granted by user action
7103 USER_GRANTED = 4;
7104 // permission was automatically granted
7105 AUTO_GRANTED = 5;
7106 // permission was denied by user action
7107 USER_DENIED = 6;
7108 // permission was denied with prejudice by the user
7109 USER_DENIED_WITH_PREJUDICE = 7;
7110 // permission was automatically denied
7111 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007112 // permission request was ignored because permission is restricted
7113 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007114 // one time permission was granted by user action
7115 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007116 // user ignored request by leaving the request screen without choosing any option
7117 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007118 // user granted the permission after being linked to settings
7119 USER_GRANTED_IN_SETTINGS = 12;
7120 // user denied the permission after being linked to settings
7121 USER_DENIED_IN_SETTINGS = 13;
7122 // user denied the permission with prejudice after being linked to settings
7123 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7124 // permission was automatically revoked after one-time permission expired
7125 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007126 // permission was automatically revoked for unused app
7127 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007128 }
7129 // The result of the permission grant
7130 optional Result result = 6;
7131}
7132
7133/**
Jack Yu95b64f32018-12-13 18:26:11 +08007134 * Logs when Omapi API used
7135 * Logged from:
7136 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7137 */
7138message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007139 enum Operation {
7140 UNKNOWN = 0;
7141 OPEN_CHANNEL = 1;
7142 }
7143 optional Operation operation = 1;
7144 // SIMx or eSEx.
7145 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007146
Alex Salod7c3eef2019-01-25 14:43:27 -08007147 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007148}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007149
7150/**
Alex Saloa060aee2019-01-21 14:36:41 -08007151 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7152 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007153 * Logged from:
7154 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7155 */
7156message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007157 optional int64 dispatch_latency_millis = 1;
7158}
7159
7160/**
7161 * Logs AttentionManagerService attention check result.
7162 *
7163 * Logged from:
7164 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7165 */
7166message AttentionManagerServiceResultReported {
7167 // See core/java/android/service/attention/AttentionService.java
7168 enum AttentionCheckResult {
7169 UNKNOWN = 20;
7170 ATTENTION_SUCCESS_ABSENT = 0;
7171 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007172 ATTENTION_FAILURE_UNKNOWN = 2;
7173 ATTENTION_FAILURE_CANCELLED = 3;
7174 ATTENTION_FAILURE_PREEMPTED = 4;
7175 ATTENTION_FAILURE_TIMED_OUT = 5;
7176 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007177 }
7178 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007179}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007180
7181/**
7182 * Logs when an adb connection changes state.
7183 *
7184 * Logged from:
7185 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7186 */
7187message AdbConnectionChanged {
7188 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7189 // previously selected for this system.
7190 optional int64 last_connection_time_millis = 1;
7191
7192 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7193 // to reconnect via adb without user interaction.
7194 optional int64 auth_window_millis = 2;
7195
7196 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7197 optional android.debug.AdbConnectionStateEnum state = 3;
7198
7199 // True if the 'always allow' option was selected for this system.
7200 optional bool always_allow = 4;
7201}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007202
7203/*
7204 * Logs the reported speech DSP status.
7205 *
7206 * Logged from:
7207 * Vendor audio implementation.
7208 */
7209message SpeechDspStatReported {
7210 // The total Speech DSP uptime in milliseconds.
7211 optional int32 total_uptime_millis = 1;
7212 // The total Speech DSP downtime in milliseconds.
7213 optional int32 total_downtime_millis = 2;
7214 optional int32 total_crash_count = 3;
7215 optional int32 total_recover_count = 4;
7216}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007217
7218/**
7219 * Logs USB connector contaminant status.
7220 *
7221 * Logged from: USB Service.
7222 */
7223message UsbContaminantReported {
7224 optional string id = 1;
7225 optional android.service.usb.ContaminantPresenceStatus status = 2;
7226}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007227
7228/**
7229 * This atom is for debugging purpose.
7230 */
7231message DebugElapsedClock {
7232 // Monotically increasing value for each pull.
7233 optional int64 pull_count = 1;
7234 // Time from System.elapsedRealtime.
7235 optional int64 elapsed_clock_millis = 2;
7236 // Time from System.elapsedRealtime.
7237 optional int64 same_elapsed_clock_millis = 3;
7238 // Diff between current elapsed time and elapsed time from previous pull.
7239 optional int64 elapsed_clock_diff_millis = 4;
7240
7241 enum Type {
7242 TYPE_UNKNOWN = 0;
7243 ALWAYS_PRESENT = 1;
7244 PRESENT_ON_ODD_PULLS = 2;
7245 }
7246 // Type of behavior for the pulled data.
7247 optional Type type = 5;
7248}
7249
7250/**
7251 * This atom is for debugging purpose.
7252 */
7253message DebugFailingElapsedClock {
7254 // Monotically increasing value for each pull.
7255 optional int64 pull_count = 1;
7256 // Time from System.elapsedRealtime.
7257 optional int64 elapsed_clock_millis = 2;
7258 // Time from System.elapsedRealtime.
7259 optional int64 same_elapsed_clock_millis = 3;
7260 // Diff between current elapsed time and elapsed time from previous pull.
7261 optional int64 elapsed_clock_diff_millis = 4;
7262}
Steven Wuacef6bb2019-01-23 14:21:17 -05007263
7264/** Logs System UI bubbles event changed.
7265 *
7266 * Logged from:
7267 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7268 */
7269message BubbleUIChanged {
7270
7271 // The app package that is posting the bubble.
7272 optional string package_name = 1;
7273
7274 // The notification channel that is posting the bubble.
7275 optional string notification_channel = 2;
7276
7277 // The notification id associated with the posted bubble.
7278 optional int32 notification_id = 3;
7279
7280 // The position of the bubble within the bubble stack.
7281 optional int32 position = 4;
7282
7283 // The total number of bubbles within the bubble stack.
7284 optional int32 total_number = 5;
7285
7286 // User interactions with the bubble.
7287 enum Action {
7288 UNKNOWN = 0;
7289 POSTED = 1;
7290 UPDATED = 2;
7291 EXPANDED = 3;
7292 COLLAPSED = 4;
7293 DISMISSED = 5;
7294 STACK_DISMISSED = 6;
7295 STACK_MOVED = 7;
7296 HEADER_GO_TO_APP = 8;
7297 HEADER_GO_TO_SETTINGS = 9;
7298 PERMISSION_OPT_IN = 10;
7299 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007300 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007301 SWIPE_LEFT = 13;
7302 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007303 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007304 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007305 }
7306 optional Action action = 6;
7307
7308 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7309 optional float normalized_x_position = 7;
7310 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007311
7312 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7313 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007314
7315 // Whether the bubble is an on-going one.
7316 optional bool is_ongoing = 10;
7317
7318 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007319 // This is deprecated and the value should be ignored.
7320 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007321}
Kweku Adams8845d012018-12-11 20:06:45 -08007322
7323/**
Steven Wu552f63f2019-02-05 13:41:36 -05007324 * Logs System UI bubbles developer errors.
7325 *
7326 * Logged from:
7327 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7328 */
7329message BubbleDeveloperErrorReported {
7330
7331 // The app package that is posting the bubble.
7332 optional string package_name = 1;
7333
7334 // Bubble developer error type enums.
7335 enum Error {
7336 UNKNOWN = 0;
7337 ACTIVITY_INFO_MISSING = 1;
7338 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7339 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7340 }
7341 optional Error error = 2 [default = UNKNOWN];
7342}
7343
7344/**
Kweku Adams8845d012018-12-11 20:06:45 -08007345 * Logs that a constraint for a scheduled job has changed.
7346 *
7347 * Logged from:
7348 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7349 */
7350message ScheduledJobConstraintChanged {
7351 repeated AttributionNode attribution_node = 1;
7352
7353 // Name of the job.
7354 optional string job_name = 2;
7355
7356 optional com.android.server.job.ConstraintEnum constraint = 3;
7357
7358 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007359 UNKNOWN = 0;
7360 UNSATISFIED = 1;
7361 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007362 }
7363 optional State state = 4;
7364}
Alex Salod7c3eef2019-01-25 14:43:27 -08007365
7366/**
7367 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7368 * returns true.
7369 *
7370 * Logged from:
7371 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7372 */
7373message ScreenTimeoutExtensionReported {
7374 // Describes how many times in a row did the power manager reset the screen off timeout.
7375 optional uint32 consecutive_timeout_extended_count = 1;
7376}
Hui Yu885aca12019-01-10 17:11:34 -08007377
7378/*
7379* Logs number of milliseconds it takes to start a process.
7380* The definition of app process start time is from the app launch time to
7381* the time that Zygote finished forking the app process and loaded the
7382* application package's java classes.
7383
7384* This metric is different from AppStartOccurred which is for foreground
7385* activity only.
7386
7387* ProcessStartTime can report all processes (both foreground and background)
7388* start time.
7389*
7390* Logged from:
7391* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7392*/
7393message ProcessStartTime {
7394 // The uid of the ProcessRecord.
7395 optional int32 uid = 1 [(is_uid) = true];
7396
7397 // The process pid.
7398 optional int32 pid = 2;
7399
7400 // The process name.
7401 // Usually package name, "system" for system server.
7402 // Provided by ActivityManagerService.
7403 optional string process_name = 3;
7404
7405 enum StartType {
7406 UNKNOWN = 0;
7407 WARM = 1;
7408 HOT = 2;
7409 COLD = 3;
7410 }
7411
7412 // The start type.
7413 optional StartType type = 4;
7414
7415 // The elapsed realtime at the start of the process.
7416 optional int64 process_start_time_millis = 5;
7417
7418 // Number of milliseconds it takes to reach bind application.
7419 optional int32 bind_application_delay_millis = 6;
7420
7421 // Number of milliseconds it takes to finish start of the process.
7422 optional int32 process_start_delay_millis = 7;
7423
7424 // hostingType field in ProcessRecord, the component type such as "activity",
7425 // "service", "content provider", "broadcast" or other strings.
7426 optional string hosting_type = 8;
7427
7428 // hostingNameStr field in ProcessRecord. The component class name that runs
7429 // in this process.
7430 optional string hosting_name = 9;
7431}
7432
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007433/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007434 * Track Media Codec usage
7435 * Logged from:
7436 * frameworks/av/media/libstagefright/MediaCodec.cpp
7437 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7438 */
7439message MediametricsCodecReported {
7440 optional int64 timestamp_nanos = 1;
7441 optional string package_name = 2;
7442 optional int64 package_version_code = 3;
7443 optional int64 media_apex_version = 4;
7444
7445 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7446}
7447
7448/**
7449 * Track Media Extractor (pulling video/audio streams out of containers) usage
7450 * Logged from:
7451 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7452 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7453 */
7454message MediametricsExtractorReported {
7455 optional int64 timestamp_nanos = 1;
7456 optional string package_name = 2;
7457 optional int64 package_version_code = 3;
7458 optional int64 media_apex_version = 4;
7459
7460 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7461}
7462
7463/**
7464 * Track how we arbitrate between microphone/input requests.
7465 * Logged from
7466 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7467 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7468 */
7469message MediametricsAudiopolicyReported {
7470 optional int64 timestamp_nanos = 1;
7471 optional string package_name = 2;
7472 optional int64 package_version_code = 3;
7473 optional int64 media_apex_version = 4;
7474
7475 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7476}
7477
7478/**
7479 * Track how we arbitrate between microphone requests.
7480 * Logged from
7481 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7482 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7483 */
7484message MediametricsAudiorecordReported {
7485 optional int64 timestamp_nanos = 1;
7486 optional string package_name = 2;
7487 optional int64 package_version_code = 3;
7488 optional int64 media_apex_version = 4;
7489
7490 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7491}
7492
7493/**
7494 * Track how we arbitrate between microphone/input requests.
7495 * Logged from
7496 * frameworks/av/media/libnblog/ReportPerformance.cpp
7497 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7498 */
7499message MediametricsAudiothreadReported {
7500 optional int64 timestamp_nanos = 1;
7501 optional string package_name = 2;
7502 optional int64 package_version_code = 3;
7503 optional int64 media_apex_version = 4;
7504
7505 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7506}
7507
7508/**
7509 * Track how we arbitrate between microphone/input requests.
7510 * Logged from
7511 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7512 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7513 */
7514message MediametricsAudiotrackReported {
7515 optional int64 timestamp_nanos = 1;
7516 optional string package_name = 2;
7517 optional int64 package_version_code = 3;
7518 optional int64 media_apex_version = 4;
7519
7520 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7521}
7522
7523/**
7524 * Track information about DRM framework performance
7525 * Logged from
7526 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7527 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7528 */
7529message MediametricsMediadrmReported {
7530 optional int64 timestamp_nanos = 1;
7531 optional string package_name = 2;
7532 optional int64 package_version_code = 3;
7533 optional int64 media_apex_version = 4;
7534
7535 // vendor+description tell about which DRM plugin is in use on this device
7536 optional string vendor = 5;
7537 optional string description = 6;
7538 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7539 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7540}
7541
7542/**
7543 * Track information about the widevine DRM plugin performance
7544 * Logged from
7545 * vendor/widevine/libwvdrmengine/cdm/metrics
7546 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7547 */
7548message MediametricsDrmWidevineReported {
7549 optional int64 timestamp_nanos = 1;
7550 optional string package_name = 2;
7551 optional int64 package_version_code = 3;
7552 optional int64 media_apex_version = 4;
7553
7554 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7555}
7556
7557/**
7558 * Track information about recordings (e.g. camcorder)
7559 * Logged from
7560 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7561 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7562 */
7563message MediametricsRecorderReported {
7564 optional int64 timestamp_nanos = 1;
7565 optional string package_name = 2;
7566 optional int64 package_version_code = 3;
7567 optional int64 media_apex_version = 4;
7568
7569 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7570}
7571
7572/**
7573 * Track Media Player usage
7574 * Logged from:
7575 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7576 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7577 */
7578message MediametricsNuPlayerReported {
7579 optional int64 timestamp_nanos = 1;
7580 optional string package_name = 2;
7581 optional int64 package_version_code = 3;
7582 optional int64 media_apex_version = 4;
7583
7584 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7585}
7586
7587/**
Robert Shiha4beed32019-08-19 14:15:23 -07007588 * Track Legacy DRM usage
7589 * Logged from
7590 * frameworks/av/drm/drmserver/DrmManager.cpp
7591 */
7592message MediametricsDrmManagerReported {
7593 optional int64 timestamp_nanos = 1;
7594 optional string package_name = 2;
7595 optional int64 package_version_code = 3;
7596 optional int64 media_apex_version = 4;
7597
7598 enum Method {
7599 METHOD_NOT_FOUND = -1;
7600 GET_CONSTRAINTS = 0;
7601 GET_METADATA = 1;
7602 CAN_HANDLE = 2;
7603 PROCESS_DRM_INFO = 3;
7604 ACQUIRE_DRM_INFO = 4;
7605 SAVE_RIGHTS = 5;
7606 GET_ORIGINAL_MIME_TYPE = 6;
7607 GET_DRM_OBJECT_TYPE = 7;
7608 CHECK_RIGHTS_STATUS = 8;
7609 REMOVE_RIGHTS = 9;
7610 REMOVE_ALL_RIGHTS = 10;
7611 OPEN_CONVERT_SESSION = 11;
7612 OPEN_DECRYPT_SESSION = 12;
7613 }
7614
7615 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7616 optional string plugin_id = 5;
7617 optional string description = 6;
7618 optional Method method = 7;
7619 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007620
7621 optional int64 get_constraints_count = 9;
7622 optional int64 get_metadata_count = 10;
7623 optional int64 can_handle_count = 11;
7624 optional int64 process_drm_info_count = 12;
7625 optional int64 acquire_drm_info_count = 13;
7626 optional int64 save_rights_count = 14;
7627 optional int64 get_original_mime_type_count = 15;
7628 optional int64 get_drm_object_type_count = 16;
7629 optional int64 check_rights_status_count = 17;
7630 optional int64 remove_rights_count = 18;
7631 optional int64 remove_all_rights_count = 19;
7632 optional int64 open_convert_session_count = 20;
7633 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007634}
7635
7636/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007637 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007638 * Pulled from: StatsCompanionService
7639*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007640message DangerousPermissionState {
7641 // Name of the permission
7642 optional string permission_name = 1;
7643
7644 // Uid of the package
7645 optional int32 uid = 2 [(is_uid) = true];
7646
7647 // Package requesting the permission
7648 optional string package_name = 3;
7649
7650 // If the permission is granted to the uid
7651 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007652
7653 // Permission flags as per android.content.pm.PermissionFlags
7654 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007655}
7656
Michael Groover4a0ca942019-01-24 17:41:25 -08007657/**
7658 * Logs when a package is denied access to a device identifier based on the new access requirements.
7659 *
7660 * Logged from:
7661 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7662 */
7663message DeviceIdentifierAccessDenied {
7664 // The name of the package denied access to the requested device identifier.
7665 optional string package_name = 1;
7666
7667 // The name of the device identifier method the package attempted to invoke.
7668 optional string method_name = 2;
7669
7670 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007671 // Starting from Android 11, this boolean is not set and will always be false.
7672 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007673
7674 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007675 // Starting from Android 11, this boolean is not set and will always be false.
7676 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007677}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007678
7679/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007680 * Pulls the ongoing mainline install train version code.
7681 * Pulled from StatsCompanionService
7682 */
7683message TrainInfo {
7684 optional int64 train_version_code = 1;
7685
7686 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007687
7688 optional string train_name = 3;
7689
7690 enum Status {
7691 UNKNOWN = 0;
7692 INSTALL_REQUESTED = 1;
7693 INSTALL_STARTED = 2;
7694 INSTALL_STAGED_NOT_READY = 3;
7695 INSTALL_STAGED_READY = 4;
7696 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007697 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7698 // and INSTALL_FAILURE_COMMIT.
7699 INSTALL_FAILURE = 6 [deprecated = true];
7700 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007701 INSTALL_CANCELLED = 7;
7702 INSTALLER_ROLLBACK_REQUESTED = 8;
7703 INSTALLER_ROLLBACK_INITIATED = 9;
7704 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7705 INSTALLER_ROLLBACK_STAGED = 11;
7706 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7707 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7708 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7709 INSTALLER_ROLLBACK_SUCCESS = 15;
7710 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007711 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7712 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7713 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7714 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7715 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7716 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007717 INSTALL_FAILURE_DOWNLOAD = 23;
7718 INSTALL_FAILURE_STATE_MISMATCH = 24;
7719 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007720 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007721 }
7722 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007723}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007724
7725/**
7726 * Logs the gesture stage changed event.
7727 *
7728 * Logged from:
7729 * frameworks/base/packages/SystemUI/
7730 */
7731message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007732 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007733}
7734
7735/**
7736 * Logs the feedback type.
7737 *
7738 * Logged from:
7739 * frameworks/base/packages/SystemUI/
7740 */
7741message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007742 // Whether or not the gesture was used.
7743 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007744}
7745
7746/**
7747 * Logs the progress.
7748 *
7749 * Logged from:
7750 * frameworks/base/packages/SystemUI/
7751 */
7752message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007753 // [0,100] progress for the assist gesture.
7754 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007755}
Neil Fullerdb14b482019-02-05 19:44:44 +00007756
7757/*
7758 * Information about the time zone data on a device.
7759 */
7760message TimeZoneDataInfo {
7761 // A version identifier for the data set on device. e.g. "2018i"
7762 optional string tzdb_version = 1;
7763}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007764
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007765/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007766 * Logs the GPU stats global health information.
7767 *
7768 * Logged from:
7769 * frameworks/native/services/gpuservice/gpustats/
7770 */
7771message GpuStatsGlobalInfo {
7772 // Package name of the gpu driver.
7773 optional string driver_package_name = 1;
7774
7775 // Version name of the gpu driver.
7776 optional string driver_version_name = 2;
7777
7778 // Version code of the gpu driver.
7779 optional int64 driver_version_code = 3;
7780
7781 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7782 optional int64 driver_build_time = 4;
7783
7784 // Total count of the gl driver gets loaded.
7785 optional int64 gl_loading_count = 5;
7786
7787 // Total count of the gl driver fails to be loaded.
7788 optional int64 gl_loading_failure_count = 6;
7789
7790 // Total count of the Vulkan driver gets loaded.
7791 optional int64 vk_loading_count = 7;
7792
7793 // Total count of the Vulkan driver fails to be loaded.
7794 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007795
7796 // Api version of the system Vulkan driver.
7797 optional int32 vulkan_version = 9;
7798
7799 // Api version of the system CPU Vulkan driver.
7800 optional int32 cpu_vulkan_version = 10;
7801
7802 // Api version of the system GLES driver.
7803 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007804
7805 // Total count of the angle driver gets loaded.
7806 optional int64 angle_loading_count = 12;
7807
7808 // Total count of the angle driver fails to be loaded.
7809 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007810}
7811
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007812/**
7813 * GPU driver loading time info.
7814 */
7815message GpuDriverLoadingTime {
7816 // List of all the driver loading times for this app. The list size is
7817 // capped at 50.
7818 repeated int64 driver_loading_time = 1;
7819}
7820
7821/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007822 * Logs the GPU stats per app health information.
7823 *
7824 * Logged from:
7825 * frameworks/native/services/gpuservice/gpustats/
7826 */
7827message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007828 // Package name of the application that loads the gpu driver. Total number
7829 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007830 optional string app_package_name = 1;
7831
7832 // Version code of the gpu driver this app loads.
7833 optional int64 driver_version_code = 2;
7834
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007835 // gl driver loading time info.
7836 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7837 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007838
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007839 // Vulkan driver loading time info.
7840 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7841 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007842
7843 // Angle driver loading time info.
7844 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7845 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007846
7847 // CPU Vulkan implementation is in use.
7848 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007849
7850 // App is not doing pre-rotation correctly.
7851 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007852
7853 // App creates GLESv1 context.
7854 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007855}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007856
7857/*
7858 * Logs the size of the system ion heap.
7859 *
7860 * Pulled from StatsCompanionService.
7861 */
7862message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007863 // Deprecated due to limited support of ion stats in debugfs.
7864 // Use `IonHeapSize` instead.
7865 option deprecated = true;
7866
Rafal Slawikd4e87572019-03-12 13:08:38 +00007867 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007868 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007869 optional int64 size_in_bytes = 1;
7870}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007871
Rafal Slawik77987ed2019-06-17 12:28:23 +01007872/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007873 * Logs the total size of the ion heap.
7874 *
7875 * Pulled from StatsCompanionService.
7876 */
7877message IonHeapSize {
7878 // Total size of all ion heaps in kilobytes.
7879 // Read from: /sys/kernel/ion/total_heaps_kb.
7880 optional int32 total_size_kb = 1;
7881}
7882
7883/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007884 * Logs the per-process size of the system ion heap.
7885 *
7886 * Pulled from StatsCompanionService.
7887 */
7888message ProcessSystemIonHeapSize {
7889 // The uid if available. -1 means not available.
7890 optional int32 uid = 1 [(is_uid) = true];
7891
7892 // The process name (from /proc/PID/cmdline).
7893 optional string process_name = 2;
7894
7895 // Sum of sizes of all allocations.
7896 optional int32 total_size_in_kilobytes = 3;
7897
7898 // Number of allocations.
7899 optional int32 allocation_count = 4;
7900
7901 // Size of the largest allocation.
7902 optional int32 max_size_in_kilobytes = 5;
7903}
7904
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007905/**
7906 * Push network stack events.
7907 *
7908 * Log from:
7909 * frameworks/base/packages/NetworkStack/
7910 */
7911message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007912 // The id that indicates the event reported from NetworkStack.
7913 optional int32 event_id = 1;
7914 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007915 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7916}
Carmen Agimofa769c152019-03-04 14:39:14 +00007917
7918/**
7919 * Logs the apps that are installed on the external storage.
7920 * Pulled from:
7921 * StatsCompanionService
7922 */
7923message AppsOnExternalStorageInfo {
7924 // The type of the external storage.
7925 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7926 // The name of the package that is installed on the external storage.
7927 optional string package_name = 2;
7928}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007929
7930/**
7931 * Logs the settings related to Face.
7932 * Logged from:
7933 * frameworks/base/services/core/java/com/android/server/stats
7934 */
7935message FaceSettings {
7936 // Whether or not face unlock is allowed on Keyguard.
7937 optional bool unlock_keyguard_enabled = 1;
7938 // Whether or not face unlock dismisses the Keyguard.
7939 optional bool unlock_dismisses_keyguard = 2;
7940 // Whether or not face unlock requires attention.
7941 optional bool unlock_attention_required = 3;
7942 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7943 optional bool unlock_app_enabled = 4;
7944 // Whether or not face unlock always requires user confirmation.
7945 optional bool unlock_always_require_confirmation = 5;
7946 // Whether or not a diverse set of poses are required during enrollment.
7947 optional bool unlock_diversity_required = 6;
7948}
Maggie White442b6312019-04-05 16:26:44 -07007949
7950/**
7951 * Logs cooling devices maintained by the kernel.
7952 *
7953 * Pulled from StatsCompanionService.java
7954 */
7955message CoolingDevice {
7956 // The type of cooling device being reported. Eg. CPU, GPU...
7957 optional android.os.CoolingTypeEnum device_location = 1;
7958 // The name of the cooling device source. Eg. CPU0
7959 optional string device_name = 2;
7960 // Current throttle state of the cooling device. The value can any unsigned
7961 // integer between 0 and max_state defined in its driver. 0 means device is
7962 // not in throttling, higher value means deeper throttling.
7963 optional int32 state = 3;
7964}
Ben Blount763a5d52019-04-10 11:48:58 -07007965
7966/**
7967 * Intelligence has several counter-type events that don't warrant a
7968 * full separate atom. These are primarily API call counters but also include
7969 * counters for feature usage and specific failure modes.
7970 *
7971 * Logged from the Intelligence mainline module.
7972 */
7973message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007974 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007975 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007976 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007977 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007978 // How many times the event occured (to report a batch of high frequency events).
7979 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007980 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007981 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007982}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007983
7984/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007985 * Logs when Car Power state changed.
7986 *
7987 * Logged from:
7988 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7989 */
7990message CarPowerStateChanged {
7991 // States come from CpmsState in CarPowerManagementService.java.
7992 enum State {
7993 WAIT_FOR_VHAL = 0;
7994 ON = 1;
7995 SHUTDOWN_PREPARE = 2;
7996 WAIT_FOR_FINISH = 3;
7997 SUSPEND = 4;
7998 SIMULATE_SLEEP = 5;
7999 }
8000 optional State state = 1;
8001}
8002
8003/**
8004 * Logs whether GarageMode is entered.
8005 *
8006 * Logged from:
8007 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8008 */
8009message GarageModeInfo {
8010 // Whether GarageMode is entered.
8011 optional bool is_garage_mode = 1;
8012}
Martijn Coenencd95d462019-04-25 17:09:45 +02008013
8014/**
8015 * Historical app ops data per package.
8016 */
8017message AppOps {
8018 // Uid of the package requesting the op
8019 optional int32 uid = 1 [(is_uid) = true];
8020
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008021 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008022 optional string package_name = 2;
8023
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008024 // operation id
8025 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008026
8027 // The number of times the op was granted while the app was in the
8028 // foreground (only for trusted requests)
8029 optional int64 trusted_foreground_granted_count = 4;
8030
8031 // The number of times the op was granted while the app was in the
8032 // background (only for trusted requests)
8033 optional int64 trusted_background_granted_count = 5;
8034
8035 // The number of times the op was rejected while the app was in the
8036 // foreground (only for trusted requests)
8037 optional int64 trusted_foreground_rejected_count = 6;
8038
8039 // The number of times the op was rejected while the app was in the
8040 // background (only for trusted requests)
8041 optional int64 trusted_background_rejected_count = 7;
8042
8043 // For long-running operations, total duration of the operation
8044 // while the app was in the foreground (only for trusted requests)
8045 optional int64 trusted_foreground_duration_millis = 8;
8046
8047 // For long-running operations, total duration of the operation
8048 // while the app was in the background (only for trusted requests)
8049 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008050
8051 // Whether AppOps is guarded by Runtime permission
8052 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008053}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008054
8055/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008056 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008057 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008058message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008059 // Uid of the package requesting the op
8060 optional int32 uid = 1 [(is_uid) = true];
8061
8062 // Name of the package performing the op
8063 optional string package_name = 2;
8064
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008065 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8066 // Attributions must be provided through manifest using <attribution> tag available in R and
8067 // above.
8068 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008069
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008070 // operation id
8071 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008072
8073 // The number of times the op was granted while the app was in the
8074 // foreground (only for trusted requests)
8075 optional int64 trusted_foreground_granted_count = 5;
8076
8077 // The number of times the op was granted while the app was in the
8078 // background (only for trusted requests)
8079 optional int64 trusted_background_granted_count = 6;
8080
8081 // The number of times the op was rejected while the app was in the
8082 // foreground (only for trusted requests)
8083 optional int64 trusted_foreground_rejected_count = 7;
8084
8085 // The number of times the op was rejected while the app was in the
8086 // background (only for trusted requests)
8087 optional int64 trusted_background_rejected_count = 8;
8088
8089 // For long-running operations, total duration of the operation
8090 // while the app was in the foreground (only for trusted requests)
8091 optional int64 trusted_foreground_duration_millis = 9;
8092
8093 // For long-running operations, total duration of the operation
8094 // while the app was in the background (only for trusted requests)
8095 optional int64 trusted_background_duration_millis = 10;
8096
8097 // Whether AppOps is guarded by Runtime permission
8098 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008099
8100 // Sampling rate used on device, from 0 to 100
8101 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008102}
8103
8104/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008105 * Location Manager API Usage information(e.g. API under usage,
8106 * API call's parameters).
8107 * Logged from:
8108 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8109 */
8110message LocationManagerApiUsageReported {
8111
8112 // Indicating if usage starts or usage ends.
8113 optional android.stats.location.UsageState state = 1;
8114
8115 // LocationManagerService's API in use.
8116 // We can identify which API from LocationManager is
8117 // invoking current LMS API by the combination of
8118 // API parameter(e.g. is_listener_null, is_intent_null,
8119 // is_location_request_null)
8120 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8121
8122 // Name of the package calling the API.
8123 optional string calling_package_name = 3;
8124
8125 // Type of the location provider.
8126 optional android.stats.location.ProviderType provider = 4;
8127
8128 // Quality of the location request
8129 optional android.stats.location.LocationRequestQuality quality = 5;
8130
8131 // The desired interval for active location updates, in milliseconds.
8132 // Bucketized to reduce cardinality.
8133 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8134
8135 // Minimum distance between location updates, in meters.
8136 // Bucketized to reduce cardinality.
8137 optional android.stats.location.SmallestDisplacementBucket
8138 bucketized_smallest_displacement = 7;
8139
8140 // The number of location updates.
8141 optional int64 num_updates = 8;
8142
8143 // The request expiration time, in millisecond since boot.
8144 // Bucketized to reduce cardinality.
8145 optional android.stats.location.ExpirationBucket
8146 bucketized_expire_in = 9;
8147
8148 // Type of Callback passed in for this API.
8149 optional android.stats.location.CallbackType callback_type = 10;
8150
8151 // The radius of the central point of the alert
8152 // region, in meters. Only for API REQUEST_GEOFENCE.
8153 // Bucketized to reduce cardinality.
8154 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8155
8156 // Activity Importance of API caller.
8157 // Categorized to 3 types that are interesting from location's perspective.
8158 optional android.stats.location.ActivityImportance activiy_importance = 12;
8159}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008160
8161/**
8162 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8163 */
8164message ReviewPermissionsFragmentResultReported {
8165 // unique value identifying a permission group change. A permission group change might result
8166 // in multiple of these atoms
8167 optional int64 change_id = 1;
8168
8169 // UID of package the permission belongs to
8170 optional int32 uid = 2 [(is_uid) = true];
8171
8172 // Name of package the permission belongs to
8173 optional string package_name = 3;
8174
8175 // The permission to be granted
8176 optional string permission_name = 4;
8177
8178 // The result of the permission grant
8179 optional bool permission_granted = 5;
8180}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008181
8182/**
8183* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8184* Logged from: RuntimePermissionUpdgradeController
8185*/
8186message RuntimePermissionsUpgradeResult {
8187 // Permission granted as result of upgrade
8188 optional string permission_name = 1;
8189
8190 // UID of package granted permission
8191 optional int32 uid = 2 [(is_uid) = true];
8192
8193 // Name of package granted permission
8194 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008195}
8196
8197/**
8198* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8199*/
8200message GrantPermissionsActivityButtonActions {
8201 // Permission granted as result of upgrade
8202 optional string permission_group_name = 1;
8203
8204 // UID of package granted permission
8205 optional int32 uid = 2 [(is_uid) = true];
8206
8207 // Name of package requesting permission
8208 optional string package_name = 3;
8209
8210 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8211 // LABEL_ constants in GrantPermissionActivity.java
8212 optional int32 buttons_presented = 4;
8213
8214 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8215 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008216
8217 // id which identifies single session of user interacting with permission controller
8218 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008219}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008220
8221/**
8222 * Information about LocationAccessCheck notification presented to user
8223 */
8224message LocationAccessCheckNotificationAction {
8225
8226 // id which identifies single session of user interacting with permission controller
8227 optional int64 session_id = 1;
8228
8229 // Uid of package for which location access check is presented
8230 optional int32 package_uid = 2;
8231
8232 // Name of package for which location access check is presented
8233 optional string package_name = 3;
8234
8235 enum Result {
8236 UNDEFINED = 0;
8237 // notification was presented to the user
8238 NOTIFICATION_PRESENTED = 1;
8239 // notification was declined by the user
8240 NOTIFICATION_DECLINED = 2;
8241 // notification was clicked by the user
8242 NOTIFICATION_CLICKED = 3;
8243 }
8244
8245 // View / interaction recorded
8246 optional Result result = 4;
8247}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008248
8249/**
8250 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8251 */
8252message AppPermissionFragmentActionReported {
8253 // id which identifies single session of user interacting with permission controller
8254 optional int64 session_id = 1;
8255
8256 // unique value identifying a permission group change. A permission group change might result
8257 // in multiple of these atoms
8258 optional int64 change_id = 2;
8259
8260 // UID of package the permission belongs to
8261 optional int32 uid = 3 [(is_uid) = true];
8262
8263 // Name of package the permission belongs to
8264 optional string package_name = 4;
8265
8266 // The permission to be granted
8267 optional string permission_name = 5;
8268
8269 // The result of the permission grant
8270 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008271
8272 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8273 optional int32 permission_flags = 7;
8274
8275 enum Button {
8276 UNDEFINED = 0;
8277 // Allow button
8278 ALLOW = 1;
8279 // Deny button
8280 DENY = 2;
8281 // Ask every time button
8282 ASK_EVERY_TIME = 3;
8283 // Allow all the time button
8284 ALLOW_ALWAYS = 4;
8285 // Allow only while using the app button
8286 ALLOW_FOREGROUND = 5;
8287 // Same is Deny button but shown in while in use dialog
8288 DENY_FOREGROUND = 6;
8289 }
8290
8291 // Button pressed in the dialog
8292 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008293}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008294
8295/**
8296* Information about a AppPermissionFragment viewed by user
8297*/
8298message AppPermissionFragmentViewed {
8299 // id which identifies single session of user interacting with permission controller
8300 optional int64 session_id = 1;
8301
8302 // UID of package for which permissions are viewed
8303 optional int32 uid = 2 [(is_uid) = true];
8304
8305 // Name of package for which permissions are viewed
8306 optional string package_name = 3;
8307
8308 // Permission group viewed
8309 optional string permission_group_name = 4;
8310}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008311
8312/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008313* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8314* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008315*/
8316message AppPermissionsFragmentViewed {
8317 // id which identifies single session of user interacting with permission controller
8318 optional int64 session_id = 1;
8319
8320 // id which identifies single view as every view might have several logging records
8321 // with different package information attached
8322 optional int64 view_id = 2;
8323
8324 // Permission group viewed
8325 optional string permission_group_name = 3;
8326
8327 // UID of package for which permissions are viewed
8328 optional int32 uid = 4 [(is_uid) = true];
8329
8330 // Name of package for which permissions are viewed
8331 optional string package_name = 5;
8332
8333 // Category in which permission is included
8334 enum Category {
8335 UNDEFINED = 0;
8336 ALLOWED = 1;
8337 ALLOWED_FOREGROUND = 2;
8338 DENIED = 3;
8339 }
8340 optional Category category = 6;
8341}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008342/**
8343* Information about a PermissionAppsFragment viewed by user.
8344* Logged from ui/handheld/PermissionAppsFragment.java
8345*/
8346message PermissionAppsFragmentViewed {
8347 // id which identifies single session of user interacting with permission controller
8348 optional int64 session_id = 1;
8349
8350 // id which identifies single view as every view might have several logging records
8351 // with different package information attached
8352 optional int64 view_id = 2;
8353
8354 // Permission group viewed
8355 optional string permission_group_name = 3;
8356
8357 // UID of package for which permissions are viewed
8358 optional int32 uid = 4 [(is_uid) = true];
8359
8360 // Name of package for which permissions are viewed
8361 optional string package_name = 5;
8362
8363 // Category in which app is included
8364 enum Category {
8365 UNDEFINED = 0;
8366 ALLOWED = 1;
8367 ALLOWED_FOREGROUND = 2;
8368 DENIED = 3;
8369 }
8370 optional Category category = 6;
8371}
Tony Make2b1b672019-07-29 16:59:47 +01008372
8373/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008374* Log that the Auto Revoke notification has been clicked
8375* Logged from ui/ManagePermissionsActivity
8376*/
8377message AutoRevokeNotificationClicked {
8378 // id which identifies single session of user interacting with permission controller
8379 optional int64 session_id = 1;
8380}
8381
8382/**
8383* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8384* auto revoked for it.
8385* Logged from ui/handheld/AutoRevokeFragment
8386*/
8387message AutoRevokeFragmentAppViewed {
8388 // id which identifies single session of user interacting with permission controller
8389 optional int64 session_id = 1;
8390
8391 // UID of package for which permissions are viewed
8392 optional int32 uid = 2 [(is_uid) = true];
8393
8394 // Name of package for which permissions are viewed
8395 optional string package_name = 3;
8396
8397 // The name of a permission group that has been revoked
8398 optional string permission_group_name = 4;
8399
8400 // The age of the app- more than three months old, or more than six months
8401 enum Age {
8402 UNDEFINED = 0;
8403 NEWER_BUCKET = 1;
8404 OLDER_BUCKET = 2;
8405 }
8406
8407 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8408 optional Age age = 5;
8409}
8410
8411/**
8412* Log that the user has interacted with an app on the auto revoke fragment
8413* Logged from ui/handheld/AutoRevokeFragment
8414*/
8415message AutoRevokedAppInteraction {
8416 // id which identifies single session of user interacting with permission controller
8417 optional int64 session_id = 1;
8418
8419 // UID of package for which permissions are viewed
8420 optional int32 uid = 2 [(is_uid) = true];
8421
8422 // Name of package for which permissions are viewed
8423 optional string package_name = 3;
8424
8425 enum Action {
8426 UNDEFINED = 0;
8427 REMOVE = 1;
8428 OPEN = 2;
8429 APP_INFO = 3;
8430 PERMISSIONS = 4;
8431 REMOVE_IN_SETTINGS = 5;
8432 OPEN_IN_SETTINGS = 6;
8433 }
8434
8435 // The action the user took to interact with the app
8436 optional Action action = 4;
8437}
8438
8439/**
8440* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8441* auto revoke, or that the auto revoke switch has been changed
8442* Logged from ui/handheld/AppPermissionGroupsFragment
8443 */
8444message AppPermissionGroupsFragmentAutoRevokeAction {
8445 // id which identifies single session of user interacting with permission controller
8446 optional int64 session_id = 1;
8447
8448 // UID of package for which permissions are viewed
8449 optional int32 uid = 2 [(is_uid) = true];
8450
8451 // Name of package for which permissions are viewed
8452 optional string package_name = 3;
8453
8454 enum Action {
8455 UNDEFINED = 0;
8456 OPENED_FOR_AUTO_REVOKE = 1;
8457 OPENED_FROM_INTENT = 2;
8458 SWITCH_ENABLED = 3;
8459 SWITCH_DISABLED = 4;
8460 }
8461
8462 // The action the user took to interact with the fragment
8463 optional Action action = 4;
8464}
8465
8466/**
Tony Make2b1b672019-07-29 16:59:47 +01008467 * Logs when there is a smart selection related event.
8468 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8469 * Logged from: TextClassifierEventLogger.java
8470 */
8471message TextSelectionEvent {
8472 // A session ID.
8473 optional string session_id = 1;
8474
8475 // Event type of this event.
8476 optional android.stats.textclassifier.EventType event_type = 2;
8477
Tony Mak9c84bd22019-12-09 07:27:25 +00008478 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008479 optional string model_name = 3;
8480
8481 // Type of widget that was involved in triggering this event.
8482 optional android.stats.textclassifier.WidgetType widget_type = 4;
8483
8484 // Index of this event in a session.
8485 optional int32 event_index = 5;
8486
8487 // Entity type that is involved.
8488 optional string entity_type = 6;
8489
8490 // Relative word index of the start of the selection.
8491 optional int32 relative_word_start_index = 7;
8492
8493 // Relative word (exclusive) index of the end of the selection.
8494 optional int32 relative_word_end_index = 8;
8495
8496 // Relative word index of the start of the smart selection.
8497 optional int32 relative_suggested_word_start_index = 9;
8498
8499 // Relative word (exclusive) index of the end of the smart selection.
8500 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008501
8502 // Name of source package.
8503 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008504
8505 // Name of the LangID model that is involved in this event.
8506 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008507}
8508
8509/**
8510 * Logs when there is a smart linkify related event.
8511 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8512 * Logged from: TextClassifierEventLogger.java
8513 */
8514message TextLinkifyEvent {
8515 // A session ID.
8516 optional string session_id = 1;
8517
8518 // Event type of this event.
8519 optional android.stats.textclassifier.EventType event_type = 2;
8520
Tony Mak9c84bd22019-12-09 07:27:25 +00008521 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008522 optional string model_name = 3;
8523
8524 // Type of widget that was involved in triggering this event.
8525 optional android.stats.textclassifier.WidgetType widget_type = 4;
8526
8527 // Index of this event in a session.
8528 optional int32 event_index = 5;
8529
8530 // Entity type that is involved.
8531 optional string entity_type = 6;
8532
8533 // Number of links detected.
8534 optional int32 num_links = 7;
8535
8536 // The total length of all links.
8537 optional int32 linked_text_length = 8;
8538
8539 // Length of input text.
8540 optional int32 text_length = 9;
8541
8542 // Time spent on generating links in ms.
8543 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008544
8545 // Name of source package.
8546 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008547
8548 // Name of the LangID model that is involved in this event.
8549 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008550}
8551
8552/**
8553 * Logs when there is a conversation actions related event.
8554 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8555 * Logged from: TextClassifierEventLogger.java
8556 */
8557message ConversationActionsEvent {
8558 // A session ID.
8559 optional string session_id = 1;
8560
8561 // Event type of this event.
8562 optional android.stats.textclassifier.EventType event_type = 2;
8563
Tony Mak9c84bd22019-12-09 07:27:25 +00008564 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008565 optional string model_name = 3;
8566
8567 // Type of widget that was involved in triggering this event.
8568 optional android.stats.textclassifier.WidgetType widget_type = 4;
8569
8570 // The first entity type that is involved.
8571 optional string first_entity_type = 5;
8572
8573 // The second entity type that is involved.
8574 optional string second_entity_type = 6;
8575
8576 // The third entity type that is involved.
8577 optional string third_entity_type = 7;
8578
8579 // The score of the first entity type.
8580 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008581
8582 // Name of source package.
8583 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008584
8585 // Name of the annotator model that is involved in this event.
8586 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008587
8588 // Name of the LangID model that is involved in this event.
8589 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008590}
8591
8592/**
8593 * Logs when there is a language detection related event.
8594 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8595 * Logged from: TextClassifierEventLogger.java
8596 */
8597message LanguageDetectionEvent {
8598 // A session ID.
8599 optional string session_id = 1;
8600
8601 // Event type of this event.
8602 optional android.stats.textclassifier.EventType event_type = 2;
8603
Tony Mak9c84bd22019-12-09 07:27:25 +00008604 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008605 optional string model_name = 3;
8606
8607 // Type of widget that was involved in triggering this event.
8608 optional android.stats.textclassifier.WidgetType widget_type = 4;
8609
8610 // Detected language.
8611 optional string language_tag = 5;
8612
8613 // Score of the detected language.
8614 optional float score = 6;
8615
8616 // Position of this action.
8617 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008618
8619 // Name of source package.
8620 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008621}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008622
8623/**
8624 * Information about an OTA update attempt by update_engine.
8625 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8626 */
8627message UpdateEngineUpdateAttemptReported {
8628 // The number of attempts for the update engine to apply a given payload.
8629 optional int32 attempt_number = 1;
8630
8631 optional android.stats.otaupdate.PayloadType payload_type = 2;
8632
8633 // The total time in minutes for the update engine to apply a given payload.
8634 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8635 // it's increased when the system is sleeping.
8636 optional int32 duration_boottime_in_minutes = 3;
8637
8638 // The total time in minutes for the update engine to apply a given payload.
8639 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8640 // and it's not increased when the system is sleeping.
8641 optional int32 duration_monotonic_in_minutes = 4;
8642
8643 // The size of the payload in MiBs.
8644 optional int32 payload_size_mib = 5;
8645
8646 // The attempt result reported by the update engine for an OTA update.
8647 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8648
8649 // The error code reported by the update engine after an OTA update attempt
8650 // on A/B devices.
8651 optional android.stats.otaupdate.ErrorCode error_code = 7;
8652
8653 // The build fingerprint of the source system. The value is read from a
8654 // system property when the device takes the update. e.g.
8655 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8656 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008657
8658 // Size of super partition.
8659 optional int64 super_partition_size_bytes = 9;
8660
8661 // Size of current slot within the super partition.
8662 optional int64 slot_size_bytes = 10;
8663
8664 // Free space available in the super partition.
8665 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008666}
8667
8668/**
8669 * Information about all the attempts the device make before finishing the
8670 * successful update.
8671 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8672 */
8673message UpdateEngineSuccessfulUpdateReported {
8674 // The number of attempts for the update engine to apply the payload for a
8675 // successful update.
8676 optional int32 attempt_count = 1;
8677
8678 optional android.stats.otaupdate.PayloadType payload_type = 2;
8679
8680 optional int32 payload_size_mib = 3;
8681
8682 // The total number of bytes downloaded by update_engine since the last
8683 // successful update.
8684 optional int32 total_bytes_downloaded_mib = 4;
8685
8686 // The ratio in percentage of the over-downloaded bytes compared to the
8687 // total bytes needed to successfully install the update. e.g. 200 if we
8688 // download 200MiB in total for a 100MiB package.
8689 optional int32 download_overhead_percentage = 5;
8690
8691 // The total time in minutes for the update engine to apply the payload for a
8692 // successful update.
8693 optional int32 total_duration_minutes = 6;
8694
8695 // The number of reboot of the device during a successful update.
8696 optional int32 reboot_count = 7;
8697}
Alec Mourie088e762019-07-02 13:10:55 -07008698
8699/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008700 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8701 * key to indicate whether it was successful or not.
8702 *
8703 * Logged from:
8704 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8705 */
8706message RebootEscrowRecoveryReported {
8707 optional bool successful = 1;
8708}
8709
8710/**
Alec Mourie088e762019-07-02 13:10:55 -07008711 * Global display pipeline metrics reported by SurfaceFlinger.
8712 * Pulled from:
8713 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8714 */
8715message SurfaceflingerStatsGlobalInfo {
8716 // Total number of frames presented during the tracing period
8717 optional int64 total_frames = 1;
8718 // Total number of frames missed
8719 optional int64 missed_frames = 2;
8720 // Total number of frames that fell back to client composition
8721 optional int64 client_composition_frames = 3;
8722 // Total time the display was turned on
8723 optional int64 display_on_millis = 4;
8724 // Total time that was spent performing animations.
8725 // This is derived from the present-to-present layer histogram
8726 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008727 // Total number of event connections tracked by SurfaceFlinger at the time
8728 // of this pull. If this number grows prohibitively large, then this can
8729 // cause jank due to resource contention.
8730 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008731 // Set of timings measured from when SurfaceFlinger began compositing a
8732 // frame, until the frame was requested to be presented to the display. This
8733 // measures SurfaceFlinger's total CPU walltime on the critical path per
8734 // frame.
8735 optional FrameTimingHistogram frame_duration = 7
8736 [(android.os.statsd.log_mode) = MODE_BYTES];
8737 // Set of timings measured from when SurfaceFlinger first began using the
8738 // GPU to composite a frame, until the GPU has finished compositing that
8739 // frame. This measures the total additional time SurfaceFlinger needed to
8740 // perform due to falling back into GPU composition.
8741 optional FrameTimingHistogram render_engine_timing = 8
8742 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008743}
8744
8745/**
8746 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8747 * The number of layers uploaded will be restricted due to size limitations.
8748 * Pulled from:
8749 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8750 */
8751message SurfaceflingerStatsLayerInfo {
8752 // The layer for this set of metrics
8753 // For now we can infer that the package name is included in the layer
8754 // name.
8755 optional string layer_name = 1;
8756 // Total number of frames presented
8757 optional int64 total_frames = 2;
8758 // Total number of dropped frames while latching a buffer for this layer.
8759 optional int64 dropped_frames = 3;
8760 // Set of timings measured between successive presentation timestamps.
8761 optional FrameTimingHistogram present_to_present = 4
8762 [(android.os.statsd.log_mode) = MODE_BYTES];
8763 // Set of timings measured from when an app queued a buffer for
8764 // presentation, until the buffer was actually presented to the
8765 // display.
8766 optional FrameTimingHistogram post_to_present = 5
8767 [(android.os.statsd.log_mode) = MODE_BYTES];
8768 // Set of timings measured from when a buffer is ready to be presented,
8769 // until the buffer was actually presented to the display.
8770 optional FrameTimingHistogram acquire_to_present = 6
8771 [(android.os.statsd.log_mode) = MODE_BYTES];
8772 // Set of timings measured from when a buffer was latched by
8773 // SurfaceFlinger, until the buffer was presented to the display
8774 optional FrameTimingHistogram latch_to_present = 7
8775 [(android.os.statsd.log_mode) = MODE_BYTES];
8776 // Set of timings measured from the desired presentation to the actual
8777 // presentation time
8778 optional FrameTimingHistogram desired_to_present = 8
8779 [(android.os.statsd.log_mode) = MODE_BYTES];
8780 // Set of timings measured from when an app queued a buffer for
8781 // presentation, until the buffer was ready to be presented.
8782 optional FrameTimingHistogram post_to_acquire = 9
8783 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008784 // Frames missed latch because the acquire fence didn't fire
8785 optional int64 late_acquire_frames = 10;
8786 // Frames latched early because the desired present time was bad
8787 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008788}
8789
8790/**
8791 * Histogram of frame counts bucketed by time in milliseconds.
8792 * Because of size limitations, we hard-cap the number of buckets, with
8793 * buckets for corresponding to larger milliseconds being less precise.
8794 */
8795message FrameTimingHistogram {
8796 // Timings in milliseconds that describes a set of histogram buckets
8797 repeated int32 time_millis_buckets = 1;
8798 // Number of frames that match to each time_millis, i.e. the bucket
8799 // contents
8800 // It's required that len(time_millis) == len(frame_count)
8801 repeated int64 frame_counts = 2;
8802}
Emilian Peev6729f372019-08-29 09:14:09 -07008803
Emilian Peev6729f372019-08-29 09:14:09 -07008804/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008805 * Janky event as reported by SurfaceFlinger.
8806 * This event is intended to be consumed by a Perfetto subscriber for
8807 * automated trace collection.
8808 *
8809 * Logged from:
8810 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8811 */
8812message DisplayJankReported {
8813 // Informational field for how long the janky event lasted in milliseconds
8814 optional int64 event_duration_millis = 1;
8815 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8816 // the display on time.
8817 optional int32 present_deadlines_missed = 2;
8818}
8819
8820/**
Emilian Peev6729f372019-08-29 09:14:09 -07008821 * Information about camera facing and API level usage.
8822 * Logged from:
8823 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8824 */
8825message CameraActionEvent {
8826 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008827 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008828
8829 // Camera API level used
8830 optional int32 api_level = 2;
8831
8832 // Name of client package
8833 optional string package_name = 3;
8834
8835 // Camera facing
8836 enum Facing {
8837 UNKNOWN = 0;
8838 BACK = 1;
8839 FRONT = 2;
8840 EXTERNAL = 3;
8841 }
8842 optional Facing facing = 4;
8843}
atrost01a20932019-08-28 15:40:37 +01008844
8845/**
8846 * Logs when a compatibility change is affecting an app.
8847 *
8848 * Logged from:
8849 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8850 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8851 */
8852message AppCompatibilityChangeReported {
8853 // The UID of the app being affected by the compatibilty change.
8854 optional int32 uid = 1 [(is_uid) = true];
8855
8856 // The ID of the change affecting the app.
8857 optional int64 change_id = 2;
8858
8859 enum State {
8860 UNKNOWN_STATE = 0;
8861 ENABLED = 1;
8862 DISABLED = 2;
8863 LOGGED = 3;
8864 }
8865
8866 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8867 // logged otherwise.
8868 optional State state = 3;
8869
8870 enum Source {
8871 UNKNOWN_SOURCE = 0;
8872 APP_PROCESS = 1;
8873 SYSTEM_SERVER = 2;
8874 }
8875
8876 // Where it was logged from.
8877 optional Source source = 4;
8878
8879}
Hector Dearman40579f62019-11-01 13:19:30 +00008880
8881/**
8882 * Logged from
8883 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8884 */
8885message PerfettoUploaded {
8886 enum Event {
8887 PERFETTO_UNDEFINED = 0;
8888 PERFETTO_TRACE_BEGIN = 1;
8889 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8890 PERFETTO_ON_CONNECT = 3;
8891 PERFETTO_ON_TRACING_DISABLED = 4;
8892 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8893 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8894 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8895 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8896 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8897 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8898 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8899 PERFETTO_TRIGGER_BEGIN = 12;
8900 PERFETTO_TRIGGER_SUCCESS = 13;
8901 PERFETTO_TRIGGER_FAILURE = 14;
8902 PERFETTO_HIT_GUARDRAILS = 15;
8903 PERFETTO_ON_TIMEOUT = 16;
8904 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8905 }
8906
8907 // Which stage of the pipeline we are reporting from.
8908 optional Event event = 1;
8909
8910 // UUID matching the one set inside the SystemInfo trace packet.
8911 optional int64 trace_uuid_lsb = 2;
8912 optional int64 trace_uuid_msb = 3;
8913}
Mark Tabrya824a642019-11-05 12:26:12 -08008914
8915/**
8916 * Pulls client metrics on data transferred via Vehicle Maps Service.
8917 * Metrics are keyed by uid + layer.
8918 *
8919 * Pulled from:
8920 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8921 */
8922message VmsClientStats {
8923 // UID of the VMS client app
8924 optional int32 uid = 1 [(is_uid) = true];
8925
8926 // VMS layer definition
8927 optional int32 layer_type = 2;
8928 optional int32 layer_channel = 3;
8929 optional int32 layer_version = 4;
8930
8931 // Bytes and packets sent by the client for the layer
8932 optional int64 tx_bytes = 5;
8933 optional int64 tx_packets = 6;
8934
8935 // Bytes and packets received by the client for the layer
8936 optional int64 rx_bytes = 7;
8937 optional int64 rx_packets = 8;
8938
8939 // Bytes and packets dropped due to client error
8940 optional int64 dropped_bytes = 9;
8941 optional int64 dropped_packets = 10;
8942}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008943
8944/**
8945 * State of a dangerous permission requested by a package - sampled
8946 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8947*/
8948message DangerousPermissionStateSampled {
8949 // Name of the permission
8950 optional string permission_name = 1;
8951
8952 // Uid of the package
8953 optional int32 uid = 2 [(is_uid) = true];
8954
8955 // If the permission is granted to the uid
8956 optional bool is_granted = 3;
8957
8958 // Permission flags as per android.content.pm.PermissionFlags
8959 optional int32 permission_flags = 4;
8960}
8961
Stan Iliev637ba5e2019-08-16 13:43:08 -04008962/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008963 * HWUI stats for a given app.
8964 */
8965message GraphicsStats {
8966 // The package name of the app
8967 optional string package_name = 1;
8968
8969 // The version code of the app
8970 optional int64 version_code = 2;
8971
8972 // The start & end timestamps in UTC as
8973 // milliseconds since January 1, 1970
8974 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008975 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008976
Stan Ilievb6517192020-02-18 10:12:42 -05008977 optional int64 end_millis = 4;
8978
8979 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8980 enum PipelineType {
8981 UNKNOWN = 0;
8982 GL = 1;
8983 VULKAN = 2;
8984 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008985
8986 // HWUI renders pipeline type: GL or Vulkan.
8987 optional PipelineType pipeline = 5;
8988
8989 // Distinct frame count.
8990 optional int32 total_frames = 6;
8991
8992 // Number of "missed vsync" events.
8993 optional int32 missed_vsync_count = 7;
8994
8995 // Number of frames in triple-buffering scenario (high input latency)
8996 optional int32 high_input_latency_count = 8;
8997
8998 // Number of "slow UI thread" events.
8999 optional int32 slow_ui_thread_count = 9;
9000
9001 // Number of "slow bitmap upload" events.
9002 optional int32 slow_bitmap_upload_count = 10;
9003
9004 // Number of "slow draw" events.
9005 optional int32 slow_draw_count = 11;
9006
9007 // Number of frames that missed their deadline (aka, visibly janked)
9008 optional int32 missed_deadline_count = 12;
9009
9010 // The frame time histogram for the package
9011 optional FrameTimingHistogram cpu_histogram = 13
9012 [(android.os.statsd.log_mode) = MODE_BYTES];
9013
9014 // The gpu frame time histogram for the package
9015 optional FrameTimingHistogram gpu_histogram = 14
9016 [(android.os.statsd.log_mode) = MODE_BYTES];
9017
9018 // UI mainline module version.
9019 optional int64 version_ui_module = 15;
9020
9021 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9022 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9023 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9024 // more apps are running / rendering.
9025 optional bool is_today = 16;
9026}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009027
9028/**
9029 * Message related to dangerous (runtime) app ops access
9030 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009031message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009032 // Uid of the package accessing app op
9033 optional int32 uid = 1 [(is_uid) = true];
9034
9035 // Name of the package accessing app op
9036 optional string package_name = 2;
9037
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009038 // deprecated - set to empty string
9039 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009040
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009041 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009042 // API. Attributions must be provided through manifest using <attribution> tag available in R
9043 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009044 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009045
9046 // message related to app op access, limited to 600 chars by API
9047 optional string message = 5;
9048
9049 enum SamplingStrategy {
9050 DEFAULT = 0;
9051 UNIFORM = 1;
9052 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009053 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009054 }
9055
9056 // sampling strategy used to collect this message
9057 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009058
9059 // operation id
9060 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009061}
9062
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009063/*
9064 * Logs userspace reboot outcome and duration.
9065 *
9066 * Logged from:
9067 * frameworks/base/core/java/com/android/server/BootReceiver.java
9068 */
9069message UserspaceRebootReported {
9070 // Possible outcomes of userspace reboot.
9071 enum Outcome {
9072 // Default value in case platform failed to determine the outcome.
9073 OUTCOME_UNKNOWN = 0;
9074 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9075 SUCCESS = 1;
9076 // Userspace reboot shutdown sequence was aborted.
9077 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9078 // Remounting userdata into checkpointing mode failed.
9079 FAILED_USERDATA_REMOUNT = 3;
9080 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9081 // reboot.
9082 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9083 }
9084 // Outcome of userspace reboot. Always set.
9085 optional Outcome outcome = 1;
9086 // Duration of userspace reboot in case it has a successful outcome.
9087 // Duration is measured as time between userspace reboot was initiated and until boot completed
9088 // (e.g. sys.boot_completed=1).
9089 optional int64 duration_millis = 2;
9090 // State of primary user's (user0) credential encryption storage.
9091 enum UserEncryptionState {
9092 // Default value.
9093 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9094 // Credential encrypted storage is unlocked.
9095 UNLOCKED = 1;
9096 // Credential encrypted storage is locked.
9097 LOCKED = 2;
9098 }
9099 // State of primary user's encryption storage at the moment boot completed. Always set.
9100 optional UserEncryptionState user_encryption_state = 3;
9101}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009102
9103/*
9104 * Logs integrity check information during each install.
9105 *
9106 * Logged from:
9107 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9108 */
9109message IntegrityCheckResultReported {
9110 optional string package_name = 1;
9111 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009112 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009113 optional string installer_package_name = 4;
9114 enum Response {
9115 UNKNOWN = 0;
9116 ALLOWED = 1;
9117 REJECTED = 2;
9118 FORCE_ALLOWED = 3;
9119 }
9120 optional Response response = 5;
9121 // An estimate on the cause of the response. This will only be populated for
9122 // REJECTED and FORCE_ALLOWED
9123 optional bool caused_by_app_cert_rule = 6;
9124 optional bool caused_by_installer_rule = 7;
9125}
9126
9127/**
9128 * Logs the information about the rules and the provider whenever rules are
9129 * pushed into AppIntegrityManager.
9130 *
9131 * Logged from:
9132 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9133 */
9134message IntegrityRulesPushed {
9135 optional bool success = 1;
9136 // Package name of the app that pushed the rules.
9137 optional string rule_provider = 2;
9138 // Version string of arbitrary format provided by the rule provider to
9139 // identify the rules.
9140 optional string rule_version = 3;
9141}
Jordan Liubedfa702019-12-20 15:08:45 -08009142
9143/**
9144 * Logs when a cell broadcast message is received on the device.
9145 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009146 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009147 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009148 * packages/apps/CellBroadcastReceiver/
9149 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009150 */
9151message CellBroadcastMessageReported {
9152 // The type of Cell Broadcast message
9153 enum CbType {
9154 UNKNOWN_TYPE = 0;
9155 GSM = 1;
9156 CDMA = 2;
9157 CDMA_SPC = 3;
9158 }
9159
Jordan Liu900e5cb2020-05-29 09:44:59 -07009160 // The parts of the cell broadcast message pipeline
9161 enum ReportSource {
9162 UNKNOWN_SOURCE = 0;
9163 FRAMEWORK = 1;
9164 CB_SERVICE = 2;
9165 CB_RECEIVER_APP = 3;
9166 }
9167
Jordan Liubedfa702019-12-20 15:08:45 -08009168 // GSM, CDMA, CDMA-SCP
9169 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009170
9171 // The source of the report
9172 optional ReportSource source = 2;
9173}
9174
9175/**
9176 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9177 *
9178 * Logged from CellBroadcastService module:
9179 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9180 */
9181message CellBroadcastMessageFiltered {
9182 enum FilterReason {
9183 NOT_FILTERED = 0;
9184 DUPLICATE_MESSAGE = 1;
9185 GEOFENCED_MESSAGE = 2;
9186 AREA_INFO_MESSAGE = 3;
9187 }
9188
9189 // GSM, CDMA, CDMA-SCP
9190 optional CellBroadcastMessageReported.CbType type = 1;
9191
9192 // The source of the report
9193 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009194}
9195
9196/**
9197 * Logs when an error occurs while handling a cell broadcast message;
9198 *
9199 * Logged from CellBroadcastService module:
9200 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9201 */
9202message CellBroadcastMessageError {
9203 // The type of error raised when trying to handle a cell broadcast message
9204 enum ErrorType {
9205 UNKNOWN_TYPE = 0;
9206 CDMA_DECODING_ERROR = 1;
9207 CDMA_SCP_EMPTY = 2;
9208 CDMA_SCP_HANDLING_ERROR = 3;
9209 GSM_INVALID_HEADER_LENGTH = 4;
9210 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9211 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9212 GSM_INVALID_PDU = 7;
9213 GSM_INVALID_GEO_FENCING_DATA = 8;
9214 GSM_UMTS_INVALID_WAC = 9;
9215 FAILED_TO_INSERT_TO_DB = 10;
9216 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9217 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9218 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9219 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009220 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009221 }
9222
9223 // What kind of error occurred
9224 optional ErrorType type = 1;
9225
9226 // Exception message (or log message) associated with the error (max 1000 chars)
9227 optional string exception_message = 2;
9228}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009229
9230/**
Henry Fange316ab62020-04-21 18:43:14 -07009231 * Logs when a tune occurs through device's Frontend.
9232 * This is atom ID 276.
9233 *
9234 * Logged from:
9235 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9236 */
9237message TvTunerStateChanged {
9238 enum State {
9239 UNKNOWN = 0;
9240 TUNING = 1; // Signal is tuned
9241 LOCKED = 2; // the signal is locked
9242 NOT_LOCKED = 3; // the signal isn’t locked.
9243 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9244 SCANNING = 5; // the signal is scanned
9245 SCAN_STOPPED = 6; // the scan is stopped.
9246 }
9247 // The uid of the application that sent this custom atom.
9248 optional int32 uid = 1 [(is_uid) = true];
9249 // new state
9250 optional State state = 2;
9251}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009252
9253/**
9254 * Logs the status of a dvr playback or record.
9255 * This is atom ID 279.
9256 *
9257 * Logged from:
9258 * frameworks/base/media/java/android/media/tv/tuner/dvr
9259 */
9260message TvTunerDvrStatus {
9261 enum Type {
9262 UNKNOWN_TYPE = 0;
9263 PLAYBACK = 1; // is a playback
9264 RECORD = 2; // is a record
9265 }
9266 enum State {
9267 UNKNOWN_STATE = 0;
9268 STARTED = 1; // DVR is started
9269 STOPPED = 2; // DVR is stopped
9270 }
9271 // The uid of the application that sent this custom atom.
9272 optional int32 uid = 1 [(is_uid) = true];
9273 // DVR type
9274 optional Type type = 2;
9275 // DVR state
9276 optional State state = 3;
9277 // Identify the segment of a record or playback
9278 optional int32 segment_id = 4;
9279 // indicate how many overflow or underflow happened between started to stopped
9280 optional int32 overflow_underflow_count = 5;
9281}
Henry Fangfd40c072020-06-01 14:59:17 -07009282
9283/**
9284 * Logs when a cas session opened through MediaCas.
9285 * This is atom ID 280.
9286 *
9287 * Logged from:
9288 * frameworks/base/media/java/android/media/MediaCas.java
9289 */
9290message TvCasSessionOpenStatus {
9291 enum State {
9292 UNKNOWN = 0;
9293 SUCCEEDED = 1; // indicate that the session is opened successfully.
9294 FAILED = 2; // indicate that the session isn’t opened successfully.
9295 }
9296 // The uid of the application that sent this custom atom.
9297 optional int32 uid = 1 [(is_uid) = true];
9298 // Cas system Id
9299 optional int32 cas_system_id = 2;
9300 // State of the session
9301 optional State state = 3;
9302}
9303
Henry Fange316ab62020-04-21 18:43:14 -07009304/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009305 * Logs when an app is frozen or unfrozen.
9306 *
9307 * Logged from:
9308 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9309 */
9310message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009311 // The type of event.
9312 enum Action {
9313 UNKNOWN = 0;
9314 FREEZE_APP = 1;
9315 UNFREEZE_APP = 2;
9316 }
9317 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009318
Blake Kragten6ce382a2020-01-16 20:20:46 -08009319 // Pid of the process being frozen.
9320 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009321
Blake Kragten6ce382a2020-01-16 20:20:46 -08009322 // Name of the process being frozen.
9323 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009324
Blake Kragten6ce382a2020-01-16 20:20:46 -08009325 // Time since last unfrozen.
9326 optional int64 time_unfrozen_millis = 4;
9327}
9328
9329/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009330 * Pulls information for a single voice call.
9331 *
9332 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9333 *
9334 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009335 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009336 */
9337message VoiceCallSession {
9338 // Bearer (IMS or CS) when the call started.
9339 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9340
9341 // Bearer (IMS or CS) when the call ended.
9342 // The bearer may change during the call, e.g. due to SRVCC.
9343 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9344
9345 // Direction of the call (incoming or outgoing).
9346 optional android.telephony.CallDirectionEnum direction = 3;
9347
9348 // Time spent setting up the call.
9349 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9350
9351 // Whether the call ended before the setup was completed.
9352 optional bool setup_failed = 5;
9353
9354 // IMS reason code or CS disconnect cause.
9355 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9356 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9357 optional int32 disconnect_reason_code = 6;
9358
9359 // IMS extra code or CS precise disconnect cause.
9360 // For IMS, this code is vendor-specific
9361 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9362 optional int32 disconnect_extra_code = 7;
9363
9364 // IMS extra message or CS vendor cause.
9365 optional string disconnect_extra_message = 8;
9366
9367 // Radio access technology (RAT) used when call started.
9368 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9369
9370 // Radio access technology (RAT) used when call terminated.
9371 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9372
9373 // Number of times RAT changed during the call.
9374 optional int64 rat_switch_count = 11;
9375
9376 // A bitmask of all codecs used during the call.
9377 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9378 optional int64 codec_bitmask = 12;
9379
9380 // Number of other calls going on during call setup, for the same SIM slot.
9381 optional int32 concurrent_call_count_at_start = 13;
9382
9383 // Number of other calls going on during call termination, for the same SIM slot.
9384 optional int32 concurrent_call_count_at_end = 14;
9385
9386 // Index of the SIM is used, 0 for single-SIM devices.
9387 optional int32 sim_slot_index = 15;
9388
9389 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9390 optional bool is_multi_sim = 16;
9391
9392 // Whether the call was made with an eSIM profile.
9393 optional bool is_esim = 17;
9394
9395 // Carrier ID of the SIM card.
9396 // See https://source.android.com/devices/tech/config/carrierid.
9397 optional int32 carrier_id = 18;
9398
Chi Zhangba1b03a2020-04-21 17:17:56 -07009399 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009400 optional bool srvcc_completed = 19;
9401
9402 // Number of SRVCC failures.
9403 optional int64 srvcc_failure_count = 20;
9404
9405 // Number of SRVCC cancellations.
9406 optional int64 srvcc_cancellation_count = 21;
9407
Chi Zhangba1b03a2020-04-21 17:17:56 -07009408 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9409 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009410 optional bool rtt_enabled = 22;
9411
9412 // Whether this was an emergency call.
9413 optional bool is_emergency = 23;
9414
9415 // Whether the call was performed while roaming.
9416 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009417
9418 // A random number used as the dimension field to pull multiple atoms.
9419 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009420}
9421
9422/**
9423 * Pulls voice call radio access technology (RAT) usage.
9424 *
9425 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9426 * time. The atom will be skipped if not enough data is available.
9427 *
9428 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009429 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009430 */
9431message VoiceCallRatUsage {
9432 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9433 optional int32 carrier_id = 1;
9434
9435 // Radio access technology.
9436 optional android.telephony.NetworkTypeEnum rat = 2;
9437
9438 // Total duration that voice calls spent on this carrier and RAT.
9439 optional int64 total_duration_seconds = 3;
9440
9441 // Total number of calls using this carrier and RAT.
9442 // A call is counted once even if it used the RAT multiple times.
9443 optional int64 call_count = 4;
9444}
9445
9446/**
9447 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9448 *
9449 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009450 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009451 */
9452message SimSlotState {
9453 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9454 optional int32 active_slot_count = 1;
9455
9456 // Number of SIM cards (both physical and active eSIM profiles).
9457 // This number is always equal to or less than the number of active SIM slots.
9458 optional int32 sim_count = 2;
9459
9460 // Number of active eSIM profiles.
9461 // This number is always equal to or less than the number of SIMs.
9462 optional int32 esim_count = 3;
9463}
9464
9465/**
9466 * Pulls supported cellular radio access technologies.
9467 *
9468 * This atom reports the capabilities of the device, rather than the network it has access to.
9469 *
9470 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009471 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009472 */
9473message SupportedRadioAccessFamily {
9474 // A bitmask of supported radio technologies.
9475 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9476 optional int64 network_type_bitmask = 1;
9477}
9478
9479/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009480 * Logs gnss stats from location service provider
9481 *
9482 * Pulled from:
9483 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9484 */
9485
9486message GnssStats {
9487 // Number of location reports since boot
9488 optional int64 location_reports = 1;
9489
9490 // Total pulled reports of Location failures since boot
9491 optional int64 location_failure_reports = 2;
9492
9493 // Number of time to first fix reports since boot
9494 optional int64 time_to_first_fix_reports = 3;
9495
9496 // Total pulled reported time to first fix (in milli-seconds) since boot
9497 optional int64 time_to_first_fix_milli_s = 4;
9498
9499 // Number of position accuracy reports since boot
9500 optional int64 position_accuracy_reports = 5;
9501
9502 // Total pulled reported position accuracy (in meters) since boot
9503 optional int64 position_accuracy_meters = 6;
9504
9505 // Number of top 4 average CN0 reports since boot
9506 optional int64 top_four_average_cn0_reports = 7;
9507
9508 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9509 optional int64 top_four_average_cn0_db_mhz = 8;
9510
9511 // Number of l5 top 4 average CN0 reports since boot
9512 optional int64 l5_top_four_average_cn0_reports = 9;
9513
9514 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9515 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9516
9517 // Total number of sv status messages reports since boot
9518 optional int64 sv_status_reports = 11;
9519
9520 // Total number of sv status messages reports, where sv is used in fix since boot
9521 optional int64 sv_status_reports_used_in_fix = 12;
9522
9523 // Total number of L5 sv status messages reports since boot
9524 optional int64 l5_sv_status_reports = 13;
9525
9526 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9527 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009528}
Kweku Adams12752132020-02-18 15:36:48 -08009529
9530/**
9531 * Logs when an app is moved to a different standby bucket.
9532 *
9533 * Logged from:
9534 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9535 */
9536message AppStandbyBucketChanged {
9537 optional string package_name = 1;
9538
9539 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9540 optional int32 user_id = 2;
9541
9542 // These enum values match the constants defined in UsageStatsManager.java.
9543 enum Bucket {
9544 BUCKET_UNKNOWN = 0;
9545 BUCKET_EXEMPTED = 5;
9546 BUCKET_ACTIVE = 10;
9547 BUCKET_WORKING_SET = 20;
9548 BUCKET_FREQUENT = 30;
9549 BUCKET_RARE = 40;
9550 BUCKET_RESTRICTED = 45;
9551 BUCKET_NEVER = 50;
9552 }
9553 optional Bucket bucket = 3;
9554
9555 enum MainReason {
9556 MAIN_UNKNOWN = 0;
9557 MAIN_DEFAULT = 0x0100;
9558 MAIN_TIMEOUT = 0x0200;
9559 MAIN_USAGE = 0x0300;
9560 MAIN_FORCED_BY_USER = 0x0400;
9561 MAIN_PREDICTED = 0x0500;
9562 MAIN_FORCED_BY_SYSTEM = 0x0600;
9563 }
9564 optional MainReason main_reason = 4;
9565
9566 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9567 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9568 // UsageStatsManager.java.
9569 optional int32 sub_reason = 5;
9570}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009571
9572/**
9573* Reports a started sharesheet transaction.
9574*
9575* Logged from:
9576* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9577*/
9578message SharesheetStarted {
9579 // The event_id (as for UiEventReported).
9580 optional int32 event_id = 1;
9581 // The calling app's package name.
9582 optional string package_name = 2;
9583 // An identifier to tie together multiple logs relating to the same share event
9584 optional int32 instance_id = 3;
9585 // The mime type of the share
9586 optional string mime_type = 4;
9587 // The number of direct targets the calling app is providing that will be shown.
9588 optional int32 num_app_provided_direct_targets = 5;
9589 // The number of app targets the calling app is providing that will be shown.
9590 optional int32 num_app_provided_app_targets = 6;
9591 // True if the share originates from the workprofile
9592 optional bool is_workprofile = 7;
9593
9594 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009595 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009596 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9597 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9598 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9599 }
9600 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009601 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009602
9603 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9604 INTENT_DEFAULT = 0;
9605 INTENT_ACTION_VIEW = 1;
9606 INTENT_ACTION_EDIT = 2;
9607 INTENT_ACTION_SEND = 3;
9608 INTENT_ACTION_SENDTO = 4;
9609 INTENT_ACTION_SEND_MULTIPLE = 5;
9610 INTENT_ACTION_IMAGE_CAPTURE = 6;
9611 INTENT_ACTION_MAIN = 7;
9612 }
9613 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009614 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009615}
9616
9617/**
9618 * Reports a ranking selection event.
9619 *
9620 * Logged from:
9621 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9622 */
9623message RankingSelected {
9624 // The event_id (as for UiEventReported).
9625 optional int32 event_id = 1;
9626 // The relevant app's package name (can be source or picked package).
9627 optional string package_name = 2;
9628 // An identifier to tie together multiple logs relating to the same share event.
9629 optional int32 instance_id = 3;
9630 // Which of the ranked targets got picked, default starting position 0.
9631 optional int32 position_picked = 4;
9632}
Raff Tsaiea4db182020-03-06 07:45:43 +08009633
9634/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009635 * Logs when TvSettings UI is interacted at.
9636 *
9637 * Logged from: packages/apps/TvSettings
9638 */
9639message TvSettingsUIInteracted {
9640
9641 /** The UI action category */
9642 optional android.app.tvsettings.Action action = 1;
9643
9644 /** The ID of the entry that the users actioned on */
9645 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009646}
9647
9648/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009649 * Logs information about a package installation using package installer V2 APIs.
9650 *
9651 * Logged from:
9652 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9653 */
9654message PackageInstallerV2Reported {
9655 // Whether this installation uses Incremental File System
9656 optional bool is_incremental = 1;
9657 // Name of the package that is intended to be installed
9658 optional string package_name = 2;
9659 // The duration between when the install was requested to when the install has completed
9660 optional int64 duration_millis = 3;
9661 // Installation result in final integer, which are SystemApi's.
9662 // Return_code 1 indicates success.
9663 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9664 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009665 // Total size of the APKs installed for this package
9666 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009667}
9668
9669/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009670 * Logs settings provider values.
9671 *
9672 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9673 * then write the value to proto.
9674 *
9675 */
9676message SettingSnapshot {
9677
9678 // Setting key
9679 optional string name = 1;
9680
9681 enum SettingsValueType {
9682 NOTASSIGNED = 0;
9683 ASSIGNED_BOOL_TYPE = 1;
9684 ASSIGNED_INT_TYPE = 2;
9685 ASSIGNED_FLOAT_TYPE = 3;
9686 ASSIGNED_STRING_TYPE = 4;
9687 };
9688 // Setting value type
9689 optional SettingsValueType type = 2;
9690
9691 optional bool bool_value = 3;
9692
9693 optional int32 int_value = 4;
9694
9695 optional float float_value = 5;
9696
9697 optional string str_value = 6;
9698
9699 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9700 optional int32 user_id = 7;
9701}
Varun Shahacb56342019-12-18 11:45:38 -08009702
9703/**
9704 * An event logged to indicate that a user journey is about to be performed. This atom includes
9705 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9706 * will immediately follow this atom which will describe the event(s) and its state.
9707 *
9708 * Logged from:
9709 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9710 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9711 */
9712message UserLifecycleJourneyReported {
9713 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9714 // UserLifecycleEventOccurred atom)
9715 optional int64 session_id = 1;
9716
9717 // Indicates what type of user journey this session is related to
9718 enum Journey {
9719 UNKNOWN = 0; // Undefined user lifecycle journey
9720 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9721 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9722 USER_START = 3; // A user start journey
9723 USER_CREATE = 4; // A user creation journey
9724 }
9725 optional Journey journey = 2;
9726 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9727 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9728 optional int32 origin_user = 3;
9729 // Which user the journey is targeting
9730 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9731 optional int32 target_user = 4;
9732
9733 // What is the user type of the target user
9734 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9735 enum UserType {
9736 TYPE_UNKNOWN = 0;
9737 FULL_SYSTEM = 1;
9738 FULL_SECONDARY = 2;
9739 FULL_GUEST = 3;
9740 FULL_DEMO = 4;
9741 FULL_RESTRICTED = 5;
9742 PROFILE_MANAGED = 6;
9743 SYSTEM_HEADLESS = 7;
9744 }
9745 optional UserType user_type = 5;
9746 // What are the flags attached to the target user
9747 optional int32 user_flags = 6;
9748}
9749
9750/**
9751 * An event logged when a specific user lifecycle event is performed. These events should be
9752 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9753 * Note: journeys can span over multiple events, hence some events may share a single session id.
9754 *
9755 * Logged from:
9756 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9757 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9758 */
9759message UserLifecycleEventOccurred {
9760 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9761 optional int64 session_id = 1;
9762 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9763 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9764 optional int32 user_id = 2;
9765
9766 enum Event {
9767 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9768 SWITCH_USER = 1; // Indicates that this is a user switch event
9769 START_USER = 2; // Indicates that this is a user start event
9770 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -07009771 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
9772 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
9773 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -08009774 }
9775 optional Event event = 3;
9776
9777 enum State {
9778 NONE = 0; // Indicates the associated event has no start/end defined
9779 BEGIN = 1;
9780 FINISH = 2;
9781 }
9782 optional State state = 4; // Represents the state of an event (beginning/ending)
9783}
jasonwshsu81173e32020-03-27 15:22:03 +08009784
9785/**
9786 * Logs when accessibility shortcut clicked.
9787 *
9788 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009789 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009790 */
9791message AccessibilityShortcutReported {
9792 // The accessibility feature(including installed a11y service, framework a11y feature,
9793 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9794 optional string package_name = 1;
9795
9796 // The definition of the accessibility shortcut.
9797 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9798 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9799
9800 // The definition of the service status.
9801 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9802 optional android.stats.accessibility.ServiceStatus service_status = 3;
9803}
9804
9805/**
9806 * Logs when accessibility service status changed.
9807 *
9808 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009809 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009810 */
9811message AccessibilityServiceReported {
9812 // The accessibility service package name.
9813 optional string package_name = 1;
9814
9815 // The definition of the service status.
9816 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9817 optional android.stats.accessibility.ServiceStatus service_status = 2;
9818}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009819
Denny cy Lee57b31282020-04-17 10:08:52 +08009820message DisplayWakeReason {
9821 // Wake_up_reason code
9822 // If LOWORD(wake_up_reason) = 0
9823 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9824 // else reference wake_up_reason to
9825 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9826 optional int32 wake_up_reason = 1;
9827 // Count of wake up by reason
9828 optional int32 wake_times = 2;
9829}
9830
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009831/**
9832 * Logs app usage events.
9833 */
9834message AppUsageEventOccurred {
9835 optional int32 uid = 1 [(is_uid) = true];
9836 optional string package_name = 2;
9837 optional string class_name = 3;
9838
9839 enum EventType {
9840 NONE = 0;
9841 MOVE_TO_FOREGROUND = 1;
9842 MOVE_TO_BACKGROUND = 2;
9843 }
9844 optional EventType event_type = 4;
9845}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009846
9847/*
9848 * Quality metrics logged when EVS cameras are active.
9849 *
9850 * Logged from:
9851 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9852 */
9853message EvsUsageStatsReported {
9854
9855 // Camera identifier to distinguish the source camera device. This is not
9856 // globally unique and therefore cannot be used to identify the user and/or
9857 // the device.
9858 optional int32 device_id = 1;
9859
9860 // Peak number of clients during the service
9861 optional int32 peak_num_clients = 2;
9862
9863 // Number of erroneous events during the service
9864 optional int32 num_errors = 3;
9865
9866 // Round trip latency of the very first frame
9867 optional int64 first_latency_millis = 4;
9868
9869 // Average frame round trip latency
9870 optional float avg_latency_millis = 5;
9871
9872 // Peak frame round trip latency
9873 optional int64 peak_latency_millis = 6;
9874
9875 // Total number of frames received
9876 optional int64 total_frames = 7;
9877
9878 // Number of frames ignored
9879 optional int64 ignored_frames = 8;
9880
9881 // Number of dropped frames to synchronize camera devices
9882 optional int64 dropped_frames_to_sync = 9;
9883
9884 // The duration of the service
9885 optional int64 duration_millis = 10;
9886}
Robert Leecccdc152020-04-23 13:22:46 +08009887
9888/**
9889 * Logs audio power usage stats.
9890 *
9891 * Pushed from:
9892 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9893 */
9894message AudioPowerUsageDataReported {
9895 /**
9896 * Device used for input/output
9897 *
9898 * All audio devices please refer to below file:
9899 * system/media/audio/include/system/audio-base.h
9900 *
9901 * Define our own enum values because we don't report all audio devices.
9902 * Currently, we only report built-in audio devices such as handset, speaker,
9903 * built-in mics, common audio devices such as wired headset, usb headset
9904 * and bluetooth devices.
9905 */
9906 enum AudioDevice {
9907 OUTPUT_EARPIECE = 0x1; // handset
9908 OUTPUT_SPEAKER = 0x2; // dual speaker
9909 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9910 OUTPUT_USB_HEADSET = 0x8; // usb headset
9911 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9912 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9913 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9914
9915 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9916 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9917 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9918 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9919 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9920 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9921 }
9922 optional AudioDevice audio_device = 1;
9923
9924 // Duration of the audio in seconds
9925 optional int32 duration_secs = 2;
9926
9927 // Average volume (0 ... 1.0)
9928 optional float average_volume = 3;
9929
9930 enum AudioType {
9931 UNKNOWN_TYPE = 0;
9932 VOICE_CALL_TYPE = 1; // voice call
9933 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9934 MEDIA_TYPE = 3; // music and system sound
9935 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9936 ALARM_TYPE = 5; // alarm type
9937 // record type
9938 CAMCORDER_TYPE = 6; // camcorder
9939 RECORD_TYPE = 7; // other recording
9940 }
9941 optional AudioType type = 4;
9942}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009943
9944/**
9945 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9946 *
9947 * Pulled from:
9948 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9949 */
9950message BytesTransferByTagAndMetered {
9951 optional int32 uid = 1 [(is_uid) = true];
9952
9953 optional bool is_metered = 2;
9954
9955 optional int32 tag = 3;
9956
9957 optional int64 rx_bytes = 4;
9958
9959 optional int64 rx_packets = 5;
9960
9961 optional int64 tx_bytes = 6;
9962
9963 optional int64 tx_packets = 7;
9964}
Robert Luo2f52f042020-05-11 16:39:24 +08009965
9966/*
9967 * Logs when the Media Output Switcher finishes a media switch operation.
9968 *
9969 * Logged from:
9970 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9971 */
9972message MediaOutputOpSwitchReported {
9973 // Source medium type before switching.
9974 optional android.app.settings.mediaoutput.MediumType source = 1;
9975
9976 // Target medium type after switching.
9977 optional android.app.settings.mediaoutput.MediumType target = 2;
9978
9979 // The result of switching.
9980 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9981
9982 // The detail code of a switching result.
9983 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9984
9985 /*
9986 * The package name of a pre-installed app, whose media session is being switched.
9987 */
9988 optional string media_session_package_name = 5;
9989
9990 // The amount of available wired devices when a switching is being performed.
9991 optional int32 available_wired_device_count = 6;
9992
9993 // The amount of available Bluetooth devices a switching is being performed.
9994 optional int32 available_bt_device_count = 7;
9995
9996 // The amount of available remote devices when a switching is being performed.
9997 optional int32 available_remote_device_count = 8;
9998
9999 // The amount of applied devices within a remote dynamic group after a switching is done.
10000 optional int32 applied_device_count_within_remote_group = 9;
10001}
Govinda Wassermane4640282020-04-30 09:30:56 -040010002
10003/**
10004 * Logs when the Assistant is invoked.
10005 *
10006 * Logged from:
10007 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10008 */
10009message AssistantInvocationReported {
10010
10011 // The event_id (as for UiEventReported).
10012 optional int32 event_id = 1;
10013
10014 // The registered Assistant's uid and package (as for UiEventReported).
10015 optional int32 uid = 2 [(is_uid) = true];
10016 optional string package_name = 3;
10017
10018 // An identifier used to disambiguate which logs refer to a particular invocation of the
10019 // Assistant (as for UiEventReported).
10020 optional int32 instance_id = 4;
10021
10022 // The state of the device at the time of invocation.
10023 enum DeviceState {
10024 UNKNOWN_DEVICE_STATE = 0;
10025 AOD1 = 1;
10026 AOD2 = 2;
10027 BOUNCER = 3;
10028 UNLOCKED_LOCKSCREEN = 4;
10029 LAUNCHER_HOME = 5;
10030 LAUNCHER_OVERVIEW = 6;
10031 LAUNCHER_ALL_APPS = 7;
10032 APP_DEFAULT = 8;
10033 APP_IMMERSIVE = 9;
10034 APP_FULLSCREEN = 10;
10035 }
10036 optional DeviceState device_state = 5;
10037
10038 // Whether the Assistant handles were showing at the time of invocation.
10039 optional bool assistant_handles_showing = 6;
10040}