blob: 4aef504562b73bf4aa7e355e12869f35535f48fc [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"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000447 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700448
449 // StatsdStats tracks platform atoms with ids upto 500.
450 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000451 }
David Chenc8a43242017-10-17 16:23:28 -0700452
David Chen6e3e6cb2018-01-03 16:14:06 -0800453 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700454 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700455 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800456 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
457 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700458 MobileBytesTransfer mobile_bytes_transfer =
459 10002 [(module) = "framework", (truncate_timestamp) = true];
460 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
461 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800462 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
463 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700464 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700466 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800467 CpuTimePerUidFreq cpu_time_per_uid_freq =
468 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
470 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
471 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
472 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
473 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700474 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700475 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700476 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700477 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800478 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
479 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700480 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800481 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800482 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800483 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800484 DiskStats disk_stats = 10025 [(module) = "framework"];
485 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
486 AppSize app_size = 10027 [(module) = "framework"];
487 CategorySize category_size = 10028 [(module) = "framework"];
488 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800489 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800490 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
491 DiskIo disk_io = 10032 [(module) = "framework"];
492 PowerProfile power_profile = 10033 [(module) = "framework"];
493 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
494 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
495 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700496 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800497 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
498 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
499 10040 [(module) = "framework"];
500 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
501 10041 [(module) = "framework"];
502 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800503 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800504 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800505 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800506 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
507 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
508 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
509 RoleHolder role_holder = 10049 [(module) = "framework"];
510 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800511 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800512 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
513 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800514 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
515 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800516 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
517 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
518 FaceSettings face_settings = 10058 [(module) = "framework"];
519 CoolingDevice cooling_device = 10059 [(module) = "framework"];
520 AppOps app_ops = 10060 [(module) = "framework"];
521 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700522 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
523 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800524 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800525 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
527 DangerousPermissionStateSampled dangerous_permission_state_sampled =
528 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400529 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000530 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000531 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200532 PackageNotificationPreferences package_notification_preferences =
533 10071 [(module) = "framework"];
534 PackageNotificationChannelPreferences package_notification_channel_preferences =
535 10072 [(module) = "framework"];
536 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
537 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800538 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800539 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700540 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
541 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
542 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
543 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800544 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800545 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800546 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700547 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
548 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700549 }
yroa1fe77c2018-02-26 14:22:54 -0800550
Bookatz76aafcf2018-09-17 16:17:10 -0700551 // DO NOT USE field numbers above 100,000 in AOSP.
552 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
553 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100554
555 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700556}
557
Yao Chend54f9dd2017-10-17 17:37:48 +0000558/**
Yangster-mac20877162017-12-22 17:19:39 -0800559 * This proto represents a node of an attribution chain.
560 * Note: All attribution chains are represented as a repeated field of type
561 * AttributionNode. It is understood that in such arrays, the order is that
562 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000563 */
Yangster-mac20877162017-12-22 17:19:39 -0800564message AttributionNode {
565 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800566 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800567
Yangster-mac20877162017-12-22 17:19:39 -0800568 // The (optional) string tag for an element in the attribution chain. If the
569 // element has no tag, it is encoded as an empty string.
570 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700571}
572
Yangster-mac48b3d622018-08-18 12:38:11 -0700573message KeyValuePair {
574 optional int32 key = 1;
575 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700576 int32 value_int = 2;
577 int64 value_long = 3;
578 string value_str = 4;
579 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700580 }
581}
582
583message KeyValuePairsAtom {
584 optional int32 uid = 1;
585 repeated KeyValuePair pairs = 2;
586}
587
Yao Chend54f9dd2017-10-17 17:37:48 +0000588/*
589 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800590 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000591 *
592 * RULES:
593 * - The field ids for each atom must start at 1, and count upwards by 1.
594 * Skipping field ids is not allowed.
595 * - These form an API, so renaming, renumbering or removing fields is
596 * not allowed between android releases. (This is not currently enforced,
597 * but there will be a tool to enforce this restriction).
598 * - The types must be built-in protocol buffer types, namely, no sub-messages
599 * are allowed (yet). The bytes type is also not allowed.
600 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800601 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000602 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800603 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000604 * - A field that is a uid should be a string field, tagged with the [xxx]
605 * annotation. The generated code on android will be represented by UIDs,
606 * and those UIDs will be translated in xxx to those strings.
607 *
608 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700609 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000610 * - If there is a UID, it goes first. Think in an object-oriented fashion.
611 * *****************************************************************************
612 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700613
Yao Chend54f9dd2017-10-17 17:37:48 +0000614/**
Tej Singha72344992019-04-17 18:55:08 -0700615 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700616 * Logs when the Thermal service HAL notifies the throttling start/stop events.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
620 */
621message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700622 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700623 optional android.os.TemperatureTypeEnum sensor_type = 1;
624
Maggie White442b6312019-04-05 16:26:44 -0700625 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700626 enum State {
627 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700628 START = 1; // START indicated that throttling was triggered.
629 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700630 }
Yangster-mace16189a2018-08-26 12:20:16 -0700631 optional State state = 2;
632
633 optional float temperature = 3;
634}
635
636/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000637 * Logs when the screen state changes.
638 *
639 * Logged from:
640 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
641 */
642message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800643 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800644 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700645 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700646}
Yao Chend54f9dd2017-10-17 17:37:48 +0000647
648/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700649 * Logs that the process state of the uid, as determined by ActivityManager
650 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000651 *
652 * Logged from:
653 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
654 */
Bookatzc1a050a2017-10-10 15:49:28 -0700655message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700656 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000657
Bookatzdb026a22018-01-10 19:01:56 -0800658 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800659 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700660 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000661}
662
663/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700664 * Logs process state change of a process, as per the activity manager.
665 *
666 * Logged from:
667 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
668 */
669message ProcessStateChanged {
670 optional int32 uid = 1;
671 optional string process_name = 2;
672 optional string package_name = 3;
673 // TODO: remove this when validation is done
674 optional int64 version = 5;
675 // The state, from frameworks/base/core/proto/android/app/enums.proto.
676 optional android.app.ProcessStateEnum state = 4;
677}
678
679/**
680 * Logs when ActivityManagerService sleep state is changed.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
684 */
685message ActivityManagerSleepStateChanged {
686 // TODO: import frameworks proto
687 enum State {
688 UNKNOWN = 0;
689 ASLEEP = 1;
690 AWAKE = 2;
691 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700692 optional State state = 1
693 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700694}
695
696/**
697 * Logs when system memory state changes.
698 *
699 * Logged from:
700 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
701 */
702message MemoryFactorStateChanged {
703 // TODO: import frameworks proto
704 enum State {
705 MEMORY_UNKNOWN = 0;
706 NORMAL = 1; // normal.
707 MODERATE = 2; // moderate memory pressure.
708 LOW = 3; // low memory.
709 CRITICAL = 4; // critical memory.
710
711 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700712 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700713}
714
715/**
716 * Logs when app is using too much cpu, according to ActivityManagerService.
717 *
718 * Logged from:
719 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
720 */
721message ExcessiveCpuUsageReported {
722 optional int32 uid = 1;
723 optional string process_name = 2;
724 optional string package_name = 3;
725 // package version. TODO: remove this when validation is done
726 optional int64 version = 4;
727}
728
729/**
730 * Logs when a cached process is killed, along with its pss.
731 *
732 * Logged from:
733 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
734 */
735message CachedKillReported {
736 optional int32 uid = 1;
737 optional string process_name = 2;
738 optional string package_name = 3;
739 // TODO: remove this when validation is done
740 optional int64 version = 5;
741 optional int64 pss = 4;
742}
743
744/**
xshu2c3d9e42019-09-26 17:54:02 -0700745 * Logs the change in wifi health.
746 *
747 * Logged from:
748 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
749 */
750message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800751 enum Band {
752 UNKNOWN = 0;
753 // All of 2.4GHz band
754 BAND_2G = 1;
755 // Frequencies in the range of [5150, 5250) GHz
756 BAND_5G_LOW = 2;
757 // Frequencies in the range of [5250, 5725) GHz
758 BAND_5G_MIDDLE = 3;
759 // Frequencies in the range of [5725, 5850) GHz
760 BAND_5G_HIGH = 4;
761 // Frequencies in the range of [5925, 6425) GHz
762 BAND_6G_LOW = 5;
763 // Frequencies in the range of [6425, 6875) GHz
764 BAND_6G_MIDDLE = 6;
765 // Frequencies in the range of [6875, 7125) GHz
766 BAND_6G_HIGH = 7;
767 }
xshu2c3d9e42019-09-26 17:54:02 -0700768 // duration this stat is obtained over in milliseconds
769 optional int32 duration_millis = 1;
770 // whether wifi is classified as sufficient for the user's data traffic, determined
771 // by whether the calculated throughput exceeds the average demand within |duration_millis|
772 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700773 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800774 optional bool is_cell_data_available = 3;
775 // the Band bucket the connected network is on
776 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700777}
778
779/**
780 * Logged when wifi detects a significant change in connection failure rate.
781 *
782 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
783 *
784 */
785message WifiFailureStatReported {
786 enum AbnormalityType {
787 UNKNOWN = 0;
788 SIGNIFICANT_INCREASE = 1;
789 SIGNIFICANT_DECREASE = 2;
790 SIMPLY_HIGH = 3;
791 }
792 enum FailureType {
793 FAILURE_UNKNOWN = 0;
794 FAILURE_CONNECTION = 1;
795 FAILURE_ASSOCIATION_REJECTION = 2;
796 FAILURE_ASSOCIATION_TIMEOUT = 3;
797 FAILURE_AUTHENTICATION = 4;
798 FAILURE_NON_LOCAL_DISCONNECTION = 5;
799 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
800 }
801 // Reason for uploading this stat
802 optional AbnormalityType abnormality_type = 1;
803 // The particular type of failure
804 optional FailureType failure_type = 2;
805 // How many times we have encountered this combination of AbnormalityType and FailureType
806 optional int32 failure_count = 3;
807}
808
809/**
810 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
811 *
812 * Logged from:
813 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
814 */
815message WifiConnectionResultReported {
816 enum FailureCode {
817 FAILURE_UNKNOWN = 0;
818 FAILURE_ASSOCIATION_TIMEOUT = 1;
819 FAILURE_ASSOCIATION_REJECTION = 2;
820 FAILURE_AUTHENTICATION_GENERAL = 3;
821 FAILURE_AUTHENTICATION_EAP = 4;
822 FAILURE_DHCP = 5;
823 FAILURE_NETWORK_DISCONNECTION = 6;
824 FAILURE_ROAM_TIMEOUT = 7;
825 }
826 // true represents a successful connection
827 optional bool connection_result = 1;
828 // reason for the connection failure
829 optional FailureCode failure_code = 2;
830 // scan rssi before the connection attempt
831 optional int32 rssi = 3;
832}
833
834/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700835 * Logs when memory stats of a process is reported.
836 *
837 * Logged from:
838 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
839 */
840message ProcessMemoryStatReported {
841 optional int32 uid = 1;
842 optional string process_name = 2;
843 optional string package_name = 3;
844 //TODO: remove this when validation is done
845 optional int64 version = 9;
846 optional int64 pss = 4;
847 optional int64 uss = 5;
848 optional int64 rss = 6;
849 enum Type {
850 ADD_PSS_INTERNAL_SINGLE = 0;
851 ADD_PSS_INTERNAL_ALL_MEM = 1;
852 ADD_PSS_INTERNAL_ALL_POLL = 2;
853 ADD_PSS_EXTERNAL = 3;
854 ADD_PSS_EXTERNAL_SLOW = 4;
855 }
856 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800857 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700858}
859
860/**
Bookatzc1a050a2017-10-10 15:49:28 -0700861 * Logs that a process started, finished, crashed, or ANRed.
862 *
863 * Logged from:
864 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
865 */
866message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700867 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700868
David Chen0b5c90c2018-01-25 16:51:49 -0800869 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800870 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700871
Bookatzddccf0a2017-11-28 16:48:14 -0800872 // What lifecycle state the process changed to.
873 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800874 enum State {
875 FINISHED = 0;
876 STARTED = 1;
877 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800878 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800879 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700880}
881
Bookatzc1a050a2017-10-10 15:49:28 -0700882/**
883 * Logs when the ble scan state changes.
884 *
885 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700886 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700887 */
888message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800889 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700890 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700891
892 enum State {
893 OFF = 0;
894 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700895 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
896 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700897 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800898 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700899 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800900 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700901 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800902 (state_field_option).nested = true
903 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700904
Bookatze5ec0b42018-03-26 13:34:56 -0700905 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700906 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700907 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700908 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700909 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700910 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700911}
912
913/**
914 * Logs reporting of a ble scan finding results.
915 *
916 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700917 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700918 */
Bookatzae6738e2018-09-13 11:38:56 -0700919// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700920message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800921 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700922
923 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800924 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700925}
926
927/**
928 * Logs when a sensor state changes.
929 *
930 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700931 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700932 */
933message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800934 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700935
Bookatzc1a050a2017-10-10 15:49:28 -0700936 // The id (int) of the sensor.
937 optional int32 sensor_id = 2;
938
939 enum State {
940 OFF = 0;
941 ON = 1;
942 }
943 optional State state = 3;
944}
945
Bookatzc1a050a2017-10-10 15:49:28 -0700946/**
947 * Logs when GPS state changes.
948 *
949 * Logged from:
950 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
951 */
952message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800953 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700954
955 enum State {
956 OFF = 0;
957 ON = 1;
958 }
959 optional State state = 2;
960}
961
Bookatz48d362e2018-11-06 15:49:08 -0800962/**
963 * Logs when GPS signal quality.
964 *
965 * Logged from:
966 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
967 */
968message GpsSignalQualityChanged {
969 optional android.server.location.GpsSignalQualityEnum level = 1;
970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972
973/**
974 * Logs when a sync manager sync state changes.
975 *
976 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700977 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700978 */
979message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800980 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700981
David Chen0b5c90c2018-01-25 16:51:49 -0800982 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800983 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700984
985 enum State {
986 OFF = 0;
987 ON = 1;
988 }
989 optional State state = 3;
990}
991
Yangster-mac96353002018-09-05 11:18:55 -0700992/*
993 * Deferred job stats.
994 *
995 * Logged from:
996 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
997*/
998message DeferredJobStatsReported {
999 repeated AttributionNode attribution_node = 1;
1000
1001 // Number of jobs deferred.
1002 optional int32 num_jobs_deferred = 2;
1003
1004 // Time since the last job runs.
1005 optional int64 time_since_last_job_millis = 3;
1006}
1007
Bookatzc1a050a2017-10-10 15:49:28 -07001008/**
1009 * Logs when a job scheduler job state changes.
1010 *
1011 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001012 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001013 */
1014message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001015 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001016
1017 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001018 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001019
1020 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001021 FINISHED = 0;
1022 STARTED = 1;
1023 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001024 }
1025 optional State state = 3;
1026
Tej Singh33a412b2018-03-16 18:43:59 -07001027 // The reason a job has stopped.
1028 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001029 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001030 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001031
1032 // The standby bucket of the app that scheduled the job. These match the framework constants
1033 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1034 // already assigned 0.
1035 enum Bucket {
1036 UNKNOWN = -1;
1037 ACTIVE = 0;
1038 WORKING_SET = 1;
1039 FREQUENT = 2;
1040 RARE = 3;
1041 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001042 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001043 }
1044 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1045
1046 // The job id (as assigned by the app).
1047 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001048
1049 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1050 // constraints as they are always assumed to be set.
1051 optional bool has_charging_constraint = 7;
1052 optional bool has_battery_not_low_constraint = 8;
1053 optional bool has_storage_not_low_constraint = 9;
1054 optional bool has_timing_delay_constraint = 10;
1055 optional bool has_deadline_constraint = 11;
1056 optional bool has_idle_constraint = 12;
1057 optional bool has_connectivity_constraint = 13;
1058 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001059}
1060
1061/**
1062 * Logs when the audio state changes.
1063 *
1064 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001065 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001066 */
1067message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001068 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 enum State {
1071 OFF = 0;
1072 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001073 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1074 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001075 }
1076 optional State state = 2;
1077}
1078
1079/**
1080 * Logs when the video codec state changes.
1081 *
1082 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001084 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001085message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001087
1088 enum State {
1089 OFF = 0;
1090 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001091 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1092 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001093 }
1094 optional State state = 2;
1095}
1096
1097/**
1098 * Logs when the flashlight state changes.
1099 *
1100 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001101 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001102 */
1103message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001104 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001105
1106 enum State {
1107 OFF = 0;
1108 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001109 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1110 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001111 }
1112 optional State state = 2;
1113}
1114
1115/**
1116 * Logs when the camera state changes.
1117 *
1118 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001119 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001120 */
1121message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001122 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001123
1124 enum State {
1125 OFF = 0;
1126 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001127 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1128 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001129 }
1130 optional State state = 2;
1131}
1132
1133/**
1134 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001135 *
1136 * Logged from:
1137 * TODO
1138 */
Bookatzd6746242017-10-24 18:39:35 -07001139message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001140 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001141 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001142
Bookatz1a1b0462018-01-12 11:47:03 -08001143 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1144 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001145 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001146
1147 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001148 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001149
1150 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001151 RELEASE = 0;
1152 ACQUIRE = 1;
1153 CHANGE_RELEASE = 2;
1154 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001155 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001156 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001157 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001158 (state_field_option).default_state_value = 0,
1159 (state_field_option).nested = true
1160 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001161}
1162
1163/**
Bookatzc1a050a2017-10-10 15:49:28 -07001164 * Logs when a partial wakelock is considered 'long' (over 1 min).
1165 *
1166 * Logged from:
1167 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1168 */
1169message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001170 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001171
Yao Chend54f9dd2017-10-17 17:37:48 +00001172 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1173 optional string tag = 2;
1174
Bookatzc1a050a2017-10-10 15:49:28 -07001175 // TODO: I have no idea what this is.
1176 optional string history_tag = 3;
1177
1178 enum State {
1179 OFF = 0;
1180 ON = 1;
1181 }
1182 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001183}
1184
Bookatzc1a050a2017-10-10 15:49:28 -07001185/**
Bookatza66083f2018-09-20 17:24:00 -07001186 * Logs when the device is interactive, according to the PowerManager Notifier.
1187 *
1188 * Logged from:
1189 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1190 */
1191message InteractiveStateChanged {
1192 enum State {
1193 OFF = 0;
1194 ON = 1;
1195 }
1196 optional State state = 1;
1197}
1198
1199/**
Bookatzc1a050a2017-10-10 15:49:28 -07001200 * Logs Battery Saver state change.
1201 *
1202 * Logged from:
1203 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1204 */
1205message BatterySaverModeStateChanged {
1206 enum State {
1207 OFF = 0;
1208 ON = 1;
1209 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001210 optional State state = 1
1211 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001212}
1213
1214/**
1215 * Logs Doze mode state change.
1216 *
1217 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001218 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001219 */
1220message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001221 optional android.server.DeviceIdleModeEnum state = 1
1222 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001223}
1224
1225
1226/**
1227 * Logs state change of Doze mode including maintenance windows.
1228 *
1229 * Logged from:
1230 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1231 */
1232message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001233 optional android.server.DeviceIdleModeEnum state = 1
1234 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001235}
1236
1237/**
1238 * Logs screen brightness level.
1239 *
1240 * Logged from:
1241 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1242 */
1243message ScreenBrightnessChanged {
1244 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1245 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001246}
1247
1248/**
1249 * Logs battery level (percent full, from 0 to 100).
1250 *
1251 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001252 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001253 */
1254message BatteryLevelChanged {
1255 // Battery level. Should be in [0, 100].
1256 optional int32 battery_level = 1;
1257}
1258
1259/**
1260 * Logs change in charging status of the device.
1261 *
1262 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001263 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001264 */
1265message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001266 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001267 optional android.os.BatteryStatusEnum state = 1
1268 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001269}
1270
1271/**
1272 * Logs whether the device is plugged in, and what power source it is using.
1273 *
1274 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001275 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001276 */
1277message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001278 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001279 optional android.os.BatteryPluggedStateEnum state = 1
1280 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001281}
1282
Bookatz8c6571b2017-10-24 15:04:41 -07001283/**
1284 * Logs when an app's wakeup alarm fires.
1285 *
1286 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001287 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001288 */
1289message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001290 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001291
1292 // Name of the wakeup alarm.
1293 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001294
1295 // Name of source package (for historical reasons, since BatteryStats tracked it).
1296 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001297
Ben Murdoch3389f1522019-05-21 15:05:34 +01001298 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001299 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001300}
1301
1302/**
1303 * Logs when an an app causes the mobile radio to change state.
1304 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1305 *
1306 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001307 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001308 */
1309message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001310 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001311
Bookatz1a1b0462018-01-12 11:47:03 -08001312 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1313 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001314}
1315
1316/**
1317 * Logs when an an app causes the wifi radio to change state.
1318 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1319 *
1320 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001321 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001322 */
1323message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001324 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001325
Bookatz1a1b0462018-01-12 11:47:03 -08001326 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1327 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001328}
1329
1330/**
1331 * Logs kernel wakeup reasons and aborts.
1332 *
1333 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001334 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001335 */
1336message KernelWakeupReported {
1337 // Name of the kernel wakeup reason (or abort).
1338 optional string wakeup_reason_name = 1;
1339
1340 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001341 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001342}
1343
1344/**
Bookatzda1798c2018-12-13 14:16:00 -08001345 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001346 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001347 *
1348 * Logged from:
1349 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1350 */
1351message WifiEnabledStateChanged {
1352 enum State {
1353 OFF = 0;
1354 ON = 1;
1355 }
1356 optional State state = 1;
1357}
1358
1359/**
tsaichristinececebdc2020-02-04 14:05:56 -08001360 * This atom is deprecated starting in R.
1361 *
Bookatzda1798c2018-12-13 14:16:00 -08001362 * 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 -08001363 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1364 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001365 *
1366 * Logged from:
1367 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1368 */
1369message WifiRunningStateChanged {
1370 repeated AttributionNode attribution_node = 1;
1371
1372 enum State {
1373 OFF = 0;
1374 ON = 1;
1375 }
1376 optional State state = 2;
1377}
1378
1379/**
Bookatze5885242017-10-24 20:10:31 -07001380 * Logs wifi locks held by an app.
1381 *
1382 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001383 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001384 */
1385message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001386 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001387
1388 enum State {
1389 OFF = 0;
1390 ON = 1;
1391 }
1392 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001393
1394 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1395 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001396}
1397
1398/**
1399 * Logs wifi signal strength changes.
1400 *
1401 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001402 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001403 */
1404message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001405 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1406 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001407}
1408
1409/**
1410 * Logs wifi scans performed by an app.
1411 *
1412 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001413 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001414 */
1415message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001416 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001417
1418 enum State {
1419 OFF = 0;
1420 ON = 1;
1421 }
1422 optional State state = 2;
1423}
1424
1425/**
Tej Singh4503e102018-01-04 14:35:01 -08001426 * Logs wifi multicast locks held by an app
1427 *
1428 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001429 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001430 */
1431message WifiMulticastLockStateChanged {
1432 repeated AttributionNode attribution_node = 1;
1433
1434 enum State {
1435 OFF = 0;
1436 ON = 1;
1437 }
1438 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001439
1440 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001441}
1442
1443/**
Tej Singh1ea42892018-01-19 09:27:00 -08001444 * Logs shutdown reason and duration on next boot.
1445 *
1446 * Logged from:
1447 * frameworks/base/core/java/com/android/server/BootReceiver.java
1448 */
1449message ShutdownSequenceReported {
1450 // True if shutdown is for a reboot. Default: false if we do not know.
1451 optional bool reboot = 1;
1452
1453 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1454 optional string reason = 2;
1455
1456 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1457 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001458 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001459
1460 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001461 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001462}
1463
Tej Singh6483ea42018-01-25 17:45:49 -08001464
1465/**
1466 * Logs boot reason and duration.
1467 *
1468 * Logged from:
1469 * system/core/bootstat/bootstat.cpp
1470 */
1471message BootSequenceReported {
1472 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1473 // Default: "<EMPTY>" if not available.
1474 optional string bootloader_reason = 1;
1475
1476 // Reason for system boot. Eg. bootloader, reboot,userrequested
1477 // Default: "<EMPTY>" if not available.
1478 optional string system_reason = 2;
1479
1480 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001481 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001482
1483 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001484 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001485
1486 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001487 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001488
1489 // Time since last boot in ms. Default: 0 if not available.
1490 optional int64 time_since_last_boot = 6;
1491}
1492
Tej Singhc477d9c2018-02-05 18:31:39 -08001493
1494/**
1495 * Logs call state and disconnect cause (if applicable).
1496 *
1497 * Logged from:
1498 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1499 */
1500message CallStateChanged {
1501 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1502 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1503 optional android.telecom.CallStateEnum call_state = 1;
1504
1505 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1506 // This value is only applicable when the call_state is DISCONNECTED, and
1507 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1508 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1509 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1510
1511 // True if the call is self-managed, which are apps that use the
1512 // telecom infrastructure to make their own calls.
1513 optional bool self_managed = 3;
1514
1515 // True if call is external. External calls are calls on connected Wear
1516 // devices but show up in Telecom so the user can pull them onto the device.
1517 optional bool external_call = 4;
1518}
1519
Tej Singh1ea42892018-01-19 09:27:00 -08001520/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001521 * Logs keyguard state. The keyguard is the lock screen.
1522 *
1523 * Logged from:
1524 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1525 */
1526message KeyguardStateChanged {
1527 enum State {
1528 UNKNOWN = 0;
1529 // The keyguard is hidden when the phone is unlocked.
1530 HIDDEN = 1;
1531 // The keyguard is shown when the phone is locked (screen turns off).
1532 SHOWN= 2;
1533 // The keyguard is occluded when something is overlaying the keyguard.
1534 // Eg. Opening the camera while on the lock screen.
1535 OCCLUDED = 3;
1536 }
1537 optional State state = 1;
1538}
1539
1540/**
1541 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1542 * prompts the user to enter a password (pattern, pin, etc).
1543 *
1544 * Logged from:
1545 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1546 */
1547
1548message KeyguardBouncerStateChanged {
1549 enum State {
1550 UNKNOWN = 0;
1551 // Bouncer is hidden, either as a result of successfully entering the
1552 // password, screen timing out, or user going back to lock screen.
1553 HIDDEN = 1;
1554 // This is when the user is being prompted to enter the password.
1555 SHOWN = 2;
1556 }
1557 optional State state = 1;
1558}
1559
1560/**
1561 * Logs the result of entering a password into the keyguard bouncer.
1562 *
1563 * Logged from:
1564 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1565 */
1566message KeyguardBouncerPasswordEntered {
1567 enum BouncerResult {
1568 UNKNOWN = 0;
1569 // The password entered was incorrect.
1570 FAILURE = 1;
1571 // The password entered was correct.
1572 SUCCESS = 2;
1573 }
1574 optional BouncerResult result = 1;
1575}
1576
Tej Singha883b372018-02-15 11:30:01 -08001577/*
1578 * Logs changes to the configuration of the device. The configuration is defined
1579 * in frameworks/base/core/java/android/content/res/Configuration.java
1580 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1581 * Please go there to interpret the possible values each field can be.
1582 *
1583 * Logged from:
1584 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1585 */
1586message ResourceConfigurationChanged {
1587 // Bit mask of color capabilities of the screen.
1588 // Contains information about the color gamut and hdr mode of the screen.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // The target screen density being rendered to.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001595
1596 // Current user preference for the scaling factor for fonts,
1597 // relative to the base density scaling.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001600
1601 // Flag indicating whether the hard keyboard is hidden.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001603 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001604
1605 // The type of keyboard attached to the device.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1607 optional int32 keyboard = 5;
1608
1609 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001611 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001612
1613 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1614 // 0 if undefined.
1615 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1616 optional int32 mcc = 7;
1617
1618 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1619 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1620 // MNC_ZERO symbol defined in Configuration.java.
1621 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1622 optional int32 mnc = 8;
1623
1624 // The kind of navigation available on the device.
1625 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1626 optional int32 navigation = 9;
1627
1628 // Flag indicating whether the navigation is available.
1629 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001630 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001631
1632 // Overall orientation of the screen.
1633 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1634 optional int32 orientation = 11;
1635
1636 // The current height of the available screen space, in dp units.
1637 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001638 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001639
1640 // Bit mask of overall layout of the screen.
1641 // Contains information about screen size, whether the screen is wider/taller
1642 // than normal, whether the screen layout is right-tl-left or left-to-right,
1643 // and whether the screen has a rounded shape.
1644 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001645 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001646
1647 // Current width of the available screen space, in dp units.
1648 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001649 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001650
1651 // The smallest screen size an application will see in normal operation.
1652 // This is the smallest value of both screenWidthDp and screenHeightDp
1653 // in portrait and landscape.
1654 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001655 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001656
1657 // The type of touch screen attached to the device.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1659 optional int32 touchscreen = 16;
1660
1661 // Bit mask of the ui mode.
1662 // Contains information about the overall ui mode of the device.
1663 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1664 // Also contains information about whether the device is in night mode.
1665 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001666 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001667}
1668
Tej Singheee317b2018-03-07 19:28:05 -08001669
1670/**
1671 * Logs changes in the connection state of the mobile radio.
1672 *
1673 * Logged from:
1674 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1675 */
1676message MobileConnectionStateChanged {
1677 // States are from the state machine DataConnection.java.
1678 enum State {
1679 UNKNOWN = 0;
1680 // The connection is inactive, or disconnected.
1681 INACTIVE = 1;
1682 // The connection is being activated, or connecting.
1683 ACTIVATING = 2;
1684 // The connection is active, or connected.
1685 ACTIVE = 3;
1686 // The connection is disconnecting.
1687 DISCONNECTING = 4;
1688 // The connection is disconnecting after creating a connection.
1689 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1690 }
1691 optional State state = 1;
1692 // For multi-sim phones, this distinguishes between the sim cards.
1693 optional int32 sim_slot_index = 2;
1694 // Used to identify the connection. Starts at 0 and increments by 1 for
1695 // every new network created. Resets whenever the device reboots.
1696 optional int32 data_connection_id = 3;
1697 // A bitmask for the capabilities of this connection.
1698 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1699 // Default value (if we have no information): 0
1700 optional int64 capabilities = 4;
1701 // If this connection has internet.
1702 // This just checks if the DEFAULT bit of capabilities is set.
1703 optional bool has_internet = 5;
1704}
1705
1706/**
1707 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1708 *
1709 * Logged from:
1710 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1711 */
1712message MobileRadioTechnologyChanged {
1713 optional android.telephony.NetworkTypeEnum state = 1;
1714 // For multi-sim phones, this distinguishes between the sim cards.
1715 optional int32 sim_slot_index = 2;
1716}
1717
Andrew Chantb56388b2018-03-22 21:07:33 -07001718/**
1719 * Logs the VID and PID of any connected USB devices.
1720 *
1721 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1722 *
1723 * Logged by Vendor.
1724 */
1725message UsbDeviceAttached {
1726 optional int32 vid = 1;
1727 optional int32 pid = 2;
1728 optional bool has_audio = 3;
1729 optional bool has_hid = 4;
1730 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001731 enum State {
1732 STATE_DISCONNECTED = 0;
1733 STATE_CONNECTED = 1;
1734 }
1735 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001736 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001737}
1738
Tej Singheee317b2018-03-07 19:28:05 -08001739
Tej Singhdd7bd352018-02-09 19:33:15 -08001740/**
Tej Singh5d991e12018-03-09 19:48:11 -08001741 * Logs when Bluetooth is enabled and disabled.
1742 *
1743 * Logged from:
1744 * services/core/java/com/android/server/BluetoothManagerService.java
1745 */
1746message BluetoothEnabledStateChanged {
1747 repeated AttributionNode attribution_node = 1;
1748 // Whether or not bluetooth is enabled on the device.
1749 enum State {
1750 UNKNOWN = 0;
1751 ENABLED = 1;
1752 DISABLED = 2;
1753 }
1754 optional State state = 2;
1755 // The reason for being enabled/disabled.
1756 // Eg. Airplane mode, crash, application request.
1757 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1758 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001759 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001760}
1761
1762/**
Jack Hed9837c82019-01-09 01:19:13 -08001763 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001764 *
1765 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001766 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1767 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001768 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001769 */
1770message BluetoothConnectionStateChanged {
1771 // The state of the connection.
1772 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1773 optional android.bluetooth.ConnectionStateEnum state = 1;
1774 // An identifier that can be used to match connect and disconnect events.
1775 // Currently is last two bytes of a hash of a device level ID and
1776 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001777 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001778 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001779 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1780 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001781 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001782 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001783 // An identifier that can be used to match events for this device.
1784 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1785 // Salt: Randomly generated 256 bit value
1786 // Hash algorithm: HMAC-SHA256
1787 // Size: 32 byte
1788 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001789 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001790 // An identifier that can be used to match events for this device.
1791 // The incremental identifier is locally generated and guaranteed not derived
1792 // from any globally unique hardware id.
1793 // For paired devices, it stays consistent between Bluetooth toggling for the
1794 // same remote device.
1795 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1796 // session for the same remote device.
1797 // Default: 0 if the device's metric id is unknown.
1798 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001799}
1800
1801/**
1802 * Logs when a Bluetooth device connects and disconnects over ACL
1803 *
1804 * Logged from:
1805 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1806 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001807 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001808 */
1809message BluetoothAclConnectionStateChanged {
1810 // An identifier that can be used to match events for this device.
1811 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1812 // Salt: Randomly generated 256 bit value
1813 // Hash algorithm: HMAC-SHA256
1814 // Size: 32 byte
1815 // Default: null or empty if the device identifier is not known
1816 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1817 // The state of the connection.
1818 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1819 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001820 // An identifier that can be used to match events for this device.
1821 // The incremental identifier is locally generated and guaranteed not derived
1822 // from any globally unique hardware id.
1823 // For paired devices, it stays consistent between Bluetooth toggling for the
1824 // same remote device.
1825 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1826 // session for the same remote device.
1827 // Default: 0 if the device's metric id is unknown.
1828 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001829}
1830
1831/**
1832 * Logs when a Bluetooth device connects and disconnects over SCO
1833 *
1834 * Logged from:
1835 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1836 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1837 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001838 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001839 */
1840message BluetoothScoConnectionStateChanged {
1841 // An identifier that can be used to match events for this device.
1842 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1843 // Salt: Randomly generated 256 bit value
1844 // Hash algorithm: HMAC-SHA256
1845 // Size: 32 byte
1846 // Default: null or empty if the device identifier is not known
1847 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1848 // The state of the connection.
1849 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1850 optional android.bluetooth.ConnectionStateEnum state = 2;
1851 // Codec used for this SCO connection
1852 // Default: UNKNOWN
1853 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001854 // An identifier that can be used to match events for this device.
1855 // The incremental identifier is locally generated and guaranteed not derived
1856 // from any globally unique hardware id.
1857 // For paired devices, it stays consistent between Bluetooth toggling for the
1858 // same remote device.
1859 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1860 // session for the same remote device.
1861 // Default: 0 if the device's metric id is unknown.
1862 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001863}
1864
Jack Hec27040a2019-01-09 20:54:41 -08001865/**
1866 * Logged when active device of a profile changes
1867 *
1868 * Logged from:
1869 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1870 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1871 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1872 */
1873message BluetoothActiveDeviceChanged {
1874 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1875 // From android.bluetooth.BluetoothProfile
1876 optional int32 bt_profile = 1;
1877 // An identifier that can be used to match events for this new active device.
1878 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1879 // Salt: Randomly generated 256 bit value
1880 // Hash algorithm: HMAC-SHA256
1881 // Size: 32 byte
1882 // Default: null or empty if there is no active device for this profile
1883 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001884 // An identifier that can be used to match events for this device.
1885 // The incremental identifier is locally generated and guaranteed not derived
1886 // from any globally unique hardware id.
1887 // For paired devices, it stays consistent between Bluetooth toggling for the
1888 // same remote device.
1889 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1890 // session for the same remote device.
1891 // Default: 0 if the device's metric id is unknown.
1892 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001893}
1894
Jack Heab86dbd22018-12-18 15:43:27 -08001895// Logs when there is an event affecting Bluetooth device's link layer connection.
1896// - This event is triggered when there is a related HCI command or event
1897// - Users of this metrics can deduce Bluetooth device's connection state from these events
1898// - HCI commands are logged before the command is sent, after receiving command status, and after
1899// receiving command complete
1900// - HCI events are logged when they arrive
1901//
1902// Low level log from system/bt
1903//
1904// Bluetooth classic commands:
1905// - CMD_CREATE_CONNECTION
1906// - CMD_DISCONNECT
1907// - CMD_CREATE_CONNECTION_CANCEL
1908// - CMD_ACCEPT_CONNECTION_REQUEST
1909// - CMD_REJECT_CONNECTION_REQUEST
1910// - CMD_SETUP_ESCO_CONNECTION
1911// - CMD_ACCEPT_ESCO_CONNECTION
1912// - CMD_REJECT_ESCO_CONNECTION
1913// - CMD_ENH_SETUP_ESCO_CONNECTION
1914// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1915//
1916// Bluetooth low energy commands:
1917// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1918// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1919// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1920// - CMD_BLE_CLEAR_WHITE_LIST
1921// - CMD_BLE_ADD_WHITE_LIST
1922// - CMD_BLE_REMOVE_WHITE_LIST
1923//
1924// Bluetooth classic events:
1925// - EVT_CONNECTION_COMP
1926// - EVT_CONNECTION_REQUEST
1927// - EVT_DISCONNECTION_COMP
1928// - EVT_ESCO_CONNECTION_COMP
1929// - EVT_ESCO_CONNECTION_CHANGED
1930//
1931// Bluetooth low energy meta events:
1932// - BLE_EVT_CONN_COMPLETE_EVT
1933// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1934//
1935// Next tag: 10
1936message BluetoothLinkLayerConnectionEvent {
1937 // An identifier that can be used to match events for this device.
1938 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1939 // Salt: Randomly generated 256 bit value
1940 // Hash algorithm: HMAC-SHA256
1941 // Size: 32 byte
1942 // Default: null or empty if the device identifier is not known
1943 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1944 // Connection handle of this connection if available
1945 // Range: 0x0000 - 0x0EFF (12 bits)
1946 // Default: 0xFFFF if the handle is unknown
1947 optional int32 connection_handle = 2;
1948 // Direction of the link
1949 // Default: DIRECTION_UNKNOWN
1950 optional android.bluetooth.DirectionEnum direction = 3;
1951 // Type of this link
1952 // Default: LINK_TYPE_UNKNOWN
1953 optional android.bluetooth.LinkTypeEnum type = 4;
1954
1955 // Reason metadata for this link layer connection event, rules for interpretation:
1956 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1957 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1958 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1959 // set and valid, ignore hci_ble_event
1960
1961 // HCI command associated with this event
1962 // Default: CMD_UNKNOWN
1963 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1964 // HCI event associated with this event
1965 // Default: EVT_UNKNOWN
1966 optional android.bluetooth.hci.EventEnum hci_event = 6;
1967 // HCI BLE meta event associated with this event
1968 // Default: BLE_EVT_UNKNOWN
1969 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1970 // HCI command status code if this is triggerred by hci_cmd
1971 // Default: STATUS_UNKNOWN
1972 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1973 // HCI reason code associated with this event
1974 // Default: STATUS_UNKNOWN
1975 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001976 // An identifier that can be used to match events for this device.
1977 // The incremental identifier is locally generated and guaranteed not derived
1978 // from any globally unique hardware id.
1979 // For paired devices, it stays consistent between Bluetooth toggling for the
1980 // same remote device.
1981 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1982 // session for the same remote device.
1983 // Default: 0 if the device's metric id is unknown.
1984 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001985}
1986
Howard Roe103fe22019-01-17 16:52:16 -08001987/**
1988 * Logs when a module is rolled back by Watchdog.
1989 *
1990 * Logged from: Rollback Manager
1991 */
1992message WatchdogRollbackOccurred {
1993 enum RollbackType {
1994 UNKNOWN = 0;
1995 ROLLBACK_INITIATE = 1;
1996 ROLLBACK_SUCCESS = 2;
1997 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001998 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001999 }
2000 optional RollbackType rollback_type = 1;
2001
2002 optional string package_name = 2;
2003
2004 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002005
2006 enum RollbackReasonType {
2007 REASON_UNKNOWN = 0;
2008 REASON_NATIVE_CRASH = 1;
2009 REASON_EXPLICIT_HEALTH_CHECK = 2;
2010 REASON_APP_CRASH = 3;
2011 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002012 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002013 }
2014 optional RollbackReasonType rollback_reason = 4;
2015
2016 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2017 // is initiated. Empty if the package is unknown.
2018 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002019
2020 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002021}
2022
Jack Hec27040a2019-01-09 20:54:41 -08002023/**
2024 * Logs when there is a change in Bluetooth A2DP playback state
2025 *
2026 * Logged from:
2027 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2028 */
2029message BluetoothA2dpPlaybackStateChanged {
2030 // An identifier that can be used to match events for this device.
2031 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2032 // Salt: Randomly generated 256 bit value
2033 // Hash algorithm: HMAC-SHA256
2034 // Size: 32 byte
2035 // Default: null or empty if the device identifier is not known
2036 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2037 // Current playback state
2038 // Default: PLAYBACK_STATE_UNKNOWN
2039 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2040 // Current audio coding mode
2041 // Default: AUDIO_CODING_MODE_UNKNOWN
2042 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002043 // An identifier that can be used to match events for this device.
2044 // The incremental identifier is locally generated and guaranteed not derived
2045 // from any globally unique hardware id.
2046 // For paired devices, it stays consistent between Bluetooth toggling for the
2047 // same remote device.
2048 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2049 // session for the same remote device.
2050 // Default: 0 if the device's metric id is unknown.
2051 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002052}
2053
2054/**
2055 * Logs when there is a change in A2DP codec config for a particular remote device
2056 *
2057 * Logged from:
2058 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2059 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2060 */
2061message BluetoothA2dpCodecConfigChanged {
2062 // An identifier that can be used to match events for this device.
2063 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2064 // Salt: Randomly generated 256 bit value
2065 // Hash algorithm: HMAC-SHA256
2066 // Size: 32 byte
2067 // Default: null or empty if the device identifier is not known
2068 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2069 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2070 // Default SOURCE_CODEC_TYPE_INVALID
2071 optional int32 codec_type = 2;
2072 // Codec priroity, the higher the more preferred, -1 for disabled
2073 // Default: CODEC_PRIORITY_DEFAULT
2074 optional int32 codec_priority = 3;
2075 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2076 // Default: SAMPLE_RATE_NONE
2077 optional int32 sample_rate = 4;
2078 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2079 // Default: BITS_PER_SAMPLE_NONE
2080 optional int32 bits_per_sample = 5;
2081 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2082 // Default: CHANNEL_MODE_NONE
2083 optional int32 channel_mode = 6;
2084 // Codec specific values
2085 // Default 0
2086 optional int64 codec_specific_1 = 7;
2087 optional int64 codec_specific_2 = 8;
2088 optional int64 codec_specific_3 = 9;
2089 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002090 // An identifier that can be used to match events for this device.
2091 // The incremental identifier is locally generated and guaranteed not derived
2092 // from any globally unique hardware id.
2093 // For paired devices, it stays consistent between Bluetooth toggling for the
2094 // same remote device.
2095 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2096 // session for the same remote device.
2097 // Default: 0 if the device's metric id is unknown.
2098 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002099}
2100
2101/**
2102 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2103 * Each codec's capability is logged separately due to statsd restriction
2104 *
2105 * Logged from:
2106 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2107 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2108 */
2109message BluetoothA2dpCodecCapabilityChanged {
2110 // An identifier that can be used to match events for this device.
2111 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2112 // Salt: Randomly generated 256 bit value
2113 // Hash algorithm: HMAC-SHA256
2114 // Size: 32 byte
2115 // Default: null or empty if the device identifier is not known
2116 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2117 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2118 // Default SOURCE_CODEC_TYPE_INVALID
2119 optional int32 codec_type = 2;
2120 // Codec priroity, the higher the more preferred, -1 for disabled
2121 // Default: CODEC_PRIORITY_DEFAULT
2122 optional int32 codec_priority = 3;
2123 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2124 // in BluetoothCodecConfig
2125 // Default: empty and SAMPLE_RATE_NONE for individual item
2126 optional int32 sample_rate = 4;
2127 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2128 // in BluetoothCodecConfig
2129 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2130 optional int32 bits_per_sample = 5;
2131 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2132 // BluetoothCodecConfig
2133 // Default: empty and CHANNEL_MODE_NONE for individual item
2134 optional int32 channel_mode = 6;
2135 // Codec specific values
2136 // Default 0
2137 optional int64 codec_specific_1 = 7;
2138 optional int64 codec_specific_2 = 8;
2139 optional int64 codec_specific_3 = 9;
2140 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002141 // An identifier that can be used to match events for this device.
2142 // The incremental identifier is locally generated and guaranteed not derived
2143 // from any globally unique hardware id.
2144 // For paired devices, it stays consistent between Bluetooth toggling for the
2145 // same remote device.
2146 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2147 // session for the same remote device.
2148 // Default: 0 if the device's metric id is unknown.
2149 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002150}
2151
2152/**
2153 * Logs when A2DP failed to read from PCM source.
2154 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2155 *
2156 * Logged from:
2157 * system/bt
2158 */
2159message BluetoothA2dpAudioUnderrunReported {
2160 // An identifier that can be used to match events for this device.
2161 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2162 // Salt: Randomly generated 256 bit value
2163 // Hash algorithm: HMAC-SHA256
2164 // Size: 32 byte
2165 // Default: null or empty if the device identifier is not known
2166 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2167 // Encoding interval in nanoseconds
2168 // Default: 0
2169 optional int64 encoding_interval_nanos = 2;
2170 // Number of bytes of PCM data that could not be read from the source
2171 // Default: 0
2172 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002173 // An identifier that can be used to match events for this device.
2174 // The incremental identifier is locally generated and guaranteed not derived
2175 // from any globally unique hardware id.
2176 // For paired devices, it stays consistent between Bluetooth toggling for the
2177 // same remote device.
2178 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2179 // session for the same remote device.
2180 // Default: 0 if the device's metric id is unknown.
2181 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002182}
2183
2184/**
2185 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2186 * buffer queue is full and we have to drop data
2187 *
2188 * Logged from:
2189 * system/bt
2190 */
2191message BluetoothA2dpAudioOverrunReported {
2192 // An identifier that can be used to match events for this device.
2193 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2194 // Salt: Randomly generated 256 bit value
2195 // Hash algorithm: HMAC-SHA256
2196 // Size: 32 byte
2197 // Default: null or empty if the device identifier is not known
2198 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2199 // Encoding interval in nanoseconds
2200 // Default: 0
2201 optional int64 encoding_interval_nanos = 2;
2202 // Number of buffers dropped in this event
2203 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2204 // Default: 0
2205 optional int32 num_dropped_buffers = 3;
2206 // Number of encoded buffers dropped in this event
2207 // Default 0
2208 optional int32 num_dropped_encoded_frames = 4;
2209 // Number of encoded bytes dropped in this event
2210 // Default: 0
2211 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002212 // An identifier that can be used to match events for this device.
2213 // The incremental identifier is locally generated and guaranteed not derived
2214 // from any globally unique hardware id.
2215 // For paired devices, it stays consistent between Bluetooth toggling for the
2216 // same remote device.
2217 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2218 // session for the same remote device.
2219 // Default: 0 if the device's metric id is unknown.
2220 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002221}
2222
2223/**
2224 * Logs when we receive reports regarding a device's RSSI value
2225 *
2226 * Logged from:
2227 * system/bt
2228 */
2229message BluetoothDeviceRssiReported {
2230 // An identifier that can be used to match events for this device.
2231 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2232 // Salt: Randomly generated 256 bit value
2233 // Hash algorithm: HMAC-SHA256
2234 // Size: 32 byte
2235 // Default: null or empty if the device identifier is not known
2236 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2237 // Connection handle of this connection if available
2238 // Range: 0x0000 - 0x0EFF (12 bits)
2239 // Default: 0xFFFF if the handle is unknown
2240 optional int32 connection_handle = 2;
2241 // HCI command status code if this is triggerred by hci_cmd
2242 // Default: STATUS_UNKNOWN
2243 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2244 // BR/EDR
2245 // Range: -128 ≤ N ≤ 127 (signed integer)
2246 // Units: dB
2247 // LE:
2248 // Range: -127 to 20, 127 (signed integer)
2249 // Units: dBm
2250 // Invalid when an out of range value is reported
2251 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002252 // An identifier that can be used to match events for this device.
2253 // The incremental identifier is locally generated and guaranteed not derived
2254 // from any globally unique hardware id.
2255 // For paired devices, it stays consistent between Bluetooth toggling for the
2256 // same remote device.
2257 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2258 // session for the same remote device.
2259 // Default: 0 if the device's metric id is unknown.
2260 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002261}
2262
2263/**
2264 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2265 *
2266 * Logged from:
2267 * system/bt
2268 */
2269message BluetoothDeviceFailedContactCounterReported {
2270 // An identifier that can be used to match events for this device.
2271 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2272 // Salt: Randomly generated 256 bit value
2273 // Hash algorithm: HMAC-SHA256
2274 // Size: 32 byte
2275 // Default: null or empty if the device identifier is not known
2276 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2277 // Connection handle of this connection if available
2278 // Range: 0x0000 - 0x0EFF (12 bits)
2279 // Default: 0xFFFF if the handle is unknown
2280 optional int32 connection_handle = 2;
2281 // HCI command status code if this is triggerred by hci_cmd
2282 // Default: STATUS_UNKNOWN
2283 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2284 // Number of consecutive failed contacts for a connection corresponding to the Handle
2285 // Range: uint16_t, 0-0xFFFF
2286 // Default: 0xFFFFF
2287 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002288 // An identifier that can be used to match events for this device.
2289 // The incremental identifier is locally generated and guaranteed not derived
2290 // from any globally unique hardware id.
2291 // For paired devices, it stays consistent between Bluetooth toggling for the
2292 // same remote device.
2293 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2294 // session for the same remote device.
2295 // Default: 0 if the device's metric id is unknown.
2296 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002297}
2298
2299/**
2300 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2301 *
2302 * Logged from:
2303 * system/bt
2304 */
2305message BluetoothDeviceTxPowerLevelReported {
2306 // An identifier that can be used to match events for this device.
2307 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2308 // Salt: Randomly generated 256 bit value
2309 // Hash algorithm: HMAC-SHA256
2310 // Size: 32 byte
2311 // Default: null or empty if the device identifier is not known
2312 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2313 // Connection handle of this connection if available
2314 // Range: 0x0000 - 0x0EFF (12 bits)
2315 // Default: 0xFFFF if the handle is unknown
2316 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002317 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002318 // Default: STATUS_UNKNOWN
2319 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2320 // Range: -30 ≤ N ≤ 20
2321 // Units: dBm
2322 // Invalid when an out of range value is reported
2323 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002324 // An identifier that can be used to match events for this device.
2325 // The incremental identifier is locally generated and guaranteed not derived
2326 // from any globally unique hardware id.
2327 // For paired devices, it stays consistent between Bluetooth toggling for the
2328 // same remote device.
2329 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2330 // session for the same remote device.
2331 // Default: 0 if the device's metric id is unknown.
2332 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002333}
Jack Heab86dbd22018-12-18 15:43:27 -08002334
Tej Singh5d991e12018-03-09 19:48:11 -08002335/**
Jack He1021a612019-01-20 21:22:46 -08002336 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2337 * receiving an HCI command from the host
2338 *
2339 * Logged from: system/bt
2340 */
2341message BluetoothHciTimeoutReported {
2342 // HCI command associated with this event
2343 // Default: CMD_UNKNOWN
2344 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2345}
2346
2347/**
2348 * Logs when we receive Bluetooth Link Quality Report event from the controller
2349 * See Android Bluetooth HCI specification for more details
2350 *
2351 * Note: all count and bytes field are counted since last event
2352 *
2353 * Logged from: system/bt
2354 */
2355message BluetoothQualityReportReported {
2356 // Quality report ID
2357 // Original type: uint8_t
2358 // Default: BQR_ID_UNKNOWN
2359 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2360 // Packet type of the connection
2361 // Original type: uint8_t
2362 // Default: BQR_PACKET_TYPE_UNKNOWN
2363 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2364 // Connection handle of the connection
2365 // Original type: uint16_t
2366 optional int32 connection_handle = 3;
2367 // Performing Role for the connection
2368 // Original type: uint8_t
2369 optional int32 connection_role = 4;
2370 // Current Transmit Power Level for the connection. This value is the same as the controller's
2371 // response to the HCI_Read_Transmit_Power_Level HCI command
2372 // Original type: uint8_t
2373 optional int32 tx_power_level = 5;
2374 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2375 // absolute receiver signal strength value
2376 // Original type: int8_t
2377 optional int32 rssi = 6;
2378 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2379 // channels used by the link currently
2380 // Original type: uint8_t
2381 optional int32 snr = 7;
2382 // Indicates the number of unused channels in AFH_channel_map
2383 // Original type: uint8_t
2384 optional int32 unused_afh_channel_count = 8;
2385 // Indicates the number of the channels which are interfered and quality is bad but are still
2386 // selected for AFH
2387 // Original type: uint8_t
2388 optional int32 afh_select_unideal_channel_count = 9;
2389 // Current Link Supervision Timeout Setting
2390 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2391 // Original type: uint16_t
2392 optional int32 lsto = 10;
2393 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2394 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2395 // 0x01 (Piconet Clock)
2396 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2397 // Original type: uint32_t
2398 optional int64 connection_piconet_clock = 11;
2399 // The count of retransmission
2400 // Original type: uint32_t
2401 optional int64 retransmission_count = 12;
2402 // The count of no RX
2403 // Original type: uint32_t
2404 optional int64 no_rx_count = 13;
2405 // The count of NAK (Negative Acknowledge)
2406 // Original type: uint32_t
2407 optional int64 nak_count = 14;
2408 // Controller timestamp of last TX ACK
2409 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2410 // Original type: uint32_t
2411 optional int64 last_tx_ack_timestamp = 15;
2412 // The count of Flow-off (STOP)
2413 // Original type: uint32_t
2414 optional int64 flow_off_count = 16;
2415 // Controller timestamp of last Flow-on (GO)
2416 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2417 // Original type: uint32_t
2418 optional int64 last_flow_on_timestamp = 17;
2419 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2420 // Original type: uint32_t
2421 optional int64 buffer_overflow_bytes = 18;
2422 // Buffer underflow count (in byte) since last event
2423 // Original type: uint32_t
2424 optional int64 buffer_underflow_bytes = 19;
2425}
2426
2427/**
2428 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2429 *
2430 * Notes:
2431 * - Each event can be partially filled as we might learn different pieces of device
2432 * information at different time
2433 * - Multiple device info events can be combined to give more complete picture
2434 * - When multiple device info events tries to describe the same information, the
2435 * later one wins
2436 *
2437 * Logged from:
2438 * packages/apps/Bluetooth
2439 */
Jack Heaea26982019-04-04 11:19:48 -07002440message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002441 // An identifier that can be used to match events for this device.
2442 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2443 // Salt: Randomly generated 256 bit value
2444 // Hash algorithm: HMAC-SHA256
2445 // Size: 32 byte
2446 // Default: null or empty if the device identifier is not known
2447 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2448 // Where is this device info obtained from
2449 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2450 // Name of the data source
2451 // For EXTERNAL: package name of the data source
2452 // For INTERNAL: null for general case, component name otherwise
2453 optional string source_name = 3;
2454 // Name of the manufacturer of this device
2455 optional string manufacturer = 4;
2456 // Model of this device
2457 optional string model = 5;
2458 // Hardware version of this device
2459 optional string hardware_version = 6;
2460 // Software version of this device
2461 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002462 // An identifier that can be used to match events for this device.
2463 // The incremental identifier is locally generated and guaranteed not derived
2464 // from any globally unique hardware id.
2465 // For paired devices, it stays consistent between Bluetooth toggling for the
2466 // same remote device.
2467 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2468 // session for the same remote device.
2469 // Default: 0 if the device's metric id is unknown.
2470 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002471}
2472
2473/**
2474 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2475 * device, as documented by the Bluetooth Core HCI specification
2476 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2477 * Vol 2, Part E, Page 1118
2478 *
2479 * Logged from:
2480 * system/bt
2481 */
2482message BluetoothRemoteVersionInfoReported {
2483 // Connection handle of the connection
2484 // Original type: uint16_t
2485 optional int32 connection_handle = 1;
2486 // HCI command status code
2487 // Default: STATUS_UNKNOWN
2488 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2489 // 1 byte Version of current LMP in the remote controller
2490 optional int32 lmp_version = 3;
2491 // 2 bytes LMP manufacturer code of the remote controller
2492 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2493 optional int32 lmp_manufacturer_code = 4;
2494 // 4 bytes subversion of the LMP in the remote controller
2495 optional int32 lmp_subversion = 5;
2496}
2497
2498/**
2499 * Logs when certain Bluetooth SDP attributes are discovered
2500 * Constant definitions are from:
2501 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2502 *
2503 * Current logged attributes:
2504 * - BluetoothProfileDescriptorList
2505 * - Supported Features Bitmask
2506 *
2507 * Logged from:
2508 * system/bt
2509 */
2510message BluetoothSdpAttributeReported {
2511 // An identifier that can be used to match events for this device.
2512 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2513 // Salt: Randomly generated 256 bit value
2514 // Hash algorithm: HMAC-SHA256
2515 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2516 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2517 // Original type: uint16_t
2518 optional int32 protocol_uuid = 2;
2519 // Short form UUIDs used to identify Bluetooth SDP attribute types
2520 // Original type: uint16_t
2521 optional int32 attribute_id = 3;
2522 // Attribute value for the particular attribute
2523 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002524 // An identifier that can be used to match events for this device.
2525 // The incremental identifier is locally generated and guaranteed not derived
2526 // from any globally unique hardware id.
2527 // For paired devices, it stays consistent between Bluetooth toggling for the
2528 // same remote device.
2529 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2530 // session for the same remote device.
2531 // Default: 0 if the device's metric id is unknown.
2532 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002533}
2534
2535/**
2536 * Logs when bond state of a Bluetooth device changes
2537 *
2538 * Logged from:
2539 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2540 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2541 */
2542message BluetoothBondStateChanged {
2543 // An identifier that can be used to match events for this device.
2544 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2545 // Salt: Randomly generated 256 bit value
2546 // Hash algorithm: HMAC-SHA256
2547 // Size: 32 byte
2548 // Default: null or empty if the device identifier is not known
2549 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2550 // Preferred transport type to remote dual mode device
2551 // Default: TRANSPORT_AUTO means no preference
2552 optional android.bluetooth.TransportTypeEnum transport = 2;
2553 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2554 // Default: UNKNOWN
2555 optional android.bluetooth.DeviceTypeEnum type = 3;
2556 // Current bond state (NONE, BONDING, BONDED)
2557 // Default: BOND_STATE_UNKNOWN
2558 optional android.bluetooth.BondStateEnum bond_state = 4;
2559 // Bonding sub state
2560 // Default: BOND_SUB_STATE_UNKNOWN
2561 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2562 // Unbond Reason
2563 // Default: UNBOND_REASON_UNKNOWN
2564 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002565 // An identifier that can be used to match events for this device.
2566 // The incremental identifier is locally generated and guaranteed not derived
2567 // from any globally unique hardware id.
2568 // For paired devices, it stays consistent between Bluetooth toggling for the
2569 // same remote device.
2570 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2571 // session for the same remote device.
2572 // Default: 0 if the device's metric id is unknown.
2573 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002574}
2575
2576/**
2577 * Logs there is an event related Bluetooth classic pairing
2578 *
2579 * Logged from:
2580 * system/bt
2581 */
2582message BluetoothClassicPairingEventReported {
2583 // An identifier that can be used to match events for this device.
2584 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2585 // Salt: Randomly generated 256 bit value
2586 // Hash algorithm: HMAC-SHA256
2587 // Size: 32 byte
2588 // Default: null or empty if the device identifier is not known
2589 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2590 // Connection handle of this connection if available
2591 // Range: 0x0000 - 0x0EFF (12 bits)
2592 // Default: 0xFFFF if the handle is unknown
2593 optional int32 connection_handle = 2;
2594 // HCI command associated with this event
2595 // Default: CMD_UNKNOWN
2596 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2597 // HCI event associated with this event
2598 // Default: EVT_UNKNOWN
2599 optional android.bluetooth.hci.EventEnum hci_event = 4;
2600 // HCI command status code if this is triggerred by hci_cmd
2601 // Default: STATUS_UNKNOWN
2602 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2603 // HCI reason code associated with this event
2604 // Default: STATUS_UNKNOWN
2605 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002606 // A status value related to this specific event
2607 // Default: 0
2608 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002609 // An identifier that can be used to match events for this device.
2610 // The incremental identifier is locally generated and guaranteed not derived
2611 // from any globally unique hardware id.
2612 // For paired devices, it stays consistent between Bluetooth toggling for the
2613 // same remote device.
2614 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2615 // session for the same remote device.
2616 // Default: 0 if the device's metric id is unknown.
2617 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002618}
2619
2620/**
2621 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2622 *
2623 * Logged from:
2624 * system/bt
2625 */
2626message BluetoothSmpPairingEventReported {
2627 // An identifier that can be used to match events for this device.
2628 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2629 // Salt: Randomly generated 256 bit value
2630 // Hash algorithm: HMAC-SHA256
2631 // Size: 32 byte
2632 // Default: null or empty if the device identifier is not known
2633 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2634 // SMP command sent or received over L2CAP
2635 // Default: CMD_UNKNOWN
2636 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2637 // Whether this command is sent or received
2638 // Default: DIRECTION_UNKNOWN
2639 optional android.bluetooth.DirectionEnum direction = 3;
2640 // SMP failure reason code
2641 // Default: PAIRING_FAIL_REASON_DEFAULT
2642 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002643 // An identifier that can be used to match events for this device.
2644 // The incremental identifier is locally generated and guaranteed not derived
2645 // from any globally unique hardware id.
2646 // For paired devices, it stays consistent between Bluetooth toggling for the
2647 // same remote device.
2648 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2649 // session for the same remote device.
2650 // Default: 0 if the device's metric id is unknown.
2651 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002652}
2653
2654/**
Jack He815cdba2019-01-30 17:24:55 -08002655 * Logs when a Bluetooth socket’s connection state changed
2656 *
2657 * Logged from:
2658 * system/bt
2659 */
2660message BluetoothSocketConnectionStateChanged {
2661 // An identifier that can be used to match events for this device.
2662 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2663 // Salt: Randomly generated 256 bit value
2664 // Hash algorithm: HMAC-SHA256
2665 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002666 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002667 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002668 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002669 // Default 0 when unknown or don't care
2670 optional int32 port = 2;
2671 // Socket type as mentioned in
2672 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2673 // Default: SOCKET_TYPE_UNKNOWN
2674 optional android.bluetooth.SocketTypeEnum type = 3;
2675 // Socket connection state
2676 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2677 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2678 // Number of bytes sent to remote device during this connection
2679 optional int64 tx_bytes = 5;
2680 // Number of bytes received from remote device during this connection
2681 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002682 // Socket owner's UID
2683 optional int32 uid = 7 [(is_uid) = true];
2684 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2685 // |port| must be spawned by |server_port|
2686 // Default 0 when unknown or don't care
2687 optional int32 server_port = 8;
2688 // Whether this is a server listener socket
2689 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002690 // An identifier that can be used to match events for this device.
2691 // The incremental identifier is locally generated and guaranteed not derived
2692 // from any globally unique hardware id.
2693 // For paired devices, it stays consistent between Bluetooth toggling for the
2694 // same remote device.
2695 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2696 // session for the same remote device.
2697 // Default: 0 if the device's metric id is unknown.
2698 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002699}
2700
2701/**
Jack He71426802019-04-02 13:32:52 -07002702 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2703 *
2704 * Logged from:
2705 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2706 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2707 *
2708 */
2709message BluetoothClassOfDeviceReported {
2710 // An identifier that can be used to match events for this device.
2711 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2712 // Salt: Randomly generated 256 bit value
2713 // Hash algorithm: HMAC-SHA256
2714 // Size: 32 byte
2715 // Default: null or empty if this is a server listener socket
2716 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2717 // Class of Device (CoD) value including both Major, Minor device class and service class
2718 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2719 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2720 // Default: 0
2721 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002722 // An identifier that can be used to match events for this device.
2723 // The incremental identifier is locally generated and guaranteed not derived
2724 // from any globally unique hardware id.
2725 // For paired devices, it stays consistent between Bluetooth toggling for the
2726 // same remote device.
2727 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2728 // session for the same remote device.
2729 // Default: 0 if the device's metric id is unknown.
2730 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002731}
2732
2733/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002734 * Logs when something is plugged into or removed from the USB-C connector.
2735 *
2736 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002737 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002738 */
2739message UsbConnectorStateChanged {
2740 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002741 STATE_DISCONNECTED = 0;
2742 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002743 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002744 optional State state = 1
2745 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2746 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002747 // Last active session in ms.
2748 // 0 when the port is in connected state.
2749 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002750}
2751
2752/**
2753 * Logs the reported speaker impedance.
2754 *
2755 * Logged from:
2756 * Vendor audio implementation.
2757 */
2758message SpeakerImpedanceReported {
2759 optional int32 speaker_location = 1;
2760 optional int32 impedance = 2;
2761}
2762
2763/**
2764 * Logs the report of a failed hardware.
2765 *
2766 * Logged from:
2767 * Vendor HALs.
2768 *
2769 */
2770message HardwareFailed {
2771 enum HardwareType {
2772 HARDWARE_FAILED_UNKNOWN = 0;
2773 HARDWARE_FAILED_MICROPHONE = 1;
2774 HARDWARE_FAILED_CODEC = 2;
2775 HARDWARE_FAILED_SPEAKER = 3;
2776 HARDWARE_FAILED_FINGERPRINT = 4;
2777 }
2778 optional HardwareType hardware_type = 1;
2779
Maggie White6dcd8572019-01-31 14:11:50 -08002780 /**
2781 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002782 * the same hardware_type. The specific locations are vendor defined integers,
2783 * referring to board-specific numbering schemes.
2784 */
2785 optional int32 hardware_location = 2;
2786
Maggie White6dcd8572019-01-31 14:11:50 -08002787 /**
2788 * failure_code is specific to the HardwareType of the failed hardware.
2789 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002790 */
Maggie White6dcd8572019-01-31 14:11:50 -08002791 enum HardwareErrorCode {
2792 UNKNOWN = 0;
2793 COMPLETE = 1;
2794 SPEAKER_HIGH_Z = 2;
2795 SPEAKER_SHORT = 3;
2796 FINGERPRINT_SENSOR_BROKEN = 4;
2797 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002798 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002799 }
2800 optional int32 failure_code = 3;
2801}
2802
2803/**
2804 * Log an event when the device has been physically dropped.
2805 * Reported from the /vendor partition.
2806 */
2807message PhysicalDropDetected {
2808 // Confidence that the event was actually a drop, 0 -> 100
2809 optional int32 confidence_pctg = 1;
2810 // Peak acceleration of the drop, in 1/1000s of a g.
2811 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002812 // Duration of freefall in ms
2813 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002814}
2815
2816/**
2817 * Log bucketed battery charge cycles.
2818 *
2819 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002820 * a given charge point. For example, if 10 cycle buckets are
2821 * initialized, bucket 1 is the lowest 1/10th of the battery,
2822 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002823 *
2824 * Logged from:
2825 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2826 */
2827message ChargeCyclesReported {
2828 optional int32 cycle_bucket_1 = 1;
2829 optional int32 cycle_bucket_2 = 2;
2830 optional int32 cycle_bucket_3 = 3;
2831 optional int32 cycle_bucket_4 = 4;
2832 optional int32 cycle_bucket_5 = 5;
2833 optional int32 cycle_bucket_6 = 6;
2834 optional int32 cycle_bucket_7 = 7;
2835 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002836 optional int32 cycle_bucket_9 = 9;
2837 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002838}
2839
2840/**
Howard Roa46b6582018-09-18 16:45:02 -07002841 * Log battery health snapshot.
2842 *
2843 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2844 * are snapshotted periodically over 24hrs.
2845 */
2846message BatteryHealthSnapshot {
2847 enum BatterySnapshotType {
2848 UNKNOWN = 0;
2849 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2850 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2851 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2852 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2853 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2854 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2855 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2856 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2857 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2858 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2859 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2860 }
2861 optional BatterySnapshotType type = 1;
2862 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002863 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002864 // Voltage Battery Voltage, in microVolts.
2865 optional int32 voltage_micro_volt = 3;
2866 // Current Battery current, in microAmps.
2867 optional int32 current_micro_amps = 4;
2868 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2869 optional int32 open_circuit_micro_volt = 5;
2870 // Resistance Battery Resistance, in microOhms.
2871 optional int32 resistance_micro_ohm = 6;
2872 // Level Battery Level, as % of full.
2873 optional int32 level_percent = 7;
2874}
2875
2876/**
2877 * Log slow I/O operations on the primary storage.
2878 */
2879message SlowIo {
2880 // Classifications of IO Operations.
2881 enum IoOperation {
2882 UNKNOWN = 0;
2883 READ = 1;
2884 WRITE = 2;
2885 UNMAP = 3;
2886 SYNC = 4;
2887 }
2888 optional IoOperation operation = 1;
2889
2890 // The number of slow IO operations of this type over 24 hours.
2891 optional int32 count = 2;
2892}
2893
2894/**
2895 * Log battery caused shutdown with the last recorded voltage.
2896 */
2897message BatteryCausedShutdown {
2898 // The last recorded battery voltage prior to shutdown.
2899 optional int32 last_recorded_micro_volt = 1;
2900}
2901
2902/**
Tej Singha72344992019-04-17 18:55:08 -07002903 * Logs when ThermalService receives throttling events.
2904 *
2905 * Logged from:
2906 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2907 */
2908message ThermalThrottlingSeverityStateChanged {
2909 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2910 optional android.os.TemperatureTypeEnum sensor_type = 1;
2911
2912 // The name of the temperature source. Eg. CPU0
2913 optional string sensor_name = 2;
2914
2915 // Temperature in tenths of a degree C.
2916 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2917 optional int32 temperature_deci_celsius = 3;
2918
2919 // Relative severity of the throttling, see enum definition.
2920 optional android.os.ThrottlingSeverityEnum severity = 4;
2921}
2922
2923/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002924 * Logs the duration of a davey (jank of >=700ms) when it occurs
2925 *
2926 * Logged from:
2927 * frameworks/base/libs/hwui/JankTracker.cpp
2928 */
2929message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002930 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002931 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002932
Tej Singhbb8554a2018-01-26 11:59:14 -08002933 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002934 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002935}
2936
2937/**
Bookatze5885242017-10-24 20:10:31 -07002938 * Logs phone signal strength changes.
2939 *
2940 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002941 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002942 */
2943message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002944 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2945 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002946}
2947
Yangster4ccebea2018-10-09 17:09:02 -07002948
2949/**
2950 * Logs when the phone state, sim state or signal strength changes
2951 *
2952 * Logged from:
2953 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2954 */
2955message PhoneServiceStateChanged {
2956 optional android.telephony.ServiceStateEnum state = 1;
2957 optional android.telephony.SimStateEnum sim_state = 2;
2958 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2959}
2960
2961/**
2962 * Logs when the phone becomes on or off.
2963 *
2964 * Logged from:
2965 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2966 */
2967message PhoneStateChanged {
2968 enum State {
2969 OFF = 0;
2970 ON = 1;
2971 }
2972 optional State state = 1;
2973}
2974
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002975message BackGesture {
2976 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002977 DEFAULT_BACK_TYPE = 0;
2978 COMPLETED = 1;
2979 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2980 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2981 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2982 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2983 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2984 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2985 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002986 }
2987 optional BackType type = 1;
2988
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002989 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2990 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2991 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2992 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2993 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2994 optional int32 left_boundary = 8; // left edge width + left inset
2995 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2996
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002997 enum WindowHorizontalLocation {
2998 DEFAULT_LOCATION = 0;
2999 LEFT = 1;
3000 RIGHT = 2;
3001 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003002 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003003}
3004
3005message ExclusionRectStateChanged {
3006 optional string component_name = 1; // if not available, simply packageName
3007 optional int32 requested_height = 2; // px
3008 optional int32 rejected_height = 3; // px
3009
3010 enum WindowHorizontalLocation {
3011 DEFAULT_LOCATION = 0;
3012 LEFT = 1;
3013 RIGHT = 2;
3014 }
3015 optional WindowHorizontalLocation x_location = 4;
3016 optional bool landscape = 5;
3017 optional bool splitscreen = 6;
3018 optional int32 duration_millis = 7;
3019}
3020
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003021/**
3022 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3023 *
3024 * Logged from:
3025 * packages/apps/Launcher3
3026 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003027message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003028 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003029 optional android.stats.launcher.LauncherState src_state = 2;
3030 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003031 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3032 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3033
3034 // The event id (e.g., app launch, drag and drop, long press)
3035 optional int32 event_id = 6;
3036 // The event's source or target id (e.g., icon, task, button)
3037 optional int32 target_id = 7;
3038 // If the target needs to be tracked, use this id field
3039 optional int32 instance_id = 8;
3040 optional int32 uid = 9 [(is_uid) = true];
3041 optional string package_name = 10;
3042 optional string component_name = 11;
3043
3044 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003045 optional int32 grid_x = 12 [default = -1];
3046 optional int32 grid_y = 13 [default = -1];
3047 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003048
3049 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003050 optional int32 grid_x_parent = 15 [default = -1];
3051 optional int32 grid_y_parent = 16 [default = -1];
3052 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003053
3054 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3055 optional int32 hierarchy = 18;
3056
3057 optional bool is_work_profile = 19;
3058
3059 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003060 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003061
3062 // e.g., folderLabelState can be captured in the following two fields
3063 optional int32 from_state = 21;
3064 optional int32 to_state = 22;
3065
3066 // e.g., autofilled or suggested texts that are not user entered
3067 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003068
3069 // e.g., number of contents inside a container (e.g., icons inside a folder)
3070 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003071}
3072
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003073/**
3074 * Used for snapshot of the HomeScreen UI elements
3075 *
3076 * Logged from:
3077 * packages/apps/Launcher3
3078 */
3079message LauncherStaticLayout {
3080 // The event id (e.g., snapshot, drag and drop)
3081 optional int32 event_id = 1;
3082 // The event's source or target id (e.g., icon, shortcut, widget)
3083 optional int32 target_id = 2;
3084 // If the target needs to be tracked, use this id field
3085 optional int32 instance_id = 3;
3086 optional int32 uid = 4 [(is_uid) = true];
3087 optional string package_name = 5;
3088 optional string component_name = 6;
3089
3090 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003091 optional int32 grid_x = 7 [default = -1];
3092 optional int32 grid_y = 8 [default = -1];
3093 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003094
3095 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003096 // e.g., when used with widgets target, use these values for (span_x, span_y)
3097 optional int32 grid_x_parent = 10 [default = -1];
3098 optional int32 grid_y_parent = 11 [default = -1];
3099 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003100
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003101 // UNKNOWN = 0
3102 // HOTSEAT = 1
3103 // WORKSPACE = 2
3104 // FOLDER_HOTSEAT = 3
3105 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003106 optional int32 hierarchy = 13;
3107
3108 optional bool is_work_profile = 14;
3109
3110 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3111 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003112
3113 // e.g., number of icons inside a folder
3114 optional int32 cardinality = 16;
3115
3116 // e.g., (x, y) span of the widget inside homescreen grid system
3117 optional int32 span_x = 17 [default = 1];
3118 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003119}
3120
3121/**
3122 * Logs when Wallpaper or ThemePicker UI has changed.
3123 *
3124 * Logged from:
3125 * packages/apps/ThemePicker
3126 * packages/apps/WallpaperPicker2
3127 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003128message StyleUIChanged {
3129 optional android.stats.style.Action action = 1;
3130 optional int32 color_package_hash = 2;
3131 optional int32 font_package_hash = 3;
3132 optional int32 shape_package_hash = 4;
3133 optional int32 clock_package_hash = 5;
3134 optional int32 launcher_grid = 6;
3135 optional int32 wallpaper_category_hash = 7;
3136 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003137 optional int32 color_preference = 9;
3138 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003139}
3140
David Chenc28b2bb2017-10-24 12:52:52 -07003141/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003142 * Logs when Settings UI has changed.
3143 *
3144 * Logged from:
3145 * packages/apps/Settings
3146 */
3147message SettingsUIChanged {
3148 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003149 * Where this SettingsUIChange event comes from. For example, if
3150 * it's a PAGE_VISIBLE event, where the page is opened from.
3151 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003152 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003153
3154 /**
3155 * What the UI action is.
3156 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003157 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003158
3159 /**
3160 * Where the action is happening
3161 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003162 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003163
3164 /**
3165 * What preference changed in this event.
3166 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003167 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003168
3169 /**
3170 * The new value of the changed preference.
3171 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003172 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003173}
3174
3175/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003176 * Logs basic timing information about touch events.
3177 * Reported at most every 5 minutes while device is being interacted with.
3178 *
3179 * Logged from:
3180 * frameworks/native/services/inputflinger
3181 */
3182message TouchEventReported {
3183 /**
3184 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003185 * and the standard deviation of the time spent processing touchscreen events
3186 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003187 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003188 * On supported devices, the starting point is taken during the hard interrupt inside the
3189 * kernel touch driver. On all other devices, the starting point is taken inside
3190 * the kernel's input event subsystem upon receipt of the input event.
3191 * The ending point is taken inside InputDispatcher, just after the input event
3192 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003193 */
3194 // Minimum value
3195 optional float latency_min_micros = 1;
3196 // Maximum value
3197 optional float latency_max_micros = 2;
3198 // Average value
3199 optional float latency_mean_micros = 3;
3200 // Standard deviation
3201 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003202 // Number of touch events (input_event) in this report
3203 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003204}
3205
3206/**
Philip Quinn0eded622019-01-29 12:46:28 -08003207 * Logs gesture classification and timing information for touch events.
3208 *
3209 * Logged from:
3210 * frameworks/base/core/java/android/view/GestureDetector.java
3211 * frameworks/base/core/java/android/view/View.java
3212 */
3213message TouchGestureClassified {
3214 // The source of the classification (e.g. Java class name).
3215 optional string source = 1;
3216
3217 enum Classification {
3218 UNKNOWN_CLASSIFICATION = 0;
3219 SINGLE_TAP = 1;
3220 DOUBLE_TAP = 2;
3221 LONG_PRESS = 3;
3222 DEEP_PRESS = 4;
3223 SCROLL = 5;
3224 }
3225 // The classification of the gesture.
3226 optional Classification classification = 2;
3227
3228 // The interval from the start of a touch event stream until the
3229 // classification was made.
3230 optional int32 latency_millis = 3;
3231
3232 // The distance from the location of the first touch event to the
3233 // location of the touch event when the classification was made.
3234 optional float displacement_px = 4;
3235}
3236
3237/**
David Chenc28b2bb2017-10-24 12:52:52 -07003238 * Logs that a setting was updated.
3239 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003240 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003241 * The tag and is_default allow resetting of settings to default values based on the specified
3242 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3243 */
3244message SettingChanged {
3245 // The name of the setting.
3246 optional string setting = 1;
3247
3248 // The change being imposed on this setting. May represent a number, eg "3".
3249 optional string value = 2;
3250
3251 // The new value of this setting. For most settings, this is same as value. For some settings,
3252 // value is +X or -X where X represents an element in a set. For example, if the previous value
3253 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3254 // The +/- feature is currently only used for location_providers_allowed.
3255 optional string new_value = 3;
3256
3257 // The previous value of this setting.
3258 optional string prev_value = 4;
3259
3260 // The tag used with the is_default for resetting sets of settings. This is generally null.
3261 optional string tag = 5;
3262
Bookatz90867622018-01-31 15:05:57 -08003263 // True if this setting with tag should be resettable.
3264 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003265
David Chenbd789912018-03-16 17:19:55 -07003266 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003267 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003268
3269 enum ChangeReason {
3270 UPDATED = 1; // Updated can be an insertion or an update.
3271 DELETED = 2;
3272 }
3273 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003274}
Chenjie Yub3dda412017-10-24 13:41:59 -07003275
Chenjie Yu05013b32017-11-21 10:21:41 -08003276/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003277 * Logs activity going to foreground or background
3278 *
3279 * Logged from:
3280 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3281 */
3282message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003283 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003284 optional string pkg_name = 2;
3285 optional string class_name = 3;
3286
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003287 enum State {
3288 BACKGROUND = 0;
3289 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003290 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003291 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003292}
David Chenc8a43242017-10-17 16:23:28 -07003293
3294/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003295 * Logs when a volume entered low Storage state.
3296 * Logged from:
3297 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3298 */
3299message LowStorageStateChanged {
3300 // Volume that ran out of storage.
3301 optional string volume_description = 1;
3302
3303 enum State {
3304 UNKNOWN = 0;
3305 OFF = 1;
3306 ON = 2;
3307 }
3308 optional State state = 2;
3309}
3310
3311/**
3312 * Logs when an app is downgraded.
3313 * Logged from:
3314 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3315 */
3316message AppDowngraded {
3317 optional string package_name = 1;
3318 // Size of the package (all data) before being downgraded.
3319 optional int64 size_in_bytes_before = 2;
3320 // Size of the package (all data) after being downgraded.
3321 optional int64 size_in_bytes_after = 3;
3322
3323 optional bool aggressive = 4;
3324}
3325
3326/**
3327 * Logs when an app is optimized after being downgraded.
3328 * Logged from:
3329 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3330 */
3331message AppOptimizedAfterDowngraded {
3332 optional string package_name = 1;
3333}
3334
3335/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003336 * Logs whenever an app is installed on external storage.
3337 * Logged from:
3338 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3339 */
3340message AppInstallOnExternalStorageReported {
3341 // The type of external storage.
3342 optional android.stats.storage.ExternalStorageType storage_type = 1;
3343 // The name of the package that is installed on the sd card.
3344 optional string package_name = 2;
3345}
3346
3347/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003349 * Logged from:
3350 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3351 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003352message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003353 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003354
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003355 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003356
3357 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003358 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003359 optional string process_name = 3;
3360
3361 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003362 optional int32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003363
3364 optional string package_name = 5;
3365
3366 enum InstantApp {
3367 UNAVAILABLE = 0;
3368 FALSE = 1;
3369 TRUE = 2;
3370 }
3371 optional InstantApp is_instant_app = 6;
3372
3373 enum ForegroundState {
3374 UNKNOWN = 0;
3375 BACKGROUND = 1;
3376 FOREGROUND = 2;
3377 }
3378 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003379
3380 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381}
David Chen9e3808c2017-11-20 17:25:34 -08003382
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003383/**
3384 * Logs when a WTF (What a Terrible Failure) happened.
3385 * Logged from:
3386 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3387 */
3388message WTFOccurred {
3389 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003390
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003391 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003392
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003393 // The name of the process.
3394 // system_server if it is not by an app
3395 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003396
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003397 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003398 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003399
3400 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003401}
3402
3403/**
3404 * Logs when system server reports low memory.
3405 * Logged from:
3406 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3407 */
3408message LowMemReported {
3409}
3410
3411/**
3412 * Logs when an app ANR (App Not Responding) occurs.
3413 * Logged from:
3414 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3415 */
3416message ANROccurred {
3417 optional int32 uid = 1 [(is_uid) = true];
3418
3419 optional string process_name = 2;
3420
3421 optional string short_component_name = 3;
3422
3423 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003424
3425 enum InstantApp {
3426 UNAVAILABLE = 0;
3427 FALSE = 1;
3428 TRUE = 2;
3429 }
3430 optional InstantApp is_instant_app = 5;
3431
3432 enum ForegroundState {
3433 UNKNOWN = 0;
3434 BACKGROUND = 1;
3435 FOREGROUND = 2;
3436 }
3437 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003438
3439 optional android.server.ErrorSource error_source = 7;
3440
3441 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003442}
3443
Bookatza7020bd2018-08-28 16:29:35 -07003444/**
3445 * Logs when the vibrator state changes.
3446 * Logged from:
3447 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3448 */
3449message VibratorStateChanged {
3450 repeated AttributionNode attribution_node = 1;
3451
3452 enum State {
3453 OFF = 0;
3454 ON = 1;
3455 }
3456 optional State state = 2;
3457
3458 // Duration (in milliseconds) requested to keep the vibrator on.
3459 // Only applicable for State == ON.
3460 optional int64 duration_millis = 3;
3461}
3462
David Chen0a368b22017-12-06 16:28:16 -08003463/*
3464 * Allows other apps to push events into statsd.
3465 * Logged from:
3466 * frameworks/base/core/java/android/util/StatsLog.java
3467 */
David Chen0b5c90c2018-01-25 16:51:49 -08003468message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003469 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003470 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003471
3472 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3473 optional int32 label = 2;
3474
3475 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3476 // predicates for the metrics).
3477 enum State {
3478 UNKNOWN = 0;
3479 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3480 STOP = 2;
3481 START = 3;
3482 }
3483 optional State state = 3;
3484}
3485
David Chen9e3808c2017-11-20 17:25:34 -08003486/**
Bookatz7948c872018-09-04 12:58:33 -07003487 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3488 * For example, this could be due to the user manually changing the time.
3489 *
3490 * Logged from:
3491 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3492 */
3493message WallClockTimeShifted {
3494 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3495 optional int64 wall_clock_timestamp_millis = 1;
3496}
3497
3498/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003499 * Logs when statsd detects an anomaly.
3500 *
3501 * Logged from:
3502 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3503 */
3504message AnomalyDetected {
3505 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003506 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003507
Yangster-mac94e197c2018-01-02 16:03:03 -08003508 // Id of the config whose anomaly detection alert fired.
3509 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003510
Yangster-mac94e197c2018-01-02 16:03:03 -08003511 // Id of the alert (i.e. name of the anomaly that was detected).
3512 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003513}
3514
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003515message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003516 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003517 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003518
3519 // The app package name.
3520 optional string pkg_name = 2;
3521
3522 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003523 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003524 WARM = 1;
3525 HOT = 2;
3526 COLD = 3;
3527 }
3528 // The transition type.
3529 optional TransitionType type = 3;
3530
3531 // The activity name.
3532 optional string activity_name = 4;
3533
3534 // The name of the calling app. Empty if not set.
3535 optional string calling_pkg_name = 5;
3536
3537 // Whether the app is an instant app.
3538 optional bool is_instant_app = 6;
3539
3540 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003541 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003542
Bookatz80d11a02018-01-16 10:46:35 -08003543 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544
David Chen0b5c90c2018-01-25 16:51:49 -08003545 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003546 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003547 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003548 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003549 optional int32 bind_application_delay_millis = 11;
3550 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003551
3552 // Empty if not set.
3553 optional string launch_token = 13;
3554
Calin Juravle759fbda2018-02-20 19:52:30 +00003555 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003556 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003557
3558 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003559 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003560}
3561
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003562message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003563 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003564 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003565
3566 // The app package name.
3567 optional string pkg_name = 2;
3568
3569 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003570 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003571 WARM = 1;
3572 HOT = 2;
3573 COLD = 3;
3574 }
3575 // The transition type.
3576 optional TransitionType type = 3;
3577
3578 // The activity name.
3579 optional string activity_name = 4;
3580}
3581
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003582message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003583 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003584 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003585
3586 // The app package name.
3587 optional string pkg_name = 2;
3588
3589 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003590 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003591 WITH_BUNDLE = 1;
3592 WITHOUT_BUNDLE = 2;
3593 }
3594 // The transition type.
3595 optional TransitionType type = 3;
3596
3597 // The activity name.
3598 optional string activity_name = 4;
3599
3600 optional bool transition_process_running = 5;
3601
3602 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003603 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003604}
3605
Bookatz8fcd09a2017-12-18 13:01:10 -08003606/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003607 * Logs a picture-in-picture action
3608 * Logged from:
3609 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3610 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3611 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3612 */
3613message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003614 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003615 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003616
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003617 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003618
Chenjie Yu52cacc62017-12-08 18:11:45 -08003619 enum State {
3620 ENTERED = 1;
3621 EXPANDED_TO_FULL_SCREEN = 2;
3622 MINIMIZED = 3;
3623 DISMISSED = 4;
3624 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003625 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003626}
3627
3628/**
Chenjie Yue8904192017-12-08 19:12:57 -08003629 * Logs overlay action
3630 * Logged from:
3631 * services/core/java/com/android/server/wm/Session.java
3632 */
3633message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003634 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003635
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003636 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003637
3638 optional bool using_alert_window = 3;
3639
3640 enum State {
3641 ENTERED = 1;
3642 EXITED = 2;
3643 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003644 optional State state = 4
3645 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003646}
3647
Adam Bookatz38767932020-02-05 12:13:40 -08003648/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003649 * Logs foreground service starts and stops.
3650 * Note that this is not when a service starts or stops, but when it is
3651 * considered foreground.
3652 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003653 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003654 */
3655message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003656 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003657 // package_name + "/" + class_name
3658 optional string short_name = 2;
3659
3660 enum State {
3661 ENTER = 1;
3662 EXIT = 2;
3663 }
3664 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003665
3666 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3667 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3668 optional bool allow_while_in_use_permission = 4;
3669}
3670
3671/**
3672 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3673 * A foreground service session is any continuous period during which the uid holds at least one
3674 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3675 * Accesses initiated while the uid is in the TOP state are ignored.
3676 * Sessions with no attempted accesses are not logged.
3677 * Logged from
3678 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3679 */
3680message ForegroundServiceAppOpSessionEnded {
3681 optional int32 uid = 1 [(is_uid) = true];
3682
3683 // The operation's name.
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00003684 // Only following four ops are logged
3685 // COARSE_LOCATION = 0
3686 // FINE_LOCATION = 1
3687 // CAMERA = 26
3688 // RECORD_AUDIO = 27
3689 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003690
3691 // The uid's permission mode for accessing the AppOp during this fgs session.
3692 enum Mode {
3693 MODE_UNKNOWN = 0;
3694 MODE_ALLOWED = 1; // Always allowed
3695 MODE_IGNORED = 2; // Denied
3696 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3697 }
3698 optional Mode app_op_mode = 3;
3699
3700 // Number of times this AppOp was requested and allowed.
3701 optional int32 count_ops_accepted = 4;
3702 // Number of times this AppOp was requested but denied.
3703 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003704}
3705
Chenjie Yue8904192017-12-08 19:12:57 -08003706/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003707 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3708 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3709 * attributed back to the parent (host) uid. One example is Chrome.
3710 *
3711 * Logged from:
3712 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3713 */
3714message IsolatedUidChanged {
3715 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003716 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003717 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003718 optional int32 parent_uid = 1;
3719
3720 optional int32 isolated_uid = 2;
3721
3722 // We expect an isolated uid to be removed before if it's used for another parent uid.
3723 enum Event {
3724 REMOVED = 0;
3725 CREATED = 1;
3726 }
3727 optional Event event = 3;
3728}
3729
3730/*
3731 * Logs the reception of an incoming network packet causing the main system to wake up for
3732 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3733 * and processed by WakeupController.cpp.
3734 */
3735message PacketWakeupOccurred {
3736 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3737 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003738 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003739 // The interface name on which the packet was received.
3740 optional string iface = 2;
3741 // The ethertype value of the packet.
3742 optional int32 ethertype = 3;
3743 // String representation of the destination MAC address of the packet.
3744 optional string destination_hardware_address = 4;
3745 // String representation of the source address of the packet if this was an IP packet.
3746 optional string source_ip = 5;
3747 // String representation of the destination address of the packet if this was an IP packet.
3748 optional string destination_ip = 6;
3749 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3750 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3751 // families.
3752 optional int32 ip_next_header = 7;
3753 // The source port if this was a TCP or UDP packet.
3754 optional int32 source_port = 8;
3755 // The destination port if this was a TCP or UDP packet.
3756 optional int32 destination_port = 9;
3757}
3758
3759/*
3760 * Logs the memory stats for an app on startup.
3761 * Logged from:
3762 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3763 */
3764message AppStartMemoryStateCaptured {
3765 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003766 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003767
3768 // The process name.
3769 optional string process_name = 2;
3770
3771 // The activity name.
3772 optional string activity_name = 3;
3773
3774 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003775 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003776
3777 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003778 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003779
3780 // RSS
3781 optional int64 rss_in_bytes = 6;
3782
3783 // CACHE
3784 optional int64 cache_in_bytes = 7;
3785
3786 // SWAP
3787 optional int64 swap_in_bytes = 8;
3788}
3789
3790/*
3791 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3792 * for LMK event.
3793 * Logged from:
3794 * system/core/lmkd/lmkd.c
3795 */
3796message LmkStateChanged {
3797 enum State {
3798 UNKNOWN = 0;
3799 START = 1;
3800 STOP = 2;
3801 }
3802 optional State state = 1;
3803}
3804
3805/*
3806 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3807 * Logged from:
3808 * system/core/lmkd/lmkd.c
3809 */
3810message LmkKillOccurred {
3811 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003812 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003813
3814 // The process name.
3815 optional string process_name = 2;
3816
3817 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003818 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003819
3820 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003821 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003822
3823 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003824 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003825
3826 // RSS
3827 optional int64 rss_in_bytes = 6;
3828
3829 // CACHE
3830 optional int64 cache_in_bytes = 7;
3831
3832 // SWAP
3833 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003834
3835 // The elapsed real time of start of the process.
3836 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003837
3838 // Min oom adj score considered by lmkd.
3839 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003840}
3841
Rajeev Kumar51b54602018-03-01 12:18:26 -08003842/*
3843 * Logs when the ActivityManagerService detects that an app died.
3844 *
3845 * Logged from:
3846 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3847 */
3848message AppDied {
3849 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003850 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003851}
3852
Howard Ro21a039c2018-08-06 14:55:47 -07003853/**
3854 * An atom for generic metrics logging. Available from Android Q.
3855 */
3856message GenericAtom {
3857 // The uid of the application that sent this custom atom.
3858 optional int32 uid = 1 [(is_uid) = true];
3859
3860 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003861 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003862}
3863
Tej Singhd6d6d772018-09-05 17:41:25 -07003864/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003865 * Atom for simple logging of user interaction and impression events, such as "the user touched
3866 * this button" or "this dialog was displayed".
3867 * Keep the UI event stream clean: don't use for system or background events.
3868 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003869 *
3870 * Logged from:
3871 * frameworks/base/services/core/java/com/android/server/
3872 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003873 */
3874message UiEventReported {
3875 // The event_id.
3876 optional int32 event_id = 1;
3877 // The event's source or target uid and package, if applicable.
3878 // For example, the package posting a notification, or the destination package of a share.
3879 optional int32 uid = 2 [(is_uid) = true];
3880 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003881 // An identifier used to disambiguate which logs refer to a particular instance of some
3882 // UI element. Useful when there might be multiple instances simultaneously active.
3883 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003884}
3885
3886/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003887 * Reports a notification was created or updated.
3888 *
3889 * Logged from:
3890 * frameworks/base/services/core/java/com/android/server/notification/
3891 */
3892message NotificationReported {
3893 // The event_id (as for UiEventReported).
3894 optional int32 event_id = 1;
3895 // The notifying app's uid and package.
3896 optional int32 uid = 2 [(is_uid) = true];
3897 optional string package_name = 3;
3898 // A small system-assigned identifier for the notification.
3899 // Locally probably-unique, but expect collisions across users and/or days.
3900 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003901 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3902 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003903
3904 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003905 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3906 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3907 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003908
3909 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003910 optional string category = 10; // App-assigned notification category (API-defined strings)
3911 optional int32 style = 11; // App-assigned notification style
3912 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003913
3914 // Ordering, importance and interruptiveness
3915
Will Brockman7614f6962020-02-10 19:43:03 -05003916 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003917
Will Brockman7614f6962020-02-10 19:43:03 -05003918 optional android.stats.sysui.NotificationImportance importance = 14;
3919 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003920
3921 enum NotificationImportanceExplanation {
3922 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3923 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3924 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3925 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3926 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3927 // Like _APP, but based on pre-channels priority signal.
3928 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3929 }
3930
Will Brockman7614f6962020-02-10 19:43:03 -05003931 optional NotificationImportanceExplanation importance_source = 16;
3932 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3933 optional NotificationImportanceExplanation importance_initial_source = 18;
3934 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3935 optional int32 assistant_hash = 20;
3936 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003937}
3938
3939message Notification {
3940 // The notifying app's uid and package.
3941 optional int32 uid = 1 [(is_uid) = true];
3942 optional string package_name = 2;
3943 // A small system-assigned identifier for the notification.
3944 optional int32 instance_id = 3;
3945
3946 // Grouping information.
3947 optional int32 group_instance_id = 4;
3948 optional bool is_group_summary = 5;
3949
3950 // The section of the shade that the notification is in.
3951 // See NotificationSectionsManager.PriorityBucket.
3952 enum NotificationSection {
3953 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003954 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003955 SECTION_MEDIA_CONTROLS = 2;
3956 SECTION_PEOPLE = 3;
3957 SECTION_ALERTING = 4;
3958 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003959 }
3960 optional NotificationSection section = 6;
3961}
3962
3963message NotificationList {
3964 repeated Notification notifications = 1; // An ordered sequence of notifications.
3965}
3966
3967/**
3968 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3969 *
3970 * Logged from:
3971 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3972 */
3973message NotificationPanelReported {
3974 // The event_id (as for UiEventReported).
3975 optional int32 event_id = 1;
3976 optional int32 num_notifications = 2;
3977 // The notifications in the panel, in the order that they appear there.
3978 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3979}
3980
3981/**
3982 * Reports a notification channel, or channel group, was created, updated, or deleted.
3983 *
3984 * Logged from:
3985 * frameworks/base/services/core/java/com/android/server/notification/
3986 */
3987message NotificationChannelModified {
3988 // The event_id (as for UiEventReported).
3989 optional int32 event_id = 1;
3990 // The notifying app's uid and package.
3991 optional int32 uid = 2 [(is_uid) = true];
3992 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003993 // Hash of app-assigned notification channel ID or channel-group ID
3994 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003995 // Previous importance setting, if applicable
3996 optional android.stats.sysui.NotificationImportance old_importance = 5;
3997 // New importance setting
3998 optional android.stats.sysui.NotificationImportance importance = 6;
3999}
4000
4001
4002/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004003 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004004 *
4005 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004006 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004007 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004008message BiometricAcquired {
4009 // Biometric modality that was acquired.
4010 optional android.hardware.biometrics.ModalityEnum modality = 1;
4011 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4012 optional int32 user = 2;
4013 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4014 optional bool is_crypto = 3;
4015 // Action that the device is performing. Acquired messages are only expected for enroll and
4016 // authenticate. Other actions may indicate an error.
4017 optional android.hardware.biometrics.ActionEnum action = 4;
4018 // The client that this acquisition was received for.
4019 optional android.hardware.biometrics.ClientEnum client = 5;
4020 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4021 optional int32 acquire_info = 6;
4022 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4023 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004024 // Dictates if this message should trigger additional debugging.
4025 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004026}
4027
4028/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004029 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004030 *
4031 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004032 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004033 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004034message BiometricAuthenticated {
4035 // Biometric modality that was used.
4036 optional android.hardware.biometrics.ModalityEnum modality = 1;
4037 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4038 optional int32 user = 2;
4039 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4040 // storage.
4041 optional bool is_crypto = 3;
4042 // The client that this acquisition was received for.
4043 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004044 // If authentication requires user confirmation. See BiometricPrompt's
4045 // setRequireConfirmation(bool) method.
4046 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004047
Kevin Chyn1741a072019-01-17 11:54:40 -08004048 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004049 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004050 REJECTED = 1;
4051 PENDING_CONFIRMATION = 2;
4052 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004053 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004054
4055 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004056 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004057 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4058 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4059 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4060 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004061 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004062 // Dictates if this message should trigger additional debugging.
4063 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004064}
4065
4066/**
4067 * Logs when a biometric error occurs.
4068 *
4069 * Logged from:
4070 * frameworks/base/services/core/java/com/android/server/biometrics
4071 */
4072message BiometricErrorOccurred {
4073 // Biometric modality that was used.
4074 optional android.hardware.biometrics.ModalityEnum modality = 1;
4075 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4076 optional int32 user = 2;
4077 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4078 optional bool is_crypto = 3;
4079 // Action that the device is performing.
4080 optional android.hardware.biometrics.ActionEnum action = 4;
4081 // The client that this acquisition was received for.
4082 optional android.hardware.biometrics.ClientEnum client = 5;
4083 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4084 // are unique to modality.
4085 optional int32 error_info = 6;
4086 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4087 // by the vendor and not specified by the HIDL interface.
4088 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004089 // Dictates if this message should trigger additional debugging.
4090 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004091 // Time spent during the authentication attempt.
4092 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004093}
4094
4095/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004096 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004097 * Logged from:
4098 * frameworks/base/services/core/java/com/android/server/biometrics
4099 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004100message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004101 // Biometric modality.
4102 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004103 // Type of issue detected.
4104 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004105 // Dictates if this message should trigger additional debugging.
4106 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004107}
Howard Ro688ae182018-09-25 00:09:36 -07004108
joshmccloskey6f952b22019-03-25 20:59:35 -07004109/**
4110 * Logs when a biometric enrollment occurs.
4111 *
4112 * Logged from:
4113 * frameworks/base/services/core/java/com/android/server/biometrics
4114 */
4115message BiometricEnrolled {
4116 // Biometric modality that was used.
4117 optional android.hardware.biometrics.ModalityEnum modality = 1;
4118 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4119 optional int32 user = 2;
4120 // The amount of time the enrollment took in milliseconds.
4121 optional int64 latency_millis = 3;
4122 // Whether or not the enrollment was successful.
4123 optional bool success = 4;
4124}
4125
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004126/*
Tej Singh0d176952019-01-16 19:10:54 -08004127 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004128 */
Tej Singh0d176952019-01-16 19:10:54 -08004129message FlagFlipUpdateOccurred {
4130 // If the event is from a flag config package, specify the package name.
4131 optional string flag_flip_package_name = 1;
4132
4133 // The order id of the package
4134 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004135}
4136
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004137/**
4138 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004139 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004140 */
4141message TrainExperimentIds {
4142 repeated int64 experiment_id = 1;
4143}
4144
Yangster-macb89807e2018-11-15 21:10:57 -08004145/*
4146 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004147 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004148 */
4149message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004150 // Name of the train.
4151 optional string train_name = 1;
4152 // Version code for a "train" of packages that need to be installed atomically
4153 optional int64 train_version_code = 2;
4154 // After installation of this package, device requires a restart.
4155 optional bool requires_staging = 3;
4156 // Rollback should be enabled for this install.
4157 optional bool rollback_enabled = 4;
4158 // Requires low latency monitoring if possible.
4159 optional bool requires_low_latency_monitor = 5;
4160
Yangster-macb89807e2018-11-15 21:10:57 -08004161 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004162 UNKNOWN = 0;
4163 INSTALL_REQUESTED = 1;
4164 INSTALL_STARTED = 2;
4165 INSTALL_STAGED_NOT_READY = 3;
4166 INSTALL_STAGED_READY = 4;
4167 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004168 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4169 // and INSTALL_FAILURE_COMMIT.
4170 INSTALL_FAILURE = 6 [deprecated = true];
4171 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004172 INSTALL_CANCELLED = 7;
4173 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004174 INSTALLER_ROLLBACK_INITIATED = 9;
4175 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4176 INSTALLER_ROLLBACK_STAGED = 11;
4177 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4178 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4179 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4180 INSTALLER_ROLLBACK_SUCCESS = 15;
4181 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004182 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4183 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4184 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4185 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4186 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4187 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004188 INSTALL_FAILURE_DOWNLOAD = 23;
4189 INSTALL_FAILURE_STATE_MISMATCH = 24;
4190 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004191 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004192 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004193 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004194 // Possible experiment ids for monitoring this push.
4195 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4196 // user id
4197 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004198 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004199 // Whether or not this is a rollback event
4200 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004201}
4202
Tej Singhc9203082019-05-03 13:42:23 -07004203/* Test atom, is not logged anywhere */
4204message TestAtomReported {
4205 repeated AttributionNode attribution_node = 1;
4206 optional int32 int_field = 2;
4207 optional int64 long_field = 3;
4208 optional float float_field = 4;
4209 optional string string_field = 5;
4210 optional bool boolean_field = 6;
4211 enum State {
4212 UNKNOWN = 0;
4213 OFF = 1;
4214 ON = 2;
4215 }
4216 optional State state = 7;
4217 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4218}
4219
Maggie Whitefc1aa592018-11-28 21:55:23 -08004220/** Represents USB port overheat event. */
4221message UsbPortOverheatEvent {
4222 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4223 optional int32 plug_temperature_deci_c = 1;
4224
4225 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4226 optional int32 max_temperature_deci_c = 2;
4227
4228 /* Time between USB plug event and overheat threshold trip, in seconds. */
4229 optional int32 time_to_overheat_secs = 3;
4230
4231 /* Time between overheat threshold trip and hysteresis, in seconds. */
4232 optional int32 time_to_hysteresis_secs = 4;
4233
4234 /* Time between hysteresis and active mitigation ending, in seconds. */
4235 optional int32 time_to_inactive_secs = 5;
4236};
4237
Maggie White8735b852019-01-18 11:40:49 -08004238/**
4239 * Logs total effective full charge and discharge cycles on a battery.
4240 * Here are some examples of one effective cycle:
4241 * 1) the battery charges from 0% to 100% and drains back to 0%,
4242 * 2) charging from 50% to 100% and draining back to 50% twice.
4243 * Pulled from:
4244 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4245 */
4246message BatteryCycleCount {
4247 /* Number of total charge and discharge cycles on the system battery. */
4248 optional int32 cycle_count = 1;
4249}
4250
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004251/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004252 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4253 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004254 * Pulled from:
4255 * StatsCompanionService
4256 */
4257
Carmen Agimof12dec122019-03-06 16:14:38 +00004258message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004259
Carmen Agimof12dec122019-03-06 16:14:38 +00004260 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004261 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004262 PUBLIC = 1;
4263 PRIVATE = 2;
4264 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004265 }
4266
Carmen Agimof12dec122019-03-06 16:14:38 +00004267 // The type of external storage.
4268 optional android.stats.storage.ExternalStorageType storage_type = 1;
4269 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4270 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004271 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004272 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004273}
4274
Yangster-macb89807e2018-11-15 21:10:57 -08004275/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004276 * Logs when a connection becomes available and lost.
4277 * Logged in StatsCompanionService.java
4278 */
4279message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004280 // Id of the network.
4281 optional int32 net_id = 1;
4282
4283 enum State {
4284 UNKNOWN = 0;
4285 CONNECTED = 1;
4286 DISCONNECTED = 2;
4287 }
4288 // Connected state of a network.
4289 optional State state = 2;
4290}
4291
4292/**
4293 * Logs when a service starts and stops.
4294 * Logged from:
4295 * services/core/java/com/android/server/am/ActiveServices.java
4296 */
4297message ServiceStateChanged {
4298
4299 optional int32 uid = 1 [(is_uid) = true];
4300
4301 optional string package_name = 2;
4302
4303 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004304
4305 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004306 START = 1;
4307 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004308 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004309
4310 optional State state = 4;
4311}
4312
4313/**
4314 * Logs when a service is launched.
4315 * Logged from:
4316 * services/core/java/com/android/server/am/ActiveServices.java
4317 */
4318message ServiceLaunchReported {
4319
4320 optional int32 uid = 1 [(is_uid) = true];
4321
4322 optional string package_name = 2;
4323
4324 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004325}
Howard Ro688ae182018-09-25 00:09:36 -07004326
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004327/**
4328 * Logs when a hidden API is used.
4329 *
4330 * Logged from:
4331 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4332 */
4333message HiddenApiUsed {
4334 // The uid of the app making the hidden access.
4335 optional int32 uid = 1 [(is_uid) = true];
4336
4337 // Signature of the method or field accessed.
4338 optional string signature = 2;
4339
4340 enum AccessMethod {
4341 NONE = 0;
4342 REFLECTION = 1;
4343 JNI = 2;
4344 LINKING = 3;
4345 }
4346
4347 // Type of access.
4348 optional AccessMethod access_method = 3;
4349
4350 // Whether the access was prevented or not.
4351 optional bool access_denied = 4;
4352}
4353
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004354/**
4355 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4356 * - When user sees privacy chip
4357 * - When user clicks privacy chip
4358 * - How does the user exit the Privacy Dialog
4359 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004360 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4361 */
4362message PrivacyIndicatorsInteracted {
4363
4364 enum Type {
4365 UNKNOWN = 0;
4366 CHIP_VIEWED = 1;
4367 CHIP_CLICKED = 2;
4368 DIALOG_PRIVACY_SETTINGS = 3;
4369 DIALOG_DISMISS = 4;
4370 DIALOG_LINE_ITEM = 5;
4371 }
4372
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004373 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004374
4375 // Used if the type is LINE_ITEM
4376 optional string package_name = 2;
4377}
4378
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004379/**
4380 * Logs information about a package that is moved from the internal to external storage and vice
4381 * versa.
4382 * It logs the package name, the type of the external storage where the package is installed
4383 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4384 * and the move type: if it's from internal to external or the other way around.
4385 *
4386 * Logged from:
4387 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4388 */
4389message AppMovedStorageReported {
4390 enum MoveType {
4391 UNKNOWN = 0;
4392 TO_EXTERNAL = 1;
4393 TO_INTERNAL = 2;
4394 }
4395 // The type of the external storage.
4396 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4397 // The type of move.
4398 optional MoveType move_type = 2;
4399 // The name of the package that was moved.
4400 optional string package_name = 3;
4401}
4402
jianjin8f2dee02019-03-29 14:03:08 -07004403/**
4404 * Logs when system server watchdog occurs.
4405 * Logged from:
4406 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4407 */
4408message SystemServerWatchdogOccurred {
4409 optional string subject = 1;
4410}
4411
4412/**
4413 * Logs when new file added to tombstones.
4414 * Logged from:
4415 * frameworks/base/core/java/com/android/server/BootReceiver.java
4416 */
4417message TombStoneOccurred {
4418}
4419
Hai Zhang5d3328d2019-04-13 21:25:06 +08004420/*
4421 * Information about a role request
4422 *
4423 * Logged from:
4424 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4425 */
4426message RoleRequestResultReported {
4427 // UID of application requesting the role
4428 optional int32 requesting_uid = 1;
4429
4430 // Package name of application requesting the role
4431 optional string requesting_package_name = 2;
4432
4433 // The role to be granted
4434 optional string role_name = 3;
4435
4436 // The count of applications qualifying for the role
4437 optional int32 qualifying_count = 4;
4438
4439 // UID of application current granted the role
4440 optional int32 current_uid = 5;
4441
4442 // Package name of application current granted the role
4443 optional string current_package_name = 6;
4444
4445 // UID of another application that user chose to grant the role to, instead of the requesting
4446 // application
4447 optional int32 granted_another_uid = 7;
4448
4449 // Package name of another application that user chose to grant the role to, instead of the
4450 // requesting application
4451 optional string granted_another_package_name = 8;
4452
4453 enum Result {
4454 UNDEFINED = 0;
4455 // role request was ignored
4456 IGNORED = 1;
4457 // role request was ignored because it's already granted
4458 IGNORED_ALREADY_GRANTED = 2;
4459 // role request was ignored because the application isn't qualified
4460 IGNORED_NOT_QUALIFIED = 3;
4461 // role request was ignored because user said it should be always denied
4462 IGNORED_USER_ALWAYS_DENIED = 4;
4463 // role was granted by user action
4464 USER_GRANTED = 5;
4465 // role was denied by user action
4466 USER_DENIED = 6;
4467 // role was denied by user granting another application the role
4468 USER_DENIED_GRANTED_ANOTHER = 7;
4469 // role was denied and set to be always denied by the user
4470 USER_DENIED_WITH_ALWAYS = 8;
4471 }
4472 // The result of the role request
4473 optional Result result = 9;
4474}
4475
Mark Tabrya824a642019-11-05 12:26:12 -08004476/**
4477 * Logs when a Vehicle Maps Service client's connection state has changed
4478 *
4479 * Logged from:
4480 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4481 */
4482message VmsClientConnectionStateChanged {
4483 // The UID of the VMS client app
4484 optional int32 uid = 1 [(is_uid) = true];
4485
4486 enum State {
4487 UNKNOWN = 0;
4488 // Attempting to connect to the client
4489 CONNECTING = 1;
4490 // Client connection established
4491 CONNECTED = 2;
4492 // Client connection closed unexpectedly
4493 DISCONNECTED = 3;
4494 // Client connection closed by VMS
4495 TERMINATED = 4;
4496 // Error establishing the client connection
4497 CONNECTION_ERROR = 5;
4498 }
4499
4500 optional State state = 2;
4501}
4502
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004503/**
4504 * Logs when MediaProvider has successfully finished scanning a storage volume.
4505 *
4506 * Logged from:
4507 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4508 */
shafik43825842020-04-02 17:30:24 +01004509message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004510 enum Reason {
4511 // Scan triggered due to unknown reason
4512 UNKNOWN = 0;
4513 // Scan triggered due to storage volume being mounted
4514 MOUNTED = 1;
4515 // Scan triggered due to explicit user action or app request
4516 DEMAND = 2;
4517 // Scan triggered due to idle maintenance
4518 IDLE = 3;
4519 }
4520
4521 // Volume type that this event pertains to
4522 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4523 // Reason why this scan was triggered
4524 optional Reason reason = 2;
4525 // Total number of files scanned
4526 optional int64 item_count = 3;
4527 // Duration of scan, normalized per file
4528 optional float normalized_duration_millis = 4;
4529 // Number of database inserts, normalized per file
4530 optional float normalized_insert_count = 5;
4531 // Number of database updates, normalized per file
4532 optional float normalized_update_count = 6;
4533 // Number of database deletes, normalized per file
4534 optional float normalized_delete_count = 7;
4535}
4536
4537/**
4538 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4539 *
4540 * Logged from:
4541 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4542 */
shafik43825842020-04-02 17:30:24 +01004543message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004544 // Volume type that this event pertains to
4545 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004546 // UID of app that requested deletion
4547 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004548 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004549 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004550}
4551
4552/**
4553 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4554 *
4555 * Logged from:
4556 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4557 */
shafik43825842020-04-02 17:30:24 +01004558message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004559 enum Result {
4560 UNKNOWN = 0;
4561 USER_GRANTED = 1;
4562 AUTO_GRANTED = 2;
4563 USER_DENIED = 3;
4564 USER_DENIED_WITH_PREJUDICE = 4;
4565 AUTO_DENIED = 5;
4566 }
4567
4568 // Volume type that this event pertains to
4569 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004570 // UID of app that requested permission
4571 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004572 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004573 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004574 // Result of this request
shafik43825842020-04-02 17:30:24 +01004575 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004576}
4577
4578/**
4579 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4580 *
4581 * Logged from:
4582 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4583 */
shafik43825842020-04-02 17:30:24 +01004584message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004585 // Volume type that this event pertains to
4586 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4587 // Old database version code
4588 optional int32 version_from = 2;
4589 // New database version code
4590 optional int32 version_to = 3;
4591 // Total number of files in database
4592 optional int64 item_count = 4;
4593 // Duration of schema change, normalized per file
4594 optional float normalized_duration_millis = 5;
4595}
4596
4597/**
4598 * Logs when MediaProvider has finished an idle maintenance job.
4599 *
4600 * Logged from:
4601 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4602 */
shafik43825842020-04-02 17:30:24 +01004603message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004604 // Volume type that this event pertains to
4605 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4606
4607 // Total number of files in database
4608 optional int64 item_count = 2;
4609 // Duration of idle maintenance, normalized per file
4610 optional float normalized_duration_millis = 3;
4611 // Number of thumbnails found to be stale, normalized per file
4612 optional float normalized_stale_thumbnails = 4;
4613 // Number of items found to be expired, normalized per file
4614 optional float normalized_expired_media = 5;
4615}
4616
Keun young Park3e033cb2019-12-18 11:27:35 -08004617/**
4618 * Represents boot time event with duration in ms.
4619 *
4620 * Logged from: bootstat and various system server components. Check each enums for details.
4621 */
4622message BootTimeEventDuration {
4623 enum DurationEvent {
4624 UNKNOWN = 0;
4625 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4626 ABSOLUTE_BOOT_TIME = 1;
4627 // Bootloader's 1st stage execution time.
4628 // Logged from bootstat.
4629 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4630 // Bootloader's 1st stage loading time.
4631 // Logged from bootstat.
4632 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4633 // Bootloader's kernel loading time.
4634 // Logged from bootstat.
4635 BOOTLOADER_KERNEL_LOAD = 4;
4636 // Bootloader's 2nd stage execution time.
4637 // Logged from bootstat.
4638 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4639 // Bootloader's 2nd stage loading time.
4640 // Logged from bootstat.
4641 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4642 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4643 // for locked device.
4644 // Logged from bootstat.
4645 BOOTLOADER_UI_WAIT = 7;
4646 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4647 // Logged from bootstat.
4648 BOOTLOADER_TOTAL = 8;
4649 // Shutdown duration inside init for the reboot before the current boot up.
4650 // Logged from f/b/services/.../BootReceiver.java.
4651 SHUTDOWN_DURATION = 9;
4652 // Total time for mounting of disk devices during bootup.
4653 // Logged from f/b/services/.../BootReceiver.java.
4654 MOUNT_DEFAULT_DURATION = 10;
4655 // Total time for early stage mounting of disk devices during bootup.
4656 // Logged from f/b/services/.../BootReceiver.java.
4657 MOUNT_EARLY_DURATION = 11;
4658 // Total time for late stage mounting of disk devices during bootup.
4659 // Logged from f/b/services/.../BootReceiver.java.
4660 MOUNT_LATE_DURATION = 12;
4661 // Average time to scan non-system app after OTA
4662 // Logged from f/b/services/.../PackageManagerService.java
4663 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4664 // Time to initialize Package manager after OTA
4665 // Logged from f/b/services/.../PackageManagerService.java
4666 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4667 // Time to scan all system app from Package manager after OTA
4668 // Logged from f/b/services/.../PackageManagerService.java
4669 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4670 // Init's total time for cold boot stage.
4671 // Logged from bootstat.
4672 COLDBOOT_WAIT = 16;
4673 // Init's total time for initializing selinux.
4674 // Logged from bootstat.
4675 SELINUX_INIT = 17;
4676 // Time since last factory reset.
4677 // Logged from bootstat.
4678 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004679 // Init's total time spent for completing the 1st stage.
4680 // Logged from bootstat.
4681 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004682 }
4683
4684 // Type of the event.
4685 optional DurationEvent event = 1;
4686 // Duration of the event in ms.
4687 optional int64 duration_millis = 2;
4688}
4689
4690/**
4691 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4692 * since boot-up.
4693 *
4694 * Logged from: bootstat and various system server components. Check each enums for details.
4695 */
4696message BootTimeEventElapsedTime {
4697 enum ElapsedTimeEvent {
4698 UNKNOWN = 0;
4699 // Time when init starts 1st stage. Logged from bootstat.
4700 ANDROID_INIT_STAGE_1 = 1;
4701 // Time when sys.boot_completed prop is set.
4702 // Logged from bootstat.
4703 BOOT_COMPLETE = 2;
4704 // BOOT_COMPLETE for encrypted device.
4705 BOOT_COMPLETE_ENCRYPTION = 3;
4706 // BOOT_COMPLETE for device with no encryption.
4707 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4708 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004709 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004710 // BOOT_COMPLETE after factory reset.
4711 FACTORY_RESET_BOOT_COMPLETE = 6;
4712 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4713 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004714 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4715 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004716 // BOOT_COMPLETE after OTA.
4717 OTA_BOOT_COMPLETE = 9;
4718 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4719 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004720 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4721 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004722 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4723 // Logged from f/b/services/.../UserController.java
4724 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4725 // Time when the system starts sending BOOT_COMPLETED broadcast.
4726 // Logged from f/b/services/.../UserController.java
4727 FRAMEWORK_BOOT_COMPLETED = 13;
4728 // Time when the package manager starts init.
4729 // Logged from f/b/services/.../SystemServer.java
4730 PACKAGE_MANAGER_INIT_START = 14;
4731 // Time when package manager is ready
4732 // Logged from f/b/services/.../SystemServer.java
4733 PACKAGE_MANAGER_INIT_READY = 15;
4734 // Represents the time when user has entered unlock credential for system with user pin.
4735 // Logged from bootstat.
4736 POST_DECRYPT = 16;
4737 // Represents the start of zygote's init.
4738 // Logged from zygote itself.
4739 ZYGOTE_INIT_START = 17;
4740 // Represents the start of secondary zygote's init.
4741 // TODO: add logging to zygote
4742 SECONDARY_ZYGOTE_INIT_START = 18;
4743 // Represents the start of system server's init.
4744 // Logged from f/b/services/.../SystemServer.java
4745 SYSTEM_SERVER_INIT_START = 19;
4746 // Represents the completion of system server's init.
4747 // Logged from f/b/services/.../SystemServer.java
4748 SYSTEM_SERVER_READY = 20;
4749 // Represents the start of launcher during boot-up.
4750 // TODO: add logging
4751 LAUNCHER_START = 21;
4752 // Represents the completion of launcher's initial rendering. User can use other apps from
4753 // launcher from this point.
4754 // TODO: add logging
4755 LAUNCHER_SHOWN = 22;
4756 }
4757
4758 // Type of the event.
4759 optional ElapsedTimeEvent event = 1;
4760 // Time since bootup for the event.
4761 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4762 optional int64 time_millis = 2;
4763}
4764
4765/**
4766 * Boot time events with UTC time.
4767 *
4768 * Logged from: bootstat and various system server components. Check each enums for details.
4769 */
4770message BootTimeEventUtcTime {
4771 enum UtcTimeEvent {
4772 UNKNOWN = 0;
4773 // Time of the bootstat's marking of 1st boot after the last factory reset.
4774 // Logged from bootstat.
4775 FACTORY_RESET_RESET_TIME = 1;
4776 // The time when bootstat records FACTORY_RESET_* events. This is close to
4777 // BOOT_COMPLETE time for the current bootup.
4778 // Logged from bootstat.
4779 FACTORY_RESET_CURRENT_TIME = 2;
4780 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4781 // Logged from bootstat.
4782 FACTORY_RESET_RECORD_VALUE = 3;
4783 }
4784
4785 // Type of the event.
4786 optional UtcTimeEvent event = 1;
4787 // UTC time for the event.
4788 optional int64 utc_time_secs = 2;
4789}
4790
4791/**
4792 * Boot time events representing specific error code during bootup.
4793 * Meaning of error code can be different per each event type.
4794 *
4795 * Logged from: bootstat and various system server components. Check each enums for details.
4796 */
4797message BootTimeEventErrorCode {
4798 enum ErrorCodeEvent {
4799 UNKNOWN = 0;
4800 // Linux error code for time() call to get the current UTC time.
4801 // Logged from bootstat.
4802 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4803 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4804 // as UMOUNT_STAT_* from init/reboot.cpp.
4805 // Logged from f/b/services/.../BootReceiver.java.
4806 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004807 // Reprepsents fie system mounting error code of /data partition for the current boot.
4808 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004809 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004810 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004811 }
4812
4813 // Type of the event.
4814 optional ErrorCodeEvent event = 1;
4815 // error code defined per each event type.
4816 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4817 // FS_MGR_FS_STAT.
4818 optional int32 error_code = 2;
4819}
4820
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004821/**
4822 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4823 * after an OTA.
4824 *
4825 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004826 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004827 */
4828message SnapshotMergeReported {
4829 // Keep in sync with
4830 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4831 enum UpdateState {
4832 // No update or merge is in progress.
4833 NONE = 0;
4834 // An update is applying; snapshots may already exist.
4835 INITIATED = 1;
4836 // An update is pending, but has not been successfully booted yet.
4837 UNVERIFIED = 2;
4838 // The kernel is merging in the background.
4839 MERGING = 3;
4840 // Post-merge cleanup steps could not be completed due to a transient
4841 // error, but the next reboot will finish any pending operations.
4842 MERGE_NEEDS_REBOOT = 4;
4843 // Merging is complete, and needs to be acknowledged.
4844 MERGE_COMPLETED = 5;
4845 // Merging failed due to an unrecoverable error.
4846 MERGE_FAILED = 6;
4847 // The update was implicitly cancelled, either by a rollback or a flash
4848 // operation via fastboot. This state can only be returned by WaitForMerge.
4849 CANCELLED = 7;
4850 };
4851
4852 // Status of the update after the merge attempts.
4853 optional UpdateState final_state = 1;
4854
4855 // Time to complete a merge operation in milliseconds.
4856 // A negative value corresponds to the case in which the merge operation
4857 // was interrupted and resumed (e.g. in case of a system reboot during the
4858 // merge).
4859 optional int64 duration_millis = 2;
4860
4861 // Number of reboots that occurred after issuing and before completing the
4862 // merge of all the snapshot devices.
4863 optional int32 intermediate_reboots = 3;
4864}
4865
Chenjie Yubbcbc602018-02-05 16:51:52 -08004866//////////////////////////////////////////////////////////////////////
4867// Pulled atoms below this line //
4868//////////////////////////////////////////////////////////////////////
4869
4870/**
David Chenc8a43242017-10-17 16:23:28 -07004871 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4872 *
4873 * Pulled from:
4874 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4875 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004876message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004877 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004878
4879 optional int64 rx_bytes = 2;
4880
4881 optional int64 rx_packets = 3;
4882
4883 optional int64 tx_bytes = 4;
4884
4885 optional int64 tx_packets = 5;
4886}
4887
4888/**
4889 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4890 *
4891 * Pulled from:
4892 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4893 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004894message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004895 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004896
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004897 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4898 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004899
4900 optional int64 rx_bytes = 3;
4901
4902 optional int64 rx_packets = 4;
4903
4904 optional int64 tx_bytes = 5;
4905
4906 optional int64 tx_packets = 6;
4907}
4908
4909/**
4910 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4911 *
4912 * Pulled from:
4913 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4914 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004915message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004916 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004917
4918 optional int64 rx_bytes = 2;
4919
4920 optional int64 rx_packets = 3;
4921
4922 optional int64 tx_bytes = 4;
4923
4924 optional int64 tx_packets = 5;
4925}
4926
4927/**
4928 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4929 *
4930 * Pulled from:
4931 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4932 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004933message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004934 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004935
Yao Chenc40a19d2018-03-15 16:48:25 -07004936 // 1 denotes foreground and 0 denotes background. This is called Set in
4937 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004938 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004939
4940 optional int64 rx_bytes = 3;
4941
4942 optional int64 rx_packets = 4;
4943
4944 optional int64 tx_bytes = 5;
4945
4946 optional int64 tx_packets = 6;
4947}
4948
4949/**
junyulai8d1a6092020-05-07 13:38:15 +08004950 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004951 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4952 * the caller must not assume any row of data is one full report when filtering with a set of
4953 * matching conditions, because future data may represent with multiple rows what is currently
4954 * represented by one.
4955 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4956 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004957 *
4958 * Pulled from:
4959 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4960 */
4961message DataUsageBytesTransfer {
4962 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4963 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4964 // states combined, not including debug states. See NetworkStats#SET_*.
4965 optional int32 state = 1;
4966
4967 optional int64 rx_bytes = 2;
4968
4969 optional int64 rx_packets = 3;
4970
4971 optional int64 tx_bytes = 4;
4972
4973 optional int64 tx_packets = 5;
4974
4975 // Radio Access Technology (RAT) type of this record, should be one of
4976 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4977 // the record is for all rat types combined.
4978 optional int32 rat_type = 6;
4979
4980 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004981 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004982 optional string sim_mcc = 7;
4983 optional string sim_mnc = 8;
4984
junyulai8b794b72020-05-19 17:36:13 +08004985 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4986 // See TelephonyManager#getSimCarrierId.
4987 optional int32 carrier_id = 9;
4988
junyulai8d1a6092020-05-07 13:38:15 +08004989 // Enumeration of opportunistic states with an additional ALL state indicates the record is
4990 // combined regardless of the boolean value in its field.
4991 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08004992 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08004993 ALL = 1;
4994 OPPORTUNISTIC = 2;
4995 NOT_OPPORTUNISTIC = 3;
4996 }
4997 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08004998 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004999 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005000 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005001}
5002
5003/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005004 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5005 *
5006 * Pulled from:
5007 * StatsCompanionService
5008 */
5009message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005010 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005011
5012 optional int64 rx_bytes = 2;
5013
5014 optional int64 tx_bytes = 3;
5015}
5016
5017/**
David Chenc8a43242017-10-17 16:23:28 -07005018 * Pulls the kernel wakelock durations. This atom is adapted from
5019 * android/internal/os/KernelWakelockStats.java
5020 *
5021 * Pulled from:
5022 * StatsCompanionService using KernelWakelockReader.
5023 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005024message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005025 optional string name = 1;
5026
5027 optional int32 count = 2;
5028
5029 optional int32 version = 3;
5030
Yangster-maca8a30442018-10-13 23:46:34 -07005031 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005032}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005033
Chenjie Yu05013b32017-11-21 10:21:41 -08005034/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005035 * Pulls low power state information. If power.stats HAL is not available, this
5036 * includes platform and subsystem sleep state information,
5037 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5038 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005039 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005040 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005041 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5042 * as defined in:
5043 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005044 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005045message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005046 // Subsystem name
5047 optional string subsystem_name = 1;
5048 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5049 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005050 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5051 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005052 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005053 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005054 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005055 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005056 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005057}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005058
Chenjie Yu05013b32017-11-21 10:21:41 -08005059/**
Bookatz92da2832018-11-01 18:10:03 -07005060 * Pulls on-device power measurement information.
5061 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5062 * Pulled from:
5063 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5064 */
5065message OnDevicePowerMeasurement {
5066 // Name of the subsystem (to which the rail belongs).
5067 optional string subsystem_name = 1;
5068
5069 // Rail name. The rail lies within the subsystem.
5070 optional string rail_name = 2;
5071
5072 // Time (in ms since boot) at which the rail energy value was measured.
5073 // This may differ slightly from the time that statsd logs this information.
5074 optional uint64 measurement_timestamp_millis = 3;
5075
5076 // Accumulated energy used via the rail since device boot in uWs.
5077 optional uint64 energy_microwatt_secs = 4;
5078}
5079
5080/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005081 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005082 * Pulls the time the cpu spend on the frequency index. Frequency index
5083 * starts from highest to lowest. The value should be monotonically
5084 * increasing since boot. However, if there is a cpu
5085 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005086 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005087message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005088 optional uint32 cluster = 1;
5089 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005091}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005092
Chenjie Yu05013b32017-11-21 10:21:41 -08005093/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005094 * Pulls Cpu Time Per Uid.
5095 * Note that isolated process uid time should be attributed to host uids.
5096 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005097message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005098 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005099 optional uint64 user_time_micros = 2;
5100 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005101}
5102
5103/**
5104 * Pulls Cpu Time Per Uid per frequency.
5105 * Note that isolated process uid time should be attributed to host uids.
5106 * For each uid, we order the time by descending frequencies.
5107 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005108message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005109 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005110 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005111 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005112}
Hugo Benichi884970e2017-11-14 22:42:46 +09005113
Chenjie Yu05013b32017-11-21 10:21:41 -08005114/**
5115 * Pulls Wifi Controller Activity Energy Info
5116 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005117message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005118 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005119 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005120 // stack reported state
5121 // TODO: replace this with proto enum
5122 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005123 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005124 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005125 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005126 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005127 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005128 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005129 // product of current(mA), voltage(V) and time(ms)
5130 optional uint64 controller_energy_used = 6;
5131}
5132
5133/**
5134 * Pulls Modem Activity Energy Info
5135 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005136message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005137 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005138 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005139 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005140 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005141 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005142 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005143 /**
5144 * Tx power index
5145 * index 0 = tx_power < 0dBm
5146 * index 1 = 0dBm < tx_power < 5dBm
5147 * index 2 = 5dBm < tx_power < 15dBm
5148 * index 3 = 15dBm < tx_power < 20dBm
5149 * index 4 = tx_power > 20dBm
5150 */
5151 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005152 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005153 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005154 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005155 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005156 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005157 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005158 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005159 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005160 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005161 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005162 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005163 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005164 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005165}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005166
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005167/**
5168 * Pulls Bluetooth Activity Energy Info
5169 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5170 */
5171message BluetoothActivityInfo {
5172 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005173 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005174 // bluetooth stack state
5175 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005176 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005177 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005178 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005179 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005180 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005181 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005182 // product of current(mA), voltage(V) and time(ms)
5183 optional uint64 energy_used = 6;
5184}
5185
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005186/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005187 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005188 *
5189 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005190 */
5191message ProcessMemoryState {
5192 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005193 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005194
5195 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005196 // Usually package name, "system" for system server.
5197 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005198 optional string process_name = 2;
5199
Rafal Slawikda51b932018-12-13 16:31:33 +00005200 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005201 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005202
5203 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005204 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005205
5206 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005207 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005208
Rajeev Kumar90235992018-01-29 11:06:48 -08005209 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005210 // Value is read from memory.stat, field total_rss if per-app memory
5211 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005212 optional int64 rss_in_bytes = 6;
5213
5214 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005215 // Value is read from memory.stat, field total_cache if per-app memory
5216 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005217 optional int64 cache_in_bytes = 7;
5218
5219 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005220 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005221 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005222 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005223
Rafal Slawik203c3db2019-09-25 19:53:01 +01005224 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005225 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005226
Rafal Slawik203c3db2019-09-25 19:53:01 +01005227 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5228 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005229
Rafal Slawik203c3db2019-09-25 19:53:01 +01005230 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5231 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005232}
5233
5234/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005235 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005236 *
5237 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5238 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005239 *
5240 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005241 */
5242message ProcessMemoryHighWaterMark {
5243 // The uid if available. -1 means not available.
5244 optional int32 uid = 1 [(is_uid) = true];
5245
Rafal Slawikda51b932018-12-13 16:31:33 +00005246 // The process name.
5247 // Usually package name or process cmdline.
5248 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005249 optional string process_name = 2;
5250
Rafal Slawik239b6802019-09-09 18:46:01 +01005251 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5252 // computed by converting kilobytes to bytes.
5253 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5254
Rafal Slawik3bea8952018-11-15 12:39:33 +00005255 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5256 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005257 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005258}
5259
5260/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005261 * Logs the memory stats for a process.
5262 *
5263 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5264 * and for selected native processes.
5265 */
5266message ProcessMemorySnapshot {
5267 // The uid if available. -1 means not available.
5268 optional int32 uid = 1 [(is_uid) = true];
5269
5270 // The process name.
5271 // Usually package name or process cmdline.
5272 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5273 optional string process_name = 2;
5274
5275 // The pid of the process.
5276 // Allows to disambiguate instances of the process.
5277 optional int32 pid = 3;
5278
5279 // The current OOM score adjustment value.
5280 // Read from ProcessRecord for managed processes.
5281 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5282 optional int32 oom_score_adj = 4;
5283
5284 // The current RSS of the process.
5285 // VmRSS from /proc/pid/status.
5286 optional int32 rss_in_kilobytes = 5;
5287
5288 // The current anon RSS of the process.
5289 // RssAnon from /proc/pid/status.
5290 optional int32 anon_rss_in_kilobytes = 6;
5291
5292 // The current swap size of the process.
5293 // VmSwap from /proc/pid/status.
5294 optional int32 swap_in_kilobytes = 7;
5295
5296 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5297 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5298}
5299
5300/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005301 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005302 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005303message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005304 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005305}
5306
5307/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005308 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005309 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005310message SystemUptime {
5311 // Milliseconds since the system was booted.
5312 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5313 // for external input).
5314 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005315 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005316}
5317
5318/*
5319 * Reads from /proc/uid_concurrent_active_time which has the format:
5320 * active: X (X is # cores)
5321 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5322 * [uid1]: [time-0] [time-1] [time-2] ... ...
5323 * ...
5324 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5325 * The file contains a monotonically increasing count of time for a single boot.
5326 */
5327message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005328 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005329 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005330}
5331
5332/**
5333 * Reads from /proc/uid_concurrent_policy_time which has the format:
5334 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5335 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5336 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5337 * ...
5338 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5339 * The file contains a monotonically increasing count of time for a single boot.
5340 */
5341message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005342 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005343 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005344 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005345}
5346
5347/*
5348 * Pulls free disk space, for data, system partition and temporary directory.
5349 */
5350message DiskSpace {
5351 // available bytes in data partition
5352 optional uint64 data_available_bytes = 1;
5353 // available bytes in system partition
5354 optional uint64 system_available_bytes = 2;
5355 // available bytes in download cache or temp directories
5356 optional uint64 temp_available_bytes = 3;
5357}
Tej Singhbf972d92018-01-10 20:51:13 -08005358
5359/**
5360 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005361 *
5362 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005363 */
5364message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005365 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005366}
5367
5368/**
5369 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005370 * Pulled from:
5371 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005372 */
5373message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005374 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005375}
5376
5377/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005378 * Pulls battery voltage.
5379 * Pulled from:
5380 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5381 */
5382message BatteryVoltage {
5383 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005384 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005385}
5386
5387/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005388 * Pulls battery level (percent full, from 0 to 100).
5389 *
5390 * Pulled from:
5391 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5392 */
5393message BatteryLevel {
5394 // Battery level. Should be in [0, 100].
5395 optional int32 battery_level = 1;
5396}
5397
5398/**
Tej Singhd89137e2018-03-26 14:51:40 -07005399 * Pulls the temperature of various parts of the device.
5400 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005401 *
Maggie White442b6312019-04-05 16:26:44 -07005402 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005403 */
5404message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005405 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005406 optional android.os.TemperatureTypeEnum sensor_location = 1;
5407
5408 // The name of the temperature source. Eg. CPU0
5409 optional string sensor_name = 2;
5410
Tej Singhd89137e2018-03-26 14:51:40 -07005411 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005412 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005413 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005414
5415 // Relative severity of the throttling, see enum definition.
5416 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005417}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005418
5419/**
5420 * Pulls the statistics of calls to Binder.
5421 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005422 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5423 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005424 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005425 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005426 */
5427message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005428 // UID of the process responsible for the binder transaction. It will be set if the process
5429 // executing the binder transaction attribute the transaction to another uid using
5430 // Binder.setThreadWorkSource().
5431 //
5432 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005433 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005434 // UID of the process executing the binder transaction.
5435 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005436 // Fully qualified class name of the API call.
5437 //
5438 // This is a system server class name.
5439 //
5440 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5441 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5442 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5443 // commonly used APIs.
5444 optional string service_class_name = 2;
5445 // Method name of the API call. It can also be a transaction code if we cannot
5446 // resolve it to a name. See Binder#getTransactionName.
5447 //
5448 // This is a system server method name.
5449 optional string service_method_name = 3;
5450 // Total number of API calls.
5451 optional int64 call_count = 4;
5452 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5453 optional bool screen_interactive = 13;
5454 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5455 // call_count will be equal to recorded_call_count.
5456 //
5457 // If recorded_call_count is different than call_count, it means data collection has been
5458 // sampled. All the fields below will be sampled in this case.
5459 optional int64 recorded_call_count = 12;
5460 // Number of exceptions thrown by the API.
5461 optional int64 recorded_exception_count = 5;
5462 // Total latency of all API calls.
5463 // Average can be computed using total_latency_micros / recorded_call_count.
5464 optional int64 recorded_total_latency_micros = 6;
5465 // Maximum latency of one API call.
5466 optional int64 recorded_max_latency_micros = 7;
5467 // Total CPU usage of all API calls.
5468 // Average can be computed using total_cpu_micros / recorded_call_count.
5469 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5470 optional int64 recorded_total_cpu_micros = 8;
5471 // Maximum CPU usage of one API call.
5472 optional int64 recorded_max_cpu_micros = 9;
5473 // Maximum parcel reply size of one API call.
5474 optional int64 recorded_max_reply_size_bytes = 10;
5475 // Maximum parcel request size of one API call.
5476 optional int64 recorded_max_request_size_bytes = 11;
5477}
5478
5479/**
5480 * Pulls the statistics of exceptions during calls to Binder.
5481 *
5482 * Binder stats are cumulative from boot unless somebody reset the data using
5483 * > adb shell dumpsys binder_calls_stats --reset
5484 */
5485message BinderCallsExceptions {
5486 // Exception class name, e.g. java.lang.IllegalArgumentException.
5487 //
5488 // This is an exception class name thrown by the system server.
5489 optional string exception_class_name = 1;
5490 // Total number of exceptions.
5491 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005492}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005493
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005494/**
5495 * Pulls the statistics of message dispatching on HandlerThreads.
5496 *
5497 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5498 * config on the device.
5499 *
5500 * Next tag: 11
5501 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005502message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005503 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005504 optional int32 uid = 1 [(is_uid) = true];
5505
5506 // Fully qualified class name of the handler target class.
5507 //
5508 // This field does not contain PII. This is a system server class name.
5509 optional string handler_class_name = 2;
5510
5511 // The name of the thread that runs the Looper.
5512 //
5513 // This field does not contain PII. This is a system server thread name.
5514 optional string looper_thread_name = 3;
5515
5516 // The name of the dispatched message.
5517 //
5518 // This field does not contain PII. This is a system server constant or class
5519 // name.
5520 optional string message_name = 4;
5521
5522 // Total number of successfully dispatched messages.
5523 optional int64 message_count = 5;
5524
5525 // Total number of messages that failed dispatching.
5526 optional int64 exception_count = 6;
5527
5528 // Total number of processed messages we have data recorded for. If we
5529 // collected data for all the messages, message_count will be equal to
5530 // recorded_message_count.
5531 //
5532 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005533 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005534 optional int64 recorded_message_count = 7;
5535
5536 // Total latency of all processed messages.
5537 // Average can be computed using recorded_total_latency_micros /
5538 // recorded_message_count.
5539 optional int64 recorded_total_latency_micros = 8;
5540
5541 // Total CPU usage of all processed message.
5542 // Average can be computed using recorded_total_cpu_micros /
5543 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005544 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005545 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005546
5547 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5548 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005549
5550 // Max recorded CPU usage of all processed messages.
5551 optional int64 recorded_max_cpu_micros = 11;
5552
5553 // Max recorded latency of all processed messages.
5554 optional int64 recorded_max_latency_micros = 12;
5555
5556 // Total number of messages we tracked the dispatching delay for. If we
5557 // collected data for all the messages, message_count will be equal to
5558 // recorded_delay_message_count.
5559 //
5560 // If recorded_delay_message_count is different than message_count, it means data
5561 // collection has been sampled or/and not all messages specified the target dispatch time.
5562 // The fields below will be sampled in this case.
5563 optional int64 recorded_delay_message_count = 13;
5564
5565 // Total dispatching delay of all processed messages.
5566 // Calculated as a difference between the target dispatching time (Message.when)
5567 // and the actual dispatching time.
5568 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5569 optional int64 recorded_total_delay_millis = 14;
5570
5571 // Max dispatching delay of all processed messages.
5572 // Calculated as a difference between the target dispatching time (Message.when)
5573 // and the actual dispatching time.
5574 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005575}
Tej Singh86dc9db2018-09-06 00:39:57 +00005576
5577/**
5578 * Pulls disk information, such as write speed and latency.
5579 */
5580message DiskStats {
5581 // Time taken to open, write 512B to, and close a file.
5582 // -1 if error performing the check.
5583 optional int64 data_write_latency_millis = 1;
5584
5585 optional bool file_based_encryption = 2;
5586
5587 // Recent disk write speed in kB/s.
5588 // -1 if error querying storageed.
5589 // 0 if data is unavailable.
5590 optional int32 recent_disk_write_speed = 3;
5591}
5592
5593
5594/**
5595 * Free and total bytes of the Data, Cache, and System partition.
5596 */
5597message DirectoryUsage {
5598 enum Directory {
5599 UNKNOWN = 0;
5600 DATA = 1;
5601 CACHE = 2;
5602 SYSTEM = 3;
5603 }
5604 optional Directory directory = 1;
5605 optional int64 free_bytes = 2;
5606 optional int64 total_bytes = 3;
5607}
5608
5609
5610/**
5611 * Size of an application: apk size, data size, and cache size.
5612 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5613 * Information is only reported for apps with the primary user (user 0).
5614 * Sizes are aggregated by package name.
5615 */
5616message AppSize {
5617 // Including uids will involve modifying diskstats logic.
5618 optional string package_name = 1;
5619 // App size in bytes. -1 if unavailable.
5620 optional int64 app_size_bytes = 2;
5621 // App data size in bytes. -1 if unavailable.
5622 optional int64 app_data_size_bytes = 3;
5623 // App cache size in bytes. -1 if unavailable.
5624 optional int64 app_cache_size_bytes = 4;
5625 // Time that the cache file was produced.
5626 // Uses System.currentTimeMillis(), which is wall clock time.
5627 optional int64 cache_time_millis = 5;
5628}
5629
5630
5631/**
5632 * Size of a particular category. Eg: photos, videos.
5633 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5634 */
5635message CategorySize {
5636 enum Category {
5637 UNKNOWN = 0;
5638 APP_SIZE = 1;
5639 APP_DATA_SIZE = 2;
5640 APP_CACHE_SIZE = 3;
5641 PHOTOS = 4;
5642 VIDEOS = 5;
5643 AUDIO = 6;
5644 DOWNLOADS = 7;
5645 SYSTEM = 8;
5646 OTHER = 9;
5647 }
5648 optional Category category = 1;
5649 // Category size in bytes.
5650 optional int64 size_bytes = 2;
5651 // Time that the cache file was produced.
5652 // Uses System.currentTimeMillis(), which is wall clock time.
5653 optional int64 cache_time_millis = 3;
5654}
Tej Singhd6d6d772018-09-05 17:41:25 -07005655
5656/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005657 * Pulls per uid I/O stats. The stats are cumulative since boot.
5658 *
5659 * Read/write bytes are I/O events from a storage device
5660 * Read/write chars are data requested by read/write syscalls, and can be
5661 * satisfied by caching.
5662 *
5663 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5664 */
5665message DiskIo {
5666 optional int32 uid = 1 [(is_uid) = true];
5667 optional int64 fg_chars_read = 2;
5668 optional int64 fg_chars_write = 3;
5669 optional int64 fg_bytes_read = 4;
5670 optional int64 fg_bytes_write = 5;
5671 optional int64 bg_chars_read = 6;
5672 optional int64 bg_chars_write = 7;
5673 optional int64 bg_bytes_read = 8;
5674 optional int64 bg_bytes_write = 9;
5675 optional int64 fg_fsync = 10;
5676 optional int64 bg_fsync= 11;
5677}
5678
5679
5680/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005681 * Pulls the number of fingerprints for each user.
5682 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005683 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005684 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005685message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005686 // The associated user. Eg: 0 for owners, 10+ for others.
5687 // Defined in android/os/UserHandle.java
5688 optional int32 user = 1;
5689 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005690 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005691}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005692
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005693/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005694 * Pulls the number of faces for each user.
5695 *
5696 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5697 */
5698message NumFacesEnrolled {
5699 // The associated user. Eg: 0 for owners, 10+ for others.
5700 // Defined in android/os/UserHandle.java
5701 optional int32 user = 1;
5702 // Number of faces registered to that user.
5703 optional int32 num_faces_enrolled = 2;
5704}
5705/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005706 * A mapping of role holder -> role
5707 */
5708message RoleHolder {
5709 // uid of the role holder
5710 optional int32 uid = 1 [(is_uid) = true];
5711
5712 // package name of the role holder
5713 optional string package_name = 2;
5714
5715 // the role held
5716 optional string role = 3;
5717}
5718
Yangsteraf9aee72018-10-12 09:26:16 -07005719message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005720 // These are all in byte resolution.
5721 optional int64 min = 1 [deprecated = true];
5722 optional int64 average = 2 [deprecated = true];
5723 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005724
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005725 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5726 // int64 fields.
5727 optional int32 mean_kb = 4;
5728 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005729}
5730
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005731// A reduced subset of process states; reducing the number of possible states allows more
5732// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5733enum ProcessStateAggregated {
5734 PROCESS_STATE_UNKNOWN = 0;
5735 // Persistent system process.
5736 PROCESS_STATE_PERSISTENT = 1;
5737 // Top activity; actually any visible activity.
5738 PROCESS_STATE_TOP = 2;
5739 // Process binding to top or a foreground service.
5740 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5741 // Processing running a foreground service.
5742 PROCESS_STATE_FGS = 4;
5743 // Important foreground process (ime, wallpaper, etc).
5744 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5745 // Important background process.
5746 PROCESS_STATE_BACKGROUND = 6;
5747 // Process running a receiver.
5748 PROCESS_STATE_RECEIVER = 7;
5749 // All kinds of cached processes.
5750 PROCESS_STATE_CACHED = 8;
5751}
5752
5753// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005754message ProcessStatsStateProto {
5755 optional android.service.procstats.ScreenState screen_state = 1;
5756
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005757 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005758
5759 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5760 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005761 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5762
5763 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005764
5765 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005766 optional int64 duration_millis = 4 [deprecated = true];
5767 // Same as above, but with minute resolution so it fits into an int32.
5768 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005769
5770 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005771 optional int64 realtime_duration_millis = 9 [deprecated = true];
5772 // Same as above, but with minute resolution so it fits into an int32.
5773 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005774
5775 // # of samples taken
5776 optional int32 sample_size = 5;
5777
5778 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005779 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005780
5781 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005782 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005783
5784 // RSS is memory resident for this process
5785 optional AggStats rss = 8;
5786}
5787
Jing Ji060d6862020-04-13 19:36:31 -07005788// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005789message ProcessStatsProto {
5790 // Name of process.
5791 optional string process = 1;
5792
5793 // Uid of the process.
5794 optional int32 uid = 2;
5795
5796 // Information about how often kills occurred
5797 message Kill {
5798 // Count of excessive CPU kills
5799 optional int32 cpu = 1;
5800
5801 // Count of kills when cached
5802 optional int32 cached = 2;
5803
5804 // PSS stats during cached kill
5805 optional AggStats cached_pss = 3;
5806 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005807 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005808
5809 // Time and memory spent in various states.
5810 repeated ProcessStatsStateProto states = 5;
5811
5812 // Total time process has been running... screen_state, memory_state, and process_state
5813 // will not be set.
5814 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005815
5816 // Association data for this process in this state;
5817 // each entry here is one association.
5818 repeated ProcessStatsAssociationProto assocs = 7;
5819}
5820
5821// Next Tag: 5
5822message ProcessStatsAssociationProto {
5823 // Procss Name of the associated process (client process of service binding)
5824 optional string assoc_process_name = 1;
5825
5826 // Package Name of the associated package (client package of service binding)
5827 optional string assoc_package_name = 2;
5828
5829 // Total count of the times this association (service binding) appeared.
5830 optional int32 total_count = 3;
5831
5832 // Uptime total duration in seconds this association (service binding) was around.
5833 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005834}
5835
5836message PackageServiceOperationStatsProto {
5837 // Operate enum: Started, Foreground, Bound, Executing
5838 optional android.service.procstats.ServiceOperationState operation = 1;
5839
5840 // Number of times the service was in this operation.
5841 optional int32 count = 2;
5842
5843 // Information about a state the service can be in.
5844 message StateStats {
5845 // Screen state enum.
5846 optional android.service.procstats.ScreenState screen_state = 1;
5847 // Memory state enum.
5848 optional android.service.procstats.MemoryState memory_state = 2;
5849
5850 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005851 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005852 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005853 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005854 }
5855 repeated StateStats state_stats = 3;
5856}
5857
5858message PackageServiceStatsProto {
5859 // Name of service component.
5860 optional string service_name = 1;
5861
5862 // The operation stats.
5863 // The package_name, package_uid, package_version, service_name will not be set to save space.
5864 repeated PackageServiceOperationStatsProto operation_stats = 2;
5865}
5866
5867message PackageAssociationSourceProcessStatsProto {
5868 // Uid of the process.
5869 optional int32 process_uid = 1;
5870 // Process name.
5871 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005872 // Package name.
5873 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005874 // Total count of the times this association appeared.
5875 optional int32 total_count = 3;
5876
5877 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005878 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005879
5880 // Total count of the times this association became actively impacting its target process.
5881 optional int32 active_count = 5;
5882
5883 // Information on one source in this association.
5884 message StateStats {
5885 // Process state enum.
5886 optional android.service.procstats.ProcessState process_state = 1;
5887 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005888 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005889 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005890 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005891 }
5892 repeated StateStats active_state_stats = 6;
5893}
5894
5895message PackageAssociationProcessStatsProto {
5896 // Name of the target component.
5897 optional string component_name = 1;
5898 // Information on one source in this association.
5899 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5900}
5901
5902
5903message ProcessStatsPackageProto {
5904 // Name of package.
5905 optional string package = 1;
5906
5907 // Uid of the package.
5908 optional int32 uid = 2;
5909
5910 // Version of the package.
5911 optional int64 version = 3;
5912
5913 // Stats for each process running with the package loaded in to it.
5914 repeated ProcessStatsProto process_stats = 4;
5915
5916 // Stats for each of the package's services.
5917 repeated PackageServiceStatsProto service_stats = 5;
5918
5919 // Stats for each association with the package.
5920 repeated PackageAssociationProcessStatsProto association_stats = 6;
5921}
5922
5923message ProcessStatsSectionProto {
5924 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005925 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005926
5927 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005928 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005929
5930 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005931 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005932
5933 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005934 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005935
5936 // System runtime library. e.g. "libdvm.so", "libart.so".
5937 optional string runtime = 5;
5938
5939 // whether kernel reports swapped pss.
5940 optional bool has_swapped_pss = 6;
5941
5942 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5943 enum Status {
5944 STATUS_UNKNOWN = 0;
5945 STATUS_COMPLETE = 1;
5946 STATUS_PARTIAL = 2;
5947 STATUS_SHUTDOWN = 3;
5948 STATUS_SYSPROPS = 4;
5949 }
5950 repeated Status status = 7;
5951
Chenjie Yub2ecc792019-01-17 10:27:26 -08005952 // Number of pages available of various types and sizes, representation fragmentation.
5953 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5954
Yangsteraf9aee72018-10-12 09:26:16 -07005955 // Stats for each process.
5956 repeated ProcessStatsProto process_stats = 8;
5957
5958 // Stats for each package.
5959 repeated ProcessStatsPackageProto package_stats = 9;
5960}
5961
Chenjie Yub2ecc792019-01-17 10:27:26 -08005962message ProcessStatsAvailablePagesProto {
5963 // Node these pages are in (as per /proc/pagetypeinfo)
5964 optional int32 node = 1;
5965
5966 // Zone these pages are in (as per /proc/pagetypeinfo)
5967 optional string zone = 2;
5968
5969 // Label for the type of these pages (as per /proc/pagetypeinfo)
5970 optional string label = 3;
5971
5972 // Distribution of number of pages available by order size. First entry in array is
5973 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5974 repeated int32 pages_per_order = 4;
5975}
5976
Chenjie Yu12e5e672018-09-14 15:54:59 -07005977/**
5978 * Pulled from ProcessStatsService.java
5979 */
5980message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005981 optional ProcessStatsSectionProto proc_stats_section = 1;
5982}
5983
Chenjie Yuf910b7802019-01-11 16:08:20 -08005984/**
5985 * Pulled from ProcessStatsService.java
5986 */
5987message ProcStatsPkgProc {
5988 optional ProcessStatsSectionProto proc_stats_section = 1;
5989}
5990
Chris Wrencdea3b72019-11-22 16:58:17 -05005991// Next Tag: 2
5992message PackageRemoteViewInfoProto {
5993 optional string package_name = 1;
5994 // add per-package additional info here (like channels)
5995}
5996
5997// Next Tag: 2
5998message NotificationRemoteViewsProto {
5999 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6000}
6001
6002/**
6003 * Pulled from NotificationManagerService.java
6004 */
6005message NotificationRemoteViews {
6006 optional NotificationRemoteViewsProto notification_remote_views = 1;
6007}
6008
Yotam Aron74299972020-01-16 16:20:58 +02006009/**
6010 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6011 */
6012message PackageNotificationPreferences {
6013 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006014 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006015 // Notification importance, which specifies when and how a notification is displayed.
6016 // Specified under core/java/android/app/NotificationManager.java.
6017 optional int32 importance = 2;
6018 // Lockscreen visibility as set by the user.
6019 optional int32 visibility = 3;
6020 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6021 // PreferencesHelper.java)
6022 optional int32 user_locked_fields = 4;
6023}
6024
6025/**
6026 * Atom that contains a list of a package's channel preferences, pulled from
6027 * NotificationManagerService.java.
6028 */
6029message PackageNotificationChannelPreferences {
6030 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006031 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006032 // Channel's ID. Should always be available.
6033 optional string channel_id = 2;
6034 // Channel's name. Should always be available.
6035 optional string channel_name = 3;
6036 // Channel's description. Optionally set by the channel creator.
6037 optional string description = 4;
6038 // Notification importance, which specifies when and how a notification is displayed. Specified
6039 // under core/java/android/app/NotificationManager.java.
6040 optional int32 importance = 5;
6041 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6042 // at core/java/android/app/NotificationChannel.java
6043 optional int32 user_locked_fields = 6;
6044 // Indicates if the channel was deleted by the app.
6045 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006046 // Indicates if the channel was marked as a conversation by the app.
6047 optional bool is_conversation = 8;
6048 // Indicates if the channel is a conversation that was demoted by the user.
6049 optional bool is_demoted_conversation = 9;
6050 // Indicates if the channel is a conversation that was marked as important by the user.
6051 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006052}
6053
6054/**
6055 * Atom that contains a list of a package's channel group preferences, pulled from
6056 * NotificationManagerService.java.
6057 */
6058message PackageNotificationChannelGroupPreferences {
6059 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006060 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006061 // Channel Group's ID. Should always be available.
6062 optional string group_id = 2;
6063 // Channel Group's name. Should always be available.
6064 optional string group_name = 3;
6065 // Channel Group's description. Optionally set by group creator.
6066 optional string description = 4;
6067 // Indicates if notifications from this channel group are blocked.
6068 optional bool is_blocked = 5;
6069 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6070 // at core/java/android/app/NotificationChannelGroup.java
6071 optional int32 user_locked_fields = 6;
6072}
6073
Yangsteraf9aee72018-10-12 09:26:16 -07006074message PowerProfileProto {
6075 optional double cpu_suspend = 1;
6076
6077 optional double cpu_idle = 2;
6078
6079 optional double cpu_active = 3;
6080
6081 message CpuCluster {
6082 optional int32 id = 1;
6083 optional double cluster_power = 2;
6084 optional int32 cores = 3;
6085 repeated int64 speed = 4;
6086 repeated double core_power = 5;
6087 }
6088
6089 repeated CpuCluster cpu_cluster = 40;
6090
6091 optional double wifi_scan = 4;
6092
6093 optional double wifi_on = 5;
6094
6095 optional double wifi_active = 6;
6096
6097 optional double wifi_controller_idle = 7;
6098
6099 optional double wifi_controller_rx = 8;
6100
6101 optional double wifi_controller_tx = 9;
6102
6103 repeated double wifi_controller_tx_levels = 10;
6104
6105 optional double wifi_controller_operating_voltage = 11;
6106
6107 optional double bluetooth_controller_idle = 12;
6108
6109 optional double bluetooth_controller_rx = 13;
6110
6111 optional double bluetooth_controller_tx = 14;
6112
6113 optional double bluetooth_controller_operating_voltage = 15;
6114
6115 optional double modem_controller_sleep = 16;
6116
6117 optional double modem_controller_idle = 17;
6118
6119 optional double modem_controller_rx = 18;
6120
6121 repeated double modem_controller_tx = 19;
6122
6123 optional double modem_controller_operating_voltage = 20;
6124
6125 optional double gps_on = 21;
6126
6127 repeated double gps_signal_quality_based = 22;
6128
6129 optional double gps_operating_voltage = 23;
6130
6131 optional double bluetooth_on = 24;
6132
6133 optional double bluetooth_active = 25;
6134
6135 optional double bluetooth_at_cmd = 26;
6136
6137 optional double ambient_display = 27;
6138
6139 optional double screen_on = 28;
6140
6141 optional double radio_on = 29;
6142
6143 optional double radio_scanning = 30;
6144
6145 optional double radio_active = 31;
6146
6147 optional double screen_full = 32;
6148
6149 optional double audio = 33;
6150
6151 optional double video = 34;
6152
6153 optional double flashlight = 35;
6154
6155 optional double memory = 36;
6156
6157 optional double camera = 37;
6158
6159 optional double wifi_batched_scan = 38;
6160
6161 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006162}
Chenjie Yuab530202018-09-26 12:39:20 -07006163
6164/**
6165 * power_profile.xml and other constants for power model calculations.
6166 * Pulled from PowerProfile.java
6167 */
6168message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006169 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006170}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006171
6172/**
arangelovd5db50e2018-10-12 20:24:39 +01006173 * Logs when a user restriction was added or removed.
6174 *
6175 * Logged from:
6176 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6177 */
6178message UserRestrictionChanged {
6179 // The raw string of the user restriction as defined in UserManager.
6180 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6181 optional string restriction = 1;
6182 // Whether the restriction is enabled or disabled.
6183 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006184}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006185
6186/**
6187 * Pulls process user time and system time. Puller takes a snapshot of all pids
6188 * in the system and returns cpu stats for those that are working at the time.
6189 * Dead pids will be dropped. Kernel processes are excluded.
6190 * Min cool-down is 5 sec.
6191 */
6192message ProcessCpuTime {
6193 optional int32 uid = 1 [(is_uid) = true];
6194
6195 optional string process_name = 2;
6196 // Process cpu time in user space, cumulative from boot/process start
6197 optional int64 user_time_millis = 3;
6198 // Process cpu time in system space, cumulative from boot/process start
6199 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006200}
Misha Wagner5a51e002018-10-03 15:04:09 +01006201
6202/**
6203 * Pulls the CPU usage for each thread.
6204 *
6205 * Read from /proc/$PID/task/$TID/time_in_state files.
6206 *
6207 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6208 * time_in_state files not being present on some phones, have not been addressed. These should be
6209 * considered before a public release.
6210 */
6211message CpuTimePerThreadFreq {
6212 // UID that owns the process.
6213 optional int32 uid = 1 [(is_uid) = true];
6214 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006215 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006216 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006217 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006218 // Name of the process taken from `/proc/$PID/cmdline`.
6219 optional string process_name = 4;
6220 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6221 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006222
6223 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6224 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6225 // frequencies are given here as the alternative is sending eight separate atoms. This method
6226 // significantly reduces the amount of data created
6227 optional int32 frequency1_khz = 6;
6228 optional int32 time1_millis = 7;
6229 optional int32 frequency2_khz = 8;
6230 optional int32 time2_millis = 9;
6231 optional int32 frequency3_khz = 10;
6232 optional int32 time3_millis = 11;
6233 optional int32 frequency4_khz = 12;
6234 optional int32 time4_millis = 13;
6235 optional int32 frequency5_khz = 14;
6236 optional int32 time5_millis = 15;
6237 optional int32 frequency6_khz = 16;
6238 optional int32 time6_millis = 17;
6239 optional int32 frequency7_khz = 18;
6240 optional int32 time7_millis = 19;
6241 optional int32 frequency8_khz = 20;
6242 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006243}
Bookatz75ee6042018-11-09 12:27:37 -08006244
6245/**
Bookatz366a4432018-11-20 09:42:33 -08006246 * Pulls information about the device's build.
6247 */
6248message BuildInformation {
6249 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6250 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6251 optional string fingerprint = 1;
6252
6253 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6254 optional string brand = 2;
6255
6256 // Build.PRODUCT. The name of the overall product.
6257 optional string product = 3;
6258
6259 // Build.DEVICE. The name of the industrial design.
6260 optional string device = 4;
6261
6262 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6263 optional string version_release = 5;
6264
6265 // Build.ID. E.g. a label like "M4-rc20".
6266 optional string id = 6;
6267
6268 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6269 // represent this build.
6270 optional string version_incremental = 7;
6271
6272 // Build.TYPE. The type of build, like "user" or "eng".
6273 optional string type = 8;
6274
6275 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6276 optional string tags = 9;
6277}
6278
6279/**
Adam He420947c2019-01-23 15:59:09 -08006280 * Logs information about mismatched caller for content capture.
6281 *
6282 * Logged from:
6283 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6284 */
6285message ContentCaptureCallerMismatchReported {
6286 optional string intended_package = 1;
6287 optional string calling_package = 2;
6288}
6289
6290/**
6291 * Logs information about content capture service events.
6292 *
6293 * Logged from:
6294 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6295 */
6296message ContentCaptureServiceEvents {
6297 // The type of event.
6298 enum Event {
6299 UNKNOWN = 0;
6300 ON_CONNECTED = 1;
6301 ON_DISCONNECTED = 2;
6302 SET_WHITELIST = 3;
6303 SET_DISABLED = 4;
6304 ON_USER_DATA_REMOVED = 5;
6305 }
6306 optional Event event = 1;
6307 // component/package of content capture service.
6308 optional string service_info = 2;
6309 // component/package of target.
6310 // it's a concatenated list of component/package for SET_WHITELIST event
6311 // separated by " ".
6312 optional string target_info = 3;
6313}
6314
6315/**
6316 * Logs information about content capture session events.
6317 *
6318 * Logged from:
6319 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6320 */
6321message ContentCaptureSessionEvents {
6322 // The type of event.
6323 enum Event {
6324 UNKNOWN = 0;
6325 ON_SESSION_STARTED = 1;
6326 ON_SESSION_FINISHED = 2;
6327 SESSION_NOT_CREATED = 3;
6328 }
6329 optional int32 session_id = 1;
6330 optional Event event = 2;
6331 // (n/a on session finished)
6332 optional int32 state_flags = 3;
6333 // component/package of content capture service.
6334 optional string service_info = 4;
6335 // component/package of app.
6336 // (n/a on session finished)
6337 optional string app_info = 5;
6338 optional bool is_child_session = 6;
6339}
6340
6341/**
6342 * Logs information about session being flushed.
6343 *
6344 * Logged from:
6345 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6346 */
6347message ContentCaptureFlushed {
6348 optional int32 session_id = 1;
6349 // component/package of content capture service.
6350 optional string service_info = 2;
6351 // component/package of app.
6352 optional string app_info = 3;
6353 // session start/finish events
6354 optional int32 child_session_started = 4;
6355 optional int32 child_session_finished = 5;
6356 // count of view events.
6357 optional int32 view_appeared_count = 6;
6358 optional int32 view_disappeared_count = 7;
6359 optional int32 view_text_changed_count = 8;
6360
6361 // Flush stats.
6362 optional int32 max_events = 9;
6363 optional int32 idle_flush_freq = 10;
6364 optional int32 text_flush_freq = 11;
6365 optional int32 flush_reason = 12;
6366}
6367
6368/**
Bookatz75ee6042018-11-09 12:27:37 -08006369 * Pulls on-device BatteryStats power use calculations for the overall device.
6370 */
6371message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006372 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6373 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6374 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6375 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08006376}
6377
6378/**
6379 * Pulls on-device BatteryStats power use calculations broken down by uid.
6380 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6381 * that is attributed to non-uid items. They must all be included to get the total power use.
6382 */
6383message DeviceCalculatedPowerBlameUid {
6384 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6385 optional int32 uid = 1 [(is_uid) = true];
6386
Bookatz3dbc13a2018-12-21 12:16:51 -08006387 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6388 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6389 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08006390}
6391
6392/**
6393 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6394 * drain type.
6395 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6396 * is attributed uids. They must all be included to get the total power use.
6397 */
6398message DeviceCalculatedPowerBlameOther {
6399 // The type of item whose power use is being reported.
6400 enum DrainType {
6401 AMBIENT_DISPLAY = 0;
6402 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6403 BLUETOOTH = 2;
6404 CAMERA = 3;
6405 // Cell-standby
6406 CELL = 4;
6407 FLASHLIGHT = 5;
6408 IDLE = 6;
6409 MEMORY = 7;
6410 // Amount that total computed drain exceeded the drain estimated using the
6411 // battery level changes and capacity.
6412 OVERCOUNTED = 8;
6413 PHONE = 9;
6414 SCREEN = 10;
6415 // Amount that total computed drain was below the drain estimated using the
6416 // battery level changes and capacity.
6417 UNACCOUNTED = 11;
6418 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6419 WIFI = 13;
6420 }
6421 optional DrainType drain_type = 1;
6422
Bookatz3dbc13a2018-12-21 12:16:51 -08006423 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6424 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6425 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006426}
arangelov4e994062018-11-13 16:12:38 +00006427
6428/**
6429 * Logs device policy features.
6430 *
6431 * Logged from:
6432 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6433 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6434 */
6435message DevicePolicyEvent {
6436 // The event id - unique for each event.
6437 optional android.stats.devicepolicy.EventId event_id = 1;
6438 // The admin package name.
6439 optional string admin_package_name = 2;
6440 // A generic integer parameter.
6441 optional int32 integer_value = 3;
6442 // A generic boolean parameter.
6443 optional bool boolean_value = 4;
6444 // A parameter specifying a time period in milliseconds.
6445 optional uint64 time_period_millis = 5;
6446 // A parameter specifying a list of package names, bundle extras or string parameters.
6447 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6448}
shawnlinea5b66b2018-11-13 15:05:29 +08006449
6450/**
6451 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6452 *
6453 * Logged from:
6454 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6455 */
6456message DocsUILaunchReported {
6457 optional android.stats.docsui.LaunchAction launch_action = 1;
6458 optional bool has_initial_uri = 2;
6459 optional android.stats.docsui.MimeType mime_type = 3;
6460 optional android.stats.docsui.Root initial_root = 4;
6461}
6462
6463/**
6464 * Logs root/app visited event in file managers/picker. Call this when the user
6465 * taps on root/app in hamburger menu.
6466 *
6467 * Logged from:
6468 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6469 */
6470message DocsUIRootVisitedReported {
6471 optional android.stats.docsui.ContextScope scope = 1;
6472 optional android.stats.docsui.Root root = 2;
6473}
6474
6475/**
6476 * Logs file operation stats. Call this when a file operation has completed.
6477 *
6478 * Logged from:
6479 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6480 */
6481message DocsUIFileOperationReported {
6482 optional android.stats.docsui.Provider provider = 1;
6483 optional android.stats.docsui.FileOperation file_op = 2;
6484}
6485
6486/**
6487 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6488 * mode.
6489 *
6490 * Logged from:
6491 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6492 */
6493message DocsUIFileOperationCopyMoveModeReported {
6494 optional android.stats.docsui.FileOperation file_op = 1;
6495 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6496}
6497
6498
6499/**
6500 * Logs file sub operation stats. Call this when a file operation has failed.
6501 *
6502 * Logged from:
6503 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6504 */
6505message DocsUIFileOperationFailureReported {
6506 optional android.stats.docsui.Authority authority = 1;
6507 optional android.stats.docsui.SubFileOperation sub_op = 2;
6508}
6509
6510/**
6511* Logs the cancellation of a file operation. Call this when a job is canceled
6512*
6513* Logged from:
6514* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6515*/
6516message DocsUIFileOperationCanceledReported {
6517 optional android.stats.docsui.FileOperation file_op = 1;
6518}
6519
6520/**
6521 * Logs startup time in milliseconds.
6522 *
6523 * Logged from:
6524 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6525 */
6526message DocsUIStartupMsReported {
6527 optional int32 startup_millis = 1;
6528}
6529
6530/**
6531 * Logs the action that was started by user.
6532 *
6533 * Logged from:
6534 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6535 */
6536message DocsUIUserActionReported {
6537 optional android.stats.docsui.UserAction action = 1;
6538}
6539
6540/**
6541 * Logs the invalid type when invalid scoped access is requested.
6542 *
6543 * Logged from:
6544 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6545 */
6546message DocsUIInvalidScopedAccessRequestReported {
6547 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006548}
Ben Murdochbab399f2018-12-06 11:01:38 +00006549
6550/**
shawnlina75e82d2019-01-07 10:31:12 +08006551 * Logs the package name that launches docsui picker mode.
6552 *
6553 * Logged from:
6554 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6555 */
6556message DocsUIPickerLaunchedFromReported {
6557 optional string package_name = 1;
6558}
6559
6560/**
6561 * Logs the search type.
6562 *
6563 * Logged from:
6564 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6565 */
6566message DocsUISearchTypeReported {
6567 optional android.stats.docsui.SearchType search_type = 1;
6568}
6569
6570/**
6571 * Logs the search mode.
6572 *
6573 * Logged from:
6574 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6575 */
6576message DocsUISearchModeReported {
6577 optional android.stats.docsui.SearchMode search_mode = 1;
6578}
6579
6580/**
6581 * Logs the pick result information.
6582 *
6583 * Logged from:
6584 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6585 */
6586message DocsUIPickResultReported {
6587 optional int32 total_action_count = 1;
6588 optional int64 duration_millis = 2;
6589 optional int32 file_count= 3;
6590 optional bool is_searching = 4;
6591 optional android.stats.docsui.Root picked_from = 5;
6592 optional android.stats.docsui.MimeType mime_type = 6;
6593 optional int32 repeatedly_pick_times = 7;
6594}
6595
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006596/** Logs the drag and drop of files.
6597
6598 * Logged from:
6599 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6600 */
6601message DocsUIDragAndDropReported {
6602 optional bool drag_initiated_from_docsui = 1;
6603}
6604
shawnlina75e82d2019-01-07 10:31:12 +08006605/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006606 * Logs when an app's memory is compacted.
6607 *
6608 * Logged from:
6609 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6610 */
6611message AppCompacted {
6612 // The pid of the process being compacted.
6613 optional int32 pid = 1;
6614
6615 // The name of the process being compacted.
6616 optional string process_name = 2;
6617
6618 // The type of compaction.
6619 enum Action {
6620 UNKNOWN = 0;
6621 SOME = 1;
6622 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006623 PERSISTENT = 3;
6624 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006625 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006626 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006627
6628 // Total RSS in kilobytes consumed by the process prior to compaction.
6629 optional int64 before_rss_total_kilobytes = 4;
6630
6631 // File RSS in kilobytes consumed by the process prior to compaction.
6632 optional int64 before_rss_file_kilobytes = 5;
6633
6634 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6635 optional int64 before_rss_anon_kilobytes = 6;
6636
6637 // Swap in kilobytes consumed by the process prior to compaction.
6638 optional int64 before_swap_kilobytes = 7;
6639
6640 // Total RSS in kilobytes consumed by the process after compaction.
6641 optional int64 after_rss_total_kilobytes = 8;
6642
6643 // File RSS in kilobytes consumed by the process after compaction.
6644 optional int64 after_rss_file_kilobytes = 9;
6645
6646 // Anonymous RSS in kilobytes consumed by the process after compaction.
6647 optional int64 after_rss_anon_kilobytes = 10;
6648
6649 // Swap in kilobytes consumed by the process after compaction.
6650 optional int64 after_swap_kilobytes = 11;
6651
6652 // The time taken to perform compaction in milliseconds.
6653 optional int64 time_to_compact_millis = 12;
6654
6655 // The last compaction action performed for this app.
6656 optional Action last_action = 13;
6657
Ben Murdoch01720b82018-12-19 18:03:44 +00006658 // The last time that compaction was attempted on this process in milliseconds
6659 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6660 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006661
Ben Murdoch885c21b2019-03-15 18:02:04 +00006662 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006663 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006664
6665 // The process state at the time of compaction.
6666 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006667
6668 // Free ZRAM in kilobytes before compaction.
6669 optional int64 before_zram_free_kilobytes = 17;
6670
6671 // Free ZRAM in kilobytes after compaction.
6672 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006673}
lifr157fc552018-12-12 16:38:04 +08006674
6675/**
lifrb6b90b62019-03-29 00:40:17 +08006676 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6677 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6678 *
lifr1f74b052019-04-16 22:16:30 +08006679 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6680 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6681 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6682 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006683 */
6684message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006685 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006686
lifr1f74b052019-04-16 22:16:30 +08006687 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006688
6689 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006690 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006691
lifr1f74b052019-04-16 22:16:30 +08006692 // Only valid for event_type = EVENT_GETADDRINFO.
6693 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006694
lifr1f74b052019-04-16 22:16:30 +08006695 // Flags passed to android_res_nsend() defined in multinetwork.h
6696 // Only valid for event_type = EVENT_RESNSEND.
6697 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006698
lifrad9becc2019-05-20 11:04:41 +08006699 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006700
6701 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006702 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006703
6704 // Additional pass-through fields opaque to statsd.
6705 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006706 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006707
6708 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6709 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006710}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006711
6712/**
6713 * Logs when a data stall event occurs.
6714 *
6715 * Log from:
6716 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6717 */
6718message DataStallEvent {
6719 // Data stall evaluation type.
6720 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6721 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6722 optional int32 evaluation_type = 1;
6723 // See definition in data_stall_event.proto.
6724 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6725 // See definition in data_stall_event.proto.
6726 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6727 // See definition in data_stall_event.proto.
6728 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6729 // See definition in data_stall_event.proto.
6730 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6731 // See definition in data_stall_event.proto.
6732 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6733}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006734
6735/*
6736 * Logs when RescueParty resets some set of experiment flags.
6737 *
6738 * Logged from:
6739 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6740 */
6741message RescuePartyResetReported {
6742 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6743 optional int32 rescue_level = 1;
6744}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006745
6746/**
6747 * Logs when signed config is received from an APK, and if that config was applied successfully.
6748 * Logged from:
6749 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6750 */
6751message SignedConfigReported {
6752 enum Type {
6753 UNKNOWN_TYPE = 0;
6754 GLOBAL_SETTINGS = 1;
6755 }
6756 optional Type type = 1;
6757
6758 // The final status of the signed config received.
6759 enum Status {
6760 UNKNOWN_STATUS = 0;
6761 APPLIED = 1;
6762 BASE64_FAILURE_CONFIG = 2;
6763 BASE64_FAILURE_SIGNATURE = 3;
6764 SECURITY_EXCEPTION = 4;
6765 INVALID_CONFIG = 5;
6766 OLD_CONFIG = 6;
6767 SIGNATURE_CHECK_FAILED = 7;
6768 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006769 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006770 }
6771 optional Status status = 2;
6772
6773 // The version of the signed config processed.
6774 optional int32 version = 3;
6775
6776 // The package name that the config was extracted from.
6777 optional string from_package = 4;
6778
6779 enum Key {
6780 NO_KEY = 0;
6781 DEBUG = 1;
6782 PRODUCTION = 2;
6783 }
6784 // Which key was used to verify the config.
6785 optional Key verified_with = 5;
6786}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006787
6788/*
6789 * Logs GNSS Network-Initiated (NI) location events.
6790 *
6791 * Logged from:
6792 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6793 */
6794message GnssNiEventReported {
6795 // The type of GnssNiEvent.
6796 enum EventType {
6797 UNKNOWN = 0;
6798 NI_REQUEST = 1;
6799 NI_RESPONSE = 2;
6800 }
6801 optional EventType event_type = 1;
6802
6803 // An ID generated by HAL to associate NI notifications and UI responses.
6804 optional int32 notification_id = 2;
6805
6806 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006807 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006808
6809 // NI requires notification.
6810 optional bool need_notify = 4;
6811
6812 // NI requires verification.
6813 optional bool need_verify = 5;
6814
6815 // NI requires privacy override, no notification/minimal trace.
6816 optional bool privacy_override = 6;
6817
6818 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6819 // seconds.
6820 optional int32 timeout = 7;
6821
6822 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006823 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006824
6825 // String representing the requester of the network inititated location request.
6826 optional string requestor_id = 9;
6827
6828 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6829 // network initiated location request.
6830 optional string text = 10;
6831
6832 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006833 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006834
6835 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006836 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006837
6838 // True if SUPL ES is enabled.
6839 optional bool is_supl_es_enabled = 13;
6840
6841 // True if GNSS location is enabled.
6842 optional bool is_location_enabled = 14;
6843
6844 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006845 optional android.server.location.GnssUserResponseType user_response = 15;
6846}
6847
6848/**
6849 * Logs GNSS non-framework (NFW) location notification.
6850 *
6851 * Logged from:
6852 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6853 */
6854message GnssNfwNotificationReported {
6855 // Package name of the Android proxy application representing the non-framework entity that
6856 // requested location. Set to empty string if unknown.
6857 optional string proxy_app_package_name = 1;
6858
6859 // Protocol stack that initiated the non-framework location request.
6860 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6861
6862 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6863 // set to empty string. This field is opaque to the framework and used for logging purposes.
6864 optional string other_protocol_stack_name = 3;
6865
6866 // Source initiating/receiving the location information.
6867 optional android.server.location.NfwRequestor requestor = 4;
6868
6869 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6870 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6871 // and used for logging purposes.
6872 optional string requestor_id = 5;
6873
6874 // Indicates whether location information was provided for this request.
6875 optional android.server.location.NfwResponseType response_type = 6;
6876
6877 // True if the device is in user initiated emergency session.
6878 optional bool in_emergency_mode = 7;
6879
6880 // True if cached location is provided.
6881 optional bool is_cached_location = 8;
6882
6883 // True if proxy app permission mismatch between framework and GNSS HAL.
6884 optional bool is_permission_mismatched = 9;
6885}
6886
6887/**
6888 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6889 *
6890 * Logged from:
6891 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6892 */
6893message GnssConfigurationReported {
6894 // SUPL host name.
6895 optional string supl_host = 1;
6896
6897 // SUPL port number.
6898 optional int32 supl_port = 2;
6899
6900 // C2K host name.
6901 optional string c2k_host = 3;
6902
6903 // C2K port number.
6904 optional int32 c2k_port = 4;
6905
6906 // The SUPL version requested by Carrier.
6907 optional int32 supl_ver = 5;
6908
6909 // The SUPL mode.
6910 optional android.server.location.SuplMode supl_mode = 6;
6911
6912 // True if NI emergency SUPL restrictions is enabled.
6913 optional bool supl_es = 7;
6914
6915 // LTE Positioning Profile settings
6916 optional android.server.location.LppProfile lpp_profile = 8;
6917
6918 // Positioning protocol on A-Glonass system.
6919 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6920
6921 // True if emergency PDN is used. Otherwise, regular PDN is used.
6922 optional bool use_emergency_pdn_for_emergency_supl= 10;
6923
6924 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6925 optional android.server.location.GpsLock gps_lock = 11;
6926
6927 // Number of seconds to extend the emergency session duration post emergency call.
6928 optional int32 es_extension_sec = 12;
6929
6930 // The full list of package names of proxy Android applications representing the non-framework
6931 // location access entities (on/off the device) for which the framework user has granted
6932 // non-framework location access permission. The package names are concatenated in one string
6933 // with spaces as separators.
6934 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006935}
Jack Yu95b64f32018-12-13 18:26:11 +08006936
6937/**
6938 * Logs when a NFC device's error occurred.
6939 * Logged from:
6940 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6941 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6942 */
6943message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006944 enum Type {
6945 UNKNOWN = 0;
6946 CMD_TIMEOUT = 1;
6947 ERROR_NOTIFICATION = 2;
6948 AID_OVERFLOW = 3;
6949 }
6950 optional Type type = 1;
6951 // If it's nci cmd timeout, log the timeout command.
6952 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006953
Alex Salod7c3eef2019-01-25 14:43:27 -08006954 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006955}
6956
6957/**
6958 * Logs when a NFC device's state changed event
6959 * Logged from:
6960 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6961 */
6962message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006963 enum State {
6964 UNKNOWN = 0;
6965 OFF = 1;
6966 ON = 2;
6967 ON_LOCKED = 3; // Secure Nfc enabled.
6968 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6969 }
6970 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006971}
6972
6973/**
6974 * Logs when a NFC Beam Transaction occurred.
6975 * Logged from:
6976 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6977 */
6978message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006979 enum Operation {
6980 UNKNOWN = 0;
6981 SEND = 1;
6982 RECEIVE = 2;
6983 }
6984 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006985}
6986
6987/**
6988 * Logs when a NFC Card Emulation Transaction occurred.
6989 * Logged from:
6990 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6991 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6992 */
6993message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006994 enum Category {
6995 UNKNOWN = 0;
6996 HCE_PAYMENT = 1;
6997 HCE_OTHER = 2;
6998 OFFHOST = 3;
6999 }
7000 // Transaction belongs to HCE payment or HCE other category, or offhost.
7001 optional Category category = 1;
7002 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7003 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007004}
7005
7006/**
7007 * Logs when a NFC Tag event occurred.
7008 * Logged from:
7009 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7010 */
7011message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007012 enum Type {
7013 UNKNOWN = 0;
7014 URL = 1;
7015 BT_PAIRING = 2;
7016 PROVISION = 3;
7017 WIFI_CONNECT = 4;
7018 APP_LAUNCH = 5;
7019 OTHERS = 6;
7020 }
7021 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007022}
7023
7024/**
7025 * Logs when Hce transaction triggered
7026 * Logged from:
7027 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7028 */
7029message NfcHceTransactionOccurred {
7030 // The latency period(in microseconds) it took for the first HCE data
7031 // exchange.
7032 optional uint32 latency_micros = 1;
7033}
7034
7035/**
7036 * Logs when SecureElement state event changed
7037 * Logged from:
7038 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7039 */
7040message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007041 enum State {
7042 UNKNOWN = 0;
7043 INITIALIZED = 1;
7044 DISCONNECTED = 2;
7045 CONNECTED = 3;
7046 HALCRASH = 4;
7047 }
7048 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007049
Alex Salod7c3eef2019-01-25 14:43:27 -08007050 optional string state_change_reason = 2;
7051 // SIMx or eSEx.
7052 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007053}
7054
7055/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007056 * Information about a permission grant request
7057 */
7058message PermissionGrantRequestResultReported {
7059 // unique value identifying an API call. A API call might result in multiple of these atoms
7060 optional int64 request_id = 1;
7061
7062 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007063 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007064
7065 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007066 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007067
7068 // The permission to be granted
7069 optional string permission_name = 4;
7070
7071 // If the permission was explicitly requested via the API or added by the system
7072 optional bool is_implicit = 5;
7073
7074 enum Result {
7075 UNDEFINED = 0;
7076 // permission request was ignored
7077 IGNORED = 1;
7078 // permission request was ignored because it was user fixed
7079 IGNORED_USER_FIXED = 2;
7080 // permission request was ignored because it was policy fixed
7081 IGNORED_POLICY_FIXED = 3;
7082 // permission was granted by user action
7083 USER_GRANTED = 4;
7084 // permission was automatically granted
7085 AUTO_GRANTED = 5;
7086 // permission was denied by user action
7087 USER_DENIED = 6;
7088 // permission was denied with prejudice by the user
7089 USER_DENIED_WITH_PREJUDICE = 7;
7090 // permission was automatically denied
7091 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007092 // permission request was ignored because permission is restricted
7093 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007094 // one time permission was granted by user action
7095 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007096 // user ignored request by leaving the request screen without choosing any option
7097 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007098 // user granted the permission after being linked to settings
7099 USER_GRANTED_IN_SETTINGS = 12;
7100 // user denied the permission after being linked to settings
7101 USER_DENIED_IN_SETTINGS = 13;
7102 // user denied the permission with prejudice after being linked to settings
7103 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7104 // permission was automatically revoked after one-time permission expired
7105 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007106 // permission was automatically revoked for unused app
7107 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007108 }
7109 // The result of the permission grant
7110 optional Result result = 6;
7111}
7112
7113/**
Jack Yu95b64f32018-12-13 18:26:11 +08007114 * Logs when Omapi API used
7115 * Logged from:
7116 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7117 */
7118message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007119 enum Operation {
7120 UNKNOWN = 0;
7121 OPEN_CHANNEL = 1;
7122 }
7123 optional Operation operation = 1;
7124 // SIMx or eSEx.
7125 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007126
Alex Salod7c3eef2019-01-25 14:43:27 -08007127 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007128}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007129
7130/**
Alex Saloa060aee2019-01-21 14:36:41 -08007131 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7132 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007133 * Logged from:
7134 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7135 */
7136message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007137 optional int64 dispatch_latency_millis = 1;
7138}
7139
7140/**
7141 * Logs AttentionManagerService attention check result.
7142 *
7143 * Logged from:
7144 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7145 */
7146message AttentionManagerServiceResultReported {
7147 // See core/java/android/service/attention/AttentionService.java
7148 enum AttentionCheckResult {
7149 UNKNOWN = 20;
7150 ATTENTION_SUCCESS_ABSENT = 0;
7151 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007152 ATTENTION_FAILURE_UNKNOWN = 2;
7153 ATTENTION_FAILURE_CANCELLED = 3;
7154 ATTENTION_FAILURE_PREEMPTED = 4;
7155 ATTENTION_FAILURE_TIMED_OUT = 5;
7156 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007157 }
7158 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007159}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007160
7161/**
7162 * Logs when an adb connection changes state.
7163 *
7164 * Logged from:
7165 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7166 */
7167message AdbConnectionChanged {
7168 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7169 // previously selected for this system.
7170 optional int64 last_connection_time_millis = 1;
7171
7172 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7173 // to reconnect via adb without user interaction.
7174 optional int64 auth_window_millis = 2;
7175
7176 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7177 optional android.debug.AdbConnectionStateEnum state = 3;
7178
7179 // True if the 'always allow' option was selected for this system.
7180 optional bool always_allow = 4;
7181}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007182
7183/*
7184 * Logs the reported speech DSP status.
7185 *
7186 * Logged from:
7187 * Vendor audio implementation.
7188 */
7189message SpeechDspStatReported {
7190 // The total Speech DSP uptime in milliseconds.
7191 optional int32 total_uptime_millis = 1;
7192 // The total Speech DSP downtime in milliseconds.
7193 optional int32 total_downtime_millis = 2;
7194 optional int32 total_crash_count = 3;
7195 optional int32 total_recover_count = 4;
7196}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007197
7198/**
7199 * Logs USB connector contaminant status.
7200 *
7201 * Logged from: USB Service.
7202 */
7203message UsbContaminantReported {
7204 optional string id = 1;
7205 optional android.service.usb.ContaminantPresenceStatus status = 2;
7206}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007207
7208/**
7209 * This atom is for debugging purpose.
7210 */
7211message DebugElapsedClock {
7212 // Monotically increasing value for each pull.
7213 optional int64 pull_count = 1;
7214 // Time from System.elapsedRealtime.
7215 optional int64 elapsed_clock_millis = 2;
7216 // Time from System.elapsedRealtime.
7217 optional int64 same_elapsed_clock_millis = 3;
7218 // Diff between current elapsed time and elapsed time from previous pull.
7219 optional int64 elapsed_clock_diff_millis = 4;
7220
7221 enum Type {
7222 TYPE_UNKNOWN = 0;
7223 ALWAYS_PRESENT = 1;
7224 PRESENT_ON_ODD_PULLS = 2;
7225 }
7226 // Type of behavior for the pulled data.
7227 optional Type type = 5;
7228}
7229
7230/**
7231 * This atom is for debugging purpose.
7232 */
7233message DebugFailingElapsedClock {
7234 // Monotically increasing value for each pull.
7235 optional int64 pull_count = 1;
7236 // Time from System.elapsedRealtime.
7237 optional int64 elapsed_clock_millis = 2;
7238 // Time from System.elapsedRealtime.
7239 optional int64 same_elapsed_clock_millis = 3;
7240 // Diff between current elapsed time and elapsed time from previous pull.
7241 optional int64 elapsed_clock_diff_millis = 4;
7242}
Steven Wuacef6bb2019-01-23 14:21:17 -05007243
7244/** Logs System UI bubbles event changed.
7245 *
7246 * Logged from:
7247 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7248 */
7249message BubbleUIChanged {
7250
7251 // The app package that is posting the bubble.
7252 optional string package_name = 1;
7253
7254 // The notification channel that is posting the bubble.
7255 optional string notification_channel = 2;
7256
7257 // The notification id associated with the posted bubble.
7258 optional int32 notification_id = 3;
7259
7260 // The position of the bubble within the bubble stack.
7261 optional int32 position = 4;
7262
7263 // The total number of bubbles within the bubble stack.
7264 optional int32 total_number = 5;
7265
7266 // User interactions with the bubble.
7267 enum Action {
7268 UNKNOWN = 0;
7269 POSTED = 1;
7270 UPDATED = 2;
7271 EXPANDED = 3;
7272 COLLAPSED = 4;
7273 DISMISSED = 5;
7274 STACK_DISMISSED = 6;
7275 STACK_MOVED = 7;
7276 HEADER_GO_TO_APP = 8;
7277 HEADER_GO_TO_SETTINGS = 9;
7278 PERMISSION_OPT_IN = 10;
7279 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007280 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007281 SWIPE_LEFT = 13;
7282 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007283 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04007284 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007285 }
7286 optional Action action = 6;
7287
7288 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7289 optional float normalized_x_position = 7;
7290 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007291
7292 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7293 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007294
7295 // Whether the bubble is an on-going one.
7296 optional bool is_ongoing = 10;
7297
7298 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007299 // This is deprecated and the value should be ignored.
7300 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007301}
Kweku Adams8845d012018-12-11 20:06:45 -08007302
7303/**
Steven Wu552f63f2019-02-05 13:41:36 -05007304 * Logs System UI bubbles developer errors.
7305 *
7306 * Logged from:
7307 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7308 */
7309message BubbleDeveloperErrorReported {
7310
7311 // The app package that is posting the bubble.
7312 optional string package_name = 1;
7313
7314 // Bubble developer error type enums.
7315 enum Error {
7316 UNKNOWN = 0;
7317 ACTIVITY_INFO_MISSING = 1;
7318 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7319 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7320 }
7321 optional Error error = 2 [default = UNKNOWN];
7322}
7323
7324/**
Kweku Adams8845d012018-12-11 20:06:45 -08007325 * Logs that a constraint for a scheduled job has changed.
7326 *
7327 * Logged from:
7328 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7329 */
7330message ScheduledJobConstraintChanged {
7331 repeated AttributionNode attribution_node = 1;
7332
7333 // Name of the job.
7334 optional string job_name = 2;
7335
7336 optional com.android.server.job.ConstraintEnum constraint = 3;
7337
7338 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007339 UNKNOWN = 0;
7340 UNSATISFIED = 1;
7341 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007342 }
7343 optional State state = 4;
7344}
Alex Salod7c3eef2019-01-25 14:43:27 -08007345
7346/**
7347 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7348 * returns true.
7349 *
7350 * Logged from:
7351 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7352 */
7353message ScreenTimeoutExtensionReported {
7354 // Describes how many times in a row did the power manager reset the screen off timeout.
7355 optional uint32 consecutive_timeout_extended_count = 1;
7356}
Hui Yu885aca12019-01-10 17:11:34 -08007357
7358/*
7359* Logs number of milliseconds it takes to start a process.
7360* The definition of app process start time is from the app launch time to
7361* the time that Zygote finished forking the app process and loaded the
7362* application package's java classes.
7363
7364* This metric is different from AppStartOccurred which is for foreground
7365* activity only.
7366
7367* ProcessStartTime can report all processes (both foreground and background)
7368* start time.
7369*
7370* Logged from:
7371* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7372*/
7373message ProcessStartTime {
7374 // The uid of the ProcessRecord.
7375 optional int32 uid = 1 [(is_uid) = true];
7376
7377 // The process pid.
7378 optional int32 pid = 2;
7379
7380 // The process name.
7381 // Usually package name, "system" for system server.
7382 // Provided by ActivityManagerService.
7383 optional string process_name = 3;
7384
7385 enum StartType {
7386 UNKNOWN = 0;
7387 WARM = 1;
7388 HOT = 2;
7389 COLD = 3;
7390 }
7391
7392 // The start type.
7393 optional StartType type = 4;
7394
7395 // The elapsed realtime at the start of the process.
7396 optional int64 process_start_time_millis = 5;
7397
7398 // Number of milliseconds it takes to reach bind application.
7399 optional int32 bind_application_delay_millis = 6;
7400
7401 // Number of milliseconds it takes to finish start of the process.
7402 optional int32 process_start_delay_millis = 7;
7403
7404 // hostingType field in ProcessRecord, the component type such as "activity",
7405 // "service", "content provider", "broadcast" or other strings.
7406 optional string hosting_type = 8;
7407
7408 // hostingNameStr field in ProcessRecord. The component class name that runs
7409 // in this process.
7410 optional string hosting_name = 9;
7411}
7412
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007413/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007414 * Track Media Codec usage
7415 * Logged from:
7416 * frameworks/av/media/libstagefright/MediaCodec.cpp
7417 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7418 */
7419message MediametricsCodecReported {
7420 optional int64 timestamp_nanos = 1;
7421 optional string package_name = 2;
7422 optional int64 package_version_code = 3;
7423 optional int64 media_apex_version = 4;
7424
7425 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7426}
7427
7428/**
7429 * Track Media Extractor (pulling video/audio streams out of containers) usage
7430 * Logged from:
7431 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7432 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7433 */
7434message MediametricsExtractorReported {
7435 optional int64 timestamp_nanos = 1;
7436 optional string package_name = 2;
7437 optional int64 package_version_code = 3;
7438 optional int64 media_apex_version = 4;
7439
7440 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7441}
7442
7443/**
7444 * Track how we arbitrate between microphone/input requests.
7445 * Logged from
7446 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7447 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7448 */
7449message MediametricsAudiopolicyReported {
7450 optional int64 timestamp_nanos = 1;
7451 optional string package_name = 2;
7452 optional int64 package_version_code = 3;
7453 optional int64 media_apex_version = 4;
7454
7455 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7456}
7457
7458/**
7459 * Track how we arbitrate between microphone requests.
7460 * Logged from
7461 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7462 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7463 */
7464message MediametricsAudiorecordReported {
7465 optional int64 timestamp_nanos = 1;
7466 optional string package_name = 2;
7467 optional int64 package_version_code = 3;
7468 optional int64 media_apex_version = 4;
7469
7470 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7471}
7472
7473/**
7474 * Track how we arbitrate between microphone/input requests.
7475 * Logged from
7476 * frameworks/av/media/libnblog/ReportPerformance.cpp
7477 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7478 */
7479message MediametricsAudiothreadReported {
7480 optional int64 timestamp_nanos = 1;
7481 optional string package_name = 2;
7482 optional int64 package_version_code = 3;
7483 optional int64 media_apex_version = 4;
7484
7485 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7486}
7487
7488/**
7489 * Track how we arbitrate between microphone/input requests.
7490 * Logged from
7491 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7492 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7493 */
7494message MediametricsAudiotrackReported {
7495 optional int64 timestamp_nanos = 1;
7496 optional string package_name = 2;
7497 optional int64 package_version_code = 3;
7498 optional int64 media_apex_version = 4;
7499
7500 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7501}
7502
7503/**
7504 * Track information about DRM framework performance
7505 * Logged from
7506 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7507 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7508 */
7509message MediametricsMediadrmReported {
7510 optional int64 timestamp_nanos = 1;
7511 optional string package_name = 2;
7512 optional int64 package_version_code = 3;
7513 optional int64 media_apex_version = 4;
7514
7515 // vendor+description tell about which DRM plugin is in use on this device
7516 optional string vendor = 5;
7517 optional string description = 6;
7518 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7519 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7520}
7521
7522/**
7523 * Track information about the widevine DRM plugin performance
7524 * Logged from
7525 * vendor/widevine/libwvdrmengine/cdm/metrics
7526 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7527 */
7528message MediametricsDrmWidevineReported {
7529 optional int64 timestamp_nanos = 1;
7530 optional string package_name = 2;
7531 optional int64 package_version_code = 3;
7532 optional int64 media_apex_version = 4;
7533
7534 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7535}
7536
7537/**
7538 * Track information about recordings (e.g. camcorder)
7539 * Logged from
7540 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7541 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7542 */
7543message MediametricsRecorderReported {
7544 optional int64 timestamp_nanos = 1;
7545 optional string package_name = 2;
7546 optional int64 package_version_code = 3;
7547 optional int64 media_apex_version = 4;
7548
7549 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7550}
7551
7552/**
7553 * Track Media Player usage
7554 * Logged from:
7555 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7556 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7557 */
7558message MediametricsNuPlayerReported {
7559 optional int64 timestamp_nanos = 1;
7560 optional string package_name = 2;
7561 optional int64 package_version_code = 3;
7562 optional int64 media_apex_version = 4;
7563
7564 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7565}
7566
7567/**
Robert Shiha4beed32019-08-19 14:15:23 -07007568 * Track Legacy DRM usage
7569 * Logged from
7570 * frameworks/av/drm/drmserver/DrmManager.cpp
7571 */
7572message MediametricsDrmManagerReported {
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 enum Method {
7579 METHOD_NOT_FOUND = -1;
7580 GET_CONSTRAINTS = 0;
7581 GET_METADATA = 1;
7582 CAN_HANDLE = 2;
7583 PROCESS_DRM_INFO = 3;
7584 ACQUIRE_DRM_INFO = 4;
7585 SAVE_RIGHTS = 5;
7586 GET_ORIGINAL_MIME_TYPE = 6;
7587 GET_DRM_OBJECT_TYPE = 7;
7588 CHECK_RIGHTS_STATUS = 8;
7589 REMOVE_RIGHTS = 9;
7590 REMOVE_ALL_RIGHTS = 10;
7591 OPEN_CONVERT_SESSION = 11;
7592 OPEN_DECRYPT_SESSION = 12;
7593 }
7594
7595 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7596 optional string plugin_id = 5;
7597 optional string description = 6;
7598 optional Method method = 7;
7599 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007600
7601 optional int64 get_constraints_count = 9;
7602 optional int64 get_metadata_count = 10;
7603 optional int64 can_handle_count = 11;
7604 optional int64 process_drm_info_count = 12;
7605 optional int64 acquire_drm_info_count = 13;
7606 optional int64 save_rights_count = 14;
7607 optional int64 get_original_mime_type_count = 15;
7608 optional int64 get_drm_object_type_count = 16;
7609 optional int64 check_rights_status_count = 17;
7610 optional int64 remove_rights_count = 18;
7611 optional int64 remove_all_rights_count = 19;
7612 optional int64 open_convert_session_count = 20;
7613 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007614}
7615
7616/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007617 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007618 * Pulled from: StatsCompanionService
7619*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007620message DangerousPermissionState {
7621 // Name of the permission
7622 optional string permission_name = 1;
7623
7624 // Uid of the package
7625 optional int32 uid = 2 [(is_uid) = true];
7626
7627 // Package requesting the permission
7628 optional string package_name = 3;
7629
7630 // If the permission is granted to the uid
7631 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007632
7633 // Permission flags as per android.content.pm.PermissionFlags
7634 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007635}
7636
Michael Groover4a0ca942019-01-24 17:41:25 -08007637/**
7638 * Logs when a package is denied access to a device identifier based on the new access requirements.
7639 *
7640 * Logged from:
7641 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7642 */
7643message DeviceIdentifierAccessDenied {
7644 // The name of the package denied access to the requested device identifier.
7645 optional string package_name = 1;
7646
7647 // The name of the device identifier method the package attempted to invoke.
7648 optional string method_name = 2;
7649
7650 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007651 // Starting from Android 11, this boolean is not set and will always be false.
7652 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007653
7654 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007655 // Starting from Android 11, this boolean is not set and will always be false.
7656 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007657}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007658
7659/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007660 * Pulls the ongoing mainline install train version code.
7661 * Pulled from StatsCompanionService
7662 */
7663message TrainInfo {
7664 optional int64 train_version_code = 1;
7665
7666 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007667
7668 optional string train_name = 3;
7669
7670 enum Status {
7671 UNKNOWN = 0;
7672 INSTALL_REQUESTED = 1;
7673 INSTALL_STARTED = 2;
7674 INSTALL_STAGED_NOT_READY = 3;
7675 INSTALL_STAGED_READY = 4;
7676 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007677 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7678 // and INSTALL_FAILURE_COMMIT.
7679 INSTALL_FAILURE = 6 [deprecated = true];
7680 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007681 INSTALL_CANCELLED = 7;
7682 INSTALLER_ROLLBACK_REQUESTED = 8;
7683 INSTALLER_ROLLBACK_INITIATED = 9;
7684 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7685 INSTALLER_ROLLBACK_STAGED = 11;
7686 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7687 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7688 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7689 INSTALLER_ROLLBACK_SUCCESS = 15;
7690 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007691 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7692 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7693 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7694 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7695 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7696 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007697 INSTALL_FAILURE_DOWNLOAD = 23;
7698 INSTALL_FAILURE_STATE_MISMATCH = 24;
7699 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007700 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007701 }
7702 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007703}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007704
7705/**
7706 * Logs the gesture stage changed event.
7707 *
7708 * Logged from:
7709 * frameworks/base/packages/SystemUI/
7710 */
7711message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007712 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007713}
7714
7715/**
7716 * Logs the feedback type.
7717 *
7718 * Logged from:
7719 * frameworks/base/packages/SystemUI/
7720 */
7721message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007722 // Whether or not the gesture was used.
7723 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007724}
7725
7726/**
7727 * Logs the progress.
7728 *
7729 * Logged from:
7730 * frameworks/base/packages/SystemUI/
7731 */
7732message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007733 // [0,100] progress for the assist gesture.
7734 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007735}
Neil Fullerdb14b482019-02-05 19:44:44 +00007736
7737/*
7738 * Information about the time zone data on a device.
7739 */
7740message TimeZoneDataInfo {
7741 // A version identifier for the data set on device. e.g. "2018i"
7742 optional string tzdb_version = 1;
7743}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007744
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007745/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007746 * Logs the GPU stats global health information.
7747 *
7748 * Logged from:
7749 * frameworks/native/services/gpuservice/gpustats/
7750 */
7751message GpuStatsGlobalInfo {
7752 // Package name of the gpu driver.
7753 optional string driver_package_name = 1;
7754
7755 // Version name of the gpu driver.
7756 optional string driver_version_name = 2;
7757
7758 // Version code of the gpu driver.
7759 optional int64 driver_version_code = 3;
7760
7761 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7762 optional int64 driver_build_time = 4;
7763
7764 // Total count of the gl driver gets loaded.
7765 optional int64 gl_loading_count = 5;
7766
7767 // Total count of the gl driver fails to be loaded.
7768 optional int64 gl_loading_failure_count = 6;
7769
7770 // Total count of the Vulkan driver gets loaded.
7771 optional int64 vk_loading_count = 7;
7772
7773 // Total count of the Vulkan driver fails to be loaded.
7774 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007775
7776 // Api version of the system Vulkan driver.
7777 optional int32 vulkan_version = 9;
7778
7779 // Api version of the system CPU Vulkan driver.
7780 optional int32 cpu_vulkan_version = 10;
7781
7782 // Api version of the system GLES driver.
7783 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007784
7785 // Total count of the angle driver gets loaded.
7786 optional int64 angle_loading_count = 12;
7787
7788 // Total count of the angle driver fails to be loaded.
7789 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007790}
7791
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007792/**
7793 * GPU driver loading time info.
7794 */
7795message GpuDriverLoadingTime {
7796 // List of all the driver loading times for this app. The list size is
7797 // capped at 50.
7798 repeated int64 driver_loading_time = 1;
7799}
7800
7801/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007802 * Logs the GPU stats per app health information.
7803 *
7804 * Logged from:
7805 * frameworks/native/services/gpuservice/gpustats/
7806 */
7807message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007808 // Package name of the application that loads the gpu driver. Total number
7809 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007810 optional string app_package_name = 1;
7811
7812 // Version code of the gpu driver this app loads.
7813 optional int64 driver_version_code = 2;
7814
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007815 // gl driver loading time info.
7816 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7817 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007818
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007819 // Vulkan driver loading time info.
7820 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7821 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007822
7823 // Angle driver loading time info.
7824 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7825 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007826
7827 // CPU Vulkan implementation is in use.
7828 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007829
7830 // App is not doing pre-rotation correctly.
7831 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007832
7833 // App creates GLESv1 context.
7834 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007835}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007836
7837/*
7838 * Logs the size of the system ion heap.
7839 *
7840 * Pulled from StatsCompanionService.
7841 */
7842message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007843 // Deprecated due to limited support of ion stats in debugfs.
7844 // Use `IonHeapSize` instead.
7845 option deprecated = true;
7846
Rafal Slawikd4e87572019-03-12 13:08:38 +00007847 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007848 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007849 optional int64 size_in_bytes = 1;
7850}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007851
Rafal Slawik77987ed2019-06-17 12:28:23 +01007852/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007853 * Logs the total size of the ion heap.
7854 *
7855 * Pulled from StatsCompanionService.
7856 */
7857message IonHeapSize {
7858 // Total size of all ion heaps in kilobytes.
7859 // Read from: /sys/kernel/ion/total_heaps_kb.
7860 optional int32 total_size_kb = 1;
7861}
7862
7863/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007864 * Logs the per-process size of the system ion heap.
7865 *
7866 * Pulled from StatsCompanionService.
7867 */
7868message ProcessSystemIonHeapSize {
7869 // The uid if available. -1 means not available.
7870 optional int32 uid = 1 [(is_uid) = true];
7871
7872 // The process name (from /proc/PID/cmdline).
7873 optional string process_name = 2;
7874
7875 // Sum of sizes of all allocations.
7876 optional int32 total_size_in_kilobytes = 3;
7877
7878 // Number of allocations.
7879 optional int32 allocation_count = 4;
7880
7881 // Size of the largest allocation.
7882 optional int32 max_size_in_kilobytes = 5;
7883}
7884
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007885/**
7886 * Push network stack events.
7887 *
7888 * Log from:
7889 * frameworks/base/packages/NetworkStack/
7890 */
7891message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007892 // The id that indicates the event reported from NetworkStack.
7893 optional int32 event_id = 1;
7894 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007895 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7896}
Carmen Agimofa769c152019-03-04 14:39:14 +00007897
7898/**
7899 * Logs the apps that are installed on the external storage.
7900 * Pulled from:
7901 * StatsCompanionService
7902 */
7903message AppsOnExternalStorageInfo {
7904 // The type of the external storage.
7905 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7906 // The name of the package that is installed on the external storage.
7907 optional string package_name = 2;
7908}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007909
7910/**
7911 * Logs the settings related to Face.
7912 * Logged from:
7913 * frameworks/base/services/core/java/com/android/server/stats
7914 */
7915message FaceSettings {
7916 // Whether or not face unlock is allowed on Keyguard.
7917 optional bool unlock_keyguard_enabled = 1;
7918 // Whether or not face unlock dismisses the Keyguard.
7919 optional bool unlock_dismisses_keyguard = 2;
7920 // Whether or not face unlock requires attention.
7921 optional bool unlock_attention_required = 3;
7922 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7923 optional bool unlock_app_enabled = 4;
7924 // Whether or not face unlock always requires user confirmation.
7925 optional bool unlock_always_require_confirmation = 5;
7926 // Whether or not a diverse set of poses are required during enrollment.
7927 optional bool unlock_diversity_required = 6;
7928}
Maggie White442b6312019-04-05 16:26:44 -07007929
7930/**
7931 * Logs cooling devices maintained by the kernel.
7932 *
7933 * Pulled from StatsCompanionService.java
7934 */
7935message CoolingDevice {
7936 // The type of cooling device being reported. Eg. CPU, GPU...
7937 optional android.os.CoolingTypeEnum device_location = 1;
7938 // The name of the cooling device source. Eg. CPU0
7939 optional string device_name = 2;
7940 // Current throttle state of the cooling device. The value can any unsigned
7941 // integer between 0 and max_state defined in its driver. 0 means device is
7942 // not in throttling, higher value means deeper throttling.
7943 optional int32 state = 3;
7944}
Ben Blount763a5d52019-04-10 11:48:58 -07007945
7946/**
7947 * Intelligence has several counter-type events that don't warrant a
7948 * full separate atom. These are primarily API call counters but also include
7949 * counters for feature usage and specific failure modes.
7950 *
7951 * Logged from the Intelligence mainline module.
7952 */
7953message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007954 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007955 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007956 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007957 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007958 // How many times the event occured (to report a batch of high frequency events).
7959 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007960 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007961 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007962}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007963
7964/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007965 * Logs when Car Power state changed.
7966 *
7967 * Logged from:
7968 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7969 */
7970message CarPowerStateChanged {
7971 // States come from CpmsState in CarPowerManagementService.java.
7972 enum State {
7973 WAIT_FOR_VHAL = 0;
7974 ON = 1;
7975 SHUTDOWN_PREPARE = 2;
7976 WAIT_FOR_FINISH = 3;
7977 SUSPEND = 4;
7978 SIMULATE_SLEEP = 5;
7979 }
7980 optional State state = 1;
7981}
7982
7983/**
7984 * Logs whether GarageMode is entered.
7985 *
7986 * Logged from:
7987 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7988 */
7989message GarageModeInfo {
7990 // Whether GarageMode is entered.
7991 optional bool is_garage_mode = 1;
7992}
Martijn Coenencd95d462019-04-25 17:09:45 +02007993
7994/**
7995 * Historical app ops data per package.
7996 */
7997message AppOps {
7998 // Uid of the package requesting the op
7999 optional int32 uid = 1 [(is_uid) = true];
8000
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008001 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008002 optional string package_name = 2;
8003
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00008004 // operation id
8005 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008006
8007 // The number of times the op was granted while the app was in the
8008 // foreground (only for trusted requests)
8009 optional int64 trusted_foreground_granted_count = 4;
8010
8011 // The number of times the op was granted while the app was in the
8012 // background (only for trusted requests)
8013 optional int64 trusted_background_granted_count = 5;
8014
8015 // The number of times the op was rejected while the app was in the
8016 // foreground (only for trusted requests)
8017 optional int64 trusted_foreground_rejected_count = 6;
8018
8019 // The number of times the op was rejected while the app was in the
8020 // background (only for trusted requests)
8021 optional int64 trusted_background_rejected_count = 7;
8022
8023 // For long-running operations, total duration of the operation
8024 // while the app was in the foreground (only for trusted requests)
8025 optional int64 trusted_foreground_duration_millis = 8;
8026
8027 // For long-running operations, total duration of the operation
8028 // while the app was in the background (only for trusted requests)
8029 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008030
8031 // Whether AppOps is guarded by Runtime permission
8032 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008033}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008034
8035/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008036 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008037 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008038message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008039 // Uid of the package requesting the op
8040 optional int32 uid = 1 [(is_uid) = true];
8041
8042 // Name of the package performing the op
8043 optional string package_name = 2;
8044
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008045 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8046 // Attributions must be provided through manifest using <attribution> tag available in R and
8047 // above.
8048 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008049
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00008050 // operation id
8051 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008052
8053 // The number of times the op was granted while the app was in the
8054 // foreground (only for trusted requests)
8055 optional int64 trusted_foreground_granted_count = 5;
8056
8057 // The number of times the op was granted while the app was in the
8058 // background (only for trusted requests)
8059 optional int64 trusted_background_granted_count = 6;
8060
8061 // The number of times the op was rejected while the app was in the
8062 // foreground (only for trusted requests)
8063 optional int64 trusted_foreground_rejected_count = 7;
8064
8065 // The number of times the op was rejected while the app was in the
8066 // background (only for trusted requests)
8067 optional int64 trusted_background_rejected_count = 8;
8068
8069 // For long-running operations, total duration of the operation
8070 // while the app was in the foreground (only for trusted requests)
8071 optional int64 trusted_foreground_duration_millis = 9;
8072
8073 // For long-running operations, total duration of the operation
8074 // while the app was in the background (only for trusted requests)
8075 optional int64 trusted_background_duration_millis = 10;
8076
8077 // Whether AppOps is guarded by Runtime permission
8078 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008079
8080 // Sampling rate used on device, from 0 to 100
8081 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008082}
8083
8084/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008085 * Location Manager API Usage information(e.g. API under usage,
8086 * API call's parameters).
8087 * Logged from:
8088 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8089 */
8090message LocationManagerApiUsageReported {
8091
8092 // Indicating if usage starts or usage ends.
8093 optional android.stats.location.UsageState state = 1;
8094
8095 // LocationManagerService's API in use.
8096 // We can identify which API from LocationManager is
8097 // invoking current LMS API by the combination of
8098 // API parameter(e.g. is_listener_null, is_intent_null,
8099 // is_location_request_null)
8100 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8101
8102 // Name of the package calling the API.
8103 optional string calling_package_name = 3;
8104
8105 // Type of the location provider.
8106 optional android.stats.location.ProviderType provider = 4;
8107
8108 // Quality of the location request
8109 optional android.stats.location.LocationRequestQuality quality = 5;
8110
8111 // The desired interval for active location updates, in milliseconds.
8112 // Bucketized to reduce cardinality.
8113 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8114
8115 // Minimum distance between location updates, in meters.
8116 // Bucketized to reduce cardinality.
8117 optional android.stats.location.SmallestDisplacementBucket
8118 bucketized_smallest_displacement = 7;
8119
8120 // The number of location updates.
8121 optional int64 num_updates = 8;
8122
8123 // The request expiration time, in millisecond since boot.
8124 // Bucketized to reduce cardinality.
8125 optional android.stats.location.ExpirationBucket
8126 bucketized_expire_in = 9;
8127
8128 // Type of Callback passed in for this API.
8129 optional android.stats.location.CallbackType callback_type = 10;
8130
8131 // The radius of the central point of the alert
8132 // region, in meters. Only for API REQUEST_GEOFENCE.
8133 // Bucketized to reduce cardinality.
8134 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8135
8136 // Activity Importance of API caller.
8137 // Categorized to 3 types that are interesting from location's perspective.
8138 optional android.stats.location.ActivityImportance activiy_importance = 12;
8139}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008140
8141/**
8142 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8143 */
8144message ReviewPermissionsFragmentResultReported {
8145 // unique value identifying a permission group change. A permission group change might result
8146 // in multiple of these atoms
8147 optional int64 change_id = 1;
8148
8149 // UID of package the permission belongs to
8150 optional int32 uid = 2 [(is_uid) = true];
8151
8152 // Name of package the permission belongs to
8153 optional string package_name = 3;
8154
8155 // The permission to be granted
8156 optional string permission_name = 4;
8157
8158 // The result of the permission grant
8159 optional bool permission_granted = 5;
8160}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008161
8162/**
8163* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8164* Logged from: RuntimePermissionUpdgradeController
8165*/
8166message RuntimePermissionsUpgradeResult {
8167 // Permission granted as result of upgrade
8168 optional string permission_name = 1;
8169
8170 // UID of package granted permission
8171 optional int32 uid = 2 [(is_uid) = true];
8172
8173 // Name of package granted permission
8174 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008175}
8176
8177/**
8178* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8179*/
8180message GrantPermissionsActivityButtonActions {
8181 // Permission granted as result of upgrade
8182 optional string permission_group_name = 1;
8183
8184 // UID of package granted permission
8185 optional int32 uid = 2 [(is_uid) = true];
8186
8187 // Name of package requesting permission
8188 optional string package_name = 3;
8189
8190 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8191 // LABEL_ constants in GrantPermissionActivity.java
8192 optional int32 buttons_presented = 4;
8193
8194 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8195 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008196
8197 // id which identifies single session of user interacting with permission controller
8198 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008199}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008200
8201/**
8202 * Information about LocationAccessCheck notification presented to user
8203 */
8204message LocationAccessCheckNotificationAction {
8205
8206 // id which identifies single session of user interacting with permission controller
8207 optional int64 session_id = 1;
8208
8209 // Uid of package for which location access check is presented
8210 optional int32 package_uid = 2;
8211
8212 // Name of package for which location access check is presented
8213 optional string package_name = 3;
8214
8215 enum Result {
8216 UNDEFINED = 0;
8217 // notification was presented to the user
8218 NOTIFICATION_PRESENTED = 1;
8219 // notification was declined by the user
8220 NOTIFICATION_DECLINED = 2;
8221 // notification was clicked by the user
8222 NOTIFICATION_CLICKED = 3;
8223 }
8224
8225 // View / interaction recorded
8226 optional Result result = 4;
8227}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008228
8229/**
8230 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8231 */
8232message AppPermissionFragmentActionReported {
8233 // id which identifies single session of user interacting with permission controller
8234 optional int64 session_id = 1;
8235
8236 // unique value identifying a permission group change. A permission group change might result
8237 // in multiple of these atoms
8238 optional int64 change_id = 2;
8239
8240 // UID of package the permission belongs to
8241 optional int32 uid = 3 [(is_uid) = true];
8242
8243 // Name of package the permission belongs to
8244 optional string package_name = 4;
8245
8246 // The permission to be granted
8247 optional string permission_name = 5;
8248
8249 // The result of the permission grant
8250 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008251
8252 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8253 optional int32 permission_flags = 7;
8254
8255 enum Button {
8256 UNDEFINED = 0;
8257 // Allow button
8258 ALLOW = 1;
8259 // Deny button
8260 DENY = 2;
8261 // Ask every time button
8262 ASK_EVERY_TIME = 3;
8263 // Allow all the time button
8264 ALLOW_ALWAYS = 4;
8265 // Allow only while using the app button
8266 ALLOW_FOREGROUND = 5;
8267 // Same is Deny button but shown in while in use dialog
8268 DENY_FOREGROUND = 6;
8269 }
8270
8271 // Button pressed in the dialog
8272 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008273}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008274
8275/**
8276* Information about a AppPermissionFragment viewed by user
8277*/
8278message AppPermissionFragmentViewed {
8279 // id which identifies single session of user interacting with permission controller
8280 optional int64 session_id = 1;
8281
8282 // UID of package for which permissions are viewed
8283 optional int32 uid = 2 [(is_uid) = true];
8284
8285 // Name of package for which permissions are viewed
8286 optional string package_name = 3;
8287
8288 // Permission group viewed
8289 optional string permission_group_name = 4;
8290}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008291
8292/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008293* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8294* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008295*/
8296message AppPermissionsFragmentViewed {
8297 // id which identifies single session of user interacting with permission controller
8298 optional int64 session_id = 1;
8299
8300 // id which identifies single view as every view might have several logging records
8301 // with different package information attached
8302 optional int64 view_id = 2;
8303
8304 // Permission group viewed
8305 optional string permission_group_name = 3;
8306
8307 // UID of package for which permissions are viewed
8308 optional int32 uid = 4 [(is_uid) = true];
8309
8310 // Name of package for which permissions are viewed
8311 optional string package_name = 5;
8312
8313 // Category in which permission is included
8314 enum Category {
8315 UNDEFINED = 0;
8316 ALLOWED = 1;
8317 ALLOWED_FOREGROUND = 2;
8318 DENIED = 3;
8319 }
8320 optional Category category = 6;
8321}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008322/**
8323* Information about a PermissionAppsFragment viewed by user.
8324* Logged from ui/handheld/PermissionAppsFragment.java
8325*/
8326message PermissionAppsFragmentViewed {
8327 // id which identifies single session of user interacting with permission controller
8328 optional int64 session_id = 1;
8329
8330 // id which identifies single view as every view might have several logging records
8331 // with different package information attached
8332 optional int64 view_id = 2;
8333
8334 // Permission group viewed
8335 optional string permission_group_name = 3;
8336
8337 // UID of package for which permissions are viewed
8338 optional int32 uid = 4 [(is_uid) = true];
8339
8340 // Name of package for which permissions are viewed
8341 optional string package_name = 5;
8342
8343 // Category in which app is included
8344 enum Category {
8345 UNDEFINED = 0;
8346 ALLOWED = 1;
8347 ALLOWED_FOREGROUND = 2;
8348 DENIED = 3;
8349 }
8350 optional Category category = 6;
8351}
Tony Make2b1b672019-07-29 16:59:47 +01008352
8353/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008354* Log that the Auto Revoke notification has been clicked
8355* Logged from ui/ManagePermissionsActivity
8356*/
8357message AutoRevokeNotificationClicked {
8358 // id which identifies single session of user interacting with permission controller
8359 optional int64 session_id = 1;
8360}
8361
8362/**
8363* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8364* auto revoked for it.
8365* Logged from ui/handheld/AutoRevokeFragment
8366*/
8367message AutoRevokeFragmentAppViewed {
8368 // id which identifies single session of user interacting with permission controller
8369 optional int64 session_id = 1;
8370
8371 // UID of package for which permissions are viewed
8372 optional int32 uid = 2 [(is_uid) = true];
8373
8374 // Name of package for which permissions are viewed
8375 optional string package_name = 3;
8376
8377 // The name of a permission group that has been revoked
8378 optional string permission_group_name = 4;
8379
8380 // The age of the app- more than three months old, or more than six months
8381 enum Age {
8382 UNDEFINED = 0;
8383 NEWER_BUCKET = 1;
8384 OLDER_BUCKET = 2;
8385 }
8386
8387 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8388 optional Age age = 5;
8389}
8390
8391/**
8392* Log that the user has interacted with an app on the auto revoke fragment
8393* Logged from ui/handheld/AutoRevokeFragment
8394*/
8395message AutoRevokedAppInteraction {
8396 // id which identifies single session of user interacting with permission controller
8397 optional int64 session_id = 1;
8398
8399 // UID of package for which permissions are viewed
8400 optional int32 uid = 2 [(is_uid) = true];
8401
8402 // Name of package for which permissions are viewed
8403 optional string package_name = 3;
8404
8405 enum Action {
8406 UNDEFINED = 0;
8407 REMOVE = 1;
8408 OPEN = 2;
8409 APP_INFO = 3;
8410 PERMISSIONS = 4;
8411 REMOVE_IN_SETTINGS = 5;
8412 OPEN_IN_SETTINGS = 6;
8413 }
8414
8415 // The action the user took to interact with the app
8416 optional Action action = 4;
8417}
8418
8419/**
8420* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8421* auto revoke, or that the auto revoke switch has been changed
8422* Logged from ui/handheld/AppPermissionGroupsFragment
8423 */
8424message AppPermissionGroupsFragmentAutoRevokeAction {
8425 // id which identifies single session of user interacting with permission controller
8426 optional int64 session_id = 1;
8427
8428 // UID of package for which permissions are viewed
8429 optional int32 uid = 2 [(is_uid) = true];
8430
8431 // Name of package for which permissions are viewed
8432 optional string package_name = 3;
8433
8434 enum Action {
8435 UNDEFINED = 0;
8436 OPENED_FOR_AUTO_REVOKE = 1;
8437 OPENED_FROM_INTENT = 2;
8438 SWITCH_ENABLED = 3;
8439 SWITCH_DISABLED = 4;
8440 }
8441
8442 // The action the user took to interact with the fragment
8443 optional Action action = 4;
8444}
8445
8446/**
Tony Make2b1b672019-07-29 16:59:47 +01008447 * Logs when there is a smart selection related event.
8448 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8449 * Logged from: TextClassifierEventLogger.java
8450 */
8451message TextSelectionEvent {
8452 // A session ID.
8453 optional string session_id = 1;
8454
8455 // Event type of this event.
8456 optional android.stats.textclassifier.EventType event_type = 2;
8457
Tony Mak9c84bd22019-12-09 07:27:25 +00008458 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008459 optional string model_name = 3;
8460
8461 // Type of widget that was involved in triggering this event.
8462 optional android.stats.textclassifier.WidgetType widget_type = 4;
8463
8464 // Index of this event in a session.
8465 optional int32 event_index = 5;
8466
8467 // Entity type that is involved.
8468 optional string entity_type = 6;
8469
8470 // Relative word index of the start of the selection.
8471 optional int32 relative_word_start_index = 7;
8472
8473 // Relative word (exclusive) index of the end of the selection.
8474 optional int32 relative_word_end_index = 8;
8475
8476 // Relative word index of the start of the smart selection.
8477 optional int32 relative_suggested_word_start_index = 9;
8478
8479 // Relative word (exclusive) index of the end of the smart selection.
8480 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008481
8482 // Name of source package.
8483 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008484
8485 // Name of the LangID model that is involved in this event.
8486 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008487}
8488
8489/**
8490 * Logs when there is a smart linkify related event.
8491 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8492 * Logged from: TextClassifierEventLogger.java
8493 */
8494message TextLinkifyEvent {
8495 // A session ID.
8496 optional string session_id = 1;
8497
8498 // Event type of this event.
8499 optional android.stats.textclassifier.EventType event_type = 2;
8500
Tony Mak9c84bd22019-12-09 07:27:25 +00008501 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008502 optional string model_name = 3;
8503
8504 // Type of widget that was involved in triggering this event.
8505 optional android.stats.textclassifier.WidgetType widget_type = 4;
8506
8507 // Index of this event in a session.
8508 optional int32 event_index = 5;
8509
8510 // Entity type that is involved.
8511 optional string entity_type = 6;
8512
8513 // Number of links detected.
8514 optional int32 num_links = 7;
8515
8516 // The total length of all links.
8517 optional int32 linked_text_length = 8;
8518
8519 // Length of input text.
8520 optional int32 text_length = 9;
8521
8522 // Time spent on generating links in ms.
8523 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008524
8525 // Name of source package.
8526 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008527
8528 // Name of the LangID model that is involved in this event.
8529 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008530}
8531
8532/**
8533 * Logs when there is a conversation actions related event.
8534 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8535 * Logged from: TextClassifierEventLogger.java
8536 */
8537message ConversationActionsEvent {
8538 // A session ID.
8539 optional string session_id = 1;
8540
8541 // Event type of this event.
8542 optional android.stats.textclassifier.EventType event_type = 2;
8543
Tony Mak9c84bd22019-12-09 07:27:25 +00008544 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008545 optional string model_name = 3;
8546
8547 // Type of widget that was involved in triggering this event.
8548 optional android.stats.textclassifier.WidgetType widget_type = 4;
8549
8550 // The first entity type that is involved.
8551 optional string first_entity_type = 5;
8552
8553 // The second entity type that is involved.
8554 optional string second_entity_type = 6;
8555
8556 // The third entity type that is involved.
8557 optional string third_entity_type = 7;
8558
8559 // The score of the first entity type.
8560 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008561
8562 // Name of source package.
8563 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008564
8565 // Name of the annotator model that is involved in this event.
8566 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008567
8568 // Name of the LangID model that is involved in this event.
8569 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008570}
8571
8572/**
8573 * Logs when there is a language detection related event.
8574 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8575 * Logged from: TextClassifierEventLogger.java
8576 */
8577message LanguageDetectionEvent {
8578 // A session ID.
8579 optional string session_id = 1;
8580
8581 // Event type of this event.
8582 optional android.stats.textclassifier.EventType event_type = 2;
8583
Tony Mak9c84bd22019-12-09 07:27:25 +00008584 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008585 optional string model_name = 3;
8586
8587 // Type of widget that was involved in triggering this event.
8588 optional android.stats.textclassifier.WidgetType widget_type = 4;
8589
8590 // Detected language.
8591 optional string language_tag = 5;
8592
8593 // Score of the detected language.
8594 optional float score = 6;
8595
8596 // Position of this action.
8597 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008598
8599 // Name of source package.
8600 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008601}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008602
8603/**
8604 * Information about an OTA update attempt by update_engine.
8605 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8606 */
8607message UpdateEngineUpdateAttemptReported {
8608 // The number of attempts for the update engine to apply a given payload.
8609 optional int32 attempt_number = 1;
8610
8611 optional android.stats.otaupdate.PayloadType payload_type = 2;
8612
8613 // The total time in minutes for the update engine to apply a given payload.
8614 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8615 // it's increased when the system is sleeping.
8616 optional int32 duration_boottime_in_minutes = 3;
8617
8618 // The total time in minutes for the update engine to apply a given payload.
8619 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8620 // and it's not increased when the system is sleeping.
8621 optional int32 duration_monotonic_in_minutes = 4;
8622
8623 // The size of the payload in MiBs.
8624 optional int32 payload_size_mib = 5;
8625
8626 // The attempt result reported by the update engine for an OTA update.
8627 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8628
8629 // The error code reported by the update engine after an OTA update attempt
8630 // on A/B devices.
8631 optional android.stats.otaupdate.ErrorCode error_code = 7;
8632
8633 // The build fingerprint of the source system. The value is read from a
8634 // system property when the device takes the update. e.g.
8635 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8636 optional string source_fingerprint = 8;
8637}
8638
8639/**
8640 * Information about all the attempts the device make before finishing the
8641 * successful update.
8642 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8643 */
8644message UpdateEngineSuccessfulUpdateReported {
8645 // The number of attempts for the update engine to apply the payload for a
8646 // successful update.
8647 optional int32 attempt_count = 1;
8648
8649 optional android.stats.otaupdate.PayloadType payload_type = 2;
8650
8651 optional int32 payload_size_mib = 3;
8652
8653 // The total number of bytes downloaded by update_engine since the last
8654 // successful update.
8655 optional int32 total_bytes_downloaded_mib = 4;
8656
8657 // The ratio in percentage of the over-downloaded bytes compared to the
8658 // total bytes needed to successfully install the update. e.g. 200 if we
8659 // download 200MiB in total for a 100MiB package.
8660 optional int32 download_overhead_percentage = 5;
8661
8662 // The total time in minutes for the update engine to apply the payload for a
8663 // successful update.
8664 optional int32 total_duration_minutes = 6;
8665
8666 // The number of reboot of the device during a successful update.
8667 optional int32 reboot_count = 7;
8668}
Alec Mourie088e762019-07-02 13:10:55 -07008669
8670/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008671 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8672 * key to indicate whether it was successful or not.
8673 *
8674 * Logged from:
8675 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8676 */
8677message RebootEscrowRecoveryReported {
8678 optional bool successful = 1;
8679}
8680
8681/**
Alec Mourie088e762019-07-02 13:10:55 -07008682 * Global display pipeline metrics reported by SurfaceFlinger.
8683 * Pulled from:
8684 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8685 */
8686message SurfaceflingerStatsGlobalInfo {
8687 // Total number of frames presented during the tracing period
8688 optional int64 total_frames = 1;
8689 // Total number of frames missed
8690 optional int64 missed_frames = 2;
8691 // Total number of frames that fell back to client composition
8692 optional int64 client_composition_frames = 3;
8693 // Total time the display was turned on
8694 optional int64 display_on_millis = 4;
8695 // Total time that was spent performing animations.
8696 // This is derived from the present-to-present layer histogram
8697 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008698 // Total number of event connections tracked by SurfaceFlinger at the time
8699 // of this pull. If this number grows prohibitively large, then this can
8700 // cause jank due to resource contention.
8701 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008702 // Set of timings measured from when SurfaceFlinger began compositing a
8703 // frame, until the frame was requested to be presented to the display. This
8704 // measures SurfaceFlinger's total CPU walltime on the critical path per
8705 // frame.
8706 optional FrameTimingHistogram frame_duration = 7
8707 [(android.os.statsd.log_mode) = MODE_BYTES];
8708 // Set of timings measured from when SurfaceFlinger first began using the
8709 // GPU to composite a frame, until the GPU has finished compositing that
8710 // frame. This measures the total additional time SurfaceFlinger needed to
8711 // perform due to falling back into GPU composition.
8712 optional FrameTimingHistogram render_engine_timing = 8
8713 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008714}
8715
8716/**
8717 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8718 * The number of layers uploaded will be restricted due to size limitations.
8719 * Pulled from:
8720 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8721 */
8722message SurfaceflingerStatsLayerInfo {
8723 // The layer for this set of metrics
8724 // For now we can infer that the package name is included in the layer
8725 // name.
8726 optional string layer_name = 1;
8727 // Total number of frames presented
8728 optional int64 total_frames = 2;
8729 // Total number of dropped frames while latching a buffer for this layer.
8730 optional int64 dropped_frames = 3;
8731 // Set of timings measured between successive presentation timestamps.
8732 optional FrameTimingHistogram present_to_present = 4
8733 [(android.os.statsd.log_mode) = MODE_BYTES];
8734 // Set of timings measured from when an app queued a buffer for
8735 // presentation, until the buffer was actually presented to the
8736 // display.
8737 optional FrameTimingHistogram post_to_present = 5
8738 [(android.os.statsd.log_mode) = MODE_BYTES];
8739 // Set of timings measured from when a buffer is ready to be presented,
8740 // until the buffer was actually presented to the display.
8741 optional FrameTimingHistogram acquire_to_present = 6
8742 [(android.os.statsd.log_mode) = MODE_BYTES];
8743 // Set of timings measured from when a buffer was latched by
8744 // SurfaceFlinger, until the buffer was presented to the display
8745 optional FrameTimingHistogram latch_to_present = 7
8746 [(android.os.statsd.log_mode) = MODE_BYTES];
8747 // Set of timings measured from the desired presentation to the actual
8748 // presentation time
8749 optional FrameTimingHistogram desired_to_present = 8
8750 [(android.os.statsd.log_mode) = MODE_BYTES];
8751 // Set of timings measured from when an app queued a buffer for
8752 // presentation, until the buffer was ready to be presented.
8753 optional FrameTimingHistogram post_to_acquire = 9
8754 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008755 // Frames missed latch because the acquire fence didn't fire
8756 optional int64 late_acquire_frames = 10;
8757 // Frames latched early because the desired present time was bad
8758 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008759}
8760
8761/**
8762 * Histogram of frame counts bucketed by time in milliseconds.
8763 * Because of size limitations, we hard-cap the number of buckets, with
8764 * buckets for corresponding to larger milliseconds being less precise.
8765 */
8766message FrameTimingHistogram {
8767 // Timings in milliseconds that describes a set of histogram buckets
8768 repeated int32 time_millis_buckets = 1;
8769 // Number of frames that match to each time_millis, i.e. the bucket
8770 // contents
8771 // It's required that len(time_millis) == len(frame_count)
8772 repeated int64 frame_counts = 2;
8773}
Emilian Peev6729f372019-08-29 09:14:09 -07008774
Emilian Peev6729f372019-08-29 09:14:09 -07008775/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008776 * Janky event as reported by SurfaceFlinger.
8777 * This event is intended to be consumed by a Perfetto subscriber for
8778 * automated trace collection.
8779 *
8780 * Logged from:
8781 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8782 */
8783message DisplayJankReported {
8784 // Informational field for how long the janky event lasted in milliseconds
8785 optional int64 event_duration_millis = 1;
8786 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8787 // the display on time.
8788 optional int32 present_deadlines_missed = 2;
8789}
8790
8791/**
Emilian Peev6729f372019-08-29 09:14:09 -07008792 * Information about camera facing and API level usage.
8793 * Logged from:
8794 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8795 */
8796message CameraActionEvent {
8797 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008798 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008799
8800 // Camera API level used
8801 optional int32 api_level = 2;
8802
8803 // Name of client package
8804 optional string package_name = 3;
8805
8806 // Camera facing
8807 enum Facing {
8808 UNKNOWN = 0;
8809 BACK = 1;
8810 FRONT = 2;
8811 EXTERNAL = 3;
8812 }
8813 optional Facing facing = 4;
8814}
atrost01a20932019-08-28 15:40:37 +01008815
8816/**
8817 * Logs when a compatibility change is affecting an app.
8818 *
8819 * Logged from:
8820 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8821 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8822 */
8823message AppCompatibilityChangeReported {
8824 // The UID of the app being affected by the compatibilty change.
8825 optional int32 uid = 1 [(is_uid) = true];
8826
8827 // The ID of the change affecting the app.
8828 optional int64 change_id = 2;
8829
8830 enum State {
8831 UNKNOWN_STATE = 0;
8832 ENABLED = 1;
8833 DISABLED = 2;
8834 LOGGED = 3;
8835 }
8836
8837 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8838 // logged otherwise.
8839 optional State state = 3;
8840
8841 enum Source {
8842 UNKNOWN_SOURCE = 0;
8843 APP_PROCESS = 1;
8844 SYSTEM_SERVER = 2;
8845 }
8846
8847 // Where it was logged from.
8848 optional Source source = 4;
8849
8850}
Hector Dearman40579f62019-11-01 13:19:30 +00008851
8852/**
8853 * Logged from
8854 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8855 */
8856message PerfettoUploaded {
8857 enum Event {
8858 PERFETTO_UNDEFINED = 0;
8859 PERFETTO_TRACE_BEGIN = 1;
8860 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8861 PERFETTO_ON_CONNECT = 3;
8862 PERFETTO_ON_TRACING_DISABLED = 4;
8863 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8864 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8865 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8866 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8867 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8868 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8869 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8870 PERFETTO_TRIGGER_BEGIN = 12;
8871 PERFETTO_TRIGGER_SUCCESS = 13;
8872 PERFETTO_TRIGGER_FAILURE = 14;
8873 PERFETTO_HIT_GUARDRAILS = 15;
8874 PERFETTO_ON_TIMEOUT = 16;
8875 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8876 }
8877
8878 // Which stage of the pipeline we are reporting from.
8879 optional Event event = 1;
8880
8881 // UUID matching the one set inside the SystemInfo trace packet.
8882 optional int64 trace_uuid_lsb = 2;
8883 optional int64 trace_uuid_msb = 3;
8884}
Mark Tabrya824a642019-11-05 12:26:12 -08008885
8886/**
8887 * Pulls client metrics on data transferred via Vehicle Maps Service.
8888 * Metrics are keyed by uid + layer.
8889 *
8890 * Pulled from:
8891 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8892 */
8893message VmsClientStats {
8894 // UID of the VMS client app
8895 optional int32 uid = 1 [(is_uid) = true];
8896
8897 // VMS layer definition
8898 optional int32 layer_type = 2;
8899 optional int32 layer_channel = 3;
8900 optional int32 layer_version = 4;
8901
8902 // Bytes and packets sent by the client for the layer
8903 optional int64 tx_bytes = 5;
8904 optional int64 tx_packets = 6;
8905
8906 // Bytes and packets received by the client for the layer
8907 optional int64 rx_bytes = 7;
8908 optional int64 rx_packets = 8;
8909
8910 // Bytes and packets dropped due to client error
8911 optional int64 dropped_bytes = 9;
8912 optional int64 dropped_packets = 10;
8913}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008914
8915/**
8916 * State of a dangerous permission requested by a package - sampled
8917 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8918*/
8919message DangerousPermissionStateSampled {
8920 // Name of the permission
8921 optional string permission_name = 1;
8922
8923 // Uid of the package
8924 optional int32 uid = 2 [(is_uid) = true];
8925
8926 // If the permission is granted to the uid
8927 optional bool is_granted = 3;
8928
8929 // Permission flags as per android.content.pm.PermissionFlags
8930 optional int32 permission_flags = 4;
8931}
8932
Stan Iliev637ba5e2019-08-16 13:43:08 -04008933/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008934 * HWUI stats for a given app.
8935 */
8936message GraphicsStats {
8937 // The package name of the app
8938 optional string package_name = 1;
8939
8940 // The version code of the app
8941 optional int64 version_code = 2;
8942
8943 // The start & end timestamps in UTC as
8944 // milliseconds since January 1, 1970
8945 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008946 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008947
Stan Ilievb6517192020-02-18 10:12:42 -05008948 optional int64 end_millis = 4;
8949
8950 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8951 enum PipelineType {
8952 UNKNOWN = 0;
8953 GL = 1;
8954 VULKAN = 2;
8955 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008956
8957 // HWUI renders pipeline type: GL or Vulkan.
8958 optional PipelineType pipeline = 5;
8959
8960 // Distinct frame count.
8961 optional int32 total_frames = 6;
8962
8963 // Number of "missed vsync" events.
8964 optional int32 missed_vsync_count = 7;
8965
8966 // Number of frames in triple-buffering scenario (high input latency)
8967 optional int32 high_input_latency_count = 8;
8968
8969 // Number of "slow UI thread" events.
8970 optional int32 slow_ui_thread_count = 9;
8971
8972 // Number of "slow bitmap upload" events.
8973 optional int32 slow_bitmap_upload_count = 10;
8974
8975 // Number of "slow draw" events.
8976 optional int32 slow_draw_count = 11;
8977
8978 // Number of frames that missed their deadline (aka, visibly janked)
8979 optional int32 missed_deadline_count = 12;
8980
8981 // The frame time histogram for the package
8982 optional FrameTimingHistogram cpu_histogram = 13
8983 [(android.os.statsd.log_mode) = MODE_BYTES];
8984
8985 // The gpu frame time histogram for the package
8986 optional FrameTimingHistogram gpu_histogram = 14
8987 [(android.os.statsd.log_mode) = MODE_BYTES];
8988
8989 // UI mainline module version.
8990 optional int64 version_ui_module = 15;
8991
8992 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8993 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8994 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8995 // more apps are running / rendering.
8996 optional bool is_today = 16;
8997}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008998
8999/**
9000 * Message related to dangerous (runtime) app ops access
9001 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009002message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009003 // Uid of the package accessing app op
9004 optional int32 uid = 1 [(is_uid) = true];
9005
9006 // Name of the package accessing app op
9007 optional string package_name = 2;
9008
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009009 // deprecated - set to empty string
9010 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009011
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009012 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009013 // API. Attributions must be provided through manifest using <attribution> tag available in R
9014 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009015 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009016
9017 // message related to app op access, limited to 600 chars by API
9018 optional string message = 5;
9019
9020 enum SamplingStrategy {
9021 DEFAULT = 0;
9022 UNIFORM = 1;
9023 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009024 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009025 }
9026
9027 // sampling strategy used to collect this message
9028 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009029
9030 // operation id
9031 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009032}
9033
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009034/*
9035 * Logs userspace reboot outcome and duration.
9036 *
9037 * Logged from:
9038 * frameworks/base/core/java/com/android/server/BootReceiver.java
9039 */
9040message UserspaceRebootReported {
9041 // Possible outcomes of userspace reboot.
9042 enum Outcome {
9043 // Default value in case platform failed to determine the outcome.
9044 OUTCOME_UNKNOWN = 0;
9045 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9046 SUCCESS = 1;
9047 // Userspace reboot shutdown sequence was aborted.
9048 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9049 // Remounting userdata into checkpointing mode failed.
9050 FAILED_USERDATA_REMOUNT = 3;
9051 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9052 // reboot.
9053 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9054 }
9055 // Outcome of userspace reboot. Always set.
9056 optional Outcome outcome = 1;
9057 // Duration of userspace reboot in case it has a successful outcome.
9058 // Duration is measured as time between userspace reboot was initiated and until boot completed
9059 // (e.g. sys.boot_completed=1).
9060 optional int64 duration_millis = 2;
9061 // State of primary user's (user0) credential encryption storage.
9062 enum UserEncryptionState {
9063 // Default value.
9064 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9065 // Credential encrypted storage is unlocked.
9066 UNLOCKED = 1;
9067 // Credential encrypted storage is locked.
9068 LOCKED = 2;
9069 }
9070 // State of primary user's encryption storage at the moment boot completed. Always set.
9071 optional UserEncryptionState user_encryption_state = 3;
9072}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009073
9074/*
9075 * Logs integrity check information during each install.
9076 *
9077 * Logged from:
9078 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9079 */
9080message IntegrityCheckResultReported {
9081 optional string package_name = 1;
9082 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009083 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009084 optional string installer_package_name = 4;
9085 enum Response {
9086 UNKNOWN = 0;
9087 ALLOWED = 1;
9088 REJECTED = 2;
9089 FORCE_ALLOWED = 3;
9090 }
9091 optional Response response = 5;
9092 // An estimate on the cause of the response. This will only be populated for
9093 // REJECTED and FORCE_ALLOWED
9094 optional bool caused_by_app_cert_rule = 6;
9095 optional bool caused_by_installer_rule = 7;
9096}
9097
9098/**
9099 * Logs the information about the rules and the provider whenever rules are
9100 * pushed into AppIntegrityManager.
9101 *
9102 * Logged from:
9103 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9104 */
9105message IntegrityRulesPushed {
9106 optional bool success = 1;
9107 // Package name of the app that pushed the rules.
9108 optional string rule_provider = 2;
9109 // Version string of arbitrary format provided by the rule provider to
9110 // identify the rules.
9111 optional string rule_version = 3;
9112}
Jordan Liubedfa702019-12-20 15:08:45 -08009113
9114/**
9115 * Logs when a cell broadcast message is received on the device.
9116 *
9117 * Logged from CellBroadcastService module:
9118 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9119 */
9120message CellBroadcastMessageReported {
9121 // The type of Cell Broadcast message
9122 enum CbType {
9123 UNKNOWN_TYPE = 0;
9124 GSM = 1;
9125 CDMA = 2;
9126 CDMA_SPC = 3;
9127 }
9128
9129 // GSM, CDMA, CDMA-SCP
9130 optional CbType type = 1;
9131}
9132
9133/**
9134 * Logs when an error occurs while handling a cell broadcast message;
9135 *
9136 * Logged from CellBroadcastService module:
9137 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9138 */
9139message CellBroadcastMessageError {
9140 // The type of error raised when trying to handle a cell broadcast message
9141 enum ErrorType {
9142 UNKNOWN_TYPE = 0;
9143 CDMA_DECODING_ERROR = 1;
9144 CDMA_SCP_EMPTY = 2;
9145 CDMA_SCP_HANDLING_ERROR = 3;
9146 GSM_INVALID_HEADER_LENGTH = 4;
9147 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9148 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9149 GSM_INVALID_PDU = 7;
9150 GSM_INVALID_GEO_FENCING_DATA = 8;
9151 GSM_UMTS_INVALID_WAC = 9;
9152 FAILED_TO_INSERT_TO_DB = 10;
9153 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9154 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9155 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9156 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9157 }
9158
9159 // What kind of error occurred
9160 optional ErrorType type = 1;
9161
9162 // Exception message (or log message) associated with the error (max 1000 chars)
9163 optional string exception_message = 2;
9164}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009165
9166/**
9167 * Logs when the SDK Extensions test app has polled the current version.
9168 * This is atom ID 354.
9169 *
9170 * Logged from:
9171 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
9172 */
9173message SdkExtensionStatus {
9174 enum ApiCallStatus {
9175 CALL_NOT_ATTEMPTED = 0;
9176 CALL_SUCCESSFUL = 1;
9177 CALL_FAILED = 2;
9178 }
9179
9180 optional ApiCallStatus result = 1;
9181
9182 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
9183 optional int32 r_extension_version = 2;
9184
9185 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
9186 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
9187 optional int32 failed_call_symbol = 3;
9188}
Marco Ballesio497aff42020-01-24 08:39:42 -08009189
9190/**
Henry Fange316ab62020-04-21 18:43:14 -07009191 * Logs when a tune occurs through device's Frontend.
9192 * This is atom ID 276.
9193 *
9194 * Logged from:
9195 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9196 */
9197message TvTunerStateChanged {
9198 enum State {
9199 UNKNOWN = 0;
9200 TUNING = 1; // Signal is tuned
9201 LOCKED = 2; // the signal is locked
9202 NOT_LOCKED = 3; // the signal isn’t locked.
9203 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9204 SCANNING = 5; // the signal is scanned
9205 SCAN_STOPPED = 6; // the scan is stopped.
9206 }
9207 // The uid of the application that sent this custom atom.
9208 optional int32 uid = 1 [(is_uid) = true];
9209 // new state
9210 optional State state = 2;
9211}
9212/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009213 * Logs when an app is frozen or unfrozen.
9214 *
9215 * Logged from:
9216 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9217 */
9218message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009219 // The type of event.
9220 enum Action {
9221 UNKNOWN = 0;
9222 FREEZE_APP = 1;
9223 UNFREEZE_APP = 2;
9224 }
9225 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009226
Blake Kragten6ce382a2020-01-16 20:20:46 -08009227 // Pid of the process being frozen.
9228 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009229
Blake Kragten6ce382a2020-01-16 20:20:46 -08009230 // Name of the process being frozen.
9231 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009232
Blake Kragten6ce382a2020-01-16 20:20:46 -08009233 // Time since last unfrozen.
9234 optional int64 time_unfrozen_millis = 4;
9235}
9236
9237/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009238 * Pulls information for a single voice call.
9239 *
9240 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9241 *
9242 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009243 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009244 */
9245message VoiceCallSession {
9246 // Bearer (IMS or CS) when the call started.
9247 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9248
9249 // Bearer (IMS or CS) when the call ended.
9250 // The bearer may change during the call, e.g. due to SRVCC.
9251 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9252
9253 // Direction of the call (incoming or outgoing).
9254 optional android.telephony.CallDirectionEnum direction = 3;
9255
9256 // Time spent setting up the call.
9257 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9258
9259 // Whether the call ended before the setup was completed.
9260 optional bool setup_failed = 5;
9261
9262 // IMS reason code or CS disconnect cause.
9263 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9264 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9265 optional int32 disconnect_reason_code = 6;
9266
9267 // IMS extra code or CS precise disconnect cause.
9268 // For IMS, this code is vendor-specific
9269 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9270 optional int32 disconnect_extra_code = 7;
9271
9272 // IMS extra message or CS vendor cause.
9273 optional string disconnect_extra_message = 8;
9274
9275 // Radio access technology (RAT) used when call started.
9276 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9277
9278 // Radio access technology (RAT) used when call terminated.
9279 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9280
9281 // Number of times RAT changed during the call.
9282 optional int64 rat_switch_count = 11;
9283
9284 // A bitmask of all codecs used during the call.
9285 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9286 optional int64 codec_bitmask = 12;
9287
9288 // Number of other calls going on during call setup, for the same SIM slot.
9289 optional int32 concurrent_call_count_at_start = 13;
9290
9291 // Number of other calls going on during call termination, for the same SIM slot.
9292 optional int32 concurrent_call_count_at_end = 14;
9293
9294 // Index of the SIM is used, 0 for single-SIM devices.
9295 optional int32 sim_slot_index = 15;
9296
9297 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9298 optional bool is_multi_sim = 16;
9299
9300 // Whether the call was made with an eSIM profile.
9301 optional bool is_esim = 17;
9302
9303 // Carrier ID of the SIM card.
9304 // See https://source.android.com/devices/tech/config/carrierid.
9305 optional int32 carrier_id = 18;
9306
Chi Zhangba1b03a2020-04-21 17:17:56 -07009307 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009308 optional bool srvcc_completed = 19;
9309
9310 // Number of SRVCC failures.
9311 optional int64 srvcc_failure_count = 20;
9312
9313 // Number of SRVCC cancellations.
9314 optional int64 srvcc_cancellation_count = 21;
9315
Chi Zhangba1b03a2020-04-21 17:17:56 -07009316 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9317 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009318 optional bool rtt_enabled = 22;
9319
9320 // Whether this was an emergency call.
9321 optional bool is_emergency = 23;
9322
9323 // Whether the call was performed while roaming.
9324 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009325
9326 // A random number used as the dimension field to pull multiple atoms.
9327 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009328}
9329
9330/**
9331 * Pulls voice call radio access technology (RAT) usage.
9332 *
9333 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9334 * time. The atom will be skipped if not enough data is available.
9335 *
9336 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009337 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009338 */
9339message VoiceCallRatUsage {
9340 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9341 optional int32 carrier_id = 1;
9342
9343 // Radio access technology.
9344 optional android.telephony.NetworkTypeEnum rat = 2;
9345
9346 // Total duration that voice calls spent on this carrier and RAT.
9347 optional int64 total_duration_seconds = 3;
9348
9349 // Total number of calls using this carrier and RAT.
9350 // A call is counted once even if it used the RAT multiple times.
9351 optional int64 call_count = 4;
9352}
9353
9354/**
9355 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9356 *
9357 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009358 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009359 */
9360message SimSlotState {
9361 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9362 optional int32 active_slot_count = 1;
9363
9364 // Number of SIM cards (both physical and active eSIM profiles).
9365 // This number is always equal to or less than the number of active SIM slots.
9366 optional int32 sim_count = 2;
9367
9368 // Number of active eSIM profiles.
9369 // This number is always equal to or less than the number of SIMs.
9370 optional int32 esim_count = 3;
9371}
9372
9373/**
9374 * Pulls supported cellular radio access technologies.
9375 *
9376 * This atom reports the capabilities of the device, rather than the network it has access to.
9377 *
9378 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009379 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009380 */
9381message SupportedRadioAccessFamily {
9382 // A bitmask of supported radio technologies.
9383 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9384 optional int64 network_type_bitmask = 1;
9385}
9386
9387/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009388 * Logs gnss stats from location service provider
9389 *
9390 * Pulled from:
9391 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9392 */
9393
9394message GnssStats {
9395 // Number of location reports since boot
9396 optional int64 location_reports = 1;
9397
9398 // Total pulled reports of Location failures since boot
9399 optional int64 location_failure_reports = 2;
9400
9401 // Number of time to first fix reports since boot
9402 optional int64 time_to_first_fix_reports = 3;
9403
9404 // Total pulled reported time to first fix (in milli-seconds) since boot
9405 optional int64 time_to_first_fix_milli_s = 4;
9406
9407 // Number of position accuracy reports since boot
9408 optional int64 position_accuracy_reports = 5;
9409
9410 // Total pulled reported position accuracy (in meters) since boot
9411 optional int64 position_accuracy_meters = 6;
9412
9413 // Number of top 4 average CN0 reports since boot
9414 optional int64 top_four_average_cn0_reports = 7;
9415
9416 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9417 optional int64 top_four_average_cn0_db_mhz = 8;
9418
9419 // Number of l5 top 4 average CN0 reports since boot
9420 optional int64 l5_top_four_average_cn0_reports = 9;
9421
9422 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9423 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9424
9425 // Total number of sv status messages reports since boot
9426 optional int64 sv_status_reports = 11;
9427
9428 // Total number of sv status messages reports, where sv is used in fix since boot
9429 optional int64 sv_status_reports_used_in_fix = 12;
9430
9431 // Total number of L5 sv status messages reports since boot
9432 optional int64 l5_sv_status_reports = 13;
9433
9434 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9435 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009436}
Kweku Adams12752132020-02-18 15:36:48 -08009437
9438/**
9439 * Logs when an app is moved to a different standby bucket.
9440 *
9441 * Logged from:
9442 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9443 */
9444message AppStandbyBucketChanged {
9445 optional string package_name = 1;
9446
9447 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9448 optional int32 user_id = 2;
9449
9450 // These enum values match the constants defined in UsageStatsManager.java.
9451 enum Bucket {
9452 BUCKET_UNKNOWN = 0;
9453 BUCKET_EXEMPTED = 5;
9454 BUCKET_ACTIVE = 10;
9455 BUCKET_WORKING_SET = 20;
9456 BUCKET_FREQUENT = 30;
9457 BUCKET_RARE = 40;
9458 BUCKET_RESTRICTED = 45;
9459 BUCKET_NEVER = 50;
9460 }
9461 optional Bucket bucket = 3;
9462
9463 enum MainReason {
9464 MAIN_UNKNOWN = 0;
9465 MAIN_DEFAULT = 0x0100;
9466 MAIN_TIMEOUT = 0x0200;
9467 MAIN_USAGE = 0x0300;
9468 MAIN_FORCED_BY_USER = 0x0400;
9469 MAIN_PREDICTED = 0x0500;
9470 MAIN_FORCED_BY_SYSTEM = 0x0600;
9471 }
9472 optional MainReason main_reason = 4;
9473
9474 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9475 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9476 // UsageStatsManager.java.
9477 optional int32 sub_reason = 5;
9478}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009479
9480/**
9481* Reports a started sharesheet transaction.
9482*
9483* Logged from:
9484* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9485*/
9486message SharesheetStarted {
9487 // The event_id (as for UiEventReported).
9488 optional int32 event_id = 1;
9489 // The calling app's package name.
9490 optional string package_name = 2;
9491 // An identifier to tie together multiple logs relating to the same share event
9492 optional int32 instance_id = 3;
9493 // The mime type of the share
9494 optional string mime_type = 4;
9495 // The number of direct targets the calling app is providing that will be shown.
9496 optional int32 num_app_provided_direct_targets = 5;
9497 // The number of app targets the calling app is providing that will be shown.
9498 optional int32 num_app_provided_app_targets = 6;
9499 // True if the share originates from the workprofile
9500 optional bool is_workprofile = 7;
9501
9502 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009503 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009504 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9505 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9506 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9507 }
9508 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009509 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009510
9511 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9512 INTENT_DEFAULT = 0;
9513 INTENT_ACTION_VIEW = 1;
9514 INTENT_ACTION_EDIT = 2;
9515 INTENT_ACTION_SEND = 3;
9516 INTENT_ACTION_SENDTO = 4;
9517 INTENT_ACTION_SEND_MULTIPLE = 5;
9518 INTENT_ACTION_IMAGE_CAPTURE = 6;
9519 INTENT_ACTION_MAIN = 7;
9520 }
9521 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009522 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009523}
9524
9525/**
9526 * Reports a ranking selection event.
9527 *
9528 * Logged from:
9529 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9530 */
9531message RankingSelected {
9532 // The event_id (as for UiEventReported).
9533 optional int32 event_id = 1;
9534 // The relevant app's package name (can be source or picked package).
9535 optional string package_name = 2;
9536 // An identifier to tie together multiple logs relating to the same share event.
9537 optional int32 instance_id = 3;
9538 // Which of the ranked targets got picked, default starting position 0.
9539 optional int32 position_picked = 4;
9540}
Raff Tsaiea4db182020-03-06 07:45:43 +08009541
9542/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009543 * Logs when TvSettings UI is interacted at.
9544 *
9545 * Logged from: packages/apps/TvSettings
9546 */
9547message TvSettingsUIInteracted {
9548
9549 /** The UI action category */
9550 optional android.app.tvsettings.Action action = 1;
9551
9552 /** The ID of the entry that the users actioned on */
9553 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009554}
9555
9556/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009557 * Logs information about a package installation using package installer V2 APIs.
9558 *
9559 * Logged from:
9560 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9561 */
9562message PackageInstallerV2Reported {
9563 // Whether this installation uses Incremental File System
9564 optional bool is_incremental = 1;
9565 // Name of the package that is intended to be installed
9566 optional string package_name = 2;
9567 // The duration between when the install was requested to when the install has completed
9568 optional int64 duration_millis = 3;
9569 // Installation result in final integer, which are SystemApi's.
9570 // Return_code 1 indicates success.
9571 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9572 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009573 // Total size of the APKs installed for this package
9574 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009575}
9576
9577/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009578 * Logs settings provider values.
9579 *
9580 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9581 * then write the value to proto.
9582 *
9583 */
9584message SettingSnapshot {
9585
9586 // Setting key
9587 optional string name = 1;
9588
9589 enum SettingsValueType {
9590 NOTASSIGNED = 0;
9591 ASSIGNED_BOOL_TYPE = 1;
9592 ASSIGNED_INT_TYPE = 2;
9593 ASSIGNED_FLOAT_TYPE = 3;
9594 ASSIGNED_STRING_TYPE = 4;
9595 };
9596 // Setting value type
9597 optional SettingsValueType type = 2;
9598
9599 optional bool bool_value = 3;
9600
9601 optional int32 int_value = 4;
9602
9603 optional float float_value = 5;
9604
9605 optional string str_value = 6;
9606
9607 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9608 optional int32 user_id = 7;
9609}
Varun Shahacb56342019-12-18 11:45:38 -08009610
9611/**
9612 * An event logged to indicate that a user journey is about to be performed. This atom includes
9613 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9614 * will immediately follow this atom which will describe the event(s) and its state.
9615 *
9616 * Logged from:
9617 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9618 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9619 */
9620message UserLifecycleJourneyReported {
9621 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9622 // UserLifecycleEventOccurred atom)
9623 optional int64 session_id = 1;
9624
9625 // Indicates what type of user journey this session is related to
9626 enum Journey {
9627 UNKNOWN = 0; // Undefined user lifecycle journey
9628 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9629 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9630 USER_START = 3; // A user start journey
9631 USER_CREATE = 4; // A user creation journey
9632 }
9633 optional Journey journey = 2;
9634 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9635 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9636 optional int32 origin_user = 3;
9637 // Which user the journey is targeting
9638 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9639 optional int32 target_user = 4;
9640
9641 // What is the user type of the target user
9642 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9643 enum UserType {
9644 TYPE_UNKNOWN = 0;
9645 FULL_SYSTEM = 1;
9646 FULL_SECONDARY = 2;
9647 FULL_GUEST = 3;
9648 FULL_DEMO = 4;
9649 FULL_RESTRICTED = 5;
9650 PROFILE_MANAGED = 6;
9651 SYSTEM_HEADLESS = 7;
9652 }
9653 optional UserType user_type = 5;
9654 // What are the flags attached to the target user
9655 optional int32 user_flags = 6;
9656}
9657
9658/**
9659 * An event logged when a specific user lifecycle event is performed. These events should be
9660 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9661 * Note: journeys can span over multiple events, hence some events may share a single session id.
9662 *
9663 * Logged from:
9664 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9665 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9666 */
9667message UserLifecycleEventOccurred {
9668 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9669 optional int64 session_id = 1;
9670 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9671 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9672 optional int32 user_id = 2;
9673
9674 enum Event {
9675 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9676 SWITCH_USER = 1; // Indicates that this is a user switch event
9677 START_USER = 2; // Indicates that this is a user start event
9678 CREATE_USER = 3; // Indicates that this is a user create event
9679 }
9680 optional Event event = 3;
9681
9682 enum State {
9683 NONE = 0; // Indicates the associated event has no start/end defined
9684 BEGIN = 1;
9685 FINISH = 2;
9686 }
9687 optional State state = 4; // Represents the state of an event (beginning/ending)
9688}
jasonwshsu81173e32020-03-27 15:22:03 +08009689
9690/**
9691 * Logs when accessibility shortcut clicked.
9692 *
9693 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009694 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009695 */
9696message AccessibilityShortcutReported {
9697 // The accessibility feature(including installed a11y service, framework a11y feature,
9698 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9699 optional string package_name = 1;
9700
9701 // The definition of the accessibility shortcut.
9702 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9703 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9704
9705 // The definition of the service status.
9706 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9707 optional android.stats.accessibility.ServiceStatus service_status = 3;
9708}
9709
9710/**
9711 * Logs when accessibility service status changed.
9712 *
9713 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009714 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009715 */
9716message AccessibilityServiceReported {
9717 // The accessibility service package name.
9718 optional string package_name = 1;
9719
9720 // The definition of the service status.
9721 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9722 optional android.stats.accessibility.ServiceStatus service_status = 2;
9723}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009724
Denny cy Lee57b31282020-04-17 10:08:52 +08009725message DisplayWakeReason {
9726 // Wake_up_reason code
9727 // If LOWORD(wake_up_reason) = 0
9728 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9729 // else reference wake_up_reason to
9730 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9731 optional int32 wake_up_reason = 1;
9732 // Count of wake up by reason
9733 optional int32 wake_times = 2;
9734}
9735
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009736/**
9737 * Logs app usage events.
9738 */
9739message AppUsageEventOccurred {
9740 optional int32 uid = 1 [(is_uid) = true];
9741 optional string package_name = 2;
9742 optional string class_name = 3;
9743
9744 enum EventType {
9745 NONE = 0;
9746 MOVE_TO_FOREGROUND = 1;
9747 MOVE_TO_BACKGROUND = 2;
9748 }
9749 optional EventType event_type = 4;
9750}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009751
9752/*
9753 * Quality metrics logged when EVS cameras are active.
9754 *
9755 * Logged from:
9756 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9757 */
9758message EvsUsageStatsReported {
9759
9760 // Camera identifier to distinguish the source camera device. This is not
9761 // globally unique and therefore cannot be used to identify the user and/or
9762 // the device.
9763 optional int32 device_id = 1;
9764
9765 // Peak number of clients during the service
9766 optional int32 peak_num_clients = 2;
9767
9768 // Number of erroneous events during the service
9769 optional int32 num_errors = 3;
9770
9771 // Round trip latency of the very first frame
9772 optional int64 first_latency_millis = 4;
9773
9774 // Average frame round trip latency
9775 optional float avg_latency_millis = 5;
9776
9777 // Peak frame round trip latency
9778 optional int64 peak_latency_millis = 6;
9779
9780 // Total number of frames received
9781 optional int64 total_frames = 7;
9782
9783 // Number of frames ignored
9784 optional int64 ignored_frames = 8;
9785
9786 // Number of dropped frames to synchronize camera devices
9787 optional int64 dropped_frames_to_sync = 9;
9788
9789 // The duration of the service
9790 optional int64 duration_millis = 10;
9791}
Robert Leecccdc152020-04-23 13:22:46 +08009792
9793/**
9794 * Logs audio power usage stats.
9795 *
9796 * Pushed from:
9797 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9798 */
9799message AudioPowerUsageDataReported {
9800 /**
9801 * Device used for input/output
9802 *
9803 * All audio devices please refer to below file:
9804 * system/media/audio/include/system/audio-base.h
9805 *
9806 * Define our own enum values because we don't report all audio devices.
9807 * Currently, we only report built-in audio devices such as handset, speaker,
9808 * built-in mics, common audio devices such as wired headset, usb headset
9809 * and bluetooth devices.
9810 */
9811 enum AudioDevice {
9812 OUTPUT_EARPIECE = 0x1; // handset
9813 OUTPUT_SPEAKER = 0x2; // dual speaker
9814 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9815 OUTPUT_USB_HEADSET = 0x8; // usb headset
9816 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9817 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9818 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9819
9820 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9821 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9822 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9823 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9824 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9825 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9826 }
9827 optional AudioDevice audio_device = 1;
9828
9829 // Duration of the audio in seconds
9830 optional int32 duration_secs = 2;
9831
9832 // Average volume (0 ... 1.0)
9833 optional float average_volume = 3;
9834
9835 enum AudioType {
9836 UNKNOWN_TYPE = 0;
9837 VOICE_CALL_TYPE = 1; // voice call
9838 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9839 MEDIA_TYPE = 3; // music and system sound
9840 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9841 ALARM_TYPE = 5; // alarm type
9842 // record type
9843 CAMCORDER_TYPE = 6; // camcorder
9844 RECORD_TYPE = 7; // other recording
9845 }
9846 optional AudioType type = 4;
9847}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009848
9849/**
9850 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9851 *
9852 * Pulled from:
9853 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9854 */
9855message BytesTransferByTagAndMetered {
9856 optional int32 uid = 1 [(is_uid) = true];
9857
9858 optional bool is_metered = 2;
9859
9860 optional int32 tag = 3;
9861
9862 optional int64 rx_bytes = 4;
9863
9864 optional int64 rx_packets = 5;
9865
9866 optional int64 tx_bytes = 6;
9867
9868 optional int64 tx_packets = 7;
9869}
Robert Luo2f52f042020-05-11 16:39:24 +08009870
9871/*
9872 * Logs when the Media Output Switcher finishes a media switch operation.
9873 *
9874 * Logged from:
9875 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9876 */
9877message MediaOutputOpSwitchReported {
9878 // Source medium type before switching.
9879 optional android.app.settings.mediaoutput.MediumType source = 1;
9880
9881 // Target medium type after switching.
9882 optional android.app.settings.mediaoutput.MediumType target = 2;
9883
9884 // The result of switching.
9885 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9886
9887 // The detail code of a switching result.
9888 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9889
9890 /*
9891 * The package name of a pre-installed app, whose media session is being switched.
9892 */
9893 optional string media_session_package_name = 5;
9894
9895 // The amount of available wired devices when a switching is being performed.
9896 optional int32 available_wired_device_count = 6;
9897
9898 // The amount of available Bluetooth devices a switching is being performed.
9899 optional int32 available_bt_device_count = 7;
9900
9901 // The amount of available remote devices when a switching is being performed.
9902 optional int32 available_remote_device_count = 8;
9903
9904 // The amount of applied devices within a remote dynamic group after a switching is done.
9905 optional int32 applied_device_count_within_remote_group = 9;
9906}