blob: 81d059ed84d9a9b0331fad2354b063a78c8d7124 [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"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700452
453 // StatsdStats tracks platform atoms with ids upto 500.
454 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000455 }
David Chenc8a43242017-10-17 16:23:28 -0700456
David Chen6e3e6cb2018-01-03 16:14:06 -0800457 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700458 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700459 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800460 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
461 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700462 MobileBytesTransfer mobile_bytes_transfer =
463 10002 [(module) = "framework", (truncate_timestamp) = true];
464 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
465 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
467 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700468 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700470 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800471 CpuTimePerUidFreq cpu_time_per_uid_freq =
472 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
474 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
475 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
476 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
477 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700478 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700479 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700480 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700481 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800482 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
483 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700484 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800485 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800487 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800488 DiskStats disk_stats = 10025 [(module) = "framework"];
489 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
490 AppSize app_size = 10027 [(module) = "framework"];
491 CategorySize category_size = 10028 [(module) = "framework"];
492 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800493 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800494 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
495 DiskIo disk_io = 10032 [(module) = "framework"];
496 PowerProfile power_profile = 10033 [(module) = "framework"];
497 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
498 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
499 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700500 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800501 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
502 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
503 10040 [(module) = "framework"];
504 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
505 10041 [(module) = "framework"];
506 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800507 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800508 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800509 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800510 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
511 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
512 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
513 RoleHolder role_holder = 10049 [(module) = "framework"];
514 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800515 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800516 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
517 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800518 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
519 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800520 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
521 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
522 FaceSettings face_settings = 10058 [(module) = "framework"];
523 CoolingDevice cooling_device = 10059 [(module) = "framework"];
524 AppOps app_ops = 10060 [(module) = "framework"];
525 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700526 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
527 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800528 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800529 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800530 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
531 DangerousPermissionStateSampled dangerous_permission_state_sampled =
532 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400533 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000534 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000535 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200536 PackageNotificationPreferences package_notification_preferences =
537 10071 [(module) = "framework"];
538 PackageNotificationChannelPreferences package_notification_channel_preferences =
539 10072 [(module) = "framework"];
540 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
541 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800542 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800543 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700544 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
545 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
546 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
547 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800548 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800549 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800550 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700551 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
552 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700553 }
yroa1fe77c2018-02-26 14:22:54 -0800554
Bookatz76aafcf2018-09-17 16:17:10 -0700555 // DO NOT USE field numbers above 100,000 in AOSP.
556 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
557 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100558
559 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700560}
561
Yao Chend54f9dd2017-10-17 17:37:48 +0000562/**
Yangster-mac20877162017-12-22 17:19:39 -0800563 * This proto represents a node of an attribution chain.
564 * Note: All attribution chains are represented as a repeated field of type
565 * AttributionNode. It is understood that in such arrays, the order is that
566 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000567 */
Yangster-mac20877162017-12-22 17:19:39 -0800568message AttributionNode {
569 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800570 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800571
Yangster-mac20877162017-12-22 17:19:39 -0800572 // The (optional) string tag for an element in the attribution chain. If the
573 // element has no tag, it is encoded as an empty string.
574 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700575}
576
Yangster-mac48b3d622018-08-18 12:38:11 -0700577message KeyValuePair {
578 optional int32 key = 1;
579 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700580 int32 value_int = 2;
581 int64 value_long = 3;
582 string value_str = 4;
583 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700584 }
585}
586
587message KeyValuePairsAtom {
588 optional int32 uid = 1;
589 repeated KeyValuePair pairs = 2;
590}
591
Yao Chend54f9dd2017-10-17 17:37:48 +0000592/*
593 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800594 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 *
596 * RULES:
597 * - The field ids for each atom must start at 1, and count upwards by 1.
598 * Skipping field ids is not allowed.
599 * - These form an API, so renaming, renumbering or removing fields is
600 * not allowed between android releases. (This is not currently enforced,
601 * but there will be a tool to enforce this restriction).
602 * - The types must be built-in protocol buffer types, namely, no sub-messages
603 * are allowed (yet). The bytes type is also not allowed.
604 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800605 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800607 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000608 * - A field that is a uid should be a string field, tagged with the [xxx]
609 * annotation. The generated code on android will be represented by UIDs,
610 * and those UIDs will be translated in xxx to those strings.
611 *
612 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700613 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000614 * - If there is a UID, it goes first. Think in an object-oriented fashion.
615 * *****************************************************************************
616 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700617
Yao Chend54f9dd2017-10-17 17:37:48 +0000618/**
Tej Singha72344992019-04-17 18:55:08 -0700619 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700620 * Logs when the Thermal service HAL notifies the throttling start/stop events.
621 *
622 * Logged from:
623 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
624 */
625message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700626 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700627 optional android.os.TemperatureTypeEnum sensor_type = 1;
628
Maggie White442b6312019-04-05 16:26:44 -0700629 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700630 enum State {
631 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700632 START = 1; // START indicated that throttling was triggered.
633 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700634 }
Yangster-mace16189a2018-08-26 12:20:16 -0700635 optional State state = 2;
636
637 optional float temperature = 3;
638}
639
640/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000641 * Logs when the screen state changes.
642 *
643 * Logged from:
644 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
645 */
646message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800647 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800648 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700649 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700650}
Yao Chend54f9dd2017-10-17 17:37:48 +0000651
652/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700653 * Logs that the process state of the uid, as determined by ActivityManager
654 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000655 *
656 * Logged from:
657 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
658 */
Bookatzc1a050a2017-10-10 15:49:28 -0700659message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700660 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000661
Bookatzdb026a22018-01-10 19:01:56 -0800662 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800663 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700664 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000665}
666
667/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700668 * Logs process state change of a process, as per the activity manager.
669 *
670 * Logged from:
671 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
672 */
673message ProcessStateChanged {
674 optional int32 uid = 1;
675 optional string process_name = 2;
676 optional string package_name = 3;
677 // TODO: remove this when validation is done
678 optional int64 version = 5;
679 // The state, from frameworks/base/core/proto/android/app/enums.proto.
680 optional android.app.ProcessStateEnum state = 4;
681}
682
683/**
684 * Logs when ActivityManagerService sleep state is changed.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
688 */
689message ActivityManagerSleepStateChanged {
690 // TODO: import frameworks proto
691 enum State {
692 UNKNOWN = 0;
693 ASLEEP = 1;
694 AWAKE = 2;
695 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700696 optional State state = 1
697 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700698}
699
700/**
701 * Logs when system memory state changes.
702 *
703 * Logged from:
704 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
705 */
706message MemoryFactorStateChanged {
707 // TODO: import frameworks proto
708 enum State {
709 MEMORY_UNKNOWN = 0;
710 NORMAL = 1; // normal.
711 MODERATE = 2; // moderate memory pressure.
712 LOW = 3; // low memory.
713 CRITICAL = 4; // critical memory.
714
715 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700716 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700717}
718
719/**
720 * Logs when app is using too much cpu, according to ActivityManagerService.
721 *
722 * Logged from:
723 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
724 */
725message ExcessiveCpuUsageReported {
726 optional int32 uid = 1;
727 optional string process_name = 2;
728 optional string package_name = 3;
729 // package version. TODO: remove this when validation is done
730 optional int64 version = 4;
731}
732
733/**
734 * Logs when a cached process is killed, along with its pss.
735 *
736 * Logged from:
737 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
738 */
739message CachedKillReported {
740 optional int32 uid = 1;
741 optional string process_name = 2;
742 optional string package_name = 3;
743 // TODO: remove this when validation is done
744 optional int64 version = 5;
745 optional int64 pss = 4;
746}
747
748/**
xshu2c3d9e42019-09-26 17:54:02 -0700749 * Logs the change in wifi health.
750 *
751 * Logged from:
752 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
753 */
754message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800755 enum Band {
756 UNKNOWN = 0;
757 // All of 2.4GHz band
758 BAND_2G = 1;
759 // Frequencies in the range of [5150, 5250) GHz
760 BAND_5G_LOW = 2;
761 // Frequencies in the range of [5250, 5725) GHz
762 BAND_5G_MIDDLE = 3;
763 // Frequencies in the range of [5725, 5850) GHz
764 BAND_5G_HIGH = 4;
765 // Frequencies in the range of [5925, 6425) GHz
766 BAND_6G_LOW = 5;
767 // Frequencies in the range of [6425, 6875) GHz
768 BAND_6G_MIDDLE = 6;
769 // Frequencies in the range of [6875, 7125) GHz
770 BAND_6G_HIGH = 7;
771 }
xshu2c3d9e42019-09-26 17:54:02 -0700772 // duration this stat is obtained over in milliseconds
773 optional int32 duration_millis = 1;
774 // whether wifi is classified as sufficient for the user's data traffic, determined
775 // by whether the calculated throughput exceeds the average demand within |duration_millis|
776 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700777 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800778 optional bool is_cell_data_available = 3;
779 // the Band bucket the connected network is on
780 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700781}
782
783/**
784 * Logged when wifi detects a significant change in connection failure rate.
785 *
786 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
787 *
788 */
789message WifiFailureStatReported {
790 enum AbnormalityType {
791 UNKNOWN = 0;
792 SIGNIFICANT_INCREASE = 1;
793 SIGNIFICANT_DECREASE = 2;
794 SIMPLY_HIGH = 3;
795 }
796 enum FailureType {
797 FAILURE_UNKNOWN = 0;
798 FAILURE_CONNECTION = 1;
799 FAILURE_ASSOCIATION_REJECTION = 2;
800 FAILURE_ASSOCIATION_TIMEOUT = 3;
801 FAILURE_AUTHENTICATION = 4;
802 FAILURE_NON_LOCAL_DISCONNECTION = 5;
803 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
804 }
805 // Reason for uploading this stat
806 optional AbnormalityType abnormality_type = 1;
807 // The particular type of failure
808 optional FailureType failure_type = 2;
809 // How many times we have encountered this combination of AbnormalityType and FailureType
810 optional int32 failure_count = 3;
811}
812
813/**
814 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
815 *
816 * Logged from:
817 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
818 */
819message WifiConnectionResultReported {
820 enum FailureCode {
821 FAILURE_UNKNOWN = 0;
822 FAILURE_ASSOCIATION_TIMEOUT = 1;
823 FAILURE_ASSOCIATION_REJECTION = 2;
824 FAILURE_AUTHENTICATION_GENERAL = 3;
825 FAILURE_AUTHENTICATION_EAP = 4;
826 FAILURE_DHCP = 5;
827 FAILURE_NETWORK_DISCONNECTION = 6;
828 FAILURE_ROAM_TIMEOUT = 7;
829 }
830 // true represents a successful connection
831 optional bool connection_result = 1;
832 // reason for the connection failure
833 optional FailureCode failure_code = 2;
834 // scan rssi before the connection attempt
835 optional int32 rssi = 3;
836}
837
838/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700839 * Logs when memory stats of a process is reported.
840 *
841 * Logged from:
842 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
843 */
844message ProcessMemoryStatReported {
845 optional int32 uid = 1;
846 optional string process_name = 2;
847 optional string package_name = 3;
848 //TODO: remove this when validation is done
849 optional int64 version = 9;
850 optional int64 pss = 4;
851 optional int64 uss = 5;
852 optional int64 rss = 6;
853 enum Type {
854 ADD_PSS_INTERNAL_SINGLE = 0;
855 ADD_PSS_INTERNAL_ALL_MEM = 1;
856 ADD_PSS_INTERNAL_ALL_POLL = 2;
857 ADD_PSS_EXTERNAL = 3;
858 ADD_PSS_EXTERNAL_SLOW = 4;
859 }
860 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800861 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700862}
863
864/**
Bookatzc1a050a2017-10-10 15:49:28 -0700865 * Logs that a process started, finished, crashed, or ANRed.
866 *
867 * Logged from:
868 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
869 */
870message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700871 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700872
David Chen0b5c90c2018-01-25 16:51:49 -0800873 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800874 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700875
Bookatzddccf0a2017-11-28 16:48:14 -0800876 // What lifecycle state the process changed to.
877 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800878 enum State {
879 FINISHED = 0;
880 STARTED = 1;
881 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800882 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800883 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700884}
885
Bookatzc1a050a2017-10-10 15:49:28 -0700886/**
887 * Logs when the ble scan state changes.
888 *
889 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700890 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700891 */
892message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800893 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700894 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700895
896 enum State {
897 OFF = 0;
898 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700899 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
900 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700901 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800902 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700903 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800904 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700905 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800906 (state_field_option).nested = true
907 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700908
Bookatze5ec0b42018-03-26 13:34:56 -0700909 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700910 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700911 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700912 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700913 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700914 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700915}
916
917/**
918 * Logs reporting of a ble scan finding results.
919 *
920 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700921 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700922 */
Bookatzae6738e2018-09-13 11:38:56 -0700923// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700924message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800925 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700926
927 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800928 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700929}
930
931/**
932 * Logs when a sensor state changes.
933 *
934 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700935 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700936 */
937message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800938 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700939
Bookatzc1a050a2017-10-10 15:49:28 -0700940 // The id (int) of the sensor.
941 optional int32 sensor_id = 2;
942
943 enum State {
944 OFF = 0;
945 ON = 1;
946 }
947 optional State state = 3;
948}
949
Bookatzc1a050a2017-10-10 15:49:28 -0700950/**
951 * Logs when GPS state changes.
952 *
953 * Logged from:
954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
955 */
956message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800957 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700958
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 2;
964}
965
Bookatz48d362e2018-11-06 15:49:08 -0800966/**
967 * Logs when GPS signal quality.
968 *
969 * Logged from:
970 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
971 */
972message GpsSignalQualityChanged {
973 optional android.server.location.GpsSignalQualityEnum level = 1;
974}
975
Bookatzc1a050a2017-10-10 15:49:28 -0700976
977/**
978 * Logs when a sync manager sync state changes.
979 *
980 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700981 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700982 */
983message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800984 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700985
David Chen0b5c90c2018-01-25 16:51:49 -0800986 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800987 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700988
989 enum State {
990 OFF = 0;
991 ON = 1;
992 }
993 optional State state = 3;
994}
995
Yangster-mac96353002018-09-05 11:18:55 -0700996/*
997 * Deferred job stats.
998 *
999 * Logged from:
1000 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1001*/
1002message DeferredJobStatsReported {
1003 repeated AttributionNode attribution_node = 1;
1004
1005 // Number of jobs deferred.
1006 optional int32 num_jobs_deferred = 2;
1007
1008 // Time since the last job runs.
1009 optional int64 time_since_last_job_millis = 3;
1010}
1011
Bookatzc1a050a2017-10-10 15:49:28 -07001012/**
1013 * Logs when a job scheduler job state changes.
1014 *
1015 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001016 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001017 */
1018message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001019 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001020
1021 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001022 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001023
1024 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001025 FINISHED = 0;
1026 STARTED = 1;
1027 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001028 }
1029 optional State state = 3;
1030
Tej Singh33a412b2018-03-16 18:43:59 -07001031 // The reason a job has stopped.
1032 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001033 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001034 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001035
1036 // The standby bucket of the app that scheduled the job. These match the framework constants
1037 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1038 // already assigned 0.
1039 enum Bucket {
1040 UNKNOWN = -1;
1041 ACTIVE = 0;
1042 WORKING_SET = 1;
1043 FREQUENT = 2;
1044 RARE = 3;
1045 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001046 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001047 }
1048 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1049
1050 // The job id (as assigned by the app).
1051 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001052
1053 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1054 // constraints as they are always assumed to be set.
1055 optional bool has_charging_constraint = 7;
1056 optional bool has_battery_not_low_constraint = 8;
1057 optional bool has_storage_not_low_constraint = 9;
1058 optional bool has_timing_delay_constraint = 10;
1059 optional bool has_deadline_constraint = 11;
1060 optional bool has_idle_constraint = 12;
1061 optional bool has_connectivity_constraint = 13;
1062 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001063}
1064
1065/**
1066 * Logs when the audio state changes.
1067 *
1068 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001069 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001070 */
1071message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001072 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001073
1074 enum State {
1075 OFF = 0;
1076 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001077 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1078 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001079 }
1080 optional State state = 2;
1081}
1082
1083/**
1084 * Logs when the video codec state changes.
1085 *
1086 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001087 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001088 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001089message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001090 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001091
1092 enum State {
1093 OFF = 0;
1094 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001095 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1096 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001097 }
1098 optional State state = 2;
1099}
1100
1101/**
1102 * Logs when the flashlight state changes.
1103 *
1104 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001105 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001106 */
1107message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001108 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001109
1110 enum State {
1111 OFF = 0;
1112 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001113 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1114 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001115 }
1116 optional State state = 2;
1117}
1118
1119/**
1120 * Logs when the camera state changes.
1121 *
1122 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001123 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001124 */
1125message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001126 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001127
1128 enum State {
1129 OFF = 0;
1130 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001131 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1132 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001133 }
1134 optional State state = 2;
1135}
1136
1137/**
1138 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001139 *
1140 * Logged from:
1141 * TODO
1142 */
Bookatzd6746242017-10-24 18:39:35 -07001143message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001144 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001145 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001146
Bookatz1a1b0462018-01-12 11:47:03 -08001147 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1148 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001149 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001150
1151 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001152 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001153
1154 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001155 RELEASE = 0;
1156 ACQUIRE = 1;
1157 CHANGE_RELEASE = 2;
1158 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001159 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001160 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001161 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001162 (state_field_option).default_state_value = 0,
1163 (state_field_option).nested = true
1164 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001165}
1166
1167/**
Bookatzc1a050a2017-10-10 15:49:28 -07001168 * Logs when a partial wakelock is considered 'long' (over 1 min).
1169 *
1170 * Logged from:
1171 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1172 */
1173message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001174 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001175
Yao Chend54f9dd2017-10-17 17:37:48 +00001176 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1177 optional string tag = 2;
1178
Bookatzc1a050a2017-10-10 15:49:28 -07001179 // TODO: I have no idea what this is.
1180 optional string history_tag = 3;
1181
1182 enum State {
1183 OFF = 0;
1184 ON = 1;
1185 }
1186 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001187}
1188
Bookatzc1a050a2017-10-10 15:49:28 -07001189/**
Bookatza66083f2018-09-20 17:24:00 -07001190 * Logs when the device is interactive, according to the PowerManager Notifier.
1191 *
1192 * Logged from:
1193 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1194 */
1195message InteractiveStateChanged {
1196 enum State {
1197 OFF = 0;
1198 ON = 1;
1199 }
1200 optional State state = 1;
1201}
1202
1203/**
Bookatzc1a050a2017-10-10 15:49:28 -07001204 * Logs Battery Saver state change.
1205 *
1206 * Logged from:
1207 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1208 */
1209message BatterySaverModeStateChanged {
1210 enum State {
1211 OFF = 0;
1212 ON = 1;
1213 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001214 optional State state = 1
1215 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001216}
1217
1218/**
1219 * Logs Doze mode state change.
1220 *
1221 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001222 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001223 */
1224message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001225 optional android.server.DeviceIdleModeEnum state = 1
1226 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001227}
1228
1229
1230/**
1231 * Logs state change of Doze mode including maintenance windows.
1232 *
1233 * Logged from:
1234 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1235 */
1236message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001237 optional android.server.DeviceIdleModeEnum state = 1
1238 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001239}
1240
1241/**
1242 * Logs screen brightness level.
1243 *
1244 * Logged from:
1245 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1246 */
1247message ScreenBrightnessChanged {
1248 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1249 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001250}
1251
1252/**
1253 * Logs battery level (percent full, from 0 to 100).
1254 *
1255 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001256 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001257 */
1258message BatteryLevelChanged {
1259 // Battery level. Should be in [0, 100].
1260 optional int32 battery_level = 1;
1261}
1262
1263/**
1264 * Logs change in charging status of the device.
1265 *
1266 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001267 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001268 */
1269message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001270 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001271 optional android.os.BatteryStatusEnum state = 1
1272 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001273}
1274
1275/**
1276 * Logs whether the device is plugged in, and what power source it is using.
1277 *
1278 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001279 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001280 */
1281message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001282 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001283 optional android.os.BatteryPluggedStateEnum state = 1
1284 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001285}
1286
Bookatz8c6571b2017-10-24 15:04:41 -07001287/**
1288 * Logs when an app's wakeup alarm fires.
1289 *
1290 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001291 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001292 */
1293message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001294 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001295
1296 // Name of the wakeup alarm.
1297 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001298
1299 // Name of source package (for historical reasons, since BatteryStats tracked it).
1300 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001301
Ben Murdoch3389f1522019-05-21 15:05:34 +01001302 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001303 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001304}
1305
1306/**
1307 * Logs when an an app causes the mobile radio to change state.
1308 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1309 *
1310 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001311 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001312 */
1313message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001314 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001315
Bookatz1a1b0462018-01-12 11:47:03 -08001316 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1317 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001318}
1319
1320/**
1321 * Logs when an an app causes the wifi radio to change state.
1322 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1323 *
1324 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001325 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001326 */
1327message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001328 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001329
Bookatz1a1b0462018-01-12 11:47:03 -08001330 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1331 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001332}
1333
1334/**
1335 * Logs kernel wakeup reasons and aborts.
1336 *
1337 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001338 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001339 */
1340message KernelWakeupReported {
1341 // Name of the kernel wakeup reason (or abort).
1342 optional string wakeup_reason_name = 1;
1343
1344 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001345 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001346}
1347
1348/**
Bookatzda1798c2018-12-13 14:16:00 -08001349 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001350 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001351 *
1352 * Logged from:
1353 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1354 */
1355message WifiEnabledStateChanged {
1356 enum State {
1357 OFF = 0;
1358 ON = 1;
1359 }
1360 optional State state = 1;
1361}
1362
1363/**
tsaichristinececebdc2020-02-04 14:05:56 -08001364 * This atom is deprecated starting in R.
1365 *
Bookatzda1798c2018-12-13 14:16:00 -08001366 * 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 -08001367 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1368 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001369 *
1370 * Logged from:
1371 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1372 */
1373message WifiRunningStateChanged {
1374 repeated AttributionNode attribution_node = 1;
1375
1376 enum State {
1377 OFF = 0;
1378 ON = 1;
1379 }
1380 optional State state = 2;
1381}
1382
1383/**
Bookatze5885242017-10-24 20:10:31 -07001384 * Logs wifi locks held by an app.
1385 *
1386 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001387 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001388 */
1389message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001390 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001391
1392 enum State {
1393 OFF = 0;
1394 ON = 1;
1395 }
1396 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001397
1398 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1399 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001400}
1401
1402/**
1403 * Logs wifi signal strength changes.
1404 *
1405 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001406 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001407 */
1408message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001409 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1410 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001411}
1412
1413/**
1414 * Logs wifi scans performed by an app.
1415 *
1416 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001417 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001418 */
1419message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001420 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001421
1422 enum State {
1423 OFF = 0;
1424 ON = 1;
1425 }
1426 optional State state = 2;
1427}
1428
1429/**
Tej Singh4503e102018-01-04 14:35:01 -08001430 * Logs wifi multicast locks held by an app
1431 *
1432 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001433 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001434 */
1435message WifiMulticastLockStateChanged {
1436 repeated AttributionNode attribution_node = 1;
1437
1438 enum State {
1439 OFF = 0;
1440 ON = 1;
1441 }
1442 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001443
1444 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001445}
1446
1447/**
Tej Singh1ea42892018-01-19 09:27:00 -08001448 * Logs shutdown reason and duration on next boot.
1449 *
1450 * Logged from:
1451 * frameworks/base/core/java/com/android/server/BootReceiver.java
1452 */
1453message ShutdownSequenceReported {
1454 // True if shutdown is for a reboot. Default: false if we do not know.
1455 optional bool reboot = 1;
1456
1457 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1458 optional string reason = 2;
1459
1460 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1461 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001462 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001463
1464 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001465 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001466}
1467
Tej Singh6483ea42018-01-25 17:45:49 -08001468
1469/**
1470 * Logs boot reason and duration.
1471 *
1472 * Logged from:
1473 * system/core/bootstat/bootstat.cpp
1474 */
1475message BootSequenceReported {
1476 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1477 // Default: "<EMPTY>" if not available.
1478 optional string bootloader_reason = 1;
1479
1480 // Reason for system boot. Eg. bootloader, reboot,userrequested
1481 // Default: "<EMPTY>" if not available.
1482 optional string system_reason = 2;
1483
1484 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001485 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001486
1487 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001488 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001489
1490 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001491 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001492
1493 // Time since last boot in ms. Default: 0 if not available.
1494 optional int64 time_since_last_boot = 6;
1495}
1496
Tej Singhc477d9c2018-02-05 18:31:39 -08001497
1498/**
1499 * Logs call state and disconnect cause (if applicable).
1500 *
1501 * Logged from:
1502 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1503 */
1504message CallStateChanged {
1505 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1506 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1507 optional android.telecom.CallStateEnum call_state = 1;
1508
1509 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1510 // This value is only applicable when the call_state is DISCONNECTED, and
1511 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1512 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1513 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1514
1515 // True if the call is self-managed, which are apps that use the
1516 // telecom infrastructure to make their own calls.
1517 optional bool self_managed = 3;
1518
1519 // True if call is external. External calls are calls on connected Wear
1520 // devices but show up in Telecom so the user can pull them onto the device.
1521 optional bool external_call = 4;
1522}
1523
Tej Singh1ea42892018-01-19 09:27:00 -08001524/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001525 * Logs keyguard state. The keyguard is the lock screen.
1526 *
1527 * Logged from:
1528 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1529 */
1530message KeyguardStateChanged {
1531 enum State {
1532 UNKNOWN = 0;
1533 // The keyguard is hidden when the phone is unlocked.
1534 HIDDEN = 1;
1535 // The keyguard is shown when the phone is locked (screen turns off).
1536 SHOWN= 2;
1537 // The keyguard is occluded when something is overlaying the keyguard.
1538 // Eg. Opening the camera while on the lock screen.
1539 OCCLUDED = 3;
1540 }
1541 optional State state = 1;
1542}
1543
1544/**
1545 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1546 * prompts the user to enter a password (pattern, pin, etc).
1547 *
1548 * Logged from:
1549 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1550 */
1551
1552message KeyguardBouncerStateChanged {
1553 enum State {
1554 UNKNOWN = 0;
1555 // Bouncer is hidden, either as a result of successfully entering the
1556 // password, screen timing out, or user going back to lock screen.
1557 HIDDEN = 1;
1558 // This is when the user is being prompted to enter the password.
1559 SHOWN = 2;
1560 }
1561 optional State state = 1;
1562}
1563
1564/**
1565 * Logs the result of entering a password into the keyguard bouncer.
1566 *
1567 * Logged from:
1568 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1569 */
1570message KeyguardBouncerPasswordEntered {
1571 enum BouncerResult {
1572 UNKNOWN = 0;
1573 // The password entered was incorrect.
1574 FAILURE = 1;
1575 // The password entered was correct.
1576 SUCCESS = 2;
1577 }
1578 optional BouncerResult result = 1;
1579}
1580
Tej Singha883b372018-02-15 11:30:01 -08001581/*
1582 * Logs changes to the configuration of the device. The configuration is defined
1583 * in frameworks/base/core/java/android/content/res/Configuration.java
1584 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1585 * Please go there to interpret the possible values each field can be.
1586 *
1587 * Logged from:
1588 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1589 */
1590message ResourceConfigurationChanged {
1591 // Bit mask of color capabilities of the screen.
1592 // Contains information about the color gamut and hdr mode of the screen.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001595
1596 // The target screen density being rendered to.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Current user preference for the scaling factor for fonts,
1601 // relative to the base density scaling.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001603 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001604
1605 // Flag indicating whether the hard keyboard is hidden.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001608
1609 // The type of keyboard attached to the device.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1611 optional int32 keyboard = 5;
1612
1613 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1618 // 0 if undefined.
1619 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1620 optional int32 mcc = 7;
1621
1622 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1623 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1624 // MNC_ZERO symbol defined in Configuration.java.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1626 optional int32 mnc = 8;
1627
1628 // The kind of navigation available on the device.
1629 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1630 optional int32 navigation = 9;
1631
1632 // Flag indicating whether the navigation is available.
1633 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001634 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001635
1636 // Overall orientation of the screen.
1637 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1638 optional int32 orientation = 11;
1639
1640 // The current height of the available screen space, in dp units.
1641 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001642 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001643
1644 // Bit mask of overall layout of the screen.
1645 // Contains information about screen size, whether the screen is wider/taller
1646 // than normal, whether the screen layout is right-tl-left or left-to-right,
1647 // and whether the screen has a rounded shape.
1648 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001649 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001650
1651 // Current width of the available screen space, in dp units.
1652 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001653 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001654
1655 // The smallest screen size an application will see in normal operation.
1656 // This is the smallest value of both screenWidthDp and screenHeightDp
1657 // in portrait and landscape.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001659 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001660
1661 // The type of touch screen attached to the device.
1662 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1663 optional int32 touchscreen = 16;
1664
1665 // Bit mask of the ui mode.
1666 // Contains information about the overall ui mode of the device.
1667 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1668 // Also contains information about whether the device is in night mode.
1669 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001670 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001671}
1672
Tej Singheee317b2018-03-07 19:28:05 -08001673
1674/**
1675 * Logs changes in the connection state of the mobile radio.
1676 *
1677 * Logged from:
1678 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1679 */
1680message MobileConnectionStateChanged {
1681 // States are from the state machine DataConnection.java.
1682 enum State {
1683 UNKNOWN = 0;
1684 // The connection is inactive, or disconnected.
1685 INACTIVE = 1;
1686 // The connection is being activated, or connecting.
1687 ACTIVATING = 2;
1688 // The connection is active, or connected.
1689 ACTIVE = 3;
1690 // The connection is disconnecting.
1691 DISCONNECTING = 4;
1692 // The connection is disconnecting after creating a connection.
1693 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1694 }
1695 optional State state = 1;
1696 // For multi-sim phones, this distinguishes between the sim cards.
1697 optional int32 sim_slot_index = 2;
1698 // Used to identify the connection. Starts at 0 and increments by 1 for
1699 // every new network created. Resets whenever the device reboots.
1700 optional int32 data_connection_id = 3;
1701 // A bitmask for the capabilities of this connection.
1702 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1703 // Default value (if we have no information): 0
1704 optional int64 capabilities = 4;
1705 // If this connection has internet.
1706 // This just checks if the DEFAULT bit of capabilities is set.
1707 optional bool has_internet = 5;
1708}
1709
1710/**
1711 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1712 *
1713 * Logged from:
1714 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1715 */
1716message MobileRadioTechnologyChanged {
1717 optional android.telephony.NetworkTypeEnum state = 1;
1718 // For multi-sim phones, this distinguishes between the sim cards.
1719 optional int32 sim_slot_index = 2;
1720}
1721
Andrew Chantb56388b2018-03-22 21:07:33 -07001722/**
1723 * Logs the VID and PID of any connected USB devices.
1724 *
1725 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1726 *
1727 * Logged by Vendor.
1728 */
1729message UsbDeviceAttached {
1730 optional int32 vid = 1;
1731 optional int32 pid = 2;
1732 optional bool has_audio = 3;
1733 optional bool has_hid = 4;
1734 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001735 enum State {
1736 STATE_DISCONNECTED = 0;
1737 STATE_CONNECTED = 1;
1738 }
1739 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001740 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001741}
1742
Tej Singheee317b2018-03-07 19:28:05 -08001743
Tej Singhdd7bd352018-02-09 19:33:15 -08001744/**
Tej Singh5d991e12018-03-09 19:48:11 -08001745 * Logs when Bluetooth is enabled and disabled.
1746 *
1747 * Logged from:
1748 * services/core/java/com/android/server/BluetoothManagerService.java
1749 */
1750message BluetoothEnabledStateChanged {
1751 repeated AttributionNode attribution_node = 1;
1752 // Whether or not bluetooth is enabled on the device.
1753 enum State {
1754 UNKNOWN = 0;
1755 ENABLED = 1;
1756 DISABLED = 2;
1757 }
1758 optional State state = 2;
1759 // The reason for being enabled/disabled.
1760 // Eg. Airplane mode, crash, application request.
1761 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1762 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001763 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001764}
1765
1766/**
Jack Hed9837c82019-01-09 01:19:13 -08001767 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001768 *
1769 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001770 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1771 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001772 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001773 */
1774message BluetoothConnectionStateChanged {
1775 // The state of the connection.
1776 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1777 optional android.bluetooth.ConnectionStateEnum state = 1;
1778 // An identifier that can be used to match connect and disconnect events.
1779 // Currently is last two bytes of a hash of a device level ID and
1780 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001781 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001782 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001783 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1784 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001785 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001786 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001787 // An identifier that can be used to match events for this device.
1788 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1789 // Salt: Randomly generated 256 bit value
1790 // Hash algorithm: HMAC-SHA256
1791 // Size: 32 byte
1792 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001793 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001794 // An identifier that can be used to match events for this device.
1795 // The incremental identifier is locally generated and guaranteed not derived
1796 // from any globally unique hardware id.
1797 // For paired devices, it stays consistent between Bluetooth toggling for the
1798 // same remote device.
1799 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1800 // session for the same remote device.
1801 // Default: 0 if the device's metric id is unknown.
1802 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001803}
1804
1805/**
1806 * Logs when a Bluetooth device connects and disconnects over ACL
1807 *
1808 * Logged from:
1809 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1810 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001811 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001812 */
1813message BluetoothAclConnectionStateChanged {
1814 // An identifier that can be used to match events for this device.
1815 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1816 // Salt: Randomly generated 256 bit value
1817 // Hash algorithm: HMAC-SHA256
1818 // Size: 32 byte
1819 // Default: null or empty if the device identifier is not known
1820 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1821 // The state of the connection.
1822 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1823 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001824 // An identifier that can be used to match events for this device.
1825 // The incremental identifier is locally generated and guaranteed not derived
1826 // from any globally unique hardware id.
1827 // For paired devices, it stays consistent between Bluetooth toggling for the
1828 // same remote device.
1829 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1830 // session for the same remote device.
1831 // Default: 0 if the device's metric id is unknown.
1832 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001833}
1834
1835/**
1836 * Logs when a Bluetooth device connects and disconnects over SCO
1837 *
1838 * Logged from:
1839 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1840 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1841 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001842 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001843 */
1844message BluetoothScoConnectionStateChanged {
1845 // An identifier that can be used to match events for this device.
1846 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1847 // Salt: Randomly generated 256 bit value
1848 // Hash algorithm: HMAC-SHA256
1849 // Size: 32 byte
1850 // Default: null or empty if the device identifier is not known
1851 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1852 // The state of the connection.
1853 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1854 optional android.bluetooth.ConnectionStateEnum state = 2;
1855 // Codec used for this SCO connection
1856 // Default: UNKNOWN
1857 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001858 // An identifier that can be used to match events for this device.
1859 // The incremental identifier is locally generated and guaranteed not derived
1860 // from any globally unique hardware id.
1861 // For paired devices, it stays consistent between Bluetooth toggling for the
1862 // same remote device.
1863 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1864 // session for the same remote device.
1865 // Default: 0 if the device's metric id is unknown.
1866 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001867}
1868
Jack Hec27040a2019-01-09 20:54:41 -08001869/**
1870 * Logged when active device of a profile changes
1871 *
1872 * Logged from:
1873 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1874 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1875 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1876 */
1877message BluetoothActiveDeviceChanged {
1878 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1879 // From android.bluetooth.BluetoothProfile
1880 optional int32 bt_profile = 1;
1881 // An identifier that can be used to match events for this new active device.
1882 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1883 // Salt: Randomly generated 256 bit value
1884 // Hash algorithm: HMAC-SHA256
1885 // Size: 32 byte
1886 // Default: null or empty if there is no active device for this profile
1887 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001888 // An identifier that can be used to match events for this device.
1889 // The incremental identifier is locally generated and guaranteed not derived
1890 // from any globally unique hardware id.
1891 // For paired devices, it stays consistent between Bluetooth toggling for the
1892 // same remote device.
1893 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1894 // session for the same remote device.
1895 // Default: 0 if the device's metric id is unknown.
1896 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001897}
1898
Jack Heab86dbd22018-12-18 15:43:27 -08001899// Logs when there is an event affecting Bluetooth device's link layer connection.
1900// - This event is triggered when there is a related HCI command or event
1901// - Users of this metrics can deduce Bluetooth device's connection state from these events
1902// - HCI commands are logged before the command is sent, after receiving command status, and after
1903// receiving command complete
1904// - HCI events are logged when they arrive
1905//
1906// Low level log from system/bt
1907//
1908// Bluetooth classic commands:
1909// - CMD_CREATE_CONNECTION
1910// - CMD_DISCONNECT
1911// - CMD_CREATE_CONNECTION_CANCEL
1912// - CMD_ACCEPT_CONNECTION_REQUEST
1913// - CMD_REJECT_CONNECTION_REQUEST
1914// - CMD_SETUP_ESCO_CONNECTION
1915// - CMD_ACCEPT_ESCO_CONNECTION
1916// - CMD_REJECT_ESCO_CONNECTION
1917// - CMD_ENH_SETUP_ESCO_CONNECTION
1918// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1919//
1920// Bluetooth low energy commands:
1921// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1922// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1923// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1924// - CMD_BLE_CLEAR_WHITE_LIST
1925// - CMD_BLE_ADD_WHITE_LIST
1926// - CMD_BLE_REMOVE_WHITE_LIST
1927//
1928// Bluetooth classic events:
1929// - EVT_CONNECTION_COMP
1930// - EVT_CONNECTION_REQUEST
1931// - EVT_DISCONNECTION_COMP
1932// - EVT_ESCO_CONNECTION_COMP
1933// - EVT_ESCO_CONNECTION_CHANGED
1934//
1935// Bluetooth low energy meta events:
1936// - BLE_EVT_CONN_COMPLETE_EVT
1937// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1938//
1939// Next tag: 10
1940message BluetoothLinkLayerConnectionEvent {
1941 // An identifier that can be used to match events for this device.
1942 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1943 // Salt: Randomly generated 256 bit value
1944 // Hash algorithm: HMAC-SHA256
1945 // Size: 32 byte
1946 // Default: null or empty if the device identifier is not known
1947 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1948 // Connection handle of this connection if available
1949 // Range: 0x0000 - 0x0EFF (12 bits)
1950 // Default: 0xFFFF if the handle is unknown
1951 optional int32 connection_handle = 2;
1952 // Direction of the link
1953 // Default: DIRECTION_UNKNOWN
1954 optional android.bluetooth.DirectionEnum direction = 3;
1955 // Type of this link
1956 // Default: LINK_TYPE_UNKNOWN
1957 optional android.bluetooth.LinkTypeEnum type = 4;
1958
1959 // Reason metadata for this link layer connection event, rules for interpretation:
1960 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1961 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1962 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1963 // set and valid, ignore hci_ble_event
1964
1965 // HCI command associated with this event
1966 // Default: CMD_UNKNOWN
1967 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1968 // HCI event associated with this event
1969 // Default: EVT_UNKNOWN
1970 optional android.bluetooth.hci.EventEnum hci_event = 6;
1971 // HCI BLE meta event associated with this event
1972 // Default: BLE_EVT_UNKNOWN
1973 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1974 // HCI command status code if this is triggerred by hci_cmd
1975 // Default: STATUS_UNKNOWN
1976 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1977 // HCI reason code associated with this event
1978 // Default: STATUS_UNKNOWN
1979 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001980 // An identifier that can be used to match events for this device.
1981 // The incremental identifier is locally generated and guaranteed not derived
1982 // from any globally unique hardware id.
1983 // For paired devices, it stays consistent between Bluetooth toggling for the
1984 // same remote device.
1985 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1986 // session for the same remote device.
1987 // Default: 0 if the device's metric id is unknown.
1988 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001989}
1990
Howard Roe103fe22019-01-17 16:52:16 -08001991/**
1992 * Logs when a module is rolled back by Watchdog.
1993 *
1994 * Logged from: Rollback Manager
1995 */
1996message WatchdogRollbackOccurred {
1997 enum RollbackType {
1998 UNKNOWN = 0;
1999 ROLLBACK_INITIATE = 1;
2000 ROLLBACK_SUCCESS = 2;
2001 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002002 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002003 }
2004 optional RollbackType rollback_type = 1;
2005
2006 optional string package_name = 2;
2007
2008 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002009
2010 enum RollbackReasonType {
2011 REASON_UNKNOWN = 0;
2012 REASON_NATIVE_CRASH = 1;
2013 REASON_EXPLICIT_HEALTH_CHECK = 2;
2014 REASON_APP_CRASH = 3;
2015 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002016 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002017 }
2018 optional RollbackReasonType rollback_reason = 4;
2019
2020 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2021 // is initiated. Empty if the package is unknown.
2022 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002023
2024 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002025}
2026
Jack Hec27040a2019-01-09 20:54:41 -08002027/**
2028 * Logs when there is a change in Bluetooth A2DP playback state
2029 *
2030 * Logged from:
2031 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2032 */
2033message BluetoothA2dpPlaybackStateChanged {
2034 // An identifier that can be used to match events for this device.
2035 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2036 // Salt: Randomly generated 256 bit value
2037 // Hash algorithm: HMAC-SHA256
2038 // Size: 32 byte
2039 // Default: null or empty if the device identifier is not known
2040 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2041 // Current playback state
2042 // Default: PLAYBACK_STATE_UNKNOWN
2043 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2044 // Current audio coding mode
2045 // Default: AUDIO_CODING_MODE_UNKNOWN
2046 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002047 // An identifier that can be used to match events for this device.
2048 // The incremental identifier is locally generated and guaranteed not derived
2049 // from any globally unique hardware id.
2050 // For paired devices, it stays consistent between Bluetooth toggling for the
2051 // same remote device.
2052 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2053 // session for the same remote device.
2054 // Default: 0 if the device's metric id is unknown.
2055 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002056}
2057
2058/**
2059 * Logs when there is a change in A2DP codec config for a particular remote device
2060 *
2061 * Logged from:
2062 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2063 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2064 */
2065message BluetoothA2dpCodecConfigChanged {
2066 // An identifier that can be used to match events for this device.
2067 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2068 // Salt: Randomly generated 256 bit value
2069 // Hash algorithm: HMAC-SHA256
2070 // Size: 32 byte
2071 // Default: null or empty if the device identifier is not known
2072 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2073 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2074 // Default SOURCE_CODEC_TYPE_INVALID
2075 optional int32 codec_type = 2;
2076 // Codec priroity, the higher the more preferred, -1 for disabled
2077 // Default: CODEC_PRIORITY_DEFAULT
2078 optional int32 codec_priority = 3;
2079 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2080 // Default: SAMPLE_RATE_NONE
2081 optional int32 sample_rate = 4;
2082 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2083 // Default: BITS_PER_SAMPLE_NONE
2084 optional int32 bits_per_sample = 5;
2085 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2086 // Default: CHANNEL_MODE_NONE
2087 optional int32 channel_mode = 6;
2088 // Codec specific values
2089 // Default 0
2090 optional int64 codec_specific_1 = 7;
2091 optional int64 codec_specific_2 = 8;
2092 optional int64 codec_specific_3 = 9;
2093 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002094 // An identifier that can be used to match events for this device.
2095 // The incremental identifier is locally generated and guaranteed not derived
2096 // from any globally unique hardware id.
2097 // For paired devices, it stays consistent between Bluetooth toggling for the
2098 // same remote device.
2099 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2100 // session for the same remote device.
2101 // Default: 0 if the device's metric id is unknown.
2102 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002103}
2104
2105/**
2106 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2107 * Each codec's capability is logged separately due to statsd restriction
2108 *
2109 * Logged from:
2110 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2111 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2112 */
2113message BluetoothA2dpCodecCapabilityChanged {
2114 // An identifier that can be used to match events for this device.
2115 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2116 // Salt: Randomly generated 256 bit value
2117 // Hash algorithm: HMAC-SHA256
2118 // Size: 32 byte
2119 // Default: null or empty if the device identifier is not known
2120 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2121 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2122 // Default SOURCE_CODEC_TYPE_INVALID
2123 optional int32 codec_type = 2;
2124 // Codec priroity, the higher the more preferred, -1 for disabled
2125 // Default: CODEC_PRIORITY_DEFAULT
2126 optional int32 codec_priority = 3;
2127 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2128 // in BluetoothCodecConfig
2129 // Default: empty and SAMPLE_RATE_NONE for individual item
2130 optional int32 sample_rate = 4;
2131 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2132 // in BluetoothCodecConfig
2133 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2134 optional int32 bits_per_sample = 5;
2135 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2136 // BluetoothCodecConfig
2137 // Default: empty and CHANNEL_MODE_NONE for individual item
2138 optional int32 channel_mode = 6;
2139 // Codec specific values
2140 // Default 0
2141 optional int64 codec_specific_1 = 7;
2142 optional int64 codec_specific_2 = 8;
2143 optional int64 codec_specific_3 = 9;
2144 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002145 // An identifier that can be used to match events for this device.
2146 // The incremental identifier is locally generated and guaranteed not derived
2147 // from any globally unique hardware id.
2148 // For paired devices, it stays consistent between Bluetooth toggling for the
2149 // same remote device.
2150 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2151 // session for the same remote device.
2152 // Default: 0 if the device's metric id is unknown.
2153 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002154}
2155
2156/**
2157 * Logs when A2DP failed to read from PCM source.
2158 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2159 *
2160 * Logged from:
2161 * system/bt
2162 */
2163message BluetoothA2dpAudioUnderrunReported {
2164 // An identifier that can be used to match events for this device.
2165 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2166 // Salt: Randomly generated 256 bit value
2167 // Hash algorithm: HMAC-SHA256
2168 // Size: 32 byte
2169 // Default: null or empty if the device identifier is not known
2170 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2171 // Encoding interval in nanoseconds
2172 // Default: 0
2173 optional int64 encoding_interval_nanos = 2;
2174 // Number of bytes of PCM data that could not be read from the source
2175 // Default: 0
2176 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002177 // An identifier that can be used to match events for this device.
2178 // The incremental identifier is locally generated and guaranteed not derived
2179 // from any globally unique hardware id.
2180 // For paired devices, it stays consistent between Bluetooth toggling for the
2181 // same remote device.
2182 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2183 // session for the same remote device.
2184 // Default: 0 if the device's metric id is unknown.
2185 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002186}
2187
2188/**
2189 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2190 * buffer queue is full and we have to drop data
2191 *
2192 * Logged from:
2193 * system/bt
2194 */
2195message BluetoothA2dpAudioOverrunReported {
2196 // An identifier that can be used to match events for this device.
2197 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2198 // Salt: Randomly generated 256 bit value
2199 // Hash algorithm: HMAC-SHA256
2200 // Size: 32 byte
2201 // Default: null or empty if the device identifier is not known
2202 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2203 // Encoding interval in nanoseconds
2204 // Default: 0
2205 optional int64 encoding_interval_nanos = 2;
2206 // Number of buffers dropped in this event
2207 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2208 // Default: 0
2209 optional int32 num_dropped_buffers = 3;
2210 // Number of encoded buffers dropped in this event
2211 // Default 0
2212 optional int32 num_dropped_encoded_frames = 4;
2213 // Number of encoded bytes dropped in this event
2214 // Default: 0
2215 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002216 // An identifier that can be used to match events for this device.
2217 // The incremental identifier is locally generated and guaranteed not derived
2218 // from any globally unique hardware id.
2219 // For paired devices, it stays consistent between Bluetooth toggling for the
2220 // same remote device.
2221 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2222 // session for the same remote device.
2223 // Default: 0 if the device's metric id is unknown.
2224 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002225}
2226
2227/**
2228 * Logs when we receive reports regarding a device's RSSI value
2229 *
2230 * Logged from:
2231 * system/bt
2232 */
2233message BluetoothDeviceRssiReported {
2234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
2239 // Default: null or empty if the device identifier is not known
2240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2241 // Connection handle of this connection if available
2242 // Range: 0x0000 - 0x0EFF (12 bits)
2243 // Default: 0xFFFF if the handle is unknown
2244 optional int32 connection_handle = 2;
2245 // HCI command status code if this is triggerred by hci_cmd
2246 // Default: STATUS_UNKNOWN
2247 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2248 // BR/EDR
2249 // Range: -128 ≤ N ≤ 127 (signed integer)
2250 // Units: dB
2251 // LE:
2252 // Range: -127 to 20, 127 (signed integer)
2253 // Units: dBm
2254 // Invalid when an out of range value is reported
2255 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002256 // An identifier that can be used to match events for this device.
2257 // The incremental identifier is locally generated and guaranteed not derived
2258 // from any globally unique hardware id.
2259 // For paired devices, it stays consistent between Bluetooth toggling for the
2260 // same remote device.
2261 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2262 // session for the same remote device.
2263 // Default: 0 if the device's metric id is unknown.
2264 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002265}
2266
2267/**
2268 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2269 *
2270 * Logged from:
2271 * system/bt
2272 */
2273message BluetoothDeviceFailedContactCounterReported {
2274 // An identifier that can be used to match events for this device.
2275 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2276 // Salt: Randomly generated 256 bit value
2277 // Hash algorithm: HMAC-SHA256
2278 // Size: 32 byte
2279 // Default: null or empty if the device identifier is not known
2280 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2281 // Connection handle of this connection if available
2282 // Range: 0x0000 - 0x0EFF (12 bits)
2283 // Default: 0xFFFF if the handle is unknown
2284 optional int32 connection_handle = 2;
2285 // HCI command status code if this is triggerred by hci_cmd
2286 // Default: STATUS_UNKNOWN
2287 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2288 // Number of consecutive failed contacts for a connection corresponding to the Handle
2289 // Range: uint16_t, 0-0xFFFF
2290 // Default: 0xFFFFF
2291 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002292 // An identifier that can be used to match events for this device.
2293 // The incremental identifier is locally generated and guaranteed not derived
2294 // from any globally unique hardware id.
2295 // For paired devices, it stays consistent between Bluetooth toggling for the
2296 // same remote device.
2297 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2298 // session for the same remote device.
2299 // Default: 0 if the device's metric id is unknown.
2300 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002301}
2302
2303/**
2304 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2305 *
2306 * Logged from:
2307 * system/bt
2308 */
2309message BluetoothDeviceTxPowerLevelReported {
2310 // An identifier that can be used to match events for this device.
2311 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2312 // Salt: Randomly generated 256 bit value
2313 // Hash algorithm: HMAC-SHA256
2314 // Size: 32 byte
2315 // Default: null or empty if the device identifier is not known
2316 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2317 // Connection handle of this connection if available
2318 // Range: 0x0000 - 0x0EFF (12 bits)
2319 // Default: 0xFFFF if the handle is unknown
2320 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002321 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002322 // Default: STATUS_UNKNOWN
2323 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2324 // Range: -30 ≤ N ≤ 20
2325 // Units: dBm
2326 // Invalid when an out of range value is reported
2327 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002328 // An identifier that can be used to match events for this device.
2329 // The incremental identifier is locally generated and guaranteed not derived
2330 // from any globally unique hardware id.
2331 // For paired devices, it stays consistent between Bluetooth toggling for the
2332 // same remote device.
2333 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2334 // session for the same remote device.
2335 // Default: 0 if the device's metric id is unknown.
2336 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002337}
Jack Heab86dbd22018-12-18 15:43:27 -08002338
Tej Singh5d991e12018-03-09 19:48:11 -08002339/**
Jack He1021a612019-01-20 21:22:46 -08002340 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2341 * receiving an HCI command from the host
2342 *
2343 * Logged from: system/bt
2344 */
2345message BluetoothHciTimeoutReported {
2346 // HCI command associated with this event
2347 // Default: CMD_UNKNOWN
2348 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2349}
2350
2351/**
2352 * Logs when we receive Bluetooth Link Quality Report event from the controller
2353 * See Android Bluetooth HCI specification for more details
2354 *
2355 * Note: all count and bytes field are counted since last event
2356 *
2357 * Logged from: system/bt
2358 */
2359message BluetoothQualityReportReported {
2360 // Quality report ID
2361 // Original type: uint8_t
2362 // Default: BQR_ID_UNKNOWN
2363 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2364 // Packet type of the connection
2365 // Original type: uint8_t
2366 // Default: BQR_PACKET_TYPE_UNKNOWN
2367 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2368 // Connection handle of the connection
2369 // Original type: uint16_t
2370 optional int32 connection_handle = 3;
2371 // Performing Role for the connection
2372 // Original type: uint8_t
2373 optional int32 connection_role = 4;
2374 // Current Transmit Power Level for the connection. This value is the same as the controller's
2375 // response to the HCI_Read_Transmit_Power_Level HCI command
2376 // Original type: uint8_t
2377 optional int32 tx_power_level = 5;
2378 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2379 // absolute receiver signal strength value
2380 // Original type: int8_t
2381 optional int32 rssi = 6;
2382 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2383 // channels used by the link currently
2384 // Original type: uint8_t
2385 optional int32 snr = 7;
2386 // Indicates the number of unused channels in AFH_channel_map
2387 // Original type: uint8_t
2388 optional int32 unused_afh_channel_count = 8;
2389 // Indicates the number of the channels which are interfered and quality is bad but are still
2390 // selected for AFH
2391 // Original type: uint8_t
2392 optional int32 afh_select_unideal_channel_count = 9;
2393 // Current Link Supervision Timeout Setting
2394 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2395 // Original type: uint16_t
2396 optional int32 lsto = 10;
2397 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2398 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2399 // 0x01 (Piconet Clock)
2400 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2401 // Original type: uint32_t
2402 optional int64 connection_piconet_clock = 11;
2403 // The count of retransmission
2404 // Original type: uint32_t
2405 optional int64 retransmission_count = 12;
2406 // The count of no RX
2407 // Original type: uint32_t
2408 optional int64 no_rx_count = 13;
2409 // The count of NAK (Negative Acknowledge)
2410 // Original type: uint32_t
2411 optional int64 nak_count = 14;
2412 // Controller timestamp of last TX ACK
2413 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2414 // Original type: uint32_t
2415 optional int64 last_tx_ack_timestamp = 15;
2416 // The count of Flow-off (STOP)
2417 // Original type: uint32_t
2418 optional int64 flow_off_count = 16;
2419 // Controller timestamp of last Flow-on (GO)
2420 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2421 // Original type: uint32_t
2422 optional int64 last_flow_on_timestamp = 17;
2423 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2424 // Original type: uint32_t
2425 optional int64 buffer_overflow_bytes = 18;
2426 // Buffer underflow count (in byte) since last event
2427 // Original type: uint32_t
2428 optional int64 buffer_underflow_bytes = 19;
2429}
2430
2431/**
2432 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2433 *
2434 * Notes:
2435 * - Each event can be partially filled as we might learn different pieces of device
2436 * information at different time
2437 * - Multiple device info events can be combined to give more complete picture
2438 * - When multiple device info events tries to describe the same information, the
2439 * later one wins
2440 *
2441 * Logged from:
2442 * packages/apps/Bluetooth
2443 */
Jack Heaea26982019-04-04 11:19:48 -07002444message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002445 // An identifier that can be used to match events for this device.
2446 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2447 // Salt: Randomly generated 256 bit value
2448 // Hash algorithm: HMAC-SHA256
2449 // Size: 32 byte
2450 // Default: null or empty if the device identifier is not known
2451 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2452 // Where is this device info obtained from
2453 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2454 // Name of the data source
2455 // For EXTERNAL: package name of the data source
2456 // For INTERNAL: null for general case, component name otherwise
2457 optional string source_name = 3;
2458 // Name of the manufacturer of this device
2459 optional string manufacturer = 4;
2460 // Model of this device
2461 optional string model = 5;
2462 // Hardware version of this device
2463 optional string hardware_version = 6;
2464 // Software version of this device
2465 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002466 // An identifier that can be used to match events for this device.
2467 // The incremental identifier is locally generated and guaranteed not derived
2468 // from any globally unique hardware id.
2469 // For paired devices, it stays consistent between Bluetooth toggling for the
2470 // same remote device.
2471 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2472 // session for the same remote device.
2473 // Default: 0 if the device's metric id is unknown.
2474 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002475}
2476
2477/**
2478 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2479 * device, as documented by the Bluetooth Core HCI specification
2480 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2481 * Vol 2, Part E, Page 1118
2482 *
2483 * Logged from:
2484 * system/bt
2485 */
2486message BluetoothRemoteVersionInfoReported {
2487 // Connection handle of the connection
2488 // Original type: uint16_t
2489 optional int32 connection_handle = 1;
2490 // HCI command status code
2491 // Default: STATUS_UNKNOWN
2492 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2493 // 1 byte Version of current LMP in the remote controller
2494 optional int32 lmp_version = 3;
2495 // 2 bytes LMP manufacturer code of the remote controller
2496 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2497 optional int32 lmp_manufacturer_code = 4;
2498 // 4 bytes subversion of the LMP in the remote controller
2499 optional int32 lmp_subversion = 5;
2500}
2501
2502/**
2503 * Logs when certain Bluetooth SDP attributes are discovered
2504 * Constant definitions are from:
2505 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2506 *
2507 * Current logged attributes:
2508 * - BluetoothProfileDescriptorList
2509 * - Supported Features Bitmask
2510 *
2511 * Logged from:
2512 * system/bt
2513 */
2514message BluetoothSdpAttributeReported {
2515 // An identifier that can be used to match events for this device.
2516 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2517 // Salt: Randomly generated 256 bit value
2518 // Hash algorithm: HMAC-SHA256
2519 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2520 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2521 // Original type: uint16_t
2522 optional int32 protocol_uuid = 2;
2523 // Short form UUIDs used to identify Bluetooth SDP attribute types
2524 // Original type: uint16_t
2525 optional int32 attribute_id = 3;
2526 // Attribute value for the particular attribute
2527 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002528 // An identifier that can be used to match events for this device.
2529 // The incremental identifier is locally generated and guaranteed not derived
2530 // from any globally unique hardware id.
2531 // For paired devices, it stays consistent between Bluetooth toggling for the
2532 // same remote device.
2533 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2534 // session for the same remote device.
2535 // Default: 0 if the device's metric id is unknown.
2536 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002537}
2538
2539/**
2540 * Logs when bond state of a Bluetooth device changes
2541 *
2542 * Logged from:
2543 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2544 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2545 */
2546message BluetoothBondStateChanged {
2547 // An identifier that can be used to match events for this device.
2548 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2549 // Salt: Randomly generated 256 bit value
2550 // Hash algorithm: HMAC-SHA256
2551 // Size: 32 byte
2552 // Default: null or empty if the device identifier is not known
2553 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2554 // Preferred transport type to remote dual mode device
2555 // Default: TRANSPORT_AUTO means no preference
2556 optional android.bluetooth.TransportTypeEnum transport = 2;
2557 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2558 // Default: UNKNOWN
2559 optional android.bluetooth.DeviceTypeEnum type = 3;
2560 // Current bond state (NONE, BONDING, BONDED)
2561 // Default: BOND_STATE_UNKNOWN
2562 optional android.bluetooth.BondStateEnum bond_state = 4;
2563 // Bonding sub state
2564 // Default: BOND_SUB_STATE_UNKNOWN
2565 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2566 // Unbond Reason
2567 // Default: UNBOND_REASON_UNKNOWN
2568 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002569 // An identifier that can be used to match events for this device.
2570 // The incremental identifier is locally generated and guaranteed not derived
2571 // from any globally unique hardware id.
2572 // For paired devices, it stays consistent between Bluetooth toggling for the
2573 // same remote device.
2574 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2575 // session for the same remote device.
2576 // Default: 0 if the device's metric id is unknown.
2577 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002578}
2579
2580/**
2581 * Logs there is an event related Bluetooth classic pairing
2582 *
2583 * Logged from:
2584 * system/bt
2585 */
2586message BluetoothClassicPairingEventReported {
2587 // An identifier that can be used to match events for this device.
2588 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2589 // Salt: Randomly generated 256 bit value
2590 // Hash algorithm: HMAC-SHA256
2591 // Size: 32 byte
2592 // Default: null or empty if the device identifier is not known
2593 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2594 // Connection handle of this connection if available
2595 // Range: 0x0000 - 0x0EFF (12 bits)
2596 // Default: 0xFFFF if the handle is unknown
2597 optional int32 connection_handle = 2;
2598 // HCI command associated with this event
2599 // Default: CMD_UNKNOWN
2600 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2601 // HCI event associated with this event
2602 // Default: EVT_UNKNOWN
2603 optional android.bluetooth.hci.EventEnum hci_event = 4;
2604 // HCI command status code if this is triggerred by hci_cmd
2605 // Default: STATUS_UNKNOWN
2606 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2607 // HCI reason code associated with this event
2608 // Default: STATUS_UNKNOWN
2609 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002610 // A status value related to this specific event
2611 // Default: 0
2612 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002613 // An identifier that can be used to match events for this device.
2614 // The incremental identifier is locally generated and guaranteed not derived
2615 // from any globally unique hardware id.
2616 // For paired devices, it stays consistent between Bluetooth toggling for the
2617 // same remote device.
2618 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2619 // session for the same remote device.
2620 // Default: 0 if the device's metric id is unknown.
2621 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002622}
2623
2624/**
2625 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2626 *
2627 * Logged from:
2628 * system/bt
2629 */
2630message BluetoothSmpPairingEventReported {
2631 // An identifier that can be used to match events for this device.
2632 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2633 // Salt: Randomly generated 256 bit value
2634 // Hash algorithm: HMAC-SHA256
2635 // Size: 32 byte
2636 // Default: null or empty if the device identifier is not known
2637 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2638 // SMP command sent or received over L2CAP
2639 // Default: CMD_UNKNOWN
2640 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2641 // Whether this command is sent or received
2642 // Default: DIRECTION_UNKNOWN
2643 optional android.bluetooth.DirectionEnum direction = 3;
2644 // SMP failure reason code
2645 // Default: PAIRING_FAIL_REASON_DEFAULT
2646 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002647 // An identifier that can be used to match events for this device.
2648 // The incremental identifier is locally generated and guaranteed not derived
2649 // from any globally unique hardware id.
2650 // For paired devices, it stays consistent between Bluetooth toggling for the
2651 // same remote device.
2652 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2653 // session for the same remote device.
2654 // Default: 0 if the device's metric id is unknown.
2655 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002656}
2657
2658/**
Jack He815cdba2019-01-30 17:24:55 -08002659 * Logs when a Bluetooth socket’s connection state changed
2660 *
2661 * Logged from:
2662 * system/bt
2663 */
2664message BluetoothSocketConnectionStateChanged {
2665 // An identifier that can be used to match events for this device.
2666 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2667 // Salt: Randomly generated 256 bit value
2668 // Hash algorithm: HMAC-SHA256
2669 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002670 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002671 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002672 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002673 // Default 0 when unknown or don't care
2674 optional int32 port = 2;
2675 // Socket type as mentioned in
2676 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2677 // Default: SOCKET_TYPE_UNKNOWN
2678 optional android.bluetooth.SocketTypeEnum type = 3;
2679 // Socket connection state
2680 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2681 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2682 // Number of bytes sent to remote device during this connection
2683 optional int64 tx_bytes = 5;
2684 // Number of bytes received from remote device during this connection
2685 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002686 // Socket owner's UID
2687 optional int32 uid = 7 [(is_uid) = true];
2688 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2689 // |port| must be spawned by |server_port|
2690 // Default 0 when unknown or don't care
2691 optional int32 server_port = 8;
2692 // Whether this is a server listener socket
2693 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002694 // An identifier that can be used to match events for this device.
2695 // The incremental identifier is locally generated and guaranteed not derived
2696 // from any globally unique hardware id.
2697 // For paired devices, it stays consistent between Bluetooth toggling for the
2698 // same remote device.
2699 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2700 // session for the same remote device.
2701 // Default: 0 if the device's metric id is unknown.
2702 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002703}
2704
2705/**
Jack He71426802019-04-02 13:32:52 -07002706 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2707 *
2708 * Logged from:
2709 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2710 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2711 *
2712 */
2713message BluetoothClassOfDeviceReported {
2714 // An identifier that can be used to match events for this device.
2715 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2716 // Salt: Randomly generated 256 bit value
2717 // Hash algorithm: HMAC-SHA256
2718 // Size: 32 byte
2719 // Default: null or empty if this is a server listener socket
2720 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2721 // Class of Device (CoD) value including both Major, Minor device class and service class
2722 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2723 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2724 // Default: 0
2725 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002726 // An identifier that can be used to match events for this device.
2727 // The incremental identifier is locally generated and guaranteed not derived
2728 // from any globally unique hardware id.
2729 // For paired devices, it stays consistent between Bluetooth toggling for the
2730 // same remote device.
2731 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2732 // session for the same remote device.
2733 // Default: 0 if the device's metric id is unknown.
2734 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002735}
2736
2737/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002738 * Logs when something is plugged into or removed from the USB-C connector.
2739 *
2740 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002741 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002742 */
2743message UsbConnectorStateChanged {
2744 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002745 STATE_DISCONNECTED = 0;
2746 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002747 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002748 optional State state = 1
2749 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2750 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002751 // Last active session in ms.
2752 // 0 when the port is in connected state.
2753 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002754}
2755
2756/**
2757 * Logs the reported speaker impedance.
2758 *
2759 * Logged from:
2760 * Vendor audio implementation.
2761 */
2762message SpeakerImpedanceReported {
2763 optional int32 speaker_location = 1;
2764 optional int32 impedance = 2;
2765}
2766
2767/**
2768 * Logs the report of a failed hardware.
2769 *
2770 * Logged from:
2771 * Vendor HALs.
2772 *
2773 */
2774message HardwareFailed {
2775 enum HardwareType {
2776 HARDWARE_FAILED_UNKNOWN = 0;
2777 HARDWARE_FAILED_MICROPHONE = 1;
2778 HARDWARE_FAILED_CODEC = 2;
2779 HARDWARE_FAILED_SPEAKER = 3;
2780 HARDWARE_FAILED_FINGERPRINT = 4;
2781 }
2782 optional HardwareType hardware_type = 1;
2783
Maggie White6dcd8572019-01-31 14:11:50 -08002784 /**
2785 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002786 * the same hardware_type. The specific locations are vendor defined integers,
2787 * referring to board-specific numbering schemes.
2788 */
2789 optional int32 hardware_location = 2;
2790
Maggie White6dcd8572019-01-31 14:11:50 -08002791 /**
2792 * failure_code is specific to the HardwareType of the failed hardware.
2793 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002794 */
Maggie White6dcd8572019-01-31 14:11:50 -08002795 enum HardwareErrorCode {
2796 UNKNOWN = 0;
2797 COMPLETE = 1;
2798 SPEAKER_HIGH_Z = 2;
2799 SPEAKER_SHORT = 3;
2800 FINGERPRINT_SENSOR_BROKEN = 4;
2801 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002802 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002803 }
2804 optional int32 failure_code = 3;
2805}
2806
2807/**
2808 * Log an event when the device has been physically dropped.
2809 * Reported from the /vendor partition.
2810 */
2811message PhysicalDropDetected {
2812 // Confidence that the event was actually a drop, 0 -> 100
2813 optional int32 confidence_pctg = 1;
2814 // Peak acceleration of the drop, in 1/1000s of a g.
2815 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002816 // Duration of freefall in ms
2817 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002818}
2819
2820/**
2821 * Log bucketed battery charge cycles.
2822 *
2823 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002824 * a given charge point. For example, if 10 cycle buckets are
2825 * initialized, bucket 1 is the lowest 1/10th of the battery,
2826 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002827 *
2828 * Logged from:
2829 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2830 */
2831message ChargeCyclesReported {
2832 optional int32 cycle_bucket_1 = 1;
2833 optional int32 cycle_bucket_2 = 2;
2834 optional int32 cycle_bucket_3 = 3;
2835 optional int32 cycle_bucket_4 = 4;
2836 optional int32 cycle_bucket_5 = 5;
2837 optional int32 cycle_bucket_6 = 6;
2838 optional int32 cycle_bucket_7 = 7;
2839 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002840 optional int32 cycle_bucket_9 = 9;
2841 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002842}
2843
2844/**
Howard Roa46b6582018-09-18 16:45:02 -07002845 * Log battery health snapshot.
2846 *
2847 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2848 * are snapshotted periodically over 24hrs.
2849 */
2850message BatteryHealthSnapshot {
2851 enum BatterySnapshotType {
2852 UNKNOWN = 0;
2853 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2854 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2855 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2856 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2857 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2858 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2859 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2860 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2861 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2862 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2863 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2864 }
2865 optional BatterySnapshotType type = 1;
2866 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002867 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002868 // Voltage Battery Voltage, in microVolts.
2869 optional int32 voltage_micro_volt = 3;
2870 // Current Battery current, in microAmps.
2871 optional int32 current_micro_amps = 4;
2872 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2873 optional int32 open_circuit_micro_volt = 5;
2874 // Resistance Battery Resistance, in microOhms.
2875 optional int32 resistance_micro_ohm = 6;
2876 // Level Battery Level, as % of full.
2877 optional int32 level_percent = 7;
2878}
2879
2880/**
2881 * Log slow I/O operations on the primary storage.
2882 */
2883message SlowIo {
2884 // Classifications of IO Operations.
2885 enum IoOperation {
2886 UNKNOWN = 0;
2887 READ = 1;
2888 WRITE = 2;
2889 UNMAP = 3;
2890 SYNC = 4;
2891 }
2892 optional IoOperation operation = 1;
2893
2894 // The number of slow IO operations of this type over 24 hours.
2895 optional int32 count = 2;
2896}
2897
2898/**
2899 * Log battery caused shutdown with the last recorded voltage.
2900 */
2901message BatteryCausedShutdown {
2902 // The last recorded battery voltage prior to shutdown.
2903 optional int32 last_recorded_micro_volt = 1;
2904}
2905
2906/**
Tej Singha72344992019-04-17 18:55:08 -07002907 * Logs when ThermalService receives throttling events.
2908 *
2909 * Logged from:
2910 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2911 */
2912message ThermalThrottlingSeverityStateChanged {
2913 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2914 optional android.os.TemperatureTypeEnum sensor_type = 1;
2915
2916 // The name of the temperature source. Eg. CPU0
2917 optional string sensor_name = 2;
2918
2919 // Temperature in tenths of a degree C.
2920 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2921 optional int32 temperature_deci_celsius = 3;
2922
2923 // Relative severity of the throttling, see enum definition.
2924 optional android.os.ThrottlingSeverityEnum severity = 4;
2925}
2926
2927/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002928 * Logs the duration of a davey (jank of >=700ms) when it occurs
2929 *
2930 * Logged from:
2931 * frameworks/base/libs/hwui/JankTracker.cpp
2932 */
2933message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002934 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002935 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002936
Tej Singhbb8554a2018-01-26 11:59:14 -08002937 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002938 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002939}
2940
2941/**
Bookatze5885242017-10-24 20:10:31 -07002942 * Logs phone signal strength changes.
2943 *
2944 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002945 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002946 */
2947message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002948 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2949 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002950}
2951
Yangster4ccebea2018-10-09 17:09:02 -07002952
2953/**
2954 * Logs when the phone state, sim state or signal strength changes
2955 *
2956 * Logged from:
2957 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2958 */
2959message PhoneServiceStateChanged {
2960 optional android.telephony.ServiceStateEnum state = 1;
2961 optional android.telephony.SimStateEnum sim_state = 2;
2962 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2963}
2964
2965/**
2966 * Logs when the phone becomes on or off.
2967 *
2968 * Logged from:
2969 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2970 */
2971message PhoneStateChanged {
2972 enum State {
2973 OFF = 0;
2974 ON = 1;
2975 }
2976 optional State state = 1;
2977}
2978
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002979message BackGesture {
2980 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002981 DEFAULT_BACK_TYPE = 0;
2982 COMPLETED = 1;
2983 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2984 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2985 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2986 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2987 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2988 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2989 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002990 }
2991 optional BackType type = 1;
2992
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002993 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2994 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2995 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2996 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2997 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2998 optional int32 left_boundary = 8; // left edge width + left inset
2999 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3000
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003001 enum WindowHorizontalLocation {
3002 DEFAULT_LOCATION = 0;
3003 LEFT = 1;
3004 RIGHT = 2;
3005 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003006 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003007}
3008
3009message ExclusionRectStateChanged {
3010 optional string component_name = 1; // if not available, simply packageName
3011 optional int32 requested_height = 2; // px
3012 optional int32 rejected_height = 3; // px
3013
3014 enum WindowHorizontalLocation {
3015 DEFAULT_LOCATION = 0;
3016 LEFT = 1;
3017 RIGHT = 2;
3018 }
3019 optional WindowHorizontalLocation x_location = 4;
3020 optional bool landscape = 5;
3021 optional bool splitscreen = 6;
3022 optional int32 duration_millis = 7;
3023}
3024
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003025/**
3026 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3027 *
3028 * Logged from:
3029 * packages/apps/Launcher3
3030 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003031message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003032 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003033 optional android.stats.launcher.LauncherState src_state = 2;
3034 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003035 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3036 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3037
3038 // The event id (e.g., app launch, drag and drop, long press)
3039 optional int32 event_id = 6;
3040 // The event's source or target id (e.g., icon, task, button)
3041 optional int32 target_id = 7;
3042 // If the target needs to be tracked, use this id field
3043 optional int32 instance_id = 8;
3044 optional int32 uid = 9 [(is_uid) = true];
3045 optional string package_name = 10;
3046 optional string component_name = 11;
3047
3048 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003049 optional int32 grid_x = 12 [default = -1];
3050 optional int32 grid_y = 13 [default = -1];
3051 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003052
3053 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003054 optional int32 grid_x_parent = 15 [default = -1];
3055 optional int32 grid_y_parent = 16 [default = -1];
3056 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003057
3058 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3059 optional int32 hierarchy = 18;
3060
3061 optional bool is_work_profile = 19;
3062
3063 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003064 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003065
3066 // e.g., folderLabelState can be captured in the following two fields
3067 optional int32 from_state = 21;
3068 optional int32 to_state = 22;
3069
3070 // e.g., autofilled or suggested texts that are not user entered
3071 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003072
3073 // e.g., number of contents inside a container (e.g., icons inside a folder)
3074 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003075}
3076
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003077/**
3078 * Used for snapshot of the HomeScreen UI elements
3079 *
3080 * Logged from:
3081 * packages/apps/Launcher3
3082 */
3083message LauncherStaticLayout {
3084 // The event id (e.g., snapshot, drag and drop)
3085 optional int32 event_id = 1;
3086 // The event's source or target id (e.g., icon, shortcut, widget)
3087 optional int32 target_id = 2;
3088 // If the target needs to be tracked, use this id field
3089 optional int32 instance_id = 3;
3090 optional int32 uid = 4 [(is_uid) = true];
3091 optional string package_name = 5;
3092 optional string component_name = 6;
3093
3094 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003095 optional int32 grid_x = 7 [default = -1];
3096 optional int32 grid_y = 8 [default = -1];
3097 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003098
3099 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003100 // e.g., when used with widgets target, use these values for (span_x, span_y)
3101 optional int32 grid_x_parent = 10 [default = -1];
3102 optional int32 grid_y_parent = 11 [default = -1];
3103 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003104
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003105 // UNKNOWN = 0
3106 // HOTSEAT = 1
3107 // WORKSPACE = 2
3108 // FOLDER_HOTSEAT = 3
3109 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003110 optional int32 hierarchy = 13;
3111
3112 optional bool is_work_profile = 14;
3113
3114 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3115 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003116
3117 // e.g., number of icons inside a folder
3118 optional int32 cardinality = 16;
3119
3120 // e.g., (x, y) span of the widget inside homescreen grid system
3121 optional int32 span_x = 17 [default = 1];
3122 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003123}
3124
3125/**
3126 * Logs when Wallpaper or ThemePicker UI has changed.
3127 *
3128 * Logged from:
3129 * packages/apps/ThemePicker
3130 * packages/apps/WallpaperPicker2
3131 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003132message StyleUIChanged {
3133 optional android.stats.style.Action action = 1;
3134 optional int32 color_package_hash = 2;
3135 optional int32 font_package_hash = 3;
3136 optional int32 shape_package_hash = 4;
3137 optional int32 clock_package_hash = 5;
3138 optional int32 launcher_grid = 6;
3139 optional int32 wallpaper_category_hash = 7;
3140 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003141 optional int32 color_preference = 9;
3142 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003143}
3144
David Chenc28b2bb2017-10-24 12:52:52 -07003145/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003146 * Logs when Settings UI has changed.
3147 *
3148 * Logged from:
3149 * packages/apps/Settings
3150 */
3151message SettingsUIChanged {
3152 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003153 * Where this SettingsUIChange event comes from. For example, if
3154 * it's a PAGE_VISIBLE event, where the page is opened from.
3155 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003156 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003157
3158 /**
3159 * What the UI action is.
3160 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003161 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003162
3163 /**
3164 * Where the action is happening
3165 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003166 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003167
3168 /**
3169 * What preference changed in this event.
3170 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003171 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003172
3173 /**
3174 * The new value of the changed preference.
3175 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003176 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003177}
3178
3179/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003180 * Logs basic timing information about touch events.
3181 * Reported at most every 5 minutes while device is being interacted with.
3182 *
3183 * Logged from:
3184 * frameworks/native/services/inputflinger
3185 */
3186message TouchEventReported {
3187 /**
3188 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003189 * and the standard deviation of the time spent processing touchscreen events
3190 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003191 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003192 * On supported devices, the starting point is taken during the hard interrupt inside the
3193 * kernel touch driver. On all other devices, the starting point is taken inside
3194 * the kernel's input event subsystem upon receipt of the input event.
3195 * The ending point is taken inside InputDispatcher, just after the input event
3196 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003197 */
3198 // Minimum value
3199 optional float latency_min_micros = 1;
3200 // Maximum value
3201 optional float latency_max_micros = 2;
3202 // Average value
3203 optional float latency_mean_micros = 3;
3204 // Standard deviation
3205 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003206 // Number of touch events (input_event) in this report
3207 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003208}
3209
3210/**
Philip Quinn0eded622019-01-29 12:46:28 -08003211 * Logs gesture classification and timing information for touch events.
3212 *
3213 * Logged from:
3214 * frameworks/base/core/java/android/view/GestureDetector.java
3215 * frameworks/base/core/java/android/view/View.java
3216 */
3217message TouchGestureClassified {
3218 // The source of the classification (e.g. Java class name).
3219 optional string source = 1;
3220
3221 enum Classification {
3222 UNKNOWN_CLASSIFICATION = 0;
3223 SINGLE_TAP = 1;
3224 DOUBLE_TAP = 2;
3225 LONG_PRESS = 3;
3226 DEEP_PRESS = 4;
3227 SCROLL = 5;
3228 }
3229 // The classification of the gesture.
3230 optional Classification classification = 2;
3231
3232 // The interval from the start of a touch event stream until the
3233 // classification was made.
3234 optional int32 latency_millis = 3;
3235
3236 // The distance from the location of the first touch event to the
3237 // location of the touch event when the classification was made.
3238 optional float displacement_px = 4;
3239}
3240
3241/**
David Chenc28b2bb2017-10-24 12:52:52 -07003242 * Logs that a setting was updated.
3243 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003244 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003245 * The tag and is_default allow resetting of settings to default values based on the specified
3246 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3247 */
3248message SettingChanged {
3249 // The name of the setting.
3250 optional string setting = 1;
3251
3252 // The change being imposed on this setting. May represent a number, eg "3".
3253 optional string value = 2;
3254
3255 // The new value of this setting. For most settings, this is same as value. For some settings,
3256 // value is +X or -X where X represents an element in a set. For example, if the previous value
3257 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3258 // The +/- feature is currently only used for location_providers_allowed.
3259 optional string new_value = 3;
3260
3261 // The previous value of this setting.
3262 optional string prev_value = 4;
3263
3264 // The tag used with the is_default for resetting sets of settings. This is generally null.
3265 optional string tag = 5;
3266
Bookatz90867622018-01-31 15:05:57 -08003267 // True if this setting with tag should be resettable.
3268 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003269
David Chenbd789912018-03-16 17:19:55 -07003270 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003271 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003272
3273 enum ChangeReason {
3274 UPDATED = 1; // Updated can be an insertion or an update.
3275 DELETED = 2;
3276 }
3277 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003278}
Chenjie Yub3dda412017-10-24 13:41:59 -07003279
Chenjie Yu05013b32017-11-21 10:21:41 -08003280/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003281 * Logs activity going to foreground or background
3282 *
3283 * Logged from:
3284 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3285 */
3286message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003287 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003288 optional string pkg_name = 2;
3289 optional string class_name = 3;
3290
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003291 enum State {
3292 BACKGROUND = 0;
3293 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003294 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003295 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003296}
David Chenc8a43242017-10-17 16:23:28 -07003297
3298/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003299 * Logs when a volume entered low Storage state.
3300 * Logged from:
3301 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3302 */
3303message LowStorageStateChanged {
3304 // Volume that ran out of storage.
3305 optional string volume_description = 1;
3306
3307 enum State {
3308 UNKNOWN = 0;
3309 OFF = 1;
3310 ON = 2;
3311 }
3312 optional State state = 2;
3313}
3314
3315/**
3316 * Logs when an app is downgraded.
3317 * Logged from:
3318 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3319 */
3320message AppDowngraded {
3321 optional string package_name = 1;
3322 // Size of the package (all data) before being downgraded.
3323 optional int64 size_in_bytes_before = 2;
3324 // Size of the package (all data) after being downgraded.
3325 optional int64 size_in_bytes_after = 3;
3326
3327 optional bool aggressive = 4;
3328}
3329
3330/**
3331 * Logs when an app is optimized after being downgraded.
3332 * Logged from:
3333 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3334 */
3335message AppOptimizedAfterDowngraded {
3336 optional string package_name = 1;
3337}
3338
3339/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003340 * Logs whenever an app is installed on external storage.
3341 * Logged from:
3342 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3343 */
3344message AppInstallOnExternalStorageReported {
3345 // The type of external storage.
3346 optional android.stats.storage.ExternalStorageType storage_type = 1;
3347 // The name of the package that is installed on the sd card.
3348 optional string package_name = 2;
3349}
3350
3351/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003352 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003353 * Logged from:
3354 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3355 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003356message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003357 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003358
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003359 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003360
3361 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003362 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003363 optional string process_name = 3;
3364
3365 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003366 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003367
3368 optional string package_name = 5;
3369
3370 enum InstantApp {
3371 UNAVAILABLE = 0;
3372 FALSE = 1;
3373 TRUE = 2;
3374 }
3375 optional InstantApp is_instant_app = 6;
3376
3377 enum ForegroundState {
3378 UNKNOWN = 0;
3379 BACKGROUND = 1;
3380 FOREGROUND = 2;
3381 }
3382 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003383
3384 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003385}
David Chen9e3808c2017-11-20 17:25:34 -08003386
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003387/**
3388 * Logs when a WTF (What a Terrible Failure) happened.
3389 * Logged from:
3390 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3391 */
3392message WTFOccurred {
3393 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003394
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003395 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003396
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003397 // The name of the process.
3398 // system_server if it is not by an app
3399 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003400
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003401 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003402 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003403
3404 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003405}
3406
3407/**
3408 * Logs when system server reports low memory.
3409 * Logged from:
3410 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3411 */
3412message LowMemReported {
3413}
3414
3415/**
3416 * Logs when an app ANR (App Not Responding) occurs.
3417 * Logged from:
3418 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3419 */
3420message ANROccurred {
3421 optional int32 uid = 1 [(is_uid) = true];
3422
3423 optional string process_name = 2;
3424
3425 optional string short_component_name = 3;
3426
3427 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003428
3429 enum InstantApp {
3430 UNAVAILABLE = 0;
3431 FALSE = 1;
3432 TRUE = 2;
3433 }
3434 optional InstantApp is_instant_app = 5;
3435
3436 enum ForegroundState {
3437 UNKNOWN = 0;
3438 BACKGROUND = 1;
3439 FOREGROUND = 2;
3440 }
3441 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003442
3443 optional android.server.ErrorSource error_source = 7;
3444
3445 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003446}
3447
Bookatza7020bd2018-08-28 16:29:35 -07003448/**
3449 * Logs when the vibrator state changes.
3450 * Logged from:
3451 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3452 */
3453message VibratorStateChanged {
3454 repeated AttributionNode attribution_node = 1;
3455
3456 enum State {
3457 OFF = 0;
3458 ON = 1;
3459 }
3460 optional State state = 2;
3461
3462 // Duration (in milliseconds) requested to keep the vibrator on.
3463 // Only applicable for State == ON.
3464 optional int64 duration_millis = 3;
3465}
3466
David Chen0a368b22017-12-06 16:28:16 -08003467/*
3468 * Allows other apps to push events into statsd.
3469 * Logged from:
3470 * frameworks/base/core/java/android/util/StatsLog.java
3471 */
David Chen0b5c90c2018-01-25 16:51:49 -08003472message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003473 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003474 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003475
3476 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3477 optional int32 label = 2;
3478
3479 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3480 // predicates for the metrics).
3481 enum State {
3482 UNKNOWN = 0;
3483 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3484 STOP = 2;
3485 START = 3;
3486 }
3487 optional State state = 3;
3488}
3489
David Chen9e3808c2017-11-20 17:25:34 -08003490/**
Bookatz7948c872018-09-04 12:58:33 -07003491 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3492 * For example, this could be due to the user manually changing the time.
3493 *
3494 * Logged from:
3495 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3496 */
3497message WallClockTimeShifted {
3498 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3499 optional int64 wall_clock_timestamp_millis = 1;
3500}
3501
3502/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003503 * Logs when statsd detects an anomaly.
3504 *
3505 * Logged from:
3506 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3507 */
3508message AnomalyDetected {
3509 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003510 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003511
Yangster-mac94e197c2018-01-02 16:03:03 -08003512 // Id of the config whose anomaly detection alert fired.
3513 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003514
Yangster-mac94e197c2018-01-02 16:03:03 -08003515 // Id of the alert (i.e. name of the anomaly that was detected).
3516 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003517}
3518
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003519message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003520 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003521 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003522
3523 // The app package name.
3524 optional string pkg_name = 2;
3525
3526 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003527 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003528 WARM = 1;
3529 HOT = 2;
3530 COLD = 3;
3531 }
3532 // The transition type.
3533 optional TransitionType type = 3;
3534
3535 // The activity name.
3536 optional string activity_name = 4;
3537
3538 // The name of the calling app. Empty if not set.
3539 optional string calling_pkg_name = 5;
3540
3541 // Whether the app is an instant app.
3542 optional bool is_instant_app = 6;
3543
3544 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003545 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003546
Bookatz80d11a02018-01-16 10:46:35 -08003547 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003548
David Chen0b5c90c2018-01-25 16:51:49 -08003549 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003550 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003551 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003552 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003553 optional int32 bind_application_delay_millis = 11;
3554 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003555
3556 // Empty if not set.
3557 optional string launch_token = 13;
3558
Calin Juravle759fbda2018-02-20 19:52:30 +00003559 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003560 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003561
3562 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003563 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003564}
3565
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003566message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003568 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003569
3570 // The app package name.
3571 optional string pkg_name = 2;
3572
3573 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003574 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003575 WARM = 1;
3576 HOT = 2;
3577 COLD = 3;
3578 }
3579 // The transition type.
3580 optional TransitionType type = 3;
3581
3582 // The activity name.
3583 optional string activity_name = 4;
3584}
3585
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003586message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003587 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003588 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003589
3590 // The app package name.
3591 optional string pkg_name = 2;
3592
3593 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003594 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003595 WITH_BUNDLE = 1;
3596 WITHOUT_BUNDLE = 2;
3597 }
3598 // The transition type.
3599 optional TransitionType type = 3;
3600
3601 // The activity name.
3602 optional string activity_name = 4;
3603
3604 optional bool transition_process_running = 5;
3605
3606 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003607 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003608}
3609
Bookatz8fcd09a2017-12-18 13:01:10 -08003610/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003611 * Logs a picture-in-picture action
3612 * Logged from:
3613 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3614 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3615 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3616 */
3617message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003618 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003619 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003620
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003621 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003622
Chenjie Yu52cacc62017-12-08 18:11:45 -08003623 enum State {
3624 ENTERED = 1;
3625 EXPANDED_TO_FULL_SCREEN = 2;
3626 MINIMIZED = 3;
3627 DISMISSED = 4;
3628 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003629 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003630}
3631
3632/**
Chenjie Yue8904192017-12-08 19:12:57 -08003633 * Logs overlay action
3634 * Logged from:
3635 * services/core/java/com/android/server/wm/Session.java
3636 */
3637message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003638 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003639
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003640 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003641
3642 optional bool using_alert_window = 3;
3643
3644 enum State {
3645 ENTERED = 1;
3646 EXITED = 2;
3647 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003648 optional State state = 4
3649 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003650}
3651
Adam Bookatz38767932020-02-05 12:13:40 -08003652/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003653 * Logs foreground service starts and stops.
3654 * Note that this is not when a service starts or stops, but when it is
3655 * considered foreground.
3656 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003657 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003658 */
3659message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003660 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003661 // package_name + "/" + class_name
3662 optional string short_name = 2;
3663
3664 enum State {
3665 ENTER = 1;
3666 EXIT = 2;
3667 }
3668 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003669
3670 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3671 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3672 optional bool allow_while_in_use_permission = 4;
3673}
3674
3675/**
3676 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3677 * A foreground service session is any continuous period during which the uid holds at least one
3678 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3679 * Accesses initiated while the uid is in the TOP state are ignored.
3680 * Sessions with no attempted accesses are not logged.
3681 * Logged from
3682 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3683 */
3684message ForegroundServiceAppOpSessionEnded {
3685 optional int32 uid = 1 [(is_uid) = true];
3686
3687 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003688 // Only following four ops are logged
3689 // COARSE_LOCATION = 0
3690 // FINE_LOCATION = 1
3691 // CAMERA = 26
3692 // RECORD_AUDIO = 27
3693 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003694
3695 // The uid's permission mode for accessing the AppOp during this fgs session.
3696 enum Mode {
3697 MODE_UNKNOWN = 0;
3698 MODE_ALLOWED = 1; // Always allowed
3699 MODE_IGNORED = 2; // Denied
3700 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3701 }
3702 optional Mode app_op_mode = 3;
3703
3704 // Number of times this AppOp was requested and allowed.
3705 optional int32 count_ops_accepted = 4;
3706 // Number of times this AppOp was requested but denied.
3707 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003708}
3709
Chenjie Yue8904192017-12-08 19:12:57 -08003710/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003711 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3712 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3713 * attributed back to the parent (host) uid. One example is Chrome.
3714 *
3715 * Logged from:
3716 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3717 */
3718message IsolatedUidChanged {
3719 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003720 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003721 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003722 optional int32 parent_uid = 1;
3723
3724 optional int32 isolated_uid = 2;
3725
3726 // We expect an isolated uid to be removed before if it's used for another parent uid.
3727 enum Event {
3728 REMOVED = 0;
3729 CREATED = 1;
3730 }
3731 optional Event event = 3;
3732}
3733
3734/*
3735 * Logs the reception of an incoming network packet causing the main system to wake up for
3736 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3737 * and processed by WakeupController.cpp.
3738 */
3739message PacketWakeupOccurred {
3740 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3741 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003742 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003743 // The interface name on which the packet was received.
3744 optional string iface = 2;
3745 // The ethertype value of the packet.
3746 optional int32 ethertype = 3;
3747 // String representation of the destination MAC address of the packet.
3748 optional string destination_hardware_address = 4;
3749 // String representation of the source address of the packet if this was an IP packet.
3750 optional string source_ip = 5;
3751 // String representation of the destination address of the packet if this was an IP packet.
3752 optional string destination_ip = 6;
3753 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3754 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3755 // families.
3756 optional int32 ip_next_header = 7;
3757 // The source port if this was a TCP or UDP packet.
3758 optional int32 source_port = 8;
3759 // The destination port if this was a TCP or UDP packet.
3760 optional int32 destination_port = 9;
3761}
3762
3763/*
3764 * Logs the memory stats for an app on startup.
3765 * Logged from:
3766 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3767 */
3768message AppStartMemoryStateCaptured {
3769 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003770 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003771
3772 // The process name.
3773 optional string process_name = 2;
3774
3775 // The activity name.
3776 optional string activity_name = 3;
3777
3778 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003779 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003780
3781 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003782 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003783
3784 // RSS
3785 optional int64 rss_in_bytes = 6;
3786
3787 // CACHE
3788 optional int64 cache_in_bytes = 7;
3789
3790 // SWAP
3791 optional int64 swap_in_bytes = 8;
3792}
3793
3794/*
3795 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3796 * for LMK event.
3797 * Logged from:
3798 * system/core/lmkd/lmkd.c
3799 */
3800message LmkStateChanged {
3801 enum State {
3802 UNKNOWN = 0;
3803 START = 1;
3804 STOP = 2;
3805 }
3806 optional State state = 1;
3807}
3808
3809/*
3810 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3811 * Logged from:
3812 * system/core/lmkd/lmkd.c
3813 */
3814message LmkKillOccurred {
3815 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003816 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003817
3818 // The process name.
3819 optional string process_name = 2;
3820
3821 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003822 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003823
3824 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003825 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003826
3827 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003828 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003829
3830 // RSS
3831 optional int64 rss_in_bytes = 6;
3832
3833 // CACHE
3834 optional int64 cache_in_bytes = 7;
3835
3836 // SWAP
3837 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003838
3839 // The elapsed real time of start of the process.
3840 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003841
3842 // Min oom adj score considered by lmkd.
3843 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003844}
3845
Rajeev Kumar51b54602018-03-01 12:18:26 -08003846/*
3847 * Logs when the ActivityManagerService detects that an app died.
3848 *
3849 * Logged from:
3850 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3851 */
3852message AppDied {
3853 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003854 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003855}
3856
Howard Ro21a039c2018-08-06 14:55:47 -07003857/**
3858 * An atom for generic metrics logging. Available from Android Q.
3859 */
3860message GenericAtom {
3861 // The uid of the application that sent this custom atom.
3862 optional int32 uid = 1 [(is_uid) = true];
3863
3864 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003865 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003866}
3867
Tej Singhd6d6d772018-09-05 17:41:25 -07003868/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003869 * Atom for simple logging of user interaction and impression events, such as "the user touched
3870 * this button" or "this dialog was displayed".
3871 * Keep the UI event stream clean: don't use for system or background events.
3872 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003873 *
3874 * Logged from:
3875 * frameworks/base/services/core/java/com/android/server/
3876 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003877 */
3878message UiEventReported {
3879 // The event_id.
3880 optional int32 event_id = 1;
3881 // The event's source or target uid and package, if applicable.
3882 // For example, the package posting a notification, or the destination package of a share.
3883 optional int32 uid = 2 [(is_uid) = true];
3884 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003885 // An identifier used to disambiguate which logs refer to a particular instance of some
3886 // UI element. Useful when there might be multiple instances simultaneously active.
3887 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003888}
3889
3890/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003891 * Reports a notification was created or updated.
3892 *
3893 * Logged from:
3894 * frameworks/base/services/core/java/com/android/server/notification/
3895 */
3896message NotificationReported {
3897 // The event_id (as for UiEventReported).
3898 optional int32 event_id = 1;
3899 // The notifying app's uid and package.
3900 optional int32 uid = 2 [(is_uid) = true];
3901 optional string package_name = 3;
3902 // A small system-assigned identifier for the notification.
3903 // Locally probably-unique, but expect collisions across users and/or days.
3904 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003905 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3906 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003907
3908 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003909 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3910 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3911 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003912
3913 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003914 optional string category = 10; // App-assigned notification category (API-defined strings)
3915 optional int32 style = 11; // App-assigned notification style
3916 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003917
3918 // Ordering, importance and interruptiveness
3919
Will Brockman7614f6962020-02-10 19:43:03 -05003920 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003921
Will Brockman7614f6962020-02-10 19:43:03 -05003922 optional android.stats.sysui.NotificationImportance importance = 14;
3923 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003924
3925 enum NotificationImportanceExplanation {
3926 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3927 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3928 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3929 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3930 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3931 // Like _APP, but based on pre-channels priority signal.
3932 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3933 }
3934
Will Brockman7614f6962020-02-10 19:43:03 -05003935 optional NotificationImportanceExplanation importance_source = 16;
3936 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3937 optional NotificationImportanceExplanation importance_initial_source = 18;
3938 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3939 optional int32 assistant_hash = 20;
3940 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003941}
3942
3943message Notification {
3944 // The notifying app's uid and package.
3945 optional int32 uid = 1 [(is_uid) = true];
3946 optional string package_name = 2;
3947 // A small system-assigned identifier for the notification.
3948 optional int32 instance_id = 3;
3949
3950 // Grouping information.
3951 optional int32 group_instance_id = 4;
3952 optional bool is_group_summary = 5;
3953
3954 // The section of the shade that the notification is in.
3955 // See NotificationSectionsManager.PriorityBucket.
3956 enum NotificationSection {
3957 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003958 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003959 SECTION_MEDIA_CONTROLS = 2;
3960 SECTION_PEOPLE = 3;
3961 SECTION_ALERTING = 4;
3962 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003963 }
3964 optional NotificationSection section = 6;
3965}
3966
3967message NotificationList {
3968 repeated Notification notifications = 1; // An ordered sequence of notifications.
3969}
3970
3971/**
3972 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3973 *
3974 * Logged from:
3975 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3976 */
3977message NotificationPanelReported {
3978 // The event_id (as for UiEventReported).
3979 optional int32 event_id = 1;
3980 optional int32 num_notifications = 2;
3981 // The notifications in the panel, in the order that they appear there.
3982 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3983}
3984
3985/**
3986 * Reports a notification channel, or channel group, was created, updated, or deleted.
3987 *
3988 * Logged from:
3989 * frameworks/base/services/core/java/com/android/server/notification/
3990 */
3991message NotificationChannelModified {
3992 // The event_id (as for UiEventReported).
3993 optional int32 event_id = 1;
3994 // The notifying app's uid and package.
3995 optional int32 uid = 2 [(is_uid) = true];
3996 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003997 // Hash of app-assigned notification channel ID or channel-group ID
3998 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003999 // Previous importance setting, if applicable
4000 optional android.stats.sysui.NotificationImportance old_importance = 5;
4001 // New importance setting
4002 optional android.stats.sysui.NotificationImportance importance = 6;
4003}
4004
4005
4006/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004007 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004008 *
4009 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004010 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004011 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004012message BiometricAcquired {
4013 // Biometric modality that was acquired.
4014 optional android.hardware.biometrics.ModalityEnum modality = 1;
4015 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4016 optional int32 user = 2;
4017 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4018 optional bool is_crypto = 3;
4019 // Action that the device is performing. Acquired messages are only expected for enroll and
4020 // authenticate. Other actions may indicate an error.
4021 optional android.hardware.biometrics.ActionEnum action = 4;
4022 // The client that this acquisition was received for.
4023 optional android.hardware.biometrics.ClientEnum client = 5;
4024 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4025 optional int32 acquire_info = 6;
4026 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4027 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004028 // Dictates if this message should trigger additional debugging.
4029 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004030}
4031
4032/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004033 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004034 *
4035 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004036 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004037 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004038message BiometricAuthenticated {
4039 // Biometric modality that was used.
4040 optional android.hardware.biometrics.ModalityEnum modality = 1;
4041 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4042 optional int32 user = 2;
4043 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4044 // storage.
4045 optional bool is_crypto = 3;
4046 // The client that this acquisition was received for.
4047 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004048 // If authentication requires user confirmation. See BiometricPrompt's
4049 // setRequireConfirmation(bool) method.
4050 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004051
Kevin Chyn1741a072019-01-17 11:54:40 -08004052 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004053 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004054 REJECTED = 1;
4055 PENDING_CONFIRMATION = 2;
4056 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004057 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004058
4059 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004060 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004061 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4062 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4063 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4064 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004065 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004066 // Dictates if this message should trigger additional debugging.
4067 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004068}
4069
4070/**
4071 * Logs when a biometric error occurs.
4072 *
4073 * Logged from:
4074 * frameworks/base/services/core/java/com/android/server/biometrics
4075 */
4076message BiometricErrorOccurred {
4077 // Biometric modality that was used.
4078 optional android.hardware.biometrics.ModalityEnum modality = 1;
4079 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4080 optional int32 user = 2;
4081 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4082 optional bool is_crypto = 3;
4083 // Action that the device is performing.
4084 optional android.hardware.biometrics.ActionEnum action = 4;
4085 // The client that this acquisition was received for.
4086 optional android.hardware.biometrics.ClientEnum client = 5;
4087 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4088 // are unique to modality.
4089 optional int32 error_info = 6;
4090 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4091 // by the vendor and not specified by the HIDL interface.
4092 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004093 // Dictates if this message should trigger additional debugging.
4094 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004095 // Time spent during the authentication attempt.
4096 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004097}
4098
4099/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004100 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004101 * Logged from:
4102 * frameworks/base/services/core/java/com/android/server/biometrics
4103 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004104message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004105 // Biometric modality.
4106 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004107 // Type of issue detected.
4108 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004109 // Dictates if this message should trigger additional debugging.
4110 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004111}
Howard Ro688ae182018-09-25 00:09:36 -07004112
joshmccloskey6f952b22019-03-25 20:59:35 -07004113/**
4114 * Logs when a biometric enrollment occurs.
4115 *
4116 * Logged from:
4117 * frameworks/base/services/core/java/com/android/server/biometrics
4118 */
4119message BiometricEnrolled {
4120 // Biometric modality that was used.
4121 optional android.hardware.biometrics.ModalityEnum modality = 1;
4122 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4123 optional int32 user = 2;
4124 // The amount of time the enrollment took in milliseconds.
4125 optional int64 latency_millis = 3;
4126 // Whether or not the enrollment was successful.
4127 optional bool success = 4;
4128}
4129
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004130/*
Tej Singh0d176952019-01-16 19:10:54 -08004131 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004132 */
Tej Singh0d176952019-01-16 19:10:54 -08004133message FlagFlipUpdateOccurred {
4134 // If the event is from a flag config package, specify the package name.
4135 optional string flag_flip_package_name = 1;
4136
4137 // The order id of the package
4138 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004139}
4140
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004141/**
4142 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004143 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004144 */
4145message TrainExperimentIds {
4146 repeated int64 experiment_id = 1;
4147}
4148
Yangster-macb89807e2018-11-15 21:10:57 -08004149/*
4150 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004151 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004152 */
4153message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004154 // Name of the train.
4155 optional string train_name = 1;
4156 // Version code for a "train" of packages that need to be installed atomically
4157 optional int64 train_version_code = 2;
4158 // After installation of this package, device requires a restart.
4159 optional bool requires_staging = 3;
4160 // Rollback should be enabled for this install.
4161 optional bool rollback_enabled = 4;
4162 // Requires low latency monitoring if possible.
4163 optional bool requires_low_latency_monitor = 5;
4164
Yangster-macb89807e2018-11-15 21:10:57 -08004165 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004166 UNKNOWN = 0;
4167 INSTALL_REQUESTED = 1;
4168 INSTALL_STARTED = 2;
4169 INSTALL_STAGED_NOT_READY = 3;
4170 INSTALL_STAGED_READY = 4;
4171 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004172 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4173 // and INSTALL_FAILURE_COMMIT.
4174 INSTALL_FAILURE = 6 [deprecated = true];
4175 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004176 INSTALL_CANCELLED = 7;
4177 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004178 INSTALLER_ROLLBACK_INITIATED = 9;
4179 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4180 INSTALLER_ROLLBACK_STAGED = 11;
4181 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4182 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4183 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4184 INSTALLER_ROLLBACK_SUCCESS = 15;
4185 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004186 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4187 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4188 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4189 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4190 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4191 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004192 INSTALL_FAILURE_DOWNLOAD = 23;
4193 INSTALL_FAILURE_STATE_MISMATCH = 24;
4194 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004195 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004196 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004197 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004198 // Possible experiment ids for monitoring this push.
4199 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4200 // user id
4201 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004202 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004203 // Whether or not this is a rollback event
4204 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004205}
4206
Tej Singhc9203082019-05-03 13:42:23 -07004207/* Test atom, is not logged anywhere */
4208message TestAtomReported {
4209 repeated AttributionNode attribution_node = 1;
4210 optional int32 int_field = 2;
4211 optional int64 long_field = 3;
4212 optional float float_field = 4;
4213 optional string string_field = 5;
4214 optional bool boolean_field = 6;
4215 enum State {
4216 UNKNOWN = 0;
4217 OFF = 1;
4218 ON = 2;
4219 }
4220 optional State state = 7;
4221 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4222}
4223
Maggie Whitefc1aa592018-11-28 21:55:23 -08004224/** Represents USB port overheat event. */
4225message UsbPortOverheatEvent {
4226 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4227 optional int32 plug_temperature_deci_c = 1;
4228
4229 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4230 optional int32 max_temperature_deci_c = 2;
4231
4232 /* Time between USB plug event and overheat threshold trip, in seconds. */
4233 optional int32 time_to_overheat_secs = 3;
4234
4235 /* Time between overheat threshold trip and hysteresis, in seconds. */
4236 optional int32 time_to_hysteresis_secs = 4;
4237
4238 /* Time between hysteresis and active mitigation ending, in seconds. */
4239 optional int32 time_to_inactive_secs = 5;
4240};
4241
Maggie White8735b852019-01-18 11:40:49 -08004242/**
4243 * Logs total effective full charge and discharge cycles on a battery.
4244 * Here are some examples of one effective cycle:
4245 * 1) the battery charges from 0% to 100% and drains back to 0%,
4246 * 2) charging from 50% to 100% and draining back to 50% twice.
4247 * Pulled from:
4248 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4249 */
4250message BatteryCycleCount {
4251 /* Number of total charge and discharge cycles on the system battery. */
4252 optional int32 cycle_count = 1;
4253}
4254
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004255/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004256 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4257 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004258 * Pulled from:
4259 * StatsCompanionService
4260 */
4261
Carmen Agimof12dec122019-03-06 16:14:38 +00004262message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004263
Carmen Agimof12dec122019-03-06 16:14:38 +00004264 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004265 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004266 PUBLIC = 1;
4267 PRIVATE = 2;
4268 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004269 }
4270
Carmen Agimof12dec122019-03-06 16:14:38 +00004271 // The type of external storage.
4272 optional android.stats.storage.ExternalStorageType storage_type = 1;
4273 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4274 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004275 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004276 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004277}
4278
Yangster-macb89807e2018-11-15 21:10:57 -08004279/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004280 * Logs when a connection becomes available and lost.
4281 * Logged in StatsCompanionService.java
4282 */
4283message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004284 // Id of the network.
4285 optional int32 net_id = 1;
4286
4287 enum State {
4288 UNKNOWN = 0;
4289 CONNECTED = 1;
4290 DISCONNECTED = 2;
4291 }
4292 // Connected state of a network.
4293 optional State state = 2;
4294}
4295
4296/**
4297 * Logs when a service starts and stops.
4298 * Logged from:
4299 * services/core/java/com/android/server/am/ActiveServices.java
4300 */
4301message ServiceStateChanged {
4302
4303 optional int32 uid = 1 [(is_uid) = true];
4304
4305 optional string package_name = 2;
4306
4307 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004308
4309 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004310 START = 1;
4311 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004312 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004313
4314 optional State state = 4;
4315}
4316
4317/**
4318 * Logs when a service is launched.
4319 * Logged from:
4320 * services/core/java/com/android/server/am/ActiveServices.java
4321 */
4322message ServiceLaunchReported {
4323
4324 optional int32 uid = 1 [(is_uid) = true];
4325
4326 optional string package_name = 2;
4327
4328 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004329}
Howard Ro688ae182018-09-25 00:09:36 -07004330
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004331/**
4332 * Logs when a hidden API is used.
4333 *
4334 * Logged from:
4335 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4336 */
4337message HiddenApiUsed {
4338 // The uid of the app making the hidden access.
4339 optional int32 uid = 1 [(is_uid) = true];
4340
4341 // Signature of the method or field accessed.
4342 optional string signature = 2;
4343
4344 enum AccessMethod {
4345 NONE = 0;
4346 REFLECTION = 1;
4347 JNI = 2;
4348 LINKING = 3;
4349 }
4350
4351 // Type of access.
4352 optional AccessMethod access_method = 3;
4353
4354 // Whether the access was prevented or not.
4355 optional bool access_denied = 4;
4356}
4357
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004358/**
4359 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4360 * - When user sees privacy chip
4361 * - When user clicks privacy chip
4362 * - How does the user exit the Privacy Dialog
4363 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004364 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4365 */
4366message PrivacyIndicatorsInteracted {
4367
4368 enum Type {
4369 UNKNOWN = 0;
4370 CHIP_VIEWED = 1;
4371 CHIP_CLICKED = 2;
4372 DIALOG_PRIVACY_SETTINGS = 3;
4373 DIALOG_DISMISS = 4;
4374 DIALOG_LINE_ITEM = 5;
4375 }
4376
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004377 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004378
4379 // Used if the type is LINE_ITEM
4380 optional string package_name = 2;
4381}
4382
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004383/**
4384 * Logs information about a package that is moved from the internal to external storage and vice
4385 * versa.
4386 * It logs the package name, the type of the external storage where the package is installed
4387 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4388 * and the move type: if it's from internal to external or the other way around.
4389 *
4390 * Logged from:
4391 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4392 */
4393message AppMovedStorageReported {
4394 enum MoveType {
4395 UNKNOWN = 0;
4396 TO_EXTERNAL = 1;
4397 TO_INTERNAL = 2;
4398 }
4399 // The type of the external storage.
4400 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4401 // The type of move.
4402 optional MoveType move_type = 2;
4403 // The name of the package that was moved.
4404 optional string package_name = 3;
4405}
4406
jianjin8f2dee02019-03-29 14:03:08 -07004407/**
4408 * Logs when system server watchdog occurs.
4409 * Logged from:
4410 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4411 */
4412message SystemServerWatchdogOccurred {
4413 optional string subject = 1;
4414}
4415
4416/**
4417 * Logs when new file added to tombstones.
4418 * Logged from:
4419 * frameworks/base/core/java/com/android/server/BootReceiver.java
4420 */
4421message TombStoneOccurred {
4422}
4423
Hai Zhang5d3328d2019-04-13 21:25:06 +08004424/*
4425 * Information about a role request
4426 *
4427 * Logged from:
4428 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4429 */
4430message RoleRequestResultReported {
4431 // UID of application requesting the role
4432 optional int32 requesting_uid = 1;
4433
4434 // Package name of application requesting the role
4435 optional string requesting_package_name = 2;
4436
4437 // The role to be granted
4438 optional string role_name = 3;
4439
4440 // The count of applications qualifying for the role
4441 optional int32 qualifying_count = 4;
4442
4443 // UID of application current granted the role
4444 optional int32 current_uid = 5;
4445
4446 // Package name of application current granted the role
4447 optional string current_package_name = 6;
4448
4449 // UID of another application that user chose to grant the role to, instead of the requesting
4450 // application
4451 optional int32 granted_another_uid = 7;
4452
4453 // Package name of another application that user chose to grant the role to, instead of the
4454 // requesting application
4455 optional string granted_another_package_name = 8;
4456
4457 enum Result {
4458 UNDEFINED = 0;
4459 // role request was ignored
4460 IGNORED = 1;
4461 // role request was ignored because it's already granted
4462 IGNORED_ALREADY_GRANTED = 2;
4463 // role request was ignored because the application isn't qualified
4464 IGNORED_NOT_QUALIFIED = 3;
4465 // role request was ignored because user said it should be always denied
4466 IGNORED_USER_ALWAYS_DENIED = 4;
4467 // role was granted by user action
4468 USER_GRANTED = 5;
4469 // role was denied by user action
4470 USER_DENIED = 6;
4471 // role was denied by user granting another application the role
4472 USER_DENIED_GRANTED_ANOTHER = 7;
4473 // role was denied and set to be always denied by the user
4474 USER_DENIED_WITH_ALWAYS = 8;
4475 }
4476 // The result of the role request
4477 optional Result result = 9;
4478}
4479
Mark Tabrya824a642019-11-05 12:26:12 -08004480/**
4481 * Logs when a Vehicle Maps Service client's connection state has changed
4482 *
4483 * Logged from:
4484 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4485 */
4486message VmsClientConnectionStateChanged {
4487 // The UID of the VMS client app
4488 optional int32 uid = 1 [(is_uid) = true];
4489
4490 enum State {
4491 UNKNOWN = 0;
4492 // Attempting to connect to the client
4493 CONNECTING = 1;
4494 // Client connection established
4495 CONNECTED = 2;
4496 // Client connection closed unexpectedly
4497 DISCONNECTED = 3;
4498 // Client connection closed by VMS
4499 TERMINATED = 4;
4500 // Error establishing the client connection
4501 CONNECTION_ERROR = 5;
4502 }
4503
4504 optional State state = 2;
4505}
4506
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004507/**
4508 * Logs when MediaProvider has successfully finished scanning a storage volume.
4509 *
4510 * Logged from:
4511 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4512 */
shafik43825842020-04-02 17:30:24 +01004513message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004514 enum Reason {
4515 // Scan triggered due to unknown reason
4516 UNKNOWN = 0;
4517 // Scan triggered due to storage volume being mounted
4518 MOUNTED = 1;
4519 // Scan triggered due to explicit user action or app request
4520 DEMAND = 2;
4521 // Scan triggered due to idle maintenance
4522 IDLE = 3;
4523 }
4524
4525 // Volume type that this event pertains to
4526 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4527 // Reason why this scan was triggered
4528 optional Reason reason = 2;
4529 // Total number of files scanned
4530 optional int64 item_count = 3;
4531 // Duration of scan, normalized per file
4532 optional float normalized_duration_millis = 4;
4533 // Number of database inserts, normalized per file
4534 optional float normalized_insert_count = 5;
4535 // Number of database updates, normalized per file
4536 optional float normalized_update_count = 6;
4537 // Number of database deletes, normalized per file
4538 optional float normalized_delete_count = 7;
4539}
4540
4541/**
4542 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4543 *
4544 * Logged from:
4545 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4546 */
shafik43825842020-04-02 17:30:24 +01004547message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004548 // Volume type that this event pertains to
4549 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004550 // UID of app that requested deletion
4551 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004552 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004553 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004554}
4555
4556/**
4557 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4558 *
4559 * Logged from:
4560 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4561 */
shafik43825842020-04-02 17:30:24 +01004562message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004563 enum Result {
4564 UNKNOWN = 0;
4565 USER_GRANTED = 1;
4566 AUTO_GRANTED = 2;
4567 USER_DENIED = 3;
4568 USER_DENIED_WITH_PREJUDICE = 4;
4569 AUTO_DENIED = 5;
4570 }
4571
4572 // Volume type that this event pertains to
4573 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004574 // UID of app that requested permission
4575 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004576 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004577 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004578 // Result of this request
shafik43825842020-04-02 17:30:24 +01004579 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004580}
4581
4582/**
4583 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4584 *
4585 * Logged from:
4586 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4587 */
shafik43825842020-04-02 17:30:24 +01004588message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004589 // Volume type that this event pertains to
4590 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4591 // Old database version code
4592 optional int32 version_from = 2;
4593 // New database version code
4594 optional int32 version_to = 3;
4595 // Total number of files in database
4596 optional int64 item_count = 4;
4597 // Duration of schema change, normalized per file
4598 optional float normalized_duration_millis = 5;
4599}
4600
4601/**
4602 * Logs when MediaProvider has finished an idle maintenance job.
4603 *
4604 * Logged from:
4605 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4606 */
shafik43825842020-04-02 17:30:24 +01004607message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004608 // Volume type that this event pertains to
4609 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4610
4611 // Total number of files in database
4612 optional int64 item_count = 2;
4613 // Duration of idle maintenance, normalized per file
4614 optional float normalized_duration_millis = 3;
4615 // Number of thumbnails found to be stale, normalized per file
4616 optional float normalized_stale_thumbnails = 4;
4617 // Number of items found to be expired, normalized per file
4618 optional float normalized_expired_media = 5;
4619}
4620
Keun young Park3e033cb2019-12-18 11:27:35 -08004621/**
4622 * Represents boot time event with duration in ms.
4623 *
4624 * Logged from: bootstat and various system server components. Check each enums for details.
4625 */
4626message BootTimeEventDuration {
4627 enum DurationEvent {
4628 UNKNOWN = 0;
4629 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4630 ABSOLUTE_BOOT_TIME = 1;
4631 // Bootloader's 1st stage execution time.
4632 // Logged from bootstat.
4633 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4634 // Bootloader's 1st stage loading time.
4635 // Logged from bootstat.
4636 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4637 // Bootloader's kernel loading time.
4638 // Logged from bootstat.
4639 BOOTLOADER_KERNEL_LOAD = 4;
4640 // Bootloader's 2nd stage execution time.
4641 // Logged from bootstat.
4642 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4643 // Bootloader's 2nd stage loading time.
4644 // Logged from bootstat.
4645 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4646 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4647 // for locked device.
4648 // Logged from bootstat.
4649 BOOTLOADER_UI_WAIT = 7;
4650 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4651 // Logged from bootstat.
4652 BOOTLOADER_TOTAL = 8;
4653 // Shutdown duration inside init for the reboot before the current boot up.
4654 // Logged from f/b/services/.../BootReceiver.java.
4655 SHUTDOWN_DURATION = 9;
4656 // Total time for mounting of disk devices during bootup.
4657 // Logged from f/b/services/.../BootReceiver.java.
4658 MOUNT_DEFAULT_DURATION = 10;
4659 // Total time for early stage mounting of disk devices during bootup.
4660 // Logged from f/b/services/.../BootReceiver.java.
4661 MOUNT_EARLY_DURATION = 11;
4662 // Total time for late stage mounting of disk devices during bootup.
4663 // Logged from f/b/services/.../BootReceiver.java.
4664 MOUNT_LATE_DURATION = 12;
4665 // Average time to scan non-system app after OTA
4666 // Logged from f/b/services/.../PackageManagerService.java
4667 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4668 // Time to initialize Package manager after OTA
4669 // Logged from f/b/services/.../PackageManagerService.java
4670 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4671 // Time to scan all system app from Package manager after OTA
4672 // Logged from f/b/services/.../PackageManagerService.java
4673 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4674 // Init's total time for cold boot stage.
4675 // Logged from bootstat.
4676 COLDBOOT_WAIT = 16;
4677 // Init's total time for initializing selinux.
4678 // Logged from bootstat.
4679 SELINUX_INIT = 17;
4680 // Time since last factory reset.
4681 // Logged from bootstat.
4682 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004683 // Init's total time spent for completing the 1st stage.
4684 // Logged from bootstat.
4685 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004686 }
4687
4688 // Type of the event.
4689 optional DurationEvent event = 1;
4690 // Duration of the event in ms.
4691 optional int64 duration_millis = 2;
4692}
4693
4694/**
4695 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4696 * since boot-up.
4697 *
4698 * Logged from: bootstat and various system server components. Check each enums for details.
4699 */
4700message BootTimeEventElapsedTime {
4701 enum ElapsedTimeEvent {
4702 UNKNOWN = 0;
4703 // Time when init starts 1st stage. Logged from bootstat.
4704 ANDROID_INIT_STAGE_1 = 1;
4705 // Time when sys.boot_completed prop is set.
4706 // Logged from bootstat.
4707 BOOT_COMPLETE = 2;
4708 // BOOT_COMPLETE for encrypted device.
4709 BOOT_COMPLETE_ENCRYPTION = 3;
4710 // BOOT_COMPLETE for device with no encryption.
4711 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4712 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004713 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004714 // BOOT_COMPLETE after factory reset.
4715 FACTORY_RESET_BOOT_COMPLETE = 6;
4716 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4717 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004718 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4719 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004720 // BOOT_COMPLETE after OTA.
4721 OTA_BOOT_COMPLETE = 9;
4722 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4723 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004724 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4725 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004726 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4727 // Logged from f/b/services/.../UserController.java
4728 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4729 // Time when the system starts sending BOOT_COMPLETED broadcast.
4730 // Logged from f/b/services/.../UserController.java
4731 FRAMEWORK_BOOT_COMPLETED = 13;
4732 // Time when the package manager starts init.
4733 // Logged from f/b/services/.../SystemServer.java
4734 PACKAGE_MANAGER_INIT_START = 14;
4735 // Time when package manager is ready
4736 // Logged from f/b/services/.../SystemServer.java
4737 PACKAGE_MANAGER_INIT_READY = 15;
4738 // Represents the time when user has entered unlock credential for system with user pin.
4739 // Logged from bootstat.
4740 POST_DECRYPT = 16;
4741 // Represents the start of zygote's init.
4742 // Logged from zygote itself.
4743 ZYGOTE_INIT_START = 17;
4744 // Represents the start of secondary zygote's init.
4745 // TODO: add logging to zygote
4746 SECONDARY_ZYGOTE_INIT_START = 18;
4747 // Represents the start of system server's init.
4748 // Logged from f/b/services/.../SystemServer.java
4749 SYSTEM_SERVER_INIT_START = 19;
4750 // Represents the completion of system server's init.
4751 // Logged from f/b/services/.../SystemServer.java
4752 SYSTEM_SERVER_READY = 20;
4753 // Represents the start of launcher during boot-up.
4754 // TODO: add logging
4755 LAUNCHER_START = 21;
4756 // Represents the completion of launcher's initial rendering. User can use other apps from
4757 // launcher from this point.
4758 // TODO: add logging
4759 LAUNCHER_SHOWN = 22;
4760 }
4761
4762 // Type of the event.
4763 optional ElapsedTimeEvent event = 1;
4764 // Time since bootup for the event.
4765 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4766 optional int64 time_millis = 2;
4767}
4768
4769/**
4770 * Boot time events with UTC time.
4771 *
4772 * Logged from: bootstat and various system server components. Check each enums for details.
4773 */
4774message BootTimeEventUtcTime {
4775 enum UtcTimeEvent {
4776 UNKNOWN = 0;
4777 // Time of the bootstat's marking of 1st boot after the last factory reset.
4778 // Logged from bootstat.
4779 FACTORY_RESET_RESET_TIME = 1;
4780 // The time when bootstat records FACTORY_RESET_* events. This is close to
4781 // BOOT_COMPLETE time for the current bootup.
4782 // Logged from bootstat.
4783 FACTORY_RESET_CURRENT_TIME = 2;
4784 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4785 // Logged from bootstat.
4786 FACTORY_RESET_RECORD_VALUE = 3;
4787 }
4788
4789 // Type of the event.
4790 optional UtcTimeEvent event = 1;
4791 // UTC time for the event.
4792 optional int64 utc_time_secs = 2;
4793}
4794
4795/**
4796 * Boot time events representing specific error code during bootup.
4797 * Meaning of error code can be different per each event type.
4798 *
4799 * Logged from: bootstat and various system server components. Check each enums for details.
4800 */
4801message BootTimeEventErrorCode {
4802 enum ErrorCodeEvent {
4803 UNKNOWN = 0;
4804 // Linux error code for time() call to get the current UTC time.
4805 // Logged from bootstat.
4806 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4807 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4808 // as UMOUNT_STAT_* from init/reboot.cpp.
4809 // Logged from f/b/services/.../BootReceiver.java.
4810 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004811 // Reprepsents fie system mounting error code of /data partition for the current boot.
4812 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004813 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004814 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004815 }
4816
4817 // Type of the event.
4818 optional ErrorCodeEvent event = 1;
4819 // error code defined per each event type.
4820 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4821 // FS_MGR_FS_STAT.
4822 optional int32 error_code = 2;
4823}
4824
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004825/**
4826 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4827 * after an OTA.
4828 *
4829 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004830 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004831 */
4832message SnapshotMergeReported {
4833 // Keep in sync with
4834 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4835 enum UpdateState {
4836 // No update or merge is in progress.
4837 NONE = 0;
4838 // An update is applying; snapshots may already exist.
4839 INITIATED = 1;
4840 // An update is pending, but has not been successfully booted yet.
4841 UNVERIFIED = 2;
4842 // The kernel is merging in the background.
4843 MERGING = 3;
4844 // Post-merge cleanup steps could not be completed due to a transient
4845 // error, but the next reboot will finish any pending operations.
4846 MERGE_NEEDS_REBOOT = 4;
4847 // Merging is complete, and needs to be acknowledged.
4848 MERGE_COMPLETED = 5;
4849 // Merging failed due to an unrecoverable error.
4850 MERGE_FAILED = 6;
4851 // The update was implicitly cancelled, either by a rollback or a flash
4852 // operation via fastboot. This state can only be returned by WaitForMerge.
4853 CANCELLED = 7;
4854 };
4855
4856 // Status of the update after the merge attempts.
4857 optional UpdateState final_state = 1;
4858
4859 // Time to complete a merge operation in milliseconds.
4860 // A negative value corresponds to the case in which the merge operation
4861 // was interrupted and resumed (e.g. in case of a system reboot during the
4862 // merge).
4863 optional int64 duration_millis = 2;
4864
4865 // Number of reboots that occurred after issuing and before completing the
4866 // merge of all the snapshot devices.
4867 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004868
4869 // The device has been upgraded to Virtual A/B.
4870 optional bool is_vab_retrofit = 4;
4871
4872 // Space that has been temporarily allocated in the /data partition
4873 // containing the dm-snapshot's copy-on-write data generated during a
4874 // Virtual A/B update.
4875 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004876}
4877
Chenjie Yubbcbc602018-02-05 16:51:52 -08004878//////////////////////////////////////////////////////////////////////
4879// Pulled atoms below this line //
4880//////////////////////////////////////////////////////////////////////
4881
4882/**
David Chenc8a43242017-10-17 16:23:28 -07004883 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4884 *
4885 * Pulled from:
4886 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4887 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004888message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004889 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004890
4891 optional int64 rx_bytes = 2;
4892
4893 optional int64 rx_packets = 3;
4894
4895 optional int64 tx_bytes = 4;
4896
4897 optional int64 tx_packets = 5;
4898}
4899
4900/**
4901 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4902 *
4903 * Pulled from:
4904 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4905 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004906message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004907 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004908
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004909 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4910 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004911
4912 optional int64 rx_bytes = 3;
4913
4914 optional int64 rx_packets = 4;
4915
4916 optional int64 tx_bytes = 5;
4917
4918 optional int64 tx_packets = 6;
4919}
4920
4921/**
4922 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4923 *
4924 * Pulled from:
4925 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4926 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004927message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004928 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004929
4930 optional int64 rx_bytes = 2;
4931
4932 optional int64 rx_packets = 3;
4933
4934 optional int64 tx_bytes = 4;
4935
4936 optional int64 tx_packets = 5;
4937}
4938
4939/**
4940 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4941 *
4942 * Pulled from:
4943 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4944 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004945message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004946 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004947
Yao Chenc40a19d2018-03-15 16:48:25 -07004948 // 1 denotes foreground and 0 denotes background. This is called Set in
4949 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004950 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004951
4952 optional int64 rx_bytes = 3;
4953
4954 optional int64 rx_packets = 4;
4955
4956 optional int64 tx_bytes = 5;
4957
4958 optional int64 tx_packets = 6;
4959}
4960
4961/**
junyulai8d1a6092020-05-07 13:38:15 +08004962 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004963 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4964 * the caller must not assume any row of data is one full report when filtering with a set of
4965 * matching conditions, because future data may represent with multiple rows what is currently
4966 * represented by one.
4967 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4968 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004969 *
4970 * Pulled from:
4971 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4972 */
4973message DataUsageBytesTransfer {
4974 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4975 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4976 // states combined, not including debug states. See NetworkStats#SET_*.
4977 optional int32 state = 1;
4978
4979 optional int64 rx_bytes = 2;
4980
4981 optional int64 rx_packets = 3;
4982
4983 optional int64 tx_bytes = 4;
4984
4985 optional int64 tx_packets = 5;
4986
4987 // Radio Access Technology (RAT) type of this record, should be one of
4988 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4989 // the record is for all rat types combined.
4990 optional int32 rat_type = 6;
4991
4992 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004993 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004994 optional string sim_mcc = 7;
4995 optional string sim_mnc = 8;
4996
junyulai8b794b72020-05-19 17:36:13 +08004997 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4998 // See TelephonyManager#getSimCarrierId.
4999 optional int32 carrier_id = 9;
5000
junyulai8d1a6092020-05-07 13:38:15 +08005001 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5002 // combined regardless of the boolean value in its field.
5003 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005004 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005005 ALL = 1;
5006 OPPORTUNISTIC = 2;
5007 NOT_OPPORTUNISTIC = 3;
5008 }
5009 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005010 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005011 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005012 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005013}
5014
5015/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005016 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5017 *
5018 * Pulled from:
5019 * StatsCompanionService
5020 */
5021message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005022 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005023
5024 optional int64 rx_bytes = 2;
5025
5026 optional int64 tx_bytes = 3;
5027}
5028
5029/**
David Chenc8a43242017-10-17 16:23:28 -07005030 * Pulls the kernel wakelock durations. This atom is adapted from
5031 * android/internal/os/KernelWakelockStats.java
5032 *
5033 * Pulled from:
5034 * StatsCompanionService using KernelWakelockReader.
5035 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005036message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005037 optional string name = 1;
5038
5039 optional int32 count = 2;
5040
5041 optional int32 version = 3;
5042
Yangster-maca8a30442018-10-13 23:46:34 -07005043 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005044}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005045
Chenjie Yu05013b32017-11-21 10:21:41 -08005046/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005047 * Pulls low power state information. If power.stats HAL is not available, this
5048 * includes platform and subsystem sleep state information,
5049 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5050 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005051 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005052 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005053 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5054 * as defined in:
5055 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005056 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005057message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005058 // Subsystem name
5059 optional string subsystem_name = 1;
5060 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5061 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005062 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5063 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005064 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005065 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005066 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005067 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005068 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005069}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005070
Chenjie Yu05013b32017-11-21 10:21:41 -08005071/**
Bookatz92da2832018-11-01 18:10:03 -07005072 * Pulls on-device power measurement information.
5073 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5074 * Pulled from:
5075 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5076 */
5077message OnDevicePowerMeasurement {
5078 // Name of the subsystem (to which the rail belongs).
5079 optional string subsystem_name = 1;
5080
5081 // Rail name. The rail lies within the subsystem.
5082 optional string rail_name = 2;
5083
5084 // Time (in ms since boot) at which the rail energy value was measured.
5085 // This may differ slightly from the time that statsd logs this information.
5086 optional uint64 measurement_timestamp_millis = 3;
5087
5088 // Accumulated energy used via the rail since device boot in uWs.
5089 optional uint64 energy_microwatt_secs = 4;
5090}
5091
5092/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005093 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005094 * Pulls the time the cpu spend on the frequency index. Frequency index
5095 * starts from highest to lowest. The value should be monotonically
5096 * increasing since boot. However, if there is a cpu
5097 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005098 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005099message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005100 optional uint32 cluster = 1;
5101 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005102 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005103}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005104
Chenjie Yu05013b32017-11-21 10:21:41 -08005105/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005106 * Pulls Cpu Time Per Uid.
5107 * Note that isolated process uid time should be attributed to host uids.
5108 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005109message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005110 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005111 optional uint64 user_time_micros = 2;
5112 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005113}
5114
5115/**
5116 * Pulls Cpu Time Per Uid per frequency.
5117 * Note that isolated process uid time should be attributed to host uids.
5118 * For each uid, we order the time by descending frequencies.
5119 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005120message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005121 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005122 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005123 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005124}
Hugo Benichi884970e2017-11-14 22:42:46 +09005125
Chenjie Yu05013b32017-11-21 10:21:41 -08005126/**
5127 * Pulls Wifi Controller Activity Energy Info
5128 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005129message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005130 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005131 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005132 // stack reported state
5133 // TODO: replace this with proto enum
5134 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005135 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005136 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005137 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005138 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005139 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005140 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005141 // product of current(mA), voltage(V) and time(ms)
5142 optional uint64 controller_energy_used = 6;
5143}
5144
5145/**
5146 * Pulls Modem Activity Energy Info
5147 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005148message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005149 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005150 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005151 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005152 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005153 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005154 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005155 /**
5156 * Tx power index
5157 * index 0 = tx_power < 0dBm
5158 * index 1 = 0dBm < tx_power < 5dBm
5159 * index 2 = 5dBm < tx_power < 15dBm
5160 * index 3 = 15dBm < tx_power < 20dBm
5161 * index 4 = tx_power > 20dBm
5162 */
5163 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005164 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005165 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005166 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005167 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005168 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005169 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005170 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005171 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005172 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005173 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005174 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005175 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005176 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005177}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005178
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005179/**
5180 * Pulls Bluetooth Activity Energy Info
5181 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5182 */
5183message BluetoothActivityInfo {
5184 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005185 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005186 // bluetooth stack state
5187 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005188 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005189 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005190 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005191 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005192 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005193 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005194 // product of current(mA), voltage(V) and time(ms)
5195 optional uint64 energy_used = 6;
5196}
5197
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005198/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005199 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005200 *
5201 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005202 */
5203message ProcessMemoryState {
5204 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005205 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005206
5207 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005208 // Usually package name, "system" for system server.
5209 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005210 optional string process_name = 2;
5211
Rafal Slawikda51b932018-12-13 16:31:33 +00005212 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005213 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005214
5215 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005216 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005217
5218 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005219 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005220
Rajeev Kumar90235992018-01-29 11:06:48 -08005221 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005222 // Value is read from memory.stat, field total_rss if per-app memory
5223 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005224 optional int64 rss_in_bytes = 6;
5225
5226 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005227 // Value is read from memory.stat, field total_cache if per-app memory
5228 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005229 optional int64 cache_in_bytes = 7;
5230
5231 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005232 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005233 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005234 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005235
Rafal Slawik203c3db2019-09-25 19:53:01 +01005236 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005237 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005238
Rafal Slawik203c3db2019-09-25 19:53:01 +01005239 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5240 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005241
Rafal Slawik203c3db2019-09-25 19:53:01 +01005242 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5243 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005244}
5245
5246/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005247 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005248 *
5249 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5250 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005251 *
5252 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005253 */
5254message ProcessMemoryHighWaterMark {
5255 // The uid if available. -1 means not available.
5256 optional int32 uid = 1 [(is_uid) = true];
5257
Rafal Slawikda51b932018-12-13 16:31:33 +00005258 // The process name.
5259 // Usually package name or process cmdline.
5260 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005261 optional string process_name = 2;
5262
Rafal Slawik239b6802019-09-09 18:46:01 +01005263 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5264 // computed by converting kilobytes to bytes.
5265 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5266
Rafal Slawik3bea8952018-11-15 12:39:33 +00005267 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5268 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005269 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005270}
5271
5272/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005273 * Logs the memory stats for a process.
5274 *
5275 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5276 * and for selected native processes.
5277 */
5278message ProcessMemorySnapshot {
5279 // The uid if available. -1 means not available.
5280 optional int32 uid = 1 [(is_uid) = true];
5281
5282 // The process name.
5283 // Usually package name or process cmdline.
5284 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5285 optional string process_name = 2;
5286
5287 // The pid of the process.
5288 // Allows to disambiguate instances of the process.
5289 optional int32 pid = 3;
5290
5291 // The current OOM score adjustment value.
5292 // Read from ProcessRecord for managed processes.
5293 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5294 optional int32 oom_score_adj = 4;
5295
5296 // The current RSS of the process.
5297 // VmRSS from /proc/pid/status.
5298 optional int32 rss_in_kilobytes = 5;
5299
5300 // The current anon RSS of the process.
5301 // RssAnon from /proc/pid/status.
5302 optional int32 anon_rss_in_kilobytes = 6;
5303
5304 // The current swap size of the process.
5305 // VmSwap from /proc/pid/status.
5306 optional int32 swap_in_kilobytes = 7;
5307
5308 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5309 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5310}
5311
5312/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005313 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005314 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005315message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005316 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005317}
5318
5319/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005320 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005321 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005322message SystemUptime {
5323 // Milliseconds since the system was booted.
5324 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5325 // for external input).
5326 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005327 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005328}
5329
5330/*
5331 * Reads from /proc/uid_concurrent_active_time which has the format:
5332 * active: X (X is # cores)
5333 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5334 * [uid1]: [time-0] [time-1] [time-2] ... ...
5335 * ...
5336 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5337 * The file contains a monotonically increasing count of time for a single boot.
5338 */
5339message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005340 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005341 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005342}
5343
5344/**
5345 * Reads from /proc/uid_concurrent_policy_time which has the format:
5346 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5347 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5348 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5349 * ...
5350 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5351 * The file contains a monotonically increasing count of time for a single boot.
5352 */
5353message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005354 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005355 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005356 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005357}
5358
5359/*
5360 * Pulls free disk space, for data, system partition and temporary directory.
5361 */
5362message DiskSpace {
5363 // available bytes in data partition
5364 optional uint64 data_available_bytes = 1;
5365 // available bytes in system partition
5366 optional uint64 system_available_bytes = 2;
5367 // available bytes in download cache or temp directories
5368 optional uint64 temp_available_bytes = 3;
5369}
Tej Singhbf972d92018-01-10 20:51:13 -08005370
5371/**
5372 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005373 *
5374 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005375 */
5376message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005377 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005378}
5379
5380/**
5381 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005382 * Pulled from:
5383 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005384 */
5385message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005386 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005387}
5388
5389/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005390 * Pulls battery voltage.
5391 * Pulled from:
5392 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5393 */
5394message BatteryVoltage {
5395 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005396 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005397}
5398
5399/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005400 * Pulls battery level (percent full, from 0 to 100).
5401 *
5402 * Pulled from:
5403 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5404 */
5405message BatteryLevel {
5406 // Battery level. Should be in [0, 100].
5407 optional int32 battery_level = 1;
5408}
5409
5410/**
Tej Singhd89137e2018-03-26 14:51:40 -07005411 * Pulls the temperature of various parts of the device.
5412 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005413 *
Maggie White442b6312019-04-05 16:26:44 -07005414 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005415 */
5416message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005417 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005418 optional android.os.TemperatureTypeEnum sensor_location = 1;
5419
5420 // The name of the temperature source. Eg. CPU0
5421 optional string sensor_name = 2;
5422
Tej Singhd89137e2018-03-26 14:51:40 -07005423 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005424 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005425 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005426
5427 // Relative severity of the throttling, see enum definition.
5428 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005429}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005430
5431/**
5432 * Pulls the statistics of calls to Binder.
5433 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005434 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5435 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005436 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005437 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005438 */
5439message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005440 // UID of the process responsible for the binder transaction. It will be set if the process
5441 // executing the binder transaction attribute the transaction to another uid using
5442 // Binder.setThreadWorkSource().
5443 //
5444 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005445 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005446 // UID of the process executing the binder transaction.
5447 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005448 // Fully qualified class name of the API call.
5449 //
5450 // This is a system server class name.
5451 //
5452 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5453 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5454 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5455 // commonly used APIs.
5456 optional string service_class_name = 2;
5457 // Method name of the API call. It can also be a transaction code if we cannot
5458 // resolve it to a name. See Binder#getTransactionName.
5459 //
5460 // This is a system server method name.
5461 optional string service_method_name = 3;
5462 // Total number of API calls.
5463 optional int64 call_count = 4;
5464 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5465 optional bool screen_interactive = 13;
5466 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5467 // call_count will be equal to recorded_call_count.
5468 //
5469 // If recorded_call_count is different than call_count, it means data collection has been
5470 // sampled. All the fields below will be sampled in this case.
5471 optional int64 recorded_call_count = 12;
5472 // Number of exceptions thrown by the API.
5473 optional int64 recorded_exception_count = 5;
5474 // Total latency of all API calls.
5475 // Average can be computed using total_latency_micros / recorded_call_count.
5476 optional int64 recorded_total_latency_micros = 6;
5477 // Maximum latency of one API call.
5478 optional int64 recorded_max_latency_micros = 7;
5479 // Total CPU usage of all API calls.
5480 // Average can be computed using total_cpu_micros / recorded_call_count.
5481 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5482 optional int64 recorded_total_cpu_micros = 8;
5483 // Maximum CPU usage of one API call.
5484 optional int64 recorded_max_cpu_micros = 9;
5485 // Maximum parcel reply size of one API call.
5486 optional int64 recorded_max_reply_size_bytes = 10;
5487 // Maximum parcel request size of one API call.
5488 optional int64 recorded_max_request_size_bytes = 11;
5489}
5490
5491/**
5492 * Pulls the statistics of exceptions during calls to Binder.
5493 *
5494 * Binder stats are cumulative from boot unless somebody reset the data using
5495 * > adb shell dumpsys binder_calls_stats --reset
5496 */
5497message BinderCallsExceptions {
5498 // Exception class name, e.g. java.lang.IllegalArgumentException.
5499 //
5500 // This is an exception class name thrown by the system server.
5501 optional string exception_class_name = 1;
5502 // Total number of exceptions.
5503 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005504}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005505
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005506/**
5507 * Pulls the statistics of message dispatching on HandlerThreads.
5508 *
5509 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5510 * config on the device.
5511 *
5512 * Next tag: 11
5513 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005514message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005515 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005516 optional int32 uid = 1 [(is_uid) = true];
5517
5518 // Fully qualified class name of the handler target class.
5519 //
5520 // This field does not contain PII. This is a system server class name.
5521 optional string handler_class_name = 2;
5522
5523 // The name of the thread that runs the Looper.
5524 //
5525 // This field does not contain PII. This is a system server thread name.
5526 optional string looper_thread_name = 3;
5527
5528 // The name of the dispatched message.
5529 //
5530 // This field does not contain PII. This is a system server constant or class
5531 // name.
5532 optional string message_name = 4;
5533
5534 // Total number of successfully dispatched messages.
5535 optional int64 message_count = 5;
5536
5537 // Total number of messages that failed dispatching.
5538 optional int64 exception_count = 6;
5539
5540 // Total number of processed messages we have data recorded for. If we
5541 // collected data for all the messages, message_count will be equal to
5542 // recorded_message_count.
5543 //
5544 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005545 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005546 optional int64 recorded_message_count = 7;
5547
5548 // Total latency of all processed messages.
5549 // Average can be computed using recorded_total_latency_micros /
5550 // recorded_message_count.
5551 optional int64 recorded_total_latency_micros = 8;
5552
5553 // Total CPU usage of all processed message.
5554 // Average can be computed using recorded_total_cpu_micros /
5555 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005556 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005557 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005558
5559 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5560 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005561
5562 // Max recorded CPU usage of all processed messages.
5563 optional int64 recorded_max_cpu_micros = 11;
5564
5565 // Max recorded latency of all processed messages.
5566 optional int64 recorded_max_latency_micros = 12;
5567
5568 // Total number of messages we tracked the dispatching delay for. If we
5569 // collected data for all the messages, message_count will be equal to
5570 // recorded_delay_message_count.
5571 //
5572 // If recorded_delay_message_count is different than message_count, it means data
5573 // collection has been sampled or/and not all messages specified the target dispatch time.
5574 // The fields below will be sampled in this case.
5575 optional int64 recorded_delay_message_count = 13;
5576
5577 // Total dispatching delay of all processed messages.
5578 // Calculated as a difference between the target dispatching time (Message.when)
5579 // and the actual dispatching time.
5580 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5581 optional int64 recorded_total_delay_millis = 14;
5582
5583 // Max dispatching delay of all processed messages.
5584 // Calculated as a difference between the target dispatching time (Message.when)
5585 // and the actual dispatching time.
5586 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005587}
Tej Singh86dc9db2018-09-06 00:39:57 +00005588
5589/**
5590 * Pulls disk information, such as write speed and latency.
5591 */
5592message DiskStats {
5593 // Time taken to open, write 512B to, and close a file.
5594 // -1 if error performing the check.
5595 optional int64 data_write_latency_millis = 1;
5596
5597 optional bool file_based_encryption = 2;
5598
5599 // Recent disk write speed in kB/s.
5600 // -1 if error querying storageed.
5601 // 0 if data is unavailable.
5602 optional int32 recent_disk_write_speed = 3;
5603}
5604
5605
5606/**
5607 * Free and total bytes of the Data, Cache, and System partition.
5608 */
5609message DirectoryUsage {
5610 enum Directory {
5611 UNKNOWN = 0;
5612 DATA = 1;
5613 CACHE = 2;
5614 SYSTEM = 3;
5615 }
5616 optional Directory directory = 1;
5617 optional int64 free_bytes = 2;
5618 optional int64 total_bytes = 3;
5619}
5620
5621
5622/**
5623 * Size of an application: apk size, data size, and cache size.
5624 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5625 * Information is only reported for apps with the primary user (user 0).
5626 * Sizes are aggregated by package name.
5627 */
5628message AppSize {
5629 // Including uids will involve modifying diskstats logic.
5630 optional string package_name = 1;
5631 // App size in bytes. -1 if unavailable.
5632 optional int64 app_size_bytes = 2;
5633 // App data size in bytes. -1 if unavailable.
5634 optional int64 app_data_size_bytes = 3;
5635 // App cache size in bytes. -1 if unavailable.
5636 optional int64 app_cache_size_bytes = 4;
5637 // Time that the cache file was produced.
5638 // Uses System.currentTimeMillis(), which is wall clock time.
5639 optional int64 cache_time_millis = 5;
5640}
5641
5642
5643/**
5644 * Size of a particular category. Eg: photos, videos.
5645 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5646 */
5647message CategorySize {
5648 enum Category {
5649 UNKNOWN = 0;
5650 APP_SIZE = 1;
5651 APP_DATA_SIZE = 2;
5652 APP_CACHE_SIZE = 3;
5653 PHOTOS = 4;
5654 VIDEOS = 5;
5655 AUDIO = 6;
5656 DOWNLOADS = 7;
5657 SYSTEM = 8;
5658 OTHER = 9;
5659 }
5660 optional Category category = 1;
5661 // Category size in bytes.
5662 optional int64 size_bytes = 2;
5663 // Time that the cache file was produced.
5664 // Uses System.currentTimeMillis(), which is wall clock time.
5665 optional int64 cache_time_millis = 3;
5666}
Tej Singhd6d6d772018-09-05 17:41:25 -07005667
5668/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005669 * Pulls per uid I/O stats. The stats are cumulative since boot.
5670 *
5671 * Read/write bytes are I/O events from a storage device
5672 * Read/write chars are data requested by read/write syscalls, and can be
5673 * satisfied by caching.
5674 *
5675 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5676 */
5677message DiskIo {
5678 optional int32 uid = 1 [(is_uid) = true];
5679 optional int64 fg_chars_read = 2;
5680 optional int64 fg_chars_write = 3;
5681 optional int64 fg_bytes_read = 4;
5682 optional int64 fg_bytes_write = 5;
5683 optional int64 bg_chars_read = 6;
5684 optional int64 bg_chars_write = 7;
5685 optional int64 bg_bytes_read = 8;
5686 optional int64 bg_bytes_write = 9;
5687 optional int64 fg_fsync = 10;
5688 optional int64 bg_fsync= 11;
5689}
5690
5691
5692/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005693 * Pulls the number of fingerprints for each user.
5694 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005695 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005696 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005697message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005698 // The associated user. Eg: 0 for owners, 10+ for others.
5699 // Defined in android/os/UserHandle.java
5700 optional int32 user = 1;
5701 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005702 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005703}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005704
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005705/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005706 * Pulls the number of faces for each user.
5707 *
5708 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5709 */
5710message NumFacesEnrolled {
5711 // The associated user. Eg: 0 for owners, 10+ for others.
5712 // Defined in android/os/UserHandle.java
5713 optional int32 user = 1;
5714 // Number of faces registered to that user.
5715 optional int32 num_faces_enrolled = 2;
5716}
5717/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005718 * A mapping of role holder -> role
5719 */
5720message RoleHolder {
5721 // uid of the role holder
5722 optional int32 uid = 1 [(is_uid) = true];
5723
5724 // package name of the role holder
5725 optional string package_name = 2;
5726
5727 // the role held
5728 optional string role = 3;
5729}
5730
Yangsteraf9aee72018-10-12 09:26:16 -07005731message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005732 // These are all in byte resolution.
5733 optional int64 min = 1 [deprecated = true];
5734 optional int64 average = 2 [deprecated = true];
5735 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005736
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005737 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5738 // int64 fields.
5739 optional int32 mean_kb = 4;
5740 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005741}
5742
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005743// A reduced subset of process states; reducing the number of possible states allows more
5744// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5745enum ProcessStateAggregated {
5746 PROCESS_STATE_UNKNOWN = 0;
5747 // Persistent system process.
5748 PROCESS_STATE_PERSISTENT = 1;
5749 // Top activity; actually any visible activity.
5750 PROCESS_STATE_TOP = 2;
5751 // Process binding to top or a foreground service.
5752 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5753 // Processing running a foreground service.
5754 PROCESS_STATE_FGS = 4;
5755 // Important foreground process (ime, wallpaper, etc).
5756 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5757 // Important background process.
5758 PROCESS_STATE_BACKGROUND = 6;
5759 // Process running a receiver.
5760 PROCESS_STATE_RECEIVER = 7;
5761 // All kinds of cached processes.
5762 PROCESS_STATE_CACHED = 8;
5763}
5764
5765// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005766message ProcessStatsStateProto {
5767 optional android.service.procstats.ScreenState screen_state = 1;
5768
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005769 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005770
5771 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5772 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005773 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5774
5775 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005776
5777 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005778 optional int64 duration_millis = 4 [deprecated = true];
5779 // Same as above, but with minute resolution so it fits into an int32.
5780 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005781
5782 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005783 optional int64 realtime_duration_millis = 9 [deprecated = true];
5784 // Same as above, but with minute resolution so it fits into an int32.
5785 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005786
5787 // # of samples taken
5788 optional int32 sample_size = 5;
5789
5790 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005791 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005792
5793 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005794 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005795
5796 // RSS is memory resident for this process
5797 optional AggStats rss = 8;
5798}
5799
Jing Ji060d6862020-04-13 19:36:31 -07005800// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005801message ProcessStatsProto {
5802 // Name of process.
5803 optional string process = 1;
5804
5805 // Uid of the process.
5806 optional int32 uid = 2;
5807
5808 // Information about how often kills occurred
5809 message Kill {
5810 // Count of excessive CPU kills
5811 optional int32 cpu = 1;
5812
5813 // Count of kills when cached
5814 optional int32 cached = 2;
5815
5816 // PSS stats during cached kill
5817 optional AggStats cached_pss = 3;
5818 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005819 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005820
5821 // Time and memory spent in various states.
5822 repeated ProcessStatsStateProto states = 5;
5823
5824 // Total time process has been running... screen_state, memory_state, and process_state
5825 // will not be set.
5826 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005827
5828 // Association data for this process in this state;
5829 // each entry here is one association.
5830 repeated ProcessStatsAssociationProto assocs = 7;
5831}
5832
5833// Next Tag: 5
5834message ProcessStatsAssociationProto {
5835 // Procss Name of the associated process (client process of service binding)
5836 optional string assoc_process_name = 1;
5837
5838 // Package Name of the associated package (client package of service binding)
5839 optional string assoc_package_name = 2;
5840
5841 // Total count of the times this association (service binding) appeared.
5842 optional int32 total_count = 3;
5843
5844 // Uptime total duration in seconds this association (service binding) was around.
5845 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005846}
5847
5848message PackageServiceOperationStatsProto {
5849 // Operate enum: Started, Foreground, Bound, Executing
5850 optional android.service.procstats.ServiceOperationState operation = 1;
5851
5852 // Number of times the service was in this operation.
5853 optional int32 count = 2;
5854
5855 // Information about a state the service can be in.
5856 message StateStats {
5857 // Screen state enum.
5858 optional android.service.procstats.ScreenState screen_state = 1;
5859 // Memory state enum.
5860 optional android.service.procstats.MemoryState memory_state = 2;
5861
5862 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005863 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005864 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005865 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005866 }
5867 repeated StateStats state_stats = 3;
5868}
5869
5870message PackageServiceStatsProto {
5871 // Name of service component.
5872 optional string service_name = 1;
5873
5874 // The operation stats.
5875 // The package_name, package_uid, package_version, service_name will not be set to save space.
5876 repeated PackageServiceOperationStatsProto operation_stats = 2;
5877}
5878
5879message PackageAssociationSourceProcessStatsProto {
5880 // Uid of the process.
5881 optional int32 process_uid = 1;
5882 // Process name.
5883 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005884 // Package name.
5885 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005886 // Total count of the times this association appeared.
5887 optional int32 total_count = 3;
5888
5889 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005890 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005891
5892 // Total count of the times this association became actively impacting its target process.
5893 optional int32 active_count = 5;
5894
5895 // Information on one source in this association.
5896 message StateStats {
5897 // Process state enum.
5898 optional android.service.procstats.ProcessState process_state = 1;
5899 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005900 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005901 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005902 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005903 }
5904 repeated StateStats active_state_stats = 6;
5905}
5906
5907message PackageAssociationProcessStatsProto {
5908 // Name of the target component.
5909 optional string component_name = 1;
5910 // Information on one source in this association.
5911 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5912}
5913
5914
5915message ProcessStatsPackageProto {
5916 // Name of package.
5917 optional string package = 1;
5918
5919 // Uid of the package.
5920 optional int32 uid = 2;
5921
5922 // Version of the package.
5923 optional int64 version = 3;
5924
5925 // Stats for each process running with the package loaded in to it.
5926 repeated ProcessStatsProto process_stats = 4;
5927
5928 // Stats for each of the package's services.
5929 repeated PackageServiceStatsProto service_stats = 5;
5930
5931 // Stats for each association with the package.
5932 repeated PackageAssociationProcessStatsProto association_stats = 6;
5933}
5934
5935message ProcessStatsSectionProto {
5936 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005937 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005938
5939 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005940 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005941
5942 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005943 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005944
5945 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005946 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005947
5948 // System runtime library. e.g. "libdvm.so", "libart.so".
5949 optional string runtime = 5;
5950
5951 // whether kernel reports swapped pss.
5952 optional bool has_swapped_pss = 6;
5953
5954 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5955 enum Status {
5956 STATUS_UNKNOWN = 0;
5957 STATUS_COMPLETE = 1;
5958 STATUS_PARTIAL = 2;
5959 STATUS_SHUTDOWN = 3;
5960 STATUS_SYSPROPS = 4;
5961 }
5962 repeated Status status = 7;
5963
Chenjie Yub2ecc792019-01-17 10:27:26 -08005964 // Number of pages available of various types and sizes, representation fragmentation.
5965 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5966
Yangsteraf9aee72018-10-12 09:26:16 -07005967 // Stats for each process.
5968 repeated ProcessStatsProto process_stats = 8;
5969
5970 // Stats for each package.
5971 repeated ProcessStatsPackageProto package_stats = 9;
5972}
5973
Chenjie Yub2ecc792019-01-17 10:27:26 -08005974message ProcessStatsAvailablePagesProto {
5975 // Node these pages are in (as per /proc/pagetypeinfo)
5976 optional int32 node = 1;
5977
5978 // Zone these pages are in (as per /proc/pagetypeinfo)
5979 optional string zone = 2;
5980
5981 // Label for the type of these pages (as per /proc/pagetypeinfo)
5982 optional string label = 3;
5983
5984 // Distribution of number of pages available by order size. First entry in array is
5985 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5986 repeated int32 pages_per_order = 4;
5987}
5988
Chenjie Yu12e5e672018-09-14 15:54:59 -07005989/**
5990 * Pulled from ProcessStatsService.java
5991 */
5992message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005993 optional ProcessStatsSectionProto proc_stats_section = 1;
5994}
5995
Chenjie Yuf910b7802019-01-11 16:08:20 -08005996/**
5997 * Pulled from ProcessStatsService.java
5998 */
5999message ProcStatsPkgProc {
6000 optional ProcessStatsSectionProto proc_stats_section = 1;
6001}
6002
Chris Wrencdea3b72019-11-22 16:58:17 -05006003// Next Tag: 2
6004message PackageRemoteViewInfoProto {
6005 optional string package_name = 1;
6006 // add per-package additional info here (like channels)
6007}
6008
6009// Next Tag: 2
6010message NotificationRemoteViewsProto {
6011 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6012}
6013
6014/**
6015 * Pulled from NotificationManagerService.java
6016 */
6017message NotificationRemoteViews {
6018 optional NotificationRemoteViewsProto notification_remote_views = 1;
6019}
6020
Yotam Aron74299972020-01-16 16:20:58 +02006021/**
6022 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6023 */
6024message PackageNotificationPreferences {
6025 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006026 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006027 // Notification importance, which specifies when and how a notification is displayed.
6028 // Specified under core/java/android/app/NotificationManager.java.
6029 optional int32 importance = 2;
6030 // Lockscreen visibility as set by the user.
6031 optional int32 visibility = 3;
6032 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6033 // PreferencesHelper.java)
6034 optional int32 user_locked_fields = 4;
6035}
6036
6037/**
6038 * Atom that contains a list of a package's channel preferences, pulled from
6039 * NotificationManagerService.java.
6040 */
6041message PackageNotificationChannelPreferences {
6042 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006043 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006044 // Channel's ID. Should always be available.
6045 optional string channel_id = 2;
6046 // Channel's name. Should always be available.
6047 optional string channel_name = 3;
6048 // Channel's description. Optionally set by the channel creator.
6049 optional string description = 4;
6050 // Notification importance, which specifies when and how a notification is displayed. Specified
6051 // under core/java/android/app/NotificationManager.java.
6052 optional int32 importance = 5;
6053 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6054 // at core/java/android/app/NotificationChannel.java
6055 optional int32 user_locked_fields = 6;
6056 // Indicates if the channel was deleted by the app.
6057 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006058 // Indicates if the channel was marked as a conversation by the app.
6059 optional bool is_conversation = 8;
6060 // Indicates if the channel is a conversation that was demoted by the user.
6061 optional bool is_demoted_conversation = 9;
6062 // Indicates if the channel is a conversation that was marked as important by the user.
6063 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006064}
6065
6066/**
6067 * Atom that contains a list of a package's channel group preferences, pulled from
6068 * NotificationManagerService.java.
6069 */
6070message PackageNotificationChannelGroupPreferences {
6071 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006072 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006073 // Channel Group's ID. Should always be available.
6074 optional string group_id = 2;
6075 // Channel Group's name. Should always be available.
6076 optional string group_name = 3;
6077 // Channel Group's description. Optionally set by group creator.
6078 optional string description = 4;
6079 // Indicates if notifications from this channel group are blocked.
6080 optional bool is_blocked = 5;
6081 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6082 // at core/java/android/app/NotificationChannelGroup.java
6083 optional int32 user_locked_fields = 6;
6084}
6085
Yangsteraf9aee72018-10-12 09:26:16 -07006086message PowerProfileProto {
6087 optional double cpu_suspend = 1;
6088
6089 optional double cpu_idle = 2;
6090
6091 optional double cpu_active = 3;
6092
6093 message CpuCluster {
6094 optional int32 id = 1;
6095 optional double cluster_power = 2;
6096 optional int32 cores = 3;
6097 repeated int64 speed = 4;
6098 repeated double core_power = 5;
6099 }
6100
6101 repeated CpuCluster cpu_cluster = 40;
6102
6103 optional double wifi_scan = 4;
6104
6105 optional double wifi_on = 5;
6106
6107 optional double wifi_active = 6;
6108
6109 optional double wifi_controller_idle = 7;
6110
6111 optional double wifi_controller_rx = 8;
6112
6113 optional double wifi_controller_tx = 9;
6114
6115 repeated double wifi_controller_tx_levels = 10;
6116
6117 optional double wifi_controller_operating_voltage = 11;
6118
6119 optional double bluetooth_controller_idle = 12;
6120
6121 optional double bluetooth_controller_rx = 13;
6122
6123 optional double bluetooth_controller_tx = 14;
6124
6125 optional double bluetooth_controller_operating_voltage = 15;
6126
6127 optional double modem_controller_sleep = 16;
6128
6129 optional double modem_controller_idle = 17;
6130
6131 optional double modem_controller_rx = 18;
6132
6133 repeated double modem_controller_tx = 19;
6134
6135 optional double modem_controller_operating_voltage = 20;
6136
6137 optional double gps_on = 21;
6138
6139 repeated double gps_signal_quality_based = 22;
6140
6141 optional double gps_operating_voltage = 23;
6142
6143 optional double bluetooth_on = 24;
6144
6145 optional double bluetooth_active = 25;
6146
6147 optional double bluetooth_at_cmd = 26;
6148
6149 optional double ambient_display = 27;
6150
6151 optional double screen_on = 28;
6152
6153 optional double radio_on = 29;
6154
6155 optional double radio_scanning = 30;
6156
6157 optional double radio_active = 31;
6158
6159 optional double screen_full = 32;
6160
6161 optional double audio = 33;
6162
6163 optional double video = 34;
6164
6165 optional double flashlight = 35;
6166
6167 optional double memory = 36;
6168
6169 optional double camera = 37;
6170
6171 optional double wifi_batched_scan = 38;
6172
6173 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006174}
Chenjie Yuab530202018-09-26 12:39:20 -07006175
6176/**
6177 * power_profile.xml and other constants for power model calculations.
6178 * Pulled from PowerProfile.java
6179 */
6180message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006181 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006182}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006183
6184/**
arangelovd5db50e2018-10-12 20:24:39 +01006185 * Logs when a user restriction was added or removed.
6186 *
6187 * Logged from:
6188 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6189 */
6190message UserRestrictionChanged {
6191 // The raw string of the user restriction as defined in UserManager.
6192 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6193 optional string restriction = 1;
6194 // Whether the restriction is enabled or disabled.
6195 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006196}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006197
6198/**
6199 * Pulls process user time and system time. Puller takes a snapshot of all pids
6200 * in the system and returns cpu stats for those that are working at the time.
6201 * Dead pids will be dropped. Kernel processes are excluded.
6202 * Min cool-down is 5 sec.
6203 */
6204message ProcessCpuTime {
6205 optional int32 uid = 1 [(is_uid) = true];
6206
6207 optional string process_name = 2;
6208 // Process cpu time in user space, cumulative from boot/process start
6209 optional int64 user_time_millis = 3;
6210 // Process cpu time in system space, cumulative from boot/process start
6211 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006212}
Misha Wagner5a51e002018-10-03 15:04:09 +01006213
6214/**
6215 * Pulls the CPU usage for each thread.
6216 *
6217 * Read from /proc/$PID/task/$TID/time_in_state files.
6218 *
6219 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6220 * time_in_state files not being present on some phones, have not been addressed. These should be
6221 * considered before a public release.
6222 */
6223message CpuTimePerThreadFreq {
6224 // UID that owns the process.
6225 optional int32 uid = 1 [(is_uid) = true];
6226 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006227 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006228 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006229 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006230 // Name of the process taken from `/proc/$PID/cmdline`.
6231 optional string process_name = 4;
6232 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6233 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006234
6235 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6236 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6237 // frequencies are given here as the alternative is sending eight separate atoms. This method
6238 // significantly reduces the amount of data created
6239 optional int32 frequency1_khz = 6;
6240 optional int32 time1_millis = 7;
6241 optional int32 frequency2_khz = 8;
6242 optional int32 time2_millis = 9;
6243 optional int32 frequency3_khz = 10;
6244 optional int32 time3_millis = 11;
6245 optional int32 frequency4_khz = 12;
6246 optional int32 time4_millis = 13;
6247 optional int32 frequency5_khz = 14;
6248 optional int32 time5_millis = 15;
6249 optional int32 frequency6_khz = 16;
6250 optional int32 time6_millis = 17;
6251 optional int32 frequency7_khz = 18;
6252 optional int32 time7_millis = 19;
6253 optional int32 frequency8_khz = 20;
6254 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006255}
Bookatz75ee60422018-11-09 12:27:37 -08006256
6257/**
Bookatz366a4432018-11-20 09:42:33 -08006258 * Pulls information about the device's build.
6259 */
6260message BuildInformation {
6261 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6262 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6263 optional string fingerprint = 1;
6264
6265 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6266 optional string brand = 2;
6267
6268 // Build.PRODUCT. The name of the overall product.
6269 optional string product = 3;
6270
6271 // Build.DEVICE. The name of the industrial design.
6272 optional string device = 4;
6273
6274 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6275 optional string version_release = 5;
6276
6277 // Build.ID. E.g. a label like "M4-rc20".
6278 optional string id = 6;
6279
6280 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6281 // represent this build.
6282 optional string version_incremental = 7;
6283
6284 // Build.TYPE. The type of build, like "user" or "eng".
6285 optional string type = 8;
6286
6287 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6288 optional string tags = 9;
6289}
6290
6291/**
Adam He420947c2019-01-23 15:59:09 -08006292 * Logs information about mismatched caller for content capture.
6293 *
6294 * Logged from:
6295 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6296 */
6297message ContentCaptureCallerMismatchReported {
6298 optional string intended_package = 1;
6299 optional string calling_package = 2;
6300}
6301
6302/**
6303 * Logs information about content capture service events.
6304 *
6305 * Logged from:
6306 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6307 */
6308message ContentCaptureServiceEvents {
6309 // The type of event.
6310 enum Event {
6311 UNKNOWN = 0;
6312 ON_CONNECTED = 1;
6313 ON_DISCONNECTED = 2;
6314 SET_WHITELIST = 3;
6315 SET_DISABLED = 4;
6316 ON_USER_DATA_REMOVED = 5;
6317 }
6318 optional Event event = 1;
6319 // component/package of content capture service.
6320 optional string service_info = 2;
6321 // component/package of target.
6322 // it's a concatenated list of component/package for SET_WHITELIST event
6323 // separated by " ".
6324 optional string target_info = 3;
6325}
6326
6327/**
6328 * Logs information about content capture session events.
6329 *
6330 * Logged from:
6331 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6332 */
6333message ContentCaptureSessionEvents {
6334 // The type of event.
6335 enum Event {
6336 UNKNOWN = 0;
6337 ON_SESSION_STARTED = 1;
6338 ON_SESSION_FINISHED = 2;
6339 SESSION_NOT_CREATED = 3;
6340 }
6341 optional int32 session_id = 1;
6342 optional Event event = 2;
6343 // (n/a on session finished)
6344 optional int32 state_flags = 3;
6345 // component/package of content capture service.
6346 optional string service_info = 4;
6347 // component/package of app.
6348 // (n/a on session finished)
6349 optional string app_info = 5;
6350 optional bool is_child_session = 6;
6351}
6352
6353/**
6354 * Logs information about session being flushed.
6355 *
6356 * Logged from:
6357 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6358 */
6359message ContentCaptureFlushed {
6360 optional int32 session_id = 1;
6361 // component/package of content capture service.
6362 optional string service_info = 2;
6363 // component/package of app.
6364 optional string app_info = 3;
6365 // session start/finish events
6366 optional int32 child_session_started = 4;
6367 optional int32 child_session_finished = 5;
6368 // count of view events.
6369 optional int32 view_appeared_count = 6;
6370 optional int32 view_disappeared_count = 7;
6371 optional int32 view_text_changed_count = 8;
6372
6373 // Flush stats.
6374 optional int32 max_events = 9;
6375 optional int32 idle_flush_freq = 10;
6376 optional int32 text_flush_freq = 11;
6377 optional int32 flush_reason = 12;
6378}
6379
6380/**
Bookatz75ee60422018-11-09 12:27:37 -08006381 * Pulls on-device BatteryStats power use calculations for the overall device.
6382 */
6383message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006384 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6385 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6386 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6387 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006388}
6389
6390/**
6391 * Pulls on-device BatteryStats power use calculations broken down by uid.
6392 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6393 * that is attributed to non-uid items. They must all be included to get the total power use.
6394 */
6395message DeviceCalculatedPowerBlameUid {
6396 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6397 optional int32 uid = 1 [(is_uid) = true];
6398
Bookatz3dbc13a2018-12-21 12:16:51 -08006399 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6400 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6401 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006402}
6403
6404/**
6405 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6406 * drain type.
6407 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6408 * is attributed uids. They must all be included to get the total power use.
6409 */
6410message DeviceCalculatedPowerBlameOther {
6411 // The type of item whose power use is being reported.
6412 enum DrainType {
6413 AMBIENT_DISPLAY = 0;
6414 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6415 BLUETOOTH = 2;
6416 CAMERA = 3;
6417 // Cell-standby
6418 CELL = 4;
6419 FLASHLIGHT = 5;
6420 IDLE = 6;
6421 MEMORY = 7;
6422 // Amount that total computed drain exceeded the drain estimated using the
6423 // battery level changes and capacity.
6424 OVERCOUNTED = 8;
6425 PHONE = 9;
6426 SCREEN = 10;
6427 // Amount that total computed drain was below the drain estimated using the
6428 // battery level changes and capacity.
6429 UNACCOUNTED = 11;
6430 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6431 WIFI = 13;
6432 }
6433 optional DrainType drain_type = 1;
6434
Bookatz3dbc13a2018-12-21 12:16:51 -08006435 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6436 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6437 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006438}
arangelov4e994062018-11-13 16:12:38 +00006439
6440/**
6441 * Logs device policy features.
6442 *
6443 * Logged from:
6444 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6445 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6446 */
6447message DevicePolicyEvent {
6448 // The event id - unique for each event.
6449 optional android.stats.devicepolicy.EventId event_id = 1;
6450 // The admin package name.
6451 optional string admin_package_name = 2;
6452 // A generic integer parameter.
6453 optional int32 integer_value = 3;
6454 // A generic boolean parameter.
6455 optional bool boolean_value = 4;
6456 // A parameter specifying a time period in milliseconds.
6457 optional uint64 time_period_millis = 5;
6458 // A parameter specifying a list of package names, bundle extras or string parameters.
6459 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6460}
shawnlinea5b66b2018-11-13 15:05:29 +08006461
6462/**
6463 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6464 *
6465 * Logged from:
6466 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6467 */
6468message DocsUILaunchReported {
6469 optional android.stats.docsui.LaunchAction launch_action = 1;
6470 optional bool has_initial_uri = 2;
6471 optional android.stats.docsui.MimeType mime_type = 3;
6472 optional android.stats.docsui.Root initial_root = 4;
6473}
6474
6475/**
6476 * Logs root/app visited event in file managers/picker. Call this when the user
6477 * taps on root/app in hamburger menu.
6478 *
6479 * Logged from:
6480 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6481 */
6482message DocsUIRootVisitedReported {
6483 optional android.stats.docsui.ContextScope scope = 1;
6484 optional android.stats.docsui.Root root = 2;
6485}
6486
6487/**
6488 * Logs file operation stats. Call this when a file operation has completed.
6489 *
6490 * Logged from:
6491 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6492 */
6493message DocsUIFileOperationReported {
6494 optional android.stats.docsui.Provider provider = 1;
6495 optional android.stats.docsui.FileOperation file_op = 2;
6496}
6497
6498/**
6499 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6500 * mode.
6501 *
6502 * Logged from:
6503 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6504 */
6505message DocsUIFileOperationCopyMoveModeReported {
6506 optional android.stats.docsui.FileOperation file_op = 1;
6507 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6508}
6509
6510
6511/**
6512 * Logs file sub operation stats. Call this when a file operation has failed.
6513 *
6514 * Logged from:
6515 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6516 */
6517message DocsUIFileOperationFailureReported {
6518 optional android.stats.docsui.Authority authority = 1;
6519 optional android.stats.docsui.SubFileOperation sub_op = 2;
6520}
6521
6522/**
6523* Logs the cancellation of a file operation. Call this when a job is canceled
6524*
6525* Logged from:
6526* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6527*/
6528message DocsUIFileOperationCanceledReported {
6529 optional android.stats.docsui.FileOperation file_op = 1;
6530}
6531
6532/**
6533 * Logs startup time in milliseconds.
6534 *
6535 * Logged from:
6536 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6537 */
6538message DocsUIStartupMsReported {
6539 optional int32 startup_millis = 1;
6540}
6541
6542/**
6543 * Logs the action that was started by user.
6544 *
6545 * Logged from:
6546 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6547 */
6548message DocsUIUserActionReported {
6549 optional android.stats.docsui.UserAction action = 1;
6550}
6551
6552/**
6553 * Logs the invalid type when invalid scoped access is requested.
6554 *
6555 * Logged from:
6556 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6557 */
6558message DocsUIInvalidScopedAccessRequestReported {
6559 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006560}
Ben Murdochbab399f62018-12-06 11:01:38 +00006561
6562/**
shawnlina75e82d2019-01-07 10:31:12 +08006563 * Logs the package name that launches docsui picker mode.
6564 *
6565 * Logged from:
6566 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6567 */
6568message DocsUIPickerLaunchedFromReported {
6569 optional string package_name = 1;
6570}
6571
6572/**
6573 * Logs the search type.
6574 *
6575 * Logged from:
6576 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6577 */
6578message DocsUISearchTypeReported {
6579 optional android.stats.docsui.SearchType search_type = 1;
6580}
6581
6582/**
6583 * Logs the search mode.
6584 *
6585 * Logged from:
6586 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6587 */
6588message DocsUISearchModeReported {
6589 optional android.stats.docsui.SearchMode search_mode = 1;
6590}
6591
6592/**
6593 * Logs the pick result information.
6594 *
6595 * Logged from:
6596 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6597 */
6598message DocsUIPickResultReported {
6599 optional int32 total_action_count = 1;
6600 optional int64 duration_millis = 2;
6601 optional int32 file_count= 3;
6602 optional bool is_searching = 4;
6603 optional android.stats.docsui.Root picked_from = 5;
6604 optional android.stats.docsui.MimeType mime_type = 6;
6605 optional int32 repeatedly_pick_times = 7;
6606}
6607
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006608/** Logs the drag and drop of files.
6609
6610 * Logged from:
6611 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6612 */
6613message DocsUIDragAndDropReported {
6614 optional bool drag_initiated_from_docsui = 1;
6615}
6616
shawnlina75e82d2019-01-07 10:31:12 +08006617/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006618 * Logs when an app's memory is compacted.
6619 *
6620 * Logged from:
6621 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6622 */
6623message AppCompacted {
6624 // The pid of the process being compacted.
6625 optional int32 pid = 1;
6626
6627 // The name of the process being compacted.
6628 optional string process_name = 2;
6629
6630 // The type of compaction.
6631 enum Action {
6632 UNKNOWN = 0;
6633 SOME = 1;
6634 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006635 PERSISTENT = 3;
6636 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006637 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006638 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006639
6640 // Total RSS in kilobytes consumed by the process prior to compaction.
6641 optional int64 before_rss_total_kilobytes = 4;
6642
6643 // File RSS in kilobytes consumed by the process prior to compaction.
6644 optional int64 before_rss_file_kilobytes = 5;
6645
6646 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6647 optional int64 before_rss_anon_kilobytes = 6;
6648
6649 // Swap in kilobytes consumed by the process prior to compaction.
6650 optional int64 before_swap_kilobytes = 7;
6651
6652 // Total RSS in kilobytes consumed by the process after compaction.
6653 optional int64 after_rss_total_kilobytes = 8;
6654
6655 // File RSS in kilobytes consumed by the process after compaction.
6656 optional int64 after_rss_file_kilobytes = 9;
6657
6658 // Anonymous RSS in kilobytes consumed by the process after compaction.
6659 optional int64 after_rss_anon_kilobytes = 10;
6660
6661 // Swap in kilobytes consumed by the process after compaction.
6662 optional int64 after_swap_kilobytes = 11;
6663
6664 // The time taken to perform compaction in milliseconds.
6665 optional int64 time_to_compact_millis = 12;
6666
6667 // The last compaction action performed for this app.
6668 optional Action last_action = 13;
6669
Ben Murdoch01720b82018-12-19 18:03:44 +00006670 // The last time that compaction was attempted on this process in milliseconds
6671 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6672 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006673
Ben Murdoch885c21b2019-03-15 18:02:04 +00006674 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006675 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006676
6677 // The process state at the time of compaction.
6678 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006679
6680 // Free ZRAM in kilobytes before compaction.
6681 optional int64 before_zram_free_kilobytes = 17;
6682
6683 // Free ZRAM in kilobytes after compaction.
6684 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006685}
lifr157fc552018-12-12 16:38:04 +08006686
6687/**
lifrb6b90b62019-03-29 00:40:17 +08006688 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6689 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6690 *
lifr1f74b052019-04-16 22:16:30 +08006691 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6692 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6693 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6694 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006695 */
6696message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006697 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006698
lifr1f74b052019-04-16 22:16:30 +08006699 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006700
6701 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006702 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006703
lifr1f74b052019-04-16 22:16:30 +08006704 // Only valid for event_type = EVENT_GETADDRINFO.
6705 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006706
lifr1f74b052019-04-16 22:16:30 +08006707 // Flags passed to android_res_nsend() defined in multinetwork.h
6708 // Only valid for event_type = EVENT_RESNSEND.
6709 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006710
lifrad9becc2019-05-20 11:04:41 +08006711 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006712
6713 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006714 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006715
6716 // Additional pass-through fields opaque to statsd.
6717 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006718 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006719
6720 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6721 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006722}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006723
6724/**
6725 * Logs when a data stall event occurs.
6726 *
6727 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006728 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006729 */
6730message DataStallEvent {
6731 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006732 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006733 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6734 optional int32 evaluation_type = 1;
6735 // See definition in data_stall_event.proto.
6736 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6737 // See definition in data_stall_event.proto.
6738 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6739 // See definition in data_stall_event.proto.
6740 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6741 // See definition in data_stall_event.proto.
6742 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6743 // See definition in data_stall_event.proto.
6744 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006745 // The tcp packets fail rate from the latest tcp polling.
6746 optional int32 tcp_fail_rate = 7;
6747 // Number of packets sent since the last received packet.
6748 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006749}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006750
6751/*
6752 * Logs when RescueParty resets some set of experiment flags.
6753 *
6754 * Logged from:
6755 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6756 */
6757message RescuePartyResetReported {
6758 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6759 optional int32 rescue_level = 1;
6760}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006761
6762/**
6763 * Logs when signed config is received from an APK, and if that config was applied successfully.
6764 * Logged from:
6765 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6766 */
6767message SignedConfigReported {
6768 enum Type {
6769 UNKNOWN_TYPE = 0;
6770 GLOBAL_SETTINGS = 1;
6771 }
6772 optional Type type = 1;
6773
6774 // The final status of the signed config received.
6775 enum Status {
6776 UNKNOWN_STATUS = 0;
6777 APPLIED = 1;
6778 BASE64_FAILURE_CONFIG = 2;
6779 BASE64_FAILURE_SIGNATURE = 3;
6780 SECURITY_EXCEPTION = 4;
6781 INVALID_CONFIG = 5;
6782 OLD_CONFIG = 6;
6783 SIGNATURE_CHECK_FAILED = 7;
6784 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006785 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006786 }
6787 optional Status status = 2;
6788
6789 // The version of the signed config processed.
6790 optional int32 version = 3;
6791
6792 // The package name that the config was extracted from.
6793 optional string from_package = 4;
6794
6795 enum Key {
6796 NO_KEY = 0;
6797 DEBUG = 1;
6798 PRODUCTION = 2;
6799 }
6800 // Which key was used to verify the config.
6801 optional Key verified_with = 5;
6802}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006803
6804/*
6805 * Logs GNSS Network-Initiated (NI) location events.
6806 *
6807 * Logged from:
6808 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6809 */
6810message GnssNiEventReported {
6811 // The type of GnssNiEvent.
6812 enum EventType {
6813 UNKNOWN = 0;
6814 NI_REQUEST = 1;
6815 NI_RESPONSE = 2;
6816 }
6817 optional EventType event_type = 1;
6818
6819 // An ID generated by HAL to associate NI notifications and UI responses.
6820 optional int32 notification_id = 2;
6821
6822 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006823 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006824
6825 // NI requires notification.
6826 optional bool need_notify = 4;
6827
6828 // NI requires verification.
6829 optional bool need_verify = 5;
6830
6831 // NI requires privacy override, no notification/minimal trace.
6832 optional bool privacy_override = 6;
6833
6834 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6835 // seconds.
6836 optional int32 timeout = 7;
6837
6838 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006839 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006840
6841 // String representing the requester of the network inititated location request.
6842 optional string requestor_id = 9;
6843
6844 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6845 // network initiated location request.
6846 optional string text = 10;
6847
6848 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006849 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006850
6851 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006852 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006853
6854 // True if SUPL ES is enabled.
6855 optional bool is_supl_es_enabled = 13;
6856
6857 // True if GNSS location is enabled.
6858 optional bool is_location_enabled = 14;
6859
6860 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006861 optional android.server.location.GnssUserResponseType user_response = 15;
6862}
6863
6864/**
6865 * Logs GNSS non-framework (NFW) location notification.
6866 *
6867 * Logged from:
6868 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6869 */
6870message GnssNfwNotificationReported {
6871 // Package name of the Android proxy application representing the non-framework entity that
6872 // requested location. Set to empty string if unknown.
6873 optional string proxy_app_package_name = 1;
6874
6875 // Protocol stack that initiated the non-framework location request.
6876 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6877
6878 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6879 // set to empty string. This field is opaque to the framework and used for logging purposes.
6880 optional string other_protocol_stack_name = 3;
6881
6882 // Source initiating/receiving the location information.
6883 optional android.server.location.NfwRequestor requestor = 4;
6884
6885 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6886 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6887 // and used for logging purposes.
6888 optional string requestor_id = 5;
6889
6890 // Indicates whether location information was provided for this request.
6891 optional android.server.location.NfwResponseType response_type = 6;
6892
6893 // True if the device is in user initiated emergency session.
6894 optional bool in_emergency_mode = 7;
6895
6896 // True if cached location is provided.
6897 optional bool is_cached_location = 8;
6898
6899 // True if proxy app permission mismatch between framework and GNSS HAL.
6900 optional bool is_permission_mismatched = 9;
6901}
6902
6903/**
6904 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6905 *
6906 * Logged from:
6907 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6908 */
6909message GnssConfigurationReported {
6910 // SUPL host name.
6911 optional string supl_host = 1;
6912
6913 // SUPL port number.
6914 optional int32 supl_port = 2;
6915
6916 // C2K host name.
6917 optional string c2k_host = 3;
6918
6919 // C2K port number.
6920 optional int32 c2k_port = 4;
6921
6922 // The SUPL version requested by Carrier.
6923 optional int32 supl_ver = 5;
6924
6925 // The SUPL mode.
6926 optional android.server.location.SuplMode supl_mode = 6;
6927
6928 // True if NI emergency SUPL restrictions is enabled.
6929 optional bool supl_es = 7;
6930
6931 // LTE Positioning Profile settings
6932 optional android.server.location.LppProfile lpp_profile = 8;
6933
6934 // Positioning protocol on A-Glonass system.
6935 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6936
6937 // True if emergency PDN is used. Otherwise, regular PDN is used.
6938 optional bool use_emergency_pdn_for_emergency_supl= 10;
6939
6940 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6941 optional android.server.location.GpsLock gps_lock = 11;
6942
6943 // Number of seconds to extend the emergency session duration post emergency call.
6944 optional int32 es_extension_sec = 12;
6945
6946 // The full list of package names of proxy Android applications representing the non-framework
6947 // location access entities (on/off the device) for which the framework user has granted
6948 // non-framework location access permission. The package names are concatenated in one string
6949 // with spaces as separators.
6950 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006951}
Jack Yu95b64f32018-12-13 18:26:11 +08006952
6953/**
6954 * Logs when a NFC device's error occurred.
6955 * Logged from:
6956 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6957 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6958 */
6959message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006960 enum Type {
6961 UNKNOWN = 0;
6962 CMD_TIMEOUT = 1;
6963 ERROR_NOTIFICATION = 2;
6964 AID_OVERFLOW = 3;
6965 }
6966 optional Type type = 1;
6967 // If it's nci cmd timeout, log the timeout command.
6968 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006969
Alex Salod7c3eef2019-01-25 14:43:27 -08006970 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006971}
6972
6973/**
6974 * Logs when a NFC device's state changed event
6975 * Logged from:
6976 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6977 */
6978message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006979 enum State {
6980 UNKNOWN = 0;
6981 OFF = 1;
6982 ON = 2;
6983 ON_LOCKED = 3; // Secure Nfc enabled.
6984 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6985 }
6986 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006987}
6988
6989/**
6990 * Logs when a NFC Beam Transaction occurred.
6991 * Logged from:
6992 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6993 */
6994message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006995 enum Operation {
6996 UNKNOWN = 0;
6997 SEND = 1;
6998 RECEIVE = 2;
6999 }
7000 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007001}
7002
7003/**
7004 * Logs when a NFC Card Emulation Transaction occurred.
7005 * Logged from:
7006 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7007 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7008 */
7009message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007010 enum Category {
7011 UNKNOWN = 0;
7012 HCE_PAYMENT = 1;
7013 HCE_OTHER = 2;
7014 OFFHOST = 3;
7015 }
7016 // Transaction belongs to HCE payment or HCE other category, or offhost.
7017 optional Category category = 1;
7018 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7019 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007020}
7021
7022/**
7023 * Logs when a NFC Tag event occurred.
7024 * Logged from:
7025 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7026 */
7027message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007028 enum Type {
7029 UNKNOWN = 0;
7030 URL = 1;
7031 BT_PAIRING = 2;
7032 PROVISION = 3;
7033 WIFI_CONNECT = 4;
7034 APP_LAUNCH = 5;
7035 OTHERS = 6;
7036 }
7037 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007038}
7039
7040/**
7041 * Logs when Hce transaction triggered
7042 * Logged from:
7043 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7044 */
7045message NfcHceTransactionOccurred {
7046 // The latency period(in microseconds) it took for the first HCE data
7047 // exchange.
7048 optional uint32 latency_micros = 1;
7049}
7050
7051/**
7052 * Logs when SecureElement state event changed
7053 * Logged from:
7054 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7055 */
7056message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007057 enum State {
7058 UNKNOWN = 0;
7059 INITIALIZED = 1;
7060 DISCONNECTED = 2;
7061 CONNECTED = 3;
7062 HALCRASH = 4;
7063 }
7064 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007065
Alex Salod7c3eef2019-01-25 14:43:27 -08007066 optional string state_change_reason = 2;
7067 // SIMx or eSEx.
7068 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007069}
7070
7071/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007072 * Information about a permission grant request
7073 */
7074message PermissionGrantRequestResultReported {
7075 // unique value identifying an API call. A API call might result in multiple of these atoms
7076 optional int64 request_id = 1;
7077
7078 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007079 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007080
7081 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007082 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007083
7084 // The permission to be granted
7085 optional string permission_name = 4;
7086
7087 // If the permission was explicitly requested via the API or added by the system
7088 optional bool is_implicit = 5;
7089
7090 enum Result {
7091 UNDEFINED = 0;
7092 // permission request was ignored
7093 IGNORED = 1;
7094 // permission request was ignored because it was user fixed
7095 IGNORED_USER_FIXED = 2;
7096 // permission request was ignored because it was policy fixed
7097 IGNORED_POLICY_FIXED = 3;
7098 // permission was granted by user action
7099 USER_GRANTED = 4;
7100 // permission was automatically granted
7101 AUTO_GRANTED = 5;
7102 // permission was denied by user action
7103 USER_DENIED = 6;
7104 // permission was denied with prejudice by the user
7105 USER_DENIED_WITH_PREJUDICE = 7;
7106 // permission was automatically denied
7107 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007108 // permission request was ignored because permission is restricted
7109 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007110 // one time permission was granted by user action
7111 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007112 // user ignored request by leaving the request screen without choosing any option
7113 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007114 // user granted the permission after being linked to settings
7115 USER_GRANTED_IN_SETTINGS = 12;
7116 // user denied the permission after being linked to settings
7117 USER_DENIED_IN_SETTINGS = 13;
7118 // user denied the permission with prejudice after being linked to settings
7119 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7120 // permission was automatically revoked after one-time permission expired
7121 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007122 // permission was automatically revoked for unused app
7123 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007124 }
7125 // The result of the permission grant
7126 optional Result result = 6;
7127}
7128
7129/**
Jack Yu95b64f32018-12-13 18:26:11 +08007130 * Logs when Omapi API used
7131 * Logged from:
7132 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7133 */
7134message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007135 enum Operation {
7136 UNKNOWN = 0;
7137 OPEN_CHANNEL = 1;
7138 }
7139 optional Operation operation = 1;
7140 // SIMx or eSEx.
7141 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007142
Alex Salod7c3eef2019-01-25 14:43:27 -08007143 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007144}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007145
7146/**
Alex Saloa060aee2019-01-21 14:36:41 -08007147 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7148 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007149 * Logged from:
7150 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7151 */
7152message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007153 optional int64 dispatch_latency_millis = 1;
7154}
7155
7156/**
7157 * Logs AttentionManagerService attention check result.
7158 *
7159 * Logged from:
7160 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7161 */
7162message AttentionManagerServiceResultReported {
7163 // See core/java/android/service/attention/AttentionService.java
7164 enum AttentionCheckResult {
7165 UNKNOWN = 20;
7166 ATTENTION_SUCCESS_ABSENT = 0;
7167 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007168 ATTENTION_FAILURE_UNKNOWN = 2;
7169 ATTENTION_FAILURE_CANCELLED = 3;
7170 ATTENTION_FAILURE_PREEMPTED = 4;
7171 ATTENTION_FAILURE_TIMED_OUT = 5;
7172 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007173 }
7174 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007175}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007176
7177/**
7178 * Logs when an adb connection changes state.
7179 *
7180 * Logged from:
7181 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7182 */
7183message AdbConnectionChanged {
7184 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7185 // previously selected for this system.
7186 optional int64 last_connection_time_millis = 1;
7187
7188 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7189 // to reconnect via adb without user interaction.
7190 optional int64 auth_window_millis = 2;
7191
7192 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7193 optional android.debug.AdbConnectionStateEnum state = 3;
7194
7195 // True if the 'always allow' option was selected for this system.
7196 optional bool always_allow = 4;
7197}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007198
7199/*
7200 * Logs the reported speech DSP status.
7201 *
7202 * Logged from:
7203 * Vendor audio implementation.
7204 */
7205message SpeechDspStatReported {
7206 // The total Speech DSP uptime in milliseconds.
7207 optional int32 total_uptime_millis = 1;
7208 // The total Speech DSP downtime in milliseconds.
7209 optional int32 total_downtime_millis = 2;
7210 optional int32 total_crash_count = 3;
7211 optional int32 total_recover_count = 4;
7212}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007213
7214/**
7215 * Logs USB connector contaminant status.
7216 *
7217 * Logged from: USB Service.
7218 */
7219message UsbContaminantReported {
7220 optional string id = 1;
7221 optional android.service.usb.ContaminantPresenceStatus status = 2;
7222}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007223
7224/**
7225 * This atom is for debugging purpose.
7226 */
7227message DebugElapsedClock {
7228 // Monotically increasing value for each pull.
7229 optional int64 pull_count = 1;
7230 // Time from System.elapsedRealtime.
7231 optional int64 elapsed_clock_millis = 2;
7232 // Time from System.elapsedRealtime.
7233 optional int64 same_elapsed_clock_millis = 3;
7234 // Diff between current elapsed time and elapsed time from previous pull.
7235 optional int64 elapsed_clock_diff_millis = 4;
7236
7237 enum Type {
7238 TYPE_UNKNOWN = 0;
7239 ALWAYS_PRESENT = 1;
7240 PRESENT_ON_ODD_PULLS = 2;
7241 }
7242 // Type of behavior for the pulled data.
7243 optional Type type = 5;
7244}
7245
7246/**
7247 * This atom is for debugging purpose.
7248 */
7249message DebugFailingElapsedClock {
7250 // Monotically increasing value for each pull.
7251 optional int64 pull_count = 1;
7252 // Time from System.elapsedRealtime.
7253 optional int64 elapsed_clock_millis = 2;
7254 // Time from System.elapsedRealtime.
7255 optional int64 same_elapsed_clock_millis = 3;
7256 // Diff between current elapsed time and elapsed time from previous pull.
7257 optional int64 elapsed_clock_diff_millis = 4;
7258}
Steven Wuacef6bb2019-01-23 14:21:17 -05007259
7260/** Logs System UI bubbles event changed.
7261 *
7262 * Logged from:
7263 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7264 */
7265message BubbleUIChanged {
7266
7267 // The app package that is posting the bubble.
7268 optional string package_name = 1;
7269
7270 // The notification channel that is posting the bubble.
7271 optional string notification_channel = 2;
7272
7273 // The notification id associated with the posted bubble.
7274 optional int32 notification_id = 3;
7275
7276 // The position of the bubble within the bubble stack.
7277 optional int32 position = 4;
7278
7279 // The total number of bubbles within the bubble stack.
7280 optional int32 total_number = 5;
7281
7282 // User interactions with the bubble.
7283 enum Action {
7284 UNKNOWN = 0;
7285 POSTED = 1;
7286 UPDATED = 2;
7287 EXPANDED = 3;
7288 COLLAPSED = 4;
7289 DISMISSED = 5;
7290 STACK_DISMISSED = 6;
7291 STACK_MOVED = 7;
7292 HEADER_GO_TO_APP = 8;
7293 HEADER_GO_TO_SETTINGS = 9;
7294 PERMISSION_OPT_IN = 10;
7295 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007296 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007297 SWIPE_LEFT = 13;
7298 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007299 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007300 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007301 }
7302 optional Action action = 6;
7303
7304 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7305 optional float normalized_x_position = 7;
7306 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007307
7308 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7309 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007310
7311 // Whether the bubble is an on-going one.
7312 optional bool is_ongoing = 10;
7313
7314 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007315 // This is deprecated and the value should be ignored.
7316 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007317}
Kweku Adams8845d012018-12-11 20:06:45 -08007318
7319/**
Steven Wu552f63f2019-02-05 13:41:36 -05007320 * Logs System UI bubbles developer errors.
7321 *
7322 * Logged from:
7323 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7324 */
7325message BubbleDeveloperErrorReported {
7326
7327 // The app package that is posting the bubble.
7328 optional string package_name = 1;
7329
7330 // Bubble developer error type enums.
7331 enum Error {
7332 UNKNOWN = 0;
7333 ACTIVITY_INFO_MISSING = 1;
7334 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7335 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7336 }
7337 optional Error error = 2 [default = UNKNOWN];
7338}
7339
7340/**
Kweku Adams8845d012018-12-11 20:06:45 -08007341 * Logs that a constraint for a scheduled job has changed.
7342 *
7343 * Logged from:
7344 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7345 */
7346message ScheduledJobConstraintChanged {
7347 repeated AttributionNode attribution_node = 1;
7348
7349 // Name of the job.
7350 optional string job_name = 2;
7351
7352 optional com.android.server.job.ConstraintEnum constraint = 3;
7353
7354 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007355 UNKNOWN = 0;
7356 UNSATISFIED = 1;
7357 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007358 }
7359 optional State state = 4;
7360}
Alex Salod7c3eef2019-01-25 14:43:27 -08007361
7362/**
7363 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7364 * returns true.
7365 *
7366 * Logged from:
7367 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7368 */
7369message ScreenTimeoutExtensionReported {
7370 // Describes how many times in a row did the power manager reset the screen off timeout.
7371 optional uint32 consecutive_timeout_extended_count = 1;
7372}
Hui Yu885aca12019-01-10 17:11:34 -08007373
7374/*
7375* Logs number of milliseconds it takes to start a process.
7376* The definition of app process start time is from the app launch time to
7377* the time that Zygote finished forking the app process and loaded the
7378* application package's java classes.
7379
7380* This metric is different from AppStartOccurred which is for foreground
7381* activity only.
7382
7383* ProcessStartTime can report all processes (both foreground and background)
7384* start time.
7385*
7386* Logged from:
7387* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7388*/
7389message ProcessStartTime {
7390 // The uid of the ProcessRecord.
7391 optional int32 uid = 1 [(is_uid) = true];
7392
7393 // The process pid.
7394 optional int32 pid = 2;
7395
7396 // The process name.
7397 // Usually package name, "system" for system server.
7398 // Provided by ActivityManagerService.
7399 optional string process_name = 3;
7400
7401 enum StartType {
7402 UNKNOWN = 0;
7403 WARM = 1;
7404 HOT = 2;
7405 COLD = 3;
7406 }
7407
7408 // The start type.
7409 optional StartType type = 4;
7410
7411 // The elapsed realtime at the start of the process.
7412 optional int64 process_start_time_millis = 5;
7413
7414 // Number of milliseconds it takes to reach bind application.
7415 optional int32 bind_application_delay_millis = 6;
7416
7417 // Number of milliseconds it takes to finish start of the process.
7418 optional int32 process_start_delay_millis = 7;
7419
7420 // hostingType field in ProcessRecord, the component type such as "activity",
7421 // "service", "content provider", "broadcast" or other strings.
7422 optional string hosting_type = 8;
7423
7424 // hostingNameStr field in ProcessRecord. The component class name that runs
7425 // in this process.
7426 optional string hosting_name = 9;
7427}
7428
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007429/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007430 * Track Media Codec usage
7431 * Logged from:
7432 * frameworks/av/media/libstagefright/MediaCodec.cpp
7433 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7434 */
7435message MediametricsCodecReported {
7436 optional int64 timestamp_nanos = 1;
7437 optional string package_name = 2;
7438 optional int64 package_version_code = 3;
7439 optional int64 media_apex_version = 4;
7440
7441 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7442}
7443
7444/**
7445 * Track Media Extractor (pulling video/audio streams out of containers) usage
7446 * Logged from:
7447 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7448 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7449 */
7450message MediametricsExtractorReported {
7451 optional int64 timestamp_nanos = 1;
7452 optional string package_name = 2;
7453 optional int64 package_version_code = 3;
7454 optional int64 media_apex_version = 4;
7455
7456 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7457}
7458
7459/**
7460 * Track how we arbitrate between microphone/input requests.
7461 * Logged from
7462 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7463 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7464 */
7465message MediametricsAudiopolicyReported {
7466 optional int64 timestamp_nanos = 1;
7467 optional string package_name = 2;
7468 optional int64 package_version_code = 3;
7469 optional int64 media_apex_version = 4;
7470
7471 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7472}
7473
7474/**
7475 * Track how we arbitrate between microphone requests.
7476 * Logged from
7477 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7478 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7479 */
7480message MediametricsAudiorecordReported {
7481 optional int64 timestamp_nanos = 1;
7482 optional string package_name = 2;
7483 optional int64 package_version_code = 3;
7484 optional int64 media_apex_version = 4;
7485
7486 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7487}
7488
7489/**
7490 * Track how we arbitrate between microphone/input requests.
7491 * Logged from
7492 * frameworks/av/media/libnblog/ReportPerformance.cpp
7493 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7494 */
7495message MediametricsAudiothreadReported {
7496 optional int64 timestamp_nanos = 1;
7497 optional string package_name = 2;
7498 optional int64 package_version_code = 3;
7499 optional int64 media_apex_version = 4;
7500
7501 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7502}
7503
7504/**
7505 * Track how we arbitrate between microphone/input requests.
7506 * Logged from
7507 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7508 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7509 */
7510message MediametricsAudiotrackReported {
7511 optional int64 timestamp_nanos = 1;
7512 optional string package_name = 2;
7513 optional int64 package_version_code = 3;
7514 optional int64 media_apex_version = 4;
7515
7516 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7517}
7518
7519/**
7520 * Track information about DRM framework performance
7521 * Logged from
7522 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7523 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7524 */
7525message MediametricsMediadrmReported {
7526 optional int64 timestamp_nanos = 1;
7527 optional string package_name = 2;
7528 optional int64 package_version_code = 3;
7529 optional int64 media_apex_version = 4;
7530
7531 // vendor+description tell about which DRM plugin is in use on this device
7532 optional string vendor = 5;
7533 optional string description = 6;
7534 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7535 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7536}
7537
7538/**
7539 * Track information about the widevine DRM plugin performance
7540 * Logged from
7541 * vendor/widevine/libwvdrmengine/cdm/metrics
7542 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7543 */
7544message MediametricsDrmWidevineReported {
7545 optional int64 timestamp_nanos = 1;
7546 optional string package_name = 2;
7547 optional int64 package_version_code = 3;
7548 optional int64 media_apex_version = 4;
7549
7550 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7551}
7552
7553/**
7554 * Track information about recordings (e.g. camcorder)
7555 * Logged from
7556 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7557 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7558 */
7559message MediametricsRecorderReported {
7560 optional int64 timestamp_nanos = 1;
7561 optional string package_name = 2;
7562 optional int64 package_version_code = 3;
7563 optional int64 media_apex_version = 4;
7564
7565 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7566}
7567
7568/**
7569 * Track Media Player usage
7570 * Logged from:
7571 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7572 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7573 */
7574message MediametricsNuPlayerReported {
7575 optional int64 timestamp_nanos = 1;
7576 optional string package_name = 2;
7577 optional int64 package_version_code = 3;
7578 optional int64 media_apex_version = 4;
7579
7580 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7581}
7582
7583/**
Robert Shiha4beed32019-08-19 14:15:23 -07007584 * Track Legacy DRM usage
7585 * Logged from
7586 * frameworks/av/drm/drmserver/DrmManager.cpp
7587 */
7588message MediametricsDrmManagerReported {
7589 optional int64 timestamp_nanos = 1;
7590 optional string package_name = 2;
7591 optional int64 package_version_code = 3;
7592 optional int64 media_apex_version = 4;
7593
7594 enum Method {
7595 METHOD_NOT_FOUND = -1;
7596 GET_CONSTRAINTS = 0;
7597 GET_METADATA = 1;
7598 CAN_HANDLE = 2;
7599 PROCESS_DRM_INFO = 3;
7600 ACQUIRE_DRM_INFO = 4;
7601 SAVE_RIGHTS = 5;
7602 GET_ORIGINAL_MIME_TYPE = 6;
7603 GET_DRM_OBJECT_TYPE = 7;
7604 CHECK_RIGHTS_STATUS = 8;
7605 REMOVE_RIGHTS = 9;
7606 REMOVE_ALL_RIGHTS = 10;
7607 OPEN_CONVERT_SESSION = 11;
7608 OPEN_DECRYPT_SESSION = 12;
7609 }
7610
7611 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7612 optional string plugin_id = 5;
7613 optional string description = 6;
7614 optional Method method = 7;
7615 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007616
7617 optional int64 get_constraints_count = 9;
7618 optional int64 get_metadata_count = 10;
7619 optional int64 can_handle_count = 11;
7620 optional int64 process_drm_info_count = 12;
7621 optional int64 acquire_drm_info_count = 13;
7622 optional int64 save_rights_count = 14;
7623 optional int64 get_original_mime_type_count = 15;
7624 optional int64 get_drm_object_type_count = 16;
7625 optional int64 check_rights_status_count = 17;
7626 optional int64 remove_rights_count = 18;
7627 optional int64 remove_all_rights_count = 19;
7628 optional int64 open_convert_session_count = 20;
7629 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007630}
7631
7632/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007633 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007634 * Pulled from: StatsCompanionService
7635*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007636message DangerousPermissionState {
7637 // Name of the permission
7638 optional string permission_name = 1;
7639
7640 // Uid of the package
7641 optional int32 uid = 2 [(is_uid) = true];
7642
7643 // Package requesting the permission
7644 optional string package_name = 3;
7645
7646 // If the permission is granted to the uid
7647 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007648
7649 // Permission flags as per android.content.pm.PermissionFlags
7650 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007651}
7652
Michael Groover4a0ca942019-01-24 17:41:25 -08007653/**
7654 * Logs when a package is denied access to a device identifier based on the new access requirements.
7655 *
7656 * Logged from:
7657 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7658 */
7659message DeviceIdentifierAccessDenied {
7660 // The name of the package denied access to the requested device identifier.
7661 optional string package_name = 1;
7662
7663 // The name of the device identifier method the package attempted to invoke.
7664 optional string method_name = 2;
7665
7666 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007667 // Starting from Android 11, this boolean is not set and will always be false.
7668 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007669
7670 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007671 // Starting from Android 11, this boolean is not set and will always be false.
7672 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007673}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007674
7675/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007676 * Pulls the ongoing mainline install train version code.
7677 * Pulled from StatsCompanionService
7678 */
7679message TrainInfo {
7680 optional int64 train_version_code = 1;
7681
7682 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007683
7684 optional string train_name = 3;
7685
7686 enum Status {
7687 UNKNOWN = 0;
7688 INSTALL_REQUESTED = 1;
7689 INSTALL_STARTED = 2;
7690 INSTALL_STAGED_NOT_READY = 3;
7691 INSTALL_STAGED_READY = 4;
7692 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007693 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7694 // and INSTALL_FAILURE_COMMIT.
7695 INSTALL_FAILURE = 6 [deprecated = true];
7696 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007697 INSTALL_CANCELLED = 7;
7698 INSTALLER_ROLLBACK_REQUESTED = 8;
7699 INSTALLER_ROLLBACK_INITIATED = 9;
7700 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7701 INSTALLER_ROLLBACK_STAGED = 11;
7702 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7703 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7704 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7705 INSTALLER_ROLLBACK_SUCCESS = 15;
7706 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007707 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7708 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7709 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7710 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7711 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7712 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007713 INSTALL_FAILURE_DOWNLOAD = 23;
7714 INSTALL_FAILURE_STATE_MISMATCH = 24;
7715 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007716 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007717 }
7718 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007719}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007720
7721/**
7722 * Logs the gesture stage changed event.
7723 *
7724 * Logged from:
7725 * frameworks/base/packages/SystemUI/
7726 */
7727message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007728 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007729}
7730
7731/**
7732 * Logs the feedback type.
7733 *
7734 * Logged from:
7735 * frameworks/base/packages/SystemUI/
7736 */
7737message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007738 // Whether or not the gesture was used.
7739 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007740}
7741
7742/**
7743 * Logs the progress.
7744 *
7745 * Logged from:
7746 * frameworks/base/packages/SystemUI/
7747 */
7748message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007749 // [0,100] progress for the assist gesture.
7750 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007751}
Neil Fullerdb14b482019-02-05 19:44:44 +00007752
7753/*
7754 * Information about the time zone data on a device.
7755 */
7756message TimeZoneDataInfo {
7757 // A version identifier for the data set on device. e.g. "2018i"
7758 optional string tzdb_version = 1;
7759}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007760
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007761/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007762 * Logs the GPU stats global health information.
7763 *
7764 * Logged from:
7765 * frameworks/native/services/gpuservice/gpustats/
7766 */
7767message GpuStatsGlobalInfo {
7768 // Package name of the gpu driver.
7769 optional string driver_package_name = 1;
7770
7771 // Version name of the gpu driver.
7772 optional string driver_version_name = 2;
7773
7774 // Version code of the gpu driver.
7775 optional int64 driver_version_code = 3;
7776
7777 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7778 optional int64 driver_build_time = 4;
7779
7780 // Total count of the gl driver gets loaded.
7781 optional int64 gl_loading_count = 5;
7782
7783 // Total count of the gl driver fails to be loaded.
7784 optional int64 gl_loading_failure_count = 6;
7785
7786 // Total count of the Vulkan driver gets loaded.
7787 optional int64 vk_loading_count = 7;
7788
7789 // Total count of the Vulkan driver fails to be loaded.
7790 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007791
7792 // Api version of the system Vulkan driver.
7793 optional int32 vulkan_version = 9;
7794
7795 // Api version of the system CPU Vulkan driver.
7796 optional int32 cpu_vulkan_version = 10;
7797
7798 // Api version of the system GLES driver.
7799 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007800
7801 // Total count of the angle driver gets loaded.
7802 optional int64 angle_loading_count = 12;
7803
7804 // Total count of the angle driver fails to be loaded.
7805 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007806}
7807
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007808/**
7809 * GPU driver loading time info.
7810 */
7811message GpuDriverLoadingTime {
7812 // List of all the driver loading times for this app. The list size is
7813 // capped at 50.
7814 repeated int64 driver_loading_time = 1;
7815}
7816
7817/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007818 * Logs the GPU stats per app health information.
7819 *
7820 * Logged from:
7821 * frameworks/native/services/gpuservice/gpustats/
7822 */
7823message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007824 // Package name of the application that loads the gpu driver. Total number
7825 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007826 optional string app_package_name = 1;
7827
7828 // Version code of the gpu driver this app loads.
7829 optional int64 driver_version_code = 2;
7830
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007831 // gl driver loading time info.
7832 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7833 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007834
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007835 // Vulkan driver loading time info.
7836 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7837 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007838
7839 // Angle driver loading time info.
7840 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7841 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007842
7843 // CPU Vulkan implementation is in use.
7844 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007845
7846 // App is not doing pre-rotation correctly.
7847 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007848
7849 // App creates GLESv1 context.
7850 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007851}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007852
7853/*
7854 * Logs the size of the system ion heap.
7855 *
7856 * Pulled from StatsCompanionService.
7857 */
7858message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007859 // Deprecated due to limited support of ion stats in debugfs.
7860 // Use `IonHeapSize` instead.
7861 option deprecated = true;
7862
Rafal Slawikd4e87572019-03-12 13:08:38 +00007863 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007864 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007865 optional int64 size_in_bytes = 1;
7866}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007867
Rafal Slawik77987ed2019-06-17 12:28:23 +01007868/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007869 * Logs the total size of the ion heap.
7870 *
7871 * Pulled from StatsCompanionService.
7872 */
7873message IonHeapSize {
7874 // Total size of all ion heaps in kilobytes.
7875 // Read from: /sys/kernel/ion/total_heaps_kb.
7876 optional int32 total_size_kb = 1;
7877}
7878
7879/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007880 * Logs the per-process size of the system ion heap.
7881 *
7882 * Pulled from StatsCompanionService.
7883 */
7884message ProcessSystemIonHeapSize {
7885 // The uid if available. -1 means not available.
7886 optional int32 uid = 1 [(is_uid) = true];
7887
7888 // The process name (from /proc/PID/cmdline).
7889 optional string process_name = 2;
7890
7891 // Sum of sizes of all allocations.
7892 optional int32 total_size_in_kilobytes = 3;
7893
7894 // Number of allocations.
7895 optional int32 allocation_count = 4;
7896
7897 // Size of the largest allocation.
7898 optional int32 max_size_in_kilobytes = 5;
7899}
7900
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007901/**
7902 * Push network stack events.
7903 *
7904 * Log from:
7905 * frameworks/base/packages/NetworkStack/
7906 */
7907message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007908 // The id that indicates the event reported from NetworkStack.
7909 optional int32 event_id = 1;
7910 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007911 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7912}
Carmen Agimofa769c152019-03-04 14:39:14 +00007913
7914/**
7915 * Logs the apps that are installed on the external storage.
7916 * Pulled from:
7917 * StatsCompanionService
7918 */
7919message AppsOnExternalStorageInfo {
7920 // The type of the external storage.
7921 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7922 // The name of the package that is installed on the external storage.
7923 optional string package_name = 2;
7924}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007925
7926/**
7927 * Logs the settings related to Face.
7928 * Logged from:
7929 * frameworks/base/services/core/java/com/android/server/stats
7930 */
7931message FaceSettings {
7932 // Whether or not face unlock is allowed on Keyguard.
7933 optional bool unlock_keyguard_enabled = 1;
7934 // Whether or not face unlock dismisses the Keyguard.
7935 optional bool unlock_dismisses_keyguard = 2;
7936 // Whether or not face unlock requires attention.
7937 optional bool unlock_attention_required = 3;
7938 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7939 optional bool unlock_app_enabled = 4;
7940 // Whether or not face unlock always requires user confirmation.
7941 optional bool unlock_always_require_confirmation = 5;
7942 // Whether or not a diverse set of poses are required during enrollment.
7943 optional bool unlock_diversity_required = 6;
7944}
Maggie White442b6312019-04-05 16:26:44 -07007945
7946/**
7947 * Logs cooling devices maintained by the kernel.
7948 *
7949 * Pulled from StatsCompanionService.java
7950 */
7951message CoolingDevice {
7952 // The type of cooling device being reported. Eg. CPU, GPU...
7953 optional android.os.CoolingTypeEnum device_location = 1;
7954 // The name of the cooling device source. Eg. CPU0
7955 optional string device_name = 2;
7956 // Current throttle state of the cooling device. The value can any unsigned
7957 // integer between 0 and max_state defined in its driver. 0 means device is
7958 // not in throttling, higher value means deeper throttling.
7959 optional int32 state = 3;
7960}
Ben Blount763a5d52019-04-10 11:48:58 -07007961
7962/**
7963 * Intelligence has several counter-type events that don't warrant a
7964 * full separate atom. These are primarily API call counters but also include
7965 * counters for feature usage and specific failure modes.
7966 *
7967 * Logged from the Intelligence mainline module.
7968 */
7969message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007970 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007971 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007972 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007973 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007974 // How many times the event occured (to report a batch of high frequency events).
7975 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007976 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007977 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007978}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007979
7980/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007981 * Logs when Car Power state changed.
7982 *
7983 * Logged from:
7984 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7985 */
7986message CarPowerStateChanged {
7987 // States come from CpmsState in CarPowerManagementService.java.
7988 enum State {
7989 WAIT_FOR_VHAL = 0;
7990 ON = 1;
7991 SHUTDOWN_PREPARE = 2;
7992 WAIT_FOR_FINISH = 3;
7993 SUSPEND = 4;
7994 SIMULATE_SLEEP = 5;
7995 }
7996 optional State state = 1;
7997}
7998
7999/**
8000 * Logs whether GarageMode is entered.
8001 *
8002 * Logged from:
8003 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8004 */
8005message GarageModeInfo {
8006 // Whether GarageMode is entered.
8007 optional bool is_garage_mode = 1;
8008}
Martijn Coenencd95d462019-04-25 17:09:45 +02008009
8010/**
8011 * Historical app ops data per package.
8012 */
8013message AppOps {
8014 // Uid of the package requesting the op
8015 optional int32 uid = 1 [(is_uid) = true];
8016
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008017 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008018 optional string package_name = 2;
8019
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008020 // operation id
8021 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008022
8023 // The number of times the op was granted while the app was in the
8024 // foreground (only for trusted requests)
8025 optional int64 trusted_foreground_granted_count = 4;
8026
8027 // The number of times the op was granted while the app was in the
8028 // background (only for trusted requests)
8029 optional int64 trusted_background_granted_count = 5;
8030
8031 // The number of times the op was rejected while the app was in the
8032 // foreground (only for trusted requests)
8033 optional int64 trusted_foreground_rejected_count = 6;
8034
8035 // The number of times the op was rejected while the app was in the
8036 // background (only for trusted requests)
8037 optional int64 trusted_background_rejected_count = 7;
8038
8039 // For long-running operations, total duration of the operation
8040 // while the app was in the foreground (only for trusted requests)
8041 optional int64 trusted_foreground_duration_millis = 8;
8042
8043 // For long-running operations, total duration of the operation
8044 // while the app was in the background (only for trusted requests)
8045 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008046
8047 // Whether AppOps is guarded by Runtime permission
8048 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008049}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008050
8051/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008052 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008053 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008054message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008055 // Uid of the package requesting the op
8056 optional int32 uid = 1 [(is_uid) = true];
8057
8058 // Name of the package performing the op
8059 optional string package_name = 2;
8060
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008061 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8062 // Attributions must be provided through manifest using <attribution> tag available in R and
8063 // above.
8064 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008065
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008066 // operation id
8067 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008068
8069 // The number of times the op was granted while the app was in the
8070 // foreground (only for trusted requests)
8071 optional int64 trusted_foreground_granted_count = 5;
8072
8073 // The number of times the op was granted while the app was in the
8074 // background (only for trusted requests)
8075 optional int64 trusted_background_granted_count = 6;
8076
8077 // The number of times the op was rejected while the app was in the
8078 // foreground (only for trusted requests)
8079 optional int64 trusted_foreground_rejected_count = 7;
8080
8081 // The number of times the op was rejected while the app was in the
8082 // background (only for trusted requests)
8083 optional int64 trusted_background_rejected_count = 8;
8084
8085 // For long-running operations, total duration of the operation
8086 // while the app was in the foreground (only for trusted requests)
8087 optional int64 trusted_foreground_duration_millis = 9;
8088
8089 // For long-running operations, total duration of the operation
8090 // while the app was in the background (only for trusted requests)
8091 optional int64 trusted_background_duration_millis = 10;
8092
8093 // Whether AppOps is guarded by Runtime permission
8094 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008095
8096 // Sampling rate used on device, from 0 to 100
8097 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008098}
8099
8100/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008101 * Location Manager API Usage information(e.g. API under usage,
8102 * API call's parameters).
8103 * Logged from:
8104 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8105 */
8106message LocationManagerApiUsageReported {
8107
8108 // Indicating if usage starts or usage ends.
8109 optional android.stats.location.UsageState state = 1;
8110
8111 // LocationManagerService's API in use.
8112 // We can identify which API from LocationManager is
8113 // invoking current LMS API by the combination of
8114 // API parameter(e.g. is_listener_null, is_intent_null,
8115 // is_location_request_null)
8116 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8117
8118 // Name of the package calling the API.
8119 optional string calling_package_name = 3;
8120
8121 // Type of the location provider.
8122 optional android.stats.location.ProviderType provider = 4;
8123
8124 // Quality of the location request
8125 optional android.stats.location.LocationRequestQuality quality = 5;
8126
8127 // The desired interval for active location updates, in milliseconds.
8128 // Bucketized to reduce cardinality.
8129 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8130
8131 // Minimum distance between location updates, in meters.
8132 // Bucketized to reduce cardinality.
8133 optional android.stats.location.SmallestDisplacementBucket
8134 bucketized_smallest_displacement = 7;
8135
8136 // The number of location updates.
8137 optional int64 num_updates = 8;
8138
8139 // The request expiration time, in millisecond since boot.
8140 // Bucketized to reduce cardinality.
8141 optional android.stats.location.ExpirationBucket
8142 bucketized_expire_in = 9;
8143
8144 // Type of Callback passed in for this API.
8145 optional android.stats.location.CallbackType callback_type = 10;
8146
8147 // The radius of the central point of the alert
8148 // region, in meters. Only for API REQUEST_GEOFENCE.
8149 // Bucketized to reduce cardinality.
8150 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8151
8152 // Activity Importance of API caller.
8153 // Categorized to 3 types that are interesting from location's perspective.
8154 optional android.stats.location.ActivityImportance activiy_importance = 12;
8155}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008156
8157/**
8158 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8159 */
8160message ReviewPermissionsFragmentResultReported {
8161 // unique value identifying a permission group change. A permission group change might result
8162 // in multiple of these atoms
8163 optional int64 change_id = 1;
8164
8165 // UID of package the permission belongs to
8166 optional int32 uid = 2 [(is_uid) = true];
8167
8168 // Name of package the permission belongs to
8169 optional string package_name = 3;
8170
8171 // The permission to be granted
8172 optional string permission_name = 4;
8173
8174 // The result of the permission grant
8175 optional bool permission_granted = 5;
8176}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008177
8178/**
8179* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8180* Logged from: RuntimePermissionUpdgradeController
8181*/
8182message RuntimePermissionsUpgradeResult {
8183 // Permission granted as result of upgrade
8184 optional string permission_name = 1;
8185
8186 // UID of package granted permission
8187 optional int32 uid = 2 [(is_uid) = true];
8188
8189 // Name of package granted permission
8190 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008191}
8192
8193/**
8194* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8195*/
8196message GrantPermissionsActivityButtonActions {
8197 // Permission granted as result of upgrade
8198 optional string permission_group_name = 1;
8199
8200 // UID of package granted permission
8201 optional int32 uid = 2 [(is_uid) = true];
8202
8203 // Name of package requesting permission
8204 optional string package_name = 3;
8205
8206 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8207 // LABEL_ constants in GrantPermissionActivity.java
8208 optional int32 buttons_presented = 4;
8209
8210 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8211 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008212
8213 // id which identifies single session of user interacting with permission controller
8214 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008215}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008216
8217/**
8218 * Information about LocationAccessCheck notification presented to user
8219 */
8220message LocationAccessCheckNotificationAction {
8221
8222 // id which identifies single session of user interacting with permission controller
8223 optional int64 session_id = 1;
8224
8225 // Uid of package for which location access check is presented
8226 optional int32 package_uid = 2;
8227
8228 // Name of package for which location access check is presented
8229 optional string package_name = 3;
8230
8231 enum Result {
8232 UNDEFINED = 0;
8233 // notification was presented to the user
8234 NOTIFICATION_PRESENTED = 1;
8235 // notification was declined by the user
8236 NOTIFICATION_DECLINED = 2;
8237 // notification was clicked by the user
8238 NOTIFICATION_CLICKED = 3;
8239 }
8240
8241 // View / interaction recorded
8242 optional Result result = 4;
8243}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008244
8245/**
8246 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8247 */
8248message AppPermissionFragmentActionReported {
8249 // id which identifies single session of user interacting with permission controller
8250 optional int64 session_id = 1;
8251
8252 // unique value identifying a permission group change. A permission group change might result
8253 // in multiple of these atoms
8254 optional int64 change_id = 2;
8255
8256 // UID of package the permission belongs to
8257 optional int32 uid = 3 [(is_uid) = true];
8258
8259 // Name of package the permission belongs to
8260 optional string package_name = 4;
8261
8262 // The permission to be granted
8263 optional string permission_name = 5;
8264
8265 // The result of the permission grant
8266 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008267
8268 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8269 optional int32 permission_flags = 7;
8270
8271 enum Button {
8272 UNDEFINED = 0;
8273 // Allow button
8274 ALLOW = 1;
8275 // Deny button
8276 DENY = 2;
8277 // Ask every time button
8278 ASK_EVERY_TIME = 3;
8279 // Allow all the time button
8280 ALLOW_ALWAYS = 4;
8281 // Allow only while using the app button
8282 ALLOW_FOREGROUND = 5;
8283 // Same is Deny button but shown in while in use dialog
8284 DENY_FOREGROUND = 6;
8285 }
8286
8287 // Button pressed in the dialog
8288 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008289}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008290
8291/**
8292* Information about a AppPermissionFragment viewed by user
8293*/
8294message AppPermissionFragmentViewed {
8295 // id which identifies single session of user interacting with permission controller
8296 optional int64 session_id = 1;
8297
8298 // UID of package for which permissions are viewed
8299 optional int32 uid = 2 [(is_uid) = true];
8300
8301 // Name of package for which permissions are viewed
8302 optional string package_name = 3;
8303
8304 // Permission group viewed
8305 optional string permission_group_name = 4;
8306}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008307
8308/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008309* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8310* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008311*/
8312message AppPermissionsFragmentViewed {
8313 // id which identifies single session of user interacting with permission controller
8314 optional int64 session_id = 1;
8315
8316 // id which identifies single view as every view might have several logging records
8317 // with different package information attached
8318 optional int64 view_id = 2;
8319
8320 // Permission group viewed
8321 optional string permission_group_name = 3;
8322
8323 // UID of package for which permissions are viewed
8324 optional int32 uid = 4 [(is_uid) = true];
8325
8326 // Name of package for which permissions are viewed
8327 optional string package_name = 5;
8328
8329 // Category in which permission is included
8330 enum Category {
8331 UNDEFINED = 0;
8332 ALLOWED = 1;
8333 ALLOWED_FOREGROUND = 2;
8334 DENIED = 3;
8335 }
8336 optional Category category = 6;
8337}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008338/**
8339* Information about a PermissionAppsFragment viewed by user.
8340* Logged from ui/handheld/PermissionAppsFragment.java
8341*/
8342message PermissionAppsFragmentViewed {
8343 // id which identifies single session of user interacting with permission controller
8344 optional int64 session_id = 1;
8345
8346 // id which identifies single view as every view might have several logging records
8347 // with different package information attached
8348 optional int64 view_id = 2;
8349
8350 // Permission group viewed
8351 optional string permission_group_name = 3;
8352
8353 // UID of package for which permissions are viewed
8354 optional int32 uid = 4 [(is_uid) = true];
8355
8356 // Name of package for which permissions are viewed
8357 optional string package_name = 5;
8358
8359 // Category in which app is included
8360 enum Category {
8361 UNDEFINED = 0;
8362 ALLOWED = 1;
8363 ALLOWED_FOREGROUND = 2;
8364 DENIED = 3;
8365 }
8366 optional Category category = 6;
8367}
Tony Make2b1b672019-07-29 16:59:47 +01008368
8369/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008370* Log that the Auto Revoke notification has been clicked
8371* Logged from ui/ManagePermissionsActivity
8372*/
8373message AutoRevokeNotificationClicked {
8374 // id which identifies single session of user interacting with permission controller
8375 optional int64 session_id = 1;
8376}
8377
8378/**
8379* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8380* auto revoked for it.
8381* Logged from ui/handheld/AutoRevokeFragment
8382*/
8383message AutoRevokeFragmentAppViewed {
8384 // id which identifies single session of user interacting with permission controller
8385 optional int64 session_id = 1;
8386
8387 // UID of package for which permissions are viewed
8388 optional int32 uid = 2 [(is_uid) = true];
8389
8390 // Name of package for which permissions are viewed
8391 optional string package_name = 3;
8392
8393 // The name of a permission group that has been revoked
8394 optional string permission_group_name = 4;
8395
8396 // The age of the app- more than three months old, or more than six months
8397 enum Age {
8398 UNDEFINED = 0;
8399 NEWER_BUCKET = 1;
8400 OLDER_BUCKET = 2;
8401 }
8402
8403 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8404 optional Age age = 5;
8405}
8406
8407/**
8408* Log that the user has interacted with an app on the auto revoke fragment
8409* Logged from ui/handheld/AutoRevokeFragment
8410*/
8411message AutoRevokedAppInteraction {
8412 // id which identifies single session of user interacting with permission controller
8413 optional int64 session_id = 1;
8414
8415 // UID of package for which permissions are viewed
8416 optional int32 uid = 2 [(is_uid) = true];
8417
8418 // Name of package for which permissions are viewed
8419 optional string package_name = 3;
8420
8421 enum Action {
8422 UNDEFINED = 0;
8423 REMOVE = 1;
8424 OPEN = 2;
8425 APP_INFO = 3;
8426 PERMISSIONS = 4;
8427 REMOVE_IN_SETTINGS = 5;
8428 OPEN_IN_SETTINGS = 6;
8429 }
8430
8431 // The action the user took to interact with the app
8432 optional Action action = 4;
8433}
8434
8435/**
8436* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8437* auto revoke, or that the auto revoke switch has been changed
8438* Logged from ui/handheld/AppPermissionGroupsFragment
8439 */
8440message AppPermissionGroupsFragmentAutoRevokeAction {
8441 // id which identifies single session of user interacting with permission controller
8442 optional int64 session_id = 1;
8443
8444 // UID of package for which permissions are viewed
8445 optional int32 uid = 2 [(is_uid) = true];
8446
8447 // Name of package for which permissions are viewed
8448 optional string package_name = 3;
8449
8450 enum Action {
8451 UNDEFINED = 0;
8452 OPENED_FOR_AUTO_REVOKE = 1;
8453 OPENED_FROM_INTENT = 2;
8454 SWITCH_ENABLED = 3;
8455 SWITCH_DISABLED = 4;
8456 }
8457
8458 // The action the user took to interact with the fragment
8459 optional Action action = 4;
8460}
8461
8462/**
Tony Make2b1b672019-07-29 16:59:47 +01008463 * Logs when there is a smart selection related event.
8464 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8465 * Logged from: TextClassifierEventLogger.java
8466 */
8467message TextSelectionEvent {
8468 // A session ID.
8469 optional string session_id = 1;
8470
8471 // Event type of this event.
8472 optional android.stats.textclassifier.EventType event_type = 2;
8473
Tony Mak9c84bd22019-12-09 07:27:25 +00008474 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008475 optional string model_name = 3;
8476
8477 // Type of widget that was involved in triggering this event.
8478 optional android.stats.textclassifier.WidgetType widget_type = 4;
8479
8480 // Index of this event in a session.
8481 optional int32 event_index = 5;
8482
8483 // Entity type that is involved.
8484 optional string entity_type = 6;
8485
8486 // Relative word index of the start of the selection.
8487 optional int32 relative_word_start_index = 7;
8488
8489 // Relative word (exclusive) index of the end of the selection.
8490 optional int32 relative_word_end_index = 8;
8491
8492 // Relative word index of the start of the smart selection.
8493 optional int32 relative_suggested_word_start_index = 9;
8494
8495 // Relative word (exclusive) index of the end of the smart selection.
8496 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008497
8498 // Name of source package.
8499 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008500
8501 // Name of the LangID model that is involved in this event.
8502 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008503}
8504
8505/**
8506 * Logs when there is a smart linkify related event.
8507 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8508 * Logged from: TextClassifierEventLogger.java
8509 */
8510message TextLinkifyEvent {
8511 // A session ID.
8512 optional string session_id = 1;
8513
8514 // Event type of this event.
8515 optional android.stats.textclassifier.EventType event_type = 2;
8516
Tony Mak9c84bd22019-12-09 07:27:25 +00008517 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008518 optional string model_name = 3;
8519
8520 // Type of widget that was involved in triggering this event.
8521 optional android.stats.textclassifier.WidgetType widget_type = 4;
8522
8523 // Index of this event in a session.
8524 optional int32 event_index = 5;
8525
8526 // Entity type that is involved.
8527 optional string entity_type = 6;
8528
8529 // Number of links detected.
8530 optional int32 num_links = 7;
8531
8532 // The total length of all links.
8533 optional int32 linked_text_length = 8;
8534
8535 // Length of input text.
8536 optional int32 text_length = 9;
8537
8538 // Time spent on generating links in ms.
8539 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008540
8541 // Name of source package.
8542 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008543
8544 // Name of the LangID model that is involved in this event.
8545 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008546}
8547
8548/**
8549 * Logs when there is a conversation actions related event.
8550 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8551 * Logged from: TextClassifierEventLogger.java
8552 */
8553message ConversationActionsEvent {
8554 // A session ID.
8555 optional string session_id = 1;
8556
8557 // Event type of this event.
8558 optional android.stats.textclassifier.EventType event_type = 2;
8559
Tony Mak9c84bd22019-12-09 07:27:25 +00008560 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008561 optional string model_name = 3;
8562
8563 // Type of widget that was involved in triggering this event.
8564 optional android.stats.textclassifier.WidgetType widget_type = 4;
8565
8566 // The first entity type that is involved.
8567 optional string first_entity_type = 5;
8568
8569 // The second entity type that is involved.
8570 optional string second_entity_type = 6;
8571
8572 // The third entity type that is involved.
8573 optional string third_entity_type = 7;
8574
8575 // The score of the first entity type.
8576 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008577
8578 // Name of source package.
8579 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008580
8581 // Name of the annotator model that is involved in this event.
8582 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008583
8584 // Name of the LangID model that is involved in this event.
8585 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008586}
8587
8588/**
8589 * Logs when there is a language detection related event.
8590 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8591 * Logged from: TextClassifierEventLogger.java
8592 */
8593message LanguageDetectionEvent {
8594 // A session ID.
8595 optional string session_id = 1;
8596
8597 // Event type of this event.
8598 optional android.stats.textclassifier.EventType event_type = 2;
8599
Tony Mak9c84bd22019-12-09 07:27:25 +00008600 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008601 optional string model_name = 3;
8602
8603 // Type of widget that was involved in triggering this event.
8604 optional android.stats.textclassifier.WidgetType widget_type = 4;
8605
8606 // Detected language.
8607 optional string language_tag = 5;
8608
8609 // Score of the detected language.
8610 optional float score = 6;
8611
8612 // Position of this action.
8613 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008614
8615 // Name of source package.
8616 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008617}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008618
8619/**
8620 * Information about an OTA update attempt by update_engine.
8621 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8622 */
8623message UpdateEngineUpdateAttemptReported {
8624 // The number of attempts for the update engine to apply a given payload.
8625 optional int32 attempt_number = 1;
8626
8627 optional android.stats.otaupdate.PayloadType payload_type = 2;
8628
8629 // The total time in minutes for the update engine to apply a given payload.
8630 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8631 // it's increased when the system is sleeping.
8632 optional int32 duration_boottime_in_minutes = 3;
8633
8634 // The total time in minutes for the update engine to apply a given payload.
8635 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8636 // and it's not increased when the system is sleeping.
8637 optional int32 duration_monotonic_in_minutes = 4;
8638
8639 // The size of the payload in MiBs.
8640 optional int32 payload_size_mib = 5;
8641
8642 // The attempt result reported by the update engine for an OTA update.
8643 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8644
8645 // The error code reported by the update engine after an OTA update attempt
8646 // on A/B devices.
8647 optional android.stats.otaupdate.ErrorCode error_code = 7;
8648
8649 // The build fingerprint of the source system. The value is read from a
8650 // system property when the device takes the update. e.g.
8651 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8652 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008653
8654 // Size of super partition.
8655 optional int64 super_partition_size_bytes = 9;
8656
8657 // Size of current slot within the super partition.
8658 optional int64 slot_size_bytes = 10;
8659
8660 // Free space available in the super partition.
8661 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008662}
8663
8664/**
8665 * Information about all the attempts the device make before finishing the
8666 * successful update.
8667 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8668 */
8669message UpdateEngineSuccessfulUpdateReported {
8670 // The number of attempts for the update engine to apply the payload for a
8671 // successful update.
8672 optional int32 attempt_count = 1;
8673
8674 optional android.stats.otaupdate.PayloadType payload_type = 2;
8675
8676 optional int32 payload_size_mib = 3;
8677
8678 // The total number of bytes downloaded by update_engine since the last
8679 // successful update.
8680 optional int32 total_bytes_downloaded_mib = 4;
8681
8682 // The ratio in percentage of the over-downloaded bytes compared to the
8683 // total bytes needed to successfully install the update. e.g. 200 if we
8684 // download 200MiB in total for a 100MiB package.
8685 optional int32 download_overhead_percentage = 5;
8686
8687 // The total time in minutes for the update engine to apply the payload for a
8688 // successful update.
8689 optional int32 total_duration_minutes = 6;
8690
8691 // The number of reboot of the device during a successful update.
8692 optional int32 reboot_count = 7;
8693}
Alec Mourie088e762019-07-02 13:10:55 -07008694
8695/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008696 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8697 * key to indicate whether it was successful or not.
8698 *
8699 * Logged from:
8700 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8701 */
8702message RebootEscrowRecoveryReported {
8703 optional bool successful = 1;
8704}
8705
8706/**
Alec Mourie088e762019-07-02 13:10:55 -07008707 * Global display pipeline metrics reported by SurfaceFlinger.
8708 * Pulled from:
8709 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8710 */
8711message SurfaceflingerStatsGlobalInfo {
8712 // Total number of frames presented during the tracing period
8713 optional int64 total_frames = 1;
8714 // Total number of frames missed
8715 optional int64 missed_frames = 2;
8716 // Total number of frames that fell back to client composition
8717 optional int64 client_composition_frames = 3;
8718 // Total time the display was turned on
8719 optional int64 display_on_millis = 4;
8720 // Total time that was spent performing animations.
8721 // This is derived from the present-to-present layer histogram
8722 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008723 // Total number of event connections tracked by SurfaceFlinger at the time
8724 // of this pull. If this number grows prohibitively large, then this can
8725 // cause jank due to resource contention.
8726 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008727 // Set of timings measured from when SurfaceFlinger began compositing a
8728 // frame, until the frame was requested to be presented to the display. This
8729 // measures SurfaceFlinger's total CPU walltime on the critical path per
8730 // frame.
8731 optional FrameTimingHistogram frame_duration = 7
8732 [(android.os.statsd.log_mode) = MODE_BYTES];
8733 // Set of timings measured from when SurfaceFlinger first began using the
8734 // GPU to composite a frame, until the GPU has finished compositing that
8735 // frame. This measures the total additional time SurfaceFlinger needed to
8736 // perform due to falling back into GPU composition.
8737 optional FrameTimingHistogram render_engine_timing = 8
8738 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008739}
8740
8741/**
8742 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8743 * The number of layers uploaded will be restricted due to size limitations.
8744 * Pulled from:
8745 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8746 */
8747message SurfaceflingerStatsLayerInfo {
8748 // The layer for this set of metrics
8749 // For now we can infer that the package name is included in the layer
8750 // name.
8751 optional string layer_name = 1;
8752 // Total number of frames presented
8753 optional int64 total_frames = 2;
8754 // Total number of dropped frames while latching a buffer for this layer.
8755 optional int64 dropped_frames = 3;
8756 // Set of timings measured between successive presentation timestamps.
8757 optional FrameTimingHistogram present_to_present = 4
8758 [(android.os.statsd.log_mode) = MODE_BYTES];
8759 // Set of timings measured from when an app queued a buffer for
8760 // presentation, until the buffer was actually presented to the
8761 // display.
8762 optional FrameTimingHistogram post_to_present = 5
8763 [(android.os.statsd.log_mode) = MODE_BYTES];
8764 // Set of timings measured from when a buffer is ready to be presented,
8765 // until the buffer was actually presented to the display.
8766 optional FrameTimingHistogram acquire_to_present = 6
8767 [(android.os.statsd.log_mode) = MODE_BYTES];
8768 // Set of timings measured from when a buffer was latched by
8769 // SurfaceFlinger, until the buffer was presented to the display
8770 optional FrameTimingHistogram latch_to_present = 7
8771 [(android.os.statsd.log_mode) = MODE_BYTES];
8772 // Set of timings measured from the desired presentation to the actual
8773 // presentation time
8774 optional FrameTimingHistogram desired_to_present = 8
8775 [(android.os.statsd.log_mode) = MODE_BYTES];
8776 // Set of timings measured from when an app queued a buffer for
8777 // presentation, until the buffer was ready to be presented.
8778 optional FrameTimingHistogram post_to_acquire = 9
8779 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008780 // Frames missed latch because the acquire fence didn't fire
8781 optional int64 late_acquire_frames = 10;
8782 // Frames latched early because the desired present time was bad
8783 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008784}
8785
8786/**
8787 * Histogram of frame counts bucketed by time in milliseconds.
8788 * Because of size limitations, we hard-cap the number of buckets, with
8789 * buckets for corresponding to larger milliseconds being less precise.
8790 */
8791message FrameTimingHistogram {
8792 // Timings in milliseconds that describes a set of histogram buckets
8793 repeated int32 time_millis_buckets = 1;
8794 // Number of frames that match to each time_millis, i.e. the bucket
8795 // contents
8796 // It's required that len(time_millis) == len(frame_count)
8797 repeated int64 frame_counts = 2;
8798}
Emilian Peev6729f372019-08-29 09:14:09 -07008799
Emilian Peev6729f372019-08-29 09:14:09 -07008800/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008801 * Janky event as reported by SurfaceFlinger.
8802 * This event is intended to be consumed by a Perfetto subscriber for
8803 * automated trace collection.
8804 *
8805 * Logged from:
8806 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8807 */
8808message DisplayJankReported {
8809 // Informational field for how long the janky event lasted in milliseconds
8810 optional int64 event_duration_millis = 1;
8811 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8812 // the display on time.
8813 optional int32 present_deadlines_missed = 2;
8814}
8815
8816/**
Emilian Peev6729f372019-08-29 09:14:09 -07008817 * Information about camera facing and API level usage.
8818 * Logged from:
8819 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8820 */
8821message CameraActionEvent {
8822 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008823 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008824
8825 // Camera API level used
8826 optional int32 api_level = 2;
8827
8828 // Name of client package
8829 optional string package_name = 3;
8830
8831 // Camera facing
8832 enum Facing {
8833 UNKNOWN = 0;
8834 BACK = 1;
8835 FRONT = 2;
8836 EXTERNAL = 3;
8837 }
8838 optional Facing facing = 4;
8839}
atrost01a20932019-08-28 15:40:37 +01008840
8841/**
8842 * Logs when a compatibility change is affecting an app.
8843 *
8844 * Logged from:
8845 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8846 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8847 */
8848message AppCompatibilityChangeReported {
8849 // The UID of the app being affected by the compatibilty change.
8850 optional int32 uid = 1 [(is_uid) = true];
8851
8852 // The ID of the change affecting the app.
8853 optional int64 change_id = 2;
8854
8855 enum State {
8856 UNKNOWN_STATE = 0;
8857 ENABLED = 1;
8858 DISABLED = 2;
8859 LOGGED = 3;
8860 }
8861
8862 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8863 // logged otherwise.
8864 optional State state = 3;
8865
8866 enum Source {
8867 UNKNOWN_SOURCE = 0;
8868 APP_PROCESS = 1;
8869 SYSTEM_SERVER = 2;
8870 }
8871
8872 // Where it was logged from.
8873 optional Source source = 4;
8874
8875}
Hector Dearman40579f62019-11-01 13:19:30 +00008876
8877/**
8878 * Logged from
8879 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8880 */
8881message PerfettoUploaded {
8882 enum Event {
8883 PERFETTO_UNDEFINED = 0;
8884 PERFETTO_TRACE_BEGIN = 1;
8885 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8886 PERFETTO_ON_CONNECT = 3;
8887 PERFETTO_ON_TRACING_DISABLED = 4;
8888 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8889 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8890 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8891 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8892 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8893 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8894 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8895 PERFETTO_TRIGGER_BEGIN = 12;
8896 PERFETTO_TRIGGER_SUCCESS = 13;
8897 PERFETTO_TRIGGER_FAILURE = 14;
8898 PERFETTO_HIT_GUARDRAILS = 15;
8899 PERFETTO_ON_TIMEOUT = 16;
8900 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8901 }
8902
8903 // Which stage of the pipeline we are reporting from.
8904 optional Event event = 1;
8905
8906 // UUID matching the one set inside the SystemInfo trace packet.
8907 optional int64 trace_uuid_lsb = 2;
8908 optional int64 trace_uuid_msb = 3;
8909}
Mark Tabrya824a642019-11-05 12:26:12 -08008910
8911/**
8912 * Pulls client metrics on data transferred via Vehicle Maps Service.
8913 * Metrics are keyed by uid + layer.
8914 *
8915 * Pulled from:
8916 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8917 */
8918message VmsClientStats {
8919 // UID of the VMS client app
8920 optional int32 uid = 1 [(is_uid) = true];
8921
8922 // VMS layer definition
8923 optional int32 layer_type = 2;
8924 optional int32 layer_channel = 3;
8925 optional int32 layer_version = 4;
8926
8927 // Bytes and packets sent by the client for the layer
8928 optional int64 tx_bytes = 5;
8929 optional int64 tx_packets = 6;
8930
8931 // Bytes and packets received by the client for the layer
8932 optional int64 rx_bytes = 7;
8933 optional int64 rx_packets = 8;
8934
8935 // Bytes and packets dropped due to client error
8936 optional int64 dropped_bytes = 9;
8937 optional int64 dropped_packets = 10;
8938}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008939
8940/**
8941 * State of a dangerous permission requested by a package - sampled
8942 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8943*/
8944message DangerousPermissionStateSampled {
8945 // Name of the permission
8946 optional string permission_name = 1;
8947
8948 // Uid of the package
8949 optional int32 uid = 2 [(is_uid) = true];
8950
8951 // If the permission is granted to the uid
8952 optional bool is_granted = 3;
8953
8954 // Permission flags as per android.content.pm.PermissionFlags
8955 optional int32 permission_flags = 4;
8956}
8957
Stan Iliev637ba5e2019-08-16 13:43:08 -04008958/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008959 * HWUI stats for a given app.
8960 */
8961message GraphicsStats {
8962 // The package name of the app
8963 optional string package_name = 1;
8964
8965 // The version code of the app
8966 optional int64 version_code = 2;
8967
8968 // The start & end timestamps in UTC as
8969 // milliseconds since January 1, 1970
8970 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008971 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008972
Stan Ilievb6517192020-02-18 10:12:42 -05008973 optional int64 end_millis = 4;
8974
8975 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8976 enum PipelineType {
8977 UNKNOWN = 0;
8978 GL = 1;
8979 VULKAN = 2;
8980 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008981
8982 // HWUI renders pipeline type: GL or Vulkan.
8983 optional PipelineType pipeline = 5;
8984
8985 // Distinct frame count.
8986 optional int32 total_frames = 6;
8987
8988 // Number of "missed vsync" events.
8989 optional int32 missed_vsync_count = 7;
8990
8991 // Number of frames in triple-buffering scenario (high input latency)
8992 optional int32 high_input_latency_count = 8;
8993
8994 // Number of "slow UI thread" events.
8995 optional int32 slow_ui_thread_count = 9;
8996
8997 // Number of "slow bitmap upload" events.
8998 optional int32 slow_bitmap_upload_count = 10;
8999
9000 // Number of "slow draw" events.
9001 optional int32 slow_draw_count = 11;
9002
9003 // Number of frames that missed their deadline (aka, visibly janked)
9004 optional int32 missed_deadline_count = 12;
9005
9006 // The frame time histogram for the package
9007 optional FrameTimingHistogram cpu_histogram = 13
9008 [(android.os.statsd.log_mode) = MODE_BYTES];
9009
9010 // The gpu frame time histogram for the package
9011 optional FrameTimingHistogram gpu_histogram = 14
9012 [(android.os.statsd.log_mode) = MODE_BYTES];
9013
9014 // UI mainline module version.
9015 optional int64 version_ui_module = 15;
9016
9017 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9018 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9019 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9020 // more apps are running / rendering.
9021 optional bool is_today = 16;
9022}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009023
9024/**
9025 * Message related to dangerous (runtime) app ops access
9026 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009027message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009028 // Uid of the package accessing app op
9029 optional int32 uid = 1 [(is_uid) = true];
9030
9031 // Name of the package accessing app op
9032 optional string package_name = 2;
9033
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009034 // deprecated - set to empty string
9035 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009036
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009037 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009038 // API. Attributions must be provided through manifest using <attribution> tag available in R
9039 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009040 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009041
9042 // message related to app op access, limited to 600 chars by API
9043 optional string message = 5;
9044
9045 enum SamplingStrategy {
9046 DEFAULT = 0;
9047 UNIFORM = 1;
9048 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009049 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009050 }
9051
9052 // sampling strategy used to collect this message
9053 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009054
9055 // operation id
9056 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009057}
9058
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009059/*
9060 * Logs userspace reboot outcome and duration.
9061 *
9062 * Logged from:
9063 * frameworks/base/core/java/com/android/server/BootReceiver.java
9064 */
9065message UserspaceRebootReported {
9066 // Possible outcomes of userspace reboot.
9067 enum Outcome {
9068 // Default value in case platform failed to determine the outcome.
9069 OUTCOME_UNKNOWN = 0;
9070 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9071 SUCCESS = 1;
9072 // Userspace reboot shutdown sequence was aborted.
9073 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9074 // Remounting userdata into checkpointing mode failed.
9075 FAILED_USERDATA_REMOUNT = 3;
9076 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9077 // reboot.
9078 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9079 }
9080 // Outcome of userspace reboot. Always set.
9081 optional Outcome outcome = 1;
9082 // Duration of userspace reboot in case it has a successful outcome.
9083 // Duration is measured as time between userspace reboot was initiated and until boot completed
9084 // (e.g. sys.boot_completed=1).
9085 optional int64 duration_millis = 2;
9086 // State of primary user's (user0) credential encryption storage.
9087 enum UserEncryptionState {
9088 // Default value.
9089 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9090 // Credential encrypted storage is unlocked.
9091 UNLOCKED = 1;
9092 // Credential encrypted storage is locked.
9093 LOCKED = 2;
9094 }
9095 // State of primary user's encryption storage at the moment boot completed. Always set.
9096 optional UserEncryptionState user_encryption_state = 3;
9097}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009098
9099/*
9100 * Logs integrity check information during each install.
9101 *
9102 * Logged from:
9103 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9104 */
9105message IntegrityCheckResultReported {
9106 optional string package_name = 1;
9107 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009108 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009109 optional string installer_package_name = 4;
9110 enum Response {
9111 UNKNOWN = 0;
9112 ALLOWED = 1;
9113 REJECTED = 2;
9114 FORCE_ALLOWED = 3;
9115 }
9116 optional Response response = 5;
9117 // An estimate on the cause of the response. This will only be populated for
9118 // REJECTED and FORCE_ALLOWED
9119 optional bool caused_by_app_cert_rule = 6;
9120 optional bool caused_by_installer_rule = 7;
9121}
9122
9123/**
9124 * Logs the information about the rules and the provider whenever rules are
9125 * pushed into AppIntegrityManager.
9126 *
9127 * Logged from:
9128 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9129 */
9130message IntegrityRulesPushed {
9131 optional bool success = 1;
9132 // Package name of the app that pushed the rules.
9133 optional string rule_provider = 2;
9134 // Version string of arbitrary format provided by the rule provider to
9135 // identify the rules.
9136 optional string rule_version = 3;
9137}
Jordan Liubedfa702019-12-20 15:08:45 -08009138
9139/**
9140 * Logs when a cell broadcast message is received on the device.
9141 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009142 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009143 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009144 * packages/apps/CellBroadcastReceiver/
9145 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009146 */
9147message CellBroadcastMessageReported {
9148 // The type of Cell Broadcast message
9149 enum CbType {
9150 UNKNOWN_TYPE = 0;
9151 GSM = 1;
9152 CDMA = 2;
9153 CDMA_SPC = 3;
9154 }
9155
Jordan Liu900e5cb2020-05-29 09:44:59 -07009156 // The parts of the cell broadcast message pipeline
9157 enum ReportSource {
9158 UNKNOWN_SOURCE = 0;
9159 FRAMEWORK = 1;
9160 CB_SERVICE = 2;
9161 CB_RECEIVER_APP = 3;
9162 }
9163
Jordan Liubedfa702019-12-20 15:08:45 -08009164 // GSM, CDMA, CDMA-SCP
9165 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009166
9167 // The source of the report
9168 optional ReportSource source = 2;
9169}
9170
9171/**
9172 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9173 *
9174 * Logged from CellBroadcastService module:
9175 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9176 */
9177message CellBroadcastMessageFiltered {
9178 enum FilterReason {
9179 NOT_FILTERED = 0;
9180 DUPLICATE_MESSAGE = 1;
9181 GEOFENCED_MESSAGE = 2;
9182 AREA_INFO_MESSAGE = 3;
9183 }
9184
9185 // GSM, CDMA, CDMA-SCP
9186 optional CellBroadcastMessageReported.CbType type = 1;
9187
9188 // The source of the report
9189 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009190}
9191
9192/**
9193 * Logs when an error occurs while handling a cell broadcast message;
9194 *
9195 * Logged from CellBroadcastService module:
9196 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9197 */
9198message CellBroadcastMessageError {
9199 // The type of error raised when trying to handle a cell broadcast message
9200 enum ErrorType {
9201 UNKNOWN_TYPE = 0;
9202 CDMA_DECODING_ERROR = 1;
9203 CDMA_SCP_EMPTY = 2;
9204 CDMA_SCP_HANDLING_ERROR = 3;
9205 GSM_INVALID_HEADER_LENGTH = 4;
9206 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9207 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9208 GSM_INVALID_PDU = 7;
9209 GSM_INVALID_GEO_FENCING_DATA = 8;
9210 GSM_UMTS_INVALID_WAC = 9;
9211 FAILED_TO_INSERT_TO_DB = 10;
9212 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9213 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9214 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9215 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009216 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009217 }
9218
9219 // What kind of error occurred
9220 optional ErrorType type = 1;
9221
9222 // Exception message (or log message) associated with the error (max 1000 chars)
9223 optional string exception_message = 2;
9224}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009225
9226/**
Henry Fange316ab62020-04-21 18:43:14 -07009227 * Logs when a tune occurs through device's Frontend.
9228 * This is atom ID 276.
9229 *
9230 * Logged from:
9231 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9232 */
9233message TvTunerStateChanged {
9234 enum State {
9235 UNKNOWN = 0;
9236 TUNING = 1; // Signal is tuned
9237 LOCKED = 2; // the signal is locked
9238 NOT_LOCKED = 3; // the signal isn’t locked.
9239 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9240 SCANNING = 5; // the signal is scanned
9241 SCAN_STOPPED = 6; // the scan is stopped.
9242 }
9243 // The uid of the application that sent this custom atom.
9244 optional int32 uid = 1 [(is_uid) = true];
9245 // new state
9246 optional State state = 2;
9247}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009248
9249/**
9250 * Logs the status of a dvr playback or record.
9251 * This is atom ID 279.
9252 *
9253 * Logged from:
9254 * frameworks/base/media/java/android/media/tv/tuner/dvr
9255 */
9256message TvTunerDvrStatus {
9257 enum Type {
9258 UNKNOWN_TYPE = 0;
9259 PLAYBACK = 1; // is a playback
9260 RECORD = 2; // is a record
9261 }
9262 enum State {
9263 UNKNOWN_STATE = 0;
9264 STARTED = 1; // DVR is started
9265 STOPPED = 2; // DVR is stopped
9266 }
9267 // The uid of the application that sent this custom atom.
9268 optional int32 uid = 1 [(is_uid) = true];
9269 // DVR type
9270 optional Type type = 2;
9271 // DVR state
9272 optional State state = 3;
9273 // Identify the segment of a record or playback
9274 optional int32 segment_id = 4;
9275 // indicate how many overflow or underflow happened between started to stopped
9276 optional int32 overflow_underflow_count = 5;
9277}
Henry Fangfd40c072020-06-01 14:59:17 -07009278
9279/**
9280 * Logs when a cas session opened through MediaCas.
9281 * This is atom ID 280.
9282 *
9283 * Logged from:
9284 * frameworks/base/media/java/android/media/MediaCas.java
9285 */
9286message TvCasSessionOpenStatus {
9287 enum State {
9288 UNKNOWN = 0;
9289 SUCCEEDED = 1; // indicate that the session is opened successfully.
9290 FAILED = 2; // indicate that the session isn’t opened successfully.
9291 }
9292 // The uid of the application that sent this custom atom.
9293 optional int32 uid = 1 [(is_uid) = true];
9294 // Cas system Id
9295 optional int32 cas_system_id = 2;
9296 // State of the session
9297 optional State state = 3;
9298}
9299
Henry Fange316ab62020-04-21 18:43:14 -07009300/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009301 * Logs when an app is frozen or unfrozen.
9302 *
9303 * Logged from:
9304 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9305 */
9306message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009307 // The type of event.
9308 enum Action {
9309 UNKNOWN = 0;
9310 FREEZE_APP = 1;
9311 UNFREEZE_APP = 2;
9312 }
9313 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009314
Blake Kragten6ce382a2020-01-16 20:20:46 -08009315 // Pid of the process being frozen.
9316 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009317
Blake Kragten6ce382a2020-01-16 20:20:46 -08009318 // Name of the process being frozen.
9319 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009320
Blake Kragten6ce382a2020-01-16 20:20:46 -08009321 // Time since last unfrozen.
9322 optional int64 time_unfrozen_millis = 4;
9323}
9324
9325/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009326 * Pulls information for a single voice call.
9327 *
9328 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9329 *
9330 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009331 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009332 */
9333message VoiceCallSession {
9334 // Bearer (IMS or CS) when the call started.
9335 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9336
9337 // Bearer (IMS or CS) when the call ended.
9338 // The bearer may change during the call, e.g. due to SRVCC.
9339 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9340
9341 // Direction of the call (incoming or outgoing).
9342 optional android.telephony.CallDirectionEnum direction = 3;
9343
9344 // Time spent setting up the call.
9345 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9346
9347 // Whether the call ended before the setup was completed.
9348 optional bool setup_failed = 5;
9349
9350 // IMS reason code or CS disconnect cause.
9351 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9352 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9353 optional int32 disconnect_reason_code = 6;
9354
9355 // IMS extra code or CS precise disconnect cause.
9356 // For IMS, this code is vendor-specific
9357 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9358 optional int32 disconnect_extra_code = 7;
9359
9360 // IMS extra message or CS vendor cause.
9361 optional string disconnect_extra_message = 8;
9362
9363 // Radio access technology (RAT) used when call started.
9364 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9365
9366 // Radio access technology (RAT) used when call terminated.
9367 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9368
9369 // Number of times RAT changed during the call.
9370 optional int64 rat_switch_count = 11;
9371
9372 // A bitmask of all codecs used during the call.
9373 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9374 optional int64 codec_bitmask = 12;
9375
9376 // Number of other calls going on during call setup, for the same SIM slot.
9377 optional int32 concurrent_call_count_at_start = 13;
9378
9379 // Number of other calls going on during call termination, for the same SIM slot.
9380 optional int32 concurrent_call_count_at_end = 14;
9381
9382 // Index of the SIM is used, 0 for single-SIM devices.
9383 optional int32 sim_slot_index = 15;
9384
9385 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9386 optional bool is_multi_sim = 16;
9387
9388 // Whether the call was made with an eSIM profile.
9389 optional bool is_esim = 17;
9390
9391 // Carrier ID of the SIM card.
9392 // See https://source.android.com/devices/tech/config/carrierid.
9393 optional int32 carrier_id = 18;
9394
Chi Zhangba1b03a2020-04-21 17:17:56 -07009395 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009396 optional bool srvcc_completed = 19;
9397
9398 // Number of SRVCC failures.
9399 optional int64 srvcc_failure_count = 20;
9400
9401 // Number of SRVCC cancellations.
9402 optional int64 srvcc_cancellation_count = 21;
9403
Chi Zhangba1b03a2020-04-21 17:17:56 -07009404 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9405 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009406 optional bool rtt_enabled = 22;
9407
9408 // Whether this was an emergency call.
9409 optional bool is_emergency = 23;
9410
9411 // Whether the call was performed while roaming.
9412 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009413
9414 // A random number used as the dimension field to pull multiple atoms.
9415 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009416}
9417
9418/**
9419 * Pulls voice call radio access technology (RAT) usage.
9420 *
9421 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9422 * time. The atom will be skipped if not enough data is available.
9423 *
9424 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009425 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009426 */
9427message VoiceCallRatUsage {
9428 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9429 optional int32 carrier_id = 1;
9430
9431 // Radio access technology.
9432 optional android.telephony.NetworkTypeEnum rat = 2;
9433
9434 // Total duration that voice calls spent on this carrier and RAT.
9435 optional int64 total_duration_seconds = 3;
9436
9437 // Total number of calls using this carrier and RAT.
9438 // A call is counted once even if it used the RAT multiple times.
9439 optional int64 call_count = 4;
9440}
9441
9442/**
9443 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9444 *
9445 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009446 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009447 */
9448message SimSlotState {
9449 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9450 optional int32 active_slot_count = 1;
9451
9452 // Number of SIM cards (both physical and active eSIM profiles).
9453 // This number is always equal to or less than the number of active SIM slots.
9454 optional int32 sim_count = 2;
9455
9456 // Number of active eSIM profiles.
9457 // This number is always equal to or less than the number of SIMs.
9458 optional int32 esim_count = 3;
9459}
9460
9461/**
9462 * Pulls supported cellular radio access technologies.
9463 *
9464 * This atom reports the capabilities of the device, rather than the network it has access to.
9465 *
9466 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009467 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009468 */
9469message SupportedRadioAccessFamily {
9470 // A bitmask of supported radio technologies.
9471 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9472 optional int64 network_type_bitmask = 1;
9473}
9474
9475/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009476 * Logs gnss stats from location service provider
9477 *
9478 * Pulled from:
9479 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9480 */
9481
9482message GnssStats {
9483 // Number of location reports since boot
9484 optional int64 location_reports = 1;
9485
9486 // Total pulled reports of Location failures since boot
9487 optional int64 location_failure_reports = 2;
9488
9489 // Number of time to first fix reports since boot
9490 optional int64 time_to_first_fix_reports = 3;
9491
9492 // Total pulled reported time to first fix (in milli-seconds) since boot
9493 optional int64 time_to_first_fix_milli_s = 4;
9494
9495 // Number of position accuracy reports since boot
9496 optional int64 position_accuracy_reports = 5;
9497
9498 // Total pulled reported position accuracy (in meters) since boot
9499 optional int64 position_accuracy_meters = 6;
9500
9501 // Number of top 4 average CN0 reports since boot
9502 optional int64 top_four_average_cn0_reports = 7;
9503
9504 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9505 optional int64 top_four_average_cn0_db_mhz = 8;
9506
9507 // Number of l5 top 4 average CN0 reports since boot
9508 optional int64 l5_top_four_average_cn0_reports = 9;
9509
9510 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9511 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9512
9513 // Total number of sv status messages reports since boot
9514 optional int64 sv_status_reports = 11;
9515
9516 // Total number of sv status messages reports, where sv is used in fix since boot
9517 optional int64 sv_status_reports_used_in_fix = 12;
9518
9519 // Total number of L5 sv status messages reports since boot
9520 optional int64 l5_sv_status_reports = 13;
9521
9522 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9523 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009524}
Kweku Adams12752132020-02-18 15:36:48 -08009525
9526/**
9527 * Logs when an app is moved to a different standby bucket.
9528 *
9529 * Logged from:
9530 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9531 */
9532message AppStandbyBucketChanged {
9533 optional string package_name = 1;
9534
9535 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9536 optional int32 user_id = 2;
9537
9538 // These enum values match the constants defined in UsageStatsManager.java.
9539 enum Bucket {
9540 BUCKET_UNKNOWN = 0;
9541 BUCKET_EXEMPTED = 5;
9542 BUCKET_ACTIVE = 10;
9543 BUCKET_WORKING_SET = 20;
9544 BUCKET_FREQUENT = 30;
9545 BUCKET_RARE = 40;
9546 BUCKET_RESTRICTED = 45;
9547 BUCKET_NEVER = 50;
9548 }
9549 optional Bucket bucket = 3;
9550
9551 enum MainReason {
9552 MAIN_UNKNOWN = 0;
9553 MAIN_DEFAULT = 0x0100;
9554 MAIN_TIMEOUT = 0x0200;
9555 MAIN_USAGE = 0x0300;
9556 MAIN_FORCED_BY_USER = 0x0400;
9557 MAIN_PREDICTED = 0x0500;
9558 MAIN_FORCED_BY_SYSTEM = 0x0600;
9559 }
9560 optional MainReason main_reason = 4;
9561
9562 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9563 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9564 // UsageStatsManager.java.
9565 optional int32 sub_reason = 5;
9566}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009567
9568/**
9569* Reports a started sharesheet transaction.
9570*
9571* Logged from:
9572* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9573*/
9574message SharesheetStarted {
9575 // The event_id (as for UiEventReported).
9576 optional int32 event_id = 1;
9577 // The calling app's package name.
9578 optional string package_name = 2;
9579 // An identifier to tie together multiple logs relating to the same share event
9580 optional int32 instance_id = 3;
9581 // The mime type of the share
9582 optional string mime_type = 4;
9583 // The number of direct targets the calling app is providing that will be shown.
9584 optional int32 num_app_provided_direct_targets = 5;
9585 // The number of app targets the calling app is providing that will be shown.
9586 optional int32 num_app_provided_app_targets = 6;
9587 // True if the share originates from the workprofile
9588 optional bool is_workprofile = 7;
9589
9590 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009591 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009592 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9593 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9594 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9595 }
9596 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009597 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009598
9599 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9600 INTENT_DEFAULT = 0;
9601 INTENT_ACTION_VIEW = 1;
9602 INTENT_ACTION_EDIT = 2;
9603 INTENT_ACTION_SEND = 3;
9604 INTENT_ACTION_SENDTO = 4;
9605 INTENT_ACTION_SEND_MULTIPLE = 5;
9606 INTENT_ACTION_IMAGE_CAPTURE = 6;
9607 INTENT_ACTION_MAIN = 7;
9608 }
9609 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009610 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009611}
9612
9613/**
9614 * Reports a ranking selection event.
9615 *
9616 * Logged from:
9617 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9618 */
9619message RankingSelected {
9620 // The event_id (as for UiEventReported).
9621 optional int32 event_id = 1;
9622 // The relevant app's package name (can be source or picked package).
9623 optional string package_name = 2;
9624 // An identifier to tie together multiple logs relating to the same share event.
9625 optional int32 instance_id = 3;
9626 // Which of the ranked targets got picked, default starting position 0.
9627 optional int32 position_picked = 4;
9628}
Raff Tsaiea4db182020-03-06 07:45:43 +08009629
9630/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009631 * Logs when TvSettings UI is interacted at.
9632 *
9633 * Logged from: packages/apps/TvSettings
9634 */
9635message TvSettingsUIInteracted {
9636
9637 /** The UI action category */
9638 optional android.app.tvsettings.Action action = 1;
9639
9640 /** The ID of the entry that the users actioned on */
9641 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009642}
9643
9644/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009645 * Logs information about a package installation using package installer V2 APIs.
9646 *
9647 * Logged from:
9648 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9649 */
9650message PackageInstallerV2Reported {
9651 // Whether this installation uses Incremental File System
9652 optional bool is_incremental = 1;
9653 // Name of the package that is intended to be installed
9654 optional string package_name = 2;
9655 // The duration between when the install was requested to when the install has completed
9656 optional int64 duration_millis = 3;
9657 // Installation result in final integer, which are SystemApi's.
9658 // Return_code 1 indicates success.
9659 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9660 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009661 // Total size of the APKs installed for this package
9662 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009663}
9664
9665/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009666 * Logs settings provider values.
9667 *
9668 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9669 * then write the value to proto.
9670 *
9671 */
9672message SettingSnapshot {
9673
9674 // Setting key
9675 optional string name = 1;
9676
9677 enum SettingsValueType {
9678 NOTASSIGNED = 0;
9679 ASSIGNED_BOOL_TYPE = 1;
9680 ASSIGNED_INT_TYPE = 2;
9681 ASSIGNED_FLOAT_TYPE = 3;
9682 ASSIGNED_STRING_TYPE = 4;
9683 };
9684 // Setting value type
9685 optional SettingsValueType type = 2;
9686
9687 optional bool bool_value = 3;
9688
9689 optional int32 int_value = 4;
9690
9691 optional float float_value = 5;
9692
9693 optional string str_value = 6;
9694
9695 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9696 optional int32 user_id = 7;
9697}
Varun Shahacb56342019-12-18 11:45:38 -08009698
9699/**
9700 * An event logged to indicate that a user journey is about to be performed. This atom includes
9701 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9702 * will immediately follow this atom which will describe the event(s) and its state.
9703 *
9704 * Logged from:
9705 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9706 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9707 */
9708message UserLifecycleJourneyReported {
9709 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9710 // UserLifecycleEventOccurred atom)
9711 optional int64 session_id = 1;
9712
9713 // Indicates what type of user journey this session is related to
9714 enum Journey {
9715 UNKNOWN = 0; // Undefined user lifecycle journey
9716 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9717 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9718 USER_START = 3; // A user start journey
9719 USER_CREATE = 4; // A user creation journey
9720 }
9721 optional Journey journey = 2;
9722 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9723 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9724 optional int32 origin_user = 3;
9725 // Which user the journey is targeting
9726 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9727 optional int32 target_user = 4;
9728
9729 // What is the user type of the target user
9730 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9731 enum UserType {
9732 TYPE_UNKNOWN = 0;
9733 FULL_SYSTEM = 1;
9734 FULL_SECONDARY = 2;
9735 FULL_GUEST = 3;
9736 FULL_DEMO = 4;
9737 FULL_RESTRICTED = 5;
9738 PROFILE_MANAGED = 6;
9739 SYSTEM_HEADLESS = 7;
9740 }
9741 optional UserType user_type = 5;
9742 // What are the flags attached to the target user
9743 optional int32 user_flags = 6;
9744}
9745
9746/**
9747 * An event logged when a specific user lifecycle event is performed. These events should be
9748 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9749 * Note: journeys can span over multiple events, hence some events may share a single session id.
9750 *
9751 * Logged from:
9752 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9753 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9754 */
9755message UserLifecycleEventOccurred {
9756 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9757 optional int64 session_id = 1;
9758 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9759 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9760 optional int32 user_id = 2;
9761
9762 enum Event {
9763 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9764 SWITCH_USER = 1; // Indicates that this is a user switch event
9765 START_USER = 2; // Indicates that this is a user start event
9766 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -07009767 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
9768 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
9769 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -08009770 }
9771 optional Event event = 3;
9772
9773 enum State {
9774 NONE = 0; // Indicates the associated event has no start/end defined
9775 BEGIN = 1;
9776 FINISH = 2;
9777 }
9778 optional State state = 4; // Represents the state of an event (beginning/ending)
9779}
jasonwshsu81173e32020-03-27 15:22:03 +08009780
9781/**
9782 * Logs when accessibility shortcut clicked.
9783 *
9784 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009785 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009786 */
9787message AccessibilityShortcutReported {
9788 // The accessibility feature(including installed a11y service, framework a11y feature,
9789 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9790 optional string package_name = 1;
9791
9792 // The definition of the accessibility shortcut.
9793 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9794 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9795
9796 // The definition of the service status.
9797 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9798 optional android.stats.accessibility.ServiceStatus service_status = 3;
9799}
9800
9801/**
9802 * Logs when accessibility service status changed.
9803 *
9804 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009805 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009806 */
9807message AccessibilityServiceReported {
9808 // The accessibility service package name.
9809 optional string package_name = 1;
9810
9811 // The definition of the service status.
9812 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9813 optional android.stats.accessibility.ServiceStatus service_status = 2;
9814}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009815
Denny cy Lee57b31282020-04-17 10:08:52 +08009816message DisplayWakeReason {
9817 // Wake_up_reason code
9818 // If LOWORD(wake_up_reason) = 0
9819 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9820 // else reference wake_up_reason to
9821 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9822 optional int32 wake_up_reason = 1;
9823 // Count of wake up by reason
9824 optional int32 wake_times = 2;
9825}
9826
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009827/**
9828 * Logs app usage events.
9829 */
9830message AppUsageEventOccurred {
9831 optional int32 uid = 1 [(is_uid) = true];
9832 optional string package_name = 2;
9833 optional string class_name = 3;
9834
9835 enum EventType {
9836 NONE = 0;
9837 MOVE_TO_FOREGROUND = 1;
9838 MOVE_TO_BACKGROUND = 2;
9839 }
9840 optional EventType event_type = 4;
9841}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009842
9843/*
9844 * Quality metrics logged when EVS cameras are active.
9845 *
9846 * Logged from:
9847 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9848 */
9849message EvsUsageStatsReported {
9850
9851 // Camera identifier to distinguish the source camera device. This is not
9852 // globally unique and therefore cannot be used to identify the user and/or
9853 // the device.
9854 optional int32 device_id = 1;
9855
9856 // Peak number of clients during the service
9857 optional int32 peak_num_clients = 2;
9858
9859 // Number of erroneous events during the service
9860 optional int32 num_errors = 3;
9861
9862 // Round trip latency of the very first frame
9863 optional int64 first_latency_millis = 4;
9864
9865 // Average frame round trip latency
9866 optional float avg_latency_millis = 5;
9867
9868 // Peak frame round trip latency
9869 optional int64 peak_latency_millis = 6;
9870
9871 // Total number of frames received
9872 optional int64 total_frames = 7;
9873
9874 // Number of frames ignored
9875 optional int64 ignored_frames = 8;
9876
9877 // Number of dropped frames to synchronize camera devices
9878 optional int64 dropped_frames_to_sync = 9;
9879
9880 // The duration of the service
9881 optional int64 duration_millis = 10;
9882}
Robert Leecccdc152020-04-23 13:22:46 +08009883
9884/**
9885 * Logs audio power usage stats.
9886 *
9887 * Pushed from:
9888 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9889 */
9890message AudioPowerUsageDataReported {
9891 /**
9892 * Device used for input/output
9893 *
9894 * All audio devices please refer to below file:
9895 * system/media/audio/include/system/audio-base.h
9896 *
9897 * Define our own enum values because we don't report all audio devices.
9898 * Currently, we only report built-in audio devices such as handset, speaker,
9899 * built-in mics, common audio devices such as wired headset, usb headset
9900 * and bluetooth devices.
9901 */
9902 enum AudioDevice {
9903 OUTPUT_EARPIECE = 0x1; // handset
9904 OUTPUT_SPEAKER = 0x2; // dual speaker
9905 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9906 OUTPUT_USB_HEADSET = 0x8; // usb headset
9907 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9908 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9909 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9910
9911 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9912 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9913 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9914 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9915 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9916 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9917 }
9918 optional AudioDevice audio_device = 1;
9919
9920 // Duration of the audio in seconds
9921 optional int32 duration_secs = 2;
9922
9923 // Average volume (0 ... 1.0)
9924 optional float average_volume = 3;
9925
9926 enum AudioType {
9927 UNKNOWN_TYPE = 0;
9928 VOICE_CALL_TYPE = 1; // voice call
9929 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9930 MEDIA_TYPE = 3; // music and system sound
9931 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9932 ALARM_TYPE = 5; // alarm type
9933 // record type
9934 CAMCORDER_TYPE = 6; // camcorder
9935 RECORD_TYPE = 7; // other recording
9936 }
9937 optional AudioType type = 4;
9938}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009939
9940/**
9941 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9942 *
9943 * Pulled from:
9944 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9945 */
9946message BytesTransferByTagAndMetered {
9947 optional int32 uid = 1 [(is_uid) = true];
9948
9949 optional bool is_metered = 2;
9950
9951 optional int32 tag = 3;
9952
9953 optional int64 rx_bytes = 4;
9954
9955 optional int64 rx_packets = 5;
9956
9957 optional int64 tx_bytes = 6;
9958
9959 optional int64 tx_packets = 7;
9960}
Robert Luo2f52f042020-05-11 16:39:24 +08009961
9962/*
9963 * Logs when the Media Output Switcher finishes a media switch operation.
9964 *
9965 * Logged from:
9966 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9967 */
9968message MediaOutputOpSwitchReported {
9969 // Source medium type before switching.
9970 optional android.app.settings.mediaoutput.MediumType source = 1;
9971
9972 // Target medium type after switching.
9973 optional android.app.settings.mediaoutput.MediumType target = 2;
9974
9975 // The result of switching.
9976 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9977
9978 // The detail code of a switching result.
9979 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9980
9981 /*
9982 * The package name of a pre-installed app, whose media session is being switched.
9983 */
9984 optional string media_session_package_name = 5;
9985
9986 // The amount of available wired devices when a switching is being performed.
9987 optional int32 available_wired_device_count = 6;
9988
9989 // The amount of available Bluetooth devices a switching is being performed.
9990 optional int32 available_bt_device_count = 7;
9991
9992 // The amount of available remote devices when a switching is being performed.
9993 optional int32 available_remote_device_count = 8;
9994
9995 // The amount of applied devices within a remote dynamic group after a switching is done.
9996 optional int32 applied_device_count_within_remote_group = 9;
9997}