blob: 1823bad0076dc7cb76e6a4c0451d25f05678d991 [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"];
thiruram70b08432020-06-09 18:44:02 -0700196 UiEventReported ui_event_reported = 90 [(module) = "framework", (module) = "sysui"];
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"];
thiruram70b08432020-06-09 18:44:02 -0700422 RankingSelected ranking_selected = 260 [(module) = "framework", (module) = "sysui"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700449 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Henry Fangfd40c072020-06-01 14:59:17 -0700450 TvCasSessionOpenStatus tv_cas_session_open_status =
451 280 [(module) = "framework"];
Govinda Wassermane4640282020-04-30 09:30:56 -0400452 AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800453 DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
Mayank Gargda5ca012020-05-14 00:23:53 -0700454 CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
455 283 [(module) = "car"];
456 CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
457 284 [(module) = "car"];
458 CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
459 285 [(module) = "car"];
460 CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
461 286 [(module) = "car"];
462 CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
463 287 [(module) = "car"];
464 CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
465 288 [(module) = "car"];
466 CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
467 289 [(module) = "car"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700468
469 // StatsdStats tracks platform atoms with ids upto 500.
470 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000471 }
David Chenc8a43242017-10-17 16:23:28 -0700472
David Chen6e3e6cb2018-01-03 16:14:06 -0800473 // Pulled events will start at field 10000.
Denny cy Leeca62fc42020-05-28 18:13:07 +0800474 // Next: 10081
David Chenc8a43242017-10-17 16:23:28 -0700475 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800476 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
477 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700478 MobileBytesTransfer mobile_bytes_transfer =
479 10002 [(module) = "framework", (truncate_timestamp) = true];
480 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
481 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800482 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
483 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700484 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700486 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800487 CpuTimePerUidFreq cpu_time_per_uid_freq =
488 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
490 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
491 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
492 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
493 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700494 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700495 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700496 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700497 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800498 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
499 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700500 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800501 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800503 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800504 DiskStats disk_stats = 10025 [(module) = "framework"];
505 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
506 AppSize app_size = 10027 [(module) = "framework"];
507 CategorySize category_size = 10028 [(module) = "framework"];
508 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800509 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800510 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
511 DiskIo disk_io = 10032 [(module) = "framework"];
512 PowerProfile power_profile = 10033 [(module) = "framework"];
513 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
514 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
515 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700516 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800517 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
518 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
519 10040 [(module) = "framework"];
520 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
521 10041 [(module) = "framework"];
522 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800523 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800524 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800525 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
527 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
528 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
529 RoleHolder role_holder = 10049 [(module) = "framework"];
530 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800531 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800532 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
533 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800534 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
535 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800536 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
537 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
538 FaceSettings face_settings = 10058 [(module) = "framework"];
539 CoolingDevice cooling_device = 10059 [(module) = "framework"];
540 AppOps app_ops = 10060 [(module) = "framework"];
541 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700542 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
543 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800544 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800545 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800546 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
547 DangerousPermissionStateSampled dangerous_permission_state_sampled =
548 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400549 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000550 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000551 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200552 PackageNotificationPreferences package_notification_preferences =
553 10071 [(module) = "framework"];
554 PackageNotificationChannelPreferences package_notification_channel_preferences =
555 10072 [(module) = "framework"];
556 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
557 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800558 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800559 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700560 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
561 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
562 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
563 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800564 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800565 //10081 free for use
junyulai8d1a6092020-05-07 13:38:15 +0800566 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700567 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
568 10083 [(module) = "framework"];
Chris Wren93165692020-05-15 16:12:41 -0400569 DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700570 }
yroa1fe77c2018-02-26 14:22:54 -0800571
Bookatz76aafcf2018-09-17 16:17:10 -0700572 // DO NOT USE field numbers above 100,000 in AOSP.
573 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
574 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100575
576 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700577}
578
Yao Chend54f9dd2017-10-17 17:37:48 +0000579/**
Yangster-mac20877162017-12-22 17:19:39 -0800580 * This proto represents a node of an attribution chain.
581 * Note: All attribution chains are represented as a repeated field of type
582 * AttributionNode. It is understood that in such arrays, the order is that
583 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000584 */
Yangster-mac20877162017-12-22 17:19:39 -0800585message AttributionNode {
586 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800587 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800588
Yangster-mac20877162017-12-22 17:19:39 -0800589 // The (optional) string tag for an element in the attribution chain. If the
590 // element has no tag, it is encoded as an empty string.
591 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700592}
593
Yangster-mac48b3d622018-08-18 12:38:11 -0700594message KeyValuePair {
595 optional int32 key = 1;
596 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700597 int32 value_int = 2;
598 int64 value_long = 3;
599 string value_str = 4;
600 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700601 }
602}
603
604message KeyValuePairsAtom {
605 optional int32 uid = 1;
606 repeated KeyValuePair pairs = 2;
607}
608
Yao Chend54f9dd2017-10-17 17:37:48 +0000609/*
610 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800611 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000612 *
613 * RULES:
614 * - The field ids for each atom must start at 1, and count upwards by 1.
615 * Skipping field ids is not allowed.
616 * - These form an API, so renaming, renumbering or removing fields is
617 * not allowed between android releases. (This is not currently enforced,
618 * but there will be a tool to enforce this restriction).
619 * - The types must be built-in protocol buffer types, namely, no sub-messages
620 * are allowed (yet). The bytes type is also not allowed.
621 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800622 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000623 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800624 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000625 * - A field that is a uid should be a string field, tagged with the [xxx]
626 * annotation. The generated code on android will be represented by UIDs,
627 * and those UIDs will be translated in xxx to those strings.
628 *
629 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700630 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000631 * - If there is a UID, it goes first. Think in an object-oriented fashion.
632 * *****************************************************************************
633 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700634
Yao Chend54f9dd2017-10-17 17:37:48 +0000635/**
Tej Singha72344992019-04-17 18:55:08 -0700636 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700637 * Logs when the Thermal service HAL notifies the throttling start/stop events.
638 *
639 * Logged from:
640 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
641 */
642message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700643 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700644 optional android.os.TemperatureTypeEnum sensor_type = 1;
645
Maggie White442b6312019-04-05 16:26:44 -0700646 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700647 enum State {
648 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700649 START = 1; // START indicated that throttling was triggered.
650 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700651 }
Yangster-mace16189a2018-08-26 12:20:16 -0700652 optional State state = 2;
653
654 optional float temperature = 3;
655}
656
657/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000658 * Logs when the screen state changes.
659 *
660 * Logged from:
661 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
662 */
663message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800664 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800665 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700666 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700667}
Yao Chend54f9dd2017-10-17 17:37:48 +0000668
669/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700670 * Logs that the process state of the uid, as determined by ActivityManager
671 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000672 *
673 * Logged from:
674 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
675 */
Bookatzc1a050a2017-10-10 15:49:28 -0700676message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700677 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000678
Bookatzdb026a22018-01-10 19:01:56 -0800679 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800680 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700681 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000682}
683
684/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700685 * Logs process state change of a process, as per the activity manager.
686 *
687 * Logged from:
688 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
689 */
690message ProcessStateChanged {
691 optional int32 uid = 1;
692 optional string process_name = 2;
693 optional string package_name = 3;
694 // TODO: remove this when validation is done
695 optional int64 version = 5;
696 // The state, from frameworks/base/core/proto/android/app/enums.proto.
697 optional android.app.ProcessStateEnum state = 4;
698}
699
700/**
701 * Logs when ActivityManagerService sleep state is changed.
702 *
703 * Logged from:
704 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
705 */
706message ActivityManagerSleepStateChanged {
707 // TODO: import frameworks proto
708 enum State {
709 UNKNOWN = 0;
710 ASLEEP = 1;
711 AWAKE = 2;
712 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700713 optional State state = 1
714 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700715}
716
717/**
718 * Logs when system memory state changes.
719 *
720 * Logged from:
721 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
722 */
723message MemoryFactorStateChanged {
724 // TODO: import frameworks proto
725 enum State {
726 MEMORY_UNKNOWN = 0;
727 NORMAL = 1; // normal.
728 MODERATE = 2; // moderate memory pressure.
729 LOW = 3; // low memory.
730 CRITICAL = 4; // critical memory.
731
732 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700733 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700734}
735
736/**
737 * Logs when app is using too much cpu, according to ActivityManagerService.
738 *
739 * Logged from:
740 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
741 */
742message ExcessiveCpuUsageReported {
743 optional int32 uid = 1;
744 optional string process_name = 2;
745 optional string package_name = 3;
746 // package version. TODO: remove this when validation is done
747 optional int64 version = 4;
748}
749
750/**
751 * Logs when a cached process is killed, along with its pss.
752 *
753 * Logged from:
754 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
755 */
756message CachedKillReported {
757 optional int32 uid = 1;
758 optional string process_name = 2;
759 optional string package_name = 3;
760 // TODO: remove this when validation is done
761 optional int64 version = 5;
762 optional int64 pss = 4;
763}
764
765/**
xshu2c3d9e42019-09-26 17:54:02 -0700766 * Logs the change in wifi health.
767 *
768 * Logged from:
769 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
770 */
771message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800772 enum Band {
773 UNKNOWN = 0;
774 // All of 2.4GHz band
775 BAND_2G = 1;
776 // Frequencies in the range of [5150, 5250) GHz
777 BAND_5G_LOW = 2;
778 // Frequencies in the range of [5250, 5725) GHz
779 BAND_5G_MIDDLE = 3;
780 // Frequencies in the range of [5725, 5850) GHz
781 BAND_5G_HIGH = 4;
782 // Frequencies in the range of [5925, 6425) GHz
783 BAND_6G_LOW = 5;
784 // Frequencies in the range of [6425, 6875) GHz
785 BAND_6G_MIDDLE = 6;
786 // Frequencies in the range of [6875, 7125) GHz
787 BAND_6G_HIGH = 7;
788 }
xshu2c3d9e42019-09-26 17:54:02 -0700789 // duration this stat is obtained over in milliseconds
790 optional int32 duration_millis = 1;
791 // whether wifi is classified as sufficient for the user's data traffic, determined
792 // by whether the calculated throughput exceeds the average demand within |duration_millis|
793 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700794 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800795 optional bool is_cell_data_available = 3;
796 // the Band bucket the connected network is on
797 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700798}
799
800/**
801 * Logged when wifi detects a significant change in connection failure rate.
802 *
803 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
804 *
805 */
806message WifiFailureStatReported {
807 enum AbnormalityType {
808 UNKNOWN = 0;
809 SIGNIFICANT_INCREASE = 1;
810 SIGNIFICANT_DECREASE = 2;
811 SIMPLY_HIGH = 3;
812 }
813 enum FailureType {
814 FAILURE_UNKNOWN = 0;
815 FAILURE_CONNECTION = 1;
816 FAILURE_ASSOCIATION_REJECTION = 2;
817 FAILURE_ASSOCIATION_TIMEOUT = 3;
818 FAILURE_AUTHENTICATION = 4;
819 FAILURE_NON_LOCAL_DISCONNECTION = 5;
820 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
821 }
822 // Reason for uploading this stat
823 optional AbnormalityType abnormality_type = 1;
824 // The particular type of failure
825 optional FailureType failure_type = 2;
826 // How many times we have encountered this combination of AbnormalityType and FailureType
827 optional int32 failure_count = 3;
828}
829
830/**
831 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
832 *
833 * Logged from:
834 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
835 */
836message WifiConnectionResultReported {
837 enum FailureCode {
838 FAILURE_UNKNOWN = 0;
839 FAILURE_ASSOCIATION_TIMEOUT = 1;
840 FAILURE_ASSOCIATION_REJECTION = 2;
841 FAILURE_AUTHENTICATION_GENERAL = 3;
842 FAILURE_AUTHENTICATION_EAP = 4;
843 FAILURE_DHCP = 5;
844 FAILURE_NETWORK_DISCONNECTION = 6;
845 FAILURE_ROAM_TIMEOUT = 7;
846 }
847 // true represents a successful connection
848 optional bool connection_result = 1;
849 // reason for the connection failure
850 optional FailureCode failure_code = 2;
851 // scan rssi before the connection attempt
852 optional int32 rssi = 3;
853}
854
855/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700856 * Logs when memory stats of a process is reported.
857 *
858 * Logged from:
859 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
860 */
861message ProcessMemoryStatReported {
862 optional int32 uid = 1;
863 optional string process_name = 2;
864 optional string package_name = 3;
865 //TODO: remove this when validation is done
866 optional int64 version = 9;
867 optional int64 pss = 4;
868 optional int64 uss = 5;
869 optional int64 rss = 6;
870 enum Type {
871 ADD_PSS_INTERNAL_SINGLE = 0;
872 ADD_PSS_INTERNAL_ALL_MEM = 1;
873 ADD_PSS_INTERNAL_ALL_POLL = 2;
874 ADD_PSS_EXTERNAL = 3;
875 ADD_PSS_EXTERNAL_SLOW = 4;
876 }
877 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800878 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700879}
880
881/**
Bookatzc1a050a2017-10-10 15:49:28 -0700882 * Logs that a process started, finished, crashed, or ANRed.
883 *
884 * Logged from:
885 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
886 */
887message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700888 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700889
David Chen0b5c90c2018-01-25 16:51:49 -0800890 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800891 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700892
Bookatzddccf0a2017-11-28 16:48:14 -0800893 // What lifecycle state the process changed to.
894 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800895 enum State {
896 FINISHED = 0;
897 STARTED = 1;
898 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800899 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800900 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700901}
902
Bookatzc1a050a2017-10-10 15:49:28 -0700903/**
904 * Logs when the ble scan state changes.
905 *
906 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700907 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700908 */
909message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800910 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700911 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700912
913 enum State {
914 OFF = 0;
915 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700916 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
917 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700918 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800919 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700920 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800921 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700922 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800923 (state_field_option).nested = true
924 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700925
Bookatze5ec0b42018-03-26 13:34:56 -0700926 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700927 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700928 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700929 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700930 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700931 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700932}
933
934/**
935 * Logs reporting of a ble scan finding results.
936 *
937 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700938 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700939 */
Bookatzae6738e2018-09-13 11:38:56 -0700940// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700941message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800942 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700943
944 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800945 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700946}
947
948/**
949 * Logs when a sensor state changes.
950 *
951 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700952 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700953 */
954message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800955 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700956
Bookatzc1a050a2017-10-10 15:49:28 -0700957 // The id (int) of the sensor.
958 optional int32 sensor_id = 2;
959
960 enum State {
961 OFF = 0;
962 ON = 1;
963 }
964 optional State state = 3;
965}
966
Bookatzc1a050a2017-10-10 15:49:28 -0700967/**
968 * Logs when GPS state changes.
969 *
970 * Logged from:
971 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
972 */
973message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800974 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700975
976 enum State {
977 OFF = 0;
978 ON = 1;
979 }
980 optional State state = 2;
981}
982
Bookatz48d362e2018-11-06 15:49:08 -0800983/**
984 * Logs when GPS signal quality.
985 *
986 * Logged from:
987 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
988 */
989message GpsSignalQualityChanged {
990 optional android.server.location.GpsSignalQualityEnum level = 1;
991}
992
Bookatzc1a050a2017-10-10 15:49:28 -0700993
994/**
995 * Logs when a sync manager sync state changes.
996 *
997 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700998 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700999 */
1000message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001001 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001002
David Chen0b5c90c2018-01-25 16:51:49 -08001003 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001004 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001005
1006 enum State {
1007 OFF = 0;
1008 ON = 1;
1009 }
1010 optional State state = 3;
1011}
1012
Yangster-mac96353002018-09-05 11:18:55 -07001013/*
1014 * Deferred job stats.
1015 *
1016 * Logged from:
1017 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1018*/
1019message DeferredJobStatsReported {
1020 repeated AttributionNode attribution_node = 1;
1021
1022 // Number of jobs deferred.
1023 optional int32 num_jobs_deferred = 2;
1024
1025 // Time since the last job runs.
1026 optional int64 time_since_last_job_millis = 3;
1027}
1028
Bookatzc1a050a2017-10-10 15:49:28 -07001029/**
1030 * Logs when a job scheduler job state changes.
1031 *
1032 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001033 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001034 */
1035message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001036 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001037
1038 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001039 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001040
1041 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001042 FINISHED = 0;
1043 STARTED = 1;
1044 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001045 }
1046 optional State state = 3;
1047
Tej Singh33a412b2018-03-16 18:43:59 -07001048 // The reason a job has stopped.
1049 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001050 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001051 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001052
1053 // The standby bucket of the app that scheduled the job. These match the framework constants
1054 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1055 // already assigned 0.
1056 enum Bucket {
1057 UNKNOWN = -1;
1058 ACTIVE = 0;
1059 WORKING_SET = 1;
1060 FREQUENT = 2;
1061 RARE = 3;
1062 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001063 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001064 }
1065 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1066
1067 // The job id (as assigned by the app).
1068 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001069
1070 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1071 // constraints as they are always assumed to be set.
1072 optional bool has_charging_constraint = 7;
1073 optional bool has_battery_not_low_constraint = 8;
1074 optional bool has_storage_not_low_constraint = 9;
1075 optional bool has_timing_delay_constraint = 10;
1076 optional bool has_deadline_constraint = 11;
1077 optional bool has_idle_constraint = 12;
1078 optional bool has_connectivity_constraint = 13;
1079 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001080}
1081
1082/**
1083 * Logs when the audio state changes.
1084 *
1085 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001086 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001087 */
1088message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001089 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001090
1091 enum State {
1092 OFF = 0;
1093 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001094 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1095 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001096 }
1097 optional State state = 2;
1098}
1099
1100/**
1101 * Logs when the video codec state changes.
1102 *
1103 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001104 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001105 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001106message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001107 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001108
1109 enum State {
1110 OFF = 0;
1111 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001112 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1113 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001114 }
1115 optional State state = 2;
1116}
1117
1118/**
1119 * Logs when the flashlight state changes.
1120 *
1121 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001122 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001123 */
1124message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001125 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001126
1127 enum State {
1128 OFF = 0;
1129 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001130 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1131 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001132 }
1133 optional State state = 2;
1134}
1135
1136/**
1137 * Logs when the camera state changes.
1138 *
1139 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001140 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001141 */
1142message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001143 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001144
1145 enum State {
1146 OFF = 0;
1147 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001148 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1149 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001150 }
1151 optional State state = 2;
1152}
1153
1154/**
1155 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001156 *
1157 * Logged from:
1158 * TODO
1159 */
Bookatzd6746242017-10-24 18:39:35 -07001160message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001161 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001162 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001163
Bookatz1a1b0462018-01-12 11:47:03 -08001164 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1165 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001166 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001167
1168 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001169 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001170
1171 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001172 RELEASE = 0;
1173 ACQUIRE = 1;
1174 CHANGE_RELEASE = 2;
1175 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001176 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001177 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001178 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001179 (state_field_option).default_state_value = 0,
1180 (state_field_option).nested = true
1181 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001182}
1183
1184/**
Bookatzc1a050a2017-10-10 15:49:28 -07001185 * Logs when a partial wakelock is considered 'long' (over 1 min).
1186 *
1187 * Logged from:
1188 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1189 */
1190message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001191 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001192
Yao Chend54f9dd2017-10-17 17:37:48 +00001193 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1194 optional string tag = 2;
1195
Bookatzc1a050a2017-10-10 15:49:28 -07001196 // TODO: I have no idea what this is.
1197 optional string history_tag = 3;
1198
1199 enum State {
1200 OFF = 0;
1201 ON = 1;
1202 }
1203 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001204}
1205
Bookatzc1a050a2017-10-10 15:49:28 -07001206/**
Bookatza66083f2018-09-20 17:24:00 -07001207 * Logs when the device is interactive, according to the PowerManager Notifier.
1208 *
1209 * Logged from:
1210 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1211 */
1212message InteractiveStateChanged {
1213 enum State {
1214 OFF = 0;
1215 ON = 1;
1216 }
1217 optional State state = 1;
1218}
1219
1220/**
Bookatzc1a050a2017-10-10 15:49:28 -07001221 * Logs Battery Saver state change.
1222 *
1223 * Logged from:
1224 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1225 */
1226message BatterySaverModeStateChanged {
1227 enum State {
1228 OFF = 0;
1229 ON = 1;
1230 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001231 optional State state = 1
1232 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001233}
1234
1235/**
1236 * Logs Doze mode state change.
1237 *
1238 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001239 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001240 */
1241message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001242 optional android.server.DeviceIdleModeEnum state = 1
1243 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001244}
1245
1246
1247/**
1248 * Logs state change of Doze mode including maintenance windows.
1249 *
1250 * Logged from:
1251 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1252 */
1253message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001254 optional android.server.DeviceIdleModeEnum state = 1
1255 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001256}
1257
1258/**
1259 * Logs screen brightness level.
1260 *
1261 * Logged from:
1262 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1263 */
1264message ScreenBrightnessChanged {
1265 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1266 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001267}
1268
1269/**
1270 * Logs battery level (percent full, from 0 to 100).
1271 *
1272 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001273 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001274 */
1275message BatteryLevelChanged {
1276 // Battery level. Should be in [0, 100].
1277 optional int32 battery_level = 1;
1278}
1279
1280/**
1281 * Logs change in charging status of the device.
1282 *
1283 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001284 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001285 */
1286message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001287 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001288 optional android.os.BatteryStatusEnum state = 1
1289 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001290}
1291
1292/**
1293 * Logs whether the device is plugged in, and what power source it is using.
1294 *
1295 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001296 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001297 */
1298message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001299 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001300 optional android.os.BatteryPluggedStateEnum state = 1
1301 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001302}
1303
Bookatz8c6571b2017-10-24 15:04:41 -07001304/**
1305 * Logs when an app's wakeup alarm fires.
1306 *
1307 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001308 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001309 */
1310message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001311 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001312
1313 // Name of the wakeup alarm.
1314 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001315
1316 // Name of source package (for historical reasons, since BatteryStats tracked it).
1317 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001318
Ben Murdoch3389f1522019-05-21 15:05:34 +01001319 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001320 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001321}
1322
1323/**
1324 * Logs when an an app causes the mobile radio to change state.
1325 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1326 *
1327 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001328 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001329 */
1330message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001331 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001332
Bookatz1a1b0462018-01-12 11:47:03 -08001333 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1334 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001335}
1336
1337/**
1338 * Logs when an an app causes the wifi radio to change state.
1339 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1340 *
1341 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001342 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001343 */
1344message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001345 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001346
Bookatz1a1b0462018-01-12 11:47:03 -08001347 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1348 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001349}
1350
1351/**
1352 * Logs kernel wakeup reasons and aborts.
1353 *
1354 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001355 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001356 */
1357message KernelWakeupReported {
1358 // Name of the kernel wakeup reason (or abort).
1359 optional string wakeup_reason_name = 1;
1360
1361 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001362 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001363}
1364
1365/**
Bookatzda1798c2018-12-13 14:16:00 -08001366 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001367 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001368 *
1369 * Logged from:
1370 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1371 */
1372message WifiEnabledStateChanged {
1373 enum State {
1374 OFF = 0;
1375 ON = 1;
1376 }
1377 optional State state = 1;
1378}
1379
1380/**
tsaichristinececebdc2020-02-04 14:05:56 -08001381 * This atom is deprecated starting in R.
1382 *
Bookatzda1798c2018-12-13 14:16:00 -08001383 * 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 -08001384 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1385 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001386 *
1387 * Logged from:
1388 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1389 */
1390message WifiRunningStateChanged {
1391 repeated AttributionNode attribution_node = 1;
1392
1393 enum State {
1394 OFF = 0;
1395 ON = 1;
1396 }
1397 optional State state = 2;
1398}
1399
1400/**
Bookatze5885242017-10-24 20:10:31 -07001401 * Logs wifi locks held by an app.
1402 *
1403 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001404 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001405 */
1406message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001407 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001408
1409 enum State {
1410 OFF = 0;
1411 ON = 1;
1412 }
1413 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001414
1415 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1416 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001417}
1418
1419/**
1420 * Logs wifi signal strength changes.
1421 *
1422 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001423 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001424 */
1425message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001426 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1427 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001428}
1429
1430/**
1431 * Logs wifi scans performed by an app.
1432 *
1433 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001434 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001435 */
1436message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001437 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001438
1439 enum State {
1440 OFF = 0;
1441 ON = 1;
1442 }
1443 optional State state = 2;
1444}
1445
1446/**
Tej Singh4503e102018-01-04 14:35:01 -08001447 * Logs wifi multicast locks held by an app
1448 *
1449 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001450 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001451 */
1452message WifiMulticastLockStateChanged {
1453 repeated AttributionNode attribution_node = 1;
1454
1455 enum State {
1456 OFF = 0;
1457 ON = 1;
1458 }
1459 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001460
1461 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001462}
1463
1464/**
Tej Singh1ea42892018-01-19 09:27:00 -08001465 * Logs shutdown reason and duration on next boot.
1466 *
1467 * Logged from:
1468 * frameworks/base/core/java/com/android/server/BootReceiver.java
1469 */
1470message ShutdownSequenceReported {
1471 // True if shutdown is for a reboot. Default: false if we do not know.
1472 optional bool reboot = 1;
1473
1474 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1475 optional string reason = 2;
1476
1477 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1478 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001479 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001480
1481 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001482 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001483}
1484
Tej Singh6483ea42018-01-25 17:45:49 -08001485
1486/**
1487 * Logs boot reason and duration.
1488 *
1489 * Logged from:
1490 * system/core/bootstat/bootstat.cpp
1491 */
1492message BootSequenceReported {
1493 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1494 // Default: "<EMPTY>" if not available.
1495 optional string bootloader_reason = 1;
1496
1497 // Reason for system boot. Eg. bootloader, reboot,userrequested
1498 // Default: "<EMPTY>" if not available.
1499 optional string system_reason = 2;
1500
1501 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001502 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001503
1504 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001505 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001506
1507 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001508 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001509
1510 // Time since last boot in ms. Default: 0 if not available.
1511 optional int64 time_since_last_boot = 6;
1512}
1513
Tej Singhc477d9c2018-02-05 18:31:39 -08001514
1515/**
1516 * Logs call state and disconnect cause (if applicable).
1517 *
1518 * Logged from:
1519 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1520 */
1521message CallStateChanged {
1522 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1523 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1524 optional android.telecom.CallStateEnum call_state = 1;
1525
1526 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1527 // This value is only applicable when the call_state is DISCONNECTED, and
1528 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1529 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1530 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1531
1532 // True if the call is self-managed, which are apps that use the
1533 // telecom infrastructure to make their own calls.
1534 optional bool self_managed = 3;
1535
1536 // True if call is external. External calls are calls on connected Wear
1537 // devices but show up in Telecom so the user can pull them onto the device.
1538 optional bool external_call = 4;
1539}
1540
Tej Singh1ea42892018-01-19 09:27:00 -08001541/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001542 * Logs keyguard state. The keyguard is the lock screen.
1543 *
1544 * Logged from:
1545 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1546 */
1547message KeyguardStateChanged {
1548 enum State {
1549 UNKNOWN = 0;
1550 // The keyguard is hidden when the phone is unlocked.
1551 HIDDEN = 1;
1552 // The keyguard is shown when the phone is locked (screen turns off).
1553 SHOWN= 2;
1554 // The keyguard is occluded when something is overlaying the keyguard.
1555 // Eg. Opening the camera while on the lock screen.
1556 OCCLUDED = 3;
1557 }
1558 optional State state = 1;
1559}
1560
1561/**
1562 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1563 * prompts the user to enter a password (pattern, pin, etc).
1564 *
1565 * Logged from:
1566 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1567 */
1568
1569message KeyguardBouncerStateChanged {
1570 enum State {
1571 UNKNOWN = 0;
1572 // Bouncer is hidden, either as a result of successfully entering the
1573 // password, screen timing out, or user going back to lock screen.
1574 HIDDEN = 1;
1575 // This is when the user is being prompted to enter the password.
1576 SHOWN = 2;
1577 }
1578 optional State state = 1;
1579}
1580
1581/**
1582 * Logs the result of entering a password into the keyguard bouncer.
1583 *
1584 * Logged from:
1585 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1586 */
1587message KeyguardBouncerPasswordEntered {
1588 enum BouncerResult {
1589 UNKNOWN = 0;
1590 // The password entered was incorrect.
1591 FAILURE = 1;
1592 // The password entered was correct.
1593 SUCCESS = 2;
1594 }
1595 optional BouncerResult result = 1;
1596}
1597
Tej Singha883b372018-02-15 11:30:01 -08001598/*
1599 * Logs changes to the configuration of the device. The configuration is defined
1600 * in frameworks/base/core/java/android/content/res/Configuration.java
1601 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1602 * Please go there to interpret the possible values each field can be.
1603 *
1604 * Logged from:
1605 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1606 */
1607message ResourceConfigurationChanged {
1608 // Bit mask of color capabilities of the screen.
1609 // Contains information about the color gamut and hdr mode of the screen.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001611 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001612
1613 // The target screen density being rendered to.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // Current user preference for the scaling factor for fonts,
1618 // relative to the base density scaling.
1619 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001620 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001621
1622 // Flag indicating whether the hard keyboard is hidden.
1623 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001624 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001625
1626 // The type of keyboard attached to the device.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1628 optional int32 keyboard = 5;
1629
1630 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001632 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001633
1634 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1635 // 0 if undefined.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1637 optional int32 mcc = 7;
1638
1639 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1640 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1641 // MNC_ZERO symbol defined in Configuration.java.
1642 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1643 optional int32 mnc = 8;
1644
1645 // The kind of navigation available on the device.
1646 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1647 optional int32 navigation = 9;
1648
1649 // Flag indicating whether the navigation is available.
1650 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001651 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001652
1653 // Overall orientation of the screen.
1654 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1655 optional int32 orientation = 11;
1656
1657 // The current height of the available screen space, in dp units.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001659 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001660
1661 // Bit mask of overall layout of the screen.
1662 // Contains information about screen size, whether the screen is wider/taller
1663 // than normal, whether the screen layout is right-tl-left or left-to-right,
1664 // and whether the screen has a rounded shape.
1665 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001666 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001667
1668 // Current width of the available screen space, in dp units.
1669 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001670 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001671
1672 // The smallest screen size an application will see in normal operation.
1673 // This is the smallest value of both screenWidthDp and screenHeightDp
1674 // in portrait and landscape.
1675 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001676 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001677
1678 // The type of touch screen attached to the device.
1679 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1680 optional int32 touchscreen = 16;
1681
1682 // Bit mask of the ui mode.
1683 // Contains information about the overall ui mode of the device.
1684 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1685 // Also contains information about whether the device is in night mode.
1686 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001687 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001688}
1689
Tej Singheee317b2018-03-07 19:28:05 -08001690
1691/**
1692 * Logs changes in the connection state of the mobile radio.
1693 *
1694 * Logged from:
1695 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1696 */
1697message MobileConnectionStateChanged {
1698 // States are from the state machine DataConnection.java.
1699 enum State {
1700 UNKNOWN = 0;
1701 // The connection is inactive, or disconnected.
1702 INACTIVE = 1;
1703 // The connection is being activated, or connecting.
1704 ACTIVATING = 2;
1705 // The connection is active, or connected.
1706 ACTIVE = 3;
1707 // The connection is disconnecting.
1708 DISCONNECTING = 4;
1709 // The connection is disconnecting after creating a connection.
1710 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1711 }
1712 optional State state = 1;
1713 // For multi-sim phones, this distinguishes between the sim cards.
1714 optional int32 sim_slot_index = 2;
1715 // Used to identify the connection. Starts at 0 and increments by 1 for
1716 // every new network created. Resets whenever the device reboots.
1717 optional int32 data_connection_id = 3;
1718 // A bitmask for the capabilities of this connection.
1719 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1720 // Default value (if we have no information): 0
1721 optional int64 capabilities = 4;
1722 // If this connection has internet.
1723 // This just checks if the DEFAULT bit of capabilities is set.
1724 optional bool has_internet = 5;
1725}
1726
1727/**
1728 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1729 *
1730 * Logged from:
1731 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1732 */
1733message MobileRadioTechnologyChanged {
1734 optional android.telephony.NetworkTypeEnum state = 1;
1735 // For multi-sim phones, this distinguishes between the sim cards.
1736 optional int32 sim_slot_index = 2;
1737}
1738
Andrew Chantb56388b2018-03-22 21:07:33 -07001739/**
1740 * Logs the VID and PID of any connected USB devices.
1741 *
1742 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1743 *
1744 * Logged by Vendor.
1745 */
1746message UsbDeviceAttached {
1747 optional int32 vid = 1;
1748 optional int32 pid = 2;
1749 optional bool has_audio = 3;
1750 optional bool has_hid = 4;
1751 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001752 enum State {
1753 STATE_DISCONNECTED = 0;
1754 STATE_CONNECTED = 1;
1755 }
1756 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001757 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001758}
1759
Tej Singheee317b2018-03-07 19:28:05 -08001760
Tej Singhdd7bd352018-02-09 19:33:15 -08001761/**
Tej Singh5d991e12018-03-09 19:48:11 -08001762 * Logs when Bluetooth is enabled and disabled.
1763 *
1764 * Logged from:
1765 * services/core/java/com/android/server/BluetoothManagerService.java
1766 */
1767message BluetoothEnabledStateChanged {
1768 repeated AttributionNode attribution_node = 1;
1769 // Whether or not bluetooth is enabled on the device.
1770 enum State {
1771 UNKNOWN = 0;
1772 ENABLED = 1;
1773 DISABLED = 2;
1774 }
1775 optional State state = 2;
1776 // The reason for being enabled/disabled.
1777 // Eg. Airplane mode, crash, application request.
1778 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1779 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001780 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001781}
1782
1783/**
Jack Hed9837c82019-01-09 01:19:13 -08001784 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001785 *
1786 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001787 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1788 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001789 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001790 */
1791message BluetoothConnectionStateChanged {
1792 // The state of the connection.
1793 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1794 optional android.bluetooth.ConnectionStateEnum state = 1;
1795 // An identifier that can be used to match connect and disconnect events.
1796 // Currently is last two bytes of a hash of a device level ID and
1797 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001798 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001799 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001800 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1801 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001802 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001803 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001804 // An identifier that can be used to match events for this device.
1805 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1806 // Salt: Randomly generated 256 bit value
1807 // Hash algorithm: HMAC-SHA256
1808 // Size: 32 byte
1809 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001810 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001811 // An identifier that can be used to match events for this device.
1812 // The incremental identifier is locally generated and guaranteed not derived
1813 // from any globally unique hardware id.
1814 // For paired devices, it stays consistent between Bluetooth toggling for the
1815 // same remote device.
1816 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1817 // session for the same remote device.
1818 // Default: 0 if the device's metric id is unknown.
1819 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001820}
1821
1822/**
1823 * Logs when a Bluetooth device connects and disconnects over ACL
1824 *
1825 * Logged from:
1826 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1827 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001828 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001829 */
1830message BluetoothAclConnectionStateChanged {
1831 // An identifier that can be used to match events for this device.
1832 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1833 // Salt: Randomly generated 256 bit value
1834 // Hash algorithm: HMAC-SHA256
1835 // Size: 32 byte
1836 // Default: null or empty if the device identifier is not known
1837 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1838 // The state of the connection.
1839 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1840 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001841 // An identifier that can be used to match events for this device.
1842 // The incremental identifier is locally generated and guaranteed not derived
1843 // from any globally unique hardware id.
1844 // For paired devices, it stays consistent between Bluetooth toggling for the
1845 // same remote device.
1846 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1847 // session for the same remote device.
1848 // Default: 0 if the device's metric id is unknown.
1849 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001850}
1851
1852/**
1853 * Logs when a Bluetooth device connects and disconnects over SCO
1854 *
1855 * Logged from:
1856 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1857 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1858 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001859 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001860 */
1861message BluetoothScoConnectionStateChanged {
1862 // An identifier that can be used to match events for this device.
1863 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1864 // Salt: Randomly generated 256 bit value
1865 // Hash algorithm: HMAC-SHA256
1866 // Size: 32 byte
1867 // Default: null or empty if the device identifier is not known
1868 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1869 // The state of the connection.
1870 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1871 optional android.bluetooth.ConnectionStateEnum state = 2;
1872 // Codec used for this SCO connection
1873 // Default: UNKNOWN
1874 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001875 // An identifier that can be used to match events for this device.
1876 // The incremental identifier is locally generated and guaranteed not derived
1877 // from any globally unique hardware id.
1878 // For paired devices, it stays consistent between Bluetooth toggling for the
1879 // same remote device.
1880 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1881 // session for the same remote device.
1882 // Default: 0 if the device's metric id is unknown.
1883 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001884}
1885
Jack Hec27040a2019-01-09 20:54:41 -08001886/**
1887 * Logged when active device of a profile changes
1888 *
1889 * Logged from:
1890 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1891 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1892 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1893 */
1894message BluetoothActiveDeviceChanged {
1895 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1896 // From android.bluetooth.BluetoothProfile
1897 optional int32 bt_profile = 1;
1898 // An identifier that can be used to match events for this new active device.
1899 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1900 // Salt: Randomly generated 256 bit value
1901 // Hash algorithm: HMAC-SHA256
1902 // Size: 32 byte
1903 // Default: null or empty if there is no active device for this profile
1904 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001905 // An identifier that can be used to match events for this device.
1906 // The incremental identifier is locally generated and guaranteed not derived
1907 // from any globally unique hardware id.
1908 // For paired devices, it stays consistent between Bluetooth toggling for the
1909 // same remote device.
1910 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1911 // session for the same remote device.
1912 // Default: 0 if the device's metric id is unknown.
1913 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001914}
1915
Jack Heab86dbd22018-12-18 15:43:27 -08001916// Logs when there is an event affecting Bluetooth device's link layer connection.
1917// - This event is triggered when there is a related HCI command or event
1918// - Users of this metrics can deduce Bluetooth device's connection state from these events
1919// - HCI commands are logged before the command is sent, after receiving command status, and after
1920// receiving command complete
1921// - HCI events are logged when they arrive
1922//
1923// Low level log from system/bt
1924//
1925// Bluetooth classic commands:
1926// - CMD_CREATE_CONNECTION
1927// - CMD_DISCONNECT
1928// - CMD_CREATE_CONNECTION_CANCEL
1929// - CMD_ACCEPT_CONNECTION_REQUEST
1930// - CMD_REJECT_CONNECTION_REQUEST
1931// - CMD_SETUP_ESCO_CONNECTION
1932// - CMD_ACCEPT_ESCO_CONNECTION
1933// - CMD_REJECT_ESCO_CONNECTION
1934// - CMD_ENH_SETUP_ESCO_CONNECTION
1935// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1936//
1937// Bluetooth low energy commands:
1938// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1939// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1940// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1941// - CMD_BLE_CLEAR_WHITE_LIST
1942// - CMD_BLE_ADD_WHITE_LIST
1943// - CMD_BLE_REMOVE_WHITE_LIST
1944//
1945// Bluetooth classic events:
1946// - EVT_CONNECTION_COMP
1947// - EVT_CONNECTION_REQUEST
1948// - EVT_DISCONNECTION_COMP
1949// - EVT_ESCO_CONNECTION_COMP
1950// - EVT_ESCO_CONNECTION_CHANGED
1951//
1952// Bluetooth low energy meta events:
1953// - BLE_EVT_CONN_COMPLETE_EVT
1954// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1955//
1956// Next tag: 10
1957message BluetoothLinkLayerConnectionEvent {
1958 // An identifier that can be used to match events for this device.
1959 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1960 // Salt: Randomly generated 256 bit value
1961 // Hash algorithm: HMAC-SHA256
1962 // Size: 32 byte
1963 // Default: null or empty if the device identifier is not known
1964 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1965 // Connection handle of this connection if available
1966 // Range: 0x0000 - 0x0EFF (12 bits)
1967 // Default: 0xFFFF if the handle is unknown
1968 optional int32 connection_handle = 2;
1969 // Direction of the link
1970 // Default: DIRECTION_UNKNOWN
1971 optional android.bluetooth.DirectionEnum direction = 3;
1972 // Type of this link
1973 // Default: LINK_TYPE_UNKNOWN
1974 optional android.bluetooth.LinkTypeEnum type = 4;
1975
1976 // Reason metadata for this link layer connection event, rules for interpretation:
1977 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1978 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1979 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1980 // set and valid, ignore hci_ble_event
1981
1982 // HCI command associated with this event
1983 // Default: CMD_UNKNOWN
1984 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1985 // HCI event associated with this event
1986 // Default: EVT_UNKNOWN
1987 optional android.bluetooth.hci.EventEnum hci_event = 6;
1988 // HCI BLE meta event associated with this event
1989 // Default: BLE_EVT_UNKNOWN
1990 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1991 // HCI command status code if this is triggerred by hci_cmd
1992 // Default: STATUS_UNKNOWN
1993 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1994 // HCI reason code associated with this event
1995 // Default: STATUS_UNKNOWN
1996 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001997 // An identifier that can be used to match events for this device.
1998 // The incremental identifier is locally generated and guaranteed not derived
1999 // from any globally unique hardware id.
2000 // For paired devices, it stays consistent between Bluetooth toggling for the
2001 // same remote device.
2002 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2003 // session for the same remote device.
2004 // Default: 0 if the device's metric id is unknown.
2005 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002006}
2007
Howard Roe103fe22019-01-17 16:52:16 -08002008/**
2009 * Logs when a module is rolled back by Watchdog.
2010 *
2011 * Logged from: Rollback Manager
2012 */
2013message WatchdogRollbackOccurred {
2014 enum RollbackType {
2015 UNKNOWN = 0;
2016 ROLLBACK_INITIATE = 1;
2017 ROLLBACK_SUCCESS = 2;
2018 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002019 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002020 }
2021 optional RollbackType rollback_type = 1;
2022
2023 optional string package_name = 2;
2024
2025 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002026
2027 enum RollbackReasonType {
2028 REASON_UNKNOWN = 0;
2029 REASON_NATIVE_CRASH = 1;
2030 REASON_EXPLICIT_HEALTH_CHECK = 2;
2031 REASON_APP_CRASH = 3;
2032 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002033 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002034 }
2035 optional RollbackReasonType rollback_reason = 4;
2036
2037 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2038 // is initiated. Empty if the package is unknown.
2039 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002040
2041 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002042}
2043
Jack Hec27040a2019-01-09 20:54:41 -08002044/**
2045 * Logs when there is a change in Bluetooth A2DP playback state
2046 *
2047 * Logged from:
2048 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2049 */
2050message BluetoothA2dpPlaybackStateChanged {
2051 // An identifier that can be used to match events for this device.
2052 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2053 // Salt: Randomly generated 256 bit value
2054 // Hash algorithm: HMAC-SHA256
2055 // Size: 32 byte
2056 // Default: null or empty if the device identifier is not known
2057 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2058 // Current playback state
2059 // Default: PLAYBACK_STATE_UNKNOWN
2060 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2061 // Current audio coding mode
2062 // Default: AUDIO_CODING_MODE_UNKNOWN
2063 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002064 // An identifier that can be used to match events for this device.
2065 // The incremental identifier is locally generated and guaranteed not derived
2066 // from any globally unique hardware id.
2067 // For paired devices, it stays consistent between Bluetooth toggling for the
2068 // same remote device.
2069 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2070 // session for the same remote device.
2071 // Default: 0 if the device's metric id is unknown.
2072 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002073}
2074
2075/**
2076 * Logs when there is a change in A2DP codec config for a particular remote device
2077 *
2078 * Logged from:
2079 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2080 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2081 */
2082message BluetoothA2dpCodecConfigChanged {
2083 // An identifier that can be used to match events for this device.
2084 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2085 // Salt: Randomly generated 256 bit value
2086 // Hash algorithm: HMAC-SHA256
2087 // Size: 32 byte
2088 // Default: null or empty if the device identifier is not known
2089 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2090 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2091 // Default SOURCE_CODEC_TYPE_INVALID
2092 optional int32 codec_type = 2;
2093 // Codec priroity, the higher the more preferred, -1 for disabled
2094 // Default: CODEC_PRIORITY_DEFAULT
2095 optional int32 codec_priority = 3;
2096 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2097 // Default: SAMPLE_RATE_NONE
2098 optional int32 sample_rate = 4;
2099 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2100 // Default: BITS_PER_SAMPLE_NONE
2101 optional int32 bits_per_sample = 5;
2102 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2103 // Default: CHANNEL_MODE_NONE
2104 optional int32 channel_mode = 6;
2105 // Codec specific values
2106 // Default 0
2107 optional int64 codec_specific_1 = 7;
2108 optional int64 codec_specific_2 = 8;
2109 optional int64 codec_specific_3 = 9;
2110 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002111 // An identifier that can be used to match events for this device.
2112 // The incremental identifier is locally generated and guaranteed not derived
2113 // from any globally unique hardware id.
2114 // For paired devices, it stays consistent between Bluetooth toggling for the
2115 // same remote device.
2116 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2117 // session for the same remote device.
2118 // Default: 0 if the device's metric id is unknown.
2119 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002120}
2121
2122/**
2123 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2124 * Each codec's capability is logged separately due to statsd restriction
2125 *
2126 * Logged from:
2127 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2128 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2129 */
2130message BluetoothA2dpCodecCapabilityChanged {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2139 // Default SOURCE_CODEC_TYPE_INVALID
2140 optional int32 codec_type = 2;
2141 // Codec priroity, the higher the more preferred, -1 for disabled
2142 // Default: CODEC_PRIORITY_DEFAULT
2143 optional int32 codec_priority = 3;
2144 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2145 // in BluetoothCodecConfig
2146 // Default: empty and SAMPLE_RATE_NONE for individual item
2147 optional int32 sample_rate = 4;
2148 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2149 // in BluetoothCodecConfig
2150 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2151 optional int32 bits_per_sample = 5;
2152 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2153 // BluetoothCodecConfig
2154 // Default: empty and CHANNEL_MODE_NONE for individual item
2155 optional int32 channel_mode = 6;
2156 // Codec specific values
2157 // Default 0
2158 optional int64 codec_specific_1 = 7;
2159 optional int64 codec_specific_2 = 8;
2160 optional int64 codec_specific_3 = 9;
2161 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002162 // An identifier that can be used to match events for this device.
2163 // The incremental identifier is locally generated and guaranteed not derived
2164 // from any globally unique hardware id.
2165 // For paired devices, it stays consistent between Bluetooth toggling for the
2166 // same remote device.
2167 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2168 // session for the same remote device.
2169 // Default: 0 if the device's metric id is unknown.
2170 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002171}
2172
2173/**
2174 * Logs when A2DP failed to read from PCM source.
2175 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2176 *
2177 * Logged from:
2178 * system/bt
2179 */
2180message BluetoothA2dpAudioUnderrunReported {
2181 // An identifier that can be used to match events for this device.
2182 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2183 // Salt: Randomly generated 256 bit value
2184 // Hash algorithm: HMAC-SHA256
2185 // Size: 32 byte
2186 // Default: null or empty if the device identifier is not known
2187 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2188 // Encoding interval in nanoseconds
2189 // Default: 0
2190 optional int64 encoding_interval_nanos = 2;
2191 // Number of bytes of PCM data that could not be read from the source
2192 // Default: 0
2193 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002194 // An identifier that can be used to match events for this device.
2195 // The incremental identifier is locally generated and guaranteed not derived
2196 // from any globally unique hardware id.
2197 // For paired devices, it stays consistent between Bluetooth toggling for the
2198 // same remote device.
2199 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2200 // session for the same remote device.
2201 // Default: 0 if the device's metric id is unknown.
2202 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002203}
2204
2205/**
2206 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2207 * buffer queue is full and we have to drop data
2208 *
2209 * Logged from:
2210 * system/bt
2211 */
2212message BluetoothA2dpAudioOverrunReported {
2213 // An identifier that can be used to match events for this device.
2214 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2215 // Salt: Randomly generated 256 bit value
2216 // Hash algorithm: HMAC-SHA256
2217 // Size: 32 byte
2218 // Default: null or empty if the device identifier is not known
2219 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2220 // Encoding interval in nanoseconds
2221 // Default: 0
2222 optional int64 encoding_interval_nanos = 2;
2223 // Number of buffers dropped in this event
2224 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2225 // Default: 0
2226 optional int32 num_dropped_buffers = 3;
2227 // Number of encoded buffers dropped in this event
2228 // Default 0
2229 optional int32 num_dropped_encoded_frames = 4;
2230 // Number of encoded bytes dropped in this event
2231 // Default: 0
2232 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002233 // An identifier that can be used to match events for this device.
2234 // The incremental identifier is locally generated and guaranteed not derived
2235 // from any globally unique hardware id.
2236 // For paired devices, it stays consistent between Bluetooth toggling for the
2237 // same remote device.
2238 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2239 // session for the same remote device.
2240 // Default: 0 if the device's metric id is unknown.
2241 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002242}
2243
2244/**
2245 * Logs when we receive reports regarding a device's RSSI value
2246 *
2247 * Logged from:
2248 * system/bt
2249 */
2250message BluetoothDeviceRssiReported {
2251 // An identifier that can be used to match events for this device.
2252 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2253 // Salt: Randomly generated 256 bit value
2254 // Hash algorithm: HMAC-SHA256
2255 // Size: 32 byte
2256 // Default: null or empty if the device identifier is not known
2257 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2258 // Connection handle of this connection if available
2259 // Range: 0x0000 - 0x0EFF (12 bits)
2260 // Default: 0xFFFF if the handle is unknown
2261 optional int32 connection_handle = 2;
2262 // HCI command status code if this is triggerred by hci_cmd
2263 // Default: STATUS_UNKNOWN
2264 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2265 // BR/EDR
2266 // Range: -128 ≤ N ≤ 127 (signed integer)
2267 // Units: dB
2268 // LE:
2269 // Range: -127 to 20, 127 (signed integer)
2270 // Units: dBm
2271 // Invalid when an out of range value is reported
2272 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002273 // An identifier that can be used to match events for this device.
2274 // The incremental identifier is locally generated and guaranteed not derived
2275 // from any globally unique hardware id.
2276 // For paired devices, it stays consistent between Bluetooth toggling for the
2277 // same remote device.
2278 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2279 // session for the same remote device.
2280 // Default: 0 if the device's metric id is unknown.
2281 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002282}
2283
2284/**
2285 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2286 *
2287 * Logged from:
2288 * system/bt
2289 */
2290message BluetoothDeviceFailedContactCounterReported {
2291 // An identifier that can be used to match events for this device.
2292 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2293 // Salt: Randomly generated 256 bit value
2294 // Hash algorithm: HMAC-SHA256
2295 // Size: 32 byte
2296 // Default: null or empty if the device identifier is not known
2297 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2298 // Connection handle of this connection if available
2299 // Range: 0x0000 - 0x0EFF (12 bits)
2300 // Default: 0xFFFF if the handle is unknown
2301 optional int32 connection_handle = 2;
2302 // HCI command status code if this is triggerred by hci_cmd
2303 // Default: STATUS_UNKNOWN
2304 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2305 // Number of consecutive failed contacts for a connection corresponding to the Handle
2306 // Range: uint16_t, 0-0xFFFF
2307 // Default: 0xFFFFF
2308 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002309 // An identifier that can be used to match events for this device.
2310 // The incremental identifier is locally generated and guaranteed not derived
2311 // from any globally unique hardware id.
2312 // For paired devices, it stays consistent between Bluetooth toggling for the
2313 // same remote device.
2314 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2315 // session for the same remote device.
2316 // Default: 0 if the device's metric id is unknown.
2317 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002318}
2319
2320/**
2321 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2322 *
2323 * Logged from:
2324 * system/bt
2325 */
2326message BluetoothDeviceTxPowerLevelReported {
2327 // An identifier that can be used to match events for this device.
2328 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2329 // Salt: Randomly generated 256 bit value
2330 // Hash algorithm: HMAC-SHA256
2331 // Size: 32 byte
2332 // Default: null or empty if the device identifier is not known
2333 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2334 // Connection handle of this connection if available
2335 // Range: 0x0000 - 0x0EFF (12 bits)
2336 // Default: 0xFFFF if the handle is unknown
2337 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002338 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002339 // Default: STATUS_UNKNOWN
2340 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2341 // Range: -30 ≤ N ≤ 20
2342 // Units: dBm
2343 // Invalid when an out of range value is reported
2344 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002345 // An identifier that can be used to match events for this device.
2346 // The incremental identifier is locally generated and guaranteed not derived
2347 // from any globally unique hardware id.
2348 // For paired devices, it stays consistent between Bluetooth toggling for the
2349 // same remote device.
2350 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2351 // session for the same remote device.
2352 // Default: 0 if the device's metric id is unknown.
2353 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002354}
Jack Heab86dbd22018-12-18 15:43:27 -08002355
Tej Singh5d991e12018-03-09 19:48:11 -08002356/**
Jack He1021a612019-01-20 21:22:46 -08002357 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2358 * receiving an HCI command from the host
2359 *
2360 * Logged from: system/bt
2361 */
2362message BluetoothHciTimeoutReported {
2363 // HCI command associated with this event
2364 // Default: CMD_UNKNOWN
2365 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2366}
2367
2368/**
2369 * Logs when we receive Bluetooth Link Quality Report event from the controller
2370 * See Android Bluetooth HCI specification for more details
2371 *
2372 * Note: all count and bytes field are counted since last event
2373 *
2374 * Logged from: system/bt
2375 */
2376message BluetoothQualityReportReported {
2377 // Quality report ID
2378 // Original type: uint8_t
2379 // Default: BQR_ID_UNKNOWN
2380 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2381 // Packet type of the connection
2382 // Original type: uint8_t
2383 // Default: BQR_PACKET_TYPE_UNKNOWN
2384 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2385 // Connection handle of the connection
2386 // Original type: uint16_t
2387 optional int32 connection_handle = 3;
2388 // Performing Role for the connection
2389 // Original type: uint8_t
2390 optional int32 connection_role = 4;
2391 // Current Transmit Power Level for the connection. This value is the same as the controller's
2392 // response to the HCI_Read_Transmit_Power_Level HCI command
2393 // Original type: uint8_t
2394 optional int32 tx_power_level = 5;
2395 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2396 // absolute receiver signal strength value
2397 // Original type: int8_t
2398 optional int32 rssi = 6;
2399 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2400 // channels used by the link currently
2401 // Original type: uint8_t
2402 optional int32 snr = 7;
2403 // Indicates the number of unused channels in AFH_channel_map
2404 // Original type: uint8_t
2405 optional int32 unused_afh_channel_count = 8;
2406 // Indicates the number of the channels which are interfered and quality is bad but are still
2407 // selected for AFH
2408 // Original type: uint8_t
2409 optional int32 afh_select_unideal_channel_count = 9;
2410 // Current Link Supervision Timeout Setting
2411 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2412 // Original type: uint16_t
2413 optional int32 lsto = 10;
2414 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2415 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2416 // 0x01 (Piconet Clock)
2417 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2418 // Original type: uint32_t
2419 optional int64 connection_piconet_clock = 11;
2420 // The count of retransmission
2421 // Original type: uint32_t
2422 optional int64 retransmission_count = 12;
2423 // The count of no RX
2424 // Original type: uint32_t
2425 optional int64 no_rx_count = 13;
2426 // The count of NAK (Negative Acknowledge)
2427 // Original type: uint32_t
2428 optional int64 nak_count = 14;
2429 // Controller timestamp of last TX ACK
2430 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2431 // Original type: uint32_t
2432 optional int64 last_tx_ack_timestamp = 15;
2433 // The count of Flow-off (STOP)
2434 // Original type: uint32_t
2435 optional int64 flow_off_count = 16;
2436 // Controller timestamp of last Flow-on (GO)
2437 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2438 // Original type: uint32_t
2439 optional int64 last_flow_on_timestamp = 17;
2440 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2441 // Original type: uint32_t
2442 optional int64 buffer_overflow_bytes = 18;
2443 // Buffer underflow count (in byte) since last event
2444 // Original type: uint32_t
2445 optional int64 buffer_underflow_bytes = 19;
2446}
2447
2448/**
2449 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2450 *
2451 * Notes:
2452 * - Each event can be partially filled as we might learn different pieces of device
2453 * information at different time
2454 * - Multiple device info events can be combined to give more complete picture
2455 * - When multiple device info events tries to describe the same information, the
2456 * later one wins
2457 *
2458 * Logged from:
2459 * packages/apps/Bluetooth
2460 */
Jack Heaea26982019-04-04 11:19:48 -07002461message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002462 // An identifier that can be used to match events for this device.
2463 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2464 // Salt: Randomly generated 256 bit value
2465 // Hash algorithm: HMAC-SHA256
2466 // Size: 32 byte
2467 // Default: null or empty if the device identifier is not known
2468 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2469 // Where is this device info obtained from
2470 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2471 // Name of the data source
2472 // For EXTERNAL: package name of the data source
2473 // For INTERNAL: null for general case, component name otherwise
2474 optional string source_name = 3;
2475 // Name of the manufacturer of this device
2476 optional string manufacturer = 4;
2477 // Model of this device
2478 optional string model = 5;
2479 // Hardware version of this device
2480 optional string hardware_version = 6;
2481 // Software version of this device
2482 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002483 // An identifier that can be used to match events for this device.
2484 // The incremental identifier is locally generated and guaranteed not derived
2485 // from any globally unique hardware id.
2486 // For paired devices, it stays consistent between Bluetooth toggling for the
2487 // same remote device.
2488 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2489 // session for the same remote device.
2490 // Default: 0 if the device's metric id is unknown.
2491 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002492}
2493
2494/**
2495 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2496 * device, as documented by the Bluetooth Core HCI specification
2497 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2498 * Vol 2, Part E, Page 1118
2499 *
2500 * Logged from:
2501 * system/bt
2502 */
2503message BluetoothRemoteVersionInfoReported {
2504 // Connection handle of the connection
2505 // Original type: uint16_t
2506 optional int32 connection_handle = 1;
2507 // HCI command status code
2508 // Default: STATUS_UNKNOWN
2509 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2510 // 1 byte Version of current LMP in the remote controller
2511 optional int32 lmp_version = 3;
2512 // 2 bytes LMP manufacturer code of the remote controller
2513 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2514 optional int32 lmp_manufacturer_code = 4;
2515 // 4 bytes subversion of the LMP in the remote controller
2516 optional int32 lmp_subversion = 5;
2517}
2518
2519/**
2520 * Logs when certain Bluetooth SDP attributes are discovered
2521 * Constant definitions are from:
2522 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2523 *
2524 * Current logged attributes:
2525 * - BluetoothProfileDescriptorList
2526 * - Supported Features Bitmask
2527 *
2528 * Logged from:
2529 * system/bt
2530 */
2531message BluetoothSdpAttributeReported {
2532 // An identifier that can be used to match events for this device.
2533 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2534 // Salt: Randomly generated 256 bit value
2535 // Hash algorithm: HMAC-SHA256
2536 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2537 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2538 // Original type: uint16_t
2539 optional int32 protocol_uuid = 2;
2540 // Short form UUIDs used to identify Bluetooth SDP attribute types
2541 // Original type: uint16_t
2542 optional int32 attribute_id = 3;
2543 // Attribute value for the particular attribute
2544 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002545 // An identifier that can be used to match events for this device.
2546 // The incremental identifier is locally generated and guaranteed not derived
2547 // from any globally unique hardware id.
2548 // For paired devices, it stays consistent between Bluetooth toggling for the
2549 // same remote device.
2550 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2551 // session for the same remote device.
2552 // Default: 0 if the device's metric id is unknown.
2553 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002554}
2555
2556/**
2557 * Logs when bond state of a Bluetooth device changes
2558 *
2559 * Logged from:
2560 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2561 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2562 */
2563message BluetoothBondStateChanged {
2564 // An identifier that can be used to match events for this device.
2565 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2566 // Salt: Randomly generated 256 bit value
2567 // Hash algorithm: HMAC-SHA256
2568 // Size: 32 byte
2569 // Default: null or empty if the device identifier is not known
2570 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2571 // Preferred transport type to remote dual mode device
2572 // Default: TRANSPORT_AUTO means no preference
2573 optional android.bluetooth.TransportTypeEnum transport = 2;
2574 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2575 // Default: UNKNOWN
2576 optional android.bluetooth.DeviceTypeEnum type = 3;
2577 // Current bond state (NONE, BONDING, BONDED)
2578 // Default: BOND_STATE_UNKNOWN
2579 optional android.bluetooth.BondStateEnum bond_state = 4;
2580 // Bonding sub state
2581 // Default: BOND_SUB_STATE_UNKNOWN
2582 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2583 // Unbond Reason
2584 // Default: UNBOND_REASON_UNKNOWN
2585 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002586 // An identifier that can be used to match events for this device.
2587 // The incremental identifier is locally generated and guaranteed not derived
2588 // from any globally unique hardware id.
2589 // For paired devices, it stays consistent between Bluetooth toggling for the
2590 // same remote device.
2591 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2592 // session for the same remote device.
2593 // Default: 0 if the device's metric id is unknown.
2594 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002595}
2596
2597/**
2598 * Logs there is an event related Bluetooth classic pairing
2599 *
2600 * Logged from:
2601 * system/bt
2602 */
2603message BluetoothClassicPairingEventReported {
2604 // An identifier that can be used to match events for this device.
2605 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2606 // Salt: Randomly generated 256 bit value
2607 // Hash algorithm: HMAC-SHA256
2608 // Size: 32 byte
2609 // Default: null or empty if the device identifier is not known
2610 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2611 // Connection handle of this connection if available
2612 // Range: 0x0000 - 0x0EFF (12 bits)
2613 // Default: 0xFFFF if the handle is unknown
2614 optional int32 connection_handle = 2;
2615 // HCI command associated with this event
2616 // Default: CMD_UNKNOWN
2617 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2618 // HCI event associated with this event
2619 // Default: EVT_UNKNOWN
2620 optional android.bluetooth.hci.EventEnum hci_event = 4;
2621 // HCI command status code if this is triggerred by hci_cmd
2622 // Default: STATUS_UNKNOWN
2623 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2624 // HCI reason code associated with this event
2625 // Default: STATUS_UNKNOWN
2626 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002627 // A status value related to this specific event
2628 // Default: 0
2629 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002630 // An identifier that can be used to match events for this device.
2631 // The incremental identifier is locally generated and guaranteed not derived
2632 // from any globally unique hardware id.
2633 // For paired devices, it stays consistent between Bluetooth toggling for the
2634 // same remote device.
2635 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2636 // session for the same remote device.
2637 // Default: 0 if the device's metric id is unknown.
2638 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002639}
2640
2641/**
2642 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2643 *
2644 * Logged from:
2645 * system/bt
2646 */
2647message BluetoothSmpPairingEventReported {
2648 // An identifier that can be used to match events for this device.
2649 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2650 // Salt: Randomly generated 256 bit value
2651 // Hash algorithm: HMAC-SHA256
2652 // Size: 32 byte
2653 // Default: null or empty if the device identifier is not known
2654 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2655 // SMP command sent or received over L2CAP
2656 // Default: CMD_UNKNOWN
2657 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2658 // Whether this command is sent or received
2659 // Default: DIRECTION_UNKNOWN
2660 optional android.bluetooth.DirectionEnum direction = 3;
2661 // SMP failure reason code
2662 // Default: PAIRING_FAIL_REASON_DEFAULT
2663 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002664 // An identifier that can be used to match events for this device.
2665 // The incremental identifier is locally generated and guaranteed not derived
2666 // from any globally unique hardware id.
2667 // For paired devices, it stays consistent between Bluetooth toggling for the
2668 // same remote device.
2669 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2670 // session for the same remote device.
2671 // Default: 0 if the device's metric id is unknown.
2672 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002673}
2674
2675/**
Jack He815cdba2019-01-30 17:24:55 -08002676 * Logs when a Bluetooth socket’s connection state changed
2677 *
2678 * Logged from:
2679 * system/bt
2680 */
2681message BluetoothSocketConnectionStateChanged {
2682 // An identifier that can be used to match events for this device.
2683 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2684 // Salt: Randomly generated 256 bit value
2685 // Hash algorithm: HMAC-SHA256
2686 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002687 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002688 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002689 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002690 // Default 0 when unknown or don't care
2691 optional int32 port = 2;
2692 // Socket type as mentioned in
2693 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2694 // Default: SOCKET_TYPE_UNKNOWN
2695 optional android.bluetooth.SocketTypeEnum type = 3;
2696 // Socket connection state
2697 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2698 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2699 // Number of bytes sent to remote device during this connection
2700 optional int64 tx_bytes = 5;
2701 // Number of bytes received from remote device during this connection
2702 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002703 // Socket owner's UID
2704 optional int32 uid = 7 [(is_uid) = true];
2705 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2706 // |port| must be spawned by |server_port|
2707 // Default 0 when unknown or don't care
2708 optional int32 server_port = 8;
2709 // Whether this is a server listener socket
2710 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002711 // An identifier that can be used to match events for this device.
2712 // The incremental identifier is locally generated and guaranteed not derived
2713 // from any globally unique hardware id.
2714 // For paired devices, it stays consistent between Bluetooth toggling for the
2715 // same remote device.
2716 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2717 // session for the same remote device.
2718 // Default: 0 if the device's metric id is unknown.
2719 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002720}
2721
2722/**
Jack He71426802019-04-02 13:32:52 -07002723 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2724 *
2725 * Logged from:
2726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2727 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2728 *
2729 */
2730message BluetoothClassOfDeviceReported {
2731 // An identifier that can be used to match events for this device.
2732 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2733 // Salt: Randomly generated 256 bit value
2734 // Hash algorithm: HMAC-SHA256
2735 // Size: 32 byte
2736 // Default: null or empty if this is a server listener socket
2737 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2738 // Class of Device (CoD) value including both Major, Minor device class and service class
2739 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2740 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2741 // Default: 0
2742 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002743 // An identifier that can be used to match events for this device.
2744 // The incremental identifier is locally generated and guaranteed not derived
2745 // from any globally unique hardware id.
2746 // For paired devices, it stays consistent between Bluetooth toggling for the
2747 // same remote device.
2748 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2749 // session for the same remote device.
2750 // Default: 0 if the device's metric id is unknown.
2751 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002752}
2753
2754/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002755 * Logs when something is plugged into or removed from the USB-C connector.
2756 *
2757 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002758 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002759 */
2760message UsbConnectorStateChanged {
2761 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002762 STATE_DISCONNECTED = 0;
2763 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002764 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002765 optional State state = 1
2766 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2767 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002768 // Last active session in ms.
2769 // 0 when the port is in connected state.
2770 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002771}
2772
2773/**
2774 * Logs the reported speaker impedance.
2775 *
2776 * Logged from:
2777 * Vendor audio implementation.
2778 */
2779message SpeakerImpedanceReported {
2780 optional int32 speaker_location = 1;
2781 optional int32 impedance = 2;
2782}
2783
2784/**
2785 * Logs the report of a failed hardware.
2786 *
2787 * Logged from:
2788 * Vendor HALs.
2789 *
2790 */
2791message HardwareFailed {
2792 enum HardwareType {
2793 HARDWARE_FAILED_UNKNOWN = 0;
2794 HARDWARE_FAILED_MICROPHONE = 1;
2795 HARDWARE_FAILED_CODEC = 2;
2796 HARDWARE_FAILED_SPEAKER = 3;
2797 HARDWARE_FAILED_FINGERPRINT = 4;
2798 }
2799 optional HardwareType hardware_type = 1;
2800
Maggie White6dcd8572019-01-31 14:11:50 -08002801 /**
2802 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002803 * the same hardware_type. The specific locations are vendor defined integers,
2804 * referring to board-specific numbering schemes.
2805 */
2806 optional int32 hardware_location = 2;
2807
Maggie White6dcd8572019-01-31 14:11:50 -08002808 /**
2809 * failure_code is specific to the HardwareType of the failed hardware.
2810 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002811 */
Maggie White6dcd8572019-01-31 14:11:50 -08002812 enum HardwareErrorCode {
2813 UNKNOWN = 0;
2814 COMPLETE = 1;
2815 SPEAKER_HIGH_Z = 2;
2816 SPEAKER_SHORT = 3;
2817 FINGERPRINT_SENSOR_BROKEN = 4;
2818 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002819 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002820 }
2821 optional int32 failure_code = 3;
2822}
2823
2824/**
2825 * Log an event when the device has been physically dropped.
2826 * Reported from the /vendor partition.
2827 */
2828message PhysicalDropDetected {
2829 // Confidence that the event was actually a drop, 0 -> 100
2830 optional int32 confidence_pctg = 1;
2831 // Peak acceleration of the drop, in 1/1000s of a g.
2832 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002833 // Duration of freefall in ms
2834 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002835}
2836
2837/**
2838 * Log bucketed battery charge cycles.
2839 *
2840 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002841 * a given charge point. For example, if 10 cycle buckets are
2842 * initialized, bucket 1 is the lowest 1/10th of the battery,
2843 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002844 *
2845 * Logged from:
2846 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2847 */
2848message ChargeCyclesReported {
2849 optional int32 cycle_bucket_1 = 1;
2850 optional int32 cycle_bucket_2 = 2;
2851 optional int32 cycle_bucket_3 = 3;
2852 optional int32 cycle_bucket_4 = 4;
2853 optional int32 cycle_bucket_5 = 5;
2854 optional int32 cycle_bucket_6 = 6;
2855 optional int32 cycle_bucket_7 = 7;
2856 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002857 optional int32 cycle_bucket_9 = 9;
2858 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002859}
2860
2861/**
Howard Roa46b6582018-09-18 16:45:02 -07002862 * Log battery health snapshot.
2863 *
2864 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2865 * are snapshotted periodically over 24hrs.
2866 */
2867message BatteryHealthSnapshot {
2868 enum BatterySnapshotType {
2869 UNKNOWN = 0;
2870 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2871 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2872 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2873 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2874 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2875 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2876 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2877 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2878 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2879 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2880 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2881 }
2882 optional BatterySnapshotType type = 1;
2883 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002884 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002885 // Voltage Battery Voltage, in microVolts.
2886 optional int32 voltage_micro_volt = 3;
2887 // Current Battery current, in microAmps.
2888 optional int32 current_micro_amps = 4;
2889 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2890 optional int32 open_circuit_micro_volt = 5;
2891 // Resistance Battery Resistance, in microOhms.
2892 optional int32 resistance_micro_ohm = 6;
2893 // Level Battery Level, as % of full.
2894 optional int32 level_percent = 7;
2895}
2896
2897/**
2898 * Log slow I/O operations on the primary storage.
2899 */
2900message SlowIo {
2901 // Classifications of IO Operations.
2902 enum IoOperation {
2903 UNKNOWN = 0;
2904 READ = 1;
2905 WRITE = 2;
2906 UNMAP = 3;
2907 SYNC = 4;
2908 }
2909 optional IoOperation operation = 1;
2910
2911 // The number of slow IO operations of this type over 24 hours.
2912 optional int32 count = 2;
2913}
2914
2915/**
2916 * Log battery caused shutdown with the last recorded voltage.
2917 */
2918message BatteryCausedShutdown {
2919 // The last recorded battery voltage prior to shutdown.
2920 optional int32 last_recorded_micro_volt = 1;
2921}
2922
2923/**
Tej Singha72344992019-04-17 18:55:08 -07002924 * Logs when ThermalService receives throttling events.
2925 *
2926 * Logged from:
2927 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2928 */
2929message ThermalThrottlingSeverityStateChanged {
2930 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2931 optional android.os.TemperatureTypeEnum sensor_type = 1;
2932
2933 // The name of the temperature source. Eg. CPU0
2934 optional string sensor_name = 2;
2935
2936 // Temperature in tenths of a degree C.
2937 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2938 optional int32 temperature_deci_celsius = 3;
2939
2940 // Relative severity of the throttling, see enum definition.
2941 optional android.os.ThrottlingSeverityEnum severity = 4;
2942}
2943
2944/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002945 * Logs the duration of a davey (jank of >=700ms) when it occurs
2946 *
2947 * Logged from:
2948 * frameworks/base/libs/hwui/JankTracker.cpp
2949 */
2950message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002951 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002952 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002953
Tej Singhbb8554a2018-01-26 11:59:14 -08002954 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002955 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002956}
2957
2958/**
Bookatze5885242017-10-24 20:10:31 -07002959 * Logs phone signal strength changes.
2960 *
2961 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002962 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002963 */
2964message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002965 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2966 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002967}
2968
Yangster4ccebea2018-10-09 17:09:02 -07002969
2970/**
2971 * Logs when the phone state, sim state or signal strength changes
2972 *
2973 * Logged from:
2974 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2975 */
2976message PhoneServiceStateChanged {
2977 optional android.telephony.ServiceStateEnum state = 1;
2978 optional android.telephony.SimStateEnum sim_state = 2;
2979 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2980}
2981
2982/**
2983 * Logs when the phone becomes on or off.
2984 *
2985 * Logged from:
2986 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2987 */
2988message PhoneStateChanged {
2989 enum State {
2990 OFF = 0;
2991 ON = 1;
2992 }
2993 optional State state = 1;
2994}
2995
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002996message BackGesture {
2997 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002998 DEFAULT_BACK_TYPE = 0;
2999 COMPLETED = 1;
3000 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3001 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3002 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3003 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3004 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3005 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3006 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003007 }
3008 optional BackType type = 1;
3009
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003010 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3011 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3012 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3013 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3014 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3015 optional int32 left_boundary = 8; // left edge width + left inset
3016 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3017
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003018 enum WindowHorizontalLocation {
3019 DEFAULT_LOCATION = 0;
3020 LEFT = 1;
3021 RIGHT = 2;
3022 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003023 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003024}
3025
3026message ExclusionRectStateChanged {
3027 optional string component_name = 1; // if not available, simply packageName
3028 optional int32 requested_height = 2; // px
3029 optional int32 rejected_height = 3; // px
3030
3031 enum WindowHorizontalLocation {
3032 DEFAULT_LOCATION = 0;
3033 LEFT = 1;
3034 RIGHT = 2;
3035 }
3036 optional WindowHorizontalLocation x_location = 4;
3037 optional bool landscape = 5;
3038 optional bool splitscreen = 6;
3039 optional int32 duration_millis = 7;
3040}
3041
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003042/**
3043 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3044 *
3045 * Logged from:
3046 * packages/apps/Launcher3
3047 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003048message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003049 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003050 optional android.stats.launcher.LauncherState src_state = 2;
3051 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003052 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3053 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3054
3055 // The event id (e.g., app launch, drag and drop, long press)
3056 optional int32 event_id = 6;
3057 // The event's source or target id (e.g., icon, task, button)
3058 optional int32 target_id = 7;
3059 // If the target needs to be tracked, use this id field
3060 optional int32 instance_id = 8;
3061 optional int32 uid = 9 [(is_uid) = true];
3062 optional string package_name = 10;
3063 optional string component_name = 11;
3064
3065 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003066 optional int32 grid_x = 12 [default = -1];
3067 optional int32 grid_y = 13 [default = -1];
3068 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003069
3070 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003071 optional int32 grid_x_parent = 15 [default = -1];
3072 optional int32 grid_y_parent = 16 [default = -1];
3073 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003074
3075 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3076 optional int32 hierarchy = 18;
3077
3078 optional bool is_work_profile = 19;
3079
3080 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003081 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003082
3083 // e.g., folderLabelState can be captured in the following two fields
3084 optional int32 from_state = 21;
3085 optional int32 to_state = 22;
3086
3087 // e.g., autofilled or suggested texts that are not user entered
3088 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003089
3090 // e.g., number of contents inside a container (e.g., icons inside a folder)
3091 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003092}
3093
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003094/**
3095 * Used for snapshot of the HomeScreen UI elements
3096 *
3097 * Logged from:
3098 * packages/apps/Launcher3
3099 */
3100message LauncherStaticLayout {
3101 // The event id (e.g., snapshot, drag and drop)
3102 optional int32 event_id = 1;
3103 // The event's source or target id (e.g., icon, shortcut, widget)
3104 optional int32 target_id = 2;
3105 // If the target needs to be tracked, use this id field
3106 optional int32 instance_id = 3;
3107 optional int32 uid = 4 [(is_uid) = true];
3108 optional string package_name = 5;
3109 optional string component_name = 6;
3110
3111 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003112 optional int32 grid_x = 7 [default = -1];
3113 optional int32 grid_y = 8 [default = -1];
3114 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003115
3116 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003117 // e.g., when used with widgets target, use these values for (span_x, span_y)
3118 optional int32 grid_x_parent = 10 [default = -1];
3119 optional int32 grid_y_parent = 11 [default = -1];
3120 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003121
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003122 // UNKNOWN = 0
3123 // HOTSEAT = 1
3124 // WORKSPACE = 2
3125 // FOLDER_HOTSEAT = 3
3126 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003127 optional int32 hierarchy = 13;
3128
3129 optional bool is_work_profile = 14;
3130
3131 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3132 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003133
3134 // e.g., number of icons inside a folder
3135 optional int32 cardinality = 16;
3136
3137 // e.g., (x, y) span of the widget inside homescreen grid system
3138 optional int32 span_x = 17 [default = 1];
3139 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003140}
3141
3142/**
3143 * Logs when Wallpaper or ThemePicker UI has changed.
3144 *
3145 * Logged from:
3146 * packages/apps/ThemePicker
3147 * packages/apps/WallpaperPicker2
3148 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003149message StyleUIChanged {
3150 optional android.stats.style.Action action = 1;
3151 optional int32 color_package_hash = 2;
3152 optional int32 font_package_hash = 3;
3153 optional int32 shape_package_hash = 4;
3154 optional int32 clock_package_hash = 5;
3155 optional int32 launcher_grid = 6;
3156 optional int32 wallpaper_category_hash = 7;
3157 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003158 optional int32 color_preference = 9;
3159 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003160}
3161
David Chenc28b2bb2017-10-24 12:52:52 -07003162/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003163 * Logs when Settings UI has changed.
3164 *
3165 * Logged from:
3166 * packages/apps/Settings
3167 */
3168message SettingsUIChanged {
3169 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003170 * Where this SettingsUIChange event comes from. For example, if
3171 * it's a PAGE_VISIBLE event, where the page is opened from.
3172 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003173 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003174
3175 /**
3176 * What the UI action is.
3177 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003178 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003179
3180 /**
3181 * Where the action is happening
3182 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003183 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003184
3185 /**
3186 * What preference changed in this event.
3187 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003188 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003189
3190 /**
3191 * The new value of the changed preference.
3192 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003193 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003194}
3195
3196/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003197 * Logs basic timing information about touch events.
3198 * Reported at most every 5 minutes while device is being interacted with.
3199 *
3200 * Logged from:
3201 * frameworks/native/services/inputflinger
3202 */
3203message TouchEventReported {
3204 /**
3205 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003206 * and the standard deviation of the time spent processing touchscreen events
3207 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003208 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003209 * On supported devices, the starting point is taken during the hard interrupt inside the
3210 * kernel touch driver. On all other devices, the starting point is taken inside
3211 * the kernel's input event subsystem upon receipt of the input event.
3212 * The ending point is taken inside InputDispatcher, just after the input event
3213 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003214 */
3215 // Minimum value
3216 optional float latency_min_micros = 1;
3217 // Maximum value
3218 optional float latency_max_micros = 2;
3219 // Average value
3220 optional float latency_mean_micros = 3;
3221 // Standard deviation
3222 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003223 // Number of touch events (input_event) in this report
3224 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003225}
3226
3227/**
Philip Quinn0eded622019-01-29 12:46:28 -08003228 * Logs gesture classification and timing information for touch events.
3229 *
3230 * Logged from:
3231 * frameworks/base/core/java/android/view/GestureDetector.java
3232 * frameworks/base/core/java/android/view/View.java
3233 */
3234message TouchGestureClassified {
3235 // The source of the classification (e.g. Java class name).
3236 optional string source = 1;
3237
3238 enum Classification {
3239 UNKNOWN_CLASSIFICATION = 0;
3240 SINGLE_TAP = 1;
3241 DOUBLE_TAP = 2;
3242 LONG_PRESS = 3;
3243 DEEP_PRESS = 4;
3244 SCROLL = 5;
3245 }
3246 // The classification of the gesture.
3247 optional Classification classification = 2;
3248
3249 // The interval from the start of a touch event stream until the
3250 // classification was made.
3251 optional int32 latency_millis = 3;
3252
3253 // The distance from the location of the first touch event to the
3254 // location of the touch event when the classification was made.
3255 optional float displacement_px = 4;
3256}
3257
3258/**
David Chenc28b2bb2017-10-24 12:52:52 -07003259 * Logs that a setting was updated.
3260 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003261 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003262 * The tag and is_default allow resetting of settings to default values based on the specified
3263 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3264 */
3265message SettingChanged {
3266 // The name of the setting.
3267 optional string setting = 1;
3268
3269 // The change being imposed on this setting. May represent a number, eg "3".
3270 optional string value = 2;
3271
3272 // The new value of this setting. For most settings, this is same as value. For some settings,
3273 // value is +X or -X where X represents an element in a set. For example, if the previous value
3274 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3275 // The +/- feature is currently only used for location_providers_allowed.
3276 optional string new_value = 3;
3277
3278 // The previous value of this setting.
3279 optional string prev_value = 4;
3280
3281 // The tag used with the is_default for resetting sets of settings. This is generally null.
3282 optional string tag = 5;
3283
Bookatz90867622018-01-31 15:05:57 -08003284 // True if this setting with tag should be resettable.
3285 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003286
David Chenbd789912018-03-16 17:19:55 -07003287 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003288 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003289
3290 enum ChangeReason {
3291 UPDATED = 1; // Updated can be an insertion or an update.
3292 DELETED = 2;
3293 }
3294 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003295}
Chenjie Yub3dda412017-10-24 13:41:59 -07003296
Chenjie Yu05013b32017-11-21 10:21:41 -08003297/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003298 * Logs activity going to foreground or background
3299 *
3300 * Logged from:
3301 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3302 */
3303message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003304 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003305 optional string pkg_name = 2;
3306 optional string class_name = 3;
3307
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003308 enum State {
3309 BACKGROUND = 0;
3310 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003311 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003312 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003313}
David Chenc8a43242017-10-17 16:23:28 -07003314
3315/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003316 * Logs when a volume entered low Storage state.
3317 * Logged from:
3318 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3319 */
3320message LowStorageStateChanged {
3321 // Volume that ran out of storage.
3322 optional string volume_description = 1;
3323
3324 enum State {
3325 UNKNOWN = 0;
3326 OFF = 1;
3327 ON = 2;
3328 }
3329 optional State state = 2;
3330}
3331
3332/**
3333 * Logs when an app is downgraded.
3334 * Logged from:
3335 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3336 */
3337message AppDowngraded {
3338 optional string package_name = 1;
3339 // Size of the package (all data) before being downgraded.
3340 optional int64 size_in_bytes_before = 2;
3341 // Size of the package (all data) after being downgraded.
3342 optional int64 size_in_bytes_after = 3;
3343
3344 optional bool aggressive = 4;
3345}
3346
3347/**
3348 * Logs when an app is optimized after being downgraded.
3349 * Logged from:
3350 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3351 */
3352message AppOptimizedAfterDowngraded {
3353 optional string package_name = 1;
3354}
3355
3356/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003357 * Logs whenever an app is installed on external storage.
3358 * Logged from:
3359 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3360 */
3361message AppInstallOnExternalStorageReported {
3362 // The type of external storage.
3363 optional android.stats.storage.ExternalStorageType storage_type = 1;
3364 // The name of the package that is installed on the sd card.
3365 optional string package_name = 2;
3366}
3367
3368/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003369 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003370 * Logged from:
3371 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3372 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003373message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003374 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003375
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003376 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003377
3378 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003379 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003380 optional string process_name = 3;
3381
3382 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003383 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003384
3385 optional string package_name = 5;
3386
3387 enum InstantApp {
3388 UNAVAILABLE = 0;
3389 FALSE = 1;
3390 TRUE = 2;
3391 }
3392 optional InstantApp is_instant_app = 6;
3393
3394 enum ForegroundState {
3395 UNKNOWN = 0;
3396 BACKGROUND = 1;
3397 FOREGROUND = 2;
3398 }
3399 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003400
3401 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003402}
David Chen9e3808c2017-11-20 17:25:34 -08003403
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003404/**
3405 * Logs when a WTF (What a Terrible Failure) happened.
3406 * Logged from:
3407 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3408 */
3409message WTFOccurred {
3410 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003411
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003412 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003413
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003414 // The name of the process.
3415 // system_server if it is not by an app
3416 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003417
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003418 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003419 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003420
3421 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003422}
3423
3424/**
3425 * Logs when system server reports low memory.
3426 * Logged from:
3427 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3428 */
3429message LowMemReported {
3430}
3431
3432/**
3433 * Logs when an app ANR (App Not Responding) occurs.
3434 * Logged from:
3435 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3436 */
3437message ANROccurred {
3438 optional int32 uid = 1 [(is_uid) = true];
3439
3440 optional string process_name = 2;
3441
3442 optional string short_component_name = 3;
3443
3444 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003445
3446 enum InstantApp {
3447 UNAVAILABLE = 0;
3448 FALSE = 1;
3449 TRUE = 2;
3450 }
3451 optional InstantApp is_instant_app = 5;
3452
3453 enum ForegroundState {
3454 UNKNOWN = 0;
3455 BACKGROUND = 1;
3456 FOREGROUND = 2;
3457 }
3458 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003459
3460 optional android.server.ErrorSource error_source = 7;
3461
3462 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003463}
3464
Bookatza7020bd2018-08-28 16:29:35 -07003465/**
3466 * Logs when the vibrator state changes.
3467 * Logged from:
3468 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3469 */
3470message VibratorStateChanged {
3471 repeated AttributionNode attribution_node = 1;
3472
3473 enum State {
3474 OFF = 0;
3475 ON = 1;
3476 }
3477 optional State state = 2;
3478
3479 // Duration (in milliseconds) requested to keep the vibrator on.
3480 // Only applicable for State == ON.
3481 optional int64 duration_millis = 3;
3482}
3483
David Chen0a368b22017-12-06 16:28:16 -08003484/*
3485 * Allows other apps to push events into statsd.
3486 * Logged from:
3487 * frameworks/base/core/java/android/util/StatsLog.java
3488 */
David Chen0b5c90c2018-01-25 16:51:49 -08003489message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003490 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003491 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003492
3493 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3494 optional int32 label = 2;
3495
3496 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3497 // predicates for the metrics).
3498 enum State {
3499 UNKNOWN = 0;
3500 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3501 STOP = 2;
3502 START = 3;
3503 }
3504 optional State state = 3;
3505}
3506
David Chen9e3808c2017-11-20 17:25:34 -08003507/**
Bookatz7948c872018-09-04 12:58:33 -07003508 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3509 * For example, this could be due to the user manually changing the time.
3510 *
3511 * Logged from:
3512 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3513 */
3514message WallClockTimeShifted {
3515 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3516 optional int64 wall_clock_timestamp_millis = 1;
3517}
3518
3519/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003520 * Logs when statsd detects an anomaly.
3521 *
3522 * Logged from:
3523 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3524 */
3525message AnomalyDetected {
3526 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003527 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003528
Yangster-mac94e197c2018-01-02 16:03:03 -08003529 // Id of the config whose anomaly detection alert fired.
3530 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003531
Yangster-mac94e197c2018-01-02 16:03:03 -08003532 // Id of the alert (i.e. name of the anomaly that was detected).
3533 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003534}
3535
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003536message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003537 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003538 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003539
3540 // The app package name.
3541 optional string pkg_name = 2;
3542
3543 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003544 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003545 WARM = 1;
3546 HOT = 2;
3547 COLD = 3;
3548 }
3549 // The transition type.
3550 optional TransitionType type = 3;
3551
3552 // The activity name.
3553 optional string activity_name = 4;
3554
3555 // The name of the calling app. Empty if not set.
3556 optional string calling_pkg_name = 5;
3557
3558 // Whether the app is an instant app.
3559 optional bool is_instant_app = 6;
3560
3561 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003562 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003563
Bookatz80d11a02018-01-16 10:46:35 -08003564 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003565
David Chen0b5c90c2018-01-25 16:51:49 -08003566 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003568 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003569 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003570 optional int32 bind_application_delay_millis = 11;
3571 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003572
3573 // Empty if not set.
3574 optional string launch_token = 13;
3575
Calin Juravle759fbda2018-02-20 19:52:30 +00003576 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003577 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003578
3579 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003580 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003581}
3582
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003583message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003585 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003586
3587 // The app package name.
3588 optional string pkg_name = 2;
3589
3590 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003591 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003592 WARM = 1;
3593 HOT = 2;
3594 COLD = 3;
3595 }
3596 // The transition type.
3597 optional TransitionType type = 3;
3598
3599 // The activity name.
3600 optional string activity_name = 4;
3601}
3602
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003603message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003604 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003605 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003606
3607 // The app package name.
3608 optional string pkg_name = 2;
3609
3610 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003611 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003612 WITH_BUNDLE = 1;
3613 WITHOUT_BUNDLE = 2;
3614 }
3615 // The transition type.
3616 optional TransitionType type = 3;
3617
3618 // The activity name.
3619 optional string activity_name = 4;
3620
3621 optional bool transition_process_running = 5;
3622
3623 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003624 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003625}
3626
Bookatz8fcd09a2017-12-18 13:01:10 -08003627/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003628 * Logs a picture-in-picture action
3629 * Logged from:
3630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3631 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3632 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3633 */
3634message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003635 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003636 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003637
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003638 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003639
Chenjie Yu52cacc62017-12-08 18:11:45 -08003640 enum State {
3641 ENTERED = 1;
3642 EXPANDED_TO_FULL_SCREEN = 2;
3643 MINIMIZED = 3;
3644 DISMISSED = 4;
3645 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003646 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003647}
3648
3649/**
Chenjie Yue8904192017-12-08 19:12:57 -08003650 * Logs overlay action
3651 * Logged from:
3652 * services/core/java/com/android/server/wm/Session.java
3653 */
3654message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003655 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003656
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003657 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003658
3659 optional bool using_alert_window = 3;
3660
3661 enum State {
3662 ENTERED = 1;
3663 EXITED = 2;
3664 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003665 optional State state = 4
3666 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003667}
3668
Adam Bookatz38767932020-02-05 12:13:40 -08003669/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003670 * Logs foreground service starts and stops.
3671 * Note that this is not when a service starts or stops, but when it is
3672 * considered foreground.
3673 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003674 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003675 */
3676message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003677 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003678 // package_name + "/" + class_name
3679 optional string short_name = 2;
3680
3681 enum State {
3682 ENTER = 1;
3683 EXIT = 2;
3684 }
3685 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003686
3687 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3688 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3689 optional bool allow_while_in_use_permission = 4;
3690}
3691
3692/**
3693 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3694 * A foreground service session is any continuous period during which the uid holds at least one
3695 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3696 * Accesses initiated while the uid is in the TOP state are ignored.
3697 * Sessions with no attempted accesses are not logged.
3698 * Logged from
3699 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3700 */
3701message ForegroundServiceAppOpSessionEnded {
3702 optional int32 uid = 1 [(is_uid) = true];
3703
3704 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003705 // Only following four ops are logged
3706 // COARSE_LOCATION = 0
3707 // FINE_LOCATION = 1
3708 // CAMERA = 26
3709 // RECORD_AUDIO = 27
3710 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003711
3712 // The uid's permission mode for accessing the AppOp during this fgs session.
3713 enum Mode {
3714 MODE_UNKNOWN = 0;
3715 MODE_ALLOWED = 1; // Always allowed
3716 MODE_IGNORED = 2; // Denied
3717 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3718 }
3719 optional Mode app_op_mode = 3;
3720
3721 // Number of times this AppOp was requested and allowed.
3722 optional int32 count_ops_accepted = 4;
3723 // Number of times this AppOp was requested but denied.
3724 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003725}
3726
Chenjie Yue8904192017-12-08 19:12:57 -08003727/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003728 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3729 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3730 * attributed back to the parent (host) uid. One example is Chrome.
3731 *
3732 * Logged from:
3733 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3734 */
3735message IsolatedUidChanged {
3736 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003737 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003738 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003739 optional int32 parent_uid = 1;
3740
3741 optional int32 isolated_uid = 2;
3742
3743 // We expect an isolated uid to be removed before if it's used for another parent uid.
3744 enum Event {
3745 REMOVED = 0;
3746 CREATED = 1;
3747 }
3748 optional Event event = 3;
3749}
3750
3751/*
3752 * Logs the reception of an incoming network packet causing the main system to wake up for
3753 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3754 * and processed by WakeupController.cpp.
3755 */
3756message PacketWakeupOccurred {
3757 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3758 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003759 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003760 // The interface name on which the packet was received.
3761 optional string iface = 2;
3762 // The ethertype value of the packet.
3763 optional int32 ethertype = 3;
3764 // String representation of the destination MAC address of the packet.
3765 optional string destination_hardware_address = 4;
3766 // String representation of the source address of the packet if this was an IP packet.
3767 optional string source_ip = 5;
3768 // String representation of the destination address of the packet if this was an IP packet.
3769 optional string destination_ip = 6;
3770 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3771 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3772 // families.
3773 optional int32 ip_next_header = 7;
3774 // The source port if this was a TCP or UDP packet.
3775 optional int32 source_port = 8;
3776 // The destination port if this was a TCP or UDP packet.
3777 optional int32 destination_port = 9;
3778}
3779
3780/*
3781 * Logs the memory stats for an app on startup.
3782 * Logged from:
3783 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3784 */
3785message AppStartMemoryStateCaptured {
3786 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003787 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003788
3789 // The process name.
3790 optional string process_name = 2;
3791
3792 // The activity name.
3793 optional string activity_name = 3;
3794
3795 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003796 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003797
3798 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003799 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003800
3801 // RSS
3802 optional int64 rss_in_bytes = 6;
3803
3804 // CACHE
3805 optional int64 cache_in_bytes = 7;
3806
3807 // SWAP
3808 optional int64 swap_in_bytes = 8;
3809}
3810
3811/*
3812 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3813 * for LMK event.
3814 * Logged from:
3815 * system/core/lmkd/lmkd.c
3816 */
3817message LmkStateChanged {
3818 enum State {
3819 UNKNOWN = 0;
3820 START = 1;
3821 STOP = 2;
3822 }
3823 optional State state = 1;
3824}
3825
3826/*
3827 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3828 * Logged from:
3829 * system/core/lmkd/lmkd.c
3830 */
3831message LmkKillOccurred {
3832 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003833 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003834
3835 // The process name.
3836 optional string process_name = 2;
3837
3838 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003839 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003840
3841 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003842 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003843
3844 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003845 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003846
3847 // RSS
3848 optional int64 rss_in_bytes = 6;
3849
3850 // CACHE
3851 optional int64 cache_in_bytes = 7;
3852
3853 // SWAP
3854 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003855
3856 // The elapsed real time of start of the process.
3857 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003858
3859 // Min oom adj score considered by lmkd.
3860 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003861}
3862
Rajeev Kumar51b54602018-03-01 12:18:26 -08003863/*
3864 * Logs when the ActivityManagerService detects that an app died.
3865 *
3866 * Logged from:
3867 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3868 */
3869message AppDied {
3870 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003871 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003872}
3873
Howard Ro21a039c2018-08-06 14:55:47 -07003874/**
3875 * An atom for generic metrics logging. Available from Android Q.
3876 */
3877message GenericAtom {
3878 // The uid of the application that sent this custom atom.
3879 optional int32 uid = 1 [(is_uid) = true];
3880
3881 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003882 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003883}
3884
Tej Singhd6d6d772018-09-05 17:41:25 -07003885/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003886 * Atom for simple logging of user interaction and impression events, such as "the user touched
3887 * this button" or "this dialog was displayed".
3888 * Keep the UI event stream clean: don't use for system or background events.
3889 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003890 *
3891 * Logged from:
3892 * frameworks/base/services/core/java/com/android/server/
3893 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003894 */
3895message UiEventReported {
3896 // The event_id.
3897 optional int32 event_id = 1;
3898 // The event's source or target uid and package, if applicable.
3899 // For example, the package posting a notification, or the destination package of a share.
3900 optional int32 uid = 2 [(is_uid) = true];
3901 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003902 // An identifier used to disambiguate which logs refer to a particular instance of some
3903 // UI element. Useful when there might be multiple instances simultaneously active.
3904 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003905}
3906
3907/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003908 * Reports a notification was created or updated.
3909 *
3910 * Logged from:
3911 * frameworks/base/services/core/java/com/android/server/notification/
3912 */
3913message NotificationReported {
3914 // The event_id (as for UiEventReported).
3915 optional int32 event_id = 1;
3916 // The notifying app's uid and package.
3917 optional int32 uid = 2 [(is_uid) = true];
3918 optional string package_name = 3;
3919 // A small system-assigned identifier for the notification.
3920 // Locally probably-unique, but expect collisions across users and/or days.
3921 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003922 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3923 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003924
3925 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003926 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3927 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3928 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003929
3930 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003931 optional string category = 10; // App-assigned notification category (API-defined strings)
3932 optional int32 style = 11; // App-assigned notification style
3933 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003934
3935 // Ordering, importance and interruptiveness
3936
Will Brockman7614f6962020-02-10 19:43:03 -05003937 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003938
Will Brockman7614f6962020-02-10 19:43:03 -05003939 optional android.stats.sysui.NotificationImportance importance = 14;
3940 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003941
3942 enum NotificationImportanceExplanation {
3943 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3944 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3945 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3946 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3947 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3948 // Like _APP, but based on pre-channels priority signal.
3949 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3950 }
3951
Will Brockman7614f6962020-02-10 19:43:03 -05003952 optional NotificationImportanceExplanation importance_source = 16;
3953 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3954 optional NotificationImportanceExplanation importance_initial_source = 18;
3955 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3956 optional int32 assistant_hash = 20;
3957 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003958}
3959
3960message Notification {
3961 // The notifying app's uid and package.
3962 optional int32 uid = 1 [(is_uid) = true];
3963 optional string package_name = 2;
3964 // A small system-assigned identifier for the notification.
3965 optional int32 instance_id = 3;
3966
3967 // Grouping information.
3968 optional int32 group_instance_id = 4;
3969 optional bool is_group_summary = 5;
3970
3971 // The section of the shade that the notification is in.
3972 // See NotificationSectionsManager.PriorityBucket.
3973 enum NotificationSection {
3974 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003975 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003976 SECTION_MEDIA_CONTROLS = 2;
3977 SECTION_PEOPLE = 3;
3978 SECTION_ALERTING = 4;
3979 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003980 }
3981 optional NotificationSection section = 6;
3982}
3983
3984message NotificationList {
3985 repeated Notification notifications = 1; // An ordered sequence of notifications.
3986}
3987
3988/**
3989 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3990 *
3991 * Logged from:
3992 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3993 */
3994message NotificationPanelReported {
3995 // The event_id (as for UiEventReported).
3996 optional int32 event_id = 1;
3997 optional int32 num_notifications = 2;
3998 // The notifications in the panel, in the order that they appear there.
3999 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4000}
4001
4002/**
4003 * Reports a notification channel, or channel group, was created, updated, or deleted.
4004 *
4005 * Logged from:
4006 * frameworks/base/services/core/java/com/android/server/notification/
4007 */
4008message NotificationChannelModified {
4009 // The event_id (as for UiEventReported).
4010 optional int32 event_id = 1;
4011 // The notifying app's uid and package.
4012 optional int32 uid = 2 [(is_uid) = true];
4013 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004014 // Hash of app-assigned notification channel ID or channel-group ID
4015 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004016 // Previous importance setting, if applicable
4017 optional android.stats.sysui.NotificationImportance old_importance = 5;
4018 // New importance setting
4019 optional android.stats.sysui.NotificationImportance importance = 6;
4020}
4021
4022
4023/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004024 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004025 *
4026 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004027 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004028 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004029message BiometricAcquired {
4030 // Biometric modality that was acquired.
4031 optional android.hardware.biometrics.ModalityEnum modality = 1;
4032 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4033 optional int32 user = 2;
4034 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4035 optional bool is_crypto = 3;
4036 // Action that the device is performing. Acquired messages are only expected for enroll and
4037 // authenticate. Other actions may indicate an error.
4038 optional android.hardware.biometrics.ActionEnum action = 4;
4039 // The client that this acquisition was received for.
4040 optional android.hardware.biometrics.ClientEnum client = 5;
4041 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4042 optional int32 acquire_info = 6;
4043 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4044 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004045 // Dictates if this message should trigger additional debugging.
4046 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004047}
4048
4049/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004050 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004051 *
4052 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004053 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004054 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004055message BiometricAuthenticated {
4056 // Biometric modality that was used.
4057 optional android.hardware.biometrics.ModalityEnum modality = 1;
4058 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4059 optional int32 user = 2;
4060 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4061 // storage.
4062 optional bool is_crypto = 3;
4063 // The client that this acquisition was received for.
4064 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004065 // If authentication requires user confirmation. See BiometricPrompt's
4066 // setRequireConfirmation(bool) method.
4067 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004068
Kevin Chyn1741a072019-01-17 11:54:40 -08004069 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004070 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004071 REJECTED = 1;
4072 PENDING_CONFIRMATION = 2;
4073 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004074 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004075
4076 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004077 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004078 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4079 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4080 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4081 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004082 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004083 // Dictates if this message should trigger additional debugging.
4084 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004085}
4086
4087/**
4088 * Logs when a biometric error occurs.
4089 *
4090 * Logged from:
4091 * frameworks/base/services/core/java/com/android/server/biometrics
4092 */
4093message BiometricErrorOccurred {
4094 // Biometric modality that was used.
4095 optional android.hardware.biometrics.ModalityEnum modality = 1;
4096 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4097 optional int32 user = 2;
4098 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4099 optional bool is_crypto = 3;
4100 // Action that the device is performing.
4101 optional android.hardware.biometrics.ActionEnum action = 4;
4102 // The client that this acquisition was received for.
4103 optional android.hardware.biometrics.ClientEnum client = 5;
4104 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4105 // are unique to modality.
4106 optional int32 error_info = 6;
4107 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4108 // by the vendor and not specified by the HIDL interface.
4109 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004110 // Dictates if this message should trigger additional debugging.
4111 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004112 // Time spent during the authentication attempt.
4113 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004114}
4115
4116/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004117 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004118 * Logged from:
4119 * frameworks/base/services/core/java/com/android/server/biometrics
4120 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004121message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004122 // Biometric modality.
4123 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004124 // Type of issue detected.
4125 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004126 // Dictates if this message should trigger additional debugging.
4127 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004128}
Howard Ro688ae182018-09-25 00:09:36 -07004129
joshmccloskey6f952b22019-03-25 20:59:35 -07004130/**
4131 * Logs when a biometric enrollment occurs.
4132 *
4133 * Logged from:
4134 * frameworks/base/services/core/java/com/android/server/biometrics
4135 */
4136message BiometricEnrolled {
4137 // Biometric modality that was used.
4138 optional android.hardware.biometrics.ModalityEnum modality = 1;
4139 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4140 optional int32 user = 2;
4141 // The amount of time the enrollment took in milliseconds.
4142 optional int64 latency_millis = 3;
4143 // Whether or not the enrollment was successful.
4144 optional bool success = 4;
4145}
4146
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004147/*
Tej Singh0d176952019-01-16 19:10:54 -08004148 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004149 */
Tej Singh0d176952019-01-16 19:10:54 -08004150message FlagFlipUpdateOccurred {
4151 // If the event is from a flag config package, specify the package name.
4152 optional string flag_flip_package_name = 1;
4153
4154 // The order id of the package
4155 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004156}
4157
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004158/**
4159 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004160 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004161 */
4162message TrainExperimentIds {
4163 repeated int64 experiment_id = 1;
4164}
4165
Yangster-macb89807e2018-11-15 21:10:57 -08004166/*
4167 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004168 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004169 */
4170message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004171 // Name of the train.
4172 optional string train_name = 1;
4173 // Version code for a "train" of packages that need to be installed atomically
4174 optional int64 train_version_code = 2;
4175 // After installation of this package, device requires a restart.
4176 optional bool requires_staging = 3;
4177 // Rollback should be enabled for this install.
4178 optional bool rollback_enabled = 4;
4179 // Requires low latency monitoring if possible.
4180 optional bool requires_low_latency_monitor = 5;
4181
Yangster-macb89807e2018-11-15 21:10:57 -08004182 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004183 UNKNOWN = 0;
4184 INSTALL_REQUESTED = 1;
4185 INSTALL_STARTED = 2;
4186 INSTALL_STAGED_NOT_READY = 3;
4187 INSTALL_STAGED_READY = 4;
4188 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004189 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4190 // and INSTALL_FAILURE_COMMIT.
4191 INSTALL_FAILURE = 6 [deprecated = true];
4192 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004193 INSTALL_CANCELLED = 7;
4194 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004195 INSTALLER_ROLLBACK_INITIATED = 9;
4196 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4197 INSTALLER_ROLLBACK_STAGED = 11;
4198 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4199 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4200 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4201 INSTALLER_ROLLBACK_SUCCESS = 15;
4202 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004203 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4204 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4205 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4206 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4207 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4208 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004209 INSTALL_FAILURE_DOWNLOAD = 23;
4210 INSTALL_FAILURE_STATE_MISMATCH = 24;
4211 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004212 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004213 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004214 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004215 // Possible experiment ids for monitoring this push.
4216 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4217 // user id
4218 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004219 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004220 // Whether or not this is a rollback event
4221 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004222}
4223
Tej Singhc9203082019-05-03 13:42:23 -07004224/* Test atom, is not logged anywhere */
4225message TestAtomReported {
4226 repeated AttributionNode attribution_node = 1;
4227 optional int32 int_field = 2;
4228 optional int64 long_field = 3;
4229 optional float float_field = 4;
4230 optional string string_field = 5;
4231 optional bool boolean_field = 6;
4232 enum State {
4233 UNKNOWN = 0;
4234 OFF = 1;
4235 ON = 2;
4236 }
4237 optional State state = 7;
4238 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4239}
4240
Maggie Whitefc1aa592018-11-28 21:55:23 -08004241/** Represents USB port overheat event. */
4242message UsbPortOverheatEvent {
4243 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4244 optional int32 plug_temperature_deci_c = 1;
4245
4246 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4247 optional int32 max_temperature_deci_c = 2;
4248
4249 /* Time between USB plug event and overheat threshold trip, in seconds. */
4250 optional int32 time_to_overheat_secs = 3;
4251
4252 /* Time between overheat threshold trip and hysteresis, in seconds. */
4253 optional int32 time_to_hysteresis_secs = 4;
4254
4255 /* Time between hysteresis and active mitigation ending, in seconds. */
4256 optional int32 time_to_inactive_secs = 5;
4257};
4258
Maggie White8735b852019-01-18 11:40:49 -08004259/**
4260 * Logs total effective full charge and discharge cycles on a battery.
4261 * Here are some examples of one effective cycle:
4262 * 1) the battery charges from 0% to 100% and drains back to 0%,
4263 * 2) charging from 50% to 100% and draining back to 50% twice.
4264 * Pulled from:
4265 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4266 */
4267message BatteryCycleCount {
4268 /* Number of total charge and discharge cycles on the system battery. */
4269 optional int32 cycle_count = 1;
4270}
4271
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004272/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004273 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4274 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004275 * Pulled from:
4276 * StatsCompanionService
4277 */
4278
Carmen Agimof12dec122019-03-06 16:14:38 +00004279message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004280
Carmen Agimof12dec122019-03-06 16:14:38 +00004281 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004282 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004283 PUBLIC = 1;
4284 PRIVATE = 2;
4285 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004286 }
4287
Carmen Agimof12dec122019-03-06 16:14:38 +00004288 // The type of external storage.
4289 optional android.stats.storage.ExternalStorageType storage_type = 1;
4290 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4291 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004292 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004293 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004294}
4295
Yangster-macb89807e2018-11-15 21:10:57 -08004296/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004297 * Logs when a connection becomes available and lost.
4298 * Logged in StatsCompanionService.java
4299 */
4300message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004301 // Id of the network.
4302 optional int32 net_id = 1;
4303
4304 enum State {
4305 UNKNOWN = 0;
4306 CONNECTED = 1;
4307 DISCONNECTED = 2;
4308 }
4309 // Connected state of a network.
4310 optional State state = 2;
4311}
4312
4313/**
4314 * Logs when a service starts and stops.
4315 * Logged from:
4316 * services/core/java/com/android/server/am/ActiveServices.java
4317 */
4318message ServiceStateChanged {
4319
4320 optional int32 uid = 1 [(is_uid) = true];
4321
4322 optional string package_name = 2;
4323
4324 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004325
4326 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004327 START = 1;
4328 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004329 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004330
4331 optional State state = 4;
4332}
4333
4334/**
4335 * Logs when a service is launched.
4336 * Logged from:
4337 * services/core/java/com/android/server/am/ActiveServices.java
4338 */
4339message ServiceLaunchReported {
4340
4341 optional int32 uid = 1 [(is_uid) = true];
4342
4343 optional string package_name = 2;
4344
4345 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004346}
Howard Ro688ae182018-09-25 00:09:36 -07004347
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004348/**
4349 * Logs when a hidden API is used.
4350 *
4351 * Logged from:
4352 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4353 */
4354message HiddenApiUsed {
4355 // The uid of the app making the hidden access.
4356 optional int32 uid = 1 [(is_uid) = true];
4357
4358 // Signature of the method or field accessed.
4359 optional string signature = 2;
4360
4361 enum AccessMethod {
4362 NONE = 0;
4363 REFLECTION = 1;
4364 JNI = 2;
4365 LINKING = 3;
4366 }
4367
4368 // Type of access.
4369 optional AccessMethod access_method = 3;
4370
4371 // Whether the access was prevented or not.
4372 optional bool access_denied = 4;
4373}
4374
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004375/**
4376 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4377 * - When user sees privacy chip
4378 * - When user clicks privacy chip
4379 * - How does the user exit the Privacy Dialog
4380 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004381 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4382 */
4383message PrivacyIndicatorsInteracted {
4384
4385 enum Type {
4386 UNKNOWN = 0;
4387 CHIP_VIEWED = 1;
4388 CHIP_CLICKED = 2;
4389 DIALOG_PRIVACY_SETTINGS = 3;
4390 DIALOG_DISMISS = 4;
4391 DIALOG_LINE_ITEM = 5;
4392 }
4393
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004394 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004395
4396 // Used if the type is LINE_ITEM
4397 optional string package_name = 2;
4398}
4399
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004400/**
4401 * Logs information about a package that is moved from the internal to external storage and vice
4402 * versa.
4403 * It logs the package name, the type of the external storage where the package is installed
4404 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4405 * and the move type: if it's from internal to external or the other way around.
4406 *
4407 * Logged from:
4408 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4409 */
4410message AppMovedStorageReported {
4411 enum MoveType {
4412 UNKNOWN = 0;
4413 TO_EXTERNAL = 1;
4414 TO_INTERNAL = 2;
4415 }
4416 // The type of the external storage.
4417 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4418 // The type of move.
4419 optional MoveType move_type = 2;
4420 // The name of the package that was moved.
4421 optional string package_name = 3;
4422}
4423
jianjin8f2dee02019-03-29 14:03:08 -07004424/**
4425 * Logs when system server watchdog occurs.
4426 * Logged from:
4427 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4428 */
4429message SystemServerWatchdogOccurred {
4430 optional string subject = 1;
4431}
4432
4433/**
4434 * Logs when new file added to tombstones.
4435 * Logged from:
4436 * frameworks/base/core/java/com/android/server/BootReceiver.java
4437 */
4438message TombStoneOccurred {
4439}
4440
Hai Zhang5d3328d2019-04-13 21:25:06 +08004441/*
4442 * Information about a role request
4443 *
4444 * Logged from:
4445 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4446 */
4447message RoleRequestResultReported {
4448 // UID of application requesting the role
4449 optional int32 requesting_uid = 1;
4450
4451 // Package name of application requesting the role
4452 optional string requesting_package_name = 2;
4453
4454 // The role to be granted
4455 optional string role_name = 3;
4456
4457 // The count of applications qualifying for the role
4458 optional int32 qualifying_count = 4;
4459
4460 // UID of application current granted the role
4461 optional int32 current_uid = 5;
4462
4463 // Package name of application current granted the role
4464 optional string current_package_name = 6;
4465
4466 // UID of another application that user chose to grant the role to, instead of the requesting
4467 // application
4468 optional int32 granted_another_uid = 7;
4469
4470 // Package name of another application that user chose to grant the role to, instead of the
4471 // requesting application
4472 optional string granted_another_package_name = 8;
4473
4474 enum Result {
4475 UNDEFINED = 0;
4476 // role request was ignored
4477 IGNORED = 1;
4478 // role request was ignored because it's already granted
4479 IGNORED_ALREADY_GRANTED = 2;
4480 // role request was ignored because the application isn't qualified
4481 IGNORED_NOT_QUALIFIED = 3;
4482 // role request was ignored because user said it should be always denied
4483 IGNORED_USER_ALWAYS_DENIED = 4;
4484 // role was granted by user action
4485 USER_GRANTED = 5;
4486 // role was denied by user action
4487 USER_DENIED = 6;
4488 // role was denied by user granting another application the role
4489 USER_DENIED_GRANTED_ANOTHER = 7;
4490 // role was denied and set to be always denied by the user
4491 USER_DENIED_WITH_ALWAYS = 8;
4492 }
4493 // The result of the role request
4494 optional Result result = 9;
4495}
4496
Mark Tabrya824a642019-11-05 12:26:12 -08004497/**
4498 * Logs when a Vehicle Maps Service client's connection state has changed
4499 *
4500 * Logged from:
4501 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4502 */
4503message VmsClientConnectionStateChanged {
4504 // The UID of the VMS client app
4505 optional int32 uid = 1 [(is_uid) = true];
4506
4507 enum State {
4508 UNKNOWN = 0;
4509 // Attempting to connect to the client
4510 CONNECTING = 1;
4511 // Client connection established
4512 CONNECTED = 2;
4513 // Client connection closed unexpectedly
4514 DISCONNECTED = 3;
4515 // Client connection closed by VMS
4516 TERMINATED = 4;
4517 // Error establishing the client connection
4518 CONNECTION_ERROR = 5;
4519 }
4520
4521 optional State state = 2;
4522}
4523
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004524/**
4525 * Logs when MediaProvider has successfully finished scanning a storage volume.
4526 *
4527 * Logged from:
4528 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4529 */
shafik43825842020-04-02 17:30:24 +01004530message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004531 enum Reason {
4532 // Scan triggered due to unknown reason
4533 UNKNOWN = 0;
4534 // Scan triggered due to storage volume being mounted
4535 MOUNTED = 1;
4536 // Scan triggered due to explicit user action or app request
4537 DEMAND = 2;
4538 // Scan triggered due to idle maintenance
4539 IDLE = 3;
4540 }
4541
4542 // Volume type that this event pertains to
4543 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4544 // Reason why this scan was triggered
4545 optional Reason reason = 2;
4546 // Total number of files scanned
4547 optional int64 item_count = 3;
4548 // Duration of scan, normalized per file
4549 optional float normalized_duration_millis = 4;
4550 // Number of database inserts, normalized per file
4551 optional float normalized_insert_count = 5;
4552 // Number of database updates, normalized per file
4553 optional float normalized_update_count = 6;
4554 // Number of database deletes, normalized per file
4555 optional float normalized_delete_count = 7;
4556}
4557
4558/**
4559 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4560 *
4561 * Logged from:
4562 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4563 */
shafik43825842020-04-02 17:30:24 +01004564message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004565 // Volume type that this event pertains to
4566 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004567 // UID of app that requested deletion
4568 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004569 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004570 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004571}
4572
4573/**
4574 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4575 *
4576 * Logged from:
4577 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4578 */
shafik43825842020-04-02 17:30:24 +01004579message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004580 enum Result {
4581 UNKNOWN = 0;
4582 USER_GRANTED = 1;
4583 AUTO_GRANTED = 2;
4584 USER_DENIED = 3;
4585 USER_DENIED_WITH_PREJUDICE = 4;
4586 AUTO_DENIED = 5;
4587 }
4588
4589 // Volume type that this event pertains to
4590 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004591 // UID of app that requested permission
4592 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004593 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004594 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004595 // Result of this request
shafik43825842020-04-02 17:30:24 +01004596 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004597}
4598
4599/**
4600 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4601 *
4602 * Logged from:
4603 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4604 */
shafik43825842020-04-02 17:30:24 +01004605message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004606 // Volume type that this event pertains to
4607 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4608 // Old database version code
4609 optional int32 version_from = 2;
4610 // New database version code
4611 optional int32 version_to = 3;
4612 // Total number of files in database
4613 optional int64 item_count = 4;
4614 // Duration of schema change, normalized per file
4615 optional float normalized_duration_millis = 5;
4616}
4617
4618/**
4619 * Logs when MediaProvider has finished an idle maintenance job.
4620 *
4621 * Logged from:
4622 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4623 */
shafik43825842020-04-02 17:30:24 +01004624message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004625 // Volume type that this event pertains to
4626 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4627
4628 // Total number of files in database
4629 optional int64 item_count = 2;
4630 // Duration of idle maintenance, normalized per file
4631 optional float normalized_duration_millis = 3;
4632 // Number of thumbnails found to be stale, normalized per file
4633 optional float normalized_stale_thumbnails = 4;
4634 // Number of items found to be expired, normalized per file
4635 optional float normalized_expired_media = 5;
4636}
4637
Keun young Park3e033cb2019-12-18 11:27:35 -08004638/**
4639 * Represents boot time event with duration in ms.
4640 *
4641 * Logged from: bootstat and various system server components. Check each enums for details.
4642 */
4643message BootTimeEventDuration {
4644 enum DurationEvent {
4645 UNKNOWN = 0;
4646 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4647 ABSOLUTE_BOOT_TIME = 1;
4648 // Bootloader's 1st stage execution time.
4649 // Logged from bootstat.
4650 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4651 // Bootloader's 1st stage loading time.
4652 // Logged from bootstat.
4653 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4654 // Bootloader's kernel loading time.
4655 // Logged from bootstat.
4656 BOOTLOADER_KERNEL_LOAD = 4;
4657 // Bootloader's 2nd stage execution time.
4658 // Logged from bootstat.
4659 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4660 // Bootloader's 2nd stage loading time.
4661 // Logged from bootstat.
4662 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4663 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4664 // for locked device.
4665 // Logged from bootstat.
4666 BOOTLOADER_UI_WAIT = 7;
4667 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4668 // Logged from bootstat.
4669 BOOTLOADER_TOTAL = 8;
4670 // Shutdown duration inside init for the reboot before the current boot up.
4671 // Logged from f/b/services/.../BootReceiver.java.
4672 SHUTDOWN_DURATION = 9;
4673 // Total time for mounting of disk devices during bootup.
4674 // Logged from f/b/services/.../BootReceiver.java.
4675 MOUNT_DEFAULT_DURATION = 10;
4676 // Total time for early stage mounting of disk devices during bootup.
4677 // Logged from f/b/services/.../BootReceiver.java.
4678 MOUNT_EARLY_DURATION = 11;
4679 // Total time for late stage mounting of disk devices during bootup.
4680 // Logged from f/b/services/.../BootReceiver.java.
4681 MOUNT_LATE_DURATION = 12;
4682 // Average time to scan non-system app after OTA
4683 // Logged from f/b/services/.../PackageManagerService.java
4684 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4685 // Time to initialize Package manager after OTA
4686 // Logged from f/b/services/.../PackageManagerService.java
4687 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4688 // Time to scan all system app from Package manager after OTA
4689 // Logged from f/b/services/.../PackageManagerService.java
4690 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4691 // Init's total time for cold boot stage.
4692 // Logged from bootstat.
4693 COLDBOOT_WAIT = 16;
4694 // Init's total time for initializing selinux.
4695 // Logged from bootstat.
4696 SELINUX_INIT = 17;
4697 // Time since last factory reset.
4698 // Logged from bootstat.
4699 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004700 // Init's total time spent for completing the 1st stage.
4701 // Logged from bootstat.
4702 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004703 }
4704
4705 // Type of the event.
4706 optional DurationEvent event = 1;
4707 // Duration of the event in ms.
4708 optional int64 duration_millis = 2;
4709}
4710
4711/**
4712 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4713 * since boot-up.
4714 *
4715 * Logged from: bootstat and various system server components. Check each enums for details.
4716 */
4717message BootTimeEventElapsedTime {
4718 enum ElapsedTimeEvent {
4719 UNKNOWN = 0;
4720 // Time when init starts 1st stage. Logged from bootstat.
4721 ANDROID_INIT_STAGE_1 = 1;
4722 // Time when sys.boot_completed prop is set.
4723 // Logged from bootstat.
4724 BOOT_COMPLETE = 2;
4725 // BOOT_COMPLETE for encrypted device.
4726 BOOT_COMPLETE_ENCRYPTION = 3;
4727 // BOOT_COMPLETE for device with no encryption.
4728 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4729 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004730 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004731 // BOOT_COMPLETE after factory reset.
4732 FACTORY_RESET_BOOT_COMPLETE = 6;
4733 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4734 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004735 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4736 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004737 // BOOT_COMPLETE after OTA.
4738 OTA_BOOT_COMPLETE = 9;
4739 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4740 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004741 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4742 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004743 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4744 // Logged from f/b/services/.../UserController.java
4745 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4746 // Time when the system starts sending BOOT_COMPLETED broadcast.
4747 // Logged from f/b/services/.../UserController.java
4748 FRAMEWORK_BOOT_COMPLETED = 13;
4749 // Time when the package manager starts init.
4750 // Logged from f/b/services/.../SystemServer.java
4751 PACKAGE_MANAGER_INIT_START = 14;
4752 // Time when package manager is ready
4753 // Logged from f/b/services/.../SystemServer.java
4754 PACKAGE_MANAGER_INIT_READY = 15;
4755 // Represents the time when user has entered unlock credential for system with user pin.
4756 // Logged from bootstat.
4757 POST_DECRYPT = 16;
4758 // Represents the start of zygote's init.
4759 // Logged from zygote itself.
4760 ZYGOTE_INIT_START = 17;
4761 // Represents the start of secondary zygote's init.
4762 // TODO: add logging to zygote
4763 SECONDARY_ZYGOTE_INIT_START = 18;
4764 // Represents the start of system server's init.
4765 // Logged from f/b/services/.../SystemServer.java
4766 SYSTEM_SERVER_INIT_START = 19;
4767 // Represents the completion of system server's init.
4768 // Logged from f/b/services/.../SystemServer.java
4769 SYSTEM_SERVER_READY = 20;
4770 // Represents the start of launcher during boot-up.
4771 // TODO: add logging
4772 LAUNCHER_START = 21;
4773 // Represents the completion of launcher's initial rendering. User can use other apps from
4774 // launcher from this point.
4775 // TODO: add logging
4776 LAUNCHER_SHOWN = 22;
4777 }
4778
4779 // Type of the event.
4780 optional ElapsedTimeEvent event = 1;
4781 // Time since bootup for the event.
4782 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4783 optional int64 time_millis = 2;
4784}
4785
4786/**
4787 * Boot time events with UTC time.
4788 *
4789 * Logged from: bootstat and various system server components. Check each enums for details.
4790 */
4791message BootTimeEventUtcTime {
4792 enum UtcTimeEvent {
4793 UNKNOWN = 0;
4794 // Time of the bootstat's marking of 1st boot after the last factory reset.
4795 // Logged from bootstat.
4796 FACTORY_RESET_RESET_TIME = 1;
4797 // The time when bootstat records FACTORY_RESET_* events. This is close to
4798 // BOOT_COMPLETE time for the current bootup.
4799 // Logged from bootstat.
4800 FACTORY_RESET_CURRENT_TIME = 2;
4801 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4802 // Logged from bootstat.
4803 FACTORY_RESET_RECORD_VALUE = 3;
4804 }
4805
4806 // Type of the event.
4807 optional UtcTimeEvent event = 1;
4808 // UTC time for the event.
4809 optional int64 utc_time_secs = 2;
4810}
4811
4812/**
4813 * Boot time events representing specific error code during bootup.
4814 * Meaning of error code can be different per each event type.
4815 *
4816 * Logged from: bootstat and various system server components. Check each enums for details.
4817 */
4818message BootTimeEventErrorCode {
4819 enum ErrorCodeEvent {
4820 UNKNOWN = 0;
4821 // Linux error code for time() call to get the current UTC time.
4822 // Logged from bootstat.
4823 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4824 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4825 // as UMOUNT_STAT_* from init/reboot.cpp.
4826 // Logged from f/b/services/.../BootReceiver.java.
4827 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004828 // Reprepsents fie system mounting error code of /data partition for the current boot.
4829 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004830 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004831 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004832 }
4833
4834 // Type of the event.
4835 optional ErrorCodeEvent event = 1;
4836 // error code defined per each event type.
4837 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4838 // FS_MGR_FS_STAT.
4839 optional int32 error_code = 2;
4840}
4841
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004842/**
4843 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4844 * after an OTA.
4845 *
4846 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004847 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004848 */
4849message SnapshotMergeReported {
4850 // Keep in sync with
4851 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4852 enum UpdateState {
4853 // No update or merge is in progress.
4854 NONE = 0;
4855 // An update is applying; snapshots may already exist.
4856 INITIATED = 1;
4857 // An update is pending, but has not been successfully booted yet.
4858 UNVERIFIED = 2;
4859 // The kernel is merging in the background.
4860 MERGING = 3;
4861 // Post-merge cleanup steps could not be completed due to a transient
4862 // error, but the next reboot will finish any pending operations.
4863 MERGE_NEEDS_REBOOT = 4;
4864 // Merging is complete, and needs to be acknowledged.
4865 MERGE_COMPLETED = 5;
4866 // Merging failed due to an unrecoverable error.
4867 MERGE_FAILED = 6;
4868 // The update was implicitly cancelled, either by a rollback or a flash
4869 // operation via fastboot. This state can only be returned by WaitForMerge.
4870 CANCELLED = 7;
4871 };
4872
4873 // Status of the update after the merge attempts.
4874 optional UpdateState final_state = 1;
4875
4876 // Time to complete a merge operation in milliseconds.
4877 // A negative value corresponds to the case in which the merge operation
4878 // was interrupted and resumed (e.g. in case of a system reboot during the
4879 // merge).
4880 optional int64 duration_millis = 2;
4881
4882 // Number of reboots that occurred after issuing and before completing the
4883 // merge of all the snapshot devices.
4884 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004885
4886 // The device has been upgraded to Virtual A/B.
4887 optional bool is_vab_retrofit = 4;
4888
4889 // Space that has been temporarily allocated in the /data partition
4890 // containing the dm-snapshot's copy-on-write data generated during a
4891 // Virtual A/B update.
4892 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004893}
4894
Chenjie Yubbcbc602018-02-05 16:51:52 -08004895//////////////////////////////////////////////////////////////////////
4896// Pulled atoms below this line //
4897//////////////////////////////////////////////////////////////////////
4898
4899/**
David Chenc8a43242017-10-17 16:23:28 -07004900 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4901 *
4902 * Pulled from:
4903 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4904 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004905message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004906 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004907
4908 optional int64 rx_bytes = 2;
4909
4910 optional int64 rx_packets = 3;
4911
4912 optional int64 tx_bytes = 4;
4913
4914 optional int64 tx_packets = 5;
4915}
4916
4917/**
4918 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4919 *
4920 * Pulled from:
4921 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4922 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004923message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004924 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004925
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004926 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4927 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004928
4929 optional int64 rx_bytes = 3;
4930
4931 optional int64 rx_packets = 4;
4932
4933 optional int64 tx_bytes = 5;
4934
4935 optional int64 tx_packets = 6;
4936}
4937
4938/**
4939 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4940 *
4941 * Pulled from:
4942 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4943 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004944message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004945 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004946
4947 optional int64 rx_bytes = 2;
4948
4949 optional int64 rx_packets = 3;
4950
4951 optional int64 tx_bytes = 4;
4952
4953 optional int64 tx_packets = 5;
4954}
4955
4956/**
4957 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4958 *
4959 * Pulled from:
4960 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4961 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004962message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004963 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004964
Yao Chenc40a19d2018-03-15 16:48:25 -07004965 // 1 denotes foreground and 0 denotes background. This is called Set in
4966 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004967 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004968
4969 optional int64 rx_bytes = 3;
4970
4971 optional int64 rx_packets = 4;
4972
4973 optional int64 tx_bytes = 5;
4974
4975 optional int64 tx_packets = 6;
4976}
4977
4978/**
junyulai8d1a6092020-05-07 13:38:15 +08004979 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004980 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4981 * the caller must not assume any row of data is one full report when filtering with a set of
4982 * matching conditions, because future data may represent with multiple rows what is currently
4983 * represented by one.
4984 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4985 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004986 *
4987 * Pulled from:
4988 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4989 */
4990message DataUsageBytesTransfer {
4991 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4992 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4993 // states combined, not including debug states. See NetworkStats#SET_*.
4994 optional int32 state = 1;
4995
4996 optional int64 rx_bytes = 2;
4997
4998 optional int64 rx_packets = 3;
4999
5000 optional int64 tx_bytes = 4;
5001
5002 optional int64 tx_packets = 5;
5003
5004 // Radio Access Technology (RAT) type of this record, should be one of
5005 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5006 // the record is for all rat types combined.
5007 optional int32 rat_type = 6;
5008
5009 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005010 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005011 optional string sim_mcc = 7;
5012 optional string sim_mnc = 8;
5013
junyulai8b794b72020-05-19 17:36:13 +08005014 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5015 // See TelephonyManager#getSimCarrierId.
5016 optional int32 carrier_id = 9;
5017
junyulai8d1a6092020-05-07 13:38:15 +08005018 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5019 // combined regardless of the boolean value in its field.
5020 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005021 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005022 ALL = 1;
5023 OPPORTUNISTIC = 2;
5024 NOT_OPPORTUNISTIC = 3;
5025 }
5026 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005027 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005028 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005029 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005030}
5031
5032/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005033 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5034 *
5035 * Pulled from:
5036 * StatsCompanionService
5037 */
5038message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005039 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005040
5041 optional int64 rx_bytes = 2;
5042
5043 optional int64 tx_bytes = 3;
5044}
5045
5046/**
David Chenc8a43242017-10-17 16:23:28 -07005047 * Pulls the kernel wakelock durations. This atom is adapted from
5048 * android/internal/os/KernelWakelockStats.java
5049 *
5050 * Pulled from:
5051 * StatsCompanionService using KernelWakelockReader.
5052 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005053message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005054 optional string name = 1;
5055
5056 optional int32 count = 2;
5057
5058 optional int32 version = 3;
5059
Yangster-maca8a30442018-10-13 23:46:34 -07005060 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005061}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005062
Chenjie Yu05013b32017-11-21 10:21:41 -08005063/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005064 * Pulls low power state information. If power.stats HAL is not available, this
5065 * includes platform and subsystem sleep state information,
5066 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5067 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005068 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005069 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005070 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5071 * as defined in:
5072 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005073 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005074message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005075 // Subsystem name
5076 optional string subsystem_name = 1;
5077 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5078 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005079 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5080 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005081 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005082 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005083 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005084 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005085 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005086}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005087
Chenjie Yu05013b32017-11-21 10:21:41 -08005088/**
Bookatz92da2832018-11-01 18:10:03 -07005089 * Pulls on-device power measurement information.
5090 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5091 * Pulled from:
5092 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5093 */
5094message OnDevicePowerMeasurement {
5095 // Name of the subsystem (to which the rail belongs).
5096 optional string subsystem_name = 1;
5097
5098 // Rail name. The rail lies within the subsystem.
5099 optional string rail_name = 2;
5100
5101 // Time (in ms since boot) at which the rail energy value was measured.
5102 // This may differ slightly from the time that statsd logs this information.
5103 optional uint64 measurement_timestamp_millis = 3;
5104
5105 // Accumulated energy used via the rail since device boot in uWs.
5106 optional uint64 energy_microwatt_secs = 4;
5107}
5108
5109/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005110 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005111 * Pulls the time the cpu spend on the frequency index. Frequency index
5112 * starts from highest to lowest. The value should be monotonically
5113 * increasing since boot. However, if there is a cpu
5114 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005115 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005116message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005117 optional uint32 cluster = 1;
5118 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005119 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005120}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005121
Chenjie Yu05013b32017-11-21 10:21:41 -08005122/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005123 * Pulls Cpu Time Per Uid.
5124 * Note that isolated process uid time should be attributed to host uids.
5125 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005126message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005127 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005128 optional uint64 user_time_micros = 2;
5129 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005130}
5131
5132/**
5133 * Pulls Cpu Time Per Uid per frequency.
5134 * Note that isolated process uid time should be attributed to host uids.
5135 * For each uid, we order the time by descending frequencies.
5136 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005137message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005138 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005139 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005140 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005141}
Hugo Benichi884970e2017-11-14 22:42:46 +09005142
Chenjie Yu05013b32017-11-21 10:21:41 -08005143/**
5144 * Pulls Wifi Controller Activity Energy Info
5145 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005146message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005147 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005148 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005149 // stack reported state
5150 // TODO: replace this with proto enum
5151 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005152 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005153 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005154 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005155 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005156 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005157 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005158 // product of current(mA), voltage(V) and time(ms)
5159 optional uint64 controller_energy_used = 6;
5160}
5161
5162/**
5163 * Pulls Modem Activity Energy Info
5164 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005165message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005166 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005167 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005168 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005169 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005170 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005171 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005172 /**
5173 * Tx power index
5174 * index 0 = tx_power < 0dBm
5175 * index 1 = 0dBm < tx_power < 5dBm
5176 * index 2 = 5dBm < tx_power < 15dBm
5177 * index 3 = 15dBm < tx_power < 20dBm
5178 * index 4 = tx_power > 20dBm
5179 */
5180 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005181 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005182 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005183 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005184 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005185 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005186 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005187 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005188 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005189 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005190 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005191 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005192 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005193 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005194}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005195
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005196/**
5197 * Pulls Bluetooth Activity Energy Info
5198 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5199 */
5200message BluetoothActivityInfo {
5201 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005202 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005203 // bluetooth stack state
5204 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005205 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005206 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005207 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005208 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005209 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005210 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005211 // product of current(mA), voltage(V) and time(ms)
5212 optional uint64 energy_used = 6;
5213}
5214
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005215/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005216 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005217 *
5218 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005219 */
5220message ProcessMemoryState {
5221 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005222 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005223
5224 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005225 // Usually package name, "system" for system server.
5226 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005227 optional string process_name = 2;
5228
Rafal Slawikda51b932018-12-13 16:31:33 +00005229 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005230 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005231
5232 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005233 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005234
5235 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005236 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005237
Rajeev Kumar90235992018-01-29 11:06:48 -08005238 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005239 // Value is read from memory.stat, field total_rss if per-app memory
5240 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005241 optional int64 rss_in_bytes = 6;
5242
5243 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005244 // Value is read from memory.stat, field total_cache if per-app memory
5245 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005246 optional int64 cache_in_bytes = 7;
5247
5248 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005249 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005250 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005251 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005252
Rafal Slawik203c3db2019-09-25 19:53:01 +01005253 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005254 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005255
Rafal Slawik203c3db2019-09-25 19:53:01 +01005256 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5257 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005258
Rafal Slawik203c3db2019-09-25 19:53:01 +01005259 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5260 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005261}
5262
5263/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005264 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005265 *
5266 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5267 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005268 *
5269 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005270 */
5271message ProcessMemoryHighWaterMark {
5272 // The uid if available. -1 means not available.
5273 optional int32 uid = 1 [(is_uid) = true];
5274
Rafal Slawikda51b932018-12-13 16:31:33 +00005275 // The process name.
5276 // Usually package name or process cmdline.
5277 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005278 optional string process_name = 2;
5279
Rafal Slawik239b6802019-09-09 18:46:01 +01005280 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5281 // computed by converting kilobytes to bytes.
5282 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5283
Rafal Slawik3bea8952018-11-15 12:39:33 +00005284 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5285 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005286 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005287}
5288
5289/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005290 * Logs the memory stats for a process.
5291 *
5292 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5293 * and for selected native processes.
5294 */
5295message ProcessMemorySnapshot {
5296 // The uid if available. -1 means not available.
5297 optional int32 uid = 1 [(is_uid) = true];
5298
5299 // The process name.
5300 // Usually package name or process cmdline.
5301 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5302 optional string process_name = 2;
5303
5304 // The pid of the process.
5305 // Allows to disambiguate instances of the process.
5306 optional int32 pid = 3;
5307
5308 // The current OOM score adjustment value.
5309 // Read from ProcessRecord for managed processes.
5310 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5311 optional int32 oom_score_adj = 4;
5312
5313 // The current RSS of the process.
5314 // VmRSS from /proc/pid/status.
5315 optional int32 rss_in_kilobytes = 5;
5316
5317 // The current anon RSS of the process.
5318 // RssAnon from /proc/pid/status.
5319 optional int32 anon_rss_in_kilobytes = 6;
5320
5321 // The current swap size of the process.
5322 // VmSwap from /proc/pid/status.
5323 optional int32 swap_in_kilobytes = 7;
5324
5325 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5326 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5327}
5328
5329/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005330 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005331 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005332message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005333 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005334}
5335
5336/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005337 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005338 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005339message SystemUptime {
5340 // Milliseconds since the system was booted.
5341 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5342 // for external input).
5343 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005344 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005345}
5346
5347/*
5348 * Reads from /proc/uid_concurrent_active_time which has the format:
5349 * active: X (X is # cores)
5350 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5351 * [uid1]: [time-0] [time-1] [time-2] ... ...
5352 * ...
5353 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5354 * The file contains a monotonically increasing count of time for a single boot.
5355 */
5356message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005357 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005358 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005359}
5360
5361/**
5362 * Reads from /proc/uid_concurrent_policy_time which has the format:
5363 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5364 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5365 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5366 * ...
5367 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5368 * The file contains a monotonically increasing count of time for a single boot.
5369 */
5370message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005371 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005372 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005373 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005374}
5375
5376/*
5377 * Pulls free disk space, for data, system partition and temporary directory.
5378 */
5379message DiskSpace {
5380 // available bytes in data partition
5381 optional uint64 data_available_bytes = 1;
5382 // available bytes in system partition
5383 optional uint64 system_available_bytes = 2;
5384 // available bytes in download cache or temp directories
5385 optional uint64 temp_available_bytes = 3;
5386}
Tej Singhbf972d92018-01-10 20:51:13 -08005387
5388/**
5389 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005390 *
5391 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005392 */
5393message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005394 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005395}
5396
5397/**
5398 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005399 * Pulled from:
5400 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005401 */
5402message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005403 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005404}
5405
5406/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005407 * Pulls battery voltage.
5408 * Pulled from:
5409 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5410 */
5411message BatteryVoltage {
5412 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005413 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005414}
5415
5416/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005417 * Pulls battery level (percent full, from 0 to 100).
5418 *
5419 * Pulled from:
5420 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5421 */
5422message BatteryLevel {
5423 // Battery level. Should be in [0, 100].
5424 optional int32 battery_level = 1;
5425}
5426
5427/**
Tej Singhd89137e2018-03-26 14:51:40 -07005428 * Pulls the temperature of various parts of the device.
5429 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005430 *
Maggie White442b6312019-04-05 16:26:44 -07005431 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005432 */
5433message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005434 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005435 optional android.os.TemperatureTypeEnum sensor_location = 1;
5436
5437 // The name of the temperature source. Eg. CPU0
5438 optional string sensor_name = 2;
5439
Tej Singhd89137e2018-03-26 14:51:40 -07005440 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005441 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005442 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005443
5444 // Relative severity of the throttling, see enum definition.
5445 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005446}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005447
5448/**
5449 * Pulls the statistics of calls to Binder.
5450 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005451 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5452 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005453 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005454 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005455 */
5456message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005457 // UID of the process responsible for the binder transaction. It will be set if the process
5458 // executing the binder transaction attribute the transaction to another uid using
5459 // Binder.setThreadWorkSource().
5460 //
5461 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005462 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005463 // UID of the process executing the binder transaction.
5464 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005465 // Fully qualified class name of the API call.
5466 //
5467 // This is a system server class name.
5468 //
5469 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5470 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5471 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5472 // commonly used APIs.
5473 optional string service_class_name = 2;
5474 // Method name of the API call. It can also be a transaction code if we cannot
5475 // resolve it to a name. See Binder#getTransactionName.
5476 //
5477 // This is a system server method name.
5478 optional string service_method_name = 3;
5479 // Total number of API calls.
5480 optional int64 call_count = 4;
5481 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5482 optional bool screen_interactive = 13;
5483 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5484 // call_count will be equal to recorded_call_count.
5485 //
5486 // If recorded_call_count is different than call_count, it means data collection has been
5487 // sampled. All the fields below will be sampled in this case.
5488 optional int64 recorded_call_count = 12;
5489 // Number of exceptions thrown by the API.
5490 optional int64 recorded_exception_count = 5;
5491 // Total latency of all API calls.
5492 // Average can be computed using total_latency_micros / recorded_call_count.
5493 optional int64 recorded_total_latency_micros = 6;
5494 // Maximum latency of one API call.
5495 optional int64 recorded_max_latency_micros = 7;
5496 // Total CPU usage of all API calls.
5497 // Average can be computed using total_cpu_micros / recorded_call_count.
5498 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5499 optional int64 recorded_total_cpu_micros = 8;
5500 // Maximum CPU usage of one API call.
5501 optional int64 recorded_max_cpu_micros = 9;
5502 // Maximum parcel reply size of one API call.
5503 optional int64 recorded_max_reply_size_bytes = 10;
5504 // Maximum parcel request size of one API call.
5505 optional int64 recorded_max_request_size_bytes = 11;
5506}
5507
5508/**
5509 * Pulls the statistics of exceptions during calls to Binder.
5510 *
5511 * Binder stats are cumulative from boot unless somebody reset the data using
5512 * > adb shell dumpsys binder_calls_stats --reset
5513 */
5514message BinderCallsExceptions {
5515 // Exception class name, e.g. java.lang.IllegalArgumentException.
5516 //
5517 // This is an exception class name thrown by the system server.
5518 optional string exception_class_name = 1;
5519 // Total number of exceptions.
5520 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005521}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005522
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005523/**
5524 * Pulls the statistics of message dispatching on HandlerThreads.
5525 *
5526 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5527 * config on the device.
5528 *
5529 * Next tag: 11
5530 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005531message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005532 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005533 optional int32 uid = 1 [(is_uid) = true];
5534
5535 // Fully qualified class name of the handler target class.
5536 //
5537 // This field does not contain PII. This is a system server class name.
5538 optional string handler_class_name = 2;
5539
5540 // The name of the thread that runs the Looper.
5541 //
5542 // This field does not contain PII. This is a system server thread name.
5543 optional string looper_thread_name = 3;
5544
5545 // The name of the dispatched message.
5546 //
5547 // This field does not contain PII. This is a system server constant or class
5548 // name.
5549 optional string message_name = 4;
5550
5551 // Total number of successfully dispatched messages.
5552 optional int64 message_count = 5;
5553
5554 // Total number of messages that failed dispatching.
5555 optional int64 exception_count = 6;
5556
5557 // Total number of processed messages we have data recorded for. If we
5558 // collected data for all the messages, message_count will be equal to
5559 // recorded_message_count.
5560 //
5561 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005562 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005563 optional int64 recorded_message_count = 7;
5564
5565 // Total latency of all processed messages.
5566 // Average can be computed using recorded_total_latency_micros /
5567 // recorded_message_count.
5568 optional int64 recorded_total_latency_micros = 8;
5569
5570 // Total CPU usage of all processed message.
5571 // Average can be computed using recorded_total_cpu_micros /
5572 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005573 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005574 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005575
5576 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5577 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005578
5579 // Max recorded CPU usage of all processed messages.
5580 optional int64 recorded_max_cpu_micros = 11;
5581
5582 // Max recorded latency of all processed messages.
5583 optional int64 recorded_max_latency_micros = 12;
5584
5585 // Total number of messages we tracked the dispatching delay for. If we
5586 // collected data for all the messages, message_count will be equal to
5587 // recorded_delay_message_count.
5588 //
5589 // If recorded_delay_message_count is different than message_count, it means data
5590 // collection has been sampled or/and not all messages specified the target dispatch time.
5591 // The fields below will be sampled in this case.
5592 optional int64 recorded_delay_message_count = 13;
5593
5594 // Total dispatching delay of all processed messages.
5595 // Calculated as a difference between the target dispatching time (Message.when)
5596 // and the actual dispatching time.
5597 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5598 optional int64 recorded_total_delay_millis = 14;
5599
5600 // Max dispatching delay of all processed messages.
5601 // Calculated as a difference between the target dispatching time (Message.when)
5602 // and the actual dispatching time.
5603 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005604}
Tej Singh86dc9db2018-09-06 00:39:57 +00005605
5606/**
5607 * Pulls disk information, such as write speed and latency.
5608 */
5609message DiskStats {
5610 // Time taken to open, write 512B to, and close a file.
5611 // -1 if error performing the check.
5612 optional int64 data_write_latency_millis = 1;
5613
5614 optional bool file_based_encryption = 2;
5615
5616 // Recent disk write speed in kB/s.
5617 // -1 if error querying storageed.
5618 // 0 if data is unavailable.
5619 optional int32 recent_disk_write_speed = 3;
5620}
5621
5622
5623/**
5624 * Free and total bytes of the Data, Cache, and System partition.
5625 */
5626message DirectoryUsage {
5627 enum Directory {
5628 UNKNOWN = 0;
5629 DATA = 1;
5630 CACHE = 2;
5631 SYSTEM = 3;
5632 }
5633 optional Directory directory = 1;
5634 optional int64 free_bytes = 2;
5635 optional int64 total_bytes = 3;
5636}
5637
5638
5639/**
5640 * Size of an application: apk size, data size, and cache size.
5641 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5642 * Information is only reported for apps with the primary user (user 0).
5643 * Sizes are aggregated by package name.
5644 */
5645message AppSize {
5646 // Including uids will involve modifying diskstats logic.
5647 optional string package_name = 1;
5648 // App size in bytes. -1 if unavailable.
5649 optional int64 app_size_bytes = 2;
5650 // App data size in bytes. -1 if unavailable.
5651 optional int64 app_data_size_bytes = 3;
5652 // App cache size in bytes. -1 if unavailable.
5653 optional int64 app_cache_size_bytes = 4;
5654 // Time that the cache file was produced.
5655 // Uses System.currentTimeMillis(), which is wall clock time.
5656 optional int64 cache_time_millis = 5;
5657}
5658
5659
5660/**
5661 * Size of a particular category. Eg: photos, videos.
5662 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5663 */
5664message CategorySize {
5665 enum Category {
5666 UNKNOWN = 0;
5667 APP_SIZE = 1;
5668 APP_DATA_SIZE = 2;
5669 APP_CACHE_SIZE = 3;
5670 PHOTOS = 4;
5671 VIDEOS = 5;
5672 AUDIO = 6;
5673 DOWNLOADS = 7;
5674 SYSTEM = 8;
5675 OTHER = 9;
5676 }
5677 optional Category category = 1;
5678 // Category size in bytes.
5679 optional int64 size_bytes = 2;
5680 // Time that the cache file was produced.
5681 // Uses System.currentTimeMillis(), which is wall clock time.
5682 optional int64 cache_time_millis = 3;
5683}
Tej Singhd6d6d772018-09-05 17:41:25 -07005684
5685/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005686 * Pulls per uid I/O stats. The stats are cumulative since boot.
5687 *
5688 * Read/write bytes are I/O events from a storage device
5689 * Read/write chars are data requested by read/write syscalls, and can be
5690 * satisfied by caching.
5691 *
5692 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5693 */
5694message DiskIo {
5695 optional int32 uid = 1 [(is_uid) = true];
5696 optional int64 fg_chars_read = 2;
5697 optional int64 fg_chars_write = 3;
5698 optional int64 fg_bytes_read = 4;
5699 optional int64 fg_bytes_write = 5;
5700 optional int64 bg_chars_read = 6;
5701 optional int64 bg_chars_write = 7;
5702 optional int64 bg_bytes_read = 8;
5703 optional int64 bg_bytes_write = 9;
5704 optional int64 fg_fsync = 10;
5705 optional int64 bg_fsync= 11;
5706}
5707
5708
5709/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005710 * Pulls the number of fingerprints for each user.
5711 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005712 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005713 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005714message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005715 // The associated user. Eg: 0 for owners, 10+ for others.
5716 // Defined in android/os/UserHandle.java
5717 optional int32 user = 1;
5718 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005719 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005720}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005721
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005722/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005723 * Pulls the number of faces for each user.
5724 *
5725 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5726 */
5727message NumFacesEnrolled {
5728 // The associated user. Eg: 0 for owners, 10+ for others.
5729 // Defined in android/os/UserHandle.java
5730 optional int32 user = 1;
5731 // Number of faces registered to that user.
5732 optional int32 num_faces_enrolled = 2;
5733}
5734/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005735 * A mapping of role holder -> role
5736 */
5737message RoleHolder {
5738 // uid of the role holder
5739 optional int32 uid = 1 [(is_uid) = true];
5740
5741 // package name of the role holder
5742 optional string package_name = 2;
5743
5744 // the role held
5745 optional string role = 3;
5746}
5747
Yangsteraf9aee72018-10-12 09:26:16 -07005748message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005749 // These are all in byte resolution.
5750 optional int64 min = 1 [deprecated = true];
5751 optional int64 average = 2 [deprecated = true];
5752 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005753
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005754 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5755 // int64 fields.
5756 optional int32 mean_kb = 4;
5757 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005758}
5759
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005760// A reduced subset of process states; reducing the number of possible states allows more
5761// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5762enum ProcessStateAggregated {
5763 PROCESS_STATE_UNKNOWN = 0;
5764 // Persistent system process.
5765 PROCESS_STATE_PERSISTENT = 1;
5766 // Top activity; actually any visible activity.
5767 PROCESS_STATE_TOP = 2;
5768 // Process binding to top or a foreground service.
5769 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5770 // Processing running a foreground service.
5771 PROCESS_STATE_FGS = 4;
5772 // Important foreground process (ime, wallpaper, etc).
5773 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5774 // Important background process.
5775 PROCESS_STATE_BACKGROUND = 6;
5776 // Process running a receiver.
5777 PROCESS_STATE_RECEIVER = 7;
5778 // All kinds of cached processes.
5779 PROCESS_STATE_CACHED = 8;
5780}
5781
5782// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005783message ProcessStatsStateProto {
5784 optional android.service.procstats.ScreenState screen_state = 1;
5785
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005786 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005787
5788 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5789 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005790 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5791
5792 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005793
5794 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005795 optional int64 duration_millis = 4 [deprecated = true];
5796 // Same as above, but with minute resolution so it fits into an int32.
5797 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005798
5799 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005800 optional int64 realtime_duration_millis = 9 [deprecated = true];
5801 // Same as above, but with minute resolution so it fits into an int32.
5802 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005803
5804 // # of samples taken
5805 optional int32 sample_size = 5;
5806
5807 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005808 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005809
5810 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005811 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005812
5813 // RSS is memory resident for this process
5814 optional AggStats rss = 8;
5815}
5816
Jing Ji060d6862020-04-13 19:36:31 -07005817// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005818message ProcessStatsProto {
5819 // Name of process.
5820 optional string process = 1;
5821
5822 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005823 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005824
5825 // Information about how often kills occurred
5826 message Kill {
5827 // Count of excessive CPU kills
5828 optional int32 cpu = 1;
5829
5830 // Count of kills when cached
5831 optional int32 cached = 2;
5832
5833 // PSS stats during cached kill
5834 optional AggStats cached_pss = 3;
5835 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005836 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005837
5838 // Time and memory spent in various states.
5839 repeated ProcessStatsStateProto states = 5;
5840
5841 // Total time process has been running... screen_state, memory_state, and process_state
5842 // will not be set.
5843 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005844
5845 // Association data for this process in this state;
5846 // each entry here is one association.
5847 repeated ProcessStatsAssociationProto assocs = 7;
5848}
5849
Jing Ji1cd1f602020-06-03 13:45:36 -07005850// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005851message ProcessStatsAssociationProto {
5852 // Procss Name of the associated process (client process of service binding)
5853 optional string assoc_process_name = 1;
5854
5855 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005856 optional string assoc_package_name = 2 [deprecated = true];
5857
5858 // UID of the associated process/package (client package of service binding)
5859 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005860
5861 // Total count of the times this association (service binding) appeared.
5862 optional int32 total_count = 3;
5863
5864 // Uptime total duration in seconds this association (service binding) was around.
5865 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005866}
5867
5868message PackageServiceOperationStatsProto {
5869 // Operate enum: Started, Foreground, Bound, Executing
5870 optional android.service.procstats.ServiceOperationState operation = 1;
5871
5872 // Number of times the service was in this operation.
5873 optional int32 count = 2;
5874
5875 // Information about a state the service can be in.
5876 message StateStats {
5877 // Screen state enum.
5878 optional android.service.procstats.ScreenState screen_state = 1;
5879 // Memory state enum.
5880 optional android.service.procstats.MemoryState memory_state = 2;
5881
5882 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005883 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005884 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005885 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005886 }
5887 repeated StateStats state_stats = 3;
5888}
5889
5890message PackageServiceStatsProto {
5891 // Name of service component.
5892 optional string service_name = 1;
5893
5894 // The operation stats.
5895 // The package_name, package_uid, package_version, service_name will not be set to save space.
5896 repeated PackageServiceOperationStatsProto operation_stats = 2;
5897}
5898
5899message PackageAssociationSourceProcessStatsProto {
5900 // Uid of the process.
5901 optional int32 process_uid = 1;
5902 // Process name.
5903 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005904 // Package name.
5905 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005906 // Total count of the times this association appeared.
5907 optional int32 total_count = 3;
5908
5909 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005910 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005911
5912 // Total count of the times this association became actively impacting its target process.
5913 optional int32 active_count = 5;
5914
5915 // Information on one source in this association.
5916 message StateStats {
5917 // Process state enum.
5918 optional android.service.procstats.ProcessState process_state = 1;
5919 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005920 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005921 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005922 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005923 }
5924 repeated StateStats active_state_stats = 6;
5925}
5926
5927message PackageAssociationProcessStatsProto {
5928 // Name of the target component.
5929 optional string component_name = 1;
5930 // Information on one source in this association.
5931 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5932}
5933
5934
5935message ProcessStatsPackageProto {
5936 // Name of package.
5937 optional string package = 1;
5938
5939 // Uid of the package.
5940 optional int32 uid = 2;
5941
5942 // Version of the package.
5943 optional int64 version = 3;
5944
5945 // Stats for each process running with the package loaded in to it.
5946 repeated ProcessStatsProto process_stats = 4;
5947
5948 // Stats for each of the package's services.
5949 repeated PackageServiceStatsProto service_stats = 5;
5950
5951 // Stats for each association with the package.
5952 repeated PackageAssociationProcessStatsProto association_stats = 6;
5953}
5954
5955message ProcessStatsSectionProto {
5956 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005957 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005958
5959 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005960 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005961
5962 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005963 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005964
5965 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005966 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005967
5968 // System runtime library. e.g. "libdvm.so", "libart.so".
5969 optional string runtime = 5;
5970
5971 // whether kernel reports swapped pss.
5972 optional bool has_swapped_pss = 6;
5973
5974 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5975 enum Status {
5976 STATUS_UNKNOWN = 0;
5977 STATUS_COMPLETE = 1;
5978 STATUS_PARTIAL = 2;
5979 STATUS_SHUTDOWN = 3;
5980 STATUS_SYSPROPS = 4;
5981 }
5982 repeated Status status = 7;
5983
Chenjie Yub2ecc792019-01-17 10:27:26 -08005984 // Number of pages available of various types and sizes, representation fragmentation.
5985 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5986
Yangsteraf9aee72018-10-12 09:26:16 -07005987 // Stats for each process.
5988 repeated ProcessStatsProto process_stats = 8;
5989
5990 // Stats for each package.
5991 repeated ProcessStatsPackageProto package_stats = 9;
5992}
5993
Chenjie Yub2ecc792019-01-17 10:27:26 -08005994message ProcessStatsAvailablePagesProto {
5995 // Node these pages are in (as per /proc/pagetypeinfo)
5996 optional int32 node = 1;
5997
5998 // Zone these pages are in (as per /proc/pagetypeinfo)
5999 optional string zone = 2;
6000
6001 // Label for the type of these pages (as per /proc/pagetypeinfo)
6002 optional string label = 3;
6003
6004 // Distribution of number of pages available by order size. First entry in array is
6005 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6006 repeated int32 pages_per_order = 4;
6007}
6008
Chenjie Yu12e5e672018-09-14 15:54:59 -07006009/**
6010 * Pulled from ProcessStatsService.java
6011 */
6012message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006013 optional ProcessStatsSectionProto proc_stats_section = 1;
6014}
6015
Chenjie Yuf910b7802019-01-11 16:08:20 -08006016/**
6017 * Pulled from ProcessStatsService.java
6018 */
6019message ProcStatsPkgProc {
6020 optional ProcessStatsSectionProto proc_stats_section = 1;
6021}
6022
Chris Wrencdea3b72019-11-22 16:58:17 -05006023// Next Tag: 2
6024message PackageRemoteViewInfoProto {
6025 optional string package_name = 1;
6026 // add per-package additional info here (like channels)
6027}
6028
6029// Next Tag: 2
6030message NotificationRemoteViewsProto {
6031 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6032}
6033
6034/**
6035 * Pulled from NotificationManagerService.java
6036 */
6037message NotificationRemoteViews {
6038 optional NotificationRemoteViewsProto notification_remote_views = 1;
6039}
6040
Yotam Aron74299972020-01-16 16:20:58 +02006041/**
6042 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6043 */
6044message PackageNotificationPreferences {
6045 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006046 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006047 // Notification importance, which specifies when and how a notification is displayed.
6048 // Specified under core/java/android/app/NotificationManager.java.
6049 optional int32 importance = 2;
6050 // Lockscreen visibility as set by the user.
6051 optional int32 visibility = 3;
6052 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6053 // PreferencesHelper.java)
6054 optional int32 user_locked_fields = 4;
6055}
6056
6057/**
6058 * Atom that contains a list of a package's channel preferences, pulled from
6059 * NotificationManagerService.java.
6060 */
6061message PackageNotificationChannelPreferences {
6062 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006063 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006064 // Channel's ID. Should always be available.
6065 optional string channel_id = 2;
6066 // Channel's name. Should always be available.
6067 optional string channel_name = 3;
6068 // Channel's description. Optionally set by the channel creator.
6069 optional string description = 4;
6070 // Notification importance, which specifies when and how a notification is displayed. Specified
6071 // under core/java/android/app/NotificationManager.java.
6072 optional int32 importance = 5;
6073 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6074 // at core/java/android/app/NotificationChannel.java
6075 optional int32 user_locked_fields = 6;
6076 // Indicates if the channel was deleted by the app.
6077 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006078 // Indicates if the channel was marked as a conversation by the app.
6079 optional bool is_conversation = 8;
6080 // Indicates if the channel is a conversation that was demoted by the user.
6081 optional bool is_demoted_conversation = 9;
6082 // Indicates if the channel is a conversation that was marked as important by the user.
6083 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006084}
6085
6086/**
Chris Wren93165692020-05-15 16:12:41 -04006087 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
6088 * NotificationManagerService.java.
6089 */
6090message DNDModeProto {
6091 enum Mode {
6092 ROOT_CONFIG = -1; // Used to distinguish the config (one per user) from the rules.
6093 ZEN_MODE_OFF = 0;
6094 ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6095 ZEN_MODE_NO_INTERRUPTIONS = 2;
6096 ZEN_MODE_ALARMS = 3;
6097 }
6098 optional int32 user = 1; // Android user ID (0, 1, 10, ...)
6099 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled
6100 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
6101 optional Mode zen_mode = 4;
6102 // id is one of the system default rule IDs, or empty
6103 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
6104 optional string id = 5;
6105 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
6106 optional DNDPolicyProto policy = 7;
6107}
6108
6109/**
6110 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
6111 */
6112message DNDPolicyProto {
6113 enum State {
6114 STATE_UNSET = 0;
6115 STATE_ALLOW = 1;
6116 STATE_DISALLOW = 2;
6117 }
6118 optional State calls = 1;
6119 optional State repeat_callers = 2;
6120 optional State messages = 3;
6121 optional State conversations = 4;
6122 optional State reminders = 5;
6123 optional State events = 6;
6124 optional State alarms = 7;
6125 optional State media = 8;
6126 optional State system = 9;
6127 optional State fullscreen = 10;
6128 optional State lights = 11;
6129 optional State peek = 12;
6130 optional State status_bar = 13;
6131 optional State badge = 14;
6132 optional State ambient = 15;
6133 optional State notification_list = 16;
6134
6135 enum PeopleType {
6136 PEOPLE_UNSET = 0;
6137 PEOPLE_ANYONE = 1;
6138 PEOPLE_CONTACTS = 2;
6139 PEOPLE_STARRED = 3;
6140 PEOPLE_NONE = 4;
6141 }
6142
6143 optional PeopleType allow_calls_from = 17;
6144 optional PeopleType allow_messages_from = 18;
6145
6146 enum ConversationType {
6147 CONV_UNSET = 0;
6148 CONV_ANYONE = 1;
6149 CONV_IMPORTANT = 2;
6150 CONV_NONE = 3;
6151 }
6152
6153 optional ConversationType allow_conversations_from = 19;
6154}
6155
6156/**
Yotam Aron74299972020-01-16 16:20:58 +02006157 * Atom that contains a list of a package's channel group preferences, pulled from
6158 * NotificationManagerService.java.
6159 */
6160message PackageNotificationChannelGroupPreferences {
6161 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006162 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006163 // Channel Group's ID. Should always be available.
6164 optional string group_id = 2;
6165 // Channel Group's name. Should always be available.
6166 optional string group_name = 3;
6167 // Channel Group's description. Optionally set by group creator.
6168 optional string description = 4;
6169 // Indicates if notifications from this channel group are blocked.
6170 optional bool is_blocked = 5;
6171 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6172 // at core/java/android/app/NotificationChannelGroup.java
6173 optional int32 user_locked_fields = 6;
6174}
6175
Yangsteraf9aee72018-10-12 09:26:16 -07006176message PowerProfileProto {
6177 optional double cpu_suspend = 1;
6178
6179 optional double cpu_idle = 2;
6180
6181 optional double cpu_active = 3;
6182
6183 message CpuCluster {
6184 optional int32 id = 1;
6185 optional double cluster_power = 2;
6186 optional int32 cores = 3;
6187 repeated int64 speed = 4;
6188 repeated double core_power = 5;
6189 }
6190
6191 repeated CpuCluster cpu_cluster = 40;
6192
6193 optional double wifi_scan = 4;
6194
6195 optional double wifi_on = 5;
6196
6197 optional double wifi_active = 6;
6198
6199 optional double wifi_controller_idle = 7;
6200
6201 optional double wifi_controller_rx = 8;
6202
6203 optional double wifi_controller_tx = 9;
6204
6205 repeated double wifi_controller_tx_levels = 10;
6206
6207 optional double wifi_controller_operating_voltage = 11;
6208
6209 optional double bluetooth_controller_idle = 12;
6210
6211 optional double bluetooth_controller_rx = 13;
6212
6213 optional double bluetooth_controller_tx = 14;
6214
6215 optional double bluetooth_controller_operating_voltage = 15;
6216
6217 optional double modem_controller_sleep = 16;
6218
6219 optional double modem_controller_idle = 17;
6220
6221 optional double modem_controller_rx = 18;
6222
6223 repeated double modem_controller_tx = 19;
6224
6225 optional double modem_controller_operating_voltage = 20;
6226
6227 optional double gps_on = 21;
6228
6229 repeated double gps_signal_quality_based = 22;
6230
6231 optional double gps_operating_voltage = 23;
6232
6233 optional double bluetooth_on = 24;
6234
6235 optional double bluetooth_active = 25;
6236
6237 optional double bluetooth_at_cmd = 26;
6238
6239 optional double ambient_display = 27;
6240
6241 optional double screen_on = 28;
6242
6243 optional double radio_on = 29;
6244
6245 optional double radio_scanning = 30;
6246
6247 optional double radio_active = 31;
6248
6249 optional double screen_full = 32;
6250
6251 optional double audio = 33;
6252
6253 optional double video = 34;
6254
6255 optional double flashlight = 35;
6256
6257 optional double memory = 36;
6258
6259 optional double camera = 37;
6260
6261 optional double wifi_batched_scan = 38;
6262
6263 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006264}
Chenjie Yuab530202018-09-26 12:39:20 -07006265
6266/**
6267 * power_profile.xml and other constants for power model calculations.
6268 * Pulled from PowerProfile.java
6269 */
6270message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006271 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006272}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006273
6274/**
arangelovd5db50e2018-10-12 20:24:39 +01006275 * Logs when a user restriction was added or removed.
6276 *
6277 * Logged from:
6278 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6279 */
6280message UserRestrictionChanged {
6281 // The raw string of the user restriction as defined in UserManager.
6282 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6283 optional string restriction = 1;
6284 // Whether the restriction is enabled or disabled.
6285 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006286}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006287
6288/**
6289 * Pulls process user time and system time. Puller takes a snapshot of all pids
6290 * in the system and returns cpu stats for those that are working at the time.
6291 * Dead pids will be dropped. Kernel processes are excluded.
6292 * Min cool-down is 5 sec.
6293 */
6294message ProcessCpuTime {
6295 optional int32 uid = 1 [(is_uid) = true];
6296
6297 optional string process_name = 2;
6298 // Process cpu time in user space, cumulative from boot/process start
6299 optional int64 user_time_millis = 3;
6300 // Process cpu time in system space, cumulative from boot/process start
6301 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006302}
Misha Wagner5a51e002018-10-03 15:04:09 +01006303
6304/**
6305 * Pulls the CPU usage for each thread.
6306 *
6307 * Read from /proc/$PID/task/$TID/time_in_state files.
6308 *
6309 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6310 * time_in_state files not being present on some phones, have not been addressed. These should be
6311 * considered before a public release.
6312 */
6313message CpuTimePerThreadFreq {
6314 // UID that owns the process.
6315 optional int32 uid = 1 [(is_uid) = true];
6316 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006317 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006318 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006319 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006320 // Name of the process taken from `/proc/$PID/cmdline`.
6321 optional string process_name = 4;
6322 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6323 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006324
6325 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6326 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6327 // frequencies are given here as the alternative is sending eight separate atoms. This method
6328 // significantly reduces the amount of data created
6329 optional int32 frequency1_khz = 6;
6330 optional int32 time1_millis = 7;
6331 optional int32 frequency2_khz = 8;
6332 optional int32 time2_millis = 9;
6333 optional int32 frequency3_khz = 10;
6334 optional int32 time3_millis = 11;
6335 optional int32 frequency4_khz = 12;
6336 optional int32 time4_millis = 13;
6337 optional int32 frequency5_khz = 14;
6338 optional int32 time5_millis = 15;
6339 optional int32 frequency6_khz = 16;
6340 optional int32 time6_millis = 17;
6341 optional int32 frequency7_khz = 18;
6342 optional int32 time7_millis = 19;
6343 optional int32 frequency8_khz = 20;
6344 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006345}
Bookatz75ee60422018-11-09 12:27:37 -08006346
6347/**
Bookatz366a4432018-11-20 09:42:33 -08006348 * Pulls information about the device's build.
6349 */
6350message BuildInformation {
6351 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6352 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6353 optional string fingerprint = 1;
6354
6355 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6356 optional string brand = 2;
6357
6358 // Build.PRODUCT. The name of the overall product.
6359 optional string product = 3;
6360
6361 // Build.DEVICE. The name of the industrial design.
6362 optional string device = 4;
6363
6364 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6365 optional string version_release = 5;
6366
6367 // Build.ID. E.g. a label like "M4-rc20".
6368 optional string id = 6;
6369
6370 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6371 // represent this build.
6372 optional string version_incremental = 7;
6373
6374 // Build.TYPE. The type of build, like "user" or "eng".
6375 optional string type = 8;
6376
6377 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6378 optional string tags = 9;
6379}
6380
6381/**
Adam He420947c2019-01-23 15:59:09 -08006382 * Logs information about mismatched caller for content capture.
6383 *
6384 * Logged from:
6385 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6386 */
6387message ContentCaptureCallerMismatchReported {
6388 optional string intended_package = 1;
6389 optional string calling_package = 2;
6390}
6391
6392/**
6393 * Logs information about content capture service events.
6394 *
6395 * Logged from:
6396 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6397 */
6398message ContentCaptureServiceEvents {
6399 // The type of event.
6400 enum Event {
6401 UNKNOWN = 0;
6402 ON_CONNECTED = 1;
6403 ON_DISCONNECTED = 2;
6404 SET_WHITELIST = 3;
6405 SET_DISABLED = 4;
6406 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006407 ON_DATA_SHARE_REQUEST = 6;
6408 ACCEPT_DATA_SHARE_REQUEST = 7;
6409 REJECT_DATA_SHARE_REQUEST = 8;
6410 DATA_SHARE_WRITE_FINISHED = 9;
6411 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6412 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6413 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6414 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6415 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6416 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006417 }
6418 optional Event event = 1;
6419 // component/package of content capture service.
6420 optional string service_info = 2;
6421 // component/package of target.
6422 // it's a concatenated list of component/package for SET_WHITELIST event
6423 // separated by " ".
6424 optional string target_info = 3;
6425}
6426
6427/**
6428 * Logs information about content capture session events.
6429 *
6430 * Logged from:
6431 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6432 */
6433message ContentCaptureSessionEvents {
6434 // The type of event.
6435 enum Event {
6436 UNKNOWN = 0;
6437 ON_SESSION_STARTED = 1;
6438 ON_SESSION_FINISHED = 2;
6439 SESSION_NOT_CREATED = 3;
6440 }
6441 optional int32 session_id = 1;
6442 optional Event event = 2;
6443 // (n/a on session finished)
6444 optional int32 state_flags = 3;
6445 // component/package of content capture service.
6446 optional string service_info = 4;
6447 // component/package of app.
6448 // (n/a on session finished)
6449 optional string app_info = 5;
6450 optional bool is_child_session = 6;
6451}
6452
6453/**
6454 * Logs information about session being flushed.
6455 *
6456 * Logged from:
6457 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6458 */
6459message ContentCaptureFlushed {
6460 optional int32 session_id = 1;
6461 // component/package of content capture service.
6462 optional string service_info = 2;
6463 // component/package of app.
6464 optional string app_info = 3;
6465 // session start/finish events
6466 optional int32 child_session_started = 4;
6467 optional int32 child_session_finished = 5;
6468 // count of view events.
6469 optional int32 view_appeared_count = 6;
6470 optional int32 view_disappeared_count = 7;
6471 optional int32 view_text_changed_count = 8;
6472
6473 // Flush stats.
6474 optional int32 max_events = 9;
6475 optional int32 idle_flush_freq = 10;
6476 optional int32 text_flush_freq = 11;
6477 optional int32 flush_reason = 12;
6478}
6479
6480/**
Bookatz75ee60422018-11-09 12:27:37 -08006481 * Pulls on-device BatteryStats power use calculations for the overall device.
6482 */
6483message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006484 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6485 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6486 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6487 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006488}
6489
6490/**
6491 * Pulls on-device BatteryStats power use calculations broken down by uid.
6492 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6493 * that is attributed to non-uid items. They must all be included to get the total power use.
6494 */
6495message DeviceCalculatedPowerBlameUid {
6496 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6497 optional int32 uid = 1 [(is_uid) = true];
6498
Bookatz3dbc13a2018-12-21 12:16:51 -08006499 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6500 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6501 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006502}
6503
6504/**
6505 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6506 * drain type.
6507 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6508 * is attributed uids. They must all be included to get the total power use.
6509 */
6510message DeviceCalculatedPowerBlameOther {
6511 // The type of item whose power use is being reported.
6512 enum DrainType {
6513 AMBIENT_DISPLAY = 0;
6514 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6515 BLUETOOTH = 2;
6516 CAMERA = 3;
6517 // Cell-standby
6518 CELL = 4;
6519 FLASHLIGHT = 5;
6520 IDLE = 6;
6521 MEMORY = 7;
6522 // Amount that total computed drain exceeded the drain estimated using the
6523 // battery level changes and capacity.
6524 OVERCOUNTED = 8;
6525 PHONE = 9;
6526 SCREEN = 10;
6527 // Amount that total computed drain was below the drain estimated using the
6528 // battery level changes and capacity.
6529 UNACCOUNTED = 11;
6530 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6531 WIFI = 13;
6532 }
6533 optional DrainType drain_type = 1;
6534
Bookatz3dbc13a2018-12-21 12:16:51 -08006535 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6536 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6537 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006538}
arangelov4e994062018-11-13 16:12:38 +00006539
6540/**
6541 * Logs device policy features.
6542 *
6543 * Logged from:
6544 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6545 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6546 */
6547message DevicePolicyEvent {
6548 // The event id - unique for each event.
6549 optional android.stats.devicepolicy.EventId event_id = 1;
6550 // The admin package name.
6551 optional string admin_package_name = 2;
6552 // A generic integer parameter.
6553 optional int32 integer_value = 3;
6554 // A generic boolean parameter.
6555 optional bool boolean_value = 4;
6556 // A parameter specifying a time period in milliseconds.
6557 optional uint64 time_period_millis = 5;
6558 // A parameter specifying a list of package names, bundle extras or string parameters.
6559 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6560}
shawnlinea5b66b2018-11-13 15:05:29 +08006561
6562/**
6563 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6564 *
6565 * Logged from:
6566 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6567 */
6568message DocsUILaunchReported {
6569 optional android.stats.docsui.LaunchAction launch_action = 1;
6570 optional bool has_initial_uri = 2;
6571 optional android.stats.docsui.MimeType mime_type = 3;
6572 optional android.stats.docsui.Root initial_root = 4;
6573}
6574
6575/**
6576 * Logs root/app visited event in file managers/picker. Call this when the user
6577 * taps on root/app in hamburger menu.
6578 *
6579 * Logged from:
6580 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6581 */
6582message DocsUIRootVisitedReported {
6583 optional android.stats.docsui.ContextScope scope = 1;
6584 optional android.stats.docsui.Root root = 2;
6585}
6586
6587/**
6588 * Logs file operation stats. Call this when a file operation has completed.
6589 *
6590 * Logged from:
6591 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6592 */
6593message DocsUIFileOperationReported {
6594 optional android.stats.docsui.Provider provider = 1;
6595 optional android.stats.docsui.FileOperation file_op = 2;
6596}
6597
6598/**
6599 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6600 * mode.
6601 *
6602 * Logged from:
6603 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6604 */
6605message DocsUIFileOperationCopyMoveModeReported {
6606 optional android.stats.docsui.FileOperation file_op = 1;
6607 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6608}
6609
6610
6611/**
6612 * Logs file sub operation stats. Call this when a file operation has failed.
6613 *
6614 * Logged from:
6615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6616 */
6617message DocsUIFileOperationFailureReported {
6618 optional android.stats.docsui.Authority authority = 1;
6619 optional android.stats.docsui.SubFileOperation sub_op = 2;
6620}
6621
6622/**
6623* Logs the cancellation of a file operation. Call this when a job is canceled
6624*
6625* Logged from:
6626* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6627*/
6628message DocsUIFileOperationCanceledReported {
6629 optional android.stats.docsui.FileOperation file_op = 1;
6630}
6631
6632/**
6633 * Logs startup time in milliseconds.
6634 *
6635 * Logged from:
6636 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6637 */
6638message DocsUIStartupMsReported {
6639 optional int32 startup_millis = 1;
6640}
6641
6642/**
6643 * Logs the action that was started by user.
6644 *
6645 * Logged from:
6646 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6647 */
6648message DocsUIUserActionReported {
6649 optional android.stats.docsui.UserAction action = 1;
6650}
6651
6652/**
6653 * Logs the invalid type when invalid scoped access is requested.
6654 *
6655 * Logged from:
6656 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6657 */
6658message DocsUIInvalidScopedAccessRequestReported {
6659 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006660}
Ben Murdochbab399f62018-12-06 11:01:38 +00006661
6662/**
shawnlina75e82d2019-01-07 10:31:12 +08006663 * Logs the package name that launches docsui picker mode.
6664 *
6665 * Logged from:
6666 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6667 */
6668message DocsUIPickerLaunchedFromReported {
6669 optional string package_name = 1;
6670}
6671
6672/**
6673 * Logs the search type.
6674 *
6675 * Logged from:
6676 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6677 */
6678message DocsUISearchTypeReported {
6679 optional android.stats.docsui.SearchType search_type = 1;
6680}
6681
6682/**
6683 * Logs the search mode.
6684 *
6685 * Logged from:
6686 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6687 */
6688message DocsUISearchModeReported {
6689 optional android.stats.docsui.SearchMode search_mode = 1;
6690}
6691
6692/**
6693 * Logs the pick result information.
6694 *
6695 * Logged from:
6696 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6697 */
6698message DocsUIPickResultReported {
6699 optional int32 total_action_count = 1;
6700 optional int64 duration_millis = 2;
6701 optional int32 file_count= 3;
6702 optional bool is_searching = 4;
6703 optional android.stats.docsui.Root picked_from = 5;
6704 optional android.stats.docsui.MimeType mime_type = 6;
6705 optional int32 repeatedly_pick_times = 7;
6706}
6707
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006708/** Logs the drag and drop of files.
6709
6710 * Logged from:
6711 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6712 */
6713message DocsUIDragAndDropReported {
6714 optional bool drag_initiated_from_docsui = 1;
6715}
6716
shawnlina75e82d2019-01-07 10:31:12 +08006717/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006718 * Logs when an app's memory is compacted.
6719 *
6720 * Logged from:
6721 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6722 */
6723message AppCompacted {
6724 // The pid of the process being compacted.
6725 optional int32 pid = 1;
6726
6727 // The name of the process being compacted.
6728 optional string process_name = 2;
6729
6730 // The type of compaction.
6731 enum Action {
6732 UNKNOWN = 0;
6733 SOME = 1;
6734 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006735 PERSISTENT = 3;
6736 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006737 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006738 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006739
6740 // Total RSS in kilobytes consumed by the process prior to compaction.
6741 optional int64 before_rss_total_kilobytes = 4;
6742
6743 // File RSS in kilobytes consumed by the process prior to compaction.
6744 optional int64 before_rss_file_kilobytes = 5;
6745
6746 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6747 optional int64 before_rss_anon_kilobytes = 6;
6748
6749 // Swap in kilobytes consumed by the process prior to compaction.
6750 optional int64 before_swap_kilobytes = 7;
6751
6752 // Total RSS in kilobytes consumed by the process after compaction.
6753 optional int64 after_rss_total_kilobytes = 8;
6754
6755 // File RSS in kilobytes consumed by the process after compaction.
6756 optional int64 after_rss_file_kilobytes = 9;
6757
6758 // Anonymous RSS in kilobytes consumed by the process after compaction.
6759 optional int64 after_rss_anon_kilobytes = 10;
6760
6761 // Swap in kilobytes consumed by the process after compaction.
6762 optional int64 after_swap_kilobytes = 11;
6763
6764 // The time taken to perform compaction in milliseconds.
6765 optional int64 time_to_compact_millis = 12;
6766
6767 // The last compaction action performed for this app.
6768 optional Action last_action = 13;
6769
Ben Murdoch01720b82018-12-19 18:03:44 +00006770 // The last time that compaction was attempted on this process in milliseconds
6771 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6772 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006773
Ben Murdoch885c21b2019-03-15 18:02:04 +00006774 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006775 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006776
6777 // The process state at the time of compaction.
6778 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006779
6780 // Free ZRAM in kilobytes before compaction.
6781 optional int64 before_zram_free_kilobytes = 17;
6782
6783 // Free ZRAM in kilobytes after compaction.
6784 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006785}
lifr157fc552018-12-12 16:38:04 +08006786
6787/**
lifrb6b90b62019-03-29 00:40:17 +08006788 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6789 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6790 *
lifr1f74b052019-04-16 22:16:30 +08006791 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6792 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6793 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6794 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006795 */
6796message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006797 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006798
lifr1f74b052019-04-16 22:16:30 +08006799 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006800
6801 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006802 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006803
lifr1f74b052019-04-16 22:16:30 +08006804 // Only valid for event_type = EVENT_GETADDRINFO.
6805 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006806
lifr1f74b052019-04-16 22:16:30 +08006807 // Flags passed to android_res_nsend() defined in multinetwork.h
6808 // Only valid for event_type = EVENT_RESNSEND.
6809 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006810
lifrad9becc2019-05-20 11:04:41 +08006811 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006812
6813 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006814 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006815
6816 // Additional pass-through fields opaque to statsd.
6817 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006818 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006819
6820 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6821 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006822}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006823
6824/**
6825 * Logs when a data stall event occurs.
6826 *
6827 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006828 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006829 */
6830message DataStallEvent {
6831 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006832 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006833 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6834 optional int32 evaluation_type = 1;
6835 // See definition in data_stall_event.proto.
6836 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6837 // See definition in data_stall_event.proto.
6838 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6839 // See definition in data_stall_event.proto.
6840 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6841 // See definition in data_stall_event.proto.
6842 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6843 // See definition in data_stall_event.proto.
6844 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006845 // The tcp packets fail rate from the latest tcp polling.
6846 optional int32 tcp_fail_rate = 7;
6847 // Number of packets sent since the last received packet.
6848 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006849}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006850
6851/*
6852 * Logs when RescueParty resets some set of experiment flags.
6853 *
6854 * Logged from:
6855 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6856 */
6857message RescuePartyResetReported {
6858 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6859 optional int32 rescue_level = 1;
6860}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006861
6862/**
6863 * Logs when signed config is received from an APK, and if that config was applied successfully.
6864 * Logged from:
6865 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6866 */
6867message SignedConfigReported {
6868 enum Type {
6869 UNKNOWN_TYPE = 0;
6870 GLOBAL_SETTINGS = 1;
6871 }
6872 optional Type type = 1;
6873
6874 // The final status of the signed config received.
6875 enum Status {
6876 UNKNOWN_STATUS = 0;
6877 APPLIED = 1;
6878 BASE64_FAILURE_CONFIG = 2;
6879 BASE64_FAILURE_SIGNATURE = 3;
6880 SECURITY_EXCEPTION = 4;
6881 INVALID_CONFIG = 5;
6882 OLD_CONFIG = 6;
6883 SIGNATURE_CHECK_FAILED = 7;
6884 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006885 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006886 }
6887 optional Status status = 2;
6888
6889 // The version of the signed config processed.
6890 optional int32 version = 3;
6891
6892 // The package name that the config was extracted from.
6893 optional string from_package = 4;
6894
6895 enum Key {
6896 NO_KEY = 0;
6897 DEBUG = 1;
6898 PRODUCTION = 2;
6899 }
6900 // Which key was used to verify the config.
6901 optional Key verified_with = 5;
6902}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006903
6904/*
6905 * Logs GNSS Network-Initiated (NI) location events.
6906 *
6907 * Logged from:
6908 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6909 */
6910message GnssNiEventReported {
6911 // The type of GnssNiEvent.
6912 enum EventType {
6913 UNKNOWN = 0;
6914 NI_REQUEST = 1;
6915 NI_RESPONSE = 2;
6916 }
6917 optional EventType event_type = 1;
6918
6919 // An ID generated by HAL to associate NI notifications and UI responses.
6920 optional int32 notification_id = 2;
6921
6922 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006923 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006924
6925 // NI requires notification.
6926 optional bool need_notify = 4;
6927
6928 // NI requires verification.
6929 optional bool need_verify = 5;
6930
6931 // NI requires privacy override, no notification/minimal trace.
6932 optional bool privacy_override = 6;
6933
6934 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6935 // seconds.
6936 optional int32 timeout = 7;
6937
6938 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006939 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006940
6941 // String representing the requester of the network inititated location request.
6942 optional string requestor_id = 9;
6943
6944 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6945 // network initiated location request.
6946 optional string text = 10;
6947
6948 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006949 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006950
6951 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006952 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006953
6954 // True if SUPL ES is enabled.
6955 optional bool is_supl_es_enabled = 13;
6956
6957 // True if GNSS location is enabled.
6958 optional bool is_location_enabled = 14;
6959
6960 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006961 optional android.server.location.GnssUserResponseType user_response = 15;
6962}
6963
6964/**
6965 * Logs GNSS non-framework (NFW) location notification.
6966 *
6967 * Logged from:
6968 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6969 */
6970message GnssNfwNotificationReported {
6971 // Package name of the Android proxy application representing the non-framework entity that
6972 // requested location. Set to empty string if unknown.
6973 optional string proxy_app_package_name = 1;
6974
6975 // Protocol stack that initiated the non-framework location request.
6976 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6977
6978 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6979 // set to empty string. This field is opaque to the framework and used for logging purposes.
6980 optional string other_protocol_stack_name = 3;
6981
6982 // Source initiating/receiving the location information.
6983 optional android.server.location.NfwRequestor requestor = 4;
6984
6985 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6986 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6987 // and used for logging purposes.
6988 optional string requestor_id = 5;
6989
6990 // Indicates whether location information was provided for this request.
6991 optional android.server.location.NfwResponseType response_type = 6;
6992
6993 // True if the device is in user initiated emergency session.
6994 optional bool in_emergency_mode = 7;
6995
6996 // True if cached location is provided.
6997 optional bool is_cached_location = 8;
6998
6999 // True if proxy app permission mismatch between framework and GNSS HAL.
7000 optional bool is_permission_mismatched = 9;
7001}
7002
7003/**
7004 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7005 *
7006 * Logged from:
7007 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7008 */
7009message GnssConfigurationReported {
7010 // SUPL host name.
7011 optional string supl_host = 1;
7012
7013 // SUPL port number.
7014 optional int32 supl_port = 2;
7015
7016 // C2K host name.
7017 optional string c2k_host = 3;
7018
7019 // C2K port number.
7020 optional int32 c2k_port = 4;
7021
7022 // The SUPL version requested by Carrier.
7023 optional int32 supl_ver = 5;
7024
7025 // The SUPL mode.
7026 optional android.server.location.SuplMode supl_mode = 6;
7027
7028 // True if NI emergency SUPL restrictions is enabled.
7029 optional bool supl_es = 7;
7030
7031 // LTE Positioning Profile settings
7032 optional android.server.location.LppProfile lpp_profile = 8;
7033
7034 // Positioning protocol on A-Glonass system.
7035 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7036
7037 // True if emergency PDN is used. Otherwise, regular PDN is used.
7038 optional bool use_emergency_pdn_for_emergency_supl= 10;
7039
7040 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7041 optional android.server.location.GpsLock gps_lock = 11;
7042
7043 // Number of seconds to extend the emergency session duration post emergency call.
7044 optional int32 es_extension_sec = 12;
7045
7046 // The full list of package names of proxy Android applications representing the non-framework
7047 // location access entities (on/off the device) for which the framework user has granted
7048 // non-framework location access permission. The package names are concatenated in one string
7049 // with spaces as separators.
7050 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007051}
Jack Yu95b64f32018-12-13 18:26:11 +08007052
7053/**
7054 * Logs when a NFC device's error occurred.
7055 * Logged from:
7056 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7057 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7058 */
7059message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007060 enum Type {
7061 UNKNOWN = 0;
7062 CMD_TIMEOUT = 1;
7063 ERROR_NOTIFICATION = 2;
7064 AID_OVERFLOW = 3;
7065 }
7066 optional Type type = 1;
7067 // If it's nci cmd timeout, log the timeout command.
7068 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007069
Alex Salod7c3eef2019-01-25 14:43:27 -08007070 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007071}
7072
7073/**
7074 * Logs when a NFC device's state changed event
7075 * Logged from:
7076 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7077 */
7078message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007079 enum State {
7080 UNKNOWN = 0;
7081 OFF = 1;
7082 ON = 2;
7083 ON_LOCKED = 3; // Secure Nfc enabled.
7084 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7085 }
7086 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007087}
7088
7089/**
7090 * Logs when a NFC Beam Transaction occurred.
7091 * Logged from:
7092 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7093 */
7094message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007095 enum Operation {
7096 UNKNOWN = 0;
7097 SEND = 1;
7098 RECEIVE = 2;
7099 }
7100 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007101}
7102
7103/**
7104 * Logs when a NFC Card Emulation Transaction occurred.
7105 * Logged from:
7106 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7107 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7108 */
7109message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007110 enum Category {
7111 UNKNOWN = 0;
7112 HCE_PAYMENT = 1;
7113 HCE_OTHER = 2;
7114 OFFHOST = 3;
7115 }
7116 // Transaction belongs to HCE payment or HCE other category, or offhost.
7117 optional Category category = 1;
7118 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7119 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007120}
7121
7122/**
7123 * Logs when a NFC Tag event occurred.
7124 * Logged from:
7125 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7126 */
7127message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007128 enum Type {
7129 UNKNOWN = 0;
7130 URL = 1;
7131 BT_PAIRING = 2;
7132 PROVISION = 3;
7133 WIFI_CONNECT = 4;
7134 APP_LAUNCH = 5;
7135 OTHERS = 6;
7136 }
7137 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007138}
7139
7140/**
7141 * Logs when Hce transaction triggered
7142 * Logged from:
7143 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7144 */
7145message NfcHceTransactionOccurred {
7146 // The latency period(in microseconds) it took for the first HCE data
7147 // exchange.
7148 optional uint32 latency_micros = 1;
7149}
7150
7151/**
7152 * Logs when SecureElement state event changed
7153 * Logged from:
7154 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7155 */
7156message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007157 enum State {
7158 UNKNOWN = 0;
7159 INITIALIZED = 1;
7160 DISCONNECTED = 2;
7161 CONNECTED = 3;
7162 HALCRASH = 4;
7163 }
7164 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007165
Alex Salod7c3eef2019-01-25 14:43:27 -08007166 optional string state_change_reason = 2;
7167 // SIMx or eSEx.
7168 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007169}
7170
7171/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007172 * Information about a permission grant request
7173 */
7174message PermissionGrantRequestResultReported {
7175 // unique value identifying an API call. A API call might result in multiple of these atoms
7176 optional int64 request_id = 1;
7177
7178 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007179 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007180
7181 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007182 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007183
7184 // The permission to be granted
7185 optional string permission_name = 4;
7186
7187 // If the permission was explicitly requested via the API or added by the system
7188 optional bool is_implicit = 5;
7189
7190 enum Result {
7191 UNDEFINED = 0;
7192 // permission request was ignored
7193 IGNORED = 1;
7194 // permission request was ignored because it was user fixed
7195 IGNORED_USER_FIXED = 2;
7196 // permission request was ignored because it was policy fixed
7197 IGNORED_POLICY_FIXED = 3;
7198 // permission was granted by user action
7199 USER_GRANTED = 4;
7200 // permission was automatically granted
7201 AUTO_GRANTED = 5;
7202 // permission was denied by user action
7203 USER_DENIED = 6;
7204 // permission was denied with prejudice by the user
7205 USER_DENIED_WITH_PREJUDICE = 7;
7206 // permission was automatically denied
7207 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007208 // permission request was ignored because permission is restricted
7209 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007210 // one time permission was granted by user action
7211 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007212 // user ignored request by leaving the request screen without choosing any option
7213 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007214 // user granted the permission after being linked to settings
7215 USER_GRANTED_IN_SETTINGS = 12;
7216 // user denied the permission after being linked to settings
7217 USER_DENIED_IN_SETTINGS = 13;
7218 // user denied the permission with prejudice after being linked to settings
7219 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7220 // permission was automatically revoked after one-time permission expired
7221 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007222 // permission was automatically revoked for unused app
7223 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007224 }
7225 // The result of the permission grant
7226 optional Result result = 6;
7227}
7228
7229/**
Jack Yu95b64f32018-12-13 18:26:11 +08007230 * Logs when Omapi API used
7231 * Logged from:
7232 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7233 */
7234message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007235 enum Operation {
7236 UNKNOWN = 0;
7237 OPEN_CHANNEL = 1;
7238 }
7239 optional Operation operation = 1;
7240 // SIMx or eSEx.
7241 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007242
Alex Salod7c3eef2019-01-25 14:43:27 -08007243 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007244}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007245
7246/**
Alex Saloa060aee2019-01-21 14:36:41 -08007247 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7248 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007249 * Logged from:
7250 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7251 */
7252message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007253 optional int64 dispatch_latency_millis = 1;
7254}
7255
7256/**
7257 * Logs AttentionManagerService attention check result.
7258 *
7259 * Logged from:
7260 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7261 */
7262message AttentionManagerServiceResultReported {
7263 // See core/java/android/service/attention/AttentionService.java
7264 enum AttentionCheckResult {
7265 UNKNOWN = 20;
7266 ATTENTION_SUCCESS_ABSENT = 0;
7267 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007268 ATTENTION_FAILURE_UNKNOWN = 2;
7269 ATTENTION_FAILURE_CANCELLED = 3;
7270 ATTENTION_FAILURE_PREEMPTED = 4;
7271 ATTENTION_FAILURE_TIMED_OUT = 5;
7272 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007273 }
7274 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007275}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007276
7277/**
7278 * Logs when an adb connection changes state.
7279 *
7280 * Logged from:
7281 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7282 */
7283message AdbConnectionChanged {
7284 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7285 // previously selected for this system.
7286 optional int64 last_connection_time_millis = 1;
7287
7288 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7289 // to reconnect via adb without user interaction.
7290 optional int64 auth_window_millis = 2;
7291
7292 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7293 optional android.debug.AdbConnectionStateEnum state = 3;
7294
7295 // True if the 'always allow' option was selected for this system.
7296 optional bool always_allow = 4;
7297}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007298
7299/*
7300 * Logs the reported speech DSP status.
7301 *
7302 * Logged from:
7303 * Vendor audio implementation.
7304 */
7305message SpeechDspStatReported {
7306 // The total Speech DSP uptime in milliseconds.
7307 optional int32 total_uptime_millis = 1;
7308 // The total Speech DSP downtime in milliseconds.
7309 optional int32 total_downtime_millis = 2;
7310 optional int32 total_crash_count = 3;
7311 optional int32 total_recover_count = 4;
7312}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007313
7314/**
7315 * Logs USB connector contaminant status.
7316 *
7317 * Logged from: USB Service.
7318 */
7319message UsbContaminantReported {
7320 optional string id = 1;
7321 optional android.service.usb.ContaminantPresenceStatus status = 2;
7322}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007323
7324/**
7325 * This atom is for debugging purpose.
7326 */
7327message DebugElapsedClock {
7328 // Monotically increasing value for each pull.
7329 optional int64 pull_count = 1;
7330 // Time from System.elapsedRealtime.
7331 optional int64 elapsed_clock_millis = 2;
7332 // Time from System.elapsedRealtime.
7333 optional int64 same_elapsed_clock_millis = 3;
7334 // Diff between current elapsed time and elapsed time from previous pull.
7335 optional int64 elapsed_clock_diff_millis = 4;
7336
7337 enum Type {
7338 TYPE_UNKNOWN = 0;
7339 ALWAYS_PRESENT = 1;
7340 PRESENT_ON_ODD_PULLS = 2;
7341 }
7342 // Type of behavior for the pulled data.
7343 optional Type type = 5;
7344}
7345
7346/**
7347 * This atom is for debugging purpose.
7348 */
7349message DebugFailingElapsedClock {
7350 // Monotically increasing value for each pull.
7351 optional int64 pull_count = 1;
7352 // Time from System.elapsedRealtime.
7353 optional int64 elapsed_clock_millis = 2;
7354 // Time from System.elapsedRealtime.
7355 optional int64 same_elapsed_clock_millis = 3;
7356 // Diff between current elapsed time and elapsed time from previous pull.
7357 optional int64 elapsed_clock_diff_millis = 4;
7358}
Steven Wuacef6bb2019-01-23 14:21:17 -05007359
7360/** Logs System UI bubbles event changed.
7361 *
7362 * Logged from:
7363 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7364 */
7365message BubbleUIChanged {
7366
7367 // The app package that is posting the bubble.
7368 optional string package_name = 1;
7369
7370 // The notification channel that is posting the bubble.
7371 optional string notification_channel = 2;
7372
7373 // The notification id associated with the posted bubble.
7374 optional int32 notification_id = 3;
7375
7376 // The position of the bubble within the bubble stack.
7377 optional int32 position = 4;
7378
7379 // The total number of bubbles within the bubble stack.
7380 optional int32 total_number = 5;
7381
7382 // User interactions with the bubble.
7383 enum Action {
7384 UNKNOWN = 0;
7385 POSTED = 1;
7386 UPDATED = 2;
7387 EXPANDED = 3;
7388 COLLAPSED = 4;
7389 DISMISSED = 5;
7390 STACK_DISMISSED = 6;
7391 STACK_MOVED = 7;
7392 HEADER_GO_TO_APP = 8;
7393 HEADER_GO_TO_SETTINGS = 9;
7394 PERMISSION_OPT_IN = 10;
7395 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007396 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007397 SWIPE_LEFT = 13;
7398 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007399 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007400 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007401 }
7402 optional Action action = 6;
7403
7404 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7405 optional float normalized_x_position = 7;
7406 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007407
7408 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7409 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007410
7411 // Whether the bubble is an on-going one.
7412 optional bool is_ongoing = 10;
7413
7414 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007415 // This is deprecated and the value should be ignored.
7416 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007417}
Kweku Adams8845d012018-12-11 20:06:45 -08007418
7419/**
Steven Wu552f63f2019-02-05 13:41:36 -05007420 * Logs System UI bubbles developer errors.
7421 *
7422 * Logged from:
7423 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7424 */
7425message BubbleDeveloperErrorReported {
7426
7427 // The app package that is posting the bubble.
7428 optional string package_name = 1;
7429
7430 // Bubble developer error type enums.
7431 enum Error {
7432 UNKNOWN = 0;
7433 ACTIVITY_INFO_MISSING = 1;
7434 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7435 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7436 }
7437 optional Error error = 2 [default = UNKNOWN];
7438}
7439
7440/**
Kweku Adams8845d012018-12-11 20:06:45 -08007441 * Logs that a constraint for a scheduled job has changed.
7442 *
7443 * Logged from:
7444 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7445 */
7446message ScheduledJobConstraintChanged {
7447 repeated AttributionNode attribution_node = 1;
7448
7449 // Name of the job.
7450 optional string job_name = 2;
7451
7452 optional com.android.server.job.ConstraintEnum constraint = 3;
7453
7454 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007455 UNKNOWN = 0;
7456 UNSATISFIED = 1;
7457 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007458 }
7459 optional State state = 4;
7460}
Alex Salod7c3eef2019-01-25 14:43:27 -08007461
7462/**
7463 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7464 * returns true.
7465 *
7466 * Logged from:
7467 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7468 */
7469message ScreenTimeoutExtensionReported {
7470 // Describes how many times in a row did the power manager reset the screen off timeout.
7471 optional uint32 consecutive_timeout_extended_count = 1;
7472}
Hui Yu885aca12019-01-10 17:11:34 -08007473
7474/*
7475* Logs number of milliseconds it takes to start a process.
7476* The definition of app process start time is from the app launch time to
7477* the time that Zygote finished forking the app process and loaded the
7478* application package's java classes.
7479
7480* This metric is different from AppStartOccurred which is for foreground
7481* activity only.
7482
7483* ProcessStartTime can report all processes (both foreground and background)
7484* start time.
7485*
7486* Logged from:
7487* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7488*/
7489message ProcessStartTime {
7490 // The uid of the ProcessRecord.
7491 optional int32 uid = 1 [(is_uid) = true];
7492
7493 // The process pid.
7494 optional int32 pid = 2;
7495
7496 // The process name.
7497 // Usually package name, "system" for system server.
7498 // Provided by ActivityManagerService.
7499 optional string process_name = 3;
7500
7501 enum StartType {
7502 UNKNOWN = 0;
7503 WARM = 1;
7504 HOT = 2;
7505 COLD = 3;
7506 }
7507
7508 // The start type.
7509 optional StartType type = 4;
7510
7511 // The elapsed realtime at the start of the process.
7512 optional int64 process_start_time_millis = 5;
7513
7514 // Number of milliseconds it takes to reach bind application.
7515 optional int32 bind_application_delay_millis = 6;
7516
7517 // Number of milliseconds it takes to finish start of the process.
7518 optional int32 process_start_delay_millis = 7;
7519
7520 // hostingType field in ProcessRecord, the component type such as "activity",
7521 // "service", "content provider", "broadcast" or other strings.
7522 optional string hosting_type = 8;
7523
7524 // hostingNameStr field in ProcessRecord. The component class name that runs
7525 // in this process.
7526 optional string hosting_name = 9;
7527}
7528
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007529/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007530 * Track Media Codec usage
7531 * Logged from:
7532 * frameworks/av/media/libstagefright/MediaCodec.cpp
7533 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7534 */
7535message MediametricsCodecReported {
7536 optional int64 timestamp_nanos = 1;
7537 optional string package_name = 2;
7538 optional int64 package_version_code = 3;
7539 optional int64 media_apex_version = 4;
7540
7541 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7542}
7543
7544/**
7545 * Track Media Extractor (pulling video/audio streams out of containers) usage
7546 * Logged from:
7547 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7548 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7549 */
7550message MediametricsExtractorReported {
7551 optional int64 timestamp_nanos = 1;
7552 optional string package_name = 2;
7553 optional int64 package_version_code = 3;
7554 optional int64 media_apex_version = 4;
7555
7556 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7557}
7558
7559/**
7560 * Track how we arbitrate between microphone/input requests.
7561 * Logged from
7562 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7563 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7564 */
7565message MediametricsAudiopolicyReported {
7566 optional int64 timestamp_nanos = 1;
7567 optional string package_name = 2;
7568 optional int64 package_version_code = 3;
7569 optional int64 media_apex_version = 4;
7570
7571 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7572}
7573
7574/**
7575 * Track how we arbitrate between microphone requests.
7576 * Logged from
7577 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7578 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7579 */
7580message MediametricsAudiorecordReported {
7581 optional int64 timestamp_nanos = 1;
7582 optional string package_name = 2;
7583 optional int64 package_version_code = 3;
7584 optional int64 media_apex_version = 4;
7585
7586 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7587}
7588
7589/**
7590 * Track how we arbitrate between microphone/input requests.
7591 * Logged from
7592 * frameworks/av/media/libnblog/ReportPerformance.cpp
7593 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7594 */
7595message MediametricsAudiothreadReported {
7596 optional int64 timestamp_nanos = 1;
7597 optional string package_name = 2;
7598 optional int64 package_version_code = 3;
7599 optional int64 media_apex_version = 4;
7600
7601 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7602}
7603
7604/**
7605 * Track how we arbitrate between microphone/input requests.
7606 * Logged from
7607 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7608 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7609 */
7610message MediametricsAudiotrackReported {
7611 optional int64 timestamp_nanos = 1;
7612 optional string package_name = 2;
7613 optional int64 package_version_code = 3;
7614 optional int64 media_apex_version = 4;
7615
7616 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7617}
7618
7619/**
7620 * Track information about DRM framework performance
7621 * Logged from
7622 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7623 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7624 */
7625message MediametricsMediadrmReported {
7626 optional int64 timestamp_nanos = 1;
7627 optional string package_name = 2;
7628 optional int64 package_version_code = 3;
7629 optional int64 media_apex_version = 4;
7630
7631 // vendor+description tell about which DRM plugin is in use on this device
7632 optional string vendor = 5;
7633 optional string description = 6;
7634 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7635 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7636}
7637
7638/**
7639 * Track information about the widevine DRM plugin performance
7640 * Logged from
7641 * vendor/widevine/libwvdrmengine/cdm/metrics
7642 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7643 */
7644message MediametricsDrmWidevineReported {
7645 optional int64 timestamp_nanos = 1;
7646 optional string package_name = 2;
7647 optional int64 package_version_code = 3;
7648 optional int64 media_apex_version = 4;
7649
7650 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7651}
7652
7653/**
7654 * Track information about recordings (e.g. camcorder)
7655 * Logged from
7656 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7657 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7658 */
7659message MediametricsRecorderReported {
7660 optional int64 timestamp_nanos = 1;
7661 optional string package_name = 2;
7662 optional int64 package_version_code = 3;
7663 optional int64 media_apex_version = 4;
7664
7665 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7666}
7667
7668/**
7669 * Track Media Player usage
7670 * Logged from:
7671 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7672 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7673 */
7674message MediametricsNuPlayerReported {
7675 optional int64 timestamp_nanos = 1;
7676 optional string package_name = 2;
7677 optional int64 package_version_code = 3;
7678 optional int64 media_apex_version = 4;
7679
7680 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7681}
7682
7683/**
Robert Shiha4beed32019-08-19 14:15:23 -07007684 * Track Legacy DRM usage
7685 * Logged from
7686 * frameworks/av/drm/drmserver/DrmManager.cpp
7687 */
7688message MediametricsDrmManagerReported {
7689 optional int64 timestamp_nanos = 1;
7690 optional string package_name = 2;
7691 optional int64 package_version_code = 3;
7692 optional int64 media_apex_version = 4;
7693
7694 enum Method {
7695 METHOD_NOT_FOUND = -1;
7696 GET_CONSTRAINTS = 0;
7697 GET_METADATA = 1;
7698 CAN_HANDLE = 2;
7699 PROCESS_DRM_INFO = 3;
7700 ACQUIRE_DRM_INFO = 4;
7701 SAVE_RIGHTS = 5;
7702 GET_ORIGINAL_MIME_TYPE = 6;
7703 GET_DRM_OBJECT_TYPE = 7;
7704 CHECK_RIGHTS_STATUS = 8;
7705 REMOVE_RIGHTS = 9;
7706 REMOVE_ALL_RIGHTS = 10;
7707 OPEN_CONVERT_SESSION = 11;
7708 OPEN_DECRYPT_SESSION = 12;
7709 }
7710
7711 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7712 optional string plugin_id = 5;
7713 optional string description = 6;
7714 optional Method method = 7;
7715 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007716
7717 optional int64 get_constraints_count = 9;
7718 optional int64 get_metadata_count = 10;
7719 optional int64 can_handle_count = 11;
7720 optional int64 process_drm_info_count = 12;
7721 optional int64 acquire_drm_info_count = 13;
7722 optional int64 save_rights_count = 14;
7723 optional int64 get_original_mime_type_count = 15;
7724 optional int64 get_drm_object_type_count = 16;
7725 optional int64 check_rights_status_count = 17;
7726 optional int64 remove_rights_count = 18;
7727 optional int64 remove_all_rights_count = 19;
7728 optional int64 open_convert_session_count = 20;
7729 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007730}
7731
7732/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007733 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007734 * Pulled from: StatsCompanionService
7735*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007736message DangerousPermissionState {
7737 // Name of the permission
7738 optional string permission_name = 1;
7739
7740 // Uid of the package
7741 optional int32 uid = 2 [(is_uid) = true];
7742
7743 // Package requesting the permission
7744 optional string package_name = 3;
7745
7746 // If the permission is granted to the uid
7747 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007748
7749 // Permission flags as per android.content.pm.PermissionFlags
7750 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007751}
7752
Michael Groover4a0ca942019-01-24 17:41:25 -08007753/**
7754 * Logs when a package is denied access to a device identifier based on the new access requirements.
7755 *
7756 * Logged from:
7757 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7758 */
7759message DeviceIdentifierAccessDenied {
7760 // The name of the package denied access to the requested device identifier.
7761 optional string package_name = 1;
7762
7763 // The name of the device identifier method the package attempted to invoke.
7764 optional string method_name = 2;
7765
7766 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007767 // Starting from Android 11, this boolean is not set and will always be false.
7768 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007769
7770 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007771 // Starting from Android 11, this boolean is not set and will always be false.
7772 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007773}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007774
7775/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007776 * Pulls the ongoing mainline install train version code.
7777 * Pulled from StatsCompanionService
7778 */
7779message TrainInfo {
7780 optional int64 train_version_code = 1;
7781
7782 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007783
7784 optional string train_name = 3;
7785
7786 enum Status {
7787 UNKNOWN = 0;
7788 INSTALL_REQUESTED = 1;
7789 INSTALL_STARTED = 2;
7790 INSTALL_STAGED_NOT_READY = 3;
7791 INSTALL_STAGED_READY = 4;
7792 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007793 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7794 // and INSTALL_FAILURE_COMMIT.
7795 INSTALL_FAILURE = 6 [deprecated = true];
7796 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007797 INSTALL_CANCELLED = 7;
7798 INSTALLER_ROLLBACK_REQUESTED = 8;
7799 INSTALLER_ROLLBACK_INITIATED = 9;
7800 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7801 INSTALLER_ROLLBACK_STAGED = 11;
7802 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7803 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7804 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7805 INSTALLER_ROLLBACK_SUCCESS = 15;
7806 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007807 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7808 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7809 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7810 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7811 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7812 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007813 INSTALL_FAILURE_DOWNLOAD = 23;
7814 INSTALL_FAILURE_STATE_MISMATCH = 24;
7815 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007816 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007817 }
7818 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007819}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007820
7821/**
7822 * Logs the gesture stage changed event.
7823 *
7824 * Logged from:
7825 * frameworks/base/packages/SystemUI/
7826 */
7827message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007828 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007829}
7830
7831/**
7832 * Logs the feedback type.
7833 *
7834 * Logged from:
7835 * frameworks/base/packages/SystemUI/
7836 */
7837message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007838 // Whether or not the gesture was used.
7839 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007840}
7841
7842/**
7843 * Logs the progress.
7844 *
7845 * Logged from:
7846 * frameworks/base/packages/SystemUI/
7847 */
7848message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007849 // [0,100] progress for the assist gesture.
7850 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007851}
Neil Fullerdb14b482019-02-05 19:44:44 +00007852
7853/*
7854 * Information about the time zone data on a device.
7855 */
7856message TimeZoneDataInfo {
7857 // A version identifier for the data set on device. e.g. "2018i"
7858 optional string tzdb_version = 1;
7859}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007860
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007861/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007862 * Logs the GPU stats global health information.
7863 *
7864 * Logged from:
7865 * frameworks/native/services/gpuservice/gpustats/
7866 */
7867message GpuStatsGlobalInfo {
7868 // Package name of the gpu driver.
7869 optional string driver_package_name = 1;
7870
7871 // Version name of the gpu driver.
7872 optional string driver_version_name = 2;
7873
7874 // Version code of the gpu driver.
7875 optional int64 driver_version_code = 3;
7876
7877 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7878 optional int64 driver_build_time = 4;
7879
7880 // Total count of the gl driver gets loaded.
7881 optional int64 gl_loading_count = 5;
7882
7883 // Total count of the gl driver fails to be loaded.
7884 optional int64 gl_loading_failure_count = 6;
7885
7886 // Total count of the Vulkan driver gets loaded.
7887 optional int64 vk_loading_count = 7;
7888
7889 // Total count of the Vulkan driver fails to be loaded.
7890 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007891
7892 // Api version of the system Vulkan driver.
7893 optional int32 vulkan_version = 9;
7894
7895 // Api version of the system CPU Vulkan driver.
7896 optional int32 cpu_vulkan_version = 10;
7897
7898 // Api version of the system GLES driver.
7899 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007900
7901 // Total count of the angle driver gets loaded.
7902 optional int64 angle_loading_count = 12;
7903
7904 // Total count of the angle driver fails to be loaded.
7905 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007906}
7907
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007908/**
7909 * GPU driver loading time info.
7910 */
7911message GpuDriverLoadingTime {
7912 // List of all the driver loading times for this app. The list size is
7913 // capped at 50.
7914 repeated int64 driver_loading_time = 1;
7915}
7916
7917/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007918 * Logs the GPU stats per app health information.
7919 *
7920 * Logged from:
7921 * frameworks/native/services/gpuservice/gpustats/
7922 */
7923message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007924 // Package name of the application that loads the gpu driver. Total number
7925 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007926 optional string app_package_name = 1;
7927
7928 // Version code of the gpu driver this app loads.
7929 optional int64 driver_version_code = 2;
7930
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007931 // gl driver loading time info.
7932 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7933 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007934
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007935 // Vulkan driver loading time info.
7936 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7937 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007938
7939 // Angle driver loading time info.
7940 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7941 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007942
7943 // CPU Vulkan implementation is in use.
7944 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007945
7946 // App is not doing pre-rotation correctly.
7947 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007948
7949 // App creates GLESv1 context.
7950 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007951}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007952
7953/*
7954 * Logs the size of the system ion heap.
7955 *
7956 * Pulled from StatsCompanionService.
7957 */
7958message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007959 // Deprecated due to limited support of ion stats in debugfs.
7960 // Use `IonHeapSize` instead.
7961 option deprecated = true;
7962
Rafal Slawikd4e87572019-03-12 13:08:38 +00007963 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007964 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007965 optional int64 size_in_bytes = 1;
7966}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007967
Rafal Slawik77987ed2019-06-17 12:28:23 +01007968/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007969 * Logs the total size of the ion heap.
7970 *
7971 * Pulled from StatsCompanionService.
7972 */
7973message IonHeapSize {
7974 // Total size of all ion heaps in kilobytes.
7975 // Read from: /sys/kernel/ion/total_heaps_kb.
7976 optional int32 total_size_kb = 1;
7977}
7978
7979/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007980 * Logs the per-process size of the system ion heap.
7981 *
7982 * Pulled from StatsCompanionService.
7983 */
7984message ProcessSystemIonHeapSize {
7985 // The uid if available. -1 means not available.
7986 optional int32 uid = 1 [(is_uid) = true];
7987
7988 // The process name (from /proc/PID/cmdline).
7989 optional string process_name = 2;
7990
7991 // Sum of sizes of all allocations.
7992 optional int32 total_size_in_kilobytes = 3;
7993
7994 // Number of allocations.
7995 optional int32 allocation_count = 4;
7996
7997 // Size of the largest allocation.
7998 optional int32 max_size_in_kilobytes = 5;
7999}
8000
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008001/**
8002 * Push network stack events.
8003 *
8004 * Log from:
8005 * frameworks/base/packages/NetworkStack/
8006 */
8007message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008008 // The id that indicates the event reported from NetworkStack.
8009 optional int32 event_id = 1;
8010 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008011 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8012}
Carmen Agimofa769c152019-03-04 14:39:14 +00008013
8014/**
8015 * Logs the apps that are installed on the external storage.
8016 * Pulled from:
8017 * StatsCompanionService
8018 */
8019message AppsOnExternalStorageInfo {
8020 // The type of the external storage.
8021 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8022 // The name of the package that is installed on the external storage.
8023 optional string package_name = 2;
8024}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008025
8026/**
8027 * Logs the settings related to Face.
8028 * Logged from:
8029 * frameworks/base/services/core/java/com/android/server/stats
8030 */
8031message FaceSettings {
8032 // Whether or not face unlock is allowed on Keyguard.
8033 optional bool unlock_keyguard_enabled = 1;
8034 // Whether or not face unlock dismisses the Keyguard.
8035 optional bool unlock_dismisses_keyguard = 2;
8036 // Whether or not face unlock requires attention.
8037 optional bool unlock_attention_required = 3;
8038 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8039 optional bool unlock_app_enabled = 4;
8040 // Whether or not face unlock always requires user confirmation.
8041 optional bool unlock_always_require_confirmation = 5;
8042 // Whether or not a diverse set of poses are required during enrollment.
8043 optional bool unlock_diversity_required = 6;
8044}
Maggie White442b6312019-04-05 16:26:44 -07008045
8046/**
8047 * Logs cooling devices maintained by the kernel.
8048 *
8049 * Pulled from StatsCompanionService.java
8050 */
8051message CoolingDevice {
8052 // The type of cooling device being reported. Eg. CPU, GPU...
8053 optional android.os.CoolingTypeEnum device_location = 1;
8054 // The name of the cooling device source. Eg. CPU0
8055 optional string device_name = 2;
8056 // Current throttle state of the cooling device. The value can any unsigned
8057 // integer between 0 and max_state defined in its driver. 0 means device is
8058 // not in throttling, higher value means deeper throttling.
8059 optional int32 state = 3;
8060}
Ben Blount763a5d52019-04-10 11:48:58 -07008061
8062/**
8063 * Intelligence has several counter-type events that don't warrant a
8064 * full separate atom. These are primarily API call counters but also include
8065 * counters for feature usage and specific failure modes.
8066 *
8067 * Logged from the Intelligence mainline module.
8068 */
8069message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008070 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008071 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008072 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008073 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008074 // How many times the event occured (to report a batch of high frequency events).
8075 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008076 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008077 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008078}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008079
8080/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008081 * Logs when Car Power state changed.
8082 *
8083 * Logged from:
8084 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8085 */
8086message CarPowerStateChanged {
8087 // States come from CpmsState in CarPowerManagementService.java.
8088 enum State {
8089 WAIT_FOR_VHAL = 0;
8090 ON = 1;
8091 SHUTDOWN_PREPARE = 2;
8092 WAIT_FOR_FINISH = 3;
8093 SUSPEND = 4;
8094 SIMULATE_SLEEP = 5;
8095 }
8096 optional State state = 1;
8097}
8098
8099/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008100 * Logs when Car User Hal is requested to switch/create/remove user.
8101 *
8102 * Logged from:
8103 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8104 */
8105message CarUserHalModifyUserRequestReported {
8106 // Request id for the request.
8107 optional int32 request_id = 1;
8108 // Request type.
8109 enum RequestType {
8110 UNKNOWN = 0;
8111 // Car user manager requested user switch.
8112 SWITCH_REQUEST_ANDROID = 1;
8113 // OEM requested User switch.
8114 SWITCH_REQUEST_OEM = 2;
8115 // Hal switch requested after android switch using activity manager.
8116 SWITCH_REQUEST_LEGACY = 3;
8117 // Create User
8118 CREATE_REQUEST = 4;
8119 // Remove User
8120 REMOVE_REQUEST = 5;
8121 }
8122 optional RequestType request_type = 2;
8123 // Android User id of the current user which can only be 0, 10, 11 and so on.
8124 // -1 if not available.
8125 optional int32 user_id = 3;
8126 // VHAL flags of the current user. (-1 if not available)
8127 optional int32 user_flags = 4;
8128 // Android User id of the target user for switch/create/remove. It can only
8129 // be 0, 10, 11 and so on. -1 if not available.
8130 optional int32 target_user_id = 5;
8131 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8132 optional int32 target_user_flags = 6;
8133 // Request timeout Milliseconds (-1 if not available)
8134 optional int32 timeout_millis = 7;
8135}
8136
8137/**
8138 * Logs when Car User Hal responds to switch/create user request.
8139 *
8140 * Logged from:
8141 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8142 */
8143message CarUserHalModifyUserResponseReported {
8144 // Request id of the request associated with the response.
8145 optional int32 request_id = 1;
8146 // Car user hal callback status.
8147 enum CallbackStatus {
8148 UNKNOWN = 0;
8149 // Hal response was invalid.
8150 INVALID = 1;
8151 // Hal response was ok.
8152 OK = 2;
8153 // Hal timeout during set call.
8154 HAL_SET_TIMEOUT = 3;
8155 // Hal response timeout.
8156 HAL_RESPONSE_TIMEOUT = 4;
8157 // Hal responded with wrong info.
8158 WRONG_HAL_RESPONSE = 5;
8159 // Hal is processing multiple requests simultaneously.
8160 CONCURRENT_OPERATION = 6;
8161 }
8162 optional CallbackStatus callback_status = 2;
8163
8164 // Hal request status for user switch/create/remove.
8165 enum HalRequestStatus {
8166 UNSPECIFIED = 0;
8167 // Hal request for user switch/create is successful.
8168 SUCCESS = 1;
8169 // Hal request for user switch/create failed.
8170 FAILURE = 2;
8171 }
8172 optional HalRequestStatus request_status = 3;
8173}
8174
8175/**
8176 * Logs when post switch response is posted to Car User Hal.
8177 *
8178 * Logged from:
8179 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8180 */
8181message CarUserHalPostSwitchResponseReported {
8182 // Request id.
8183 optional int32 request_id = 1;
8184
8185 // Android user switch status.
8186 enum UserSwitchStatus {
8187 UNKNOWN = 0;
8188 // Android user switch is successful.
8189 SUCCESS = 1;
8190 // Android user switch failed.
8191 FAILURE = 2;
8192 }
8193 optional UserSwitchStatus switch_status = 2;
8194}
8195
8196/**
8197 * Logs when initial user information is requested from Car User Hal.
8198 *
8199 * Logged from:
8200 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8201 */
8202message CarUserHalInitialUserInfoRequestReported {
8203 // Request id for the request.
8204 optional int32 request_id = 1;
8205
8206 // Request type for initial user information.
8207 enum InitialUserInfoRequestType {
8208 UNKNOWN = 0;
8209 // At the first time Android was booted (or after a factory reset).
8210 FIRST_BOOT = 1;
8211 // At the first time Android was booted after the system was updated.
8212 FIRST_BOOT_AFTER_OTA = 2;
8213 // When Android was booted "from scratch".
8214 COLD_BOOT = 3;
8215 // When Android was resumed after the system was suspended to memory.
8216 RESUME = 4;
8217 }
8218 optional InitialUserInfoRequestType request_type = 2;
8219 // Request timeout Milliseconds (-1 if not available)
8220 optional int32 timeout_millis = 3;
8221}
8222
8223/**
8224 * Logs when Car User Hal responds to initial user information requests.
8225 *
8226 * Logged from:
8227 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8228 */
8229message CarUserHalInitialUserInfoResponseReported {
8230 // Request id of the request associated with the response.
8231 optional int32 request_id = 1;
8232 // Car user hal callback status.
8233 enum CallbackStatus {
8234 UNKNOWN = 0;
8235 // Hal response was invalid.
8236 INVALID = 1;
8237 // Hal response was ok.
8238 OK = 2;
8239 // Hal timeout during set call.
8240 HAL_SET_TIMEOUT = 3;
8241 // Hal response timeout.
8242 HAL_RESPONSE_TIMEOUT = 4;
8243 // Hal responded with wrong info.
8244 WRONG_HAL_RESPONSE = 5;
8245 // Hal is processing multiple requests simultaneously.
8246 CONCURRENT_OPERATION = 6;
8247 }
8248 optional CallbackStatus callback_status = 2;
8249 // Response for initial user information request.
8250 enum InitialUserInfoResponseAction {
8251 UNSPECIFIED = 0;
8252 // Let the Android System decide what to do.
8253 DEFAULT = 1;
8254 // Switch to an existing Android user.
8255 SWITCH = 2;
8256 // Create a new Android user (and switch to it).
8257 CREATE = 3;
8258 }
8259 optional InitialUserInfoResponseAction response_action = 3;
8260 // Android User id of the target user which can only be 0, 10, 11 and so on.
8261 // -1 if not available.
8262 optional int32 target_user = 4;
8263 // VHAL flags of the current user. (-1 if not available)
8264 optional int32 target_user_flags = 5;
8265 // User locales
8266 optional string user_locales = 6;
8267}
8268
8269/**
8270 * Logs when set user association is requested from Car User Hal.
8271 *
8272 * Logged from:
8273 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8274 */
8275message CarUserHalUserAssociationRequestReported {
8276 // Request id for the request.
8277 optional int32 request_id = 1;
8278 // Request type.
8279 enum RequestType {
8280 UNKNOWN = 0;
8281 // For setting user association information.
8282 SET = 1;
8283 // For getting user association information.
8284 GET = 2;
8285 }
8286 optional RequestType request_type = 2;
8287 // Android User id of the current user which can only be 0, 10, 11 and so on.
8288 // -1 if not available.
8289 optional int32 current_user_id = 3;
8290 // VHAL flags of the current user. (-1 if not available)
8291 optional int32 current_user_flags = 4;
8292 // Number of the set associations requested.
8293 optional int32 number_associations = 5;
8294 // Concatenated string for the types from set associations request.
8295 // This is a string converted from an array of integers.
8296 optional string user_identification_association_types = 6;
8297 // Concatenated string for the values from set associations request.
8298 // This is a string converted from an array of integers.
8299 optional string user_identification_association_values = 7;
8300}
8301
8302/**
8303 * Logs when Car User Hal responds to set user association requests.
8304 *
8305 * Logged from:
8306 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8307 */
8308message CarUserHalSetUserAssociationResponseReported {
8309 // Request id of the request associated with the response.
8310 optional int32 request_id = 1;
8311 // Car user hal callback status.
8312 enum CallbackStatus {
8313 UNKNOWN = 0;
8314 // Hal response was invalid.
8315 INVALID = 1;
8316 // Hal response was ok.
8317 OK = 2;
8318 // Hal timeout during set call.
8319 HAL_SET_TIMEOUT = 3;
8320 // Hal response timeout.
8321 HAL_RESPONSE_TIMEOUT = 4;
8322 // Hal responded with wrong info.
8323 WRONG_HAL_RESPONSE = 5;
8324 // Hal is processing multiple requests simultaneously.
8325 CONCURRENT_OPERATION = 6;
8326 }
8327 optional CallbackStatus callback_status = 2;
8328 // Number of the set associations in the response.
8329 optional int32 number_associations = 3;
8330 // Concatenated string for the types from set associations request.
8331 // This is a string converted from an array of integers.
8332 optional string user_identification_association_types = 4;
8333 // Concatenated string for the values from set associations request.
8334 // This is a string converted from an array of integers.
8335 optional string user_identification_association_values = 5;
8336}
8337
8338/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008339 * Logs whether GarageMode is entered.
8340 *
8341 * Logged from:
8342 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8343 */
8344message GarageModeInfo {
8345 // Whether GarageMode is entered.
8346 optional bool is_garage_mode = 1;
8347}
Martijn Coenencd95d462019-04-25 17:09:45 +02008348
8349/**
8350 * Historical app ops data per package.
8351 */
8352message AppOps {
8353 // Uid of the package requesting the op
8354 optional int32 uid = 1 [(is_uid) = true];
8355
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008356 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008357 optional string package_name = 2;
8358
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008359 // operation id
8360 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008361
8362 // The number of times the op was granted while the app was in the
8363 // foreground (only for trusted requests)
8364 optional int64 trusted_foreground_granted_count = 4;
8365
8366 // The number of times the op was granted while the app was in the
8367 // background (only for trusted requests)
8368 optional int64 trusted_background_granted_count = 5;
8369
8370 // The number of times the op was rejected while the app was in the
8371 // foreground (only for trusted requests)
8372 optional int64 trusted_foreground_rejected_count = 6;
8373
8374 // The number of times the op was rejected while the app was in the
8375 // background (only for trusted requests)
8376 optional int64 trusted_background_rejected_count = 7;
8377
8378 // For long-running operations, total duration of the operation
8379 // while the app was in the foreground (only for trusted requests)
8380 optional int64 trusted_foreground_duration_millis = 8;
8381
8382 // For long-running operations, total duration of the operation
8383 // while the app was in the background (only for trusted requests)
8384 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008385
8386 // Whether AppOps is guarded by Runtime permission
8387 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008388}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008389
8390/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008391 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008392 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008393message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008394 // Uid of the package requesting the op
8395 optional int32 uid = 1 [(is_uid) = true];
8396
8397 // Name of the package performing the op
8398 optional string package_name = 2;
8399
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008400 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8401 // Attributions must be provided through manifest using <attribution> tag available in R and
8402 // above.
8403 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008404
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008405 // operation id
8406 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008407
8408 // The number of times the op was granted while the app was in the
8409 // foreground (only for trusted requests)
8410 optional int64 trusted_foreground_granted_count = 5;
8411
8412 // The number of times the op was granted while the app was in the
8413 // background (only for trusted requests)
8414 optional int64 trusted_background_granted_count = 6;
8415
8416 // The number of times the op was rejected while the app was in the
8417 // foreground (only for trusted requests)
8418 optional int64 trusted_foreground_rejected_count = 7;
8419
8420 // The number of times the op was rejected while the app was in the
8421 // background (only for trusted requests)
8422 optional int64 trusted_background_rejected_count = 8;
8423
8424 // For long-running operations, total duration of the operation
8425 // while the app was in the foreground (only for trusted requests)
8426 optional int64 trusted_foreground_duration_millis = 9;
8427
8428 // For long-running operations, total duration of the operation
8429 // while the app was in the background (only for trusted requests)
8430 optional int64 trusted_background_duration_millis = 10;
8431
8432 // Whether AppOps is guarded by Runtime permission
8433 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008434
8435 // Sampling rate used on device, from 0 to 100
8436 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008437}
8438
8439/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008440 * Location Manager API Usage information(e.g. API under usage,
8441 * API call's parameters).
8442 * Logged from:
8443 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8444 */
8445message LocationManagerApiUsageReported {
8446
8447 // Indicating if usage starts or usage ends.
8448 optional android.stats.location.UsageState state = 1;
8449
8450 // LocationManagerService's API in use.
8451 // We can identify which API from LocationManager is
8452 // invoking current LMS API by the combination of
8453 // API parameter(e.g. is_listener_null, is_intent_null,
8454 // is_location_request_null)
8455 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8456
8457 // Name of the package calling the API.
8458 optional string calling_package_name = 3;
8459
8460 // Type of the location provider.
8461 optional android.stats.location.ProviderType provider = 4;
8462
8463 // Quality of the location request
8464 optional android.stats.location.LocationRequestQuality quality = 5;
8465
8466 // The desired interval for active location updates, in milliseconds.
8467 // Bucketized to reduce cardinality.
8468 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8469
8470 // Minimum distance between location updates, in meters.
8471 // Bucketized to reduce cardinality.
8472 optional android.stats.location.SmallestDisplacementBucket
8473 bucketized_smallest_displacement = 7;
8474
8475 // The number of location updates.
8476 optional int64 num_updates = 8;
8477
8478 // The request expiration time, in millisecond since boot.
8479 // Bucketized to reduce cardinality.
8480 optional android.stats.location.ExpirationBucket
8481 bucketized_expire_in = 9;
8482
8483 // Type of Callback passed in for this API.
8484 optional android.stats.location.CallbackType callback_type = 10;
8485
8486 // The radius of the central point of the alert
8487 // region, in meters. Only for API REQUEST_GEOFENCE.
8488 // Bucketized to reduce cardinality.
8489 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8490
8491 // Activity Importance of API caller.
8492 // Categorized to 3 types that are interesting from location's perspective.
8493 optional android.stats.location.ActivityImportance activiy_importance = 12;
8494}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008495
8496/**
8497 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8498 */
8499message ReviewPermissionsFragmentResultReported {
8500 // unique value identifying a permission group change. A permission group change might result
8501 // in multiple of these atoms
8502 optional int64 change_id = 1;
8503
8504 // UID of package the permission belongs to
8505 optional int32 uid = 2 [(is_uid) = true];
8506
8507 // Name of package the permission belongs to
8508 optional string package_name = 3;
8509
8510 // The permission to be granted
8511 optional string permission_name = 4;
8512
8513 // The result of the permission grant
8514 optional bool permission_granted = 5;
8515}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008516
8517/**
8518* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8519* Logged from: RuntimePermissionUpdgradeController
8520*/
8521message RuntimePermissionsUpgradeResult {
8522 // Permission granted as result of upgrade
8523 optional string permission_name = 1;
8524
8525 // UID of package granted permission
8526 optional int32 uid = 2 [(is_uid) = true];
8527
8528 // Name of package granted permission
8529 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008530}
8531
8532/**
8533* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8534*/
8535message GrantPermissionsActivityButtonActions {
8536 // Permission granted as result of upgrade
8537 optional string permission_group_name = 1;
8538
8539 // UID of package granted permission
8540 optional int32 uid = 2 [(is_uid) = true];
8541
8542 // Name of package requesting permission
8543 optional string package_name = 3;
8544
8545 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8546 // LABEL_ constants in GrantPermissionActivity.java
8547 optional int32 buttons_presented = 4;
8548
8549 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8550 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008551
8552 // id which identifies single session of user interacting with permission controller
8553 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008554}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008555
8556/**
8557 * Information about LocationAccessCheck notification presented to user
8558 */
8559message LocationAccessCheckNotificationAction {
8560
8561 // id which identifies single session of user interacting with permission controller
8562 optional int64 session_id = 1;
8563
8564 // Uid of package for which location access check is presented
8565 optional int32 package_uid = 2;
8566
8567 // Name of package for which location access check is presented
8568 optional string package_name = 3;
8569
8570 enum Result {
8571 UNDEFINED = 0;
8572 // notification was presented to the user
8573 NOTIFICATION_PRESENTED = 1;
8574 // notification was declined by the user
8575 NOTIFICATION_DECLINED = 2;
8576 // notification was clicked by the user
8577 NOTIFICATION_CLICKED = 3;
8578 }
8579
8580 // View / interaction recorded
8581 optional Result result = 4;
8582}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008583
8584/**
8585 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8586 */
8587message AppPermissionFragmentActionReported {
8588 // id which identifies single session of user interacting with permission controller
8589 optional int64 session_id = 1;
8590
8591 // unique value identifying a permission group change. A permission group change might result
8592 // in multiple of these atoms
8593 optional int64 change_id = 2;
8594
8595 // UID of package the permission belongs to
8596 optional int32 uid = 3 [(is_uid) = true];
8597
8598 // Name of package the permission belongs to
8599 optional string package_name = 4;
8600
8601 // The permission to be granted
8602 optional string permission_name = 5;
8603
8604 // The result of the permission grant
8605 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008606
8607 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8608 optional int32 permission_flags = 7;
8609
8610 enum Button {
8611 UNDEFINED = 0;
8612 // Allow button
8613 ALLOW = 1;
8614 // Deny button
8615 DENY = 2;
8616 // Ask every time button
8617 ASK_EVERY_TIME = 3;
8618 // Allow all the time button
8619 ALLOW_ALWAYS = 4;
8620 // Allow only while using the app button
8621 ALLOW_FOREGROUND = 5;
8622 // Same is Deny button but shown in while in use dialog
8623 DENY_FOREGROUND = 6;
8624 }
8625
8626 // Button pressed in the dialog
8627 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008628}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008629
8630/**
8631* Information about a AppPermissionFragment viewed by user
8632*/
8633message AppPermissionFragmentViewed {
8634 // id which identifies single session of user interacting with permission controller
8635 optional int64 session_id = 1;
8636
8637 // UID of package for which permissions are viewed
8638 optional int32 uid = 2 [(is_uid) = true];
8639
8640 // Name of package for which permissions are viewed
8641 optional string package_name = 3;
8642
8643 // Permission group viewed
8644 optional string permission_group_name = 4;
8645}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008646
8647/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008648* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8649* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008650*/
8651message AppPermissionsFragmentViewed {
8652 // id which identifies single session of user interacting with permission controller
8653 optional int64 session_id = 1;
8654
8655 // id which identifies single view as every view might have several logging records
8656 // with different package information attached
8657 optional int64 view_id = 2;
8658
8659 // Permission group viewed
8660 optional string permission_group_name = 3;
8661
8662 // UID of package for which permissions are viewed
8663 optional int32 uid = 4 [(is_uid) = true];
8664
8665 // Name of package for which permissions are viewed
8666 optional string package_name = 5;
8667
8668 // Category in which permission is included
8669 enum Category {
8670 UNDEFINED = 0;
8671 ALLOWED = 1;
8672 ALLOWED_FOREGROUND = 2;
8673 DENIED = 3;
8674 }
8675 optional Category category = 6;
8676}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008677/**
8678* Information about a PermissionAppsFragment viewed by user.
8679* Logged from ui/handheld/PermissionAppsFragment.java
8680*/
8681message PermissionAppsFragmentViewed {
8682 // id which identifies single session of user interacting with permission controller
8683 optional int64 session_id = 1;
8684
8685 // id which identifies single view as every view might have several logging records
8686 // with different package information attached
8687 optional int64 view_id = 2;
8688
8689 // Permission group viewed
8690 optional string permission_group_name = 3;
8691
8692 // UID of package for which permissions are viewed
8693 optional int32 uid = 4 [(is_uid) = true];
8694
8695 // Name of package for which permissions are viewed
8696 optional string package_name = 5;
8697
8698 // Category in which app is included
8699 enum Category {
8700 UNDEFINED = 0;
8701 ALLOWED = 1;
8702 ALLOWED_FOREGROUND = 2;
8703 DENIED = 3;
8704 }
8705 optional Category category = 6;
8706}
Tony Make2b1b672019-07-29 16:59:47 +01008707
8708/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008709* Log that the Auto Revoke notification has been clicked
8710* Logged from ui/ManagePermissionsActivity
8711*/
8712message AutoRevokeNotificationClicked {
8713 // id which identifies single session of user interacting with permission controller
8714 optional int64 session_id = 1;
8715}
8716
8717/**
8718* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8719* auto revoked for it.
8720* Logged from ui/handheld/AutoRevokeFragment
8721*/
8722message AutoRevokeFragmentAppViewed {
8723 // id which identifies single session of user interacting with permission controller
8724 optional int64 session_id = 1;
8725
8726 // UID of package for which permissions are viewed
8727 optional int32 uid = 2 [(is_uid) = true];
8728
8729 // Name of package for which permissions are viewed
8730 optional string package_name = 3;
8731
8732 // The name of a permission group that has been revoked
8733 optional string permission_group_name = 4;
8734
8735 // The age of the app- more than three months old, or more than six months
8736 enum Age {
8737 UNDEFINED = 0;
8738 NEWER_BUCKET = 1;
8739 OLDER_BUCKET = 2;
8740 }
8741
8742 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8743 optional Age age = 5;
8744}
8745
8746/**
8747* Log that the user has interacted with an app on the auto revoke fragment
8748* Logged from ui/handheld/AutoRevokeFragment
8749*/
8750message AutoRevokedAppInteraction {
8751 // id which identifies single session of user interacting with permission controller
8752 optional int64 session_id = 1;
8753
8754 // UID of package for which permissions are viewed
8755 optional int32 uid = 2 [(is_uid) = true];
8756
8757 // Name of package for which permissions are viewed
8758 optional string package_name = 3;
8759
8760 enum Action {
8761 UNDEFINED = 0;
8762 REMOVE = 1;
8763 OPEN = 2;
8764 APP_INFO = 3;
8765 PERMISSIONS = 4;
8766 REMOVE_IN_SETTINGS = 5;
8767 OPEN_IN_SETTINGS = 6;
8768 }
8769
8770 // The action the user took to interact with the app
8771 optional Action action = 4;
8772}
8773
8774/**
8775* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8776* auto revoke, or that the auto revoke switch has been changed
8777* Logged from ui/handheld/AppPermissionGroupsFragment
8778 */
8779message AppPermissionGroupsFragmentAutoRevokeAction {
8780 // id which identifies single session of user interacting with permission controller
8781 optional int64 session_id = 1;
8782
8783 // UID of package for which permissions are viewed
8784 optional int32 uid = 2 [(is_uid) = true];
8785
8786 // Name of package for which permissions are viewed
8787 optional string package_name = 3;
8788
8789 enum Action {
8790 UNDEFINED = 0;
8791 OPENED_FOR_AUTO_REVOKE = 1;
8792 OPENED_FROM_INTENT = 2;
8793 SWITCH_ENABLED = 3;
8794 SWITCH_DISABLED = 4;
8795 }
8796
8797 // The action the user took to interact with the fragment
8798 optional Action action = 4;
8799}
8800
8801/**
Tony Make2b1b672019-07-29 16:59:47 +01008802 * Logs when there is a smart selection related event.
8803 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8804 * Logged from: TextClassifierEventLogger.java
8805 */
8806message TextSelectionEvent {
8807 // A session ID.
8808 optional string session_id = 1;
8809
8810 // Event type of this event.
8811 optional android.stats.textclassifier.EventType event_type = 2;
8812
Tony Mak9c84bd22019-12-09 07:27:25 +00008813 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008814 optional string model_name = 3;
8815
8816 // Type of widget that was involved in triggering this event.
8817 optional android.stats.textclassifier.WidgetType widget_type = 4;
8818
8819 // Index of this event in a session.
8820 optional int32 event_index = 5;
8821
8822 // Entity type that is involved.
8823 optional string entity_type = 6;
8824
8825 // Relative word index of the start of the selection.
8826 optional int32 relative_word_start_index = 7;
8827
8828 // Relative word (exclusive) index of the end of the selection.
8829 optional int32 relative_word_end_index = 8;
8830
8831 // Relative word index of the start of the smart selection.
8832 optional int32 relative_suggested_word_start_index = 9;
8833
8834 // Relative word (exclusive) index of the end of the smart selection.
8835 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008836
8837 // Name of source package.
8838 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008839
8840 // Name of the LangID model that is involved in this event.
8841 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008842}
8843
8844/**
8845 * Logs when there is a smart linkify related event.
8846 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8847 * Logged from: TextClassifierEventLogger.java
8848 */
8849message TextLinkifyEvent {
8850 // A session ID.
8851 optional string session_id = 1;
8852
8853 // Event type of this event.
8854 optional android.stats.textclassifier.EventType event_type = 2;
8855
Tony Mak9c84bd22019-12-09 07:27:25 +00008856 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008857 optional string model_name = 3;
8858
8859 // Type of widget that was involved in triggering this event.
8860 optional android.stats.textclassifier.WidgetType widget_type = 4;
8861
8862 // Index of this event in a session.
8863 optional int32 event_index = 5;
8864
8865 // Entity type that is involved.
8866 optional string entity_type = 6;
8867
8868 // Number of links detected.
8869 optional int32 num_links = 7;
8870
8871 // The total length of all links.
8872 optional int32 linked_text_length = 8;
8873
8874 // Length of input text.
8875 optional int32 text_length = 9;
8876
8877 // Time spent on generating links in ms.
8878 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008879
8880 // Name of source package.
8881 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008882
8883 // Name of the LangID model that is involved in this event.
8884 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008885}
8886
8887/**
8888 * Logs when there is a conversation actions related event.
8889 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8890 * Logged from: TextClassifierEventLogger.java
8891 */
8892message ConversationActionsEvent {
8893 // A session ID.
8894 optional string session_id = 1;
8895
8896 // Event type of this event.
8897 optional android.stats.textclassifier.EventType event_type = 2;
8898
Tony Mak9c84bd22019-12-09 07:27:25 +00008899 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008900 optional string model_name = 3;
8901
8902 // Type of widget that was involved in triggering this event.
8903 optional android.stats.textclassifier.WidgetType widget_type = 4;
8904
8905 // The first entity type that is involved.
8906 optional string first_entity_type = 5;
8907
8908 // The second entity type that is involved.
8909 optional string second_entity_type = 6;
8910
8911 // The third entity type that is involved.
8912 optional string third_entity_type = 7;
8913
8914 // The score of the first entity type.
8915 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008916
8917 // Name of source package.
8918 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008919
8920 // Name of the annotator model that is involved in this event.
8921 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008922
8923 // Name of the LangID model that is involved in this event.
8924 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008925}
8926
8927/**
8928 * Logs when there is a language detection related event.
8929 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8930 * Logged from: TextClassifierEventLogger.java
8931 */
8932message LanguageDetectionEvent {
8933 // A session ID.
8934 optional string session_id = 1;
8935
8936 // Event type of this event.
8937 optional android.stats.textclassifier.EventType event_type = 2;
8938
Tony Mak9c84bd22019-12-09 07:27:25 +00008939 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008940 optional string model_name = 3;
8941
8942 // Type of widget that was involved in triggering this event.
8943 optional android.stats.textclassifier.WidgetType widget_type = 4;
8944
8945 // Detected language.
8946 optional string language_tag = 5;
8947
8948 // Score of the detected language.
8949 optional float score = 6;
8950
8951 // Position of this action.
8952 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008953
8954 // Name of source package.
8955 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008956}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008957
8958/**
8959 * Information about an OTA update attempt by update_engine.
8960 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8961 */
8962message UpdateEngineUpdateAttemptReported {
8963 // The number of attempts for the update engine to apply a given payload.
8964 optional int32 attempt_number = 1;
8965
8966 optional android.stats.otaupdate.PayloadType payload_type = 2;
8967
8968 // The total time in minutes for the update engine to apply a given payload.
8969 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8970 // it's increased when the system is sleeping.
8971 optional int32 duration_boottime_in_minutes = 3;
8972
8973 // The total time in minutes for the update engine to apply a given payload.
8974 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8975 // and it's not increased when the system is sleeping.
8976 optional int32 duration_monotonic_in_minutes = 4;
8977
8978 // The size of the payload in MiBs.
8979 optional int32 payload_size_mib = 5;
8980
8981 // The attempt result reported by the update engine for an OTA update.
8982 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8983
8984 // The error code reported by the update engine after an OTA update attempt
8985 // on A/B devices.
8986 optional android.stats.otaupdate.ErrorCode error_code = 7;
8987
8988 // The build fingerprint of the source system. The value is read from a
8989 // system property when the device takes the update. e.g.
8990 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8991 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008992
8993 // Size of super partition.
8994 optional int64 super_partition_size_bytes = 9;
8995
8996 // Size of current slot within the super partition.
8997 optional int64 slot_size_bytes = 10;
8998
8999 // Free space available in the super partition.
9000 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009001}
9002
9003/**
9004 * Information about all the attempts the device make before finishing the
9005 * successful update.
9006 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9007 */
9008message UpdateEngineSuccessfulUpdateReported {
9009 // The number of attempts for the update engine to apply the payload for a
9010 // successful update.
9011 optional int32 attempt_count = 1;
9012
9013 optional android.stats.otaupdate.PayloadType payload_type = 2;
9014
9015 optional int32 payload_size_mib = 3;
9016
9017 // The total number of bytes downloaded by update_engine since the last
9018 // successful update.
9019 optional int32 total_bytes_downloaded_mib = 4;
9020
9021 // The ratio in percentage of the over-downloaded bytes compared to the
9022 // total bytes needed to successfully install the update. e.g. 200 if we
9023 // download 200MiB in total for a 100MiB package.
9024 optional int32 download_overhead_percentage = 5;
9025
9026 // The total time in minutes for the update engine to apply the payload for a
9027 // successful update.
9028 optional int32 total_duration_minutes = 6;
9029
9030 // The number of reboot of the device during a successful update.
9031 optional int32 reboot_count = 7;
9032}
Alec Mourie088e762019-07-02 13:10:55 -07009033
9034/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009035 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9036 * key to indicate whether it was successful or not.
9037 *
9038 * Logged from:
9039 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9040 */
9041message RebootEscrowRecoveryReported {
9042 optional bool successful = 1;
9043}
9044
9045/**
Alec Mourie088e762019-07-02 13:10:55 -07009046 * Global display pipeline metrics reported by SurfaceFlinger.
9047 * Pulled from:
9048 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9049 */
9050message SurfaceflingerStatsGlobalInfo {
9051 // Total number of frames presented during the tracing period
9052 optional int64 total_frames = 1;
9053 // Total number of frames missed
9054 optional int64 missed_frames = 2;
9055 // Total number of frames that fell back to client composition
9056 optional int64 client_composition_frames = 3;
9057 // Total time the display was turned on
9058 optional int64 display_on_millis = 4;
9059 // Total time that was spent performing animations.
9060 // This is derived from the present-to-present layer histogram
9061 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009062 // Total number of event connections tracked by SurfaceFlinger at the time
9063 // of this pull. If this number grows prohibitively large, then this can
9064 // cause jank due to resource contention.
9065 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009066 // Set of timings measured from when SurfaceFlinger began compositing a
9067 // frame, until the frame was requested to be presented to the display. This
9068 // measures SurfaceFlinger's total CPU walltime on the critical path per
9069 // frame.
9070 optional FrameTimingHistogram frame_duration = 7
9071 [(android.os.statsd.log_mode) = MODE_BYTES];
9072 // Set of timings measured from when SurfaceFlinger first began using the
9073 // GPU to composite a frame, until the GPU has finished compositing that
9074 // frame. This measures the total additional time SurfaceFlinger needed to
9075 // perform due to falling back into GPU composition.
9076 optional FrameTimingHistogram render_engine_timing = 8
9077 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009078}
9079
9080/**
9081 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9082 * The number of layers uploaded will be restricted due to size limitations.
9083 * Pulled from:
9084 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9085 */
9086message SurfaceflingerStatsLayerInfo {
9087 // The layer for this set of metrics
9088 // For now we can infer that the package name is included in the layer
9089 // name.
9090 optional string layer_name = 1;
9091 // Total number of frames presented
9092 optional int64 total_frames = 2;
9093 // Total number of dropped frames while latching a buffer for this layer.
9094 optional int64 dropped_frames = 3;
9095 // Set of timings measured between successive presentation timestamps.
9096 optional FrameTimingHistogram present_to_present = 4
9097 [(android.os.statsd.log_mode) = MODE_BYTES];
9098 // Set of timings measured from when an app queued a buffer for
9099 // presentation, until the buffer was actually presented to the
9100 // display.
9101 optional FrameTimingHistogram post_to_present = 5
9102 [(android.os.statsd.log_mode) = MODE_BYTES];
9103 // Set of timings measured from when a buffer is ready to be presented,
9104 // until the buffer was actually presented to the display.
9105 optional FrameTimingHistogram acquire_to_present = 6
9106 [(android.os.statsd.log_mode) = MODE_BYTES];
9107 // Set of timings measured from when a buffer was latched by
9108 // SurfaceFlinger, until the buffer was presented to the display
9109 optional FrameTimingHistogram latch_to_present = 7
9110 [(android.os.statsd.log_mode) = MODE_BYTES];
9111 // Set of timings measured from the desired presentation to the actual
9112 // presentation time
9113 optional FrameTimingHistogram desired_to_present = 8
9114 [(android.os.statsd.log_mode) = MODE_BYTES];
9115 // Set of timings measured from when an app queued a buffer for
9116 // presentation, until the buffer was ready to be presented.
9117 optional FrameTimingHistogram post_to_acquire = 9
9118 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009119 // Frames missed latch because the acquire fence didn't fire
9120 optional int64 late_acquire_frames = 10;
9121 // Frames latched early because the desired present time was bad
9122 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009123}
9124
9125/**
9126 * Histogram of frame counts bucketed by time in milliseconds.
9127 * Because of size limitations, we hard-cap the number of buckets, with
9128 * buckets for corresponding to larger milliseconds being less precise.
9129 */
9130message FrameTimingHistogram {
9131 // Timings in milliseconds that describes a set of histogram buckets
9132 repeated int32 time_millis_buckets = 1;
9133 // Number of frames that match to each time_millis, i.e. the bucket
9134 // contents
9135 // It's required that len(time_millis) == len(frame_count)
9136 repeated int64 frame_counts = 2;
9137}
Emilian Peev6729f372019-08-29 09:14:09 -07009138
Emilian Peev6729f372019-08-29 09:14:09 -07009139/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009140 * Janky event as reported by SurfaceFlinger.
9141 * This event is intended to be consumed by a Perfetto subscriber for
9142 * automated trace collection.
9143 *
9144 * Logged from:
9145 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9146 */
9147message DisplayJankReported {
9148 // Informational field for how long the janky event lasted in milliseconds
9149 optional int64 event_duration_millis = 1;
9150 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9151 // the display on time.
9152 optional int32 present_deadlines_missed = 2;
9153}
9154
9155/**
Emilian Peev6729f372019-08-29 09:14:09 -07009156 * Information about camera facing and API level usage.
9157 * Logged from:
9158 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9159 */
9160message CameraActionEvent {
9161 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009162 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009163
9164 // Camera API level used
9165 optional int32 api_level = 2;
9166
9167 // Name of client package
9168 optional string package_name = 3;
9169
9170 // Camera facing
9171 enum Facing {
9172 UNKNOWN = 0;
9173 BACK = 1;
9174 FRONT = 2;
9175 EXTERNAL = 3;
9176 }
9177 optional Facing facing = 4;
9178}
atrost01a20932019-08-28 15:40:37 +01009179
9180/**
9181 * Logs when a compatibility change is affecting an app.
9182 *
9183 * Logged from:
9184 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9185 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9186 */
9187message AppCompatibilityChangeReported {
9188 // The UID of the app being affected by the compatibilty change.
9189 optional int32 uid = 1 [(is_uid) = true];
9190
9191 // The ID of the change affecting the app.
9192 optional int64 change_id = 2;
9193
9194 enum State {
9195 UNKNOWN_STATE = 0;
9196 ENABLED = 1;
9197 DISABLED = 2;
9198 LOGGED = 3;
9199 }
9200
9201 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9202 // logged otherwise.
9203 optional State state = 3;
9204
9205 enum Source {
9206 UNKNOWN_SOURCE = 0;
9207 APP_PROCESS = 1;
9208 SYSTEM_SERVER = 2;
9209 }
9210
9211 // Where it was logged from.
9212 optional Source source = 4;
9213
9214}
Hector Dearman40579f62019-11-01 13:19:30 +00009215
9216/**
9217 * Logged from
9218 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9219 */
9220message PerfettoUploaded {
9221 enum Event {
9222 PERFETTO_UNDEFINED = 0;
9223 PERFETTO_TRACE_BEGIN = 1;
9224 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9225 PERFETTO_ON_CONNECT = 3;
9226 PERFETTO_ON_TRACING_DISABLED = 4;
9227 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9228 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9229 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9230 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9231 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9232 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9233 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9234 PERFETTO_TRIGGER_BEGIN = 12;
9235 PERFETTO_TRIGGER_SUCCESS = 13;
9236 PERFETTO_TRIGGER_FAILURE = 14;
9237 PERFETTO_HIT_GUARDRAILS = 15;
9238 PERFETTO_ON_TIMEOUT = 16;
9239 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9240 }
9241
9242 // Which stage of the pipeline we are reporting from.
9243 optional Event event = 1;
9244
9245 // UUID matching the one set inside the SystemInfo trace packet.
9246 optional int64 trace_uuid_lsb = 2;
9247 optional int64 trace_uuid_msb = 3;
9248}
Mark Tabrya824a642019-11-05 12:26:12 -08009249
9250/**
9251 * Pulls client metrics on data transferred via Vehicle Maps Service.
9252 * Metrics are keyed by uid + layer.
9253 *
9254 * Pulled from:
9255 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9256 */
9257message VmsClientStats {
9258 // UID of the VMS client app
9259 optional int32 uid = 1 [(is_uid) = true];
9260
9261 // VMS layer definition
9262 optional int32 layer_type = 2;
9263 optional int32 layer_channel = 3;
9264 optional int32 layer_version = 4;
9265
9266 // Bytes and packets sent by the client for the layer
9267 optional int64 tx_bytes = 5;
9268 optional int64 tx_packets = 6;
9269
9270 // Bytes and packets received by the client for the layer
9271 optional int64 rx_bytes = 7;
9272 optional int64 rx_packets = 8;
9273
9274 // Bytes and packets dropped due to client error
9275 optional int64 dropped_bytes = 9;
9276 optional int64 dropped_packets = 10;
9277}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009278
9279/**
9280 * State of a dangerous permission requested by a package - sampled
9281 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9282*/
9283message DangerousPermissionStateSampled {
9284 // Name of the permission
9285 optional string permission_name = 1;
9286
9287 // Uid of the package
9288 optional int32 uid = 2 [(is_uid) = true];
9289
9290 // If the permission is granted to the uid
9291 optional bool is_granted = 3;
9292
9293 // Permission flags as per android.content.pm.PermissionFlags
9294 optional int32 permission_flags = 4;
9295}
9296
Stan Iliev637ba5e2019-08-16 13:43:08 -04009297/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009298 * HWUI stats for a given app.
9299 */
9300message GraphicsStats {
9301 // The package name of the app
9302 optional string package_name = 1;
9303
9304 // The version code of the app
9305 optional int64 version_code = 2;
9306
9307 // The start & end timestamps in UTC as
9308 // milliseconds since January 1, 1970
9309 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009310 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009311
Stan Ilievb6517192020-02-18 10:12:42 -05009312 optional int64 end_millis = 4;
9313
9314 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9315 enum PipelineType {
9316 UNKNOWN = 0;
9317 GL = 1;
9318 VULKAN = 2;
9319 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009320
9321 // HWUI renders pipeline type: GL or Vulkan.
9322 optional PipelineType pipeline = 5;
9323
9324 // Distinct frame count.
9325 optional int32 total_frames = 6;
9326
9327 // Number of "missed vsync" events.
9328 optional int32 missed_vsync_count = 7;
9329
9330 // Number of frames in triple-buffering scenario (high input latency)
9331 optional int32 high_input_latency_count = 8;
9332
9333 // Number of "slow UI thread" events.
9334 optional int32 slow_ui_thread_count = 9;
9335
9336 // Number of "slow bitmap upload" events.
9337 optional int32 slow_bitmap_upload_count = 10;
9338
9339 // Number of "slow draw" events.
9340 optional int32 slow_draw_count = 11;
9341
9342 // Number of frames that missed their deadline (aka, visibly janked)
9343 optional int32 missed_deadline_count = 12;
9344
9345 // The frame time histogram for the package
9346 optional FrameTimingHistogram cpu_histogram = 13
9347 [(android.os.statsd.log_mode) = MODE_BYTES];
9348
9349 // The gpu frame time histogram for the package
9350 optional FrameTimingHistogram gpu_histogram = 14
9351 [(android.os.statsd.log_mode) = MODE_BYTES];
9352
9353 // UI mainline module version.
9354 optional int64 version_ui_module = 15;
9355
9356 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9357 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9358 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9359 // more apps are running / rendering.
9360 optional bool is_today = 16;
9361}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009362
9363/**
9364 * Message related to dangerous (runtime) app ops access
9365 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009366message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009367 // Uid of the package accessing app op
9368 optional int32 uid = 1 [(is_uid) = true];
9369
9370 // Name of the package accessing app op
9371 optional string package_name = 2;
9372
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009373 // deprecated - set to empty string
9374 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009375
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009376 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009377 // API. Attributions must be provided through manifest using <attribution> tag available in R
9378 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009379 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009380
9381 // message related to app op access, limited to 600 chars by API
9382 optional string message = 5;
9383
9384 enum SamplingStrategy {
9385 DEFAULT = 0;
9386 UNIFORM = 1;
9387 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009388 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009389 }
9390
9391 // sampling strategy used to collect this message
9392 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009393
9394 // operation id
9395 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009396}
9397
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009398/*
9399 * Logs userspace reboot outcome and duration.
9400 *
9401 * Logged from:
9402 * frameworks/base/core/java/com/android/server/BootReceiver.java
9403 */
9404message UserspaceRebootReported {
9405 // Possible outcomes of userspace reboot.
9406 enum Outcome {
9407 // Default value in case platform failed to determine the outcome.
9408 OUTCOME_UNKNOWN = 0;
9409 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9410 SUCCESS = 1;
9411 // Userspace reboot shutdown sequence was aborted.
9412 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9413 // Remounting userdata into checkpointing mode failed.
9414 FAILED_USERDATA_REMOUNT = 3;
9415 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9416 // reboot.
9417 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9418 }
9419 // Outcome of userspace reboot. Always set.
9420 optional Outcome outcome = 1;
9421 // Duration of userspace reboot in case it has a successful outcome.
9422 // Duration is measured as time between userspace reboot was initiated and until boot completed
9423 // (e.g. sys.boot_completed=1).
9424 optional int64 duration_millis = 2;
9425 // State of primary user's (user0) credential encryption storage.
9426 enum UserEncryptionState {
9427 // Default value.
9428 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9429 // Credential encrypted storage is unlocked.
9430 UNLOCKED = 1;
9431 // Credential encrypted storage is locked.
9432 LOCKED = 2;
9433 }
9434 // State of primary user's encryption storage at the moment boot completed. Always set.
9435 optional UserEncryptionState user_encryption_state = 3;
9436}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009437
9438/*
9439 * Logs integrity check information during each install.
9440 *
9441 * Logged from:
9442 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9443 */
9444message IntegrityCheckResultReported {
9445 optional string package_name = 1;
9446 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009447 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009448 optional string installer_package_name = 4;
9449 enum Response {
9450 UNKNOWN = 0;
9451 ALLOWED = 1;
9452 REJECTED = 2;
9453 FORCE_ALLOWED = 3;
9454 }
9455 optional Response response = 5;
9456 // An estimate on the cause of the response. This will only be populated for
9457 // REJECTED and FORCE_ALLOWED
9458 optional bool caused_by_app_cert_rule = 6;
9459 optional bool caused_by_installer_rule = 7;
9460}
9461
9462/**
9463 * Logs the information about the rules and the provider whenever rules are
9464 * pushed into AppIntegrityManager.
9465 *
9466 * Logged from:
9467 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9468 */
9469message IntegrityRulesPushed {
9470 optional bool success = 1;
9471 // Package name of the app that pushed the rules.
9472 optional string rule_provider = 2;
9473 // Version string of arbitrary format provided by the rule provider to
9474 // identify the rules.
9475 optional string rule_version = 3;
9476}
Jordan Liubedfa702019-12-20 15:08:45 -08009477
9478/**
9479 * Logs when a cell broadcast message is received on the device.
9480 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009481 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009482 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009483 * packages/apps/CellBroadcastReceiver/
9484 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009485 */
9486message CellBroadcastMessageReported {
9487 // The type of Cell Broadcast message
9488 enum CbType {
9489 UNKNOWN_TYPE = 0;
9490 GSM = 1;
9491 CDMA = 2;
9492 CDMA_SPC = 3;
9493 }
9494
Jordan Liu900e5cb2020-05-29 09:44:59 -07009495 // The parts of the cell broadcast message pipeline
9496 enum ReportSource {
9497 UNKNOWN_SOURCE = 0;
9498 FRAMEWORK = 1;
9499 CB_SERVICE = 2;
9500 CB_RECEIVER_APP = 3;
9501 }
9502
Jordan Liubedfa702019-12-20 15:08:45 -08009503 // GSM, CDMA, CDMA-SCP
9504 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009505
9506 // The source of the report
9507 optional ReportSource source = 2;
9508}
9509
9510/**
9511 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9512 *
9513 * Logged from CellBroadcastService module:
9514 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9515 */
9516message CellBroadcastMessageFiltered {
9517 enum FilterReason {
9518 NOT_FILTERED = 0;
9519 DUPLICATE_MESSAGE = 1;
9520 GEOFENCED_MESSAGE = 2;
9521 AREA_INFO_MESSAGE = 3;
9522 }
9523
9524 // GSM, CDMA, CDMA-SCP
9525 optional CellBroadcastMessageReported.CbType type = 1;
9526
9527 // The source of the report
9528 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009529}
9530
9531/**
9532 * Logs when an error occurs while handling a cell broadcast message;
9533 *
9534 * Logged from CellBroadcastService module:
9535 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9536 */
9537message CellBroadcastMessageError {
9538 // The type of error raised when trying to handle a cell broadcast message
9539 enum ErrorType {
9540 UNKNOWN_TYPE = 0;
9541 CDMA_DECODING_ERROR = 1;
9542 CDMA_SCP_EMPTY = 2;
9543 CDMA_SCP_HANDLING_ERROR = 3;
9544 GSM_INVALID_HEADER_LENGTH = 4;
9545 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9546 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9547 GSM_INVALID_PDU = 7;
9548 GSM_INVALID_GEO_FENCING_DATA = 8;
9549 GSM_UMTS_INVALID_WAC = 9;
9550 FAILED_TO_INSERT_TO_DB = 10;
9551 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9552 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9553 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9554 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009555 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009556 }
9557
9558 // What kind of error occurred
9559 optional ErrorType type = 1;
9560
9561 // Exception message (or log message) associated with the error (max 1000 chars)
9562 optional string exception_message = 2;
9563}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009564
9565/**
Henry Fange316ab62020-04-21 18:43:14 -07009566 * Logs when a tune occurs through device's Frontend.
9567 * This is atom ID 276.
9568 *
9569 * Logged from:
9570 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9571 */
9572message TvTunerStateChanged {
9573 enum State {
9574 UNKNOWN = 0;
9575 TUNING = 1; // Signal is tuned
9576 LOCKED = 2; // the signal is locked
9577 NOT_LOCKED = 3; // the signal isn’t locked.
9578 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9579 SCANNING = 5; // the signal is scanned
9580 SCAN_STOPPED = 6; // the scan is stopped.
9581 }
9582 // The uid of the application that sent this custom atom.
9583 optional int32 uid = 1 [(is_uid) = true];
9584 // new state
9585 optional State state = 2;
9586}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009587
9588/**
9589 * Logs the status of a dvr playback or record.
9590 * This is atom ID 279.
9591 *
9592 * Logged from:
9593 * frameworks/base/media/java/android/media/tv/tuner/dvr
9594 */
9595message TvTunerDvrStatus {
9596 enum Type {
9597 UNKNOWN_TYPE = 0;
9598 PLAYBACK = 1; // is a playback
9599 RECORD = 2; // is a record
9600 }
9601 enum State {
9602 UNKNOWN_STATE = 0;
9603 STARTED = 1; // DVR is started
9604 STOPPED = 2; // DVR is stopped
9605 }
9606 // The uid of the application that sent this custom atom.
9607 optional int32 uid = 1 [(is_uid) = true];
9608 // DVR type
9609 optional Type type = 2;
9610 // DVR state
9611 optional State state = 3;
9612 // Identify the segment of a record or playback
9613 optional int32 segment_id = 4;
9614 // indicate how many overflow or underflow happened between started to stopped
9615 optional int32 overflow_underflow_count = 5;
9616}
Henry Fangfd40c072020-06-01 14:59:17 -07009617
9618/**
9619 * Logs when a cas session opened through MediaCas.
9620 * This is atom ID 280.
9621 *
9622 * Logged from:
9623 * frameworks/base/media/java/android/media/MediaCas.java
9624 */
9625message TvCasSessionOpenStatus {
9626 enum State {
9627 UNKNOWN = 0;
9628 SUCCEEDED = 1; // indicate that the session is opened successfully.
9629 FAILED = 2; // indicate that the session isn’t opened successfully.
9630 }
9631 // The uid of the application that sent this custom atom.
9632 optional int32 uid = 1 [(is_uid) = true];
9633 // Cas system Id
9634 optional int32 cas_system_id = 2;
9635 // State of the session
9636 optional State state = 3;
9637}
9638
Henry Fange316ab62020-04-21 18:43:14 -07009639/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009640 * Logs when an app is frozen or unfrozen.
9641 *
9642 * Logged from:
9643 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9644 */
9645message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009646 // The type of event.
9647 enum Action {
9648 UNKNOWN = 0;
9649 FREEZE_APP = 1;
9650 UNFREEZE_APP = 2;
9651 }
9652 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009653
Blake Kragten6ce382a2020-01-16 20:20:46 -08009654 // Pid of the process being frozen.
9655 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009656
Blake Kragten6ce382a2020-01-16 20:20:46 -08009657 // Name of the process being frozen.
9658 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009659
Blake Kragten6ce382a2020-01-16 20:20:46 -08009660 // Time since last unfrozen.
9661 optional int64 time_unfrozen_millis = 4;
9662}
9663
9664/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009665 * Pulls information for a single voice call.
9666 *
9667 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9668 *
9669 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009670 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009671 */
9672message VoiceCallSession {
9673 // Bearer (IMS or CS) when the call started.
9674 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9675
9676 // Bearer (IMS or CS) when the call ended.
9677 // The bearer may change during the call, e.g. due to SRVCC.
9678 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9679
9680 // Direction of the call (incoming or outgoing).
9681 optional android.telephony.CallDirectionEnum direction = 3;
9682
9683 // Time spent setting up the call.
9684 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9685
9686 // Whether the call ended before the setup was completed.
9687 optional bool setup_failed = 5;
9688
9689 // IMS reason code or CS disconnect cause.
9690 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9691 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9692 optional int32 disconnect_reason_code = 6;
9693
9694 // IMS extra code or CS precise disconnect cause.
9695 // For IMS, this code is vendor-specific
9696 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9697 optional int32 disconnect_extra_code = 7;
9698
9699 // IMS extra message or CS vendor cause.
9700 optional string disconnect_extra_message = 8;
9701
9702 // Radio access technology (RAT) used when call started.
9703 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9704
9705 // Radio access technology (RAT) used when call terminated.
9706 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9707
9708 // Number of times RAT changed during the call.
9709 optional int64 rat_switch_count = 11;
9710
9711 // A bitmask of all codecs used during the call.
9712 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9713 optional int64 codec_bitmask = 12;
9714
9715 // Number of other calls going on during call setup, for the same SIM slot.
9716 optional int32 concurrent_call_count_at_start = 13;
9717
9718 // Number of other calls going on during call termination, for the same SIM slot.
9719 optional int32 concurrent_call_count_at_end = 14;
9720
9721 // Index of the SIM is used, 0 for single-SIM devices.
9722 optional int32 sim_slot_index = 15;
9723
9724 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9725 optional bool is_multi_sim = 16;
9726
9727 // Whether the call was made with an eSIM profile.
9728 optional bool is_esim = 17;
9729
9730 // Carrier ID of the SIM card.
9731 // See https://source.android.com/devices/tech/config/carrierid.
9732 optional int32 carrier_id = 18;
9733
Chi Zhangba1b03a2020-04-21 17:17:56 -07009734 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009735 optional bool srvcc_completed = 19;
9736
9737 // Number of SRVCC failures.
9738 optional int64 srvcc_failure_count = 20;
9739
9740 // Number of SRVCC cancellations.
9741 optional int64 srvcc_cancellation_count = 21;
9742
Chi Zhangba1b03a2020-04-21 17:17:56 -07009743 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9744 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009745 optional bool rtt_enabled = 22;
9746
9747 // Whether this was an emergency call.
9748 optional bool is_emergency = 23;
9749
9750 // Whether the call was performed while roaming.
9751 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009752
9753 // A random number used as the dimension field to pull multiple atoms.
9754 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009755}
9756
9757/**
9758 * Pulls voice call radio access technology (RAT) usage.
9759 *
9760 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9761 * time. The atom will be skipped if not enough data is available.
9762 *
9763 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009764 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009765 */
9766message VoiceCallRatUsage {
9767 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9768 optional int32 carrier_id = 1;
9769
9770 // Radio access technology.
9771 optional android.telephony.NetworkTypeEnum rat = 2;
9772
9773 // Total duration that voice calls spent on this carrier and RAT.
9774 optional int64 total_duration_seconds = 3;
9775
9776 // Total number of calls using this carrier and RAT.
9777 // A call is counted once even if it used the RAT multiple times.
9778 optional int64 call_count = 4;
9779}
9780
9781/**
9782 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9783 *
9784 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009785 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009786 */
9787message SimSlotState {
9788 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9789 optional int32 active_slot_count = 1;
9790
9791 // Number of SIM cards (both physical and active eSIM profiles).
9792 // This number is always equal to or less than the number of active SIM slots.
9793 optional int32 sim_count = 2;
9794
9795 // Number of active eSIM profiles.
9796 // This number is always equal to or less than the number of SIMs.
9797 optional int32 esim_count = 3;
9798}
9799
9800/**
9801 * Pulls supported cellular radio access technologies.
9802 *
9803 * This atom reports the capabilities of the device, rather than the network it has access to.
9804 *
9805 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009806 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009807 */
9808message SupportedRadioAccessFamily {
9809 // A bitmask of supported radio technologies.
9810 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9811 optional int64 network_type_bitmask = 1;
9812}
9813
9814/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009815 * Logs gnss stats from location service provider
9816 *
9817 * Pulled from:
9818 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9819 */
9820
9821message GnssStats {
9822 // Number of location reports since boot
9823 optional int64 location_reports = 1;
9824
9825 // Total pulled reports of Location failures since boot
9826 optional int64 location_failure_reports = 2;
9827
9828 // Number of time to first fix reports since boot
9829 optional int64 time_to_first_fix_reports = 3;
9830
9831 // Total pulled reported time to first fix (in milli-seconds) since boot
9832 optional int64 time_to_first_fix_milli_s = 4;
9833
9834 // Number of position accuracy reports since boot
9835 optional int64 position_accuracy_reports = 5;
9836
9837 // Total pulled reported position accuracy (in meters) since boot
9838 optional int64 position_accuracy_meters = 6;
9839
9840 // Number of top 4 average CN0 reports since boot
9841 optional int64 top_four_average_cn0_reports = 7;
9842
9843 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9844 optional int64 top_four_average_cn0_db_mhz = 8;
9845
9846 // Number of l5 top 4 average CN0 reports since boot
9847 optional int64 l5_top_four_average_cn0_reports = 9;
9848
9849 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9850 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9851
9852 // Total number of sv status messages reports since boot
9853 optional int64 sv_status_reports = 11;
9854
9855 // Total number of sv status messages reports, where sv is used in fix since boot
9856 optional int64 sv_status_reports_used_in_fix = 12;
9857
9858 // Total number of L5 sv status messages reports since boot
9859 optional int64 l5_sv_status_reports = 13;
9860
9861 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9862 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009863}
Kweku Adams12752132020-02-18 15:36:48 -08009864
9865/**
9866 * Logs when an app is moved to a different standby bucket.
9867 *
9868 * Logged from:
9869 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9870 */
9871message AppStandbyBucketChanged {
9872 optional string package_name = 1;
9873
9874 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9875 optional int32 user_id = 2;
9876
9877 // These enum values match the constants defined in UsageStatsManager.java.
9878 enum Bucket {
9879 BUCKET_UNKNOWN = 0;
9880 BUCKET_EXEMPTED = 5;
9881 BUCKET_ACTIVE = 10;
9882 BUCKET_WORKING_SET = 20;
9883 BUCKET_FREQUENT = 30;
9884 BUCKET_RARE = 40;
9885 BUCKET_RESTRICTED = 45;
9886 BUCKET_NEVER = 50;
9887 }
9888 optional Bucket bucket = 3;
9889
9890 enum MainReason {
9891 MAIN_UNKNOWN = 0;
9892 MAIN_DEFAULT = 0x0100;
9893 MAIN_TIMEOUT = 0x0200;
9894 MAIN_USAGE = 0x0300;
9895 MAIN_FORCED_BY_USER = 0x0400;
9896 MAIN_PREDICTED = 0x0500;
9897 MAIN_FORCED_BY_SYSTEM = 0x0600;
9898 }
9899 optional MainReason main_reason = 4;
9900
9901 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9902 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9903 // UsageStatsManager.java.
9904 optional int32 sub_reason = 5;
9905}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009906
9907/**
9908* Reports a started sharesheet transaction.
9909*
9910* Logged from:
9911* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9912*/
9913message SharesheetStarted {
9914 // The event_id (as for UiEventReported).
9915 optional int32 event_id = 1;
9916 // The calling app's package name.
9917 optional string package_name = 2;
9918 // An identifier to tie together multiple logs relating to the same share event
9919 optional int32 instance_id = 3;
9920 // The mime type of the share
9921 optional string mime_type = 4;
9922 // The number of direct targets the calling app is providing that will be shown.
9923 optional int32 num_app_provided_direct_targets = 5;
9924 // The number of app targets the calling app is providing that will be shown.
9925 optional int32 num_app_provided_app_targets = 6;
9926 // True if the share originates from the workprofile
9927 optional bool is_workprofile = 7;
9928
9929 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009930 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009931 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9932 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9933 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9934 }
9935 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009936 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009937
9938 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9939 INTENT_DEFAULT = 0;
9940 INTENT_ACTION_VIEW = 1;
9941 INTENT_ACTION_EDIT = 2;
9942 INTENT_ACTION_SEND = 3;
9943 INTENT_ACTION_SENDTO = 4;
9944 INTENT_ACTION_SEND_MULTIPLE = 5;
9945 INTENT_ACTION_IMAGE_CAPTURE = 6;
9946 INTENT_ACTION_MAIN = 7;
9947 }
9948 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009949 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009950}
9951
9952/**
9953 * Reports a ranking selection event.
9954 *
9955 * Logged from:
9956 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9957 */
9958message RankingSelected {
9959 // The event_id (as for UiEventReported).
9960 optional int32 event_id = 1;
9961 // The relevant app's package name (can be source or picked package).
9962 optional string package_name = 2;
9963 // An identifier to tie together multiple logs relating to the same share event.
9964 optional int32 instance_id = 3;
9965 // Which of the ranked targets got picked, default starting position 0.
9966 optional int32 position_picked = 4;
9967}
Raff Tsaiea4db182020-03-06 07:45:43 +08009968
9969/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009970 * Logs when TvSettings UI is interacted at.
9971 *
9972 * Logged from: packages/apps/TvSettings
9973 */
9974message TvSettingsUIInteracted {
9975
9976 /** The UI action category */
9977 optional android.app.tvsettings.Action action = 1;
9978
9979 /** The ID of the entry that the users actioned on */
9980 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009981}
9982
9983/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009984 * Logs information about a package installation using package installer V2 APIs.
9985 *
9986 * Logged from:
9987 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9988 */
9989message PackageInstallerV2Reported {
9990 // Whether this installation uses Incremental File System
9991 optional bool is_incremental = 1;
9992 // Name of the package that is intended to be installed
9993 optional string package_name = 2;
9994 // The duration between when the install was requested to when the install has completed
9995 optional int64 duration_millis = 3;
9996 // Installation result in final integer, which are SystemApi's.
9997 // Return_code 1 indicates success.
9998 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9999 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010000 // Total size of the APKs installed for this package
10001 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010002}
10003
10004/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010005 * Logs settings provider values.
10006 *
10007 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10008 * then write the value to proto.
10009 *
10010 */
10011message SettingSnapshot {
10012
10013 // Setting key
10014 optional string name = 1;
10015
10016 enum SettingsValueType {
10017 NOTASSIGNED = 0;
10018 ASSIGNED_BOOL_TYPE = 1;
10019 ASSIGNED_INT_TYPE = 2;
10020 ASSIGNED_FLOAT_TYPE = 3;
10021 ASSIGNED_STRING_TYPE = 4;
10022 };
10023 // Setting value type
10024 optional SettingsValueType type = 2;
10025
10026 optional bool bool_value = 3;
10027
10028 optional int32 int_value = 4;
10029
10030 optional float float_value = 5;
10031
10032 optional string str_value = 6;
10033
10034 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10035 optional int32 user_id = 7;
10036}
Varun Shahacb56342019-12-18 11:45:38 -080010037
10038/**
10039 * An event logged to indicate that a user journey is about to be performed. This atom includes
10040 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10041 * will immediately follow this atom which will describe the event(s) and its state.
10042 *
10043 * Logged from:
10044 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10045 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10046 */
10047message UserLifecycleJourneyReported {
10048 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10049 // UserLifecycleEventOccurred atom)
10050 optional int64 session_id = 1;
10051
10052 // Indicates what type of user journey this session is related to
10053 enum Journey {
10054 UNKNOWN = 0; // Undefined user lifecycle journey
10055 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10056 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10057 USER_START = 3; // A user start journey
10058 USER_CREATE = 4; // A user creation journey
10059 }
10060 optional Journey journey = 2;
10061 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10062 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10063 optional int32 origin_user = 3;
10064 // Which user the journey is targeting
10065 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10066 optional int32 target_user = 4;
10067
10068 // What is the user type of the target user
10069 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10070 enum UserType {
10071 TYPE_UNKNOWN = 0;
10072 FULL_SYSTEM = 1;
10073 FULL_SECONDARY = 2;
10074 FULL_GUEST = 3;
10075 FULL_DEMO = 4;
10076 FULL_RESTRICTED = 5;
10077 PROFILE_MANAGED = 6;
10078 SYSTEM_HEADLESS = 7;
10079 }
10080 optional UserType user_type = 5;
10081 // What are the flags attached to the target user
10082 optional int32 user_flags = 6;
10083}
10084
10085/**
10086 * An event logged when a specific user lifecycle event is performed. These events should be
10087 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10088 * Note: journeys can span over multiple events, hence some events may share a single session id.
10089 *
10090 * Logged from:
10091 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10092 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10093 */
10094message UserLifecycleEventOccurred {
10095 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10096 optional int64 session_id = 1;
10097 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10098 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10099 optional int32 user_id = 2;
10100
10101 enum Event {
10102 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10103 SWITCH_USER = 1; // Indicates that this is a user switch event
10104 START_USER = 2; // Indicates that this is a user start event
10105 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010106 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10107 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10108 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010109 }
10110 optional Event event = 3;
10111
10112 enum State {
10113 NONE = 0; // Indicates the associated event has no start/end defined
10114 BEGIN = 1;
10115 FINISH = 2;
10116 }
10117 optional State state = 4; // Represents the state of an event (beginning/ending)
10118}
jasonwshsu81173e32020-03-27 15:22:03 +080010119
10120/**
10121 * Logs when accessibility shortcut clicked.
10122 *
10123 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010124 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010125 */
10126message AccessibilityShortcutReported {
10127 // The accessibility feature(including installed a11y service, framework a11y feature,
10128 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10129 optional string package_name = 1;
10130
10131 // The definition of the accessibility shortcut.
10132 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10133 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10134
10135 // The definition of the service status.
10136 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10137 optional android.stats.accessibility.ServiceStatus service_status = 3;
10138}
10139
10140/**
10141 * Logs when accessibility service status changed.
10142 *
10143 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010144 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010145 */
10146message AccessibilityServiceReported {
10147 // The accessibility service package name.
10148 optional string package_name = 1;
10149
10150 // The definition of the service status.
10151 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10152 optional android.stats.accessibility.ServiceStatus service_status = 2;
10153}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010154
Denny cy Leeca62fc42020-05-28 18:13:07 +080010155/**
10156 * Logs when display wake up.
10157 *
10158 * Logged from:
10159 * services/core/java/com/android/server/power/Notifier.java
10160 */
10161
10162message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010163 // Wake_up_reason code
10164 // If LOWORD(wake_up_reason) = 0
10165 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10166 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010167 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010168 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010169}
10170
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010171/**
10172 * Logs app usage events.
10173 */
10174message AppUsageEventOccurred {
10175 optional int32 uid = 1 [(is_uid) = true];
10176 optional string package_name = 2;
10177 optional string class_name = 3;
10178
10179 enum EventType {
10180 NONE = 0;
10181 MOVE_TO_FOREGROUND = 1;
10182 MOVE_TO_BACKGROUND = 2;
10183 }
10184 optional EventType event_type = 4;
10185}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010186
10187/*
10188 * Quality metrics logged when EVS cameras are active.
10189 *
10190 * Logged from:
10191 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10192 */
10193message EvsUsageStatsReported {
10194
10195 // Camera identifier to distinguish the source camera device. This is not
10196 // globally unique and therefore cannot be used to identify the user and/or
10197 // the device.
10198 optional int32 device_id = 1;
10199
10200 // Peak number of clients during the service
10201 optional int32 peak_num_clients = 2;
10202
10203 // Number of erroneous events during the service
10204 optional int32 num_errors = 3;
10205
10206 // Round trip latency of the very first frame
10207 optional int64 first_latency_millis = 4;
10208
10209 // Average frame round trip latency
10210 optional float avg_latency_millis = 5;
10211
10212 // Peak frame round trip latency
10213 optional int64 peak_latency_millis = 6;
10214
10215 // Total number of frames received
10216 optional int64 total_frames = 7;
10217
10218 // Number of frames ignored
10219 optional int64 ignored_frames = 8;
10220
10221 // Number of dropped frames to synchronize camera devices
10222 optional int64 dropped_frames_to_sync = 9;
10223
10224 // The duration of the service
10225 optional int64 duration_millis = 10;
10226}
Robert Leecccdc152020-04-23 13:22:46 +080010227
10228/**
10229 * Logs audio power usage stats.
10230 *
10231 * Pushed from:
10232 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10233 */
10234message AudioPowerUsageDataReported {
10235 /**
10236 * Device used for input/output
10237 *
10238 * All audio devices please refer to below file:
10239 * system/media/audio/include/system/audio-base.h
10240 *
10241 * Define our own enum values because we don't report all audio devices.
10242 * Currently, we only report built-in audio devices such as handset, speaker,
10243 * built-in mics, common audio devices such as wired headset, usb headset
10244 * and bluetooth devices.
10245 */
10246 enum AudioDevice {
10247 OUTPUT_EARPIECE = 0x1; // handset
10248 OUTPUT_SPEAKER = 0x2; // dual speaker
10249 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10250 OUTPUT_USB_HEADSET = 0x8; // usb headset
10251 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10252 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10253 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10254
10255 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10256 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10257 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10258 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10259 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10260 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10261 }
10262 optional AudioDevice audio_device = 1;
10263
10264 // Duration of the audio in seconds
10265 optional int32 duration_secs = 2;
10266
10267 // Average volume (0 ... 1.0)
10268 optional float average_volume = 3;
10269
10270 enum AudioType {
10271 UNKNOWN_TYPE = 0;
10272 VOICE_CALL_TYPE = 1; // voice call
10273 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10274 MEDIA_TYPE = 3; // music and system sound
10275 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10276 ALARM_TYPE = 5; // alarm type
10277 // record type
10278 CAMCORDER_TYPE = 6; // camcorder
10279 RECORD_TYPE = 7; // other recording
10280 }
10281 optional AudioType type = 4;
10282}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010283
10284/**
10285 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10286 *
10287 * Pulled from:
10288 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10289 */
10290message BytesTransferByTagAndMetered {
10291 optional int32 uid = 1 [(is_uid) = true];
10292
10293 optional bool is_metered = 2;
10294
10295 optional int32 tag = 3;
10296
10297 optional int64 rx_bytes = 4;
10298
10299 optional int64 rx_packets = 5;
10300
10301 optional int64 tx_bytes = 6;
10302
10303 optional int64 tx_packets = 7;
10304}
Robert Luo2f52f042020-05-11 16:39:24 +080010305
10306/*
10307 * Logs when the Media Output Switcher finishes a media switch operation.
10308 *
10309 * Logged from:
10310 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10311 */
10312message MediaOutputOpSwitchReported {
10313 // Source medium type before switching.
10314 optional android.app.settings.mediaoutput.MediumType source = 1;
10315
10316 // Target medium type after switching.
10317 optional android.app.settings.mediaoutput.MediumType target = 2;
10318
10319 // The result of switching.
10320 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10321
10322 // The detail code of a switching result.
10323 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10324
10325 /*
10326 * The package name of a pre-installed app, whose media session is being switched.
10327 */
10328 optional string media_session_package_name = 5;
10329
10330 // The amount of available wired devices when a switching is being performed.
10331 optional int32 available_wired_device_count = 6;
10332
10333 // The amount of available Bluetooth devices a switching is being performed.
10334 optional int32 available_bt_device_count = 7;
10335
10336 // The amount of available remote devices when a switching is being performed.
10337 optional int32 available_remote_device_count = 8;
10338
10339 // The amount of applied devices within a remote dynamic group after a switching is done.
10340 optional int32 applied_device_count_within_remote_group = 9;
10341}
Govinda Wassermane4640282020-04-30 09:30:56 -040010342
10343/**
10344 * Logs when the Assistant is invoked.
10345 *
10346 * Logged from:
10347 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10348 */
10349message AssistantInvocationReported {
10350
10351 // The event_id (as for UiEventReported).
10352 optional int32 event_id = 1;
10353
10354 // The registered Assistant's uid and package (as for UiEventReported).
10355 optional int32 uid = 2 [(is_uid) = true];
10356 optional string package_name = 3;
10357
10358 // An identifier used to disambiguate which logs refer to a particular invocation of the
10359 // Assistant (as for UiEventReported).
10360 optional int32 instance_id = 4;
10361
10362 // The state of the device at the time of invocation.
10363 enum DeviceState {
10364 UNKNOWN_DEVICE_STATE = 0;
10365 AOD1 = 1;
10366 AOD2 = 2;
10367 BOUNCER = 3;
10368 UNLOCKED_LOCKSCREEN = 4;
10369 LAUNCHER_HOME = 5;
10370 LAUNCHER_OVERVIEW = 6;
10371 LAUNCHER_ALL_APPS = 7;
10372 APP_DEFAULT = 8;
10373 APP_IMMERSIVE = 9;
10374 APP_FULLSCREEN = 10;
10375 }
10376 optional DeviceState device_state = 5;
10377
10378 // Whether the Assistant handles were showing at the time of invocation.
10379 optional bool assistant_handles_showing = 6;
10380}