blob: 4635a2b14bb46e91ffaf3d4cb6547a291fced6f3 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Robert Luo2f52f042020-05-11 16:39:24 +080027import "frameworks/base/core/proto/android/app/media_output_enum.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070028import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080029import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080030import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080031import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080032import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080033import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080034import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080035import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080036import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080039import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080040import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080041import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080042import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080044import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080045import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080046import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070049import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080050import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070051import "frameworks/base/core/proto/android/stats/enums.proto";
52import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070053import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070054import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080055import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070056import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000057import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080058import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050059import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080060import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080061import "frameworks/base/core/proto/android/telephony/enums.proto";
62import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080063import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010064import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070065import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080066
Yao Chend54f9dd2017-10-17 17:37:48 +000067/**
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * raw stats log events from the Android system, also known as "atoms."
70 *
71 * This field contains a single oneof with all of the available messages.
72 * The stats-log-api-gen tool runs as part of the Android build and
73 * generates the android.util.StatsLog class, which contains the constants
74 * and methods that Android uses to log.
75 *
Stefan Lafonae2df012017-11-14 09:17:21 -080076 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000077 * Instead, statsd on Android constructs these messages synthetically,
78 * in the format defined here and in stats_log.proto.
79 */
Stefan Lafonae2df012017-11-14 09:17:21 -080080message Atom {
81 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070082 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070083 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070084 BleScanStateChanged ble_scan_state_changed = 2
85 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080087 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SensorStateChanged sensor_state_changed =
89 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080090 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070091 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
92 ScheduledJobStateChanged scheduled_job_state_changed =
93 8 [(module) = "framework", (module) = "statsdtest"];
94 ScreenBrightnessChanged screen_brightness_changed =
95 9 [(module) = "framework", (module) = "statsdtest"];
96 WakelockStateChanged wakelock_state_changed =
97 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080098 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
99 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700100 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
101 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800102 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
103 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
104 14 [(module) = "framework"];
105 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
106 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
107 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
108 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800109 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700110 BatterySaverModeStateChanged battery_saver_mode_state_changed =
111 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800112 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
113 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700114 AudioStateChanged audio_state_changed =
115 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
117 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
118 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700119 UidProcessStateChanged uid_process_state_changed =
120 27 [(module) = "framework", (module) = "statsdtest"];
121 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
122 28 [(module) = "framework", (module) = "statsdtest"];
123 ScreenStateChanged screen_state_changed =
124 29 [(module) = "framework", (module) = "statsdtest"];
125 BatteryLevelChanged battery_level_changed =
126 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800127 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800128 PluggedStateChanged plugged_state_changed = 32
129 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800131 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800132 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
133 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800134 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
135 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
136 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700137 PhoneSignalStrengthChanged phone_signal_strength_changed =
138 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 SettingChanged setting_changed = 41 [(module) = "framework"];
140 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 42 [(module) = "framework", (module) = "statsdtest"];
142 IsolatedUidChanged isolated_uid_changed =
143 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800144 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
145 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800146 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800147 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800148 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700149 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800150 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
151 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800152 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800153 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800154 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800155 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800156 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
157 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800158 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800159 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700160 OverlayStateChanged overlay_state_changed =
161 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 ForegroundServiceStateChanged foreground_service_state_changed
163 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700164 CallStateChanged call_state_changed =
165 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800166 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
167 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
168 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800169 AppDied app_died = 65 [(module) = "framework"];
170 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
171 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800172 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
173 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
175 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800176 SpeakerImpedanceReported speaker_impedance_reported = 71;
177 HardwareFailed hardware_failed = 72;
178 PhysicalDropDetected physical_drop_detected = 73;
179 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800180 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
181 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700183 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ANROccurred anr_occurred = 79 [(module) = "framework"];
185 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
186 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700187 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800189 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800190 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
191 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700192 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800193 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
194 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
195 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
196 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700197 BatteryHealthSnapshot battery_health_snapshot = 91;
198 SlowIo slow_io = 92;
199 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100202 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800203 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700205 // TODO: service state change is very noisy shortly after boot, as well
206 // as at other transitions - coming out of doze, device plugged in, etc.
207 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
209 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
210 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800211 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800212 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800213 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
214 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
215 105 [(module) = "docsui"];
216 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
217 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
218 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
219 108 [(module) = "docsui"];
220 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
221 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
222 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
223 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800225 WifiRunningStateChanged wifi_running_state_changed = 114
226 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800229 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800230 117 [(module) = "docsui"];
231 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
232 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
233 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
234 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
236 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
237 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800238 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
239 125 [(module) = "bluetooth"];
240 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
241 126 [(module) = "bluetooth"];
242 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
243 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000245 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800246 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
247 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
248 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800249 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800250 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
251 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
252 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
253 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
254 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
255 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800256 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
257 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
259 142 [(module) = "framework"];
260 AttentionManagerServiceResultReported attention_manager_service_result_reported =
261 143 [(module) = "framework"];
262 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800263 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800264 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800265 WatchdogRollbackOccurred watchdog_rollback_occurred =
266 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800267 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
268 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800269 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800270 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
271 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800272 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
273 151 [(module) = "bluetooth"];
274 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
275 152 [(module) = "bluetooth"];
276 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
277 153 [(module) = "bluetooth"];
278 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
279 154 [(module) = "bluetooth"];
280 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
281 155 [(module) = "bluetooth"];
282 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
283 156 [(module) = "bluetooth"];
284 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
285 157 [(module) = "bluetooth"];
286 BluetoothDeviceFailedContactCounterReported
287 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
288 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
289 159 [(module) = "bluetooth"];
290 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
291 160 [(module) = "bluetooth"];
292 BluetoothQualityReportReported bluetooth_quality_report_reported =
293 161 [(module) = "bluetooth"];
294 BluetoothDeviceInfoReported bluetooth_device_info_reported =
295 162 [(module) = "bluetooth"];
296 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
297 163 [(module) = "bluetooth"];
298 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
299 164 [(module) = "bluetooth"];
300 BluetoothBondStateChanged bluetooth_bond_state_changed =
301 165 [(module) = "bluetooth"];
302 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
303 166 [(module) = "bluetooth"];
304 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
305 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
307 168 [(module) = "framework"];
308 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700309 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800311 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800312 DeviceIdentifierAccessDenied device_identifier_access_denied =
313 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800315 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
316 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
317 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
319 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700321 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 180 [(module) = "permissioncontroller"];
323 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
324 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800326 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
327 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
328 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
329 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800330 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
331 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700332 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 188 [(module) = "intelligence"];
334 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
335 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800336 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800337 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800338 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
339 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
340 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
341 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
342 MediametricsCodecReported mediametrics_codec_reported = 195;
343 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
344 MediametricsExtractorReported mediametrics_extractor_reported = 197;
345 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
346 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
347 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700348 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800349 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
350 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800351 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
353 206 [(module) = "framework"];
354 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
355 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
356 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
357 LocationManagerApiUsageReported location_manager_api_usage_reported =
358 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100361 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100363 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100365 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100367 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100369 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100371 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100373 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
376 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
377 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
378 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800380 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700381 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
382 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100384 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800385 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800387 VmsClientConnectionStateChanged vms_client_connection_state_changed =
388 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100389 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
390 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
391 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800392 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100393 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
394 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800395 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800396 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
397 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
398 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
399 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800400 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000402 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800403 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500404 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
405 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800406 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
407 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800408 CellBroadcastMessageReported cb_message_reported =
409 249 [(module) = "cellbroadcast"];
410 CellBroadcastMessageError cb_message_error =
411 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700412 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
413 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
414 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800415 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000416 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800417 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
418 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800419 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800420 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500421 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
422 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700449 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700450
451 // StatsdStats tracks platform atoms with ids upto 500.
452 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000453 }
David Chenc8a43242017-10-17 16:23:28 -0700454
David Chen6e3e6cb2018-01-03 16:14:06 -0800455 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700456 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700457 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
459 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700460 MobileBytesTransfer mobile_bytes_transfer =
461 10002 [(module) = "framework", (truncate_timestamp) = true];
462 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
463 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800464 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
465 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700466 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700468 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800469 CpuTimePerUidFreq cpu_time_per_uid_freq =
470 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800471 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
472 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
473 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
474 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
475 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700476 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700477 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700478 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700479 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800480 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
481 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700482 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800483 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800484 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800485 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 DiskStats disk_stats = 10025 [(module) = "framework"];
487 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
488 AppSize app_size = 10027 [(module) = "framework"];
489 CategorySize category_size = 10028 [(module) = "framework"];
490 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800491 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800492 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
493 DiskIo disk_io = 10032 [(module) = "framework"];
494 PowerProfile power_profile = 10033 [(module) = "framework"];
495 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
496 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
497 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700498 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800499 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
500 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
501 10040 [(module) = "framework"];
502 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
503 10041 [(module) = "framework"];
504 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800505 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800506 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800507 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800508 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
509 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
510 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
511 RoleHolder role_holder = 10049 [(module) = "framework"];
512 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800513 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800514 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
515 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800516 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
517 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800518 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
519 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
520 FaceSettings face_settings = 10058 [(module) = "framework"];
521 CoolingDevice cooling_device = 10059 [(module) = "framework"];
522 AppOps app_ops = 10060 [(module) = "framework"];
523 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700524 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
525 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800527 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800528 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
529 DangerousPermissionStateSampled dangerous_permission_state_sampled =
530 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400531 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000532 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000533 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200534 PackageNotificationPreferences package_notification_preferences =
535 10071 [(module) = "framework"];
536 PackageNotificationChannelPreferences package_notification_channel_preferences =
537 10072 [(module) = "framework"];
538 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
539 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800540 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800541 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700542 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
543 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
544 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
545 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800546 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800547 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800548 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700549 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
550 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700551 }
yroa1fe77c2018-02-26 14:22:54 -0800552
Bookatz76aafcf2018-09-17 16:17:10 -0700553 // DO NOT USE field numbers above 100,000 in AOSP.
554 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
555 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100556
557 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700558}
559
Yao Chend54f9dd2017-10-17 17:37:48 +0000560/**
Yangster-mac20877162017-12-22 17:19:39 -0800561 * This proto represents a node of an attribution chain.
562 * Note: All attribution chains are represented as a repeated field of type
563 * AttributionNode. It is understood that in such arrays, the order is that
564 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000565 */
Yangster-mac20877162017-12-22 17:19:39 -0800566message AttributionNode {
567 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800568 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800569
Yangster-mac20877162017-12-22 17:19:39 -0800570 // The (optional) string tag for an element in the attribution chain. If the
571 // element has no tag, it is encoded as an empty string.
572 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700573}
574
Yangster-mac48b3d622018-08-18 12:38:11 -0700575message KeyValuePair {
576 optional int32 key = 1;
577 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700578 int32 value_int = 2;
579 int64 value_long = 3;
580 string value_str = 4;
581 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700582 }
583}
584
585message KeyValuePairsAtom {
586 optional int32 uid = 1;
587 repeated KeyValuePair pairs = 2;
588}
589
Yao Chend54f9dd2017-10-17 17:37:48 +0000590/*
591 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800592 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000593 *
594 * RULES:
595 * - The field ids for each atom must start at 1, and count upwards by 1.
596 * Skipping field ids is not allowed.
597 * - These form an API, so renaming, renumbering or removing fields is
598 * not allowed between android releases. (This is not currently enforced,
599 * but there will be a tool to enforce this restriction).
600 * - The types must be built-in protocol buffer types, namely, no sub-messages
601 * are allowed (yet). The bytes type is also not allowed.
602 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800603 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000604 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800605 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 * - A field that is a uid should be a string field, tagged with the [xxx]
607 * annotation. The generated code on android will be represented by UIDs,
608 * and those UIDs will be translated in xxx to those strings.
609 *
610 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700611 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000612 * - If there is a UID, it goes first. Think in an object-oriented fashion.
613 * *****************************************************************************
614 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700615
Yao Chend54f9dd2017-10-17 17:37:48 +0000616/**
Tej Singha72344992019-04-17 18:55:08 -0700617 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700618 * Logs when the Thermal service HAL notifies the throttling start/stop events.
619 *
620 * Logged from:
621 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
622 */
623message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700624 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700625 optional android.os.TemperatureTypeEnum sensor_type = 1;
626
Maggie White442b6312019-04-05 16:26:44 -0700627 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700628 enum State {
629 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700630 START = 1; // START indicated that throttling was triggered.
631 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700632 }
Yangster-mace16189a2018-08-26 12:20:16 -0700633 optional State state = 2;
634
635 optional float temperature = 3;
636}
637
638/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000639 * Logs when the screen state changes.
640 *
641 * Logged from:
642 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
643 */
644message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800645 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800646 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700647 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700648}
Yao Chend54f9dd2017-10-17 17:37:48 +0000649
650/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700651 * Logs that the process state of the uid, as determined by ActivityManager
652 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000653 *
654 * Logged from:
655 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
656 */
Bookatzc1a050a2017-10-10 15:49:28 -0700657message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700658 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000659
Bookatzdb026a22018-01-10 19:01:56 -0800660 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800661 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700662 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000663}
664
665/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700666 * Logs process state change of a process, as per the activity manager.
667 *
668 * Logged from:
669 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
670 */
671message ProcessStateChanged {
672 optional int32 uid = 1;
673 optional string process_name = 2;
674 optional string package_name = 3;
675 // TODO: remove this when validation is done
676 optional int64 version = 5;
677 // The state, from frameworks/base/core/proto/android/app/enums.proto.
678 optional android.app.ProcessStateEnum state = 4;
679}
680
681/**
682 * Logs when ActivityManagerService sleep state is changed.
683 *
684 * Logged from:
685 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
686 */
687message ActivityManagerSleepStateChanged {
688 // TODO: import frameworks proto
689 enum State {
690 UNKNOWN = 0;
691 ASLEEP = 1;
692 AWAKE = 2;
693 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700694 optional State state = 1
695 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700696}
697
698/**
699 * Logs when system memory state changes.
700 *
701 * Logged from:
702 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
703 */
704message MemoryFactorStateChanged {
705 // TODO: import frameworks proto
706 enum State {
707 MEMORY_UNKNOWN = 0;
708 NORMAL = 1; // normal.
709 MODERATE = 2; // moderate memory pressure.
710 LOW = 3; // low memory.
711 CRITICAL = 4; // critical memory.
712
713 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700714 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700715}
716
717/**
718 * Logs when app is using too much cpu, according to ActivityManagerService.
719 *
720 * Logged from:
721 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
722 */
723message ExcessiveCpuUsageReported {
724 optional int32 uid = 1;
725 optional string process_name = 2;
726 optional string package_name = 3;
727 // package version. TODO: remove this when validation is done
728 optional int64 version = 4;
729}
730
731/**
732 * Logs when a cached process is killed, along with its pss.
733 *
734 * Logged from:
735 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
736 */
737message CachedKillReported {
738 optional int32 uid = 1;
739 optional string process_name = 2;
740 optional string package_name = 3;
741 // TODO: remove this when validation is done
742 optional int64 version = 5;
743 optional int64 pss = 4;
744}
745
746/**
xshu2c3d9e42019-09-26 17:54:02 -0700747 * Logs the change in wifi health.
748 *
749 * Logged from:
750 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
751 */
752message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800753 enum Band {
754 UNKNOWN = 0;
755 // All of 2.4GHz band
756 BAND_2G = 1;
757 // Frequencies in the range of [5150, 5250) GHz
758 BAND_5G_LOW = 2;
759 // Frequencies in the range of [5250, 5725) GHz
760 BAND_5G_MIDDLE = 3;
761 // Frequencies in the range of [5725, 5850) GHz
762 BAND_5G_HIGH = 4;
763 // Frequencies in the range of [5925, 6425) GHz
764 BAND_6G_LOW = 5;
765 // Frequencies in the range of [6425, 6875) GHz
766 BAND_6G_MIDDLE = 6;
767 // Frequencies in the range of [6875, 7125) GHz
768 BAND_6G_HIGH = 7;
769 }
xshu2c3d9e42019-09-26 17:54:02 -0700770 // duration this stat is obtained over in milliseconds
771 optional int32 duration_millis = 1;
772 // whether wifi is classified as sufficient for the user's data traffic, determined
773 // by whether the calculated throughput exceeds the average demand within |duration_millis|
774 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700775 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800776 optional bool is_cell_data_available = 3;
777 // the Band bucket the connected network is on
778 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700779}
780
781/**
782 * Logged when wifi detects a significant change in connection failure rate.
783 *
784 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
785 *
786 */
787message WifiFailureStatReported {
788 enum AbnormalityType {
789 UNKNOWN = 0;
790 SIGNIFICANT_INCREASE = 1;
791 SIGNIFICANT_DECREASE = 2;
792 SIMPLY_HIGH = 3;
793 }
794 enum FailureType {
795 FAILURE_UNKNOWN = 0;
796 FAILURE_CONNECTION = 1;
797 FAILURE_ASSOCIATION_REJECTION = 2;
798 FAILURE_ASSOCIATION_TIMEOUT = 3;
799 FAILURE_AUTHENTICATION = 4;
800 FAILURE_NON_LOCAL_DISCONNECTION = 5;
801 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
802 }
803 // Reason for uploading this stat
804 optional AbnormalityType abnormality_type = 1;
805 // The particular type of failure
806 optional FailureType failure_type = 2;
807 // How many times we have encountered this combination of AbnormalityType and FailureType
808 optional int32 failure_count = 3;
809}
810
811/**
812 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
813 *
814 * Logged from:
815 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
816 */
817message WifiConnectionResultReported {
818 enum FailureCode {
819 FAILURE_UNKNOWN = 0;
820 FAILURE_ASSOCIATION_TIMEOUT = 1;
821 FAILURE_ASSOCIATION_REJECTION = 2;
822 FAILURE_AUTHENTICATION_GENERAL = 3;
823 FAILURE_AUTHENTICATION_EAP = 4;
824 FAILURE_DHCP = 5;
825 FAILURE_NETWORK_DISCONNECTION = 6;
826 FAILURE_ROAM_TIMEOUT = 7;
827 }
828 // true represents a successful connection
829 optional bool connection_result = 1;
830 // reason for the connection failure
831 optional FailureCode failure_code = 2;
832 // scan rssi before the connection attempt
833 optional int32 rssi = 3;
834}
835
836/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700837 * Logs when memory stats of a process is reported.
838 *
839 * Logged from:
840 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
841 */
842message ProcessMemoryStatReported {
843 optional int32 uid = 1;
844 optional string process_name = 2;
845 optional string package_name = 3;
846 //TODO: remove this when validation is done
847 optional int64 version = 9;
848 optional int64 pss = 4;
849 optional int64 uss = 5;
850 optional int64 rss = 6;
851 enum Type {
852 ADD_PSS_INTERNAL_SINGLE = 0;
853 ADD_PSS_INTERNAL_ALL_MEM = 1;
854 ADD_PSS_INTERNAL_ALL_POLL = 2;
855 ADD_PSS_EXTERNAL = 3;
856 ADD_PSS_EXTERNAL_SLOW = 4;
857 }
858 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800859 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700860}
861
862/**
Bookatzc1a050a2017-10-10 15:49:28 -0700863 * Logs that a process started, finished, crashed, or ANRed.
864 *
865 * Logged from:
866 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
867 */
868message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700869 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700870
David Chen0b5c90c2018-01-25 16:51:49 -0800871 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800872 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700873
Bookatzddccf0a2017-11-28 16:48:14 -0800874 // What lifecycle state the process changed to.
875 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800876 enum State {
877 FINISHED = 0;
878 STARTED = 1;
879 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800880 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800881 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700882}
883
Bookatzc1a050a2017-10-10 15:49:28 -0700884/**
885 * Logs when the ble scan state changes.
886 *
887 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700888 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700889 */
890message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800891 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700892 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700893
894 enum State {
895 OFF = 0;
896 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700897 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
898 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700899 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800900 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700901 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800902 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700903 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800904 (state_field_option).nested = true
905 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700906
Bookatze5ec0b42018-03-26 13:34:56 -0700907 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700908 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700909 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700910 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700911 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700912 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700913}
914
915/**
916 * Logs reporting of a ble scan finding results.
917 *
918 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700919 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700920 */
Bookatzae6738e2018-09-13 11:38:56 -0700921// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700922message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800923 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700924
925 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800926 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700927}
928
929/**
930 * Logs when a sensor state changes.
931 *
932 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700933 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700934 */
935message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800936 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700937
Bookatzc1a050a2017-10-10 15:49:28 -0700938 // The id (int) of the sensor.
939 optional int32 sensor_id = 2;
940
941 enum State {
942 OFF = 0;
943 ON = 1;
944 }
945 optional State state = 3;
946}
947
Bookatzc1a050a2017-10-10 15:49:28 -0700948/**
949 * Logs when GPS state changes.
950 *
951 * Logged from:
952 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
953 */
954message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800955 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700956
957 enum State {
958 OFF = 0;
959 ON = 1;
960 }
961 optional State state = 2;
962}
963
Bookatz48d362e2018-11-06 15:49:08 -0800964/**
965 * Logs when GPS signal quality.
966 *
967 * Logged from:
968 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
969 */
970message GpsSignalQualityChanged {
971 optional android.server.location.GpsSignalQualityEnum level = 1;
972}
973
Bookatzc1a050a2017-10-10 15:49:28 -0700974
975/**
976 * Logs when a sync manager sync state changes.
977 *
978 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700979 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700980 */
981message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800982 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
David Chen0b5c90c2018-01-25 16:51:49 -0800984 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800985 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700986
987 enum State {
988 OFF = 0;
989 ON = 1;
990 }
991 optional State state = 3;
992}
993
Yangster-mac96353002018-09-05 11:18:55 -0700994/*
995 * Deferred job stats.
996 *
997 * Logged from:
998 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
999*/
1000message DeferredJobStatsReported {
1001 repeated AttributionNode attribution_node = 1;
1002
1003 // Number of jobs deferred.
1004 optional int32 num_jobs_deferred = 2;
1005
1006 // Time since the last job runs.
1007 optional int64 time_since_last_job_millis = 3;
1008}
1009
Bookatzc1a050a2017-10-10 15:49:28 -07001010/**
1011 * Logs when a job scheduler job state changes.
1012 *
1013 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001014 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001015 */
1016message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001018
1019 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001020 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001021
1022 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001023 FINISHED = 0;
1024 STARTED = 1;
1025 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001026 }
1027 optional State state = 3;
1028
Tej Singh33a412b2018-03-16 18:43:59 -07001029 // The reason a job has stopped.
1030 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001031 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001032 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001033
1034 // The standby bucket of the app that scheduled the job. These match the framework constants
1035 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1036 // already assigned 0.
1037 enum Bucket {
1038 UNKNOWN = -1;
1039 ACTIVE = 0;
1040 WORKING_SET = 1;
1041 FREQUENT = 2;
1042 RARE = 3;
1043 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001044 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001045 }
1046 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1047
1048 // The job id (as assigned by the app).
1049 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001050
1051 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1052 // constraints as they are always assumed to be set.
1053 optional bool has_charging_constraint = 7;
1054 optional bool has_battery_not_low_constraint = 8;
1055 optional bool has_storage_not_low_constraint = 9;
1056 optional bool has_timing_delay_constraint = 10;
1057 optional bool has_deadline_constraint = 11;
1058 optional bool has_idle_constraint = 12;
1059 optional bool has_connectivity_constraint = 13;
1060 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001061}
1062
1063/**
1064 * Logs when the audio state changes.
1065 *
1066 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001067 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001068 */
1069message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001070 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001071
1072 enum State {
1073 OFF = 0;
1074 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001075 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1076 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001077 }
1078 optional State state = 2;
1079}
1080
1081/**
1082 * Logs when the video codec state changes.
1083 *
1084 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001085 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001086 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001087message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001088 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001089
1090 enum State {
1091 OFF = 0;
1092 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001093 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1094 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001095 }
1096 optional State state = 2;
1097}
1098
1099/**
1100 * Logs when the flashlight state changes.
1101 *
1102 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001103 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001104 */
1105message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001106 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001107
1108 enum State {
1109 OFF = 0;
1110 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001111 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1112 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001113 }
1114 optional State state = 2;
1115}
1116
1117/**
1118 * Logs when the camera state changes.
1119 *
1120 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001121 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001122 */
1123message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001124 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001125
1126 enum State {
1127 OFF = 0;
1128 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001129 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1130 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001131 }
1132 optional State state = 2;
1133}
1134
1135/**
1136 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001137 *
1138 * Logged from:
1139 * TODO
1140 */
Bookatzd6746242017-10-24 18:39:35 -07001141message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001142 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001143 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001144
Bookatz1a1b0462018-01-12 11:47:03 -08001145 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1146 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001147 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001148
1149 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001150 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001151
1152 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001153 RELEASE = 0;
1154 ACQUIRE = 1;
1155 CHANGE_RELEASE = 2;
1156 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001157 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001158 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001159 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001160 (state_field_option).default_state_value = 0,
1161 (state_field_option).nested = true
1162 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001163}
1164
1165/**
Bookatzc1a050a2017-10-10 15:49:28 -07001166 * Logs when a partial wakelock is considered 'long' (over 1 min).
1167 *
1168 * Logged from:
1169 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1170 */
1171message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001172 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001173
Yao Chend54f9dd2017-10-17 17:37:48 +00001174 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1175 optional string tag = 2;
1176
Bookatzc1a050a2017-10-10 15:49:28 -07001177 // TODO: I have no idea what this is.
1178 optional string history_tag = 3;
1179
1180 enum State {
1181 OFF = 0;
1182 ON = 1;
1183 }
1184 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001185}
1186
Bookatzc1a050a2017-10-10 15:49:28 -07001187/**
Bookatza66083f2018-09-20 17:24:00 -07001188 * Logs when the device is interactive, according to the PowerManager Notifier.
1189 *
1190 * Logged from:
1191 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1192 */
1193message InteractiveStateChanged {
1194 enum State {
1195 OFF = 0;
1196 ON = 1;
1197 }
1198 optional State state = 1;
1199}
1200
1201/**
Bookatzc1a050a2017-10-10 15:49:28 -07001202 * Logs Battery Saver state change.
1203 *
1204 * Logged from:
1205 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1206 */
1207message BatterySaverModeStateChanged {
1208 enum State {
1209 OFF = 0;
1210 ON = 1;
1211 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001212 optional State state = 1
1213 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001214}
1215
1216/**
1217 * Logs Doze mode state change.
1218 *
1219 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001220 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001221 */
1222message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001223 optional android.server.DeviceIdleModeEnum state = 1
1224 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001225}
1226
1227
1228/**
1229 * Logs state change of Doze mode including maintenance windows.
1230 *
1231 * Logged from:
1232 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1233 */
1234message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001235 optional android.server.DeviceIdleModeEnum state = 1
1236 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001237}
1238
1239/**
1240 * Logs screen brightness level.
1241 *
1242 * Logged from:
1243 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1244 */
1245message ScreenBrightnessChanged {
1246 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1247 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001248}
1249
1250/**
1251 * Logs battery level (percent full, from 0 to 100).
1252 *
1253 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001254 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001255 */
1256message BatteryLevelChanged {
1257 // Battery level. Should be in [0, 100].
1258 optional int32 battery_level = 1;
1259}
1260
1261/**
1262 * Logs change in charging status of the device.
1263 *
1264 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001265 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001266 */
1267message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001268 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001269 optional android.os.BatteryStatusEnum state = 1
1270 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001271}
1272
1273/**
1274 * Logs whether the device is plugged in, and what power source it is using.
1275 *
1276 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001277 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001278 */
1279message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001280 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001281 optional android.os.BatteryPluggedStateEnum state = 1
1282 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001283}
1284
Bookatz8c6571b2017-10-24 15:04:41 -07001285/**
1286 * Logs when an app's wakeup alarm fires.
1287 *
1288 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001289 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001290 */
1291message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001292 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001293
1294 // Name of the wakeup alarm.
1295 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001296
1297 // Name of source package (for historical reasons, since BatteryStats tracked it).
1298 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001299
Ben Murdoch3389f1522019-05-21 15:05:34 +01001300 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001301 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001302}
1303
1304/**
1305 * Logs when an an app causes the mobile radio to change state.
1306 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1307 *
1308 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001309 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001310 */
1311message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001312 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001313
Bookatz1a1b0462018-01-12 11:47:03 -08001314 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1315 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001316}
1317
1318/**
1319 * Logs when an an app causes the wifi radio to change state.
1320 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1321 *
1322 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001323 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001324 */
1325message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001326 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001327
Bookatz1a1b0462018-01-12 11:47:03 -08001328 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1329 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001330}
1331
1332/**
1333 * Logs kernel wakeup reasons and aborts.
1334 *
1335 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001336 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001337 */
1338message KernelWakeupReported {
1339 // Name of the kernel wakeup reason (or abort).
1340 optional string wakeup_reason_name = 1;
1341
1342 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001343 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001344}
1345
1346/**
Bookatzda1798c2018-12-13 14:16:00 -08001347 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001348 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001349 *
1350 * Logged from:
1351 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1352 */
1353message WifiEnabledStateChanged {
1354 enum State {
1355 OFF = 0;
1356 ON = 1;
1357 }
1358 optional State state = 1;
1359}
1360
1361/**
tsaichristinececebdc2020-02-04 14:05:56 -08001362 * This atom is deprecated starting in R.
1363 *
Bookatzda1798c2018-12-13 14:16:00 -08001364 * 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 -08001365 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1366 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001367 *
1368 * Logged from:
1369 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1370 */
1371message WifiRunningStateChanged {
1372 repeated AttributionNode attribution_node = 1;
1373
1374 enum State {
1375 OFF = 0;
1376 ON = 1;
1377 }
1378 optional State state = 2;
1379}
1380
1381/**
Bookatze5885242017-10-24 20:10:31 -07001382 * Logs wifi locks held by an app.
1383 *
1384 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001385 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001386 */
1387message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001388 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001389
1390 enum State {
1391 OFF = 0;
1392 ON = 1;
1393 }
1394 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001395
1396 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1397 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001398}
1399
1400/**
1401 * Logs wifi signal strength changes.
1402 *
1403 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001404 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001405 */
1406message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001407 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1408 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001409}
1410
1411/**
1412 * Logs wifi scans performed by an app.
1413 *
1414 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001415 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001416 */
1417message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001418 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001419
1420 enum State {
1421 OFF = 0;
1422 ON = 1;
1423 }
1424 optional State state = 2;
1425}
1426
1427/**
Tej Singh4503e102018-01-04 14:35:01 -08001428 * Logs wifi multicast locks held by an app
1429 *
1430 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001431 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001432 */
1433message WifiMulticastLockStateChanged {
1434 repeated AttributionNode attribution_node = 1;
1435
1436 enum State {
1437 OFF = 0;
1438 ON = 1;
1439 }
1440 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001441
1442 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001443}
1444
1445/**
Tej Singh1ea42892018-01-19 09:27:00 -08001446 * Logs shutdown reason and duration on next boot.
1447 *
1448 * Logged from:
1449 * frameworks/base/core/java/com/android/server/BootReceiver.java
1450 */
1451message ShutdownSequenceReported {
1452 // True if shutdown is for a reboot. Default: false if we do not know.
1453 optional bool reboot = 1;
1454
1455 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1456 optional string reason = 2;
1457
1458 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1459 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001460 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001461
1462 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001463 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001464}
1465
Tej Singh6483ea42018-01-25 17:45:49 -08001466
1467/**
1468 * Logs boot reason and duration.
1469 *
1470 * Logged from:
1471 * system/core/bootstat/bootstat.cpp
1472 */
1473message BootSequenceReported {
1474 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1475 // Default: "<EMPTY>" if not available.
1476 optional string bootloader_reason = 1;
1477
1478 // Reason for system boot. Eg. bootloader, reboot,userrequested
1479 // Default: "<EMPTY>" if not available.
1480 optional string system_reason = 2;
1481
1482 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001483 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001484
1485 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001486 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001487
1488 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001489 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001490
1491 // Time since last boot in ms. Default: 0 if not available.
1492 optional int64 time_since_last_boot = 6;
1493}
1494
Tej Singhc477d9c2018-02-05 18:31:39 -08001495
1496/**
1497 * Logs call state and disconnect cause (if applicable).
1498 *
1499 * Logged from:
1500 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1501 */
1502message CallStateChanged {
1503 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1504 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1505 optional android.telecom.CallStateEnum call_state = 1;
1506
1507 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1508 // This value is only applicable when the call_state is DISCONNECTED, and
1509 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1510 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1511 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1512
1513 // True if the call is self-managed, which are apps that use the
1514 // telecom infrastructure to make their own calls.
1515 optional bool self_managed = 3;
1516
1517 // True if call is external. External calls are calls on connected Wear
1518 // devices but show up in Telecom so the user can pull them onto the device.
1519 optional bool external_call = 4;
1520}
1521
Tej Singh1ea42892018-01-19 09:27:00 -08001522/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001523 * Logs keyguard state. The keyguard is the lock screen.
1524 *
1525 * Logged from:
1526 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1527 */
1528message KeyguardStateChanged {
1529 enum State {
1530 UNKNOWN = 0;
1531 // The keyguard is hidden when the phone is unlocked.
1532 HIDDEN = 1;
1533 // The keyguard is shown when the phone is locked (screen turns off).
1534 SHOWN= 2;
1535 // The keyguard is occluded when something is overlaying the keyguard.
1536 // Eg. Opening the camera while on the lock screen.
1537 OCCLUDED = 3;
1538 }
1539 optional State state = 1;
1540}
1541
1542/**
1543 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1544 * prompts the user to enter a password (pattern, pin, etc).
1545 *
1546 * Logged from:
1547 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1548 */
1549
1550message KeyguardBouncerStateChanged {
1551 enum State {
1552 UNKNOWN = 0;
1553 // Bouncer is hidden, either as a result of successfully entering the
1554 // password, screen timing out, or user going back to lock screen.
1555 HIDDEN = 1;
1556 // This is when the user is being prompted to enter the password.
1557 SHOWN = 2;
1558 }
1559 optional State state = 1;
1560}
1561
1562/**
1563 * Logs the result of entering a password into the keyguard bouncer.
1564 *
1565 * Logged from:
1566 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1567 */
1568message KeyguardBouncerPasswordEntered {
1569 enum BouncerResult {
1570 UNKNOWN = 0;
1571 // The password entered was incorrect.
1572 FAILURE = 1;
1573 // The password entered was correct.
1574 SUCCESS = 2;
1575 }
1576 optional BouncerResult result = 1;
1577}
1578
Tej Singha883b372018-02-15 11:30:01 -08001579/*
1580 * Logs changes to the configuration of the device. The configuration is defined
1581 * in frameworks/base/core/java/android/content/res/Configuration.java
1582 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1583 * Please go there to interpret the possible values each field can be.
1584 *
1585 * Logged from:
1586 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1587 */
1588message ResourceConfigurationChanged {
1589 // Bit mask of color capabilities of the screen.
1590 // Contains information about the color gamut and hdr mode of the screen.
1591 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001592 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001593
1594 // The target screen density being rendered to.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001596 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001597
1598 // Current user preference for the scaling factor for fonts,
1599 // relative to the base density scaling.
1600 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001601 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001602
1603 // Flag indicating whether the hard keyboard is hidden.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001606
1607 // The type of keyboard attached to the device.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1609 optional int32 keyboard = 5;
1610
1611 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1612 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001613 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001614
1615 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1616 // 0 if undefined.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1618 optional int32 mcc = 7;
1619
1620 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1621 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1622 // MNC_ZERO symbol defined in Configuration.java.
1623 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1624 optional int32 mnc = 8;
1625
1626 // The kind of navigation available on the device.
1627 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1628 optional int32 navigation = 9;
1629
1630 // Flag indicating whether the navigation is available.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001632 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001633
1634 // Overall orientation of the screen.
1635 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1636 optional int32 orientation = 11;
1637
1638 // The current height of the available screen space, in dp units.
1639 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001640 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001641
1642 // Bit mask of overall layout of the screen.
1643 // Contains information about screen size, whether the screen is wider/taller
1644 // than normal, whether the screen layout is right-tl-left or left-to-right,
1645 // and whether the screen has a rounded shape.
1646 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001647 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001648
1649 // Current width of the available screen space, in dp units.
1650 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001651 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001652
1653 // The smallest screen size an application will see in normal operation.
1654 // This is the smallest value of both screenWidthDp and screenHeightDp
1655 // in portrait and landscape.
1656 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001657 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001658
1659 // The type of touch screen attached to the device.
1660 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1661 optional int32 touchscreen = 16;
1662
1663 // Bit mask of the ui mode.
1664 // Contains information about the overall ui mode of the device.
1665 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1666 // Also contains information about whether the device is in night mode.
1667 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001668 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001669}
1670
Tej Singheee317b2018-03-07 19:28:05 -08001671
1672/**
1673 * Logs changes in the connection state of the mobile radio.
1674 *
1675 * Logged from:
1676 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1677 */
1678message MobileConnectionStateChanged {
1679 // States are from the state machine DataConnection.java.
1680 enum State {
1681 UNKNOWN = 0;
1682 // The connection is inactive, or disconnected.
1683 INACTIVE = 1;
1684 // The connection is being activated, or connecting.
1685 ACTIVATING = 2;
1686 // The connection is active, or connected.
1687 ACTIVE = 3;
1688 // The connection is disconnecting.
1689 DISCONNECTING = 4;
1690 // The connection is disconnecting after creating a connection.
1691 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1692 }
1693 optional State state = 1;
1694 // For multi-sim phones, this distinguishes between the sim cards.
1695 optional int32 sim_slot_index = 2;
1696 // Used to identify the connection. Starts at 0 and increments by 1 for
1697 // every new network created. Resets whenever the device reboots.
1698 optional int32 data_connection_id = 3;
1699 // A bitmask for the capabilities of this connection.
1700 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1701 // Default value (if we have no information): 0
1702 optional int64 capabilities = 4;
1703 // If this connection has internet.
1704 // This just checks if the DEFAULT bit of capabilities is set.
1705 optional bool has_internet = 5;
1706}
1707
1708/**
1709 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1710 *
1711 * Logged from:
1712 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1713 */
1714message MobileRadioTechnologyChanged {
1715 optional android.telephony.NetworkTypeEnum state = 1;
1716 // For multi-sim phones, this distinguishes between the sim cards.
1717 optional int32 sim_slot_index = 2;
1718}
1719
Andrew Chantb56388b2018-03-22 21:07:33 -07001720/**
1721 * Logs the VID and PID of any connected USB devices.
1722 *
1723 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1724 *
1725 * Logged by Vendor.
1726 */
1727message UsbDeviceAttached {
1728 optional int32 vid = 1;
1729 optional int32 pid = 2;
1730 optional bool has_audio = 3;
1731 optional bool has_hid = 4;
1732 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001733 enum State {
1734 STATE_DISCONNECTED = 0;
1735 STATE_CONNECTED = 1;
1736 }
1737 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001738 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001739}
1740
Tej Singheee317b2018-03-07 19:28:05 -08001741
Tej Singhdd7bd352018-02-09 19:33:15 -08001742/**
Tej Singh5d991e12018-03-09 19:48:11 -08001743 * Logs when Bluetooth is enabled and disabled.
1744 *
1745 * Logged from:
1746 * services/core/java/com/android/server/BluetoothManagerService.java
1747 */
1748message BluetoothEnabledStateChanged {
1749 repeated AttributionNode attribution_node = 1;
1750 // Whether or not bluetooth is enabled on the device.
1751 enum State {
1752 UNKNOWN = 0;
1753 ENABLED = 1;
1754 DISABLED = 2;
1755 }
1756 optional State state = 2;
1757 // The reason for being enabled/disabled.
1758 // Eg. Airplane mode, crash, application request.
1759 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1760 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001761 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001762}
1763
1764/**
Jack Hed9837c82019-01-09 01:19:13 -08001765 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001766 *
1767 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001768 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1769 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001770 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001771 */
1772message BluetoothConnectionStateChanged {
1773 // The state of the connection.
1774 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1775 optional android.bluetooth.ConnectionStateEnum state = 1;
1776 // An identifier that can be used to match connect and disconnect events.
1777 // Currently is last two bytes of a hash of a device level ID and
1778 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001779 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001780 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001781 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1782 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001783 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001784 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001785 // An identifier that can be used to match events for this device.
1786 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1787 // Salt: Randomly generated 256 bit value
1788 // Hash algorithm: HMAC-SHA256
1789 // Size: 32 byte
1790 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001791 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001792 // An identifier that can be used to match events for this device.
1793 // The incremental identifier is locally generated and guaranteed not derived
1794 // from any globally unique hardware id.
1795 // For paired devices, it stays consistent between Bluetooth toggling for the
1796 // same remote device.
1797 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1798 // session for the same remote device.
1799 // Default: 0 if the device's metric id is unknown.
1800 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001801}
1802
1803/**
1804 * Logs when a Bluetooth device connects and disconnects over ACL
1805 *
1806 * Logged from:
1807 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1808 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001809 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001810 */
1811message BluetoothAclConnectionStateChanged {
1812 // An identifier that can be used to match events for this device.
1813 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1814 // Salt: Randomly generated 256 bit value
1815 // Hash algorithm: HMAC-SHA256
1816 // Size: 32 byte
1817 // Default: null or empty if the device identifier is not known
1818 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1819 // The state of the connection.
1820 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1821 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001822 // An identifier that can be used to match events for this device.
1823 // The incremental identifier is locally generated and guaranteed not derived
1824 // from any globally unique hardware id.
1825 // For paired devices, it stays consistent between Bluetooth toggling for the
1826 // same remote device.
1827 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1828 // session for the same remote device.
1829 // Default: 0 if the device's metric id is unknown.
1830 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001831}
1832
1833/**
1834 * Logs when a Bluetooth device connects and disconnects over SCO
1835 *
1836 * Logged from:
1837 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1838 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1839 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001840 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001841 */
1842message BluetoothScoConnectionStateChanged {
1843 // An identifier that can be used to match events for this device.
1844 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1845 // Salt: Randomly generated 256 bit value
1846 // Hash algorithm: HMAC-SHA256
1847 // Size: 32 byte
1848 // Default: null or empty if the device identifier is not known
1849 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1850 // The state of the connection.
1851 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1852 optional android.bluetooth.ConnectionStateEnum state = 2;
1853 // Codec used for this SCO connection
1854 // Default: UNKNOWN
1855 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001856 // An identifier that can be used to match events for this device.
1857 // The incremental identifier is locally generated and guaranteed not derived
1858 // from any globally unique hardware id.
1859 // For paired devices, it stays consistent between Bluetooth toggling for the
1860 // same remote device.
1861 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1862 // session for the same remote device.
1863 // Default: 0 if the device's metric id is unknown.
1864 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001865}
1866
Jack Hec27040a2019-01-09 20:54:41 -08001867/**
1868 * Logged when active device of a profile changes
1869 *
1870 * Logged from:
1871 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1872 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1873 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1874 */
1875message BluetoothActiveDeviceChanged {
1876 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1877 // From android.bluetooth.BluetoothProfile
1878 optional int32 bt_profile = 1;
1879 // An identifier that can be used to match events for this new active device.
1880 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1881 // Salt: Randomly generated 256 bit value
1882 // Hash algorithm: HMAC-SHA256
1883 // Size: 32 byte
1884 // Default: null or empty if there is no active device for this profile
1885 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001886 // An identifier that can be used to match events for this device.
1887 // The incremental identifier is locally generated and guaranteed not derived
1888 // from any globally unique hardware id.
1889 // For paired devices, it stays consistent between Bluetooth toggling for the
1890 // same remote device.
1891 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1892 // session for the same remote device.
1893 // Default: 0 if the device's metric id is unknown.
1894 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001895}
1896
Jack Heab86dbd22018-12-18 15:43:27 -08001897// Logs when there is an event affecting Bluetooth device's link layer connection.
1898// - This event is triggered when there is a related HCI command or event
1899// - Users of this metrics can deduce Bluetooth device's connection state from these events
1900// - HCI commands are logged before the command is sent, after receiving command status, and after
1901// receiving command complete
1902// - HCI events are logged when they arrive
1903//
1904// Low level log from system/bt
1905//
1906// Bluetooth classic commands:
1907// - CMD_CREATE_CONNECTION
1908// - CMD_DISCONNECT
1909// - CMD_CREATE_CONNECTION_CANCEL
1910// - CMD_ACCEPT_CONNECTION_REQUEST
1911// - CMD_REJECT_CONNECTION_REQUEST
1912// - CMD_SETUP_ESCO_CONNECTION
1913// - CMD_ACCEPT_ESCO_CONNECTION
1914// - CMD_REJECT_ESCO_CONNECTION
1915// - CMD_ENH_SETUP_ESCO_CONNECTION
1916// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1917//
1918// Bluetooth low energy commands:
1919// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1920// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1921// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1922// - CMD_BLE_CLEAR_WHITE_LIST
1923// - CMD_BLE_ADD_WHITE_LIST
1924// - CMD_BLE_REMOVE_WHITE_LIST
1925//
1926// Bluetooth classic events:
1927// - EVT_CONNECTION_COMP
1928// - EVT_CONNECTION_REQUEST
1929// - EVT_DISCONNECTION_COMP
1930// - EVT_ESCO_CONNECTION_COMP
1931// - EVT_ESCO_CONNECTION_CHANGED
1932//
1933// Bluetooth low energy meta events:
1934// - BLE_EVT_CONN_COMPLETE_EVT
1935// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1936//
1937// Next tag: 10
1938message BluetoothLinkLayerConnectionEvent {
1939 // An identifier that can be used to match events for this device.
1940 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1941 // Salt: Randomly generated 256 bit value
1942 // Hash algorithm: HMAC-SHA256
1943 // Size: 32 byte
1944 // Default: null or empty if the device identifier is not known
1945 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1946 // Connection handle of this connection if available
1947 // Range: 0x0000 - 0x0EFF (12 bits)
1948 // Default: 0xFFFF if the handle is unknown
1949 optional int32 connection_handle = 2;
1950 // Direction of the link
1951 // Default: DIRECTION_UNKNOWN
1952 optional android.bluetooth.DirectionEnum direction = 3;
1953 // Type of this link
1954 // Default: LINK_TYPE_UNKNOWN
1955 optional android.bluetooth.LinkTypeEnum type = 4;
1956
1957 // Reason metadata for this link layer connection event, rules for interpretation:
1958 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1959 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1960 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1961 // set and valid, ignore hci_ble_event
1962
1963 // HCI command associated with this event
1964 // Default: CMD_UNKNOWN
1965 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1966 // HCI event associated with this event
1967 // Default: EVT_UNKNOWN
1968 optional android.bluetooth.hci.EventEnum hci_event = 6;
1969 // HCI BLE meta event associated with this event
1970 // Default: BLE_EVT_UNKNOWN
1971 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1972 // HCI command status code if this is triggerred by hci_cmd
1973 // Default: STATUS_UNKNOWN
1974 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1975 // HCI reason code associated with this event
1976 // Default: STATUS_UNKNOWN
1977 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001978 // An identifier that can be used to match events for this device.
1979 // The incremental identifier is locally generated and guaranteed not derived
1980 // from any globally unique hardware id.
1981 // For paired devices, it stays consistent between Bluetooth toggling for the
1982 // same remote device.
1983 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1984 // session for the same remote device.
1985 // Default: 0 if the device's metric id is unknown.
1986 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001987}
1988
Howard Roe103fe22019-01-17 16:52:16 -08001989/**
1990 * Logs when a module is rolled back by Watchdog.
1991 *
1992 * Logged from: Rollback Manager
1993 */
1994message WatchdogRollbackOccurred {
1995 enum RollbackType {
1996 UNKNOWN = 0;
1997 ROLLBACK_INITIATE = 1;
1998 ROLLBACK_SUCCESS = 2;
1999 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002000 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002001 }
2002 optional RollbackType rollback_type = 1;
2003
2004 optional string package_name = 2;
2005
2006 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002007
2008 enum RollbackReasonType {
2009 REASON_UNKNOWN = 0;
2010 REASON_NATIVE_CRASH = 1;
2011 REASON_EXPLICIT_HEALTH_CHECK = 2;
2012 REASON_APP_CRASH = 3;
2013 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002014 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002015 }
2016 optional RollbackReasonType rollback_reason = 4;
2017
2018 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2019 // is initiated. Empty if the package is unknown.
2020 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002021
2022 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002023}
2024
Jack Hec27040a2019-01-09 20:54:41 -08002025/**
2026 * Logs when there is a change in Bluetooth A2DP playback state
2027 *
2028 * Logged from:
2029 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2030 */
2031message BluetoothA2dpPlaybackStateChanged {
2032 // An identifier that can be used to match events for this device.
2033 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2034 // Salt: Randomly generated 256 bit value
2035 // Hash algorithm: HMAC-SHA256
2036 // Size: 32 byte
2037 // Default: null or empty if the device identifier is not known
2038 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2039 // Current playback state
2040 // Default: PLAYBACK_STATE_UNKNOWN
2041 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2042 // Current audio coding mode
2043 // Default: AUDIO_CODING_MODE_UNKNOWN
2044 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002045 // An identifier that can be used to match events for this device.
2046 // The incremental identifier is locally generated and guaranteed not derived
2047 // from any globally unique hardware id.
2048 // For paired devices, it stays consistent between Bluetooth toggling for the
2049 // same remote device.
2050 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2051 // session for the same remote device.
2052 // Default: 0 if the device's metric id is unknown.
2053 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002054}
2055
2056/**
2057 * Logs when there is a change in A2DP codec config for a particular remote device
2058 *
2059 * Logged from:
2060 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2061 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2062 */
2063message BluetoothA2dpCodecConfigChanged {
2064 // An identifier that can be used to match events for this device.
2065 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2066 // Salt: Randomly generated 256 bit value
2067 // Hash algorithm: HMAC-SHA256
2068 // Size: 32 byte
2069 // Default: null or empty if the device identifier is not known
2070 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2071 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2072 // Default SOURCE_CODEC_TYPE_INVALID
2073 optional int32 codec_type = 2;
2074 // Codec priroity, the higher the more preferred, -1 for disabled
2075 // Default: CODEC_PRIORITY_DEFAULT
2076 optional int32 codec_priority = 3;
2077 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2078 // Default: SAMPLE_RATE_NONE
2079 optional int32 sample_rate = 4;
2080 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2081 // Default: BITS_PER_SAMPLE_NONE
2082 optional int32 bits_per_sample = 5;
2083 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2084 // Default: CHANNEL_MODE_NONE
2085 optional int32 channel_mode = 6;
2086 // Codec specific values
2087 // Default 0
2088 optional int64 codec_specific_1 = 7;
2089 optional int64 codec_specific_2 = 8;
2090 optional int64 codec_specific_3 = 9;
2091 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002092 // An identifier that can be used to match events for this device.
2093 // The incremental identifier is locally generated and guaranteed not derived
2094 // from any globally unique hardware id.
2095 // For paired devices, it stays consistent between Bluetooth toggling for the
2096 // same remote device.
2097 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2098 // session for the same remote device.
2099 // Default: 0 if the device's metric id is unknown.
2100 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002101}
2102
2103/**
2104 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2105 * Each codec's capability is logged separately due to statsd restriction
2106 *
2107 * Logged from:
2108 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2109 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2110 */
2111message BluetoothA2dpCodecCapabilityChanged {
2112 // An identifier that can be used to match events for this device.
2113 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2114 // Salt: Randomly generated 256 bit value
2115 // Hash algorithm: HMAC-SHA256
2116 // Size: 32 byte
2117 // Default: null or empty if the device identifier is not known
2118 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2119 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2120 // Default SOURCE_CODEC_TYPE_INVALID
2121 optional int32 codec_type = 2;
2122 // Codec priroity, the higher the more preferred, -1 for disabled
2123 // Default: CODEC_PRIORITY_DEFAULT
2124 optional int32 codec_priority = 3;
2125 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2126 // in BluetoothCodecConfig
2127 // Default: empty and SAMPLE_RATE_NONE for individual item
2128 optional int32 sample_rate = 4;
2129 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2130 // in BluetoothCodecConfig
2131 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2132 optional int32 bits_per_sample = 5;
2133 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2134 // BluetoothCodecConfig
2135 // Default: empty and CHANNEL_MODE_NONE for individual item
2136 optional int32 channel_mode = 6;
2137 // Codec specific values
2138 // Default 0
2139 optional int64 codec_specific_1 = 7;
2140 optional int64 codec_specific_2 = 8;
2141 optional int64 codec_specific_3 = 9;
2142 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002143 // An identifier that can be used to match events for this device.
2144 // The incremental identifier is locally generated and guaranteed not derived
2145 // from any globally unique hardware id.
2146 // For paired devices, it stays consistent between Bluetooth toggling for the
2147 // same remote device.
2148 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2149 // session for the same remote device.
2150 // Default: 0 if the device's metric id is unknown.
2151 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002152}
2153
2154/**
2155 * Logs when A2DP failed to read from PCM source.
2156 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2157 *
2158 * Logged from:
2159 * system/bt
2160 */
2161message BluetoothA2dpAudioUnderrunReported {
2162 // An identifier that can be used to match events for this device.
2163 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2164 // Salt: Randomly generated 256 bit value
2165 // Hash algorithm: HMAC-SHA256
2166 // Size: 32 byte
2167 // Default: null or empty if the device identifier is not known
2168 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2169 // Encoding interval in nanoseconds
2170 // Default: 0
2171 optional int64 encoding_interval_nanos = 2;
2172 // Number of bytes of PCM data that could not be read from the source
2173 // Default: 0
2174 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002175 // An identifier that can be used to match events for this device.
2176 // The incremental identifier is locally generated and guaranteed not derived
2177 // from any globally unique hardware id.
2178 // For paired devices, it stays consistent between Bluetooth toggling for the
2179 // same remote device.
2180 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2181 // session for the same remote device.
2182 // Default: 0 if the device's metric id is unknown.
2183 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002184}
2185
2186/**
2187 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2188 * buffer queue is full and we have to drop data
2189 *
2190 * Logged from:
2191 * system/bt
2192 */
2193message BluetoothA2dpAudioOverrunReported {
2194 // An identifier that can be used to match events for this device.
2195 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2196 // Salt: Randomly generated 256 bit value
2197 // Hash algorithm: HMAC-SHA256
2198 // Size: 32 byte
2199 // Default: null or empty if the device identifier is not known
2200 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2201 // Encoding interval in nanoseconds
2202 // Default: 0
2203 optional int64 encoding_interval_nanos = 2;
2204 // Number of buffers dropped in this event
2205 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2206 // Default: 0
2207 optional int32 num_dropped_buffers = 3;
2208 // Number of encoded buffers dropped in this event
2209 // Default 0
2210 optional int32 num_dropped_encoded_frames = 4;
2211 // Number of encoded bytes dropped in this event
2212 // Default: 0
2213 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002214 // An identifier that can be used to match events for this device.
2215 // The incremental identifier is locally generated and guaranteed not derived
2216 // from any globally unique hardware id.
2217 // For paired devices, it stays consistent between Bluetooth toggling for the
2218 // same remote device.
2219 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2220 // session for the same remote device.
2221 // Default: 0 if the device's metric id is unknown.
2222 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002223}
2224
2225/**
2226 * Logs when we receive reports regarding a device's RSSI value
2227 *
2228 * Logged from:
2229 * system/bt
2230 */
2231message BluetoothDeviceRssiReported {
2232 // An identifier that can be used to match events for this device.
2233 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2234 // Salt: Randomly generated 256 bit value
2235 // Hash algorithm: HMAC-SHA256
2236 // Size: 32 byte
2237 // Default: null or empty if the device identifier is not known
2238 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2239 // Connection handle of this connection if available
2240 // Range: 0x0000 - 0x0EFF (12 bits)
2241 // Default: 0xFFFF if the handle is unknown
2242 optional int32 connection_handle = 2;
2243 // HCI command status code if this is triggerred by hci_cmd
2244 // Default: STATUS_UNKNOWN
2245 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2246 // BR/EDR
2247 // Range: -128 ≤ N ≤ 127 (signed integer)
2248 // Units: dB
2249 // LE:
2250 // Range: -127 to 20, 127 (signed integer)
2251 // Units: dBm
2252 // Invalid when an out of range value is reported
2253 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002254 // An identifier that can be used to match events for this device.
2255 // The incremental identifier is locally generated and guaranteed not derived
2256 // from any globally unique hardware id.
2257 // For paired devices, it stays consistent between Bluetooth toggling for the
2258 // same remote device.
2259 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2260 // session for the same remote device.
2261 // Default: 0 if the device's metric id is unknown.
2262 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002263}
2264
2265/**
2266 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2267 *
2268 * Logged from:
2269 * system/bt
2270 */
2271message BluetoothDeviceFailedContactCounterReported {
2272 // An identifier that can be used to match events for this device.
2273 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2274 // Salt: Randomly generated 256 bit value
2275 // Hash algorithm: HMAC-SHA256
2276 // Size: 32 byte
2277 // Default: null or empty if the device identifier is not known
2278 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2279 // Connection handle of this connection if available
2280 // Range: 0x0000 - 0x0EFF (12 bits)
2281 // Default: 0xFFFF if the handle is unknown
2282 optional int32 connection_handle = 2;
2283 // HCI command status code if this is triggerred by hci_cmd
2284 // Default: STATUS_UNKNOWN
2285 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2286 // Number of consecutive failed contacts for a connection corresponding to the Handle
2287 // Range: uint16_t, 0-0xFFFF
2288 // Default: 0xFFFFF
2289 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002290 // An identifier that can be used to match events for this device.
2291 // The incremental identifier is locally generated and guaranteed not derived
2292 // from any globally unique hardware id.
2293 // For paired devices, it stays consistent between Bluetooth toggling for the
2294 // same remote device.
2295 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2296 // session for the same remote device.
2297 // Default: 0 if the device's metric id is unknown.
2298 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002299}
2300
2301/**
2302 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2303 *
2304 * Logged from:
2305 * system/bt
2306 */
2307message BluetoothDeviceTxPowerLevelReported {
2308 // An identifier that can be used to match events for this device.
2309 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2310 // Salt: Randomly generated 256 bit value
2311 // Hash algorithm: HMAC-SHA256
2312 // Size: 32 byte
2313 // Default: null or empty if the device identifier is not known
2314 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2315 // Connection handle of this connection if available
2316 // Range: 0x0000 - 0x0EFF (12 bits)
2317 // Default: 0xFFFF if the handle is unknown
2318 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002319 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002320 // Default: STATUS_UNKNOWN
2321 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2322 // Range: -30 ≤ N ≤ 20
2323 // Units: dBm
2324 // Invalid when an out of range value is reported
2325 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002326 // An identifier that can be used to match events for this device.
2327 // The incremental identifier is locally generated and guaranteed not derived
2328 // from any globally unique hardware id.
2329 // For paired devices, it stays consistent between Bluetooth toggling for the
2330 // same remote device.
2331 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2332 // session for the same remote device.
2333 // Default: 0 if the device's metric id is unknown.
2334 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002335}
Jack Heab86dbd22018-12-18 15:43:27 -08002336
Tej Singh5d991e12018-03-09 19:48:11 -08002337/**
Jack He1021a612019-01-20 21:22:46 -08002338 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2339 * receiving an HCI command from the host
2340 *
2341 * Logged from: system/bt
2342 */
2343message BluetoothHciTimeoutReported {
2344 // HCI command associated with this event
2345 // Default: CMD_UNKNOWN
2346 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2347}
2348
2349/**
2350 * Logs when we receive Bluetooth Link Quality Report event from the controller
2351 * See Android Bluetooth HCI specification for more details
2352 *
2353 * Note: all count and bytes field are counted since last event
2354 *
2355 * Logged from: system/bt
2356 */
2357message BluetoothQualityReportReported {
2358 // Quality report ID
2359 // Original type: uint8_t
2360 // Default: BQR_ID_UNKNOWN
2361 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2362 // Packet type of the connection
2363 // Original type: uint8_t
2364 // Default: BQR_PACKET_TYPE_UNKNOWN
2365 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2366 // Connection handle of the connection
2367 // Original type: uint16_t
2368 optional int32 connection_handle = 3;
2369 // Performing Role for the connection
2370 // Original type: uint8_t
2371 optional int32 connection_role = 4;
2372 // Current Transmit Power Level for the connection. This value is the same as the controller's
2373 // response to the HCI_Read_Transmit_Power_Level HCI command
2374 // Original type: uint8_t
2375 optional int32 tx_power_level = 5;
2376 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2377 // absolute receiver signal strength value
2378 // Original type: int8_t
2379 optional int32 rssi = 6;
2380 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2381 // channels used by the link currently
2382 // Original type: uint8_t
2383 optional int32 snr = 7;
2384 // Indicates the number of unused channels in AFH_channel_map
2385 // Original type: uint8_t
2386 optional int32 unused_afh_channel_count = 8;
2387 // Indicates the number of the channels which are interfered and quality is bad but are still
2388 // selected for AFH
2389 // Original type: uint8_t
2390 optional int32 afh_select_unideal_channel_count = 9;
2391 // Current Link Supervision Timeout Setting
2392 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2393 // Original type: uint16_t
2394 optional int32 lsto = 10;
2395 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2396 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2397 // 0x01 (Piconet Clock)
2398 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2399 // Original type: uint32_t
2400 optional int64 connection_piconet_clock = 11;
2401 // The count of retransmission
2402 // Original type: uint32_t
2403 optional int64 retransmission_count = 12;
2404 // The count of no RX
2405 // Original type: uint32_t
2406 optional int64 no_rx_count = 13;
2407 // The count of NAK (Negative Acknowledge)
2408 // Original type: uint32_t
2409 optional int64 nak_count = 14;
2410 // Controller timestamp of last TX ACK
2411 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2412 // Original type: uint32_t
2413 optional int64 last_tx_ack_timestamp = 15;
2414 // The count of Flow-off (STOP)
2415 // Original type: uint32_t
2416 optional int64 flow_off_count = 16;
2417 // Controller timestamp of last Flow-on (GO)
2418 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2419 // Original type: uint32_t
2420 optional int64 last_flow_on_timestamp = 17;
2421 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2422 // Original type: uint32_t
2423 optional int64 buffer_overflow_bytes = 18;
2424 // Buffer underflow count (in byte) since last event
2425 // Original type: uint32_t
2426 optional int64 buffer_underflow_bytes = 19;
2427}
2428
2429/**
2430 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2431 *
2432 * Notes:
2433 * - Each event can be partially filled as we might learn different pieces of device
2434 * information at different time
2435 * - Multiple device info events can be combined to give more complete picture
2436 * - When multiple device info events tries to describe the same information, the
2437 * later one wins
2438 *
2439 * Logged from:
2440 * packages/apps/Bluetooth
2441 */
Jack Heaea26982019-04-04 11:19:48 -07002442message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002443 // An identifier that can be used to match events for this device.
2444 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2445 // Salt: Randomly generated 256 bit value
2446 // Hash algorithm: HMAC-SHA256
2447 // Size: 32 byte
2448 // Default: null or empty if the device identifier is not known
2449 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2450 // Where is this device info obtained from
2451 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2452 // Name of the data source
2453 // For EXTERNAL: package name of the data source
2454 // For INTERNAL: null for general case, component name otherwise
2455 optional string source_name = 3;
2456 // Name of the manufacturer of this device
2457 optional string manufacturer = 4;
2458 // Model of this device
2459 optional string model = 5;
2460 // Hardware version of this device
2461 optional string hardware_version = 6;
2462 // Software version of this device
2463 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002464 // An identifier that can be used to match events for this device.
2465 // The incremental identifier is locally generated and guaranteed not derived
2466 // from any globally unique hardware id.
2467 // For paired devices, it stays consistent between Bluetooth toggling for the
2468 // same remote device.
2469 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2470 // session for the same remote device.
2471 // Default: 0 if the device's metric id is unknown.
2472 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002473}
2474
2475/**
2476 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2477 * device, as documented by the Bluetooth Core HCI specification
2478 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2479 * Vol 2, Part E, Page 1118
2480 *
2481 * Logged from:
2482 * system/bt
2483 */
2484message BluetoothRemoteVersionInfoReported {
2485 // Connection handle of the connection
2486 // Original type: uint16_t
2487 optional int32 connection_handle = 1;
2488 // HCI command status code
2489 // Default: STATUS_UNKNOWN
2490 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2491 // 1 byte Version of current LMP in the remote controller
2492 optional int32 lmp_version = 3;
2493 // 2 bytes LMP manufacturer code of the remote controller
2494 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2495 optional int32 lmp_manufacturer_code = 4;
2496 // 4 bytes subversion of the LMP in the remote controller
2497 optional int32 lmp_subversion = 5;
2498}
2499
2500/**
2501 * Logs when certain Bluetooth SDP attributes are discovered
2502 * Constant definitions are from:
2503 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2504 *
2505 * Current logged attributes:
2506 * - BluetoothProfileDescriptorList
2507 * - Supported Features Bitmask
2508 *
2509 * Logged from:
2510 * system/bt
2511 */
2512message BluetoothSdpAttributeReported {
2513 // An identifier that can be used to match events for this device.
2514 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2515 // Salt: Randomly generated 256 bit value
2516 // Hash algorithm: HMAC-SHA256
2517 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2518 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2519 // Original type: uint16_t
2520 optional int32 protocol_uuid = 2;
2521 // Short form UUIDs used to identify Bluetooth SDP attribute types
2522 // Original type: uint16_t
2523 optional int32 attribute_id = 3;
2524 // Attribute value for the particular attribute
2525 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002526 // An identifier that can be used to match events for this device.
2527 // The incremental identifier is locally generated and guaranteed not derived
2528 // from any globally unique hardware id.
2529 // For paired devices, it stays consistent between Bluetooth toggling for the
2530 // same remote device.
2531 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2532 // session for the same remote device.
2533 // Default: 0 if the device's metric id is unknown.
2534 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002535}
2536
2537/**
2538 * Logs when bond state of a Bluetooth device changes
2539 *
2540 * Logged from:
2541 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2542 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2543 */
2544message BluetoothBondStateChanged {
2545 // An identifier that can be used to match events for this device.
2546 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2547 // Salt: Randomly generated 256 bit value
2548 // Hash algorithm: HMAC-SHA256
2549 // Size: 32 byte
2550 // Default: null or empty if the device identifier is not known
2551 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2552 // Preferred transport type to remote dual mode device
2553 // Default: TRANSPORT_AUTO means no preference
2554 optional android.bluetooth.TransportTypeEnum transport = 2;
2555 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2556 // Default: UNKNOWN
2557 optional android.bluetooth.DeviceTypeEnum type = 3;
2558 // Current bond state (NONE, BONDING, BONDED)
2559 // Default: BOND_STATE_UNKNOWN
2560 optional android.bluetooth.BondStateEnum bond_state = 4;
2561 // Bonding sub state
2562 // Default: BOND_SUB_STATE_UNKNOWN
2563 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2564 // Unbond Reason
2565 // Default: UNBOND_REASON_UNKNOWN
2566 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002567 // An identifier that can be used to match events for this device.
2568 // The incremental identifier is locally generated and guaranteed not derived
2569 // from any globally unique hardware id.
2570 // For paired devices, it stays consistent between Bluetooth toggling for the
2571 // same remote device.
2572 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2573 // session for the same remote device.
2574 // Default: 0 if the device's metric id is unknown.
2575 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002576}
2577
2578/**
2579 * Logs there is an event related Bluetooth classic pairing
2580 *
2581 * Logged from:
2582 * system/bt
2583 */
2584message BluetoothClassicPairingEventReported {
2585 // An identifier that can be used to match events for this device.
2586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2587 // Salt: Randomly generated 256 bit value
2588 // Hash algorithm: HMAC-SHA256
2589 // Size: 32 byte
2590 // Default: null or empty if the device identifier is not known
2591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2592 // Connection handle of this connection if available
2593 // Range: 0x0000 - 0x0EFF (12 bits)
2594 // Default: 0xFFFF if the handle is unknown
2595 optional int32 connection_handle = 2;
2596 // HCI command associated with this event
2597 // Default: CMD_UNKNOWN
2598 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2599 // HCI event associated with this event
2600 // Default: EVT_UNKNOWN
2601 optional android.bluetooth.hci.EventEnum hci_event = 4;
2602 // HCI command status code if this is triggerred by hci_cmd
2603 // Default: STATUS_UNKNOWN
2604 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2605 // HCI reason code associated with this event
2606 // Default: STATUS_UNKNOWN
2607 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002608 // A status value related to this specific event
2609 // Default: 0
2610 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002611 // An identifier that can be used to match events for this device.
2612 // The incremental identifier is locally generated and guaranteed not derived
2613 // from any globally unique hardware id.
2614 // For paired devices, it stays consistent between Bluetooth toggling for the
2615 // same remote device.
2616 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2617 // session for the same remote device.
2618 // Default: 0 if the device's metric id is unknown.
2619 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002620}
2621
2622/**
2623 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2624 *
2625 * Logged from:
2626 * system/bt
2627 */
2628message BluetoothSmpPairingEventReported {
2629 // An identifier that can be used to match events for this device.
2630 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2631 // Salt: Randomly generated 256 bit value
2632 // Hash algorithm: HMAC-SHA256
2633 // Size: 32 byte
2634 // Default: null or empty if the device identifier is not known
2635 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2636 // SMP command sent or received over L2CAP
2637 // Default: CMD_UNKNOWN
2638 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2639 // Whether this command is sent or received
2640 // Default: DIRECTION_UNKNOWN
2641 optional android.bluetooth.DirectionEnum direction = 3;
2642 // SMP failure reason code
2643 // Default: PAIRING_FAIL_REASON_DEFAULT
2644 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002645 // An identifier that can be used to match events for this device.
2646 // The incremental identifier is locally generated and guaranteed not derived
2647 // from any globally unique hardware id.
2648 // For paired devices, it stays consistent between Bluetooth toggling for the
2649 // same remote device.
2650 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2651 // session for the same remote device.
2652 // Default: 0 if the device's metric id is unknown.
2653 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002654}
2655
2656/**
Jack He815cdba2019-01-30 17:24:55 -08002657 * Logs when a Bluetooth socket’s connection state changed
2658 *
2659 * Logged from:
2660 * system/bt
2661 */
2662message BluetoothSocketConnectionStateChanged {
2663 // An identifier that can be used to match events for this device.
2664 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2665 // Salt: Randomly generated 256 bit value
2666 // Hash algorithm: HMAC-SHA256
2667 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002668 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002669 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002670 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002671 // Default 0 when unknown or don't care
2672 optional int32 port = 2;
2673 // Socket type as mentioned in
2674 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2675 // Default: SOCKET_TYPE_UNKNOWN
2676 optional android.bluetooth.SocketTypeEnum type = 3;
2677 // Socket connection state
2678 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2679 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2680 // Number of bytes sent to remote device during this connection
2681 optional int64 tx_bytes = 5;
2682 // Number of bytes received from remote device during this connection
2683 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002684 // Socket owner's UID
2685 optional int32 uid = 7 [(is_uid) = true];
2686 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2687 // |port| must be spawned by |server_port|
2688 // Default 0 when unknown or don't care
2689 optional int32 server_port = 8;
2690 // Whether this is a server listener socket
2691 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002692 // An identifier that can be used to match events for this device.
2693 // The incremental identifier is locally generated and guaranteed not derived
2694 // from any globally unique hardware id.
2695 // For paired devices, it stays consistent between Bluetooth toggling for the
2696 // same remote device.
2697 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2698 // session for the same remote device.
2699 // Default: 0 if the device's metric id is unknown.
2700 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002701}
2702
2703/**
Jack He71426802019-04-02 13:32:52 -07002704 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2705 *
2706 * Logged from:
2707 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2708 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2709 *
2710 */
2711message BluetoothClassOfDeviceReported {
2712 // An identifier that can be used to match events for this device.
2713 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2714 // Salt: Randomly generated 256 bit value
2715 // Hash algorithm: HMAC-SHA256
2716 // Size: 32 byte
2717 // Default: null or empty if this is a server listener socket
2718 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2719 // Class of Device (CoD) value including both Major, Minor device class and service class
2720 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2721 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2722 // Default: 0
2723 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002724 // An identifier that can be used to match events for this device.
2725 // The incremental identifier is locally generated and guaranteed not derived
2726 // from any globally unique hardware id.
2727 // For paired devices, it stays consistent between Bluetooth toggling for the
2728 // same remote device.
2729 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2730 // session for the same remote device.
2731 // Default: 0 if the device's metric id is unknown.
2732 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002733}
2734
2735/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002736 * Logs when something is plugged into or removed from the USB-C connector.
2737 *
2738 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002739 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002740 */
2741message UsbConnectorStateChanged {
2742 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002743 STATE_DISCONNECTED = 0;
2744 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002745 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002746 optional State state = 1
2747 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2748 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002749 // Last active session in ms.
2750 // 0 when the port is in connected state.
2751 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002752}
2753
2754/**
2755 * Logs the reported speaker impedance.
2756 *
2757 * Logged from:
2758 * Vendor audio implementation.
2759 */
2760message SpeakerImpedanceReported {
2761 optional int32 speaker_location = 1;
2762 optional int32 impedance = 2;
2763}
2764
2765/**
2766 * Logs the report of a failed hardware.
2767 *
2768 * Logged from:
2769 * Vendor HALs.
2770 *
2771 */
2772message HardwareFailed {
2773 enum HardwareType {
2774 HARDWARE_FAILED_UNKNOWN = 0;
2775 HARDWARE_FAILED_MICROPHONE = 1;
2776 HARDWARE_FAILED_CODEC = 2;
2777 HARDWARE_FAILED_SPEAKER = 3;
2778 HARDWARE_FAILED_FINGERPRINT = 4;
2779 }
2780 optional HardwareType hardware_type = 1;
2781
Maggie White6dcd8572019-01-31 14:11:50 -08002782 /**
2783 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002784 * the same hardware_type. The specific locations are vendor defined integers,
2785 * referring to board-specific numbering schemes.
2786 */
2787 optional int32 hardware_location = 2;
2788
Maggie White6dcd8572019-01-31 14:11:50 -08002789 /**
2790 * failure_code is specific to the HardwareType of the failed hardware.
2791 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002792 */
Maggie White6dcd8572019-01-31 14:11:50 -08002793 enum HardwareErrorCode {
2794 UNKNOWN = 0;
2795 COMPLETE = 1;
2796 SPEAKER_HIGH_Z = 2;
2797 SPEAKER_SHORT = 3;
2798 FINGERPRINT_SENSOR_BROKEN = 4;
2799 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002800 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002801 }
2802 optional int32 failure_code = 3;
2803}
2804
2805/**
2806 * Log an event when the device has been physically dropped.
2807 * Reported from the /vendor partition.
2808 */
2809message PhysicalDropDetected {
2810 // Confidence that the event was actually a drop, 0 -> 100
2811 optional int32 confidence_pctg = 1;
2812 // Peak acceleration of the drop, in 1/1000s of a g.
2813 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002814 // Duration of freefall in ms
2815 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002816}
2817
2818/**
2819 * Log bucketed battery charge cycles.
2820 *
2821 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002822 * a given charge point. For example, if 10 cycle buckets are
2823 * initialized, bucket 1 is the lowest 1/10th of the battery,
2824 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002825 *
2826 * Logged from:
2827 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2828 */
2829message ChargeCyclesReported {
2830 optional int32 cycle_bucket_1 = 1;
2831 optional int32 cycle_bucket_2 = 2;
2832 optional int32 cycle_bucket_3 = 3;
2833 optional int32 cycle_bucket_4 = 4;
2834 optional int32 cycle_bucket_5 = 5;
2835 optional int32 cycle_bucket_6 = 6;
2836 optional int32 cycle_bucket_7 = 7;
2837 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002838 optional int32 cycle_bucket_9 = 9;
2839 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002840}
2841
2842/**
Howard Roa46b6582018-09-18 16:45:02 -07002843 * Log battery health snapshot.
2844 *
2845 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2846 * are snapshotted periodically over 24hrs.
2847 */
2848message BatteryHealthSnapshot {
2849 enum BatterySnapshotType {
2850 UNKNOWN = 0;
2851 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2852 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2853 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2854 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2855 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2856 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2857 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2858 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2859 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2860 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2861 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2862 }
2863 optional BatterySnapshotType type = 1;
2864 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002865 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002866 // Voltage Battery Voltage, in microVolts.
2867 optional int32 voltage_micro_volt = 3;
2868 // Current Battery current, in microAmps.
2869 optional int32 current_micro_amps = 4;
2870 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2871 optional int32 open_circuit_micro_volt = 5;
2872 // Resistance Battery Resistance, in microOhms.
2873 optional int32 resistance_micro_ohm = 6;
2874 // Level Battery Level, as % of full.
2875 optional int32 level_percent = 7;
2876}
2877
2878/**
2879 * Log slow I/O operations on the primary storage.
2880 */
2881message SlowIo {
2882 // Classifications of IO Operations.
2883 enum IoOperation {
2884 UNKNOWN = 0;
2885 READ = 1;
2886 WRITE = 2;
2887 UNMAP = 3;
2888 SYNC = 4;
2889 }
2890 optional IoOperation operation = 1;
2891
2892 // The number of slow IO operations of this type over 24 hours.
2893 optional int32 count = 2;
2894}
2895
2896/**
2897 * Log battery caused shutdown with the last recorded voltage.
2898 */
2899message BatteryCausedShutdown {
2900 // The last recorded battery voltage prior to shutdown.
2901 optional int32 last_recorded_micro_volt = 1;
2902}
2903
2904/**
Tej Singha72344992019-04-17 18:55:08 -07002905 * Logs when ThermalService receives throttling events.
2906 *
2907 * Logged from:
2908 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2909 */
2910message ThermalThrottlingSeverityStateChanged {
2911 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2912 optional android.os.TemperatureTypeEnum sensor_type = 1;
2913
2914 // The name of the temperature source. Eg. CPU0
2915 optional string sensor_name = 2;
2916
2917 // Temperature in tenths of a degree C.
2918 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2919 optional int32 temperature_deci_celsius = 3;
2920
2921 // Relative severity of the throttling, see enum definition.
2922 optional android.os.ThrottlingSeverityEnum severity = 4;
2923}
2924
2925/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002926 * Logs the duration of a davey (jank of >=700ms) when it occurs
2927 *
2928 * Logged from:
2929 * frameworks/base/libs/hwui/JankTracker.cpp
2930 */
2931message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002932 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002933 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002934
Tej Singhbb8554a2018-01-26 11:59:14 -08002935 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002936 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002937}
2938
2939/**
Bookatze5885242017-10-24 20:10:31 -07002940 * Logs phone signal strength changes.
2941 *
2942 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002943 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002944 */
2945message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002946 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2947 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002948}
2949
Yangster4ccebea2018-10-09 17:09:02 -07002950
2951/**
2952 * Logs when the phone state, sim state or signal strength changes
2953 *
2954 * Logged from:
2955 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2956 */
2957message PhoneServiceStateChanged {
2958 optional android.telephony.ServiceStateEnum state = 1;
2959 optional android.telephony.SimStateEnum sim_state = 2;
2960 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2961}
2962
2963/**
2964 * Logs when the phone becomes on or off.
2965 *
2966 * Logged from:
2967 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2968 */
2969message PhoneStateChanged {
2970 enum State {
2971 OFF = 0;
2972 ON = 1;
2973 }
2974 optional State state = 1;
2975}
2976
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002977message BackGesture {
2978 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002979 DEFAULT_BACK_TYPE = 0;
2980 COMPLETED = 1;
2981 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2982 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2983 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2984 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2985 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2986 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2987 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002988 }
2989 optional BackType type = 1;
2990
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002991 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2992 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2993 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2994 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2995 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2996 optional int32 left_boundary = 8; // left edge width + left inset
2997 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2998
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002999 enum WindowHorizontalLocation {
3000 DEFAULT_LOCATION = 0;
3001 LEFT = 1;
3002 RIGHT = 2;
3003 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003004 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003005}
3006
3007message ExclusionRectStateChanged {
3008 optional string component_name = 1; // if not available, simply packageName
3009 optional int32 requested_height = 2; // px
3010 optional int32 rejected_height = 3; // px
3011
3012 enum WindowHorizontalLocation {
3013 DEFAULT_LOCATION = 0;
3014 LEFT = 1;
3015 RIGHT = 2;
3016 }
3017 optional WindowHorizontalLocation x_location = 4;
3018 optional bool landscape = 5;
3019 optional bool splitscreen = 6;
3020 optional int32 duration_millis = 7;
3021}
3022
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003023/**
3024 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3025 *
3026 * Logged from:
3027 * packages/apps/Launcher3
3028 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003029message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003030 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003031 optional android.stats.launcher.LauncherState src_state = 2;
3032 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003033 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3034 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3035
3036 // The event id (e.g., app launch, drag and drop, long press)
3037 optional int32 event_id = 6;
3038 // The event's source or target id (e.g., icon, task, button)
3039 optional int32 target_id = 7;
3040 // If the target needs to be tracked, use this id field
3041 optional int32 instance_id = 8;
3042 optional int32 uid = 9 [(is_uid) = true];
3043 optional string package_name = 10;
3044 optional string component_name = 11;
3045
3046 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003047 optional int32 grid_x = 12 [default = -1];
3048 optional int32 grid_y = 13 [default = -1];
3049 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003050
3051 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003052 optional int32 grid_x_parent = 15 [default = -1];
3053 optional int32 grid_y_parent = 16 [default = -1];
3054 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003055
3056 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3057 optional int32 hierarchy = 18;
3058
3059 optional bool is_work_profile = 19;
3060
3061 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003062 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003063
3064 // e.g., folderLabelState can be captured in the following two fields
3065 optional int32 from_state = 21;
3066 optional int32 to_state = 22;
3067
3068 // e.g., autofilled or suggested texts that are not user entered
3069 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003070
3071 // e.g., number of contents inside a container (e.g., icons inside a folder)
3072 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003073}
3074
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003075/**
3076 * Used for snapshot of the HomeScreen UI elements
3077 *
3078 * Logged from:
3079 * packages/apps/Launcher3
3080 */
3081message LauncherStaticLayout {
3082 // The event id (e.g., snapshot, drag and drop)
3083 optional int32 event_id = 1;
3084 // The event's source or target id (e.g., icon, shortcut, widget)
3085 optional int32 target_id = 2;
3086 // If the target needs to be tracked, use this id field
3087 optional int32 instance_id = 3;
3088 optional int32 uid = 4 [(is_uid) = true];
3089 optional string package_name = 5;
3090 optional string component_name = 6;
3091
3092 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003093 optional int32 grid_x = 7 [default = -1];
3094 optional int32 grid_y = 8 [default = -1];
3095 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003096
3097 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003098 // e.g., when used with widgets target, use these values for (span_x, span_y)
3099 optional int32 grid_x_parent = 10 [default = -1];
3100 optional int32 grid_y_parent = 11 [default = -1];
3101 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003102
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003103 // UNKNOWN = 0
3104 // HOTSEAT = 1
3105 // WORKSPACE = 2
3106 // FOLDER_HOTSEAT = 3
3107 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003108 optional int32 hierarchy = 13;
3109
3110 optional bool is_work_profile = 14;
3111
3112 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3113 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003114
3115 // e.g., number of icons inside a folder
3116 optional int32 cardinality = 16;
3117
3118 // e.g., (x, y) span of the widget inside homescreen grid system
3119 optional int32 span_x = 17 [default = 1];
3120 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003121}
3122
3123/**
3124 * Logs when Wallpaper or ThemePicker UI has changed.
3125 *
3126 * Logged from:
3127 * packages/apps/ThemePicker
3128 * packages/apps/WallpaperPicker2
3129 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003130message StyleUIChanged {
3131 optional android.stats.style.Action action = 1;
3132 optional int32 color_package_hash = 2;
3133 optional int32 font_package_hash = 3;
3134 optional int32 shape_package_hash = 4;
3135 optional int32 clock_package_hash = 5;
3136 optional int32 launcher_grid = 6;
3137 optional int32 wallpaper_category_hash = 7;
3138 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003139 optional int32 color_preference = 9;
3140 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003141}
3142
David Chenc28b2bb2017-10-24 12:52:52 -07003143/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003144 * Logs when Settings UI has changed.
3145 *
3146 * Logged from:
3147 * packages/apps/Settings
3148 */
3149message SettingsUIChanged {
3150 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003151 * Where this SettingsUIChange event comes from. For example, if
3152 * it's a PAGE_VISIBLE event, where the page is opened from.
3153 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003154 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003155
3156 /**
3157 * What the UI action is.
3158 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003159 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003160
3161 /**
3162 * Where the action is happening
3163 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003164 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003165
3166 /**
3167 * What preference changed in this event.
3168 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003169 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003170
3171 /**
3172 * The new value of the changed preference.
3173 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003174 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003175}
3176
3177/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003178 * Logs basic timing information about touch events.
3179 * Reported at most every 5 minutes while device is being interacted with.
3180 *
3181 * Logged from:
3182 * frameworks/native/services/inputflinger
3183 */
3184message TouchEventReported {
3185 /**
3186 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003187 * and the standard deviation of the time spent processing touchscreen events
3188 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003189 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003190 * On supported devices, the starting point is taken during the hard interrupt inside the
3191 * kernel touch driver. On all other devices, the starting point is taken inside
3192 * the kernel's input event subsystem upon receipt of the input event.
3193 * The ending point is taken inside InputDispatcher, just after the input event
3194 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003195 */
3196 // Minimum value
3197 optional float latency_min_micros = 1;
3198 // Maximum value
3199 optional float latency_max_micros = 2;
3200 // Average value
3201 optional float latency_mean_micros = 3;
3202 // Standard deviation
3203 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003204 // Number of touch events (input_event) in this report
3205 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003206}
3207
3208/**
Philip Quinn0eded622019-01-29 12:46:28 -08003209 * Logs gesture classification and timing information for touch events.
3210 *
3211 * Logged from:
3212 * frameworks/base/core/java/android/view/GestureDetector.java
3213 * frameworks/base/core/java/android/view/View.java
3214 */
3215message TouchGestureClassified {
3216 // The source of the classification (e.g. Java class name).
3217 optional string source = 1;
3218
3219 enum Classification {
3220 UNKNOWN_CLASSIFICATION = 0;
3221 SINGLE_TAP = 1;
3222 DOUBLE_TAP = 2;
3223 LONG_PRESS = 3;
3224 DEEP_PRESS = 4;
3225 SCROLL = 5;
3226 }
3227 // The classification of the gesture.
3228 optional Classification classification = 2;
3229
3230 // The interval from the start of a touch event stream until the
3231 // classification was made.
3232 optional int32 latency_millis = 3;
3233
3234 // The distance from the location of the first touch event to the
3235 // location of the touch event when the classification was made.
3236 optional float displacement_px = 4;
3237}
3238
3239/**
David Chenc28b2bb2017-10-24 12:52:52 -07003240 * Logs that a setting was updated.
3241 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003242 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003243 * The tag and is_default allow resetting of settings to default values based on the specified
3244 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3245 */
3246message SettingChanged {
3247 // The name of the setting.
3248 optional string setting = 1;
3249
3250 // The change being imposed on this setting. May represent a number, eg "3".
3251 optional string value = 2;
3252
3253 // The new value of this setting. For most settings, this is same as value. For some settings,
3254 // value is +X or -X where X represents an element in a set. For example, if the previous value
3255 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3256 // The +/- feature is currently only used for location_providers_allowed.
3257 optional string new_value = 3;
3258
3259 // The previous value of this setting.
3260 optional string prev_value = 4;
3261
3262 // The tag used with the is_default for resetting sets of settings. This is generally null.
3263 optional string tag = 5;
3264
Bookatz90867622018-01-31 15:05:57 -08003265 // True if this setting with tag should be resettable.
3266 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003267
David Chenbd789912018-03-16 17:19:55 -07003268 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003269 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003270
3271 enum ChangeReason {
3272 UPDATED = 1; // Updated can be an insertion or an update.
3273 DELETED = 2;
3274 }
3275 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003276}
Chenjie Yub3dda412017-10-24 13:41:59 -07003277
Chenjie Yu05013b32017-11-21 10:21:41 -08003278/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003279 * Logs activity going to foreground or background
3280 *
3281 * Logged from:
3282 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3283 */
3284message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003285 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003286 optional string pkg_name = 2;
3287 optional string class_name = 3;
3288
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003289 enum State {
3290 BACKGROUND = 0;
3291 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003292 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003293 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003294}
David Chenc8a43242017-10-17 16:23:28 -07003295
3296/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003297 * Logs when a volume entered low Storage state.
3298 * Logged from:
3299 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3300 */
3301message LowStorageStateChanged {
3302 // Volume that ran out of storage.
3303 optional string volume_description = 1;
3304
3305 enum State {
3306 UNKNOWN = 0;
3307 OFF = 1;
3308 ON = 2;
3309 }
3310 optional State state = 2;
3311}
3312
3313/**
3314 * Logs when an app is downgraded.
3315 * Logged from:
3316 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3317 */
3318message AppDowngraded {
3319 optional string package_name = 1;
3320 // Size of the package (all data) before being downgraded.
3321 optional int64 size_in_bytes_before = 2;
3322 // Size of the package (all data) after being downgraded.
3323 optional int64 size_in_bytes_after = 3;
3324
3325 optional bool aggressive = 4;
3326}
3327
3328/**
3329 * Logs when an app is optimized after being downgraded.
3330 * Logged from:
3331 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3332 */
3333message AppOptimizedAfterDowngraded {
3334 optional string package_name = 1;
3335}
3336
3337/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003338 * Logs whenever an app is installed on external storage.
3339 * Logged from:
3340 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3341 */
3342message AppInstallOnExternalStorageReported {
3343 // The type of external storage.
3344 optional android.stats.storage.ExternalStorageType storage_type = 1;
3345 // The name of the package that is installed on the sd card.
3346 optional string package_name = 2;
3347}
3348
3349/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003350 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003351 * Logged from:
3352 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3353 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003355 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003356
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003357 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003358
3359 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003360 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003361 optional string process_name = 3;
3362
3363 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003364 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003365
3366 optional string package_name = 5;
3367
3368 enum InstantApp {
3369 UNAVAILABLE = 0;
3370 FALSE = 1;
3371 TRUE = 2;
3372 }
3373 optional InstantApp is_instant_app = 6;
3374
3375 enum ForegroundState {
3376 UNKNOWN = 0;
3377 BACKGROUND = 1;
3378 FOREGROUND = 2;
3379 }
3380 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003381
3382 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383}
David Chen9e3808c2017-11-20 17:25:34 -08003384
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003385/**
3386 * Logs when a WTF (What a Terrible Failure) happened.
3387 * Logged from:
3388 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3389 */
3390message WTFOccurred {
3391 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003392
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003393 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003394
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003395 // The name of the process.
3396 // system_server if it is not by an app
3397 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003398
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003399 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003400 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003401
3402 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003403}
3404
3405/**
3406 * Logs when system server reports low memory.
3407 * Logged from:
3408 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3409 */
3410message LowMemReported {
3411}
3412
3413/**
3414 * Logs when an app ANR (App Not Responding) occurs.
3415 * Logged from:
3416 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3417 */
3418message ANROccurred {
3419 optional int32 uid = 1 [(is_uid) = true];
3420
3421 optional string process_name = 2;
3422
3423 optional string short_component_name = 3;
3424
3425 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003426
3427 enum InstantApp {
3428 UNAVAILABLE = 0;
3429 FALSE = 1;
3430 TRUE = 2;
3431 }
3432 optional InstantApp is_instant_app = 5;
3433
3434 enum ForegroundState {
3435 UNKNOWN = 0;
3436 BACKGROUND = 1;
3437 FOREGROUND = 2;
3438 }
3439 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003440
3441 optional android.server.ErrorSource error_source = 7;
3442
3443 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003444}
3445
Bookatza7020bd2018-08-28 16:29:35 -07003446/**
3447 * Logs when the vibrator state changes.
3448 * Logged from:
3449 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3450 */
3451message VibratorStateChanged {
3452 repeated AttributionNode attribution_node = 1;
3453
3454 enum State {
3455 OFF = 0;
3456 ON = 1;
3457 }
3458 optional State state = 2;
3459
3460 // Duration (in milliseconds) requested to keep the vibrator on.
3461 // Only applicable for State == ON.
3462 optional int64 duration_millis = 3;
3463}
3464
David Chen0a368b22017-12-06 16:28:16 -08003465/*
3466 * Allows other apps to push events into statsd.
3467 * Logged from:
3468 * frameworks/base/core/java/android/util/StatsLog.java
3469 */
David Chen0b5c90c2018-01-25 16:51:49 -08003470message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003471 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003472 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003473
3474 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3475 optional int32 label = 2;
3476
3477 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3478 // predicates for the metrics).
3479 enum State {
3480 UNKNOWN = 0;
3481 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3482 STOP = 2;
3483 START = 3;
3484 }
3485 optional State state = 3;
3486}
3487
David Chen9e3808c2017-11-20 17:25:34 -08003488/**
Bookatz7948c872018-09-04 12:58:33 -07003489 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3490 * For example, this could be due to the user manually changing the time.
3491 *
3492 * Logged from:
3493 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3494 */
3495message WallClockTimeShifted {
3496 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3497 optional int64 wall_clock_timestamp_millis = 1;
3498}
3499
3500/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003501 * Logs when statsd detects an anomaly.
3502 *
3503 * Logged from:
3504 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3505 */
3506message AnomalyDetected {
3507 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003508 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003509
Yangster-mac94e197c2018-01-02 16:03:03 -08003510 // Id of the config whose anomaly detection alert fired.
3511 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003512
Yangster-mac94e197c2018-01-02 16:03:03 -08003513 // Id of the alert (i.e. name of the anomaly that was detected).
3514 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003515}
3516
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003517message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003518 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003519 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003520
3521 // The app package name.
3522 optional string pkg_name = 2;
3523
3524 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003525 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003526 WARM = 1;
3527 HOT = 2;
3528 COLD = 3;
3529 }
3530 // The transition type.
3531 optional TransitionType type = 3;
3532
3533 // The activity name.
3534 optional string activity_name = 4;
3535
3536 // The name of the calling app. Empty if not set.
3537 optional string calling_pkg_name = 5;
3538
3539 // Whether the app is an instant app.
3540 optional bool is_instant_app = 6;
3541
3542 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003543 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544
Bookatz80d11a02018-01-16 10:46:35 -08003545 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003546
David Chen0b5c90c2018-01-25 16:51:49 -08003547 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003548 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003549 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003550 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003551 optional int32 bind_application_delay_millis = 11;
3552 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003553
3554 // Empty if not set.
3555 optional string launch_token = 13;
3556
Calin Juravle759fbda2018-02-20 19:52:30 +00003557 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003558 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003559
3560 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003561 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003562}
3563
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003564message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003565 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003566 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003567
3568 // The app package name.
3569 optional string pkg_name = 2;
3570
3571 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003572 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003573 WARM = 1;
3574 HOT = 2;
3575 COLD = 3;
3576 }
3577 // The transition type.
3578 optional TransitionType type = 3;
3579
3580 // The activity name.
3581 optional string activity_name = 4;
3582}
3583
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003584message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003585 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003586 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003587
3588 // The app package name.
3589 optional string pkg_name = 2;
3590
3591 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003592 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003593 WITH_BUNDLE = 1;
3594 WITHOUT_BUNDLE = 2;
3595 }
3596 // The transition type.
3597 optional TransitionType type = 3;
3598
3599 // The activity name.
3600 optional string activity_name = 4;
3601
3602 optional bool transition_process_running = 5;
3603
3604 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003605 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003606}
3607
Bookatz8fcd09a2017-12-18 13:01:10 -08003608/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003609 * Logs a picture-in-picture action
3610 * Logged from:
3611 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3612 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3613 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3614 */
3615message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003616 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003617 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003618
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003619 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003620
Chenjie Yu52cacc62017-12-08 18:11:45 -08003621 enum State {
3622 ENTERED = 1;
3623 EXPANDED_TO_FULL_SCREEN = 2;
3624 MINIMIZED = 3;
3625 DISMISSED = 4;
3626 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003627 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003628}
3629
3630/**
Chenjie Yue8904192017-12-08 19:12:57 -08003631 * Logs overlay action
3632 * Logged from:
3633 * services/core/java/com/android/server/wm/Session.java
3634 */
3635message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003636 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003637
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003638 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003639
3640 optional bool using_alert_window = 3;
3641
3642 enum State {
3643 ENTERED = 1;
3644 EXITED = 2;
3645 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003646 optional State state = 4
3647 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003648}
3649
Adam Bookatz38767932020-02-05 12:13:40 -08003650/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003651 * Logs foreground service starts and stops.
3652 * Note that this is not when a service starts or stops, but when it is
3653 * considered foreground.
3654 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003655 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003656 */
3657message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003658 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003659 // package_name + "/" + class_name
3660 optional string short_name = 2;
3661
3662 enum State {
3663 ENTER = 1;
3664 EXIT = 2;
3665 }
3666 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003667
3668 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3669 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3670 optional bool allow_while_in_use_permission = 4;
3671}
3672
3673/**
3674 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3675 * A foreground service session is any continuous period during which the uid holds at least one
3676 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3677 * Accesses initiated while the uid is in the TOP state are ignored.
3678 * Sessions with no attempted accesses are not logged.
3679 * Logged from
3680 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3681 */
3682message ForegroundServiceAppOpSessionEnded {
3683 optional int32 uid = 1 [(is_uid) = true];
3684
3685 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003686 // Only following four ops are logged
3687 // COARSE_LOCATION = 0
3688 // FINE_LOCATION = 1
3689 // CAMERA = 26
3690 // RECORD_AUDIO = 27
3691 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003692
3693 // The uid's permission mode for accessing the AppOp during this fgs session.
3694 enum Mode {
3695 MODE_UNKNOWN = 0;
3696 MODE_ALLOWED = 1; // Always allowed
3697 MODE_IGNORED = 2; // Denied
3698 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3699 }
3700 optional Mode app_op_mode = 3;
3701
3702 // Number of times this AppOp was requested and allowed.
3703 optional int32 count_ops_accepted = 4;
3704 // Number of times this AppOp was requested but denied.
3705 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003706}
3707
Chenjie Yue8904192017-12-08 19:12:57 -08003708/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003709 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3710 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3711 * attributed back to the parent (host) uid. One example is Chrome.
3712 *
3713 * Logged from:
3714 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3715 */
3716message IsolatedUidChanged {
3717 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003718 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003719 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003720 optional int32 parent_uid = 1;
3721
3722 optional int32 isolated_uid = 2;
3723
3724 // We expect an isolated uid to be removed before if it's used for another parent uid.
3725 enum Event {
3726 REMOVED = 0;
3727 CREATED = 1;
3728 }
3729 optional Event event = 3;
3730}
3731
3732/*
3733 * Logs the reception of an incoming network packet causing the main system to wake up for
3734 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3735 * and processed by WakeupController.cpp.
3736 */
3737message PacketWakeupOccurred {
3738 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3739 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003740 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003741 // The interface name on which the packet was received.
3742 optional string iface = 2;
3743 // The ethertype value of the packet.
3744 optional int32 ethertype = 3;
3745 // String representation of the destination MAC address of the packet.
3746 optional string destination_hardware_address = 4;
3747 // String representation of the source address of the packet if this was an IP packet.
3748 optional string source_ip = 5;
3749 // String representation of the destination address of the packet if this was an IP packet.
3750 optional string destination_ip = 6;
3751 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3752 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3753 // families.
3754 optional int32 ip_next_header = 7;
3755 // The source port if this was a TCP or UDP packet.
3756 optional int32 source_port = 8;
3757 // The destination port if this was a TCP or UDP packet.
3758 optional int32 destination_port = 9;
3759}
3760
3761/*
3762 * Logs the memory stats for an app on startup.
3763 * Logged from:
3764 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3765 */
3766message AppStartMemoryStateCaptured {
3767 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003768 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003769
3770 // The process name.
3771 optional string process_name = 2;
3772
3773 // The activity name.
3774 optional string activity_name = 3;
3775
3776 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003777 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003778
3779 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003780 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003781
3782 // RSS
3783 optional int64 rss_in_bytes = 6;
3784
3785 // CACHE
3786 optional int64 cache_in_bytes = 7;
3787
3788 // SWAP
3789 optional int64 swap_in_bytes = 8;
3790}
3791
3792/*
3793 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3794 * for LMK event.
3795 * Logged from:
3796 * system/core/lmkd/lmkd.c
3797 */
3798message LmkStateChanged {
3799 enum State {
3800 UNKNOWN = 0;
3801 START = 1;
3802 STOP = 2;
3803 }
3804 optional State state = 1;
3805}
3806
3807/*
3808 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3809 * Logged from:
3810 * system/core/lmkd/lmkd.c
3811 */
3812message LmkKillOccurred {
3813 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003814 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003815
3816 // The process name.
3817 optional string process_name = 2;
3818
3819 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003820 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003821
3822 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003823 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003824
3825 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003826 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003827
3828 // RSS
3829 optional int64 rss_in_bytes = 6;
3830
3831 // CACHE
3832 optional int64 cache_in_bytes = 7;
3833
3834 // SWAP
3835 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003836
3837 // The elapsed real time of start of the process.
3838 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003839
3840 // Min oom adj score considered by lmkd.
3841 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003842}
3843
Rajeev Kumar51b54602018-03-01 12:18:26 -08003844/*
3845 * Logs when the ActivityManagerService detects that an app died.
3846 *
3847 * Logged from:
3848 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3849 */
3850message AppDied {
3851 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003852 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003853}
3854
Howard Ro21a039c2018-08-06 14:55:47 -07003855/**
3856 * An atom for generic metrics logging. Available from Android Q.
3857 */
3858message GenericAtom {
3859 // The uid of the application that sent this custom atom.
3860 optional int32 uid = 1 [(is_uid) = true];
3861
3862 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003863 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003864}
3865
Tej Singhd6d6d772018-09-05 17:41:25 -07003866/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003867 * Atom for simple logging of user interaction and impression events, such as "the user touched
3868 * this button" or "this dialog was displayed".
3869 * Keep the UI event stream clean: don't use for system or background events.
3870 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003871 *
3872 * Logged from:
3873 * frameworks/base/services/core/java/com/android/server/
3874 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003875 */
3876message UiEventReported {
3877 // The event_id.
3878 optional int32 event_id = 1;
3879 // The event's source or target uid and package, if applicable.
3880 // For example, the package posting a notification, or the destination package of a share.
3881 optional int32 uid = 2 [(is_uid) = true];
3882 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003883 // An identifier used to disambiguate which logs refer to a particular instance of some
3884 // UI element. Useful when there might be multiple instances simultaneously active.
3885 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003886}
3887
3888/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003889 * Reports a notification was created or updated.
3890 *
3891 * Logged from:
3892 * frameworks/base/services/core/java/com/android/server/notification/
3893 */
3894message NotificationReported {
3895 // The event_id (as for UiEventReported).
3896 optional int32 event_id = 1;
3897 // The notifying app's uid and package.
3898 optional int32 uid = 2 [(is_uid) = true];
3899 optional string package_name = 3;
3900 // A small system-assigned identifier for the notification.
3901 // Locally probably-unique, but expect collisions across users and/or days.
3902 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003903 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3904 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003905
3906 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003907 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3908 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3909 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003910
3911 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003912 optional string category = 10; // App-assigned notification category (API-defined strings)
3913 optional int32 style = 11; // App-assigned notification style
3914 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003915
3916 // Ordering, importance and interruptiveness
3917
Will Brockman7614f6962020-02-10 19:43:03 -05003918 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003919
Will Brockman7614f6962020-02-10 19:43:03 -05003920 optional android.stats.sysui.NotificationImportance importance = 14;
3921 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003922
3923 enum NotificationImportanceExplanation {
3924 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3925 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3926 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3927 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3928 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3929 // Like _APP, but based on pre-channels priority signal.
3930 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3931 }
3932
Will Brockman7614f6962020-02-10 19:43:03 -05003933 optional NotificationImportanceExplanation importance_source = 16;
3934 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3935 optional NotificationImportanceExplanation importance_initial_source = 18;
3936 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3937 optional int32 assistant_hash = 20;
3938 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003939}
3940
3941message Notification {
3942 // The notifying app's uid and package.
3943 optional int32 uid = 1 [(is_uid) = true];
3944 optional string package_name = 2;
3945 // A small system-assigned identifier for the notification.
3946 optional int32 instance_id = 3;
3947
3948 // Grouping information.
3949 optional int32 group_instance_id = 4;
3950 optional bool is_group_summary = 5;
3951
3952 // The section of the shade that the notification is in.
3953 // See NotificationSectionsManager.PriorityBucket.
3954 enum NotificationSection {
3955 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003956 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003957 SECTION_MEDIA_CONTROLS = 2;
3958 SECTION_PEOPLE = 3;
3959 SECTION_ALERTING = 4;
3960 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003961 }
3962 optional NotificationSection section = 6;
3963}
3964
3965message NotificationList {
3966 repeated Notification notifications = 1; // An ordered sequence of notifications.
3967}
3968
3969/**
3970 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3971 *
3972 * Logged from:
3973 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3974 */
3975message NotificationPanelReported {
3976 // The event_id (as for UiEventReported).
3977 optional int32 event_id = 1;
3978 optional int32 num_notifications = 2;
3979 // The notifications in the panel, in the order that they appear there.
3980 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3981}
3982
3983/**
3984 * Reports a notification channel, or channel group, was created, updated, or deleted.
3985 *
3986 * Logged from:
3987 * frameworks/base/services/core/java/com/android/server/notification/
3988 */
3989message NotificationChannelModified {
3990 // The event_id (as for UiEventReported).
3991 optional int32 event_id = 1;
3992 // The notifying app's uid and package.
3993 optional int32 uid = 2 [(is_uid) = true];
3994 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003995 // Hash of app-assigned notification channel ID or channel-group ID
3996 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003997 // Previous importance setting, if applicable
3998 optional android.stats.sysui.NotificationImportance old_importance = 5;
3999 // New importance setting
4000 optional android.stats.sysui.NotificationImportance importance = 6;
4001}
4002
4003
4004/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004005 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004006 *
4007 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004008 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004009 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004010message BiometricAcquired {
4011 // Biometric modality that was acquired.
4012 optional android.hardware.biometrics.ModalityEnum modality = 1;
4013 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4014 optional int32 user = 2;
4015 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4016 optional bool is_crypto = 3;
4017 // Action that the device is performing. Acquired messages are only expected for enroll and
4018 // authenticate. Other actions may indicate an error.
4019 optional android.hardware.biometrics.ActionEnum action = 4;
4020 // The client that this acquisition was received for.
4021 optional android.hardware.biometrics.ClientEnum client = 5;
4022 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4023 optional int32 acquire_info = 6;
4024 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4025 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004026 // Dictates if this message should trigger additional debugging.
4027 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004028}
4029
4030/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004031 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004032 *
4033 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004034 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004035 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004036message BiometricAuthenticated {
4037 // Biometric modality that was used.
4038 optional android.hardware.biometrics.ModalityEnum modality = 1;
4039 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4040 optional int32 user = 2;
4041 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4042 // storage.
4043 optional bool is_crypto = 3;
4044 // The client that this acquisition was received for.
4045 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004046 // If authentication requires user confirmation. See BiometricPrompt's
4047 // setRequireConfirmation(bool) method.
4048 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004049
Kevin Chyn1741a072019-01-17 11:54:40 -08004050 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004051 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004052 REJECTED = 1;
4053 PENDING_CONFIRMATION = 2;
4054 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004055 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004056
4057 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004058 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004059 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4060 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4061 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4062 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004063 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004064 // Dictates if this message should trigger additional debugging.
4065 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004066}
4067
4068/**
4069 * Logs when a biometric error occurs.
4070 *
4071 * Logged from:
4072 * frameworks/base/services/core/java/com/android/server/biometrics
4073 */
4074message BiometricErrorOccurred {
4075 // Biometric modality that was used.
4076 optional android.hardware.biometrics.ModalityEnum modality = 1;
4077 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4078 optional int32 user = 2;
4079 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4080 optional bool is_crypto = 3;
4081 // Action that the device is performing.
4082 optional android.hardware.biometrics.ActionEnum action = 4;
4083 // The client that this acquisition was received for.
4084 optional android.hardware.biometrics.ClientEnum client = 5;
4085 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4086 // are unique to modality.
4087 optional int32 error_info = 6;
4088 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4089 // by the vendor and not specified by the HIDL interface.
4090 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004091 // Dictates if this message should trigger additional debugging.
4092 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004093 // Time spent during the authentication attempt.
4094 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004095}
4096
4097/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004098 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004099 * Logged from:
4100 * frameworks/base/services/core/java/com/android/server/biometrics
4101 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004102message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004103 // Biometric modality.
4104 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004105 // Type of issue detected.
4106 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004107 // Dictates if this message should trigger additional debugging.
4108 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004109}
Howard Ro688ae182018-09-25 00:09:36 -07004110
joshmccloskey6f952b22019-03-25 20:59:35 -07004111/**
4112 * Logs when a biometric enrollment occurs.
4113 *
4114 * Logged from:
4115 * frameworks/base/services/core/java/com/android/server/biometrics
4116 */
4117message BiometricEnrolled {
4118 // Biometric modality that was used.
4119 optional android.hardware.biometrics.ModalityEnum modality = 1;
4120 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4121 optional int32 user = 2;
4122 // The amount of time the enrollment took in milliseconds.
4123 optional int64 latency_millis = 3;
4124 // Whether or not the enrollment was successful.
4125 optional bool success = 4;
4126}
4127
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004128/*
Tej Singh0d176952019-01-16 19:10:54 -08004129 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004130 */
Tej Singh0d176952019-01-16 19:10:54 -08004131message FlagFlipUpdateOccurred {
4132 // If the event is from a flag config package, specify the package name.
4133 optional string flag_flip_package_name = 1;
4134
4135 // The order id of the package
4136 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004137}
4138
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004139/**
4140 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004141 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004142 */
4143message TrainExperimentIds {
4144 repeated int64 experiment_id = 1;
4145}
4146
Yangster-macb89807e2018-11-15 21:10:57 -08004147/*
4148 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004149 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004150 */
4151message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004152 // Name of the train.
4153 optional string train_name = 1;
4154 // Version code for a "train" of packages that need to be installed atomically
4155 optional int64 train_version_code = 2;
4156 // After installation of this package, device requires a restart.
4157 optional bool requires_staging = 3;
4158 // Rollback should be enabled for this install.
4159 optional bool rollback_enabled = 4;
4160 // Requires low latency monitoring if possible.
4161 optional bool requires_low_latency_monitor = 5;
4162
Yangster-macb89807e2018-11-15 21:10:57 -08004163 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004164 UNKNOWN = 0;
4165 INSTALL_REQUESTED = 1;
4166 INSTALL_STARTED = 2;
4167 INSTALL_STAGED_NOT_READY = 3;
4168 INSTALL_STAGED_READY = 4;
4169 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004170 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4171 // and INSTALL_FAILURE_COMMIT.
4172 INSTALL_FAILURE = 6 [deprecated = true];
4173 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004174 INSTALL_CANCELLED = 7;
4175 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004176 INSTALLER_ROLLBACK_INITIATED = 9;
4177 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4178 INSTALLER_ROLLBACK_STAGED = 11;
4179 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4180 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4181 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4182 INSTALLER_ROLLBACK_SUCCESS = 15;
4183 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004184 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4185 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4186 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4187 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4188 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4189 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004190 INSTALL_FAILURE_DOWNLOAD = 23;
4191 INSTALL_FAILURE_STATE_MISMATCH = 24;
4192 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004193 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004194 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004195 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004196 // Possible experiment ids for monitoring this push.
4197 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4198 // user id
4199 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004200 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004201 // Whether or not this is a rollback event
4202 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004203}
4204
Tej Singhc9203082019-05-03 13:42:23 -07004205/* Test atom, is not logged anywhere */
4206message TestAtomReported {
4207 repeated AttributionNode attribution_node = 1;
4208 optional int32 int_field = 2;
4209 optional int64 long_field = 3;
4210 optional float float_field = 4;
4211 optional string string_field = 5;
4212 optional bool boolean_field = 6;
4213 enum State {
4214 UNKNOWN = 0;
4215 OFF = 1;
4216 ON = 2;
4217 }
4218 optional State state = 7;
4219 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4220}
4221
Maggie Whitefc1aa592018-11-28 21:55:23 -08004222/** Represents USB port overheat event. */
4223message UsbPortOverheatEvent {
4224 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4225 optional int32 plug_temperature_deci_c = 1;
4226
4227 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4228 optional int32 max_temperature_deci_c = 2;
4229
4230 /* Time between USB plug event and overheat threshold trip, in seconds. */
4231 optional int32 time_to_overheat_secs = 3;
4232
4233 /* Time between overheat threshold trip and hysteresis, in seconds. */
4234 optional int32 time_to_hysteresis_secs = 4;
4235
4236 /* Time between hysteresis and active mitigation ending, in seconds. */
4237 optional int32 time_to_inactive_secs = 5;
4238};
4239
Maggie White8735b852019-01-18 11:40:49 -08004240/**
4241 * Logs total effective full charge and discharge cycles on a battery.
4242 * Here are some examples of one effective cycle:
4243 * 1) the battery charges from 0% to 100% and drains back to 0%,
4244 * 2) charging from 50% to 100% and draining back to 50% twice.
4245 * Pulled from:
4246 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4247 */
4248message BatteryCycleCount {
4249 /* Number of total charge and discharge cycles on the system battery. */
4250 optional int32 cycle_count = 1;
4251}
4252
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004253/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004254 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4255 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004256 * Pulled from:
4257 * StatsCompanionService
4258 */
4259
Carmen Agimof12dec122019-03-06 16:14:38 +00004260message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004261
Carmen Agimof12dec122019-03-06 16:14:38 +00004262 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004263 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004264 PUBLIC = 1;
4265 PRIVATE = 2;
4266 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004267 }
4268
Carmen Agimof12dec122019-03-06 16:14:38 +00004269 // The type of external storage.
4270 optional android.stats.storage.ExternalStorageType storage_type = 1;
4271 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4272 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004273 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004274 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004275}
4276
Yangster-macb89807e2018-11-15 21:10:57 -08004277/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004278 * Logs when a connection becomes available and lost.
4279 * Logged in StatsCompanionService.java
4280 */
4281message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004282 // Id of the network.
4283 optional int32 net_id = 1;
4284
4285 enum State {
4286 UNKNOWN = 0;
4287 CONNECTED = 1;
4288 DISCONNECTED = 2;
4289 }
4290 // Connected state of a network.
4291 optional State state = 2;
4292}
4293
4294/**
4295 * Logs when a service starts and stops.
4296 * Logged from:
4297 * services/core/java/com/android/server/am/ActiveServices.java
4298 */
4299message ServiceStateChanged {
4300
4301 optional int32 uid = 1 [(is_uid) = true];
4302
4303 optional string package_name = 2;
4304
4305 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004306
4307 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004308 START = 1;
4309 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004310 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004311
4312 optional State state = 4;
4313}
4314
4315/**
4316 * Logs when a service is launched.
4317 * Logged from:
4318 * services/core/java/com/android/server/am/ActiveServices.java
4319 */
4320message ServiceLaunchReported {
4321
4322 optional int32 uid = 1 [(is_uid) = true];
4323
4324 optional string package_name = 2;
4325
4326 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004327}
Howard Ro688ae182018-09-25 00:09:36 -07004328
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004329/**
4330 * Logs when a hidden API is used.
4331 *
4332 * Logged from:
4333 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4334 */
4335message HiddenApiUsed {
4336 // The uid of the app making the hidden access.
4337 optional int32 uid = 1 [(is_uid) = true];
4338
4339 // Signature of the method or field accessed.
4340 optional string signature = 2;
4341
4342 enum AccessMethod {
4343 NONE = 0;
4344 REFLECTION = 1;
4345 JNI = 2;
4346 LINKING = 3;
4347 }
4348
4349 // Type of access.
4350 optional AccessMethod access_method = 3;
4351
4352 // Whether the access was prevented or not.
4353 optional bool access_denied = 4;
4354}
4355
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004356/**
4357 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4358 * - When user sees privacy chip
4359 * - When user clicks privacy chip
4360 * - How does the user exit the Privacy Dialog
4361 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004362 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4363 */
4364message PrivacyIndicatorsInteracted {
4365
4366 enum Type {
4367 UNKNOWN = 0;
4368 CHIP_VIEWED = 1;
4369 CHIP_CLICKED = 2;
4370 DIALOG_PRIVACY_SETTINGS = 3;
4371 DIALOG_DISMISS = 4;
4372 DIALOG_LINE_ITEM = 5;
4373 }
4374
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004375 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004376
4377 // Used if the type is LINE_ITEM
4378 optional string package_name = 2;
4379}
4380
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004381/**
4382 * Logs information about a package that is moved from the internal to external storage and vice
4383 * versa.
4384 * It logs the package name, the type of the external storage where the package is installed
4385 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4386 * and the move type: if it's from internal to external or the other way around.
4387 *
4388 * Logged from:
4389 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4390 */
4391message AppMovedStorageReported {
4392 enum MoveType {
4393 UNKNOWN = 0;
4394 TO_EXTERNAL = 1;
4395 TO_INTERNAL = 2;
4396 }
4397 // The type of the external storage.
4398 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4399 // The type of move.
4400 optional MoveType move_type = 2;
4401 // The name of the package that was moved.
4402 optional string package_name = 3;
4403}
4404
jianjin8f2dee02019-03-29 14:03:08 -07004405/**
4406 * Logs when system server watchdog occurs.
4407 * Logged from:
4408 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4409 */
4410message SystemServerWatchdogOccurred {
4411 optional string subject = 1;
4412}
4413
4414/**
4415 * Logs when new file added to tombstones.
4416 * Logged from:
4417 * frameworks/base/core/java/com/android/server/BootReceiver.java
4418 */
4419message TombStoneOccurred {
4420}
4421
Hai Zhang5d3328d2019-04-13 21:25:06 +08004422/*
4423 * Information about a role request
4424 *
4425 * Logged from:
4426 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4427 */
4428message RoleRequestResultReported {
4429 // UID of application requesting the role
4430 optional int32 requesting_uid = 1;
4431
4432 // Package name of application requesting the role
4433 optional string requesting_package_name = 2;
4434
4435 // The role to be granted
4436 optional string role_name = 3;
4437
4438 // The count of applications qualifying for the role
4439 optional int32 qualifying_count = 4;
4440
4441 // UID of application current granted the role
4442 optional int32 current_uid = 5;
4443
4444 // Package name of application current granted the role
4445 optional string current_package_name = 6;
4446
4447 // UID of another application that user chose to grant the role to, instead of the requesting
4448 // application
4449 optional int32 granted_another_uid = 7;
4450
4451 // Package name of another application that user chose to grant the role to, instead of the
4452 // requesting application
4453 optional string granted_another_package_name = 8;
4454
4455 enum Result {
4456 UNDEFINED = 0;
4457 // role request was ignored
4458 IGNORED = 1;
4459 // role request was ignored because it's already granted
4460 IGNORED_ALREADY_GRANTED = 2;
4461 // role request was ignored because the application isn't qualified
4462 IGNORED_NOT_QUALIFIED = 3;
4463 // role request was ignored because user said it should be always denied
4464 IGNORED_USER_ALWAYS_DENIED = 4;
4465 // role was granted by user action
4466 USER_GRANTED = 5;
4467 // role was denied by user action
4468 USER_DENIED = 6;
4469 // role was denied by user granting another application the role
4470 USER_DENIED_GRANTED_ANOTHER = 7;
4471 // role was denied and set to be always denied by the user
4472 USER_DENIED_WITH_ALWAYS = 8;
4473 }
4474 // The result of the role request
4475 optional Result result = 9;
4476}
4477
Mark Tabrya824a642019-11-05 12:26:12 -08004478/**
4479 * Logs when a Vehicle Maps Service client's connection state has changed
4480 *
4481 * Logged from:
4482 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4483 */
4484message VmsClientConnectionStateChanged {
4485 // The UID of the VMS client app
4486 optional int32 uid = 1 [(is_uid) = true];
4487
4488 enum State {
4489 UNKNOWN = 0;
4490 // Attempting to connect to the client
4491 CONNECTING = 1;
4492 // Client connection established
4493 CONNECTED = 2;
4494 // Client connection closed unexpectedly
4495 DISCONNECTED = 3;
4496 // Client connection closed by VMS
4497 TERMINATED = 4;
4498 // Error establishing the client connection
4499 CONNECTION_ERROR = 5;
4500 }
4501
4502 optional State state = 2;
4503}
4504
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004505/**
4506 * Logs when MediaProvider has successfully finished scanning a storage volume.
4507 *
4508 * Logged from:
4509 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4510 */
shafik43825842020-04-02 17:30:24 +01004511message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004512 enum Reason {
4513 // Scan triggered due to unknown reason
4514 UNKNOWN = 0;
4515 // Scan triggered due to storage volume being mounted
4516 MOUNTED = 1;
4517 // Scan triggered due to explicit user action or app request
4518 DEMAND = 2;
4519 // Scan triggered due to idle maintenance
4520 IDLE = 3;
4521 }
4522
4523 // Volume type that this event pertains to
4524 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4525 // Reason why this scan was triggered
4526 optional Reason reason = 2;
4527 // Total number of files scanned
4528 optional int64 item_count = 3;
4529 // Duration of scan, normalized per file
4530 optional float normalized_duration_millis = 4;
4531 // Number of database inserts, normalized per file
4532 optional float normalized_insert_count = 5;
4533 // Number of database updates, normalized per file
4534 optional float normalized_update_count = 6;
4535 // Number of database deletes, normalized per file
4536 optional float normalized_delete_count = 7;
4537}
4538
4539/**
4540 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4541 *
4542 * Logged from:
4543 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4544 */
shafik43825842020-04-02 17:30:24 +01004545message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004546 // Volume type that this event pertains to
4547 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004548 // UID of app that requested deletion
4549 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004550 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004551 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004552}
4553
4554/**
4555 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4556 *
4557 * Logged from:
4558 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4559 */
shafik43825842020-04-02 17:30:24 +01004560message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004561 enum Result {
4562 UNKNOWN = 0;
4563 USER_GRANTED = 1;
4564 AUTO_GRANTED = 2;
4565 USER_DENIED = 3;
4566 USER_DENIED_WITH_PREJUDICE = 4;
4567 AUTO_DENIED = 5;
4568 }
4569
4570 // Volume type that this event pertains to
4571 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004572 // UID of app that requested permission
4573 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004574 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004575 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004576 // Result of this request
shafik43825842020-04-02 17:30:24 +01004577 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004578}
4579
4580/**
4581 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4582 *
4583 * Logged from:
4584 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4585 */
shafik43825842020-04-02 17:30:24 +01004586message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004587 // Volume type that this event pertains to
4588 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4589 // Old database version code
4590 optional int32 version_from = 2;
4591 // New database version code
4592 optional int32 version_to = 3;
4593 // Total number of files in database
4594 optional int64 item_count = 4;
4595 // Duration of schema change, normalized per file
4596 optional float normalized_duration_millis = 5;
4597}
4598
4599/**
4600 * Logs when MediaProvider has finished an idle maintenance job.
4601 *
4602 * Logged from:
4603 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4604 */
shafik43825842020-04-02 17:30:24 +01004605message MediaProviderIdleMaintenanceFinished {
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
4609 // Total number of files in database
4610 optional int64 item_count = 2;
4611 // Duration of idle maintenance, normalized per file
4612 optional float normalized_duration_millis = 3;
4613 // Number of thumbnails found to be stale, normalized per file
4614 optional float normalized_stale_thumbnails = 4;
4615 // Number of items found to be expired, normalized per file
4616 optional float normalized_expired_media = 5;
4617}
4618
Keun young Park3e033cb2019-12-18 11:27:35 -08004619/**
4620 * Represents boot time event with duration in ms.
4621 *
4622 * Logged from: bootstat and various system server components. Check each enums for details.
4623 */
4624message BootTimeEventDuration {
4625 enum DurationEvent {
4626 UNKNOWN = 0;
4627 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4628 ABSOLUTE_BOOT_TIME = 1;
4629 // Bootloader's 1st stage execution time.
4630 // Logged from bootstat.
4631 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4632 // Bootloader's 1st stage loading time.
4633 // Logged from bootstat.
4634 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4635 // Bootloader's kernel loading time.
4636 // Logged from bootstat.
4637 BOOTLOADER_KERNEL_LOAD = 4;
4638 // Bootloader's 2nd stage execution time.
4639 // Logged from bootstat.
4640 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4641 // Bootloader's 2nd stage loading time.
4642 // Logged from bootstat.
4643 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4644 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4645 // for locked device.
4646 // Logged from bootstat.
4647 BOOTLOADER_UI_WAIT = 7;
4648 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4649 // Logged from bootstat.
4650 BOOTLOADER_TOTAL = 8;
4651 // Shutdown duration inside init for the reboot before the current boot up.
4652 // Logged from f/b/services/.../BootReceiver.java.
4653 SHUTDOWN_DURATION = 9;
4654 // Total time for mounting of disk devices during bootup.
4655 // Logged from f/b/services/.../BootReceiver.java.
4656 MOUNT_DEFAULT_DURATION = 10;
4657 // Total time for early stage mounting of disk devices during bootup.
4658 // Logged from f/b/services/.../BootReceiver.java.
4659 MOUNT_EARLY_DURATION = 11;
4660 // Total time for late stage mounting of disk devices during bootup.
4661 // Logged from f/b/services/.../BootReceiver.java.
4662 MOUNT_LATE_DURATION = 12;
4663 // Average time to scan non-system app after OTA
4664 // Logged from f/b/services/.../PackageManagerService.java
4665 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4666 // Time to initialize Package manager after OTA
4667 // Logged from f/b/services/.../PackageManagerService.java
4668 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4669 // Time to scan all system app from Package manager after OTA
4670 // Logged from f/b/services/.../PackageManagerService.java
4671 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4672 // Init's total time for cold boot stage.
4673 // Logged from bootstat.
4674 COLDBOOT_WAIT = 16;
4675 // Init's total time for initializing selinux.
4676 // Logged from bootstat.
4677 SELINUX_INIT = 17;
4678 // Time since last factory reset.
4679 // Logged from bootstat.
4680 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004681 // Init's total time spent for completing the 1st stage.
4682 // Logged from bootstat.
4683 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004684 }
4685
4686 // Type of the event.
4687 optional DurationEvent event = 1;
4688 // Duration of the event in ms.
4689 optional int64 duration_millis = 2;
4690}
4691
4692/**
4693 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4694 * since boot-up.
4695 *
4696 * Logged from: bootstat and various system server components. Check each enums for details.
4697 */
4698message BootTimeEventElapsedTime {
4699 enum ElapsedTimeEvent {
4700 UNKNOWN = 0;
4701 // Time when init starts 1st stage. Logged from bootstat.
4702 ANDROID_INIT_STAGE_1 = 1;
4703 // Time when sys.boot_completed prop is set.
4704 // Logged from bootstat.
4705 BOOT_COMPLETE = 2;
4706 // BOOT_COMPLETE for encrypted device.
4707 BOOT_COMPLETE_ENCRYPTION = 3;
4708 // BOOT_COMPLETE for device with no encryption.
4709 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4710 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004711 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004712 // BOOT_COMPLETE after factory reset.
4713 FACTORY_RESET_BOOT_COMPLETE = 6;
4714 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4715 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004716 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4717 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004718 // BOOT_COMPLETE after OTA.
4719 OTA_BOOT_COMPLETE = 9;
4720 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4721 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004722 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4723 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004724 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4725 // Logged from f/b/services/.../UserController.java
4726 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4727 // Time when the system starts sending BOOT_COMPLETED broadcast.
4728 // Logged from f/b/services/.../UserController.java
4729 FRAMEWORK_BOOT_COMPLETED = 13;
4730 // Time when the package manager starts init.
4731 // Logged from f/b/services/.../SystemServer.java
4732 PACKAGE_MANAGER_INIT_START = 14;
4733 // Time when package manager is ready
4734 // Logged from f/b/services/.../SystemServer.java
4735 PACKAGE_MANAGER_INIT_READY = 15;
4736 // Represents the time when user has entered unlock credential for system with user pin.
4737 // Logged from bootstat.
4738 POST_DECRYPT = 16;
4739 // Represents the start of zygote's init.
4740 // Logged from zygote itself.
4741 ZYGOTE_INIT_START = 17;
4742 // Represents the start of secondary zygote's init.
4743 // TODO: add logging to zygote
4744 SECONDARY_ZYGOTE_INIT_START = 18;
4745 // Represents the start of system server's init.
4746 // Logged from f/b/services/.../SystemServer.java
4747 SYSTEM_SERVER_INIT_START = 19;
4748 // Represents the completion of system server's init.
4749 // Logged from f/b/services/.../SystemServer.java
4750 SYSTEM_SERVER_READY = 20;
4751 // Represents the start of launcher during boot-up.
4752 // TODO: add logging
4753 LAUNCHER_START = 21;
4754 // Represents the completion of launcher's initial rendering. User can use other apps from
4755 // launcher from this point.
4756 // TODO: add logging
4757 LAUNCHER_SHOWN = 22;
4758 }
4759
4760 // Type of the event.
4761 optional ElapsedTimeEvent event = 1;
4762 // Time since bootup for the event.
4763 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4764 optional int64 time_millis = 2;
4765}
4766
4767/**
4768 * Boot time events with UTC time.
4769 *
4770 * Logged from: bootstat and various system server components. Check each enums for details.
4771 */
4772message BootTimeEventUtcTime {
4773 enum UtcTimeEvent {
4774 UNKNOWN = 0;
4775 // Time of the bootstat's marking of 1st boot after the last factory reset.
4776 // Logged from bootstat.
4777 FACTORY_RESET_RESET_TIME = 1;
4778 // The time when bootstat records FACTORY_RESET_* events. This is close to
4779 // BOOT_COMPLETE time for the current bootup.
4780 // Logged from bootstat.
4781 FACTORY_RESET_CURRENT_TIME = 2;
4782 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4783 // Logged from bootstat.
4784 FACTORY_RESET_RECORD_VALUE = 3;
4785 }
4786
4787 // Type of the event.
4788 optional UtcTimeEvent event = 1;
4789 // UTC time for the event.
4790 optional int64 utc_time_secs = 2;
4791}
4792
4793/**
4794 * Boot time events representing specific error code during bootup.
4795 * Meaning of error code can be different per each event type.
4796 *
4797 * Logged from: bootstat and various system server components. Check each enums for details.
4798 */
4799message BootTimeEventErrorCode {
4800 enum ErrorCodeEvent {
4801 UNKNOWN = 0;
4802 // Linux error code for time() call to get the current UTC time.
4803 // Logged from bootstat.
4804 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4805 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4806 // as UMOUNT_STAT_* from init/reboot.cpp.
4807 // Logged from f/b/services/.../BootReceiver.java.
4808 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004809 // Reprepsents fie system mounting error code of /data partition for the current boot.
4810 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004811 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004812 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004813 }
4814
4815 // Type of the event.
4816 optional ErrorCodeEvent event = 1;
4817 // error code defined per each event type.
4818 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4819 // FS_MGR_FS_STAT.
4820 optional int32 error_code = 2;
4821}
4822
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004823/**
4824 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4825 * after an OTA.
4826 *
4827 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004828 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004829 */
4830message SnapshotMergeReported {
4831 // Keep in sync with
4832 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4833 enum UpdateState {
4834 // No update or merge is in progress.
4835 NONE = 0;
4836 // An update is applying; snapshots may already exist.
4837 INITIATED = 1;
4838 // An update is pending, but has not been successfully booted yet.
4839 UNVERIFIED = 2;
4840 // The kernel is merging in the background.
4841 MERGING = 3;
4842 // Post-merge cleanup steps could not be completed due to a transient
4843 // error, but the next reboot will finish any pending operations.
4844 MERGE_NEEDS_REBOOT = 4;
4845 // Merging is complete, and needs to be acknowledged.
4846 MERGE_COMPLETED = 5;
4847 // Merging failed due to an unrecoverable error.
4848 MERGE_FAILED = 6;
4849 // The update was implicitly cancelled, either by a rollback or a flash
4850 // operation via fastboot. This state can only be returned by WaitForMerge.
4851 CANCELLED = 7;
4852 };
4853
4854 // Status of the update after the merge attempts.
4855 optional UpdateState final_state = 1;
4856
4857 // Time to complete a merge operation in milliseconds.
4858 // A negative value corresponds to the case in which the merge operation
4859 // was interrupted and resumed (e.g. in case of a system reboot during the
4860 // merge).
4861 optional int64 duration_millis = 2;
4862
4863 // Number of reboots that occurred after issuing and before completing the
4864 // merge of all the snapshot devices.
4865 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004866
4867 // The device has been upgraded to Virtual A/B.
4868 optional bool is_vab_retrofit = 4;
4869
4870 // Space that has been temporarily allocated in the /data partition
4871 // containing the dm-snapshot's copy-on-write data generated during a
4872 // Virtual A/B update.
4873 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004874}
4875
Chenjie Yubbcbc602018-02-05 16:51:52 -08004876//////////////////////////////////////////////////////////////////////
4877// Pulled atoms below this line //
4878//////////////////////////////////////////////////////////////////////
4879
4880/**
David Chenc8a43242017-10-17 16:23:28 -07004881 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4882 *
4883 * Pulled from:
4884 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4885 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004886message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004887 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004888
4889 optional int64 rx_bytes = 2;
4890
4891 optional int64 rx_packets = 3;
4892
4893 optional int64 tx_bytes = 4;
4894
4895 optional int64 tx_packets = 5;
4896}
4897
4898/**
4899 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4900 *
4901 * Pulled from:
4902 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004904message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004905 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004906
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004907 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4908 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004909
4910 optional int64 rx_bytes = 3;
4911
4912 optional int64 rx_packets = 4;
4913
4914 optional int64 tx_bytes = 5;
4915
4916 optional int64 tx_packets = 6;
4917}
4918
4919/**
4920 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4921 *
4922 * Pulled from:
4923 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4924 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004925message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004926 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004927
4928 optional int64 rx_bytes = 2;
4929
4930 optional int64 rx_packets = 3;
4931
4932 optional int64 tx_bytes = 4;
4933
4934 optional int64 tx_packets = 5;
4935}
4936
4937/**
4938 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4939 *
4940 * Pulled from:
4941 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4942 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004943message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004944 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004945
Yao Chenc40a19d2018-03-15 16:48:25 -07004946 // 1 denotes foreground and 0 denotes background. This is called Set in
4947 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004948 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004949
4950 optional int64 rx_bytes = 3;
4951
4952 optional int64 rx_packets = 4;
4953
4954 optional int64 tx_bytes = 5;
4955
4956 optional int64 tx_packets = 6;
4957}
4958
4959/**
junyulai8d1a6092020-05-07 13:38:15 +08004960 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004961 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4962 * the caller must not assume any row of data is one full report when filtering with a set of
4963 * matching conditions, because future data may represent with multiple rows what is currently
4964 * represented by one.
4965 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4966 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004967 *
4968 * Pulled from:
4969 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4970 */
4971message DataUsageBytesTransfer {
4972 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4973 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4974 // states combined, not including debug states. See NetworkStats#SET_*.
4975 optional int32 state = 1;
4976
4977 optional int64 rx_bytes = 2;
4978
4979 optional int64 rx_packets = 3;
4980
4981 optional int64 tx_bytes = 4;
4982
4983 optional int64 tx_packets = 5;
4984
4985 // Radio Access Technology (RAT) type of this record, should be one of
4986 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4987 // the record is for all rat types combined.
4988 optional int32 rat_type = 6;
4989
4990 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004991 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004992 optional string sim_mcc = 7;
4993 optional string sim_mnc = 8;
4994
junyulai8b794b72020-05-19 17:36:13 +08004995 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4996 // See TelephonyManager#getSimCarrierId.
4997 optional int32 carrier_id = 9;
4998
junyulai8d1a6092020-05-07 13:38:15 +08004999 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5000 // combined regardless of the boolean value in its field.
5001 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005002 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005003 ALL = 1;
5004 OPPORTUNISTIC = 2;
5005 NOT_OPPORTUNISTIC = 3;
5006 }
5007 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005008 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005009 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005010 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005011}
5012
5013/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005014 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5015 *
5016 * Pulled from:
5017 * StatsCompanionService
5018 */
5019message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005020 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005021
5022 optional int64 rx_bytes = 2;
5023
5024 optional int64 tx_bytes = 3;
5025}
5026
5027/**
David Chenc8a43242017-10-17 16:23:28 -07005028 * Pulls the kernel wakelock durations. This atom is adapted from
5029 * android/internal/os/KernelWakelockStats.java
5030 *
5031 * Pulled from:
5032 * StatsCompanionService using KernelWakelockReader.
5033 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005034message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005035 optional string name = 1;
5036
5037 optional int32 count = 2;
5038
5039 optional int32 version = 3;
5040
Yangster-maca8a30442018-10-13 23:46:34 -07005041 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005042}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005043
Chenjie Yu05013b32017-11-21 10:21:41 -08005044/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005045 * Pulls low power state information. If power.stats HAL is not available, this
5046 * includes platform and subsystem sleep state information,
5047 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5048 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005049 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005050 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005051 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5052 * as defined in:
5053 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005054 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005055message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005056 // Subsystem name
5057 optional string subsystem_name = 1;
5058 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5059 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005060 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5061 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005062 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005063 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005064 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005065 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005066 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005067}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005068
Chenjie Yu05013b32017-11-21 10:21:41 -08005069/**
Bookatz92da2832018-11-01 18:10:03 -07005070 * Pulls on-device power measurement information.
5071 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5072 * Pulled from:
5073 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5074 */
5075message OnDevicePowerMeasurement {
5076 // Name of the subsystem (to which the rail belongs).
5077 optional string subsystem_name = 1;
5078
5079 // Rail name. The rail lies within the subsystem.
5080 optional string rail_name = 2;
5081
5082 // Time (in ms since boot) at which the rail energy value was measured.
5083 // This may differ slightly from the time that statsd logs this information.
5084 optional uint64 measurement_timestamp_millis = 3;
5085
5086 // Accumulated energy used via the rail since device boot in uWs.
5087 optional uint64 energy_microwatt_secs = 4;
5088}
5089
5090/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005091 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005092 * Pulls the time the cpu spend on the frequency index. Frequency index
5093 * starts from highest to lowest. The value should be monotonically
5094 * increasing since boot. However, if there is a cpu
5095 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005096 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005097message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005098 optional uint32 cluster = 1;
5099 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005100 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005101}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005102
Chenjie Yu05013b32017-11-21 10:21:41 -08005103/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005104 * Pulls Cpu Time Per Uid.
5105 * Note that isolated process uid time should be attributed to host uids.
5106 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005107message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005108 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005109 optional uint64 user_time_micros = 2;
5110 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005111}
5112
5113/**
5114 * Pulls Cpu Time Per Uid per frequency.
5115 * Note that isolated process uid time should be attributed to host uids.
5116 * For each uid, we order the time by descending frequencies.
5117 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005118message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005119 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005120 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005121 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005122}
Hugo Benichi884970e2017-11-14 22:42:46 +09005123
Chenjie Yu05013b32017-11-21 10:21:41 -08005124/**
5125 * Pulls Wifi Controller Activity Energy Info
5126 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005127message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005128 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005129 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005130 // stack reported state
5131 // TODO: replace this with proto enum
5132 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005133 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005134 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005135 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005136 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005137 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005138 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005139 // product of current(mA), voltage(V) and time(ms)
5140 optional uint64 controller_energy_used = 6;
5141}
5142
5143/**
5144 * Pulls Modem Activity Energy Info
5145 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005146message ModemActivityInfo {
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;
Yangster-maca8a30442018-10-13 23:46:34 -07005149 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005150 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005151 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005152 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005153 /**
5154 * Tx power index
5155 * index 0 = tx_power < 0dBm
5156 * index 1 = 0dBm < tx_power < 5dBm
5157 * index 2 = 5dBm < tx_power < 15dBm
5158 * index 3 = 15dBm < tx_power < 20dBm
5159 * index 4 = tx_power > 20dBm
5160 */
5161 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005162 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005163 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005164 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005165 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005166 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005167 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005168 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005169 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005170 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005171 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005172 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005173 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005174 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005175}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005176
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005177/**
5178 * Pulls Bluetooth Activity Energy Info
5179 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5180 */
5181message BluetoothActivityInfo {
5182 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005183 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005184 // bluetooth stack state
5185 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005186 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005187 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005188 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005189 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005190 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005191 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005192 // product of current(mA), voltage(V) and time(ms)
5193 optional uint64 energy_used = 6;
5194}
5195
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005196/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005197 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005198 *
5199 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005200 */
5201message ProcessMemoryState {
5202 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005203 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005204
5205 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005206 // Usually package name, "system" for system server.
5207 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005208 optional string process_name = 2;
5209
Rafal Slawikda51b932018-12-13 16:31:33 +00005210 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005211 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005212
5213 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005214 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005215
5216 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005217 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005218
Rajeev Kumar90235992018-01-29 11:06:48 -08005219 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005220 // Value is read from memory.stat, field total_rss if per-app memory
5221 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005222 optional int64 rss_in_bytes = 6;
5223
5224 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005225 // Value is read from memory.stat, field total_cache if per-app memory
5226 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005227 optional int64 cache_in_bytes = 7;
5228
5229 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005230 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005231 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005232 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005233
Rafal Slawik203c3db2019-09-25 19:53:01 +01005234 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005235 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005236
Rafal Slawik203c3db2019-09-25 19:53:01 +01005237 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5238 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005239
Rafal Slawik203c3db2019-09-25 19:53:01 +01005240 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5241 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005242}
5243
5244/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005245 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005246 *
5247 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5248 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005249 *
5250 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005251 */
5252message ProcessMemoryHighWaterMark {
5253 // The uid if available. -1 means not available.
5254 optional int32 uid = 1 [(is_uid) = true];
5255
Rafal Slawikda51b932018-12-13 16:31:33 +00005256 // The process name.
5257 // Usually package name or process cmdline.
5258 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005259 optional string process_name = 2;
5260
Rafal Slawik239b6802019-09-09 18:46:01 +01005261 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5262 // computed by converting kilobytes to bytes.
5263 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5264
Rafal Slawik3bea8952018-11-15 12:39:33 +00005265 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5266 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005267 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005268}
5269
5270/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005271 * Logs the memory stats for a process.
5272 *
5273 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5274 * and for selected native processes.
5275 */
5276message ProcessMemorySnapshot {
5277 // The uid if available. -1 means not available.
5278 optional int32 uid = 1 [(is_uid) = true];
5279
5280 // The process name.
5281 // Usually package name or process cmdline.
5282 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5283 optional string process_name = 2;
5284
5285 // The pid of the process.
5286 // Allows to disambiguate instances of the process.
5287 optional int32 pid = 3;
5288
5289 // The current OOM score adjustment value.
5290 // Read from ProcessRecord for managed processes.
5291 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5292 optional int32 oom_score_adj = 4;
5293
5294 // The current RSS of the process.
5295 // VmRSS from /proc/pid/status.
5296 optional int32 rss_in_kilobytes = 5;
5297
5298 // The current anon RSS of the process.
5299 // RssAnon from /proc/pid/status.
5300 optional int32 anon_rss_in_kilobytes = 6;
5301
5302 // The current swap size of the process.
5303 // VmSwap from /proc/pid/status.
5304 optional int32 swap_in_kilobytes = 7;
5305
5306 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5307 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5308}
5309
5310/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005311 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005312 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005313message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005314 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005315}
5316
5317/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005318 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005319 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005320message SystemUptime {
5321 // Milliseconds since the system was booted.
5322 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5323 // for external input).
5324 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005325 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005326}
5327
5328/*
5329 * Reads from /proc/uid_concurrent_active_time which has the format:
5330 * active: X (X is # cores)
5331 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5332 * [uid1]: [time-0] [time-1] [time-2] ... ...
5333 * ...
5334 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5335 * The file contains a monotonically increasing count of time for a single boot.
5336 */
5337message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005338 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005339 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005340}
5341
5342/**
5343 * Reads from /proc/uid_concurrent_policy_time which has the format:
5344 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5345 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5346 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5347 * ...
5348 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5349 * The file contains a monotonically increasing count of time for a single boot.
5350 */
5351message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005352 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005353 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005354 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005355}
5356
5357/*
5358 * Pulls free disk space, for data, system partition and temporary directory.
5359 */
5360message DiskSpace {
5361 // available bytes in data partition
5362 optional uint64 data_available_bytes = 1;
5363 // available bytes in system partition
5364 optional uint64 system_available_bytes = 2;
5365 // available bytes in download cache or temp directories
5366 optional uint64 temp_available_bytes = 3;
5367}
Tej Singhbf972d92018-01-10 20:51:13 -08005368
5369/**
5370 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005371 *
5372 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005373 */
5374message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005375 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005376}
5377
5378/**
5379 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005380 * Pulled from:
5381 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005382 */
5383message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005384 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005385}
5386
5387/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005388 * Pulls battery voltage.
5389 * Pulled from:
5390 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5391 */
5392message BatteryVoltage {
5393 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005394 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005395}
5396
5397/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005398 * Pulls battery level (percent full, from 0 to 100).
5399 *
5400 * Pulled from:
5401 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5402 */
5403message BatteryLevel {
5404 // Battery level. Should be in [0, 100].
5405 optional int32 battery_level = 1;
5406}
5407
5408/**
Tej Singhd89137e2018-03-26 14:51:40 -07005409 * Pulls the temperature of various parts of the device.
5410 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005411 *
Maggie White442b6312019-04-05 16:26:44 -07005412 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005413 */
5414message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005415 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005416 optional android.os.TemperatureTypeEnum sensor_location = 1;
5417
5418 // The name of the temperature source. Eg. CPU0
5419 optional string sensor_name = 2;
5420
Tej Singhd89137e2018-03-26 14:51:40 -07005421 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005422 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005423 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005424
5425 // Relative severity of the throttling, see enum definition.
5426 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005427}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005428
5429/**
5430 * Pulls the statistics of calls to Binder.
5431 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005432 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5433 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005434 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005435 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005436 */
5437message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005438 // UID of the process responsible for the binder transaction. It will be set if the process
5439 // executing the binder transaction attribute the transaction to another uid using
5440 // Binder.setThreadWorkSource().
5441 //
5442 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005443 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005444 // UID of the process executing the binder transaction.
5445 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005446 // Fully qualified class name of the API call.
5447 //
5448 // This is a system server class name.
5449 //
5450 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5451 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5452 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5453 // commonly used APIs.
5454 optional string service_class_name = 2;
5455 // Method name of the API call. It can also be a transaction code if we cannot
5456 // resolve it to a name. See Binder#getTransactionName.
5457 //
5458 // This is a system server method name.
5459 optional string service_method_name = 3;
5460 // Total number of API calls.
5461 optional int64 call_count = 4;
5462 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5463 optional bool screen_interactive = 13;
5464 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5465 // call_count will be equal to recorded_call_count.
5466 //
5467 // If recorded_call_count is different than call_count, it means data collection has been
5468 // sampled. All the fields below will be sampled in this case.
5469 optional int64 recorded_call_count = 12;
5470 // Number of exceptions thrown by the API.
5471 optional int64 recorded_exception_count = 5;
5472 // Total latency of all API calls.
5473 // Average can be computed using total_latency_micros / recorded_call_count.
5474 optional int64 recorded_total_latency_micros = 6;
5475 // Maximum latency of one API call.
5476 optional int64 recorded_max_latency_micros = 7;
5477 // Total CPU usage of all API calls.
5478 // Average can be computed using total_cpu_micros / recorded_call_count.
5479 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5480 optional int64 recorded_total_cpu_micros = 8;
5481 // Maximum CPU usage of one API call.
5482 optional int64 recorded_max_cpu_micros = 9;
5483 // Maximum parcel reply size of one API call.
5484 optional int64 recorded_max_reply_size_bytes = 10;
5485 // Maximum parcel request size of one API call.
5486 optional int64 recorded_max_request_size_bytes = 11;
5487}
5488
5489/**
5490 * Pulls the statistics of exceptions during calls to Binder.
5491 *
5492 * Binder stats are cumulative from boot unless somebody reset the data using
5493 * > adb shell dumpsys binder_calls_stats --reset
5494 */
5495message BinderCallsExceptions {
5496 // Exception class name, e.g. java.lang.IllegalArgumentException.
5497 //
5498 // This is an exception class name thrown by the system server.
5499 optional string exception_class_name = 1;
5500 // Total number of exceptions.
5501 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005502}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005503
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005504/**
5505 * Pulls the statistics of message dispatching on HandlerThreads.
5506 *
5507 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5508 * config on the device.
5509 *
5510 * Next tag: 11
5511 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005512message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005513 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005514 optional int32 uid = 1 [(is_uid) = true];
5515
5516 // Fully qualified class name of the handler target class.
5517 //
5518 // This field does not contain PII. This is a system server class name.
5519 optional string handler_class_name = 2;
5520
5521 // The name of the thread that runs the Looper.
5522 //
5523 // This field does not contain PII. This is a system server thread name.
5524 optional string looper_thread_name = 3;
5525
5526 // The name of the dispatched message.
5527 //
5528 // This field does not contain PII. This is a system server constant or class
5529 // name.
5530 optional string message_name = 4;
5531
5532 // Total number of successfully dispatched messages.
5533 optional int64 message_count = 5;
5534
5535 // Total number of messages that failed dispatching.
5536 optional int64 exception_count = 6;
5537
5538 // Total number of processed messages we have data recorded for. If we
5539 // collected data for all the messages, message_count will be equal to
5540 // recorded_message_count.
5541 //
5542 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005543 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005544 optional int64 recorded_message_count = 7;
5545
5546 // Total latency of all processed messages.
5547 // Average can be computed using recorded_total_latency_micros /
5548 // recorded_message_count.
5549 optional int64 recorded_total_latency_micros = 8;
5550
5551 // Total CPU usage of all processed message.
5552 // Average can be computed using recorded_total_cpu_micros /
5553 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005554 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005555 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005556
5557 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5558 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005559
5560 // Max recorded CPU usage of all processed messages.
5561 optional int64 recorded_max_cpu_micros = 11;
5562
5563 // Max recorded latency of all processed messages.
5564 optional int64 recorded_max_latency_micros = 12;
5565
5566 // Total number of messages we tracked the dispatching delay for. If we
5567 // collected data for all the messages, message_count will be equal to
5568 // recorded_delay_message_count.
5569 //
5570 // If recorded_delay_message_count is different than message_count, it means data
5571 // collection has been sampled or/and not all messages specified the target dispatch time.
5572 // The fields below will be sampled in this case.
5573 optional int64 recorded_delay_message_count = 13;
5574
5575 // Total dispatching delay of all processed messages.
5576 // Calculated as a difference between the target dispatching time (Message.when)
5577 // and the actual dispatching time.
5578 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5579 optional int64 recorded_total_delay_millis = 14;
5580
5581 // Max dispatching delay of all processed messages.
5582 // Calculated as a difference between the target dispatching time (Message.when)
5583 // and the actual dispatching time.
5584 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005585}
Tej Singh86dc9db2018-09-06 00:39:57 +00005586
5587/**
5588 * Pulls disk information, such as write speed and latency.
5589 */
5590message DiskStats {
5591 // Time taken to open, write 512B to, and close a file.
5592 // -1 if error performing the check.
5593 optional int64 data_write_latency_millis = 1;
5594
5595 optional bool file_based_encryption = 2;
5596
5597 // Recent disk write speed in kB/s.
5598 // -1 if error querying storageed.
5599 // 0 if data is unavailable.
5600 optional int32 recent_disk_write_speed = 3;
5601}
5602
5603
5604/**
5605 * Free and total bytes of the Data, Cache, and System partition.
5606 */
5607message DirectoryUsage {
5608 enum Directory {
5609 UNKNOWN = 0;
5610 DATA = 1;
5611 CACHE = 2;
5612 SYSTEM = 3;
5613 }
5614 optional Directory directory = 1;
5615 optional int64 free_bytes = 2;
5616 optional int64 total_bytes = 3;
5617}
5618
5619
5620/**
5621 * Size of an application: apk size, data size, and cache size.
5622 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5623 * Information is only reported for apps with the primary user (user 0).
5624 * Sizes are aggregated by package name.
5625 */
5626message AppSize {
5627 // Including uids will involve modifying diskstats logic.
5628 optional string package_name = 1;
5629 // App size in bytes. -1 if unavailable.
5630 optional int64 app_size_bytes = 2;
5631 // App data size in bytes. -1 if unavailable.
5632 optional int64 app_data_size_bytes = 3;
5633 // App cache size in bytes. -1 if unavailable.
5634 optional int64 app_cache_size_bytes = 4;
5635 // Time that the cache file was produced.
5636 // Uses System.currentTimeMillis(), which is wall clock time.
5637 optional int64 cache_time_millis = 5;
5638}
5639
5640
5641/**
5642 * Size of a particular category. Eg: photos, videos.
5643 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5644 */
5645message CategorySize {
5646 enum Category {
5647 UNKNOWN = 0;
5648 APP_SIZE = 1;
5649 APP_DATA_SIZE = 2;
5650 APP_CACHE_SIZE = 3;
5651 PHOTOS = 4;
5652 VIDEOS = 5;
5653 AUDIO = 6;
5654 DOWNLOADS = 7;
5655 SYSTEM = 8;
5656 OTHER = 9;
5657 }
5658 optional Category category = 1;
5659 // Category size in bytes.
5660 optional int64 size_bytes = 2;
5661 // Time that the cache file was produced.
5662 // Uses System.currentTimeMillis(), which is wall clock time.
5663 optional int64 cache_time_millis = 3;
5664}
Tej Singhd6d6d772018-09-05 17:41:25 -07005665
5666/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005667 * Pulls per uid I/O stats. The stats are cumulative since boot.
5668 *
5669 * Read/write bytes are I/O events from a storage device
5670 * Read/write chars are data requested by read/write syscalls, and can be
5671 * satisfied by caching.
5672 *
5673 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5674 */
5675message DiskIo {
5676 optional int32 uid = 1 [(is_uid) = true];
5677 optional int64 fg_chars_read = 2;
5678 optional int64 fg_chars_write = 3;
5679 optional int64 fg_bytes_read = 4;
5680 optional int64 fg_bytes_write = 5;
5681 optional int64 bg_chars_read = 6;
5682 optional int64 bg_chars_write = 7;
5683 optional int64 bg_bytes_read = 8;
5684 optional int64 bg_bytes_write = 9;
5685 optional int64 fg_fsync = 10;
5686 optional int64 bg_fsync= 11;
5687}
5688
5689
5690/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005691 * Pulls the number of fingerprints for each user.
5692 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005693 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005694 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005695message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005696 // The associated user. Eg: 0 for owners, 10+ for others.
5697 // Defined in android/os/UserHandle.java
5698 optional int32 user = 1;
5699 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005700 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005701}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005702
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005703/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005704 * Pulls the number of faces for each user.
5705 *
5706 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5707 */
5708message NumFacesEnrolled {
5709 // The associated user. Eg: 0 for owners, 10+ for others.
5710 // Defined in android/os/UserHandle.java
5711 optional int32 user = 1;
5712 // Number of faces registered to that user.
5713 optional int32 num_faces_enrolled = 2;
5714}
5715/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005716 * A mapping of role holder -> role
5717 */
5718message RoleHolder {
5719 // uid of the role holder
5720 optional int32 uid = 1 [(is_uid) = true];
5721
5722 // package name of the role holder
5723 optional string package_name = 2;
5724
5725 // the role held
5726 optional string role = 3;
5727}
5728
Yangsteraf9aee72018-10-12 09:26:16 -07005729message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005730 // These are all in byte resolution.
5731 optional int64 min = 1 [deprecated = true];
5732 optional int64 average = 2 [deprecated = true];
5733 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005734
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005735 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5736 // int64 fields.
5737 optional int32 mean_kb = 4;
5738 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005739}
5740
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005741// A reduced subset of process states; reducing the number of possible states allows more
5742// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5743enum ProcessStateAggregated {
5744 PROCESS_STATE_UNKNOWN = 0;
5745 // Persistent system process.
5746 PROCESS_STATE_PERSISTENT = 1;
5747 // Top activity; actually any visible activity.
5748 PROCESS_STATE_TOP = 2;
5749 // Process binding to top or a foreground service.
5750 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5751 // Processing running a foreground service.
5752 PROCESS_STATE_FGS = 4;
5753 // Important foreground process (ime, wallpaper, etc).
5754 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5755 // Important background process.
5756 PROCESS_STATE_BACKGROUND = 6;
5757 // Process running a receiver.
5758 PROCESS_STATE_RECEIVER = 7;
5759 // All kinds of cached processes.
5760 PROCESS_STATE_CACHED = 8;
5761}
5762
5763// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005764message ProcessStatsStateProto {
5765 optional android.service.procstats.ScreenState screen_state = 1;
5766
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005767 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005768
5769 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5770 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005771 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5772
5773 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005774
5775 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005776 optional int64 duration_millis = 4 [deprecated = true];
5777 // Same as above, but with minute resolution so it fits into an int32.
5778 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005779
5780 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005781 optional int64 realtime_duration_millis = 9 [deprecated = true];
5782 // Same as above, but with minute resolution so it fits into an int32.
5783 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005784
5785 // # of samples taken
5786 optional int32 sample_size = 5;
5787
5788 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005789 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005790
5791 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005792 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005793
5794 // RSS is memory resident for this process
5795 optional AggStats rss = 8;
5796}
5797
Jing Ji060d6862020-04-13 19:36:31 -07005798// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005799message ProcessStatsProto {
5800 // Name of process.
5801 optional string process = 1;
5802
5803 // Uid of the process.
5804 optional int32 uid = 2;
5805
5806 // Information about how often kills occurred
5807 message Kill {
5808 // Count of excessive CPU kills
5809 optional int32 cpu = 1;
5810
5811 // Count of kills when cached
5812 optional int32 cached = 2;
5813
5814 // PSS stats during cached kill
5815 optional AggStats cached_pss = 3;
5816 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005817 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005818
5819 // Time and memory spent in various states.
5820 repeated ProcessStatsStateProto states = 5;
5821
5822 // Total time process has been running... screen_state, memory_state, and process_state
5823 // will not be set.
5824 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005825
5826 // Association data for this process in this state;
5827 // each entry here is one association.
5828 repeated ProcessStatsAssociationProto assocs = 7;
5829}
5830
5831// Next Tag: 5
5832message ProcessStatsAssociationProto {
5833 // Procss Name of the associated process (client process of service binding)
5834 optional string assoc_process_name = 1;
5835
5836 // Package Name of the associated package (client package of service binding)
5837 optional string assoc_package_name = 2;
5838
5839 // Total count of the times this association (service binding) appeared.
5840 optional int32 total_count = 3;
5841
5842 // Uptime total duration in seconds this association (service binding) was around.
5843 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005844}
5845
5846message PackageServiceOperationStatsProto {
5847 // Operate enum: Started, Foreground, Bound, Executing
5848 optional android.service.procstats.ServiceOperationState operation = 1;
5849
5850 // Number of times the service was in this operation.
5851 optional int32 count = 2;
5852
5853 // Information about a state the service can be in.
5854 message StateStats {
5855 // Screen state enum.
5856 optional android.service.procstats.ScreenState screen_state = 1;
5857 // Memory state enum.
5858 optional android.service.procstats.MemoryState memory_state = 2;
5859
5860 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005861 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005862 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005863 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005864 }
5865 repeated StateStats state_stats = 3;
5866}
5867
5868message PackageServiceStatsProto {
5869 // Name of service component.
5870 optional string service_name = 1;
5871
5872 // The operation stats.
5873 // The package_name, package_uid, package_version, service_name will not be set to save space.
5874 repeated PackageServiceOperationStatsProto operation_stats = 2;
5875}
5876
5877message PackageAssociationSourceProcessStatsProto {
5878 // Uid of the process.
5879 optional int32 process_uid = 1;
5880 // Process name.
5881 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005882 // Package name.
5883 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005884 // Total count of the times this association appeared.
5885 optional int32 total_count = 3;
5886
5887 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005888 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005889
5890 // Total count of the times this association became actively impacting its target process.
5891 optional int32 active_count = 5;
5892
5893 // Information on one source in this association.
5894 message StateStats {
5895 // Process state enum.
5896 optional android.service.procstats.ProcessState process_state = 1;
5897 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005898 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005899 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005900 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005901 }
5902 repeated StateStats active_state_stats = 6;
5903}
5904
5905message PackageAssociationProcessStatsProto {
5906 // Name of the target component.
5907 optional string component_name = 1;
5908 // Information on one source in this association.
5909 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5910}
5911
5912
5913message ProcessStatsPackageProto {
5914 // Name of package.
5915 optional string package = 1;
5916
5917 // Uid of the package.
5918 optional int32 uid = 2;
5919
5920 // Version of the package.
5921 optional int64 version = 3;
5922
5923 // Stats for each process running with the package loaded in to it.
5924 repeated ProcessStatsProto process_stats = 4;
5925
5926 // Stats for each of the package's services.
5927 repeated PackageServiceStatsProto service_stats = 5;
5928
5929 // Stats for each association with the package.
5930 repeated PackageAssociationProcessStatsProto association_stats = 6;
5931}
5932
5933message ProcessStatsSectionProto {
5934 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005935 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005936
5937 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005938 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005939
5940 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005941 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005942
5943 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005944 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005945
5946 // System runtime library. e.g. "libdvm.so", "libart.so".
5947 optional string runtime = 5;
5948
5949 // whether kernel reports swapped pss.
5950 optional bool has_swapped_pss = 6;
5951
5952 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5953 enum Status {
5954 STATUS_UNKNOWN = 0;
5955 STATUS_COMPLETE = 1;
5956 STATUS_PARTIAL = 2;
5957 STATUS_SHUTDOWN = 3;
5958 STATUS_SYSPROPS = 4;
5959 }
5960 repeated Status status = 7;
5961
Chenjie Yub2ecc792019-01-17 10:27:26 -08005962 // Number of pages available of various types and sizes, representation fragmentation.
5963 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5964
Yangsteraf9aee72018-10-12 09:26:16 -07005965 // Stats for each process.
5966 repeated ProcessStatsProto process_stats = 8;
5967
5968 // Stats for each package.
5969 repeated ProcessStatsPackageProto package_stats = 9;
5970}
5971
Chenjie Yub2ecc792019-01-17 10:27:26 -08005972message ProcessStatsAvailablePagesProto {
5973 // Node these pages are in (as per /proc/pagetypeinfo)
5974 optional int32 node = 1;
5975
5976 // Zone these pages are in (as per /proc/pagetypeinfo)
5977 optional string zone = 2;
5978
5979 // Label for the type of these pages (as per /proc/pagetypeinfo)
5980 optional string label = 3;
5981
5982 // Distribution of number of pages available by order size. First entry in array is
5983 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5984 repeated int32 pages_per_order = 4;
5985}
5986
Chenjie Yu12e5e672018-09-14 15:54:59 -07005987/**
5988 * Pulled from ProcessStatsService.java
5989 */
5990message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005991 optional ProcessStatsSectionProto proc_stats_section = 1;
5992}
5993
Chenjie Yuf910b7802019-01-11 16:08:20 -08005994/**
5995 * Pulled from ProcessStatsService.java
5996 */
5997message ProcStatsPkgProc {
5998 optional ProcessStatsSectionProto proc_stats_section = 1;
5999}
6000
Chris Wrencdea3b72019-11-22 16:58:17 -05006001// Next Tag: 2
6002message PackageRemoteViewInfoProto {
6003 optional string package_name = 1;
6004 // add per-package additional info here (like channels)
6005}
6006
6007// Next Tag: 2
6008message NotificationRemoteViewsProto {
6009 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6010}
6011
6012/**
6013 * Pulled from NotificationManagerService.java
6014 */
6015message NotificationRemoteViews {
6016 optional NotificationRemoteViewsProto notification_remote_views = 1;
6017}
6018
Yotam Aron74299972020-01-16 16:20:58 +02006019/**
6020 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6021 */
6022message PackageNotificationPreferences {
6023 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006024 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006025 // Notification importance, which specifies when and how a notification is displayed.
6026 // Specified under core/java/android/app/NotificationManager.java.
6027 optional int32 importance = 2;
6028 // Lockscreen visibility as set by the user.
6029 optional int32 visibility = 3;
6030 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6031 // PreferencesHelper.java)
6032 optional int32 user_locked_fields = 4;
6033}
6034
6035/**
6036 * Atom that contains a list of a package's channel preferences, pulled from
6037 * NotificationManagerService.java.
6038 */
6039message PackageNotificationChannelPreferences {
6040 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006041 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006042 // Channel's ID. Should always be available.
6043 optional string channel_id = 2;
6044 // Channel's name. Should always be available.
6045 optional string channel_name = 3;
6046 // Channel's description. Optionally set by the channel creator.
6047 optional string description = 4;
6048 // Notification importance, which specifies when and how a notification is displayed. Specified
6049 // under core/java/android/app/NotificationManager.java.
6050 optional int32 importance = 5;
6051 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6052 // at core/java/android/app/NotificationChannel.java
6053 optional int32 user_locked_fields = 6;
6054 // Indicates if the channel was deleted by the app.
6055 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006056 // Indicates if the channel was marked as a conversation by the app.
6057 optional bool is_conversation = 8;
6058 // Indicates if the channel is a conversation that was demoted by the user.
6059 optional bool is_demoted_conversation = 9;
6060 // Indicates if the channel is a conversation that was marked as important by the user.
6061 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006062}
6063
6064/**
6065 * Atom that contains a list of a package's channel group preferences, pulled from
6066 * NotificationManagerService.java.
6067 */
6068message PackageNotificationChannelGroupPreferences {
6069 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006070 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006071 // Channel Group's ID. Should always be available.
6072 optional string group_id = 2;
6073 // Channel Group's name. Should always be available.
6074 optional string group_name = 3;
6075 // Channel Group's description. Optionally set by group creator.
6076 optional string description = 4;
6077 // Indicates if notifications from this channel group are blocked.
6078 optional bool is_blocked = 5;
6079 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6080 // at core/java/android/app/NotificationChannelGroup.java
6081 optional int32 user_locked_fields = 6;
6082}
6083
Yangsteraf9aee72018-10-12 09:26:16 -07006084message PowerProfileProto {
6085 optional double cpu_suspend = 1;
6086
6087 optional double cpu_idle = 2;
6088
6089 optional double cpu_active = 3;
6090
6091 message CpuCluster {
6092 optional int32 id = 1;
6093 optional double cluster_power = 2;
6094 optional int32 cores = 3;
6095 repeated int64 speed = 4;
6096 repeated double core_power = 5;
6097 }
6098
6099 repeated CpuCluster cpu_cluster = 40;
6100
6101 optional double wifi_scan = 4;
6102
6103 optional double wifi_on = 5;
6104
6105 optional double wifi_active = 6;
6106
6107 optional double wifi_controller_idle = 7;
6108
6109 optional double wifi_controller_rx = 8;
6110
6111 optional double wifi_controller_tx = 9;
6112
6113 repeated double wifi_controller_tx_levels = 10;
6114
6115 optional double wifi_controller_operating_voltage = 11;
6116
6117 optional double bluetooth_controller_idle = 12;
6118
6119 optional double bluetooth_controller_rx = 13;
6120
6121 optional double bluetooth_controller_tx = 14;
6122
6123 optional double bluetooth_controller_operating_voltage = 15;
6124
6125 optional double modem_controller_sleep = 16;
6126
6127 optional double modem_controller_idle = 17;
6128
6129 optional double modem_controller_rx = 18;
6130
6131 repeated double modem_controller_tx = 19;
6132
6133 optional double modem_controller_operating_voltage = 20;
6134
6135 optional double gps_on = 21;
6136
6137 repeated double gps_signal_quality_based = 22;
6138
6139 optional double gps_operating_voltage = 23;
6140
6141 optional double bluetooth_on = 24;
6142
6143 optional double bluetooth_active = 25;
6144
6145 optional double bluetooth_at_cmd = 26;
6146
6147 optional double ambient_display = 27;
6148
6149 optional double screen_on = 28;
6150
6151 optional double radio_on = 29;
6152
6153 optional double radio_scanning = 30;
6154
6155 optional double radio_active = 31;
6156
6157 optional double screen_full = 32;
6158
6159 optional double audio = 33;
6160
6161 optional double video = 34;
6162
6163 optional double flashlight = 35;
6164
6165 optional double memory = 36;
6166
6167 optional double camera = 37;
6168
6169 optional double wifi_batched_scan = 38;
6170
6171 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006172}
Chenjie Yuab530202018-09-26 12:39:20 -07006173
6174/**
6175 * power_profile.xml and other constants for power model calculations.
6176 * Pulled from PowerProfile.java
6177 */
6178message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006179 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006180}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006181
6182/**
arangelovd5db50e2018-10-12 20:24:39 +01006183 * Logs when a user restriction was added or removed.
6184 *
6185 * Logged from:
6186 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6187 */
6188message UserRestrictionChanged {
6189 // The raw string of the user restriction as defined in UserManager.
6190 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6191 optional string restriction = 1;
6192 // Whether the restriction is enabled or disabled.
6193 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006194}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006195
6196/**
6197 * Pulls process user time and system time. Puller takes a snapshot of all pids
6198 * in the system and returns cpu stats for those that are working at the time.
6199 * Dead pids will be dropped. Kernel processes are excluded.
6200 * Min cool-down is 5 sec.
6201 */
6202message ProcessCpuTime {
6203 optional int32 uid = 1 [(is_uid) = true];
6204
6205 optional string process_name = 2;
6206 // Process cpu time in user space, cumulative from boot/process start
6207 optional int64 user_time_millis = 3;
6208 // Process cpu time in system space, cumulative from boot/process start
6209 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006210}
Misha Wagner5a51e002018-10-03 15:04:09 +01006211
6212/**
6213 * Pulls the CPU usage for each thread.
6214 *
6215 * Read from /proc/$PID/task/$TID/time_in_state files.
6216 *
6217 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6218 * time_in_state files not being present on some phones, have not been addressed. These should be
6219 * considered before a public release.
6220 */
6221message CpuTimePerThreadFreq {
6222 // UID that owns the process.
6223 optional int32 uid = 1 [(is_uid) = true];
6224 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006225 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006226 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006227 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006228 // Name of the process taken from `/proc/$PID/cmdline`.
6229 optional string process_name = 4;
6230 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6231 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006232
6233 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6234 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6235 // frequencies are given here as the alternative is sending eight separate atoms. This method
6236 // significantly reduces the amount of data created
6237 optional int32 frequency1_khz = 6;
6238 optional int32 time1_millis = 7;
6239 optional int32 frequency2_khz = 8;
6240 optional int32 time2_millis = 9;
6241 optional int32 frequency3_khz = 10;
6242 optional int32 time3_millis = 11;
6243 optional int32 frequency4_khz = 12;
6244 optional int32 time4_millis = 13;
6245 optional int32 frequency5_khz = 14;
6246 optional int32 time5_millis = 15;
6247 optional int32 frequency6_khz = 16;
6248 optional int32 time6_millis = 17;
6249 optional int32 frequency7_khz = 18;
6250 optional int32 time7_millis = 19;
6251 optional int32 frequency8_khz = 20;
6252 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006253}
Bookatz75ee60422018-11-09 12:27:37 -08006254
6255/**
Bookatz366a4432018-11-20 09:42:33 -08006256 * Pulls information about the device's build.
6257 */
6258message BuildInformation {
6259 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6260 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6261 optional string fingerprint = 1;
6262
6263 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6264 optional string brand = 2;
6265
6266 // Build.PRODUCT. The name of the overall product.
6267 optional string product = 3;
6268
6269 // Build.DEVICE. The name of the industrial design.
6270 optional string device = 4;
6271
6272 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6273 optional string version_release = 5;
6274
6275 // Build.ID. E.g. a label like "M4-rc20".
6276 optional string id = 6;
6277
6278 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6279 // represent this build.
6280 optional string version_incremental = 7;
6281
6282 // Build.TYPE. The type of build, like "user" or "eng".
6283 optional string type = 8;
6284
6285 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6286 optional string tags = 9;
6287}
6288
6289/**
Adam He420947c2019-01-23 15:59:09 -08006290 * Logs information about mismatched caller for content capture.
6291 *
6292 * Logged from:
6293 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6294 */
6295message ContentCaptureCallerMismatchReported {
6296 optional string intended_package = 1;
6297 optional string calling_package = 2;
6298}
6299
6300/**
6301 * Logs information about content capture service events.
6302 *
6303 * Logged from:
6304 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6305 */
6306message ContentCaptureServiceEvents {
6307 // The type of event.
6308 enum Event {
6309 UNKNOWN = 0;
6310 ON_CONNECTED = 1;
6311 ON_DISCONNECTED = 2;
6312 SET_WHITELIST = 3;
6313 SET_DISABLED = 4;
6314 ON_USER_DATA_REMOVED = 5;
6315 }
6316 optional Event event = 1;
6317 // component/package of content capture service.
6318 optional string service_info = 2;
6319 // component/package of target.
6320 // it's a concatenated list of component/package for SET_WHITELIST event
6321 // separated by " ".
6322 optional string target_info = 3;
6323}
6324
6325/**
6326 * Logs information about content capture session events.
6327 *
6328 * Logged from:
6329 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6330 */
6331message ContentCaptureSessionEvents {
6332 // The type of event.
6333 enum Event {
6334 UNKNOWN = 0;
6335 ON_SESSION_STARTED = 1;
6336 ON_SESSION_FINISHED = 2;
6337 SESSION_NOT_CREATED = 3;
6338 }
6339 optional int32 session_id = 1;
6340 optional Event event = 2;
6341 // (n/a on session finished)
6342 optional int32 state_flags = 3;
6343 // component/package of content capture service.
6344 optional string service_info = 4;
6345 // component/package of app.
6346 // (n/a on session finished)
6347 optional string app_info = 5;
6348 optional bool is_child_session = 6;
6349}
6350
6351/**
6352 * Logs information about session being flushed.
6353 *
6354 * Logged from:
6355 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6356 */
6357message ContentCaptureFlushed {
6358 optional int32 session_id = 1;
6359 // component/package of content capture service.
6360 optional string service_info = 2;
6361 // component/package of app.
6362 optional string app_info = 3;
6363 // session start/finish events
6364 optional int32 child_session_started = 4;
6365 optional int32 child_session_finished = 5;
6366 // count of view events.
6367 optional int32 view_appeared_count = 6;
6368 optional int32 view_disappeared_count = 7;
6369 optional int32 view_text_changed_count = 8;
6370
6371 // Flush stats.
6372 optional int32 max_events = 9;
6373 optional int32 idle_flush_freq = 10;
6374 optional int32 text_flush_freq = 11;
6375 optional int32 flush_reason = 12;
6376}
6377
6378/**
Bookatz75ee60422018-11-09 12:27:37 -08006379 * Pulls on-device BatteryStats power use calculations for the overall device.
6380 */
6381message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006382 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6383 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6384 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6385 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006386}
6387
6388/**
6389 * Pulls on-device BatteryStats power use calculations broken down by uid.
6390 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6391 * that is attributed to non-uid items. They must all be included to get the total power use.
6392 */
6393message DeviceCalculatedPowerBlameUid {
6394 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6395 optional int32 uid = 1 [(is_uid) = true];
6396
Bookatz3dbc13a2018-12-21 12:16:51 -08006397 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6398 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6399 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006400}
6401
6402/**
6403 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6404 * drain type.
6405 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6406 * is attributed uids. They must all be included to get the total power use.
6407 */
6408message DeviceCalculatedPowerBlameOther {
6409 // The type of item whose power use is being reported.
6410 enum DrainType {
6411 AMBIENT_DISPLAY = 0;
6412 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6413 BLUETOOTH = 2;
6414 CAMERA = 3;
6415 // Cell-standby
6416 CELL = 4;
6417 FLASHLIGHT = 5;
6418 IDLE = 6;
6419 MEMORY = 7;
6420 // Amount that total computed drain exceeded the drain estimated using the
6421 // battery level changes and capacity.
6422 OVERCOUNTED = 8;
6423 PHONE = 9;
6424 SCREEN = 10;
6425 // Amount that total computed drain was below the drain estimated using the
6426 // battery level changes and capacity.
6427 UNACCOUNTED = 11;
6428 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6429 WIFI = 13;
6430 }
6431 optional DrainType drain_type = 1;
6432
Bookatz3dbc13a2018-12-21 12:16:51 -08006433 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6434 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6435 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006436}
arangelov4e994062018-11-13 16:12:38 +00006437
6438/**
6439 * Logs device policy features.
6440 *
6441 * Logged from:
6442 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6443 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6444 */
6445message DevicePolicyEvent {
6446 // The event id - unique for each event.
6447 optional android.stats.devicepolicy.EventId event_id = 1;
6448 // The admin package name.
6449 optional string admin_package_name = 2;
6450 // A generic integer parameter.
6451 optional int32 integer_value = 3;
6452 // A generic boolean parameter.
6453 optional bool boolean_value = 4;
6454 // A parameter specifying a time period in milliseconds.
6455 optional uint64 time_period_millis = 5;
6456 // A parameter specifying a list of package names, bundle extras or string parameters.
6457 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6458}
shawnlinea5b66b2018-11-13 15:05:29 +08006459
6460/**
6461 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6462 *
6463 * Logged from:
6464 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6465 */
6466message DocsUILaunchReported {
6467 optional android.stats.docsui.LaunchAction launch_action = 1;
6468 optional bool has_initial_uri = 2;
6469 optional android.stats.docsui.MimeType mime_type = 3;
6470 optional android.stats.docsui.Root initial_root = 4;
6471}
6472
6473/**
6474 * Logs root/app visited event in file managers/picker. Call this when the user
6475 * taps on root/app in hamburger menu.
6476 *
6477 * Logged from:
6478 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6479 */
6480message DocsUIRootVisitedReported {
6481 optional android.stats.docsui.ContextScope scope = 1;
6482 optional android.stats.docsui.Root root = 2;
6483}
6484
6485/**
6486 * Logs file operation stats. Call this when a file operation has completed.
6487 *
6488 * Logged from:
6489 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6490 */
6491message DocsUIFileOperationReported {
6492 optional android.stats.docsui.Provider provider = 1;
6493 optional android.stats.docsui.FileOperation file_op = 2;
6494}
6495
6496/**
6497 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6498 * mode.
6499 *
6500 * Logged from:
6501 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6502 */
6503message DocsUIFileOperationCopyMoveModeReported {
6504 optional android.stats.docsui.FileOperation file_op = 1;
6505 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6506}
6507
6508
6509/**
6510 * Logs file sub operation stats. Call this when a file operation has failed.
6511 *
6512 * Logged from:
6513 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6514 */
6515message DocsUIFileOperationFailureReported {
6516 optional android.stats.docsui.Authority authority = 1;
6517 optional android.stats.docsui.SubFileOperation sub_op = 2;
6518}
6519
6520/**
6521* Logs the cancellation of a file operation. Call this when a job is canceled
6522*
6523* Logged from:
6524* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6525*/
6526message DocsUIFileOperationCanceledReported {
6527 optional android.stats.docsui.FileOperation file_op = 1;
6528}
6529
6530/**
6531 * Logs startup time in milliseconds.
6532 *
6533 * Logged from:
6534 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6535 */
6536message DocsUIStartupMsReported {
6537 optional int32 startup_millis = 1;
6538}
6539
6540/**
6541 * Logs the action that was started by user.
6542 *
6543 * Logged from:
6544 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6545 */
6546message DocsUIUserActionReported {
6547 optional android.stats.docsui.UserAction action = 1;
6548}
6549
6550/**
6551 * Logs the invalid type when invalid scoped access is requested.
6552 *
6553 * Logged from:
6554 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6555 */
6556message DocsUIInvalidScopedAccessRequestReported {
6557 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006558}
Ben Murdochbab399f62018-12-06 11:01:38 +00006559
6560/**
shawnlina75e82d2019-01-07 10:31:12 +08006561 * Logs the package name that launches docsui picker mode.
6562 *
6563 * Logged from:
6564 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6565 */
6566message DocsUIPickerLaunchedFromReported {
6567 optional string package_name = 1;
6568}
6569
6570/**
6571 * Logs the search type.
6572 *
6573 * Logged from:
6574 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6575 */
6576message DocsUISearchTypeReported {
6577 optional android.stats.docsui.SearchType search_type = 1;
6578}
6579
6580/**
6581 * Logs the search mode.
6582 *
6583 * Logged from:
6584 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6585 */
6586message DocsUISearchModeReported {
6587 optional android.stats.docsui.SearchMode search_mode = 1;
6588}
6589
6590/**
6591 * Logs the pick result information.
6592 *
6593 * Logged from:
6594 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6595 */
6596message DocsUIPickResultReported {
6597 optional int32 total_action_count = 1;
6598 optional int64 duration_millis = 2;
6599 optional int32 file_count= 3;
6600 optional bool is_searching = 4;
6601 optional android.stats.docsui.Root picked_from = 5;
6602 optional android.stats.docsui.MimeType mime_type = 6;
6603 optional int32 repeatedly_pick_times = 7;
6604}
6605
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006606/** Logs the drag and drop of files.
6607
6608 * Logged from:
6609 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6610 */
6611message DocsUIDragAndDropReported {
6612 optional bool drag_initiated_from_docsui = 1;
6613}
6614
shawnlina75e82d2019-01-07 10:31:12 +08006615/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006616 * Logs when an app's memory is compacted.
6617 *
6618 * Logged from:
6619 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6620 */
6621message AppCompacted {
6622 // The pid of the process being compacted.
6623 optional int32 pid = 1;
6624
6625 // The name of the process being compacted.
6626 optional string process_name = 2;
6627
6628 // The type of compaction.
6629 enum Action {
6630 UNKNOWN = 0;
6631 SOME = 1;
6632 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006633 PERSISTENT = 3;
6634 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006635 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006636 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006637
6638 // Total RSS in kilobytes consumed by the process prior to compaction.
6639 optional int64 before_rss_total_kilobytes = 4;
6640
6641 // File RSS in kilobytes consumed by the process prior to compaction.
6642 optional int64 before_rss_file_kilobytes = 5;
6643
6644 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6645 optional int64 before_rss_anon_kilobytes = 6;
6646
6647 // Swap in kilobytes consumed by the process prior to compaction.
6648 optional int64 before_swap_kilobytes = 7;
6649
6650 // Total RSS in kilobytes consumed by the process after compaction.
6651 optional int64 after_rss_total_kilobytes = 8;
6652
6653 // File RSS in kilobytes consumed by the process after compaction.
6654 optional int64 after_rss_file_kilobytes = 9;
6655
6656 // Anonymous RSS in kilobytes consumed by the process after compaction.
6657 optional int64 after_rss_anon_kilobytes = 10;
6658
6659 // Swap in kilobytes consumed by the process after compaction.
6660 optional int64 after_swap_kilobytes = 11;
6661
6662 // The time taken to perform compaction in milliseconds.
6663 optional int64 time_to_compact_millis = 12;
6664
6665 // The last compaction action performed for this app.
6666 optional Action last_action = 13;
6667
Ben Murdoch01720b82018-12-19 18:03:44 +00006668 // The last time that compaction was attempted on this process in milliseconds
6669 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6670 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006671
Ben Murdoch885c21b2019-03-15 18:02:04 +00006672 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006673 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006674
6675 // The process state at the time of compaction.
6676 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006677
6678 // Free ZRAM in kilobytes before compaction.
6679 optional int64 before_zram_free_kilobytes = 17;
6680
6681 // Free ZRAM in kilobytes after compaction.
6682 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006683}
lifr157fc552018-12-12 16:38:04 +08006684
6685/**
lifrb6b90b62019-03-29 00:40:17 +08006686 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6687 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6688 *
lifr1f74b052019-04-16 22:16:30 +08006689 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6690 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6691 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6692 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006693 */
6694message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006695 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006696
lifr1f74b052019-04-16 22:16:30 +08006697 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006698
6699 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006700 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006701
lifr1f74b052019-04-16 22:16:30 +08006702 // Only valid for event_type = EVENT_GETADDRINFO.
6703 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006704
lifr1f74b052019-04-16 22:16:30 +08006705 // Flags passed to android_res_nsend() defined in multinetwork.h
6706 // Only valid for event_type = EVENT_RESNSEND.
6707 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006708
lifrad9becc2019-05-20 11:04:41 +08006709 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006710
6711 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006712 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006713
6714 // Additional pass-through fields opaque to statsd.
6715 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006716 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006717
6718 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6719 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006720}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006721
6722/**
6723 * Logs when a data stall event occurs.
6724 *
6725 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006726 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006727 */
6728message DataStallEvent {
6729 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006730 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006731 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6732 optional int32 evaluation_type = 1;
6733 // See definition in data_stall_event.proto.
6734 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6735 // See definition in data_stall_event.proto.
6736 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6737 // See definition in data_stall_event.proto.
6738 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6739 // See definition in data_stall_event.proto.
6740 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6741 // See definition in data_stall_event.proto.
6742 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006743 // The tcp packets fail rate from the latest tcp polling.
6744 optional int32 tcp_fail_rate = 7;
6745 // Number of packets sent since the last received packet.
6746 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006747}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006748
6749/*
6750 * Logs when RescueParty resets some set of experiment flags.
6751 *
6752 * Logged from:
6753 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6754 */
6755message RescuePartyResetReported {
6756 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6757 optional int32 rescue_level = 1;
6758}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006759
6760/**
6761 * Logs when signed config is received from an APK, and if that config was applied successfully.
6762 * Logged from:
6763 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6764 */
6765message SignedConfigReported {
6766 enum Type {
6767 UNKNOWN_TYPE = 0;
6768 GLOBAL_SETTINGS = 1;
6769 }
6770 optional Type type = 1;
6771
6772 // The final status of the signed config received.
6773 enum Status {
6774 UNKNOWN_STATUS = 0;
6775 APPLIED = 1;
6776 BASE64_FAILURE_CONFIG = 2;
6777 BASE64_FAILURE_SIGNATURE = 3;
6778 SECURITY_EXCEPTION = 4;
6779 INVALID_CONFIG = 5;
6780 OLD_CONFIG = 6;
6781 SIGNATURE_CHECK_FAILED = 7;
6782 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006783 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006784 }
6785 optional Status status = 2;
6786
6787 // The version of the signed config processed.
6788 optional int32 version = 3;
6789
6790 // The package name that the config was extracted from.
6791 optional string from_package = 4;
6792
6793 enum Key {
6794 NO_KEY = 0;
6795 DEBUG = 1;
6796 PRODUCTION = 2;
6797 }
6798 // Which key was used to verify the config.
6799 optional Key verified_with = 5;
6800}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006801
6802/*
6803 * Logs GNSS Network-Initiated (NI) location events.
6804 *
6805 * Logged from:
6806 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6807 */
6808message GnssNiEventReported {
6809 // The type of GnssNiEvent.
6810 enum EventType {
6811 UNKNOWN = 0;
6812 NI_REQUEST = 1;
6813 NI_RESPONSE = 2;
6814 }
6815 optional EventType event_type = 1;
6816
6817 // An ID generated by HAL to associate NI notifications and UI responses.
6818 optional int32 notification_id = 2;
6819
6820 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006821 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006822
6823 // NI requires notification.
6824 optional bool need_notify = 4;
6825
6826 // NI requires verification.
6827 optional bool need_verify = 5;
6828
6829 // NI requires privacy override, no notification/minimal trace.
6830 optional bool privacy_override = 6;
6831
6832 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6833 // seconds.
6834 optional int32 timeout = 7;
6835
6836 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006837 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006838
6839 // String representing the requester of the network inititated location request.
6840 optional string requestor_id = 9;
6841
6842 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6843 // network initiated location request.
6844 optional string text = 10;
6845
6846 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006847 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006848
6849 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006850 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006851
6852 // True if SUPL ES is enabled.
6853 optional bool is_supl_es_enabled = 13;
6854
6855 // True if GNSS location is enabled.
6856 optional bool is_location_enabled = 14;
6857
6858 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006859 optional android.server.location.GnssUserResponseType user_response = 15;
6860}
6861
6862/**
6863 * Logs GNSS non-framework (NFW) location notification.
6864 *
6865 * Logged from:
6866 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6867 */
6868message GnssNfwNotificationReported {
6869 // Package name of the Android proxy application representing the non-framework entity that
6870 // requested location. Set to empty string if unknown.
6871 optional string proxy_app_package_name = 1;
6872
6873 // Protocol stack that initiated the non-framework location request.
6874 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6875
6876 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6877 // set to empty string. This field is opaque to the framework and used for logging purposes.
6878 optional string other_protocol_stack_name = 3;
6879
6880 // Source initiating/receiving the location information.
6881 optional android.server.location.NfwRequestor requestor = 4;
6882
6883 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6884 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6885 // and used for logging purposes.
6886 optional string requestor_id = 5;
6887
6888 // Indicates whether location information was provided for this request.
6889 optional android.server.location.NfwResponseType response_type = 6;
6890
6891 // True if the device is in user initiated emergency session.
6892 optional bool in_emergency_mode = 7;
6893
6894 // True if cached location is provided.
6895 optional bool is_cached_location = 8;
6896
6897 // True if proxy app permission mismatch between framework and GNSS HAL.
6898 optional bool is_permission_mismatched = 9;
6899}
6900
6901/**
6902 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6903 *
6904 * Logged from:
6905 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6906 */
6907message GnssConfigurationReported {
6908 // SUPL host name.
6909 optional string supl_host = 1;
6910
6911 // SUPL port number.
6912 optional int32 supl_port = 2;
6913
6914 // C2K host name.
6915 optional string c2k_host = 3;
6916
6917 // C2K port number.
6918 optional int32 c2k_port = 4;
6919
6920 // The SUPL version requested by Carrier.
6921 optional int32 supl_ver = 5;
6922
6923 // The SUPL mode.
6924 optional android.server.location.SuplMode supl_mode = 6;
6925
6926 // True if NI emergency SUPL restrictions is enabled.
6927 optional bool supl_es = 7;
6928
6929 // LTE Positioning Profile settings
6930 optional android.server.location.LppProfile lpp_profile = 8;
6931
6932 // Positioning protocol on A-Glonass system.
6933 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6934
6935 // True if emergency PDN is used. Otherwise, regular PDN is used.
6936 optional bool use_emergency_pdn_for_emergency_supl= 10;
6937
6938 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6939 optional android.server.location.GpsLock gps_lock = 11;
6940
6941 // Number of seconds to extend the emergency session duration post emergency call.
6942 optional int32 es_extension_sec = 12;
6943
6944 // The full list of package names of proxy Android applications representing the non-framework
6945 // location access entities (on/off the device) for which the framework user has granted
6946 // non-framework location access permission. The package names are concatenated in one string
6947 // with spaces as separators.
6948 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006949}
Jack Yu95b64f32018-12-13 18:26:11 +08006950
6951/**
6952 * Logs when a NFC device's error occurred.
6953 * Logged from:
6954 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6955 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6956 */
6957message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006958 enum Type {
6959 UNKNOWN = 0;
6960 CMD_TIMEOUT = 1;
6961 ERROR_NOTIFICATION = 2;
6962 AID_OVERFLOW = 3;
6963 }
6964 optional Type type = 1;
6965 // If it's nci cmd timeout, log the timeout command.
6966 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006967
Alex Salod7c3eef2019-01-25 14:43:27 -08006968 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006969}
6970
6971/**
6972 * Logs when a NFC device's state changed event
6973 * Logged from:
6974 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6975 */
6976message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006977 enum State {
6978 UNKNOWN = 0;
6979 OFF = 1;
6980 ON = 2;
6981 ON_LOCKED = 3; // Secure Nfc enabled.
6982 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6983 }
6984 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006985}
6986
6987/**
6988 * Logs when a NFC Beam Transaction occurred.
6989 * Logged from:
6990 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6991 */
6992message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006993 enum Operation {
6994 UNKNOWN = 0;
6995 SEND = 1;
6996 RECEIVE = 2;
6997 }
6998 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006999}
7000
7001/**
7002 * Logs when a NFC Card Emulation Transaction occurred.
7003 * Logged from:
7004 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7005 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7006 */
7007message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007008 enum Category {
7009 UNKNOWN = 0;
7010 HCE_PAYMENT = 1;
7011 HCE_OTHER = 2;
7012 OFFHOST = 3;
7013 }
7014 // Transaction belongs to HCE payment or HCE other category, or offhost.
7015 optional Category category = 1;
7016 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7017 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007018}
7019
7020/**
7021 * Logs when a NFC Tag event occurred.
7022 * Logged from:
7023 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7024 */
7025message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007026 enum Type {
7027 UNKNOWN = 0;
7028 URL = 1;
7029 BT_PAIRING = 2;
7030 PROVISION = 3;
7031 WIFI_CONNECT = 4;
7032 APP_LAUNCH = 5;
7033 OTHERS = 6;
7034 }
7035 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007036}
7037
7038/**
7039 * Logs when Hce transaction triggered
7040 * Logged from:
7041 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7042 */
7043message NfcHceTransactionOccurred {
7044 // The latency period(in microseconds) it took for the first HCE data
7045 // exchange.
7046 optional uint32 latency_micros = 1;
7047}
7048
7049/**
7050 * Logs when SecureElement state event changed
7051 * Logged from:
7052 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7053 */
7054message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007055 enum State {
7056 UNKNOWN = 0;
7057 INITIALIZED = 1;
7058 DISCONNECTED = 2;
7059 CONNECTED = 3;
7060 HALCRASH = 4;
7061 }
7062 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007063
Alex Salod7c3eef2019-01-25 14:43:27 -08007064 optional string state_change_reason = 2;
7065 // SIMx or eSEx.
7066 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007067}
7068
7069/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007070 * Information about a permission grant request
7071 */
7072message PermissionGrantRequestResultReported {
7073 // unique value identifying an API call. A API call might result in multiple of these atoms
7074 optional int64 request_id = 1;
7075
7076 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007077 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007078
7079 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007080 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007081
7082 // The permission to be granted
7083 optional string permission_name = 4;
7084
7085 // If the permission was explicitly requested via the API or added by the system
7086 optional bool is_implicit = 5;
7087
7088 enum Result {
7089 UNDEFINED = 0;
7090 // permission request was ignored
7091 IGNORED = 1;
7092 // permission request was ignored because it was user fixed
7093 IGNORED_USER_FIXED = 2;
7094 // permission request was ignored because it was policy fixed
7095 IGNORED_POLICY_FIXED = 3;
7096 // permission was granted by user action
7097 USER_GRANTED = 4;
7098 // permission was automatically granted
7099 AUTO_GRANTED = 5;
7100 // permission was denied by user action
7101 USER_DENIED = 6;
7102 // permission was denied with prejudice by the user
7103 USER_DENIED_WITH_PREJUDICE = 7;
7104 // permission was automatically denied
7105 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007106 // permission request was ignored because permission is restricted
7107 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007108 // one time permission was granted by user action
7109 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007110 // user ignored request by leaving the request screen without choosing any option
7111 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007112 // user granted the permission after being linked to settings
7113 USER_GRANTED_IN_SETTINGS = 12;
7114 // user denied the permission after being linked to settings
7115 USER_DENIED_IN_SETTINGS = 13;
7116 // user denied the permission with prejudice after being linked to settings
7117 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7118 // permission was automatically revoked after one-time permission expired
7119 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007120 // permission was automatically revoked for unused app
7121 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007122 }
7123 // The result of the permission grant
7124 optional Result result = 6;
7125}
7126
7127/**
Jack Yu95b64f32018-12-13 18:26:11 +08007128 * Logs when Omapi API used
7129 * Logged from:
7130 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7131 */
7132message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007133 enum Operation {
7134 UNKNOWN = 0;
7135 OPEN_CHANNEL = 1;
7136 }
7137 optional Operation operation = 1;
7138 // SIMx or eSEx.
7139 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007140
Alex Salod7c3eef2019-01-25 14:43:27 -08007141 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007142}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007143
7144/**
Alex Saloa060aee2019-01-21 14:36:41 -08007145 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7146 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007147 * Logged from:
7148 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7149 */
7150message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007151 optional int64 dispatch_latency_millis = 1;
7152}
7153
7154/**
7155 * Logs AttentionManagerService attention check result.
7156 *
7157 * Logged from:
7158 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7159 */
7160message AttentionManagerServiceResultReported {
7161 // See core/java/android/service/attention/AttentionService.java
7162 enum AttentionCheckResult {
7163 UNKNOWN = 20;
7164 ATTENTION_SUCCESS_ABSENT = 0;
7165 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007166 ATTENTION_FAILURE_UNKNOWN = 2;
7167 ATTENTION_FAILURE_CANCELLED = 3;
7168 ATTENTION_FAILURE_PREEMPTED = 4;
7169 ATTENTION_FAILURE_TIMED_OUT = 5;
7170 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007171 }
7172 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007173}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007174
7175/**
7176 * Logs when an adb connection changes state.
7177 *
7178 * Logged from:
7179 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7180 */
7181message AdbConnectionChanged {
7182 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7183 // previously selected for this system.
7184 optional int64 last_connection_time_millis = 1;
7185
7186 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7187 // to reconnect via adb without user interaction.
7188 optional int64 auth_window_millis = 2;
7189
7190 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7191 optional android.debug.AdbConnectionStateEnum state = 3;
7192
7193 // True if the 'always allow' option was selected for this system.
7194 optional bool always_allow = 4;
7195}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007196
7197/*
7198 * Logs the reported speech DSP status.
7199 *
7200 * Logged from:
7201 * Vendor audio implementation.
7202 */
7203message SpeechDspStatReported {
7204 // The total Speech DSP uptime in milliseconds.
7205 optional int32 total_uptime_millis = 1;
7206 // The total Speech DSP downtime in milliseconds.
7207 optional int32 total_downtime_millis = 2;
7208 optional int32 total_crash_count = 3;
7209 optional int32 total_recover_count = 4;
7210}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007211
7212/**
7213 * Logs USB connector contaminant status.
7214 *
7215 * Logged from: USB Service.
7216 */
7217message UsbContaminantReported {
7218 optional string id = 1;
7219 optional android.service.usb.ContaminantPresenceStatus status = 2;
7220}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007221
7222/**
7223 * This atom is for debugging purpose.
7224 */
7225message DebugElapsedClock {
7226 // Monotically increasing value for each pull.
7227 optional int64 pull_count = 1;
7228 // Time from System.elapsedRealtime.
7229 optional int64 elapsed_clock_millis = 2;
7230 // Time from System.elapsedRealtime.
7231 optional int64 same_elapsed_clock_millis = 3;
7232 // Diff between current elapsed time and elapsed time from previous pull.
7233 optional int64 elapsed_clock_diff_millis = 4;
7234
7235 enum Type {
7236 TYPE_UNKNOWN = 0;
7237 ALWAYS_PRESENT = 1;
7238 PRESENT_ON_ODD_PULLS = 2;
7239 }
7240 // Type of behavior for the pulled data.
7241 optional Type type = 5;
7242}
7243
7244/**
7245 * This atom is for debugging purpose.
7246 */
7247message DebugFailingElapsedClock {
7248 // Monotically increasing value for each pull.
7249 optional int64 pull_count = 1;
7250 // Time from System.elapsedRealtime.
7251 optional int64 elapsed_clock_millis = 2;
7252 // Time from System.elapsedRealtime.
7253 optional int64 same_elapsed_clock_millis = 3;
7254 // Diff between current elapsed time and elapsed time from previous pull.
7255 optional int64 elapsed_clock_diff_millis = 4;
7256}
Steven Wuacef6bb2019-01-23 14:21:17 -05007257
7258/** Logs System UI bubbles event changed.
7259 *
7260 * Logged from:
7261 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7262 */
7263message BubbleUIChanged {
7264
7265 // The app package that is posting the bubble.
7266 optional string package_name = 1;
7267
7268 // The notification channel that is posting the bubble.
7269 optional string notification_channel = 2;
7270
7271 // The notification id associated with the posted bubble.
7272 optional int32 notification_id = 3;
7273
7274 // The position of the bubble within the bubble stack.
7275 optional int32 position = 4;
7276
7277 // The total number of bubbles within the bubble stack.
7278 optional int32 total_number = 5;
7279
7280 // User interactions with the bubble.
7281 enum Action {
7282 UNKNOWN = 0;
7283 POSTED = 1;
7284 UPDATED = 2;
7285 EXPANDED = 3;
7286 COLLAPSED = 4;
7287 DISMISSED = 5;
7288 STACK_DISMISSED = 6;
7289 STACK_MOVED = 7;
7290 HEADER_GO_TO_APP = 8;
7291 HEADER_GO_TO_SETTINGS = 9;
7292 PERMISSION_OPT_IN = 10;
7293 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007294 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007295 SWIPE_LEFT = 13;
7296 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007297 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007298 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007299 }
7300 optional Action action = 6;
7301
7302 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7303 optional float normalized_x_position = 7;
7304 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007305
7306 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7307 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007308
7309 // Whether the bubble is an on-going one.
7310 optional bool is_ongoing = 10;
7311
7312 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007313 // This is deprecated and the value should be ignored.
7314 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007315}
Kweku Adams8845d012018-12-11 20:06:45 -08007316
7317/**
Steven Wu552f63f2019-02-05 13:41:36 -05007318 * Logs System UI bubbles developer errors.
7319 *
7320 * Logged from:
7321 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7322 */
7323message BubbleDeveloperErrorReported {
7324
7325 // The app package that is posting the bubble.
7326 optional string package_name = 1;
7327
7328 // Bubble developer error type enums.
7329 enum Error {
7330 UNKNOWN = 0;
7331 ACTIVITY_INFO_MISSING = 1;
7332 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7333 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7334 }
7335 optional Error error = 2 [default = UNKNOWN];
7336}
7337
7338/**
Kweku Adams8845d012018-12-11 20:06:45 -08007339 * Logs that a constraint for a scheduled job has changed.
7340 *
7341 * Logged from:
7342 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7343 */
7344message ScheduledJobConstraintChanged {
7345 repeated AttributionNode attribution_node = 1;
7346
7347 // Name of the job.
7348 optional string job_name = 2;
7349
7350 optional com.android.server.job.ConstraintEnum constraint = 3;
7351
7352 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007353 UNKNOWN = 0;
7354 UNSATISFIED = 1;
7355 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007356 }
7357 optional State state = 4;
7358}
Alex Salod7c3eef2019-01-25 14:43:27 -08007359
7360/**
7361 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7362 * returns true.
7363 *
7364 * Logged from:
7365 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7366 */
7367message ScreenTimeoutExtensionReported {
7368 // Describes how many times in a row did the power manager reset the screen off timeout.
7369 optional uint32 consecutive_timeout_extended_count = 1;
7370}
Hui Yu885aca12019-01-10 17:11:34 -08007371
7372/*
7373* Logs number of milliseconds it takes to start a process.
7374* The definition of app process start time is from the app launch time to
7375* the time that Zygote finished forking the app process and loaded the
7376* application package's java classes.
7377
7378* This metric is different from AppStartOccurred which is for foreground
7379* activity only.
7380
7381* ProcessStartTime can report all processes (both foreground and background)
7382* start time.
7383*
7384* Logged from:
7385* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7386*/
7387message ProcessStartTime {
7388 // The uid of the ProcessRecord.
7389 optional int32 uid = 1 [(is_uid) = true];
7390
7391 // The process pid.
7392 optional int32 pid = 2;
7393
7394 // The process name.
7395 // Usually package name, "system" for system server.
7396 // Provided by ActivityManagerService.
7397 optional string process_name = 3;
7398
7399 enum StartType {
7400 UNKNOWN = 0;
7401 WARM = 1;
7402 HOT = 2;
7403 COLD = 3;
7404 }
7405
7406 // The start type.
7407 optional StartType type = 4;
7408
7409 // The elapsed realtime at the start of the process.
7410 optional int64 process_start_time_millis = 5;
7411
7412 // Number of milliseconds it takes to reach bind application.
7413 optional int32 bind_application_delay_millis = 6;
7414
7415 // Number of milliseconds it takes to finish start of the process.
7416 optional int32 process_start_delay_millis = 7;
7417
7418 // hostingType field in ProcessRecord, the component type such as "activity",
7419 // "service", "content provider", "broadcast" or other strings.
7420 optional string hosting_type = 8;
7421
7422 // hostingNameStr field in ProcessRecord. The component class name that runs
7423 // in this process.
7424 optional string hosting_name = 9;
7425}
7426
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007427/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007428 * Track Media Codec usage
7429 * Logged from:
7430 * frameworks/av/media/libstagefright/MediaCodec.cpp
7431 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7432 */
7433message MediametricsCodecReported {
7434 optional int64 timestamp_nanos = 1;
7435 optional string package_name = 2;
7436 optional int64 package_version_code = 3;
7437 optional int64 media_apex_version = 4;
7438
7439 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7440}
7441
7442/**
7443 * Track Media Extractor (pulling video/audio streams out of containers) usage
7444 * Logged from:
7445 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7446 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7447 */
7448message MediametricsExtractorReported {
7449 optional int64 timestamp_nanos = 1;
7450 optional string package_name = 2;
7451 optional int64 package_version_code = 3;
7452 optional int64 media_apex_version = 4;
7453
7454 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7455}
7456
7457/**
7458 * Track how we arbitrate between microphone/input requests.
7459 * Logged from
7460 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7461 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7462 */
7463message MediametricsAudiopolicyReported {
7464 optional int64 timestamp_nanos = 1;
7465 optional string package_name = 2;
7466 optional int64 package_version_code = 3;
7467 optional int64 media_apex_version = 4;
7468
7469 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7470}
7471
7472/**
7473 * Track how we arbitrate between microphone requests.
7474 * Logged from
7475 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7476 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7477 */
7478message MediametricsAudiorecordReported {
7479 optional int64 timestamp_nanos = 1;
7480 optional string package_name = 2;
7481 optional int64 package_version_code = 3;
7482 optional int64 media_apex_version = 4;
7483
7484 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7485}
7486
7487/**
7488 * Track how we arbitrate between microphone/input requests.
7489 * Logged from
7490 * frameworks/av/media/libnblog/ReportPerformance.cpp
7491 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7492 */
7493message MediametricsAudiothreadReported {
7494 optional int64 timestamp_nanos = 1;
7495 optional string package_name = 2;
7496 optional int64 package_version_code = 3;
7497 optional int64 media_apex_version = 4;
7498
7499 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7500}
7501
7502/**
7503 * Track how we arbitrate between microphone/input requests.
7504 * Logged from
7505 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7506 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7507 */
7508message MediametricsAudiotrackReported {
7509 optional int64 timestamp_nanos = 1;
7510 optional string package_name = 2;
7511 optional int64 package_version_code = 3;
7512 optional int64 media_apex_version = 4;
7513
7514 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7515}
7516
7517/**
7518 * Track information about DRM framework performance
7519 * Logged from
7520 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7521 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7522 */
7523message MediametricsMediadrmReported {
7524 optional int64 timestamp_nanos = 1;
7525 optional string package_name = 2;
7526 optional int64 package_version_code = 3;
7527 optional int64 media_apex_version = 4;
7528
7529 // vendor+description tell about which DRM plugin is in use on this device
7530 optional string vendor = 5;
7531 optional string description = 6;
7532 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7533 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7534}
7535
7536/**
7537 * Track information about the widevine DRM plugin performance
7538 * Logged from
7539 * vendor/widevine/libwvdrmengine/cdm/metrics
7540 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7541 */
7542message MediametricsDrmWidevineReported {
7543 optional int64 timestamp_nanos = 1;
7544 optional string package_name = 2;
7545 optional int64 package_version_code = 3;
7546 optional int64 media_apex_version = 4;
7547
7548 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7549}
7550
7551/**
7552 * Track information about recordings (e.g. camcorder)
7553 * Logged from
7554 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7555 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7556 */
7557message MediametricsRecorderReported {
7558 optional int64 timestamp_nanos = 1;
7559 optional string package_name = 2;
7560 optional int64 package_version_code = 3;
7561 optional int64 media_apex_version = 4;
7562
7563 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7564}
7565
7566/**
7567 * Track Media Player usage
7568 * Logged from:
7569 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7570 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7571 */
7572message MediametricsNuPlayerReported {
7573 optional int64 timestamp_nanos = 1;
7574 optional string package_name = 2;
7575 optional int64 package_version_code = 3;
7576 optional int64 media_apex_version = 4;
7577
7578 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7579}
7580
7581/**
Robert Shiha4beed32019-08-19 14:15:23 -07007582 * Track Legacy DRM usage
7583 * Logged from
7584 * frameworks/av/drm/drmserver/DrmManager.cpp
7585 */
7586message MediametricsDrmManagerReported {
7587 optional int64 timestamp_nanos = 1;
7588 optional string package_name = 2;
7589 optional int64 package_version_code = 3;
7590 optional int64 media_apex_version = 4;
7591
7592 enum Method {
7593 METHOD_NOT_FOUND = -1;
7594 GET_CONSTRAINTS = 0;
7595 GET_METADATA = 1;
7596 CAN_HANDLE = 2;
7597 PROCESS_DRM_INFO = 3;
7598 ACQUIRE_DRM_INFO = 4;
7599 SAVE_RIGHTS = 5;
7600 GET_ORIGINAL_MIME_TYPE = 6;
7601 GET_DRM_OBJECT_TYPE = 7;
7602 CHECK_RIGHTS_STATUS = 8;
7603 REMOVE_RIGHTS = 9;
7604 REMOVE_ALL_RIGHTS = 10;
7605 OPEN_CONVERT_SESSION = 11;
7606 OPEN_DECRYPT_SESSION = 12;
7607 }
7608
7609 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7610 optional string plugin_id = 5;
7611 optional string description = 6;
7612 optional Method method = 7;
7613 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007614
7615 optional int64 get_constraints_count = 9;
7616 optional int64 get_metadata_count = 10;
7617 optional int64 can_handle_count = 11;
7618 optional int64 process_drm_info_count = 12;
7619 optional int64 acquire_drm_info_count = 13;
7620 optional int64 save_rights_count = 14;
7621 optional int64 get_original_mime_type_count = 15;
7622 optional int64 get_drm_object_type_count = 16;
7623 optional int64 check_rights_status_count = 17;
7624 optional int64 remove_rights_count = 18;
7625 optional int64 remove_all_rights_count = 19;
7626 optional int64 open_convert_session_count = 20;
7627 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007628}
7629
7630/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007631 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007632 * Pulled from: StatsCompanionService
7633*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007634message DangerousPermissionState {
7635 // Name of the permission
7636 optional string permission_name = 1;
7637
7638 // Uid of the package
7639 optional int32 uid = 2 [(is_uid) = true];
7640
7641 // Package requesting the permission
7642 optional string package_name = 3;
7643
7644 // If the permission is granted to the uid
7645 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007646
7647 // Permission flags as per android.content.pm.PermissionFlags
7648 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007649}
7650
Michael Groover4a0ca942019-01-24 17:41:25 -08007651/**
7652 * Logs when a package is denied access to a device identifier based on the new access requirements.
7653 *
7654 * Logged from:
7655 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7656 */
7657message DeviceIdentifierAccessDenied {
7658 // The name of the package denied access to the requested device identifier.
7659 optional string package_name = 1;
7660
7661 // The name of the device identifier method the package attempted to invoke.
7662 optional string method_name = 2;
7663
7664 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007665 // Starting from Android 11, this boolean is not set and will always be false.
7666 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007667
7668 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007669 // Starting from Android 11, this boolean is not set and will always be false.
7670 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007671}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007672
7673/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007674 * Pulls the ongoing mainline install train version code.
7675 * Pulled from StatsCompanionService
7676 */
7677message TrainInfo {
7678 optional int64 train_version_code = 1;
7679
7680 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007681
7682 optional string train_name = 3;
7683
7684 enum Status {
7685 UNKNOWN = 0;
7686 INSTALL_REQUESTED = 1;
7687 INSTALL_STARTED = 2;
7688 INSTALL_STAGED_NOT_READY = 3;
7689 INSTALL_STAGED_READY = 4;
7690 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007691 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7692 // and INSTALL_FAILURE_COMMIT.
7693 INSTALL_FAILURE = 6 [deprecated = true];
7694 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007695 INSTALL_CANCELLED = 7;
7696 INSTALLER_ROLLBACK_REQUESTED = 8;
7697 INSTALLER_ROLLBACK_INITIATED = 9;
7698 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7699 INSTALLER_ROLLBACK_STAGED = 11;
7700 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7701 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7702 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7703 INSTALLER_ROLLBACK_SUCCESS = 15;
7704 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007705 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7706 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7707 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7708 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7709 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7710 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007711 INSTALL_FAILURE_DOWNLOAD = 23;
7712 INSTALL_FAILURE_STATE_MISMATCH = 24;
7713 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007714 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007715 }
7716 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007717}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007718
7719/**
7720 * Logs the gesture stage changed event.
7721 *
7722 * Logged from:
7723 * frameworks/base/packages/SystemUI/
7724 */
7725message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007726 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007727}
7728
7729/**
7730 * Logs the feedback type.
7731 *
7732 * Logged from:
7733 * frameworks/base/packages/SystemUI/
7734 */
7735message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007736 // Whether or not the gesture was used.
7737 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007738}
7739
7740/**
7741 * Logs the progress.
7742 *
7743 * Logged from:
7744 * frameworks/base/packages/SystemUI/
7745 */
7746message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007747 // [0,100] progress for the assist gesture.
7748 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007749}
Neil Fullerdb14b482019-02-05 19:44:44 +00007750
7751/*
7752 * Information about the time zone data on a device.
7753 */
7754message TimeZoneDataInfo {
7755 // A version identifier for the data set on device. e.g. "2018i"
7756 optional string tzdb_version = 1;
7757}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007758
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007759/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007760 * Logs the GPU stats global health information.
7761 *
7762 * Logged from:
7763 * frameworks/native/services/gpuservice/gpustats/
7764 */
7765message GpuStatsGlobalInfo {
7766 // Package name of the gpu driver.
7767 optional string driver_package_name = 1;
7768
7769 // Version name of the gpu driver.
7770 optional string driver_version_name = 2;
7771
7772 // Version code of the gpu driver.
7773 optional int64 driver_version_code = 3;
7774
7775 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7776 optional int64 driver_build_time = 4;
7777
7778 // Total count of the gl driver gets loaded.
7779 optional int64 gl_loading_count = 5;
7780
7781 // Total count of the gl driver fails to be loaded.
7782 optional int64 gl_loading_failure_count = 6;
7783
7784 // Total count of the Vulkan driver gets loaded.
7785 optional int64 vk_loading_count = 7;
7786
7787 // Total count of the Vulkan driver fails to be loaded.
7788 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007789
7790 // Api version of the system Vulkan driver.
7791 optional int32 vulkan_version = 9;
7792
7793 // Api version of the system CPU Vulkan driver.
7794 optional int32 cpu_vulkan_version = 10;
7795
7796 // Api version of the system GLES driver.
7797 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007798
7799 // Total count of the angle driver gets loaded.
7800 optional int64 angle_loading_count = 12;
7801
7802 // Total count of the angle driver fails to be loaded.
7803 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007804}
7805
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007806/**
7807 * GPU driver loading time info.
7808 */
7809message GpuDriverLoadingTime {
7810 // List of all the driver loading times for this app. The list size is
7811 // capped at 50.
7812 repeated int64 driver_loading_time = 1;
7813}
7814
7815/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007816 * Logs the GPU stats per app health information.
7817 *
7818 * Logged from:
7819 * frameworks/native/services/gpuservice/gpustats/
7820 */
7821message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007822 // Package name of the application that loads the gpu driver. Total number
7823 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007824 optional string app_package_name = 1;
7825
7826 // Version code of the gpu driver this app loads.
7827 optional int64 driver_version_code = 2;
7828
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007829 // gl driver loading time info.
7830 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7831 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007832
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007833 // Vulkan driver loading time info.
7834 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7835 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007836
7837 // Angle driver loading time info.
7838 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7839 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007840
7841 // CPU Vulkan implementation is in use.
7842 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007843
7844 // App is not doing pre-rotation correctly.
7845 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007846
7847 // App creates GLESv1 context.
7848 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007849}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007850
7851/*
7852 * Logs the size of the system ion heap.
7853 *
7854 * Pulled from StatsCompanionService.
7855 */
7856message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007857 // Deprecated due to limited support of ion stats in debugfs.
7858 // Use `IonHeapSize` instead.
7859 option deprecated = true;
7860
Rafal Slawikd4e87572019-03-12 13:08:38 +00007861 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007862 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007863 optional int64 size_in_bytes = 1;
7864}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007865
Rafal Slawik77987ed2019-06-17 12:28:23 +01007866/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007867 * Logs the total size of the ion heap.
7868 *
7869 * Pulled from StatsCompanionService.
7870 */
7871message IonHeapSize {
7872 // Total size of all ion heaps in kilobytes.
7873 // Read from: /sys/kernel/ion/total_heaps_kb.
7874 optional int32 total_size_kb = 1;
7875}
7876
7877/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007878 * Logs the per-process size of the system ion heap.
7879 *
7880 * Pulled from StatsCompanionService.
7881 */
7882message ProcessSystemIonHeapSize {
7883 // The uid if available. -1 means not available.
7884 optional int32 uid = 1 [(is_uid) = true];
7885
7886 // The process name (from /proc/PID/cmdline).
7887 optional string process_name = 2;
7888
7889 // Sum of sizes of all allocations.
7890 optional int32 total_size_in_kilobytes = 3;
7891
7892 // Number of allocations.
7893 optional int32 allocation_count = 4;
7894
7895 // Size of the largest allocation.
7896 optional int32 max_size_in_kilobytes = 5;
7897}
7898
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007899/**
7900 * Push network stack events.
7901 *
7902 * Log from:
7903 * frameworks/base/packages/NetworkStack/
7904 */
7905message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007906 // The id that indicates the event reported from NetworkStack.
7907 optional int32 event_id = 1;
7908 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007909 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7910}
Carmen Agimofa769c152019-03-04 14:39:14 +00007911
7912/**
7913 * Logs the apps that are installed on the external storage.
7914 * Pulled from:
7915 * StatsCompanionService
7916 */
7917message AppsOnExternalStorageInfo {
7918 // The type of the external storage.
7919 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7920 // The name of the package that is installed on the external storage.
7921 optional string package_name = 2;
7922}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007923
7924/**
7925 * Logs the settings related to Face.
7926 * Logged from:
7927 * frameworks/base/services/core/java/com/android/server/stats
7928 */
7929message FaceSettings {
7930 // Whether or not face unlock is allowed on Keyguard.
7931 optional bool unlock_keyguard_enabled = 1;
7932 // Whether or not face unlock dismisses the Keyguard.
7933 optional bool unlock_dismisses_keyguard = 2;
7934 // Whether or not face unlock requires attention.
7935 optional bool unlock_attention_required = 3;
7936 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7937 optional bool unlock_app_enabled = 4;
7938 // Whether or not face unlock always requires user confirmation.
7939 optional bool unlock_always_require_confirmation = 5;
7940 // Whether or not a diverse set of poses are required during enrollment.
7941 optional bool unlock_diversity_required = 6;
7942}
Maggie White442b6312019-04-05 16:26:44 -07007943
7944/**
7945 * Logs cooling devices maintained by the kernel.
7946 *
7947 * Pulled from StatsCompanionService.java
7948 */
7949message CoolingDevice {
7950 // The type of cooling device being reported. Eg. CPU, GPU...
7951 optional android.os.CoolingTypeEnum device_location = 1;
7952 // The name of the cooling device source. Eg. CPU0
7953 optional string device_name = 2;
7954 // Current throttle state of the cooling device. The value can any unsigned
7955 // integer between 0 and max_state defined in its driver. 0 means device is
7956 // not in throttling, higher value means deeper throttling.
7957 optional int32 state = 3;
7958}
Ben Blount763a5d52019-04-10 11:48:58 -07007959
7960/**
7961 * Intelligence has several counter-type events that don't warrant a
7962 * full separate atom. These are primarily API call counters but also include
7963 * counters for feature usage and specific failure modes.
7964 *
7965 * Logged from the Intelligence mainline module.
7966 */
7967message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007968 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007969 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007970 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007971 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007972 // How many times the event occured (to report a batch of high frequency events).
7973 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007974 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007975 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007976}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007977
7978/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007979 * Logs when Car Power state changed.
7980 *
7981 * Logged from:
7982 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7983 */
7984message CarPowerStateChanged {
7985 // States come from CpmsState in CarPowerManagementService.java.
7986 enum State {
7987 WAIT_FOR_VHAL = 0;
7988 ON = 1;
7989 SHUTDOWN_PREPARE = 2;
7990 WAIT_FOR_FINISH = 3;
7991 SUSPEND = 4;
7992 SIMULATE_SLEEP = 5;
7993 }
7994 optional State state = 1;
7995}
7996
7997/**
7998 * Logs whether GarageMode is entered.
7999 *
8000 * Logged from:
8001 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8002 */
8003message GarageModeInfo {
8004 // Whether GarageMode is entered.
8005 optional bool is_garage_mode = 1;
8006}
Martijn Coenencd95d462019-04-25 17:09:45 +02008007
8008/**
8009 * Historical app ops data per package.
8010 */
8011message AppOps {
8012 // Uid of the package requesting the op
8013 optional int32 uid = 1 [(is_uid) = true];
8014
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008015 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008016 optional string package_name = 2;
8017
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008018 // operation id
8019 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008020
8021 // The number of times the op was granted while the app was in the
8022 // foreground (only for trusted requests)
8023 optional int64 trusted_foreground_granted_count = 4;
8024
8025 // The number of times the op was granted while the app was in the
8026 // background (only for trusted requests)
8027 optional int64 trusted_background_granted_count = 5;
8028
8029 // The number of times the op was rejected while the app was in the
8030 // foreground (only for trusted requests)
8031 optional int64 trusted_foreground_rejected_count = 6;
8032
8033 // The number of times the op was rejected while the app was in the
8034 // background (only for trusted requests)
8035 optional int64 trusted_background_rejected_count = 7;
8036
8037 // For long-running operations, total duration of the operation
8038 // while the app was in the foreground (only for trusted requests)
8039 optional int64 trusted_foreground_duration_millis = 8;
8040
8041 // For long-running operations, total duration of the operation
8042 // while the app was in the background (only for trusted requests)
8043 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008044
8045 // Whether AppOps is guarded by Runtime permission
8046 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008047}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008048
8049/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008050 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008051 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008052message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008053 // Uid of the package requesting the op
8054 optional int32 uid = 1 [(is_uid) = true];
8055
8056 // Name of the package performing the op
8057 optional string package_name = 2;
8058
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008059 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8060 // Attributions must be provided through manifest using <attribution> tag available in R and
8061 // above.
8062 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008063
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008064 // operation id
8065 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008066
8067 // The number of times the op was granted while the app was in the
8068 // foreground (only for trusted requests)
8069 optional int64 trusted_foreground_granted_count = 5;
8070
8071 // The number of times the op was granted while the app was in the
8072 // background (only for trusted requests)
8073 optional int64 trusted_background_granted_count = 6;
8074
8075 // The number of times the op was rejected while the app was in the
8076 // foreground (only for trusted requests)
8077 optional int64 trusted_foreground_rejected_count = 7;
8078
8079 // The number of times the op was rejected while the app was in the
8080 // background (only for trusted requests)
8081 optional int64 trusted_background_rejected_count = 8;
8082
8083 // For long-running operations, total duration of the operation
8084 // while the app was in the foreground (only for trusted requests)
8085 optional int64 trusted_foreground_duration_millis = 9;
8086
8087 // For long-running operations, total duration of the operation
8088 // while the app was in the background (only for trusted requests)
8089 optional int64 trusted_background_duration_millis = 10;
8090
8091 // Whether AppOps is guarded by Runtime permission
8092 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008093
8094 // Sampling rate used on device, from 0 to 100
8095 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008096}
8097
8098/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008099 * Location Manager API Usage information(e.g. API under usage,
8100 * API call's parameters).
8101 * Logged from:
8102 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8103 */
8104message LocationManagerApiUsageReported {
8105
8106 // Indicating if usage starts or usage ends.
8107 optional android.stats.location.UsageState state = 1;
8108
8109 // LocationManagerService's API in use.
8110 // We can identify which API from LocationManager is
8111 // invoking current LMS API by the combination of
8112 // API parameter(e.g. is_listener_null, is_intent_null,
8113 // is_location_request_null)
8114 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8115
8116 // Name of the package calling the API.
8117 optional string calling_package_name = 3;
8118
8119 // Type of the location provider.
8120 optional android.stats.location.ProviderType provider = 4;
8121
8122 // Quality of the location request
8123 optional android.stats.location.LocationRequestQuality quality = 5;
8124
8125 // The desired interval for active location updates, in milliseconds.
8126 // Bucketized to reduce cardinality.
8127 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8128
8129 // Minimum distance between location updates, in meters.
8130 // Bucketized to reduce cardinality.
8131 optional android.stats.location.SmallestDisplacementBucket
8132 bucketized_smallest_displacement = 7;
8133
8134 // The number of location updates.
8135 optional int64 num_updates = 8;
8136
8137 // The request expiration time, in millisecond since boot.
8138 // Bucketized to reduce cardinality.
8139 optional android.stats.location.ExpirationBucket
8140 bucketized_expire_in = 9;
8141
8142 // Type of Callback passed in for this API.
8143 optional android.stats.location.CallbackType callback_type = 10;
8144
8145 // The radius of the central point of the alert
8146 // region, in meters. Only for API REQUEST_GEOFENCE.
8147 // Bucketized to reduce cardinality.
8148 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8149
8150 // Activity Importance of API caller.
8151 // Categorized to 3 types that are interesting from location's perspective.
8152 optional android.stats.location.ActivityImportance activiy_importance = 12;
8153}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008154
8155/**
8156 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8157 */
8158message ReviewPermissionsFragmentResultReported {
8159 // unique value identifying a permission group change. A permission group change might result
8160 // in multiple of these atoms
8161 optional int64 change_id = 1;
8162
8163 // UID of package the permission belongs to
8164 optional int32 uid = 2 [(is_uid) = true];
8165
8166 // Name of package the permission belongs to
8167 optional string package_name = 3;
8168
8169 // The permission to be granted
8170 optional string permission_name = 4;
8171
8172 // The result of the permission grant
8173 optional bool permission_granted = 5;
8174}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008175
8176/**
8177* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8178* Logged from: RuntimePermissionUpdgradeController
8179*/
8180message RuntimePermissionsUpgradeResult {
8181 // Permission granted as result of upgrade
8182 optional string permission_name = 1;
8183
8184 // UID of package granted permission
8185 optional int32 uid = 2 [(is_uid) = true];
8186
8187 // Name of package granted permission
8188 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008189}
8190
8191/**
8192* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8193*/
8194message GrantPermissionsActivityButtonActions {
8195 // Permission granted as result of upgrade
8196 optional string permission_group_name = 1;
8197
8198 // UID of package granted permission
8199 optional int32 uid = 2 [(is_uid) = true];
8200
8201 // Name of package requesting permission
8202 optional string package_name = 3;
8203
8204 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8205 // LABEL_ constants in GrantPermissionActivity.java
8206 optional int32 buttons_presented = 4;
8207
8208 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8209 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008210
8211 // id which identifies single session of user interacting with permission controller
8212 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008213}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008214
8215/**
8216 * Information about LocationAccessCheck notification presented to user
8217 */
8218message LocationAccessCheckNotificationAction {
8219
8220 // id which identifies single session of user interacting with permission controller
8221 optional int64 session_id = 1;
8222
8223 // Uid of package for which location access check is presented
8224 optional int32 package_uid = 2;
8225
8226 // Name of package for which location access check is presented
8227 optional string package_name = 3;
8228
8229 enum Result {
8230 UNDEFINED = 0;
8231 // notification was presented to the user
8232 NOTIFICATION_PRESENTED = 1;
8233 // notification was declined by the user
8234 NOTIFICATION_DECLINED = 2;
8235 // notification was clicked by the user
8236 NOTIFICATION_CLICKED = 3;
8237 }
8238
8239 // View / interaction recorded
8240 optional Result result = 4;
8241}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008242
8243/**
8244 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8245 */
8246message AppPermissionFragmentActionReported {
8247 // id which identifies single session of user interacting with permission controller
8248 optional int64 session_id = 1;
8249
8250 // unique value identifying a permission group change. A permission group change might result
8251 // in multiple of these atoms
8252 optional int64 change_id = 2;
8253
8254 // UID of package the permission belongs to
8255 optional int32 uid = 3 [(is_uid) = true];
8256
8257 // Name of package the permission belongs to
8258 optional string package_name = 4;
8259
8260 // The permission to be granted
8261 optional string permission_name = 5;
8262
8263 // The result of the permission grant
8264 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008265
8266 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8267 optional int32 permission_flags = 7;
8268
8269 enum Button {
8270 UNDEFINED = 0;
8271 // Allow button
8272 ALLOW = 1;
8273 // Deny button
8274 DENY = 2;
8275 // Ask every time button
8276 ASK_EVERY_TIME = 3;
8277 // Allow all the time button
8278 ALLOW_ALWAYS = 4;
8279 // Allow only while using the app button
8280 ALLOW_FOREGROUND = 5;
8281 // Same is Deny button but shown in while in use dialog
8282 DENY_FOREGROUND = 6;
8283 }
8284
8285 // Button pressed in the dialog
8286 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008287}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008288
8289/**
8290* Information about a AppPermissionFragment viewed by user
8291*/
8292message AppPermissionFragmentViewed {
8293 // id which identifies single session of user interacting with permission controller
8294 optional int64 session_id = 1;
8295
8296 // UID of package for which permissions are viewed
8297 optional int32 uid = 2 [(is_uid) = true];
8298
8299 // Name of package for which permissions are viewed
8300 optional string package_name = 3;
8301
8302 // Permission group viewed
8303 optional string permission_group_name = 4;
8304}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008305
8306/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008307* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8308* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008309*/
8310message AppPermissionsFragmentViewed {
8311 // id which identifies single session of user interacting with permission controller
8312 optional int64 session_id = 1;
8313
8314 // id which identifies single view as every view might have several logging records
8315 // with different package information attached
8316 optional int64 view_id = 2;
8317
8318 // Permission group viewed
8319 optional string permission_group_name = 3;
8320
8321 // UID of package for which permissions are viewed
8322 optional int32 uid = 4 [(is_uid) = true];
8323
8324 // Name of package for which permissions are viewed
8325 optional string package_name = 5;
8326
8327 // Category in which permission is included
8328 enum Category {
8329 UNDEFINED = 0;
8330 ALLOWED = 1;
8331 ALLOWED_FOREGROUND = 2;
8332 DENIED = 3;
8333 }
8334 optional Category category = 6;
8335}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008336/**
8337* Information about a PermissionAppsFragment viewed by user.
8338* Logged from ui/handheld/PermissionAppsFragment.java
8339*/
8340message PermissionAppsFragmentViewed {
8341 // id which identifies single session of user interacting with permission controller
8342 optional int64 session_id = 1;
8343
8344 // id which identifies single view as every view might have several logging records
8345 // with different package information attached
8346 optional int64 view_id = 2;
8347
8348 // Permission group viewed
8349 optional string permission_group_name = 3;
8350
8351 // UID of package for which permissions are viewed
8352 optional int32 uid = 4 [(is_uid) = true];
8353
8354 // Name of package for which permissions are viewed
8355 optional string package_name = 5;
8356
8357 // Category in which app is included
8358 enum Category {
8359 UNDEFINED = 0;
8360 ALLOWED = 1;
8361 ALLOWED_FOREGROUND = 2;
8362 DENIED = 3;
8363 }
8364 optional Category category = 6;
8365}
Tony Make2b1b672019-07-29 16:59:47 +01008366
8367/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008368* Log that the Auto Revoke notification has been clicked
8369* Logged from ui/ManagePermissionsActivity
8370*/
8371message AutoRevokeNotificationClicked {
8372 // id which identifies single session of user interacting with permission controller
8373 optional int64 session_id = 1;
8374}
8375
8376/**
8377* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8378* auto revoked for it.
8379* Logged from ui/handheld/AutoRevokeFragment
8380*/
8381message AutoRevokeFragmentAppViewed {
8382 // id which identifies single session of user interacting with permission controller
8383 optional int64 session_id = 1;
8384
8385 // UID of package for which permissions are viewed
8386 optional int32 uid = 2 [(is_uid) = true];
8387
8388 // Name of package for which permissions are viewed
8389 optional string package_name = 3;
8390
8391 // The name of a permission group that has been revoked
8392 optional string permission_group_name = 4;
8393
8394 // The age of the app- more than three months old, or more than six months
8395 enum Age {
8396 UNDEFINED = 0;
8397 NEWER_BUCKET = 1;
8398 OLDER_BUCKET = 2;
8399 }
8400
8401 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8402 optional Age age = 5;
8403}
8404
8405/**
8406* Log that the user has interacted with an app on the auto revoke fragment
8407* Logged from ui/handheld/AutoRevokeFragment
8408*/
8409message AutoRevokedAppInteraction {
8410 // id which identifies single session of user interacting with permission controller
8411 optional int64 session_id = 1;
8412
8413 // UID of package for which permissions are viewed
8414 optional int32 uid = 2 [(is_uid) = true];
8415
8416 // Name of package for which permissions are viewed
8417 optional string package_name = 3;
8418
8419 enum Action {
8420 UNDEFINED = 0;
8421 REMOVE = 1;
8422 OPEN = 2;
8423 APP_INFO = 3;
8424 PERMISSIONS = 4;
8425 REMOVE_IN_SETTINGS = 5;
8426 OPEN_IN_SETTINGS = 6;
8427 }
8428
8429 // The action the user took to interact with the app
8430 optional Action action = 4;
8431}
8432
8433/**
8434* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8435* auto revoke, or that the auto revoke switch has been changed
8436* Logged from ui/handheld/AppPermissionGroupsFragment
8437 */
8438message AppPermissionGroupsFragmentAutoRevokeAction {
8439 // id which identifies single session of user interacting with permission controller
8440 optional int64 session_id = 1;
8441
8442 // UID of package for which permissions are viewed
8443 optional int32 uid = 2 [(is_uid) = true];
8444
8445 // Name of package for which permissions are viewed
8446 optional string package_name = 3;
8447
8448 enum Action {
8449 UNDEFINED = 0;
8450 OPENED_FOR_AUTO_REVOKE = 1;
8451 OPENED_FROM_INTENT = 2;
8452 SWITCH_ENABLED = 3;
8453 SWITCH_DISABLED = 4;
8454 }
8455
8456 // The action the user took to interact with the fragment
8457 optional Action action = 4;
8458}
8459
8460/**
Tony Make2b1b672019-07-29 16:59:47 +01008461 * Logs when there is a smart selection related event.
8462 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8463 * Logged from: TextClassifierEventLogger.java
8464 */
8465message TextSelectionEvent {
8466 // A session ID.
8467 optional string session_id = 1;
8468
8469 // Event type of this event.
8470 optional android.stats.textclassifier.EventType event_type = 2;
8471
Tony Mak9c84bd22019-12-09 07:27:25 +00008472 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008473 optional string model_name = 3;
8474
8475 // Type of widget that was involved in triggering this event.
8476 optional android.stats.textclassifier.WidgetType widget_type = 4;
8477
8478 // Index of this event in a session.
8479 optional int32 event_index = 5;
8480
8481 // Entity type that is involved.
8482 optional string entity_type = 6;
8483
8484 // Relative word index of the start of the selection.
8485 optional int32 relative_word_start_index = 7;
8486
8487 // Relative word (exclusive) index of the end of the selection.
8488 optional int32 relative_word_end_index = 8;
8489
8490 // Relative word index of the start of the smart selection.
8491 optional int32 relative_suggested_word_start_index = 9;
8492
8493 // Relative word (exclusive) index of the end of the smart selection.
8494 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008495
8496 // Name of source package.
8497 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008498
8499 // Name of the LangID model that is involved in this event.
8500 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008501}
8502
8503/**
8504 * Logs when there is a smart linkify related event.
8505 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8506 * Logged from: TextClassifierEventLogger.java
8507 */
8508message TextLinkifyEvent {
8509 // A session ID.
8510 optional string session_id = 1;
8511
8512 // Event type of this event.
8513 optional android.stats.textclassifier.EventType event_type = 2;
8514
Tony Mak9c84bd22019-12-09 07:27:25 +00008515 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008516 optional string model_name = 3;
8517
8518 // Type of widget that was involved in triggering this event.
8519 optional android.stats.textclassifier.WidgetType widget_type = 4;
8520
8521 // Index of this event in a session.
8522 optional int32 event_index = 5;
8523
8524 // Entity type that is involved.
8525 optional string entity_type = 6;
8526
8527 // Number of links detected.
8528 optional int32 num_links = 7;
8529
8530 // The total length of all links.
8531 optional int32 linked_text_length = 8;
8532
8533 // Length of input text.
8534 optional int32 text_length = 9;
8535
8536 // Time spent on generating links in ms.
8537 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008538
8539 // Name of source package.
8540 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008541
8542 // Name of the LangID model that is involved in this event.
8543 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008544}
8545
8546/**
8547 * Logs when there is a conversation actions related event.
8548 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8549 * Logged from: TextClassifierEventLogger.java
8550 */
8551message ConversationActionsEvent {
8552 // A session ID.
8553 optional string session_id = 1;
8554
8555 // Event type of this event.
8556 optional android.stats.textclassifier.EventType event_type = 2;
8557
Tony Mak9c84bd22019-12-09 07:27:25 +00008558 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008559 optional string model_name = 3;
8560
8561 // Type of widget that was involved in triggering this event.
8562 optional android.stats.textclassifier.WidgetType widget_type = 4;
8563
8564 // The first entity type that is involved.
8565 optional string first_entity_type = 5;
8566
8567 // The second entity type that is involved.
8568 optional string second_entity_type = 6;
8569
8570 // The third entity type that is involved.
8571 optional string third_entity_type = 7;
8572
8573 // The score of the first entity type.
8574 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008575
8576 // Name of source package.
8577 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008578
8579 // Name of the annotator model that is involved in this event.
8580 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008581
8582 // Name of the LangID model that is involved in this event.
8583 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008584}
8585
8586/**
8587 * Logs when there is a language detection related event.
8588 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8589 * Logged from: TextClassifierEventLogger.java
8590 */
8591message LanguageDetectionEvent {
8592 // A session ID.
8593 optional string session_id = 1;
8594
8595 // Event type of this event.
8596 optional android.stats.textclassifier.EventType event_type = 2;
8597
Tony Mak9c84bd22019-12-09 07:27:25 +00008598 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008599 optional string model_name = 3;
8600
8601 // Type of widget that was involved in triggering this event.
8602 optional android.stats.textclassifier.WidgetType widget_type = 4;
8603
8604 // Detected language.
8605 optional string language_tag = 5;
8606
8607 // Score of the detected language.
8608 optional float score = 6;
8609
8610 // Position of this action.
8611 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008612
8613 // Name of source package.
8614 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008615}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008616
8617/**
8618 * Information about an OTA update attempt by update_engine.
8619 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8620 */
8621message UpdateEngineUpdateAttemptReported {
8622 // The number of attempts for the update engine to apply a given payload.
8623 optional int32 attempt_number = 1;
8624
8625 optional android.stats.otaupdate.PayloadType payload_type = 2;
8626
8627 // The total time in minutes for the update engine to apply a given payload.
8628 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8629 // it's increased when the system is sleeping.
8630 optional int32 duration_boottime_in_minutes = 3;
8631
8632 // The total time in minutes for the update engine to apply a given payload.
8633 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8634 // and it's not increased when the system is sleeping.
8635 optional int32 duration_monotonic_in_minutes = 4;
8636
8637 // The size of the payload in MiBs.
8638 optional int32 payload_size_mib = 5;
8639
8640 // The attempt result reported by the update engine for an OTA update.
8641 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8642
8643 // The error code reported by the update engine after an OTA update attempt
8644 // on A/B devices.
8645 optional android.stats.otaupdate.ErrorCode error_code = 7;
8646
8647 // The build fingerprint of the source system. The value is read from a
8648 // system property when the device takes the update. e.g.
8649 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8650 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008651
8652 // Size of super partition.
8653 optional int64 super_partition_size_bytes = 9;
8654
8655 // Size of current slot within the super partition.
8656 optional int64 slot_size_bytes = 10;
8657
8658 // Free space available in the super partition.
8659 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008660}
8661
8662/**
8663 * Information about all the attempts the device make before finishing the
8664 * successful update.
8665 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8666 */
8667message UpdateEngineSuccessfulUpdateReported {
8668 // The number of attempts for the update engine to apply the payload for a
8669 // successful update.
8670 optional int32 attempt_count = 1;
8671
8672 optional android.stats.otaupdate.PayloadType payload_type = 2;
8673
8674 optional int32 payload_size_mib = 3;
8675
8676 // The total number of bytes downloaded by update_engine since the last
8677 // successful update.
8678 optional int32 total_bytes_downloaded_mib = 4;
8679
8680 // The ratio in percentage of the over-downloaded bytes compared to the
8681 // total bytes needed to successfully install the update. e.g. 200 if we
8682 // download 200MiB in total for a 100MiB package.
8683 optional int32 download_overhead_percentage = 5;
8684
8685 // The total time in minutes for the update engine to apply the payload for a
8686 // successful update.
8687 optional int32 total_duration_minutes = 6;
8688
8689 // The number of reboot of the device during a successful update.
8690 optional int32 reboot_count = 7;
8691}
Alec Mourie088e762019-07-02 13:10:55 -07008692
8693/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008694 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8695 * key to indicate whether it was successful or not.
8696 *
8697 * Logged from:
8698 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8699 */
8700message RebootEscrowRecoveryReported {
8701 optional bool successful = 1;
8702}
8703
8704/**
Alec Mourie088e762019-07-02 13:10:55 -07008705 * Global display pipeline metrics reported by SurfaceFlinger.
8706 * Pulled from:
8707 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8708 */
8709message SurfaceflingerStatsGlobalInfo {
8710 // Total number of frames presented during the tracing period
8711 optional int64 total_frames = 1;
8712 // Total number of frames missed
8713 optional int64 missed_frames = 2;
8714 // Total number of frames that fell back to client composition
8715 optional int64 client_composition_frames = 3;
8716 // Total time the display was turned on
8717 optional int64 display_on_millis = 4;
8718 // Total time that was spent performing animations.
8719 // This is derived from the present-to-present layer histogram
8720 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008721 // Total number of event connections tracked by SurfaceFlinger at the time
8722 // of this pull. If this number grows prohibitively large, then this can
8723 // cause jank due to resource contention.
8724 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008725 // Set of timings measured from when SurfaceFlinger began compositing a
8726 // frame, until the frame was requested to be presented to the display. This
8727 // measures SurfaceFlinger's total CPU walltime on the critical path per
8728 // frame.
8729 optional FrameTimingHistogram frame_duration = 7
8730 [(android.os.statsd.log_mode) = MODE_BYTES];
8731 // Set of timings measured from when SurfaceFlinger first began using the
8732 // GPU to composite a frame, until the GPU has finished compositing that
8733 // frame. This measures the total additional time SurfaceFlinger needed to
8734 // perform due to falling back into GPU composition.
8735 optional FrameTimingHistogram render_engine_timing = 8
8736 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008737}
8738
8739/**
8740 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8741 * The number of layers uploaded will be restricted due to size limitations.
8742 * Pulled from:
8743 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8744 */
8745message SurfaceflingerStatsLayerInfo {
8746 // The layer for this set of metrics
8747 // For now we can infer that the package name is included in the layer
8748 // name.
8749 optional string layer_name = 1;
8750 // Total number of frames presented
8751 optional int64 total_frames = 2;
8752 // Total number of dropped frames while latching a buffer for this layer.
8753 optional int64 dropped_frames = 3;
8754 // Set of timings measured between successive presentation timestamps.
8755 optional FrameTimingHistogram present_to_present = 4
8756 [(android.os.statsd.log_mode) = MODE_BYTES];
8757 // Set of timings measured from when an app queued a buffer for
8758 // presentation, until the buffer was actually presented to the
8759 // display.
8760 optional FrameTimingHistogram post_to_present = 5
8761 [(android.os.statsd.log_mode) = MODE_BYTES];
8762 // Set of timings measured from when a buffer is ready to be presented,
8763 // until the buffer was actually presented to the display.
8764 optional FrameTimingHistogram acquire_to_present = 6
8765 [(android.os.statsd.log_mode) = MODE_BYTES];
8766 // Set of timings measured from when a buffer was latched by
8767 // SurfaceFlinger, until the buffer was presented to the display
8768 optional FrameTimingHistogram latch_to_present = 7
8769 [(android.os.statsd.log_mode) = MODE_BYTES];
8770 // Set of timings measured from the desired presentation to the actual
8771 // presentation time
8772 optional FrameTimingHistogram desired_to_present = 8
8773 [(android.os.statsd.log_mode) = MODE_BYTES];
8774 // Set of timings measured from when an app queued a buffer for
8775 // presentation, until the buffer was ready to be presented.
8776 optional FrameTimingHistogram post_to_acquire = 9
8777 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008778 // Frames missed latch because the acquire fence didn't fire
8779 optional int64 late_acquire_frames = 10;
8780 // Frames latched early because the desired present time was bad
8781 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008782}
8783
8784/**
8785 * Histogram of frame counts bucketed by time in milliseconds.
8786 * Because of size limitations, we hard-cap the number of buckets, with
8787 * buckets for corresponding to larger milliseconds being less precise.
8788 */
8789message FrameTimingHistogram {
8790 // Timings in milliseconds that describes a set of histogram buckets
8791 repeated int32 time_millis_buckets = 1;
8792 // Number of frames that match to each time_millis, i.e. the bucket
8793 // contents
8794 // It's required that len(time_millis) == len(frame_count)
8795 repeated int64 frame_counts = 2;
8796}
Emilian Peev6729f372019-08-29 09:14:09 -07008797
Emilian Peev6729f372019-08-29 09:14:09 -07008798/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008799 * Janky event as reported by SurfaceFlinger.
8800 * This event is intended to be consumed by a Perfetto subscriber for
8801 * automated trace collection.
8802 *
8803 * Logged from:
8804 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8805 */
8806message DisplayJankReported {
8807 // Informational field for how long the janky event lasted in milliseconds
8808 optional int64 event_duration_millis = 1;
8809 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8810 // the display on time.
8811 optional int32 present_deadlines_missed = 2;
8812}
8813
8814/**
Emilian Peev6729f372019-08-29 09:14:09 -07008815 * Information about camera facing and API level usage.
8816 * Logged from:
8817 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8818 */
8819message CameraActionEvent {
8820 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008821 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008822
8823 // Camera API level used
8824 optional int32 api_level = 2;
8825
8826 // Name of client package
8827 optional string package_name = 3;
8828
8829 // Camera facing
8830 enum Facing {
8831 UNKNOWN = 0;
8832 BACK = 1;
8833 FRONT = 2;
8834 EXTERNAL = 3;
8835 }
8836 optional Facing facing = 4;
8837}
atrost01a20932019-08-28 15:40:37 +01008838
8839/**
8840 * Logs when a compatibility change is affecting an app.
8841 *
8842 * Logged from:
8843 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8844 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8845 */
8846message AppCompatibilityChangeReported {
8847 // The UID of the app being affected by the compatibilty change.
8848 optional int32 uid = 1 [(is_uid) = true];
8849
8850 // The ID of the change affecting the app.
8851 optional int64 change_id = 2;
8852
8853 enum State {
8854 UNKNOWN_STATE = 0;
8855 ENABLED = 1;
8856 DISABLED = 2;
8857 LOGGED = 3;
8858 }
8859
8860 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8861 // logged otherwise.
8862 optional State state = 3;
8863
8864 enum Source {
8865 UNKNOWN_SOURCE = 0;
8866 APP_PROCESS = 1;
8867 SYSTEM_SERVER = 2;
8868 }
8869
8870 // Where it was logged from.
8871 optional Source source = 4;
8872
8873}
Hector Dearman40579f62019-11-01 13:19:30 +00008874
8875/**
8876 * Logged from
8877 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8878 */
8879message PerfettoUploaded {
8880 enum Event {
8881 PERFETTO_UNDEFINED = 0;
8882 PERFETTO_TRACE_BEGIN = 1;
8883 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8884 PERFETTO_ON_CONNECT = 3;
8885 PERFETTO_ON_TRACING_DISABLED = 4;
8886 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8887 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8888 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8889 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8890 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8891 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8892 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8893 PERFETTO_TRIGGER_BEGIN = 12;
8894 PERFETTO_TRIGGER_SUCCESS = 13;
8895 PERFETTO_TRIGGER_FAILURE = 14;
8896 PERFETTO_HIT_GUARDRAILS = 15;
8897 PERFETTO_ON_TIMEOUT = 16;
8898 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8899 }
8900
8901 // Which stage of the pipeline we are reporting from.
8902 optional Event event = 1;
8903
8904 // UUID matching the one set inside the SystemInfo trace packet.
8905 optional int64 trace_uuid_lsb = 2;
8906 optional int64 trace_uuid_msb = 3;
8907}
Mark Tabrya824a642019-11-05 12:26:12 -08008908
8909/**
8910 * Pulls client metrics on data transferred via Vehicle Maps Service.
8911 * Metrics are keyed by uid + layer.
8912 *
8913 * Pulled from:
8914 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8915 */
8916message VmsClientStats {
8917 // UID of the VMS client app
8918 optional int32 uid = 1 [(is_uid) = true];
8919
8920 // VMS layer definition
8921 optional int32 layer_type = 2;
8922 optional int32 layer_channel = 3;
8923 optional int32 layer_version = 4;
8924
8925 // Bytes and packets sent by the client for the layer
8926 optional int64 tx_bytes = 5;
8927 optional int64 tx_packets = 6;
8928
8929 // Bytes and packets received by the client for the layer
8930 optional int64 rx_bytes = 7;
8931 optional int64 rx_packets = 8;
8932
8933 // Bytes and packets dropped due to client error
8934 optional int64 dropped_bytes = 9;
8935 optional int64 dropped_packets = 10;
8936}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008937
8938/**
8939 * State of a dangerous permission requested by a package - sampled
8940 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8941*/
8942message DangerousPermissionStateSampled {
8943 // Name of the permission
8944 optional string permission_name = 1;
8945
8946 // Uid of the package
8947 optional int32 uid = 2 [(is_uid) = true];
8948
8949 // If the permission is granted to the uid
8950 optional bool is_granted = 3;
8951
8952 // Permission flags as per android.content.pm.PermissionFlags
8953 optional int32 permission_flags = 4;
8954}
8955
Stan Iliev637ba5e2019-08-16 13:43:08 -04008956/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008957 * HWUI stats for a given app.
8958 */
8959message GraphicsStats {
8960 // The package name of the app
8961 optional string package_name = 1;
8962
8963 // The version code of the app
8964 optional int64 version_code = 2;
8965
8966 // The start & end timestamps in UTC as
8967 // milliseconds since January 1, 1970
8968 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008969 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008970
Stan Ilievb6517192020-02-18 10:12:42 -05008971 optional int64 end_millis = 4;
8972
8973 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8974 enum PipelineType {
8975 UNKNOWN = 0;
8976 GL = 1;
8977 VULKAN = 2;
8978 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008979
8980 // HWUI renders pipeline type: GL or Vulkan.
8981 optional PipelineType pipeline = 5;
8982
8983 // Distinct frame count.
8984 optional int32 total_frames = 6;
8985
8986 // Number of "missed vsync" events.
8987 optional int32 missed_vsync_count = 7;
8988
8989 // Number of frames in triple-buffering scenario (high input latency)
8990 optional int32 high_input_latency_count = 8;
8991
8992 // Number of "slow UI thread" events.
8993 optional int32 slow_ui_thread_count = 9;
8994
8995 // Number of "slow bitmap upload" events.
8996 optional int32 slow_bitmap_upload_count = 10;
8997
8998 // Number of "slow draw" events.
8999 optional int32 slow_draw_count = 11;
9000
9001 // Number of frames that missed their deadline (aka, visibly janked)
9002 optional int32 missed_deadline_count = 12;
9003
9004 // The frame time histogram for the package
9005 optional FrameTimingHistogram cpu_histogram = 13
9006 [(android.os.statsd.log_mode) = MODE_BYTES];
9007
9008 // The gpu frame time histogram for the package
9009 optional FrameTimingHistogram gpu_histogram = 14
9010 [(android.os.statsd.log_mode) = MODE_BYTES];
9011
9012 // UI mainline module version.
9013 optional int64 version_ui_module = 15;
9014
9015 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9016 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9017 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9018 // more apps are running / rendering.
9019 optional bool is_today = 16;
9020}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009021
9022/**
9023 * Message related to dangerous (runtime) app ops access
9024 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009025message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009026 // Uid of the package accessing app op
9027 optional int32 uid = 1 [(is_uid) = true];
9028
9029 // Name of the package accessing app op
9030 optional string package_name = 2;
9031
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009032 // deprecated - set to empty string
9033 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009034
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009035 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009036 // API. Attributions must be provided through manifest using <attribution> tag available in R
9037 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009038 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009039
9040 // message related to app op access, limited to 600 chars by API
9041 optional string message = 5;
9042
9043 enum SamplingStrategy {
9044 DEFAULT = 0;
9045 UNIFORM = 1;
9046 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009047 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009048 }
9049
9050 // sampling strategy used to collect this message
9051 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009052
9053 // operation id
9054 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009055}
9056
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009057/*
9058 * Logs userspace reboot outcome and duration.
9059 *
9060 * Logged from:
9061 * frameworks/base/core/java/com/android/server/BootReceiver.java
9062 */
9063message UserspaceRebootReported {
9064 // Possible outcomes of userspace reboot.
9065 enum Outcome {
9066 // Default value in case platform failed to determine the outcome.
9067 OUTCOME_UNKNOWN = 0;
9068 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9069 SUCCESS = 1;
9070 // Userspace reboot shutdown sequence was aborted.
9071 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9072 // Remounting userdata into checkpointing mode failed.
9073 FAILED_USERDATA_REMOUNT = 3;
9074 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9075 // reboot.
9076 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9077 }
9078 // Outcome of userspace reboot. Always set.
9079 optional Outcome outcome = 1;
9080 // Duration of userspace reboot in case it has a successful outcome.
9081 // Duration is measured as time between userspace reboot was initiated and until boot completed
9082 // (e.g. sys.boot_completed=1).
9083 optional int64 duration_millis = 2;
9084 // State of primary user's (user0) credential encryption storage.
9085 enum UserEncryptionState {
9086 // Default value.
9087 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9088 // Credential encrypted storage is unlocked.
9089 UNLOCKED = 1;
9090 // Credential encrypted storage is locked.
9091 LOCKED = 2;
9092 }
9093 // State of primary user's encryption storage at the moment boot completed. Always set.
9094 optional UserEncryptionState user_encryption_state = 3;
9095}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009096
9097/*
9098 * Logs integrity check information during each install.
9099 *
9100 * Logged from:
9101 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9102 */
9103message IntegrityCheckResultReported {
9104 optional string package_name = 1;
9105 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009106 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009107 optional string installer_package_name = 4;
9108 enum Response {
9109 UNKNOWN = 0;
9110 ALLOWED = 1;
9111 REJECTED = 2;
9112 FORCE_ALLOWED = 3;
9113 }
9114 optional Response response = 5;
9115 // An estimate on the cause of the response. This will only be populated for
9116 // REJECTED and FORCE_ALLOWED
9117 optional bool caused_by_app_cert_rule = 6;
9118 optional bool caused_by_installer_rule = 7;
9119}
9120
9121/**
9122 * Logs the information about the rules and the provider whenever rules are
9123 * pushed into AppIntegrityManager.
9124 *
9125 * Logged from:
9126 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9127 */
9128message IntegrityRulesPushed {
9129 optional bool success = 1;
9130 // Package name of the app that pushed the rules.
9131 optional string rule_provider = 2;
9132 // Version string of arbitrary format provided by the rule provider to
9133 // identify the rules.
9134 optional string rule_version = 3;
9135}
Jordan Liubedfa702019-12-20 15:08:45 -08009136
9137/**
9138 * Logs when a cell broadcast message is received on the device.
9139 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009140 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009141 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009142 * packages/apps/CellBroadcastReceiver/
9143 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009144 */
9145message CellBroadcastMessageReported {
9146 // The type of Cell Broadcast message
9147 enum CbType {
9148 UNKNOWN_TYPE = 0;
9149 GSM = 1;
9150 CDMA = 2;
9151 CDMA_SPC = 3;
9152 }
9153
Jordan Liu900e5cb2020-05-29 09:44:59 -07009154 // The parts of the cell broadcast message pipeline
9155 enum ReportSource {
9156 UNKNOWN_SOURCE = 0;
9157 FRAMEWORK = 1;
9158 CB_SERVICE = 2;
9159 CB_RECEIVER_APP = 3;
9160 }
9161
Jordan Liubedfa702019-12-20 15:08:45 -08009162 // GSM, CDMA, CDMA-SCP
9163 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009164
9165 // The source of the report
9166 optional ReportSource source = 2;
9167}
9168
9169/**
9170 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9171 *
9172 * Logged from CellBroadcastService module:
9173 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9174 */
9175message CellBroadcastMessageFiltered {
9176 enum FilterReason {
9177 NOT_FILTERED = 0;
9178 DUPLICATE_MESSAGE = 1;
9179 GEOFENCED_MESSAGE = 2;
9180 AREA_INFO_MESSAGE = 3;
9181 }
9182
9183 // GSM, CDMA, CDMA-SCP
9184 optional CellBroadcastMessageReported.CbType type = 1;
9185
9186 // The source of the report
9187 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009188}
9189
9190/**
9191 * Logs when an error occurs while handling a cell broadcast message;
9192 *
9193 * Logged from CellBroadcastService module:
9194 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9195 */
9196message CellBroadcastMessageError {
9197 // The type of error raised when trying to handle a cell broadcast message
9198 enum ErrorType {
9199 UNKNOWN_TYPE = 0;
9200 CDMA_DECODING_ERROR = 1;
9201 CDMA_SCP_EMPTY = 2;
9202 CDMA_SCP_HANDLING_ERROR = 3;
9203 GSM_INVALID_HEADER_LENGTH = 4;
9204 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9205 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9206 GSM_INVALID_PDU = 7;
9207 GSM_INVALID_GEO_FENCING_DATA = 8;
9208 GSM_UMTS_INVALID_WAC = 9;
9209 FAILED_TO_INSERT_TO_DB = 10;
9210 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9211 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9212 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9213 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009214 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009215 }
9216
9217 // What kind of error occurred
9218 optional ErrorType type = 1;
9219
9220 // Exception message (or log message) associated with the error (max 1000 chars)
9221 optional string exception_message = 2;
9222}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009223
9224/**
Henry Fange316ab62020-04-21 18:43:14 -07009225 * Logs when a tune occurs through device's Frontend.
9226 * This is atom ID 276.
9227 *
9228 * Logged from:
9229 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9230 */
9231message TvTunerStateChanged {
9232 enum State {
9233 UNKNOWN = 0;
9234 TUNING = 1; // Signal is tuned
9235 LOCKED = 2; // the signal is locked
9236 NOT_LOCKED = 3; // the signal isn’t locked.
9237 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9238 SCANNING = 5; // the signal is scanned
9239 SCAN_STOPPED = 6; // the scan is stopped.
9240 }
9241 // The uid of the application that sent this custom atom.
9242 optional int32 uid = 1 [(is_uid) = true];
9243 // new state
9244 optional State state = 2;
9245}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009246
9247/**
9248 * Logs the status of a dvr playback or record.
9249 * This is atom ID 279.
9250 *
9251 * Logged from:
9252 * frameworks/base/media/java/android/media/tv/tuner/dvr
9253 */
9254message TvTunerDvrStatus {
9255 enum Type {
9256 UNKNOWN_TYPE = 0;
9257 PLAYBACK = 1; // is a playback
9258 RECORD = 2; // is a record
9259 }
9260 enum State {
9261 UNKNOWN_STATE = 0;
9262 STARTED = 1; // DVR is started
9263 STOPPED = 2; // DVR is stopped
9264 }
9265 // The uid of the application that sent this custom atom.
9266 optional int32 uid = 1 [(is_uid) = true];
9267 // DVR type
9268 optional Type type = 2;
9269 // DVR state
9270 optional State state = 3;
9271 // Identify the segment of a record or playback
9272 optional int32 segment_id = 4;
9273 // indicate how many overflow or underflow happened between started to stopped
9274 optional int32 overflow_underflow_count = 5;
9275}
Henry Fange316ab62020-04-21 18:43:14 -07009276/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009277 * Logs when an app is frozen or unfrozen.
9278 *
9279 * Logged from:
9280 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9281 */
9282message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009283 // The type of event.
9284 enum Action {
9285 UNKNOWN = 0;
9286 FREEZE_APP = 1;
9287 UNFREEZE_APP = 2;
9288 }
9289 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009290
Blake Kragten6ce382a2020-01-16 20:20:46 -08009291 // Pid of the process being frozen.
9292 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009293
Blake Kragten6ce382a2020-01-16 20:20:46 -08009294 // Name of the process being frozen.
9295 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009296
Blake Kragten6ce382a2020-01-16 20:20:46 -08009297 // Time since last unfrozen.
9298 optional int64 time_unfrozen_millis = 4;
9299}
9300
9301/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009302 * Pulls information for a single voice call.
9303 *
9304 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9305 *
9306 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009307 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009308 */
9309message VoiceCallSession {
9310 // Bearer (IMS or CS) when the call started.
9311 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9312
9313 // Bearer (IMS or CS) when the call ended.
9314 // The bearer may change during the call, e.g. due to SRVCC.
9315 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9316
9317 // Direction of the call (incoming or outgoing).
9318 optional android.telephony.CallDirectionEnum direction = 3;
9319
9320 // Time spent setting up the call.
9321 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9322
9323 // Whether the call ended before the setup was completed.
9324 optional bool setup_failed = 5;
9325
9326 // IMS reason code or CS disconnect cause.
9327 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9328 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9329 optional int32 disconnect_reason_code = 6;
9330
9331 // IMS extra code or CS precise disconnect cause.
9332 // For IMS, this code is vendor-specific
9333 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9334 optional int32 disconnect_extra_code = 7;
9335
9336 // IMS extra message or CS vendor cause.
9337 optional string disconnect_extra_message = 8;
9338
9339 // Radio access technology (RAT) used when call started.
9340 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9341
9342 // Radio access technology (RAT) used when call terminated.
9343 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9344
9345 // Number of times RAT changed during the call.
9346 optional int64 rat_switch_count = 11;
9347
9348 // A bitmask of all codecs used during the call.
9349 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9350 optional int64 codec_bitmask = 12;
9351
9352 // Number of other calls going on during call setup, for the same SIM slot.
9353 optional int32 concurrent_call_count_at_start = 13;
9354
9355 // Number of other calls going on during call termination, for the same SIM slot.
9356 optional int32 concurrent_call_count_at_end = 14;
9357
9358 // Index of the SIM is used, 0 for single-SIM devices.
9359 optional int32 sim_slot_index = 15;
9360
9361 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9362 optional bool is_multi_sim = 16;
9363
9364 // Whether the call was made with an eSIM profile.
9365 optional bool is_esim = 17;
9366
9367 // Carrier ID of the SIM card.
9368 // See https://source.android.com/devices/tech/config/carrierid.
9369 optional int32 carrier_id = 18;
9370
Chi Zhangba1b03a2020-04-21 17:17:56 -07009371 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009372 optional bool srvcc_completed = 19;
9373
9374 // Number of SRVCC failures.
9375 optional int64 srvcc_failure_count = 20;
9376
9377 // Number of SRVCC cancellations.
9378 optional int64 srvcc_cancellation_count = 21;
9379
Chi Zhangba1b03a2020-04-21 17:17:56 -07009380 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9381 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009382 optional bool rtt_enabled = 22;
9383
9384 // Whether this was an emergency call.
9385 optional bool is_emergency = 23;
9386
9387 // Whether the call was performed while roaming.
9388 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009389
9390 // A random number used as the dimension field to pull multiple atoms.
9391 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009392}
9393
9394/**
9395 * Pulls voice call radio access technology (RAT) usage.
9396 *
9397 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9398 * time. The atom will be skipped if not enough data is available.
9399 *
9400 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009401 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009402 */
9403message VoiceCallRatUsage {
9404 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9405 optional int32 carrier_id = 1;
9406
9407 // Radio access technology.
9408 optional android.telephony.NetworkTypeEnum rat = 2;
9409
9410 // Total duration that voice calls spent on this carrier and RAT.
9411 optional int64 total_duration_seconds = 3;
9412
9413 // Total number of calls using this carrier and RAT.
9414 // A call is counted once even if it used the RAT multiple times.
9415 optional int64 call_count = 4;
9416}
9417
9418/**
9419 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9420 *
9421 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009422 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009423 */
9424message SimSlotState {
9425 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9426 optional int32 active_slot_count = 1;
9427
9428 // Number of SIM cards (both physical and active eSIM profiles).
9429 // This number is always equal to or less than the number of active SIM slots.
9430 optional int32 sim_count = 2;
9431
9432 // Number of active eSIM profiles.
9433 // This number is always equal to or less than the number of SIMs.
9434 optional int32 esim_count = 3;
9435}
9436
9437/**
9438 * Pulls supported cellular radio access technologies.
9439 *
9440 * This atom reports the capabilities of the device, rather than the network it has access to.
9441 *
9442 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009443 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009444 */
9445message SupportedRadioAccessFamily {
9446 // A bitmask of supported radio technologies.
9447 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9448 optional int64 network_type_bitmask = 1;
9449}
9450
9451/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009452 * Logs gnss stats from location service provider
9453 *
9454 * Pulled from:
9455 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9456 */
9457
9458message GnssStats {
9459 // Number of location reports since boot
9460 optional int64 location_reports = 1;
9461
9462 // Total pulled reports of Location failures since boot
9463 optional int64 location_failure_reports = 2;
9464
9465 // Number of time to first fix reports since boot
9466 optional int64 time_to_first_fix_reports = 3;
9467
9468 // Total pulled reported time to first fix (in milli-seconds) since boot
9469 optional int64 time_to_first_fix_milli_s = 4;
9470
9471 // Number of position accuracy reports since boot
9472 optional int64 position_accuracy_reports = 5;
9473
9474 // Total pulled reported position accuracy (in meters) since boot
9475 optional int64 position_accuracy_meters = 6;
9476
9477 // Number of top 4 average CN0 reports since boot
9478 optional int64 top_four_average_cn0_reports = 7;
9479
9480 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9481 optional int64 top_four_average_cn0_db_mhz = 8;
9482
9483 // Number of l5 top 4 average CN0 reports since boot
9484 optional int64 l5_top_four_average_cn0_reports = 9;
9485
9486 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9487 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9488
9489 // Total number of sv status messages reports since boot
9490 optional int64 sv_status_reports = 11;
9491
9492 // Total number of sv status messages reports, where sv is used in fix since boot
9493 optional int64 sv_status_reports_used_in_fix = 12;
9494
9495 // Total number of L5 sv status messages reports since boot
9496 optional int64 l5_sv_status_reports = 13;
9497
9498 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9499 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009500}
Kweku Adams12752132020-02-18 15:36:48 -08009501
9502/**
9503 * Logs when an app is moved to a different standby bucket.
9504 *
9505 * Logged from:
9506 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9507 */
9508message AppStandbyBucketChanged {
9509 optional string package_name = 1;
9510
9511 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9512 optional int32 user_id = 2;
9513
9514 // These enum values match the constants defined in UsageStatsManager.java.
9515 enum Bucket {
9516 BUCKET_UNKNOWN = 0;
9517 BUCKET_EXEMPTED = 5;
9518 BUCKET_ACTIVE = 10;
9519 BUCKET_WORKING_SET = 20;
9520 BUCKET_FREQUENT = 30;
9521 BUCKET_RARE = 40;
9522 BUCKET_RESTRICTED = 45;
9523 BUCKET_NEVER = 50;
9524 }
9525 optional Bucket bucket = 3;
9526
9527 enum MainReason {
9528 MAIN_UNKNOWN = 0;
9529 MAIN_DEFAULT = 0x0100;
9530 MAIN_TIMEOUT = 0x0200;
9531 MAIN_USAGE = 0x0300;
9532 MAIN_FORCED_BY_USER = 0x0400;
9533 MAIN_PREDICTED = 0x0500;
9534 MAIN_FORCED_BY_SYSTEM = 0x0600;
9535 }
9536 optional MainReason main_reason = 4;
9537
9538 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9539 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9540 // UsageStatsManager.java.
9541 optional int32 sub_reason = 5;
9542}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009543
9544/**
9545* Reports a started sharesheet transaction.
9546*
9547* Logged from:
9548* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9549*/
9550message SharesheetStarted {
9551 // The event_id (as for UiEventReported).
9552 optional int32 event_id = 1;
9553 // The calling app's package name.
9554 optional string package_name = 2;
9555 // An identifier to tie together multiple logs relating to the same share event
9556 optional int32 instance_id = 3;
9557 // The mime type of the share
9558 optional string mime_type = 4;
9559 // The number of direct targets the calling app is providing that will be shown.
9560 optional int32 num_app_provided_direct_targets = 5;
9561 // The number of app targets the calling app is providing that will be shown.
9562 optional int32 num_app_provided_app_targets = 6;
9563 // True if the share originates from the workprofile
9564 optional bool is_workprofile = 7;
9565
9566 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009567 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009568 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9569 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9570 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9571 }
9572 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009573 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009574
9575 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9576 INTENT_DEFAULT = 0;
9577 INTENT_ACTION_VIEW = 1;
9578 INTENT_ACTION_EDIT = 2;
9579 INTENT_ACTION_SEND = 3;
9580 INTENT_ACTION_SENDTO = 4;
9581 INTENT_ACTION_SEND_MULTIPLE = 5;
9582 INTENT_ACTION_IMAGE_CAPTURE = 6;
9583 INTENT_ACTION_MAIN = 7;
9584 }
9585 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009586 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009587}
9588
9589/**
9590 * Reports a ranking selection event.
9591 *
9592 * Logged from:
9593 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9594 */
9595message RankingSelected {
9596 // The event_id (as for UiEventReported).
9597 optional int32 event_id = 1;
9598 // The relevant app's package name (can be source or picked package).
9599 optional string package_name = 2;
9600 // An identifier to tie together multiple logs relating to the same share event.
9601 optional int32 instance_id = 3;
9602 // Which of the ranked targets got picked, default starting position 0.
9603 optional int32 position_picked = 4;
9604}
Raff Tsaiea4db182020-03-06 07:45:43 +08009605
9606/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009607 * Logs when TvSettings UI is interacted at.
9608 *
9609 * Logged from: packages/apps/TvSettings
9610 */
9611message TvSettingsUIInteracted {
9612
9613 /** The UI action category */
9614 optional android.app.tvsettings.Action action = 1;
9615
9616 /** The ID of the entry that the users actioned on */
9617 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009618}
9619
9620/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009621 * Logs information about a package installation using package installer V2 APIs.
9622 *
9623 * Logged from:
9624 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9625 */
9626message PackageInstallerV2Reported {
9627 // Whether this installation uses Incremental File System
9628 optional bool is_incremental = 1;
9629 // Name of the package that is intended to be installed
9630 optional string package_name = 2;
9631 // The duration between when the install was requested to when the install has completed
9632 optional int64 duration_millis = 3;
9633 // Installation result in final integer, which are SystemApi's.
9634 // Return_code 1 indicates success.
9635 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9636 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009637 // Total size of the APKs installed for this package
9638 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009639}
9640
9641/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009642 * Logs settings provider values.
9643 *
9644 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9645 * then write the value to proto.
9646 *
9647 */
9648message SettingSnapshot {
9649
9650 // Setting key
9651 optional string name = 1;
9652
9653 enum SettingsValueType {
9654 NOTASSIGNED = 0;
9655 ASSIGNED_BOOL_TYPE = 1;
9656 ASSIGNED_INT_TYPE = 2;
9657 ASSIGNED_FLOAT_TYPE = 3;
9658 ASSIGNED_STRING_TYPE = 4;
9659 };
9660 // Setting value type
9661 optional SettingsValueType type = 2;
9662
9663 optional bool bool_value = 3;
9664
9665 optional int32 int_value = 4;
9666
9667 optional float float_value = 5;
9668
9669 optional string str_value = 6;
9670
9671 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9672 optional int32 user_id = 7;
9673}
Varun Shahacb56342019-12-18 11:45:38 -08009674
9675/**
9676 * An event logged to indicate that a user journey is about to be performed. This atom includes
9677 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9678 * will immediately follow this atom which will describe the event(s) and its state.
9679 *
9680 * Logged from:
9681 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9682 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9683 */
9684message UserLifecycleJourneyReported {
9685 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9686 // UserLifecycleEventOccurred atom)
9687 optional int64 session_id = 1;
9688
9689 // Indicates what type of user journey this session is related to
9690 enum Journey {
9691 UNKNOWN = 0; // Undefined user lifecycle journey
9692 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9693 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9694 USER_START = 3; // A user start journey
9695 USER_CREATE = 4; // A user creation journey
9696 }
9697 optional Journey journey = 2;
9698 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9699 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9700 optional int32 origin_user = 3;
9701 // Which user the journey is targeting
9702 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9703 optional int32 target_user = 4;
9704
9705 // What is the user type of the target user
9706 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9707 enum UserType {
9708 TYPE_UNKNOWN = 0;
9709 FULL_SYSTEM = 1;
9710 FULL_SECONDARY = 2;
9711 FULL_GUEST = 3;
9712 FULL_DEMO = 4;
9713 FULL_RESTRICTED = 5;
9714 PROFILE_MANAGED = 6;
9715 SYSTEM_HEADLESS = 7;
9716 }
9717 optional UserType user_type = 5;
9718 // What are the flags attached to the target user
9719 optional int32 user_flags = 6;
9720}
9721
9722/**
9723 * An event logged when a specific user lifecycle event is performed. These events should be
9724 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9725 * Note: journeys can span over multiple events, hence some events may share a single session id.
9726 *
9727 * Logged from:
9728 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9729 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9730 */
9731message UserLifecycleEventOccurred {
9732 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9733 optional int64 session_id = 1;
9734 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9735 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9736 optional int32 user_id = 2;
9737
9738 enum Event {
9739 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9740 SWITCH_USER = 1; // Indicates that this is a user switch event
9741 START_USER = 2; // Indicates that this is a user start event
9742 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -07009743 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
9744 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
9745 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -08009746 }
9747 optional Event event = 3;
9748
9749 enum State {
9750 NONE = 0; // Indicates the associated event has no start/end defined
9751 BEGIN = 1;
9752 FINISH = 2;
9753 }
9754 optional State state = 4; // Represents the state of an event (beginning/ending)
9755}
jasonwshsu81173e32020-03-27 15:22:03 +08009756
9757/**
9758 * Logs when accessibility shortcut clicked.
9759 *
9760 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009761 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009762 */
9763message AccessibilityShortcutReported {
9764 // The accessibility feature(including installed a11y service, framework a11y feature,
9765 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9766 optional string package_name = 1;
9767
9768 // The definition of the accessibility shortcut.
9769 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9770 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9771
9772 // The definition of the service status.
9773 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9774 optional android.stats.accessibility.ServiceStatus service_status = 3;
9775}
9776
9777/**
9778 * Logs when accessibility service status changed.
9779 *
9780 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009781 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009782 */
9783message AccessibilityServiceReported {
9784 // The accessibility service package name.
9785 optional string package_name = 1;
9786
9787 // The definition of the service status.
9788 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9789 optional android.stats.accessibility.ServiceStatus service_status = 2;
9790}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009791
Denny cy Lee57b31282020-04-17 10:08:52 +08009792message DisplayWakeReason {
9793 // Wake_up_reason code
9794 // If LOWORD(wake_up_reason) = 0
9795 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9796 // else reference wake_up_reason to
9797 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9798 optional int32 wake_up_reason = 1;
9799 // Count of wake up by reason
9800 optional int32 wake_times = 2;
9801}
9802
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009803/**
9804 * Logs app usage events.
9805 */
9806message AppUsageEventOccurred {
9807 optional int32 uid = 1 [(is_uid) = true];
9808 optional string package_name = 2;
9809 optional string class_name = 3;
9810
9811 enum EventType {
9812 NONE = 0;
9813 MOVE_TO_FOREGROUND = 1;
9814 MOVE_TO_BACKGROUND = 2;
9815 }
9816 optional EventType event_type = 4;
9817}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009818
9819/*
9820 * Quality metrics logged when EVS cameras are active.
9821 *
9822 * Logged from:
9823 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9824 */
9825message EvsUsageStatsReported {
9826
9827 // Camera identifier to distinguish the source camera device. This is not
9828 // globally unique and therefore cannot be used to identify the user and/or
9829 // the device.
9830 optional int32 device_id = 1;
9831
9832 // Peak number of clients during the service
9833 optional int32 peak_num_clients = 2;
9834
9835 // Number of erroneous events during the service
9836 optional int32 num_errors = 3;
9837
9838 // Round trip latency of the very first frame
9839 optional int64 first_latency_millis = 4;
9840
9841 // Average frame round trip latency
9842 optional float avg_latency_millis = 5;
9843
9844 // Peak frame round trip latency
9845 optional int64 peak_latency_millis = 6;
9846
9847 // Total number of frames received
9848 optional int64 total_frames = 7;
9849
9850 // Number of frames ignored
9851 optional int64 ignored_frames = 8;
9852
9853 // Number of dropped frames to synchronize camera devices
9854 optional int64 dropped_frames_to_sync = 9;
9855
9856 // The duration of the service
9857 optional int64 duration_millis = 10;
9858}
Robert Leecccdc152020-04-23 13:22:46 +08009859
9860/**
9861 * Logs audio power usage stats.
9862 *
9863 * Pushed from:
9864 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9865 */
9866message AudioPowerUsageDataReported {
9867 /**
9868 * Device used for input/output
9869 *
9870 * All audio devices please refer to below file:
9871 * system/media/audio/include/system/audio-base.h
9872 *
9873 * Define our own enum values because we don't report all audio devices.
9874 * Currently, we only report built-in audio devices such as handset, speaker,
9875 * built-in mics, common audio devices such as wired headset, usb headset
9876 * and bluetooth devices.
9877 */
9878 enum AudioDevice {
9879 OUTPUT_EARPIECE = 0x1; // handset
9880 OUTPUT_SPEAKER = 0x2; // dual speaker
9881 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9882 OUTPUT_USB_HEADSET = 0x8; // usb headset
9883 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9884 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9885 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9886
9887 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9888 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9889 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9890 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9891 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9892 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9893 }
9894 optional AudioDevice audio_device = 1;
9895
9896 // Duration of the audio in seconds
9897 optional int32 duration_secs = 2;
9898
9899 // Average volume (0 ... 1.0)
9900 optional float average_volume = 3;
9901
9902 enum AudioType {
9903 UNKNOWN_TYPE = 0;
9904 VOICE_CALL_TYPE = 1; // voice call
9905 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9906 MEDIA_TYPE = 3; // music and system sound
9907 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9908 ALARM_TYPE = 5; // alarm type
9909 // record type
9910 CAMCORDER_TYPE = 6; // camcorder
9911 RECORD_TYPE = 7; // other recording
9912 }
9913 optional AudioType type = 4;
9914}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009915
9916/**
9917 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9918 *
9919 * Pulled from:
9920 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9921 */
9922message BytesTransferByTagAndMetered {
9923 optional int32 uid = 1 [(is_uid) = true];
9924
9925 optional bool is_metered = 2;
9926
9927 optional int32 tag = 3;
9928
9929 optional int64 rx_bytes = 4;
9930
9931 optional int64 rx_packets = 5;
9932
9933 optional int64 tx_bytes = 6;
9934
9935 optional int64 tx_packets = 7;
9936}
Robert Luo2f52f042020-05-11 16:39:24 +08009937
9938/*
9939 * Logs when the Media Output Switcher finishes a media switch operation.
9940 *
9941 * Logged from:
9942 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9943 */
9944message MediaOutputOpSwitchReported {
9945 // Source medium type before switching.
9946 optional android.app.settings.mediaoutput.MediumType source = 1;
9947
9948 // Target medium type after switching.
9949 optional android.app.settings.mediaoutput.MediumType target = 2;
9950
9951 // The result of switching.
9952 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9953
9954 // The detail code of a switching result.
9955 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9956
9957 /*
9958 * The package name of a pre-installed app, whose media session is being switched.
9959 */
9960 optional string media_session_package_name = 5;
9961
9962 // The amount of available wired devices when a switching is being performed.
9963 optional int32 available_wired_device_count = 6;
9964
9965 // The amount of available Bluetooth devices a switching is being performed.
9966 optional int32 available_bt_device_count = 7;
9967
9968 // The amount of available remote devices when a switching is being performed.
9969 optional int32 available_remote_device_count = 8;
9970
9971 // The amount of applied devices within a remote dynamic group after a switching is done.
9972 optional int32 applied_device_count_within_remote_group = 9;
9973}