blob: 2e3c4ce7241e612c2a1d60b5c03dee54584df380 [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"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700447
448 // StatsdStats tracks platform atoms with ids upto 500.
449 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000450 }
David Chenc8a43242017-10-17 16:23:28 -0700451
David Chen6e3e6cb2018-01-03 16:14:06 -0800452 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700453 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700454 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
456 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700457 MobileBytesTransfer mobile_bytes_transfer =
458 10002 [(module) = "framework", (truncate_timestamp) = true];
459 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
460 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
462 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700463 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800464 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700465 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800466 CpuTimePerUidFreq cpu_time_per_uid_freq =
467 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
469 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
470 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
471 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
472 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700473 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700474 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700475 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700476 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800477 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
478 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700479 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800480 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800482 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800483 DiskStats disk_stats = 10025 [(module) = "framework"];
484 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
485 AppSize app_size = 10027 [(module) = "framework"];
486 CategorySize category_size = 10028 [(module) = "framework"];
487 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800488 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
490 DiskIo disk_io = 10032 [(module) = "framework"];
491 PowerProfile power_profile = 10033 [(module) = "framework"];
492 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
493 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
494 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700495 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800496 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
497 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
498 10040 [(module) = "framework"];
499 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
500 10041 [(module) = "framework"];
501 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800502 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800503 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800504 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800505 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
506 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
507 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
508 RoleHolder role_holder = 10049 [(module) = "framework"];
509 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800510 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800511 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
512 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800513 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
514 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800515 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
516 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
517 FaceSettings face_settings = 10058 [(module) = "framework"];
518 CoolingDevice cooling_device = 10059 [(module) = "framework"];
519 AppOps app_ops = 10060 [(module) = "framework"];
520 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700521 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
522 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800523 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800524 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800525 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
526 DangerousPermissionStateSampled dangerous_permission_state_sampled =
527 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400528 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000529 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000530 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200531 PackageNotificationPreferences package_notification_preferences =
532 10071 [(module) = "framework"];
533 PackageNotificationChannelPreferences package_notification_channel_preferences =
534 10072 [(module) = "framework"];
535 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
536 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800537 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800538 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700539 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
540 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
541 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
542 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800543 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800544 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800545 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700546 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
547 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700548 }
yroa1fe77c2018-02-26 14:22:54 -0800549
Bookatz76aafcf2018-09-17 16:17:10 -0700550 // DO NOT USE field numbers above 100,000 in AOSP.
551 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
552 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100553
554 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700555}
556
Yao Chend54f9dd2017-10-17 17:37:48 +0000557/**
Yangster-mac20877162017-12-22 17:19:39 -0800558 * This proto represents a node of an attribution chain.
559 * Note: All attribution chains are represented as a repeated field of type
560 * AttributionNode. It is understood that in such arrays, the order is that
561 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000562 */
Yangster-mac20877162017-12-22 17:19:39 -0800563message AttributionNode {
564 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800565 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800566
Yangster-mac20877162017-12-22 17:19:39 -0800567 // The (optional) string tag for an element in the attribution chain. If the
568 // element has no tag, it is encoded as an empty string.
569 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700570}
571
Yangster-mac48b3d622018-08-18 12:38:11 -0700572message KeyValuePair {
573 optional int32 key = 1;
574 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700575 int32 value_int = 2;
576 int64 value_long = 3;
577 string value_str = 4;
578 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700579 }
580}
581
582message KeyValuePairsAtom {
583 optional int32 uid = 1;
584 repeated KeyValuePair pairs = 2;
585}
586
Yao Chend54f9dd2017-10-17 17:37:48 +0000587/*
588 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800589 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000590 *
591 * RULES:
592 * - The field ids for each atom must start at 1, and count upwards by 1.
593 * Skipping field ids is not allowed.
594 * - These form an API, so renaming, renumbering or removing fields is
595 * not allowed between android releases. (This is not currently enforced,
596 * but there will be a tool to enforce this restriction).
597 * - The types must be built-in protocol buffer types, namely, no sub-messages
598 * are allowed (yet). The bytes type is also not allowed.
599 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800600 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000601 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800602 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000603 * - A field that is a uid should be a string field, tagged with the [xxx]
604 * annotation. The generated code on android will be represented by UIDs,
605 * and those UIDs will be translated in xxx to those strings.
606 *
607 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700608 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000609 * - If there is a UID, it goes first. Think in an object-oriented fashion.
610 * *****************************************************************************
611 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700612
Yao Chend54f9dd2017-10-17 17:37:48 +0000613/**
Tej Singha72344992019-04-17 18:55:08 -0700614 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700615 * Logs when the Thermal service HAL notifies the throttling start/stop events.
616 *
617 * Logged from:
618 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
619 */
620message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700621 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700622 optional android.os.TemperatureTypeEnum sensor_type = 1;
623
Maggie White442b6312019-04-05 16:26:44 -0700624 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700625 enum State {
626 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700627 START = 1; // START indicated that throttling was triggered.
628 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700629 }
Yangster-mace16189a2018-08-26 12:20:16 -0700630 optional State state = 2;
631
632 optional float temperature = 3;
633}
634
635/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000636 * Logs when the screen state changes.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
640 */
641message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800642 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800643 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700644 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700645}
Yao Chend54f9dd2017-10-17 17:37:48 +0000646
647/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700648 * Logs that the process state of the uid, as determined by ActivityManager
649 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000650 *
651 * Logged from:
652 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
653 */
Bookatzc1a050a2017-10-10 15:49:28 -0700654message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700655 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000656
Bookatzdb026a22018-01-10 19:01:56 -0800657 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800658 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700659 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000660}
661
662/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700663 * Logs process state change of a process, as per the activity manager.
664 *
665 * Logged from:
666 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
667 */
668message ProcessStateChanged {
669 optional int32 uid = 1;
670 optional string process_name = 2;
671 optional string package_name = 3;
672 // TODO: remove this when validation is done
673 optional int64 version = 5;
674 // The state, from frameworks/base/core/proto/android/app/enums.proto.
675 optional android.app.ProcessStateEnum state = 4;
676}
677
678/**
679 * Logs when ActivityManagerService sleep state is changed.
680 *
681 * Logged from:
682 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
683 */
684message ActivityManagerSleepStateChanged {
685 // TODO: import frameworks proto
686 enum State {
687 UNKNOWN = 0;
688 ASLEEP = 1;
689 AWAKE = 2;
690 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700691 optional State state = 1
692 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700693}
694
695/**
696 * Logs when system memory state changes.
697 *
698 * Logged from:
699 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
700 */
701message MemoryFactorStateChanged {
702 // TODO: import frameworks proto
703 enum State {
704 MEMORY_UNKNOWN = 0;
705 NORMAL = 1; // normal.
706 MODERATE = 2; // moderate memory pressure.
707 LOW = 3; // low memory.
708 CRITICAL = 4; // critical memory.
709
710 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700711 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700712}
713
714/**
715 * Logs when app is using too much cpu, according to ActivityManagerService.
716 *
717 * Logged from:
718 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
719 */
720message ExcessiveCpuUsageReported {
721 optional int32 uid = 1;
722 optional string process_name = 2;
723 optional string package_name = 3;
724 // package version. TODO: remove this when validation is done
725 optional int64 version = 4;
726}
727
728/**
729 * Logs when a cached process is killed, along with its pss.
730 *
731 * Logged from:
732 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
733 */
734message CachedKillReported {
735 optional int32 uid = 1;
736 optional string process_name = 2;
737 optional string package_name = 3;
738 // TODO: remove this when validation is done
739 optional int64 version = 5;
740 optional int64 pss = 4;
741}
742
743/**
xshu2c3d9e42019-09-26 17:54:02 -0700744 * Logs the change in wifi health.
745 *
746 * Logged from:
747 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
748 */
749message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800750 enum Band {
751 UNKNOWN = 0;
752 // All of 2.4GHz band
753 BAND_2G = 1;
754 // Frequencies in the range of [5150, 5250) GHz
755 BAND_5G_LOW = 2;
756 // Frequencies in the range of [5250, 5725) GHz
757 BAND_5G_MIDDLE = 3;
758 // Frequencies in the range of [5725, 5850) GHz
759 BAND_5G_HIGH = 4;
760 // Frequencies in the range of [5925, 6425) GHz
761 BAND_6G_LOW = 5;
762 // Frequencies in the range of [6425, 6875) GHz
763 BAND_6G_MIDDLE = 6;
764 // Frequencies in the range of [6875, 7125) GHz
765 BAND_6G_HIGH = 7;
766 }
xshu2c3d9e42019-09-26 17:54:02 -0700767 // duration this stat is obtained over in milliseconds
768 optional int32 duration_millis = 1;
769 // whether wifi is classified as sufficient for the user's data traffic, determined
770 // by whether the calculated throughput exceeds the average demand within |duration_millis|
771 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700772 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800773 optional bool is_cell_data_available = 3;
774 // the Band bucket the connected network is on
775 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700776}
777
778/**
779 * Logged when wifi detects a significant change in connection failure rate.
780 *
781 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
782 *
783 */
784message WifiFailureStatReported {
785 enum AbnormalityType {
786 UNKNOWN = 0;
787 SIGNIFICANT_INCREASE = 1;
788 SIGNIFICANT_DECREASE = 2;
789 SIMPLY_HIGH = 3;
790 }
791 enum FailureType {
792 FAILURE_UNKNOWN = 0;
793 FAILURE_CONNECTION = 1;
794 FAILURE_ASSOCIATION_REJECTION = 2;
795 FAILURE_ASSOCIATION_TIMEOUT = 3;
796 FAILURE_AUTHENTICATION = 4;
797 FAILURE_NON_LOCAL_DISCONNECTION = 5;
798 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
799 }
800 // Reason for uploading this stat
801 optional AbnormalityType abnormality_type = 1;
802 // The particular type of failure
803 optional FailureType failure_type = 2;
804 // How many times we have encountered this combination of AbnormalityType and FailureType
805 optional int32 failure_count = 3;
806}
807
808/**
809 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
810 *
811 * Logged from:
812 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
813 */
814message WifiConnectionResultReported {
815 enum FailureCode {
816 FAILURE_UNKNOWN = 0;
817 FAILURE_ASSOCIATION_TIMEOUT = 1;
818 FAILURE_ASSOCIATION_REJECTION = 2;
819 FAILURE_AUTHENTICATION_GENERAL = 3;
820 FAILURE_AUTHENTICATION_EAP = 4;
821 FAILURE_DHCP = 5;
822 FAILURE_NETWORK_DISCONNECTION = 6;
823 FAILURE_ROAM_TIMEOUT = 7;
824 }
825 // true represents a successful connection
826 optional bool connection_result = 1;
827 // reason for the connection failure
828 optional FailureCode failure_code = 2;
829 // scan rssi before the connection attempt
830 optional int32 rssi = 3;
831}
832
833/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700834 * Logs when memory stats of a process is reported.
835 *
836 * Logged from:
837 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
838 */
839message ProcessMemoryStatReported {
840 optional int32 uid = 1;
841 optional string process_name = 2;
842 optional string package_name = 3;
843 //TODO: remove this when validation is done
844 optional int64 version = 9;
845 optional int64 pss = 4;
846 optional int64 uss = 5;
847 optional int64 rss = 6;
848 enum Type {
849 ADD_PSS_INTERNAL_SINGLE = 0;
850 ADD_PSS_INTERNAL_ALL_MEM = 1;
851 ADD_PSS_INTERNAL_ALL_POLL = 2;
852 ADD_PSS_EXTERNAL = 3;
853 ADD_PSS_EXTERNAL_SLOW = 4;
854 }
855 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800856 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700857}
858
859/**
Bookatzc1a050a2017-10-10 15:49:28 -0700860 * Logs that a process started, finished, crashed, or ANRed.
861 *
862 * Logged from:
863 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
864 */
865message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700866 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700867
David Chen0b5c90c2018-01-25 16:51:49 -0800868 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800869 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700870
Bookatzddccf0a2017-11-28 16:48:14 -0800871 // What lifecycle state the process changed to.
872 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800873 enum State {
874 FINISHED = 0;
875 STARTED = 1;
876 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800877 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800878 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700879}
880
Bookatzc1a050a2017-10-10 15:49:28 -0700881/**
882 * Logs when the ble scan state changes.
883 *
884 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700885 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700886 */
887message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800888 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700889 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700890
891 enum State {
892 OFF = 0;
893 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700894 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
895 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700896 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800897 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700898 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800899 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700900 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800901 (state_field_option).nested = true
902 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700903
Bookatze5ec0b42018-03-26 13:34:56 -0700904 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700905 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700906 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700907 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700908 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700909 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700910}
911
912/**
913 * Logs reporting of a ble scan finding results.
914 *
915 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700916 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700917 */
Bookatzae6738e2018-09-13 11:38:56 -0700918// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700919message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800920 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700921
922 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800923 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700924}
925
926/**
927 * Logs when a sensor state changes.
928 *
929 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700930 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700931 */
932message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800933 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700934
Bookatzc1a050a2017-10-10 15:49:28 -0700935 // The id (int) of the sensor.
936 optional int32 sensor_id = 2;
937
938 enum State {
939 OFF = 0;
940 ON = 1;
941 }
942 optional State state = 3;
943}
944
Bookatzc1a050a2017-10-10 15:49:28 -0700945/**
946 * Logs when GPS state changes.
947 *
948 * Logged from:
949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
950 */
951message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800952 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700953
954 enum State {
955 OFF = 0;
956 ON = 1;
957 }
958 optional State state = 2;
959}
960
Bookatz48d362e2018-11-06 15:49:08 -0800961/**
962 * Logs when GPS signal quality.
963 *
964 * Logged from:
965 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
966 */
967message GpsSignalQualityChanged {
968 optional android.server.location.GpsSignalQualityEnum level = 1;
969}
970
Bookatzc1a050a2017-10-10 15:49:28 -0700971
972/**
973 * Logs when a sync manager sync state changes.
974 *
975 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700976 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
David Chen0b5c90c2018-01-25 16:51:49 -0800981 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800982 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
984 enum State {
985 OFF = 0;
986 ON = 1;
987 }
988 optional State state = 3;
989}
990
Yangster-mac96353002018-09-05 11:18:55 -0700991/*
992 * Deferred job stats.
993 *
994 * Logged from:
995 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
996*/
997message DeferredJobStatsReported {
998 repeated AttributionNode attribution_node = 1;
999
1000 // Number of jobs deferred.
1001 optional int32 num_jobs_deferred = 2;
1002
1003 // Time since the last job runs.
1004 optional int64 time_since_last_job_millis = 3;
1005}
1006
Bookatzc1a050a2017-10-10 15:49:28 -07001007/**
1008 * Logs when a job scheduler job state changes.
1009 *
1010 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001011 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001012 */
1013message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001014 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001015
1016 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001017 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001018
1019 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001020 FINISHED = 0;
1021 STARTED = 1;
1022 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001023 }
1024 optional State state = 3;
1025
Tej Singh33a412b2018-03-16 18:43:59 -07001026 // The reason a job has stopped.
1027 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001028 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001029 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001030
1031 // The standby bucket of the app that scheduled the job. These match the framework constants
1032 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1033 // already assigned 0.
1034 enum Bucket {
1035 UNKNOWN = -1;
1036 ACTIVE = 0;
1037 WORKING_SET = 1;
1038 FREQUENT = 2;
1039 RARE = 3;
1040 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001041 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001042 }
1043 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1044
1045 // The job id (as assigned by the app).
1046 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001047
1048 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1049 // constraints as they are always assumed to be set.
1050 optional bool has_charging_constraint = 7;
1051 optional bool has_battery_not_low_constraint = 8;
1052 optional bool has_storage_not_low_constraint = 9;
1053 optional bool has_timing_delay_constraint = 10;
1054 optional bool has_deadline_constraint = 11;
1055 optional bool has_idle_constraint = 12;
1056 optional bool has_connectivity_constraint = 13;
1057 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001058}
1059
1060/**
1061 * Logs when the audio state changes.
1062 *
1063 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001064 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001065 */
1066message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001067 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001068
1069 enum State {
1070 OFF = 0;
1071 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001072 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1073 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001074 }
1075 optional State state = 2;
1076}
1077
1078/**
1079 * Logs when the video codec state changes.
1080 *
1081 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001082 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001083 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001084message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001085 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001086
1087 enum State {
1088 OFF = 0;
1089 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001090 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1091 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001092 }
1093 optional State state = 2;
1094}
1095
1096/**
1097 * Logs when the flashlight state changes.
1098 *
1099 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001100 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001101 */
1102message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001103 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001104
1105 enum State {
1106 OFF = 0;
1107 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001108 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1109 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001110 }
1111 optional State state = 2;
1112}
1113
1114/**
1115 * Logs when the camera state changes.
1116 *
1117 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001118 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001119 */
1120message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001121 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001122
1123 enum State {
1124 OFF = 0;
1125 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001126 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1127 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001128 }
1129 optional State state = 2;
1130}
1131
1132/**
1133 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001134 *
1135 * Logged from:
1136 * TODO
1137 */
Bookatzd6746242017-10-24 18:39:35 -07001138message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001139 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001140 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001141
Bookatz1a1b0462018-01-12 11:47:03 -08001142 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1143 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001144 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001145
1146 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001147 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001148
1149 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001150 RELEASE = 0;
1151 ACQUIRE = 1;
1152 CHANGE_RELEASE = 2;
1153 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001154 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001155 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001156 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001157 (state_field_option).default_state_value = 0,
1158 (state_field_option).nested = true
1159 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001160}
1161
1162/**
Bookatzc1a050a2017-10-10 15:49:28 -07001163 * Logs when a partial wakelock is considered 'long' (over 1 min).
1164 *
1165 * Logged from:
1166 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1167 */
1168message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001169 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001170
Yao Chend54f9dd2017-10-17 17:37:48 +00001171 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1172 optional string tag = 2;
1173
Bookatzc1a050a2017-10-10 15:49:28 -07001174 // TODO: I have no idea what this is.
1175 optional string history_tag = 3;
1176
1177 enum State {
1178 OFF = 0;
1179 ON = 1;
1180 }
1181 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001182}
1183
Bookatzc1a050a2017-10-10 15:49:28 -07001184/**
Bookatza66083f2018-09-20 17:24:00 -07001185 * Logs when the device is interactive, according to the PowerManager Notifier.
1186 *
1187 * Logged from:
1188 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1189 */
1190message InteractiveStateChanged {
1191 enum State {
1192 OFF = 0;
1193 ON = 1;
1194 }
1195 optional State state = 1;
1196}
1197
1198/**
Bookatzc1a050a2017-10-10 15:49:28 -07001199 * Logs Battery Saver state change.
1200 *
1201 * Logged from:
1202 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1203 */
1204message BatterySaverModeStateChanged {
1205 enum State {
1206 OFF = 0;
1207 ON = 1;
1208 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001209 optional State state = 1
1210 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001211}
1212
1213/**
1214 * Logs Doze mode state change.
1215 *
1216 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001217 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001218 */
1219message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001220 optional android.server.DeviceIdleModeEnum state = 1
1221 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001222}
1223
1224
1225/**
1226 * Logs state change of Doze mode including maintenance windows.
1227 *
1228 * Logged from:
1229 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1230 */
1231message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001232 optional android.server.DeviceIdleModeEnum state = 1
1233 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001234}
1235
1236/**
1237 * Logs screen brightness level.
1238 *
1239 * Logged from:
1240 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1241 */
1242message ScreenBrightnessChanged {
1243 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1244 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001245}
1246
1247/**
1248 * Logs battery level (percent full, from 0 to 100).
1249 *
1250 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001251 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001252 */
1253message BatteryLevelChanged {
1254 // Battery level. Should be in [0, 100].
1255 optional int32 battery_level = 1;
1256}
1257
1258/**
1259 * Logs change in charging status of the device.
1260 *
1261 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001262 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001263 */
1264message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001265 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001266 optional android.os.BatteryStatusEnum state = 1
1267 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001268}
1269
1270/**
1271 * Logs whether the device is plugged in, and what power source it is using.
1272 *
1273 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001274 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001275 */
1276message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001277 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001278 optional android.os.BatteryPluggedStateEnum state = 1
1279 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001280}
1281
Bookatz8c6571b2017-10-24 15:04:41 -07001282/**
1283 * Logs when an app's wakeup alarm fires.
1284 *
1285 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001286 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001287 */
1288message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001289 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001290
1291 // Name of the wakeup alarm.
1292 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001293
1294 // Name of source package (for historical reasons, since BatteryStats tracked it).
1295 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001296
Ben Murdoch3389f1522019-05-21 15:05:34 +01001297 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001298 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001299}
1300
1301/**
1302 * Logs when an an app causes the mobile radio to change state.
1303 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1304 *
1305 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001306 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001307 */
1308message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001309 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001310
Bookatz1a1b0462018-01-12 11:47:03 -08001311 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1312 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001313}
1314
1315/**
1316 * Logs when an an app causes the wifi radio to change state.
1317 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1318 *
1319 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001320 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001321 */
1322message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001323 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001324
Bookatz1a1b0462018-01-12 11:47:03 -08001325 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1326 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001327}
1328
1329/**
1330 * Logs kernel wakeup reasons and aborts.
1331 *
1332 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001333 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001334 */
1335message KernelWakeupReported {
1336 // Name of the kernel wakeup reason (or abort).
1337 optional string wakeup_reason_name = 1;
1338
1339 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001340 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001341}
1342
1343/**
Bookatzda1798c2018-12-13 14:16:00 -08001344 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001345 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001346 *
1347 * Logged from:
1348 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1349 */
1350message WifiEnabledStateChanged {
1351 enum State {
1352 OFF = 0;
1353 ON = 1;
1354 }
1355 optional State state = 1;
1356}
1357
1358/**
tsaichristinececebdc2020-02-04 14:05:56 -08001359 * This atom is deprecated starting in R.
1360 *
Bookatzda1798c2018-12-13 14:16:00 -08001361 * 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 -08001362 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1363 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001364 *
1365 * Logged from:
1366 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1367 */
1368message WifiRunningStateChanged {
1369 repeated AttributionNode attribution_node = 1;
1370
1371 enum State {
1372 OFF = 0;
1373 ON = 1;
1374 }
1375 optional State state = 2;
1376}
1377
1378/**
Bookatze5885242017-10-24 20:10:31 -07001379 * Logs wifi locks held by an app.
1380 *
1381 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001382 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001383 */
1384message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001385 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001386
1387 enum State {
1388 OFF = 0;
1389 ON = 1;
1390 }
1391 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001392
1393 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1394 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001395}
1396
1397/**
1398 * Logs wifi signal strength changes.
1399 *
1400 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001401 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001402 */
1403message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001404 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1405 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001406}
1407
1408/**
1409 * Logs wifi scans performed by an app.
1410 *
1411 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001412 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001413 */
1414message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001415 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001416
1417 enum State {
1418 OFF = 0;
1419 ON = 1;
1420 }
1421 optional State state = 2;
1422}
1423
1424/**
Tej Singh4503e102018-01-04 14:35:01 -08001425 * Logs wifi multicast locks held by an app
1426 *
1427 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001428 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001429 */
1430message WifiMulticastLockStateChanged {
1431 repeated AttributionNode attribution_node = 1;
1432
1433 enum State {
1434 OFF = 0;
1435 ON = 1;
1436 }
1437 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001438
1439 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001440}
1441
1442/**
Tej Singh1ea42892018-01-19 09:27:00 -08001443 * Logs shutdown reason and duration on next boot.
1444 *
1445 * Logged from:
1446 * frameworks/base/core/java/com/android/server/BootReceiver.java
1447 */
1448message ShutdownSequenceReported {
1449 // True if shutdown is for a reboot. Default: false if we do not know.
1450 optional bool reboot = 1;
1451
1452 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1453 optional string reason = 2;
1454
1455 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1456 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001457 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001458
1459 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001460 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001461}
1462
Tej Singh6483ea42018-01-25 17:45:49 -08001463
1464/**
1465 * Logs boot reason and duration.
1466 *
1467 * Logged from:
1468 * system/core/bootstat/bootstat.cpp
1469 */
1470message BootSequenceReported {
1471 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1472 // Default: "<EMPTY>" if not available.
1473 optional string bootloader_reason = 1;
1474
1475 // Reason for system boot. Eg. bootloader, reboot,userrequested
1476 // Default: "<EMPTY>" if not available.
1477 optional string system_reason = 2;
1478
1479 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001480 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001481
1482 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001483 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001484
1485 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001486 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001487
1488 // Time since last boot in ms. Default: 0 if not available.
1489 optional int64 time_since_last_boot = 6;
1490}
1491
Tej Singhc477d9c2018-02-05 18:31:39 -08001492
1493/**
1494 * Logs call state and disconnect cause (if applicable).
1495 *
1496 * Logged from:
1497 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1498 */
1499message CallStateChanged {
1500 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1501 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1502 optional android.telecom.CallStateEnum call_state = 1;
1503
1504 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1505 // This value is only applicable when the call_state is DISCONNECTED, and
1506 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1507 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1508 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1509
1510 // True if the call is self-managed, which are apps that use the
1511 // telecom infrastructure to make their own calls.
1512 optional bool self_managed = 3;
1513
1514 // True if call is external. External calls are calls on connected Wear
1515 // devices but show up in Telecom so the user can pull them onto the device.
1516 optional bool external_call = 4;
1517}
1518
Tej Singh1ea42892018-01-19 09:27:00 -08001519/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001520 * Logs keyguard state. The keyguard is the lock screen.
1521 *
1522 * Logged from:
1523 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1524 */
1525message KeyguardStateChanged {
1526 enum State {
1527 UNKNOWN = 0;
1528 // The keyguard is hidden when the phone is unlocked.
1529 HIDDEN = 1;
1530 // The keyguard is shown when the phone is locked (screen turns off).
1531 SHOWN= 2;
1532 // The keyguard is occluded when something is overlaying the keyguard.
1533 // Eg. Opening the camera while on the lock screen.
1534 OCCLUDED = 3;
1535 }
1536 optional State state = 1;
1537}
1538
1539/**
1540 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1541 * prompts the user to enter a password (pattern, pin, etc).
1542 *
1543 * Logged from:
1544 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1545 */
1546
1547message KeyguardBouncerStateChanged {
1548 enum State {
1549 UNKNOWN = 0;
1550 // Bouncer is hidden, either as a result of successfully entering the
1551 // password, screen timing out, or user going back to lock screen.
1552 HIDDEN = 1;
1553 // This is when the user is being prompted to enter the password.
1554 SHOWN = 2;
1555 }
1556 optional State state = 1;
1557}
1558
1559/**
1560 * Logs the result of entering a password into the keyguard bouncer.
1561 *
1562 * Logged from:
1563 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1564 */
1565message KeyguardBouncerPasswordEntered {
1566 enum BouncerResult {
1567 UNKNOWN = 0;
1568 // The password entered was incorrect.
1569 FAILURE = 1;
1570 // The password entered was correct.
1571 SUCCESS = 2;
1572 }
1573 optional BouncerResult result = 1;
1574}
1575
Tej Singha883b372018-02-15 11:30:01 -08001576/*
1577 * Logs changes to the configuration of the device. The configuration is defined
1578 * in frameworks/base/core/java/android/content/res/Configuration.java
1579 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1580 * Please go there to interpret the possible values each field can be.
1581 *
1582 * Logged from:
1583 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1584 */
1585message ResourceConfigurationChanged {
1586 // Bit mask of color capabilities of the screen.
1587 // Contains information about the color gamut and hdr mode of the screen.
1588 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001589 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001590
1591 // The target screen density being rendered to.
1592 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001593 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001594
1595 // Current user preference for the scaling factor for fonts,
1596 // relative to the base density scaling.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Flag indicating whether the hard keyboard is hidden.
1601 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001602 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001603
1604 // The type of keyboard attached to the device.
1605 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1606 optional int32 keyboard = 5;
1607
1608 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1609 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001610 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001611
1612 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1613 // 0 if undefined.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1615 optional int32 mcc = 7;
1616
1617 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1618 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1619 // MNC_ZERO symbol defined in Configuration.java.
1620 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1621 optional int32 mnc = 8;
1622
1623 // The kind of navigation available on the device.
1624 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1625 optional int32 navigation = 9;
1626
1627 // Flag indicating whether the navigation is available.
1628 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001629 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001630
1631 // Overall orientation of the screen.
1632 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1633 optional int32 orientation = 11;
1634
1635 // The current height of the available screen space, in dp units.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001637 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001638
1639 // Bit mask of overall layout of the screen.
1640 // Contains information about screen size, whether the screen is wider/taller
1641 // than normal, whether the screen layout is right-tl-left or left-to-right,
1642 // and whether the screen has a rounded shape.
1643 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001644 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001645
1646 // Current width of the available screen space, in dp units.
1647 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001648 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001649
1650 // The smallest screen size an application will see in normal operation.
1651 // This is the smallest value of both screenWidthDp and screenHeightDp
1652 // in portrait and landscape.
1653 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001654 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001655
1656 // The type of touch screen attached to the device.
1657 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1658 optional int32 touchscreen = 16;
1659
1660 // Bit mask of the ui mode.
1661 // Contains information about the overall ui mode of the device.
1662 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1663 // Also contains information about whether the device is in night mode.
1664 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001665 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001666}
1667
Tej Singheee317b2018-03-07 19:28:05 -08001668
1669/**
1670 * Logs changes in the connection state of the mobile radio.
1671 *
1672 * Logged from:
1673 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1674 */
1675message MobileConnectionStateChanged {
1676 // States are from the state machine DataConnection.java.
1677 enum State {
1678 UNKNOWN = 0;
1679 // The connection is inactive, or disconnected.
1680 INACTIVE = 1;
1681 // The connection is being activated, or connecting.
1682 ACTIVATING = 2;
1683 // The connection is active, or connected.
1684 ACTIVE = 3;
1685 // The connection is disconnecting.
1686 DISCONNECTING = 4;
1687 // The connection is disconnecting after creating a connection.
1688 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1689 }
1690 optional State state = 1;
1691 // For multi-sim phones, this distinguishes between the sim cards.
1692 optional int32 sim_slot_index = 2;
1693 // Used to identify the connection. Starts at 0 and increments by 1 for
1694 // every new network created. Resets whenever the device reboots.
1695 optional int32 data_connection_id = 3;
1696 // A bitmask for the capabilities of this connection.
1697 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1698 // Default value (if we have no information): 0
1699 optional int64 capabilities = 4;
1700 // If this connection has internet.
1701 // This just checks if the DEFAULT bit of capabilities is set.
1702 optional bool has_internet = 5;
1703}
1704
1705/**
1706 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1707 *
1708 * Logged from:
1709 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1710 */
1711message MobileRadioTechnologyChanged {
1712 optional android.telephony.NetworkTypeEnum state = 1;
1713 // For multi-sim phones, this distinguishes between the sim cards.
1714 optional int32 sim_slot_index = 2;
1715}
1716
Andrew Chantb56388b2018-03-22 21:07:33 -07001717/**
1718 * Logs the VID and PID of any connected USB devices.
1719 *
1720 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1721 *
1722 * Logged by Vendor.
1723 */
1724message UsbDeviceAttached {
1725 optional int32 vid = 1;
1726 optional int32 pid = 2;
1727 optional bool has_audio = 3;
1728 optional bool has_hid = 4;
1729 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001730 enum State {
1731 STATE_DISCONNECTED = 0;
1732 STATE_CONNECTED = 1;
1733 }
1734 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001735 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001736}
1737
Tej Singheee317b2018-03-07 19:28:05 -08001738
Tej Singhdd7bd352018-02-09 19:33:15 -08001739/**
Tej Singh5d991e12018-03-09 19:48:11 -08001740 * Logs when Bluetooth is enabled and disabled.
1741 *
1742 * Logged from:
1743 * services/core/java/com/android/server/BluetoothManagerService.java
1744 */
1745message BluetoothEnabledStateChanged {
1746 repeated AttributionNode attribution_node = 1;
1747 // Whether or not bluetooth is enabled on the device.
1748 enum State {
1749 UNKNOWN = 0;
1750 ENABLED = 1;
1751 DISABLED = 2;
1752 }
1753 optional State state = 2;
1754 // The reason for being enabled/disabled.
1755 // Eg. Airplane mode, crash, application request.
1756 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1757 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001758 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001759}
1760
1761/**
Jack Hed9837c82019-01-09 01:19:13 -08001762 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001763 *
1764 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001765 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1766 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001767 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001768 */
1769message BluetoothConnectionStateChanged {
1770 // The state of the connection.
1771 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1772 optional android.bluetooth.ConnectionStateEnum state = 1;
1773 // An identifier that can be used to match connect and disconnect events.
1774 // Currently is last two bytes of a hash of a device level ID and
1775 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001776 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001777 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001778 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1779 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001780 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001781 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001782 // An identifier that can be used to match events for this device.
1783 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1784 // Salt: Randomly generated 256 bit value
1785 // Hash algorithm: HMAC-SHA256
1786 // Size: 32 byte
1787 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001788 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001789 // An identifier that can be used to match events for this device.
1790 // The incremental identifier is locally generated and guaranteed not derived
1791 // from any globally unique hardware id.
1792 // For paired devices, it stays consistent between Bluetooth toggling for the
1793 // same remote device.
1794 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1795 // session for the same remote device.
1796 // Default: 0 if the device's metric id is unknown.
1797 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001798}
1799
1800/**
1801 * Logs when a Bluetooth device connects and disconnects over ACL
1802 *
1803 * Logged from:
1804 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1805 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001806 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001807 */
1808message BluetoothAclConnectionStateChanged {
1809 // An identifier that can be used to match events for this device.
1810 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1811 // Salt: Randomly generated 256 bit value
1812 // Hash algorithm: HMAC-SHA256
1813 // Size: 32 byte
1814 // Default: null or empty if the device identifier is not known
1815 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1816 // The state of the connection.
1817 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1818 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001819 // An identifier that can be used to match events for this device.
1820 // The incremental identifier is locally generated and guaranteed not derived
1821 // from any globally unique hardware id.
1822 // For paired devices, it stays consistent between Bluetooth toggling for the
1823 // same remote device.
1824 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1825 // session for the same remote device.
1826 // Default: 0 if the device's metric id is unknown.
1827 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001828}
1829
1830/**
1831 * Logs when a Bluetooth device connects and disconnects over SCO
1832 *
1833 * Logged from:
1834 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1835 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1836 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001837 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001838 */
1839message BluetoothScoConnectionStateChanged {
1840 // An identifier that can be used to match events for this device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if the device identifier is not known
1846 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1847 // The state of the connection.
1848 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1849 optional android.bluetooth.ConnectionStateEnum state = 2;
1850 // Codec used for this SCO connection
1851 // Default: UNKNOWN
1852 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001853 // An identifier that can be used to match events for this device.
1854 // The incremental identifier is locally generated and guaranteed not derived
1855 // from any globally unique hardware id.
1856 // For paired devices, it stays consistent between Bluetooth toggling for the
1857 // same remote device.
1858 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1859 // session for the same remote device.
1860 // Default: 0 if the device's metric id is unknown.
1861 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001862}
1863
Jack Hec27040a2019-01-09 20:54:41 -08001864/**
1865 * Logged when active device of a profile changes
1866 *
1867 * Logged from:
1868 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1869 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1870 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1871 */
1872message BluetoothActiveDeviceChanged {
1873 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1874 // From android.bluetooth.BluetoothProfile
1875 optional int32 bt_profile = 1;
1876 // An identifier that can be used to match events for this new active device.
1877 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1878 // Salt: Randomly generated 256 bit value
1879 // Hash algorithm: HMAC-SHA256
1880 // Size: 32 byte
1881 // Default: null or empty if there is no active device for this profile
1882 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001883 // An identifier that can be used to match events for this device.
1884 // The incremental identifier is locally generated and guaranteed not derived
1885 // from any globally unique hardware id.
1886 // For paired devices, it stays consistent between Bluetooth toggling for the
1887 // same remote device.
1888 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1889 // session for the same remote device.
1890 // Default: 0 if the device's metric id is unknown.
1891 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001892}
1893
Jack Heab86dbd22018-12-18 15:43:27 -08001894// Logs when there is an event affecting Bluetooth device's link layer connection.
1895// - This event is triggered when there is a related HCI command or event
1896// - Users of this metrics can deduce Bluetooth device's connection state from these events
1897// - HCI commands are logged before the command is sent, after receiving command status, and after
1898// receiving command complete
1899// - HCI events are logged when they arrive
1900//
1901// Low level log from system/bt
1902//
1903// Bluetooth classic commands:
1904// - CMD_CREATE_CONNECTION
1905// - CMD_DISCONNECT
1906// - CMD_CREATE_CONNECTION_CANCEL
1907// - CMD_ACCEPT_CONNECTION_REQUEST
1908// - CMD_REJECT_CONNECTION_REQUEST
1909// - CMD_SETUP_ESCO_CONNECTION
1910// - CMD_ACCEPT_ESCO_CONNECTION
1911// - CMD_REJECT_ESCO_CONNECTION
1912// - CMD_ENH_SETUP_ESCO_CONNECTION
1913// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1914//
1915// Bluetooth low energy commands:
1916// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1917// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1918// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1919// - CMD_BLE_CLEAR_WHITE_LIST
1920// - CMD_BLE_ADD_WHITE_LIST
1921// - CMD_BLE_REMOVE_WHITE_LIST
1922//
1923// Bluetooth classic events:
1924// - EVT_CONNECTION_COMP
1925// - EVT_CONNECTION_REQUEST
1926// - EVT_DISCONNECTION_COMP
1927// - EVT_ESCO_CONNECTION_COMP
1928// - EVT_ESCO_CONNECTION_CHANGED
1929//
1930// Bluetooth low energy meta events:
1931// - BLE_EVT_CONN_COMPLETE_EVT
1932// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1933//
1934// Next tag: 10
1935message BluetoothLinkLayerConnectionEvent {
1936 // An identifier that can be used to match events for this device.
1937 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1938 // Salt: Randomly generated 256 bit value
1939 // Hash algorithm: HMAC-SHA256
1940 // Size: 32 byte
1941 // Default: null or empty if the device identifier is not known
1942 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1943 // Connection handle of this connection if available
1944 // Range: 0x0000 - 0x0EFF (12 bits)
1945 // Default: 0xFFFF if the handle is unknown
1946 optional int32 connection_handle = 2;
1947 // Direction of the link
1948 // Default: DIRECTION_UNKNOWN
1949 optional android.bluetooth.DirectionEnum direction = 3;
1950 // Type of this link
1951 // Default: LINK_TYPE_UNKNOWN
1952 optional android.bluetooth.LinkTypeEnum type = 4;
1953
1954 // Reason metadata for this link layer connection event, rules for interpretation:
1955 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1956 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1957 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1958 // set and valid, ignore hci_ble_event
1959
1960 // HCI command associated with this event
1961 // Default: CMD_UNKNOWN
1962 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1963 // HCI event associated with this event
1964 // Default: EVT_UNKNOWN
1965 optional android.bluetooth.hci.EventEnum hci_event = 6;
1966 // HCI BLE meta event associated with this event
1967 // Default: BLE_EVT_UNKNOWN
1968 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1969 // HCI command status code if this is triggerred by hci_cmd
1970 // Default: STATUS_UNKNOWN
1971 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1972 // HCI reason code associated with this event
1973 // Default: STATUS_UNKNOWN
1974 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001975 // An identifier that can be used to match events for this device.
1976 // The incremental identifier is locally generated and guaranteed not derived
1977 // from any globally unique hardware id.
1978 // For paired devices, it stays consistent between Bluetooth toggling for the
1979 // same remote device.
1980 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1981 // session for the same remote device.
1982 // Default: 0 if the device's metric id is unknown.
1983 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001984}
1985
Howard Roe103fe22019-01-17 16:52:16 -08001986/**
1987 * Logs when a module is rolled back by Watchdog.
1988 *
1989 * Logged from: Rollback Manager
1990 */
1991message WatchdogRollbackOccurred {
1992 enum RollbackType {
1993 UNKNOWN = 0;
1994 ROLLBACK_INITIATE = 1;
1995 ROLLBACK_SUCCESS = 2;
1996 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001997 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001998 }
1999 optional RollbackType rollback_type = 1;
2000
2001 optional string package_name = 2;
2002
2003 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002004
2005 enum RollbackReasonType {
2006 REASON_UNKNOWN = 0;
2007 REASON_NATIVE_CRASH = 1;
2008 REASON_EXPLICIT_HEALTH_CHECK = 2;
2009 REASON_APP_CRASH = 3;
2010 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002011 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002012 }
2013 optional RollbackReasonType rollback_reason = 4;
2014
2015 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2016 // is initiated. Empty if the package is unknown.
2017 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002018
2019 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002020}
2021
Jack Hec27040a2019-01-09 20:54:41 -08002022/**
2023 * Logs when there is a change in Bluetooth A2DP playback state
2024 *
2025 * Logged from:
2026 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2027 */
2028message BluetoothA2dpPlaybackStateChanged {
2029 // An identifier that can be used to match events for this device.
2030 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2031 // Salt: Randomly generated 256 bit value
2032 // Hash algorithm: HMAC-SHA256
2033 // Size: 32 byte
2034 // Default: null or empty if the device identifier is not known
2035 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2036 // Current playback state
2037 // Default: PLAYBACK_STATE_UNKNOWN
2038 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2039 // Current audio coding mode
2040 // Default: AUDIO_CODING_MODE_UNKNOWN
2041 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002042 // An identifier that can be used to match events for this device.
2043 // The incremental identifier is locally generated and guaranteed not derived
2044 // from any globally unique hardware id.
2045 // For paired devices, it stays consistent between Bluetooth toggling for the
2046 // same remote device.
2047 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2048 // session for the same remote device.
2049 // Default: 0 if the device's metric id is unknown.
2050 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002051}
2052
2053/**
2054 * Logs when there is a change in A2DP codec config for a particular remote device
2055 *
2056 * Logged from:
2057 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2058 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2059 */
2060message BluetoothA2dpCodecConfigChanged {
2061 // An identifier that can be used to match events for this device.
2062 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2063 // Salt: Randomly generated 256 bit value
2064 // Hash algorithm: HMAC-SHA256
2065 // Size: 32 byte
2066 // Default: null or empty if the device identifier is not known
2067 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2068 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2069 // Default SOURCE_CODEC_TYPE_INVALID
2070 optional int32 codec_type = 2;
2071 // Codec priroity, the higher the more preferred, -1 for disabled
2072 // Default: CODEC_PRIORITY_DEFAULT
2073 optional int32 codec_priority = 3;
2074 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2075 // Default: SAMPLE_RATE_NONE
2076 optional int32 sample_rate = 4;
2077 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2078 // Default: BITS_PER_SAMPLE_NONE
2079 optional int32 bits_per_sample = 5;
2080 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2081 // Default: CHANNEL_MODE_NONE
2082 optional int32 channel_mode = 6;
2083 // Codec specific values
2084 // Default 0
2085 optional int64 codec_specific_1 = 7;
2086 optional int64 codec_specific_2 = 8;
2087 optional int64 codec_specific_3 = 9;
2088 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002089 // An identifier that can be used to match events for this device.
2090 // The incremental identifier is locally generated and guaranteed not derived
2091 // from any globally unique hardware id.
2092 // For paired devices, it stays consistent between Bluetooth toggling for the
2093 // same remote device.
2094 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2095 // session for the same remote device.
2096 // Default: 0 if the device's metric id is unknown.
2097 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002098}
2099
2100/**
2101 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2102 * Each codec's capability is logged separately due to statsd restriction
2103 *
2104 * Logged from:
2105 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2106 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2107 */
2108message BluetoothA2dpCodecCapabilityChanged {
2109 // An identifier that can be used to match events for this device.
2110 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2111 // Salt: Randomly generated 256 bit value
2112 // Hash algorithm: HMAC-SHA256
2113 // Size: 32 byte
2114 // Default: null or empty if the device identifier is not known
2115 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2116 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2117 // Default SOURCE_CODEC_TYPE_INVALID
2118 optional int32 codec_type = 2;
2119 // Codec priroity, the higher the more preferred, -1 for disabled
2120 // Default: CODEC_PRIORITY_DEFAULT
2121 optional int32 codec_priority = 3;
2122 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2123 // in BluetoothCodecConfig
2124 // Default: empty and SAMPLE_RATE_NONE for individual item
2125 optional int32 sample_rate = 4;
2126 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2127 // in BluetoothCodecConfig
2128 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2129 optional int32 bits_per_sample = 5;
2130 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2131 // BluetoothCodecConfig
2132 // Default: empty and CHANNEL_MODE_NONE for individual item
2133 optional int32 channel_mode = 6;
2134 // Codec specific values
2135 // Default 0
2136 optional int64 codec_specific_1 = 7;
2137 optional int64 codec_specific_2 = 8;
2138 optional int64 codec_specific_3 = 9;
2139 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002140 // An identifier that can be used to match events for this device.
2141 // The incremental identifier is locally generated and guaranteed not derived
2142 // from any globally unique hardware id.
2143 // For paired devices, it stays consistent between Bluetooth toggling for the
2144 // same remote device.
2145 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2146 // session for the same remote device.
2147 // Default: 0 if the device's metric id is unknown.
2148 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002149}
2150
2151/**
2152 * Logs when A2DP failed to read from PCM source.
2153 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2154 *
2155 * Logged from:
2156 * system/bt
2157 */
2158message BluetoothA2dpAudioUnderrunReported {
2159 // An identifier that can be used to match events for this device.
2160 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2161 // Salt: Randomly generated 256 bit value
2162 // Hash algorithm: HMAC-SHA256
2163 // Size: 32 byte
2164 // Default: null or empty if the device identifier is not known
2165 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2166 // Encoding interval in nanoseconds
2167 // Default: 0
2168 optional int64 encoding_interval_nanos = 2;
2169 // Number of bytes of PCM data that could not be read from the source
2170 // Default: 0
2171 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002172 // An identifier that can be used to match events for this device.
2173 // The incremental identifier is locally generated and guaranteed not derived
2174 // from any globally unique hardware id.
2175 // For paired devices, it stays consistent between Bluetooth toggling for the
2176 // same remote device.
2177 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2178 // session for the same remote device.
2179 // Default: 0 if the device's metric id is unknown.
2180 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002181}
2182
2183/**
2184 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2185 * buffer queue is full and we have to drop data
2186 *
2187 * Logged from:
2188 * system/bt
2189 */
2190message BluetoothA2dpAudioOverrunReported {
2191 // An identifier that can be used to match events for this device.
2192 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2193 // Salt: Randomly generated 256 bit value
2194 // Hash algorithm: HMAC-SHA256
2195 // Size: 32 byte
2196 // Default: null or empty if the device identifier is not known
2197 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2198 // Encoding interval in nanoseconds
2199 // Default: 0
2200 optional int64 encoding_interval_nanos = 2;
2201 // Number of buffers dropped in this event
2202 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2203 // Default: 0
2204 optional int32 num_dropped_buffers = 3;
2205 // Number of encoded buffers dropped in this event
2206 // Default 0
2207 optional int32 num_dropped_encoded_frames = 4;
2208 // Number of encoded bytes dropped in this event
2209 // Default: 0
2210 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002211 // An identifier that can be used to match events for this device.
2212 // The incremental identifier is locally generated and guaranteed not derived
2213 // from any globally unique hardware id.
2214 // For paired devices, it stays consistent between Bluetooth toggling for the
2215 // same remote device.
2216 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2217 // session for the same remote device.
2218 // Default: 0 if the device's metric id is unknown.
2219 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002220}
2221
2222/**
2223 * Logs when we receive reports regarding a device's RSSI value
2224 *
2225 * Logged from:
2226 * system/bt
2227 */
2228message BluetoothDeviceRssiReported {
2229 // An identifier that can be used to match events for this device.
2230 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2231 // Salt: Randomly generated 256 bit value
2232 // Hash algorithm: HMAC-SHA256
2233 // Size: 32 byte
2234 // Default: null or empty if the device identifier is not known
2235 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2236 // Connection handle of this connection if available
2237 // Range: 0x0000 - 0x0EFF (12 bits)
2238 // Default: 0xFFFF if the handle is unknown
2239 optional int32 connection_handle = 2;
2240 // HCI command status code if this is triggerred by hci_cmd
2241 // Default: STATUS_UNKNOWN
2242 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2243 // BR/EDR
2244 // Range: -128 ≤ N ≤ 127 (signed integer)
2245 // Units: dB
2246 // LE:
2247 // Range: -127 to 20, 127 (signed integer)
2248 // Units: dBm
2249 // Invalid when an out of range value is reported
2250 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002251 // An identifier that can be used to match events for this device.
2252 // The incremental identifier is locally generated and guaranteed not derived
2253 // from any globally unique hardware id.
2254 // For paired devices, it stays consistent between Bluetooth toggling for the
2255 // same remote device.
2256 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2257 // session for the same remote device.
2258 // Default: 0 if the device's metric id is unknown.
2259 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002260}
2261
2262/**
2263 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2264 *
2265 * Logged from:
2266 * system/bt
2267 */
2268message BluetoothDeviceFailedContactCounterReported {
2269 // An identifier that can be used to match events for this device.
2270 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2271 // Salt: Randomly generated 256 bit value
2272 // Hash algorithm: HMAC-SHA256
2273 // Size: 32 byte
2274 // Default: null or empty if the device identifier is not known
2275 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2276 // Connection handle of this connection if available
2277 // Range: 0x0000 - 0x0EFF (12 bits)
2278 // Default: 0xFFFF if the handle is unknown
2279 optional int32 connection_handle = 2;
2280 // HCI command status code if this is triggerred by hci_cmd
2281 // Default: STATUS_UNKNOWN
2282 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2283 // Number of consecutive failed contacts for a connection corresponding to the Handle
2284 // Range: uint16_t, 0-0xFFFF
2285 // Default: 0xFFFFF
2286 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002287 // An identifier that can be used to match events for this device.
2288 // The incremental identifier is locally generated and guaranteed not derived
2289 // from any globally unique hardware id.
2290 // For paired devices, it stays consistent between Bluetooth toggling for the
2291 // same remote device.
2292 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2293 // session for the same remote device.
2294 // Default: 0 if the device's metric id is unknown.
2295 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002296}
2297
2298/**
2299 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2300 *
2301 * Logged from:
2302 * system/bt
2303 */
2304message BluetoothDeviceTxPowerLevelReported {
2305 // An identifier that can be used to match events for this device.
2306 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2307 // Salt: Randomly generated 256 bit value
2308 // Hash algorithm: HMAC-SHA256
2309 // Size: 32 byte
2310 // Default: null or empty if the device identifier is not known
2311 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2312 // Connection handle of this connection if available
2313 // Range: 0x0000 - 0x0EFF (12 bits)
2314 // Default: 0xFFFF if the handle is unknown
2315 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002316 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002317 // Default: STATUS_UNKNOWN
2318 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2319 // Range: -30 ≤ N ≤ 20
2320 // Units: dBm
2321 // Invalid when an out of range value is reported
2322 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002323 // An identifier that can be used to match events for this device.
2324 // The incremental identifier is locally generated and guaranteed not derived
2325 // from any globally unique hardware id.
2326 // For paired devices, it stays consistent between Bluetooth toggling for the
2327 // same remote device.
2328 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2329 // session for the same remote device.
2330 // Default: 0 if the device's metric id is unknown.
2331 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002332}
Jack Heab86dbd22018-12-18 15:43:27 -08002333
Tej Singh5d991e12018-03-09 19:48:11 -08002334/**
Jack He1021a612019-01-20 21:22:46 -08002335 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2336 * receiving an HCI command from the host
2337 *
2338 * Logged from: system/bt
2339 */
2340message BluetoothHciTimeoutReported {
2341 // HCI command associated with this event
2342 // Default: CMD_UNKNOWN
2343 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2344}
2345
2346/**
2347 * Logs when we receive Bluetooth Link Quality Report event from the controller
2348 * See Android Bluetooth HCI specification for more details
2349 *
2350 * Note: all count and bytes field are counted since last event
2351 *
2352 * Logged from: system/bt
2353 */
2354message BluetoothQualityReportReported {
2355 // Quality report ID
2356 // Original type: uint8_t
2357 // Default: BQR_ID_UNKNOWN
2358 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2359 // Packet type of the connection
2360 // Original type: uint8_t
2361 // Default: BQR_PACKET_TYPE_UNKNOWN
2362 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2363 // Connection handle of the connection
2364 // Original type: uint16_t
2365 optional int32 connection_handle = 3;
2366 // Performing Role for the connection
2367 // Original type: uint8_t
2368 optional int32 connection_role = 4;
2369 // Current Transmit Power Level for the connection. This value is the same as the controller's
2370 // response to the HCI_Read_Transmit_Power_Level HCI command
2371 // Original type: uint8_t
2372 optional int32 tx_power_level = 5;
2373 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2374 // absolute receiver signal strength value
2375 // Original type: int8_t
2376 optional int32 rssi = 6;
2377 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2378 // channels used by the link currently
2379 // Original type: uint8_t
2380 optional int32 snr = 7;
2381 // Indicates the number of unused channels in AFH_channel_map
2382 // Original type: uint8_t
2383 optional int32 unused_afh_channel_count = 8;
2384 // Indicates the number of the channels which are interfered and quality is bad but are still
2385 // selected for AFH
2386 // Original type: uint8_t
2387 optional int32 afh_select_unideal_channel_count = 9;
2388 // Current Link Supervision Timeout Setting
2389 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2390 // Original type: uint16_t
2391 optional int32 lsto = 10;
2392 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2393 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2394 // 0x01 (Piconet Clock)
2395 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2396 // Original type: uint32_t
2397 optional int64 connection_piconet_clock = 11;
2398 // The count of retransmission
2399 // Original type: uint32_t
2400 optional int64 retransmission_count = 12;
2401 // The count of no RX
2402 // Original type: uint32_t
2403 optional int64 no_rx_count = 13;
2404 // The count of NAK (Negative Acknowledge)
2405 // Original type: uint32_t
2406 optional int64 nak_count = 14;
2407 // Controller timestamp of last TX ACK
2408 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2409 // Original type: uint32_t
2410 optional int64 last_tx_ack_timestamp = 15;
2411 // The count of Flow-off (STOP)
2412 // Original type: uint32_t
2413 optional int64 flow_off_count = 16;
2414 // Controller timestamp of last Flow-on (GO)
2415 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2416 // Original type: uint32_t
2417 optional int64 last_flow_on_timestamp = 17;
2418 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2419 // Original type: uint32_t
2420 optional int64 buffer_overflow_bytes = 18;
2421 // Buffer underflow count (in byte) since last event
2422 // Original type: uint32_t
2423 optional int64 buffer_underflow_bytes = 19;
2424}
2425
2426/**
2427 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2428 *
2429 * Notes:
2430 * - Each event can be partially filled as we might learn different pieces of device
2431 * information at different time
2432 * - Multiple device info events can be combined to give more complete picture
2433 * - When multiple device info events tries to describe the same information, the
2434 * later one wins
2435 *
2436 * Logged from:
2437 * packages/apps/Bluetooth
2438 */
Jack Heaea26982019-04-04 11:19:48 -07002439message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002440 // An identifier that can be used to match events for this device.
2441 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2442 // Salt: Randomly generated 256 bit value
2443 // Hash algorithm: HMAC-SHA256
2444 // Size: 32 byte
2445 // Default: null or empty if the device identifier is not known
2446 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2447 // Where is this device info obtained from
2448 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2449 // Name of the data source
2450 // For EXTERNAL: package name of the data source
2451 // For INTERNAL: null for general case, component name otherwise
2452 optional string source_name = 3;
2453 // Name of the manufacturer of this device
2454 optional string manufacturer = 4;
2455 // Model of this device
2456 optional string model = 5;
2457 // Hardware version of this device
2458 optional string hardware_version = 6;
2459 // Software version of this device
2460 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002461 // An identifier that can be used to match events for this device.
2462 // The incremental identifier is locally generated and guaranteed not derived
2463 // from any globally unique hardware id.
2464 // For paired devices, it stays consistent between Bluetooth toggling for the
2465 // same remote device.
2466 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2467 // session for the same remote device.
2468 // Default: 0 if the device's metric id is unknown.
2469 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002470}
2471
2472/**
2473 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2474 * device, as documented by the Bluetooth Core HCI specification
2475 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2476 * Vol 2, Part E, Page 1118
2477 *
2478 * Logged from:
2479 * system/bt
2480 */
2481message BluetoothRemoteVersionInfoReported {
2482 // Connection handle of the connection
2483 // Original type: uint16_t
2484 optional int32 connection_handle = 1;
2485 // HCI command status code
2486 // Default: STATUS_UNKNOWN
2487 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2488 // 1 byte Version of current LMP in the remote controller
2489 optional int32 lmp_version = 3;
2490 // 2 bytes LMP manufacturer code of the remote controller
2491 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2492 optional int32 lmp_manufacturer_code = 4;
2493 // 4 bytes subversion of the LMP in the remote controller
2494 optional int32 lmp_subversion = 5;
2495}
2496
2497/**
2498 * Logs when certain Bluetooth SDP attributes are discovered
2499 * Constant definitions are from:
2500 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2501 *
2502 * Current logged attributes:
2503 * - BluetoothProfileDescriptorList
2504 * - Supported Features Bitmask
2505 *
2506 * Logged from:
2507 * system/bt
2508 */
2509message BluetoothSdpAttributeReported {
2510 // An identifier that can be used to match events for this device.
2511 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2512 // Salt: Randomly generated 256 bit value
2513 // Hash algorithm: HMAC-SHA256
2514 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2515 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2516 // Original type: uint16_t
2517 optional int32 protocol_uuid = 2;
2518 // Short form UUIDs used to identify Bluetooth SDP attribute types
2519 // Original type: uint16_t
2520 optional int32 attribute_id = 3;
2521 // Attribute value for the particular attribute
2522 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002523 // An identifier that can be used to match events for this device.
2524 // The incremental identifier is locally generated and guaranteed not derived
2525 // from any globally unique hardware id.
2526 // For paired devices, it stays consistent between Bluetooth toggling for the
2527 // same remote device.
2528 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2529 // session for the same remote device.
2530 // Default: 0 if the device's metric id is unknown.
2531 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002532}
2533
2534/**
2535 * Logs when bond state of a Bluetooth device changes
2536 *
2537 * Logged from:
2538 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2539 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2540 */
2541message BluetoothBondStateChanged {
2542 // An identifier that can be used to match events for this device.
2543 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2544 // Salt: Randomly generated 256 bit value
2545 // Hash algorithm: HMAC-SHA256
2546 // Size: 32 byte
2547 // Default: null or empty if the device identifier is not known
2548 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2549 // Preferred transport type to remote dual mode device
2550 // Default: TRANSPORT_AUTO means no preference
2551 optional android.bluetooth.TransportTypeEnum transport = 2;
2552 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2553 // Default: UNKNOWN
2554 optional android.bluetooth.DeviceTypeEnum type = 3;
2555 // Current bond state (NONE, BONDING, BONDED)
2556 // Default: BOND_STATE_UNKNOWN
2557 optional android.bluetooth.BondStateEnum bond_state = 4;
2558 // Bonding sub state
2559 // Default: BOND_SUB_STATE_UNKNOWN
2560 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2561 // Unbond Reason
2562 // Default: UNBOND_REASON_UNKNOWN
2563 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002564 // An identifier that can be used to match events for this device.
2565 // The incremental identifier is locally generated and guaranteed not derived
2566 // from any globally unique hardware id.
2567 // For paired devices, it stays consistent between Bluetooth toggling for the
2568 // same remote device.
2569 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2570 // session for the same remote device.
2571 // Default: 0 if the device's metric id is unknown.
2572 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002573}
2574
2575/**
2576 * Logs there is an event related Bluetooth classic pairing
2577 *
2578 * Logged from:
2579 * system/bt
2580 */
2581message BluetoothClassicPairingEventReported {
2582 // An identifier that can be used to match events for this device.
2583 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2584 // Salt: Randomly generated 256 bit value
2585 // Hash algorithm: HMAC-SHA256
2586 // Size: 32 byte
2587 // Default: null or empty if the device identifier is not known
2588 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2589 // Connection handle of this connection if available
2590 // Range: 0x0000 - 0x0EFF (12 bits)
2591 // Default: 0xFFFF if the handle is unknown
2592 optional int32 connection_handle = 2;
2593 // HCI command associated with this event
2594 // Default: CMD_UNKNOWN
2595 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2596 // HCI event associated with this event
2597 // Default: EVT_UNKNOWN
2598 optional android.bluetooth.hci.EventEnum hci_event = 4;
2599 // HCI command status code if this is triggerred by hci_cmd
2600 // Default: STATUS_UNKNOWN
2601 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2602 // HCI reason code associated with this event
2603 // Default: STATUS_UNKNOWN
2604 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002605 // A status value related to this specific event
2606 // Default: 0
2607 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002608 // An identifier that can be used to match events for this device.
2609 // The incremental identifier is locally generated and guaranteed not derived
2610 // from any globally unique hardware id.
2611 // For paired devices, it stays consistent between Bluetooth toggling for the
2612 // same remote device.
2613 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2614 // session for the same remote device.
2615 // Default: 0 if the device's metric id is unknown.
2616 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002617}
2618
2619/**
2620 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2621 *
2622 * Logged from:
2623 * system/bt
2624 */
2625message BluetoothSmpPairingEventReported {
2626 // An identifier that can be used to match events for this device.
2627 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2628 // Salt: Randomly generated 256 bit value
2629 // Hash algorithm: HMAC-SHA256
2630 // Size: 32 byte
2631 // Default: null or empty if the device identifier is not known
2632 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2633 // SMP command sent or received over L2CAP
2634 // Default: CMD_UNKNOWN
2635 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2636 // Whether this command is sent or received
2637 // Default: DIRECTION_UNKNOWN
2638 optional android.bluetooth.DirectionEnum direction = 3;
2639 // SMP failure reason code
2640 // Default: PAIRING_FAIL_REASON_DEFAULT
2641 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002642 // An identifier that can be used to match events for this device.
2643 // The incremental identifier is locally generated and guaranteed not derived
2644 // from any globally unique hardware id.
2645 // For paired devices, it stays consistent between Bluetooth toggling for the
2646 // same remote device.
2647 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2648 // session for the same remote device.
2649 // Default: 0 if the device's metric id is unknown.
2650 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002651}
2652
2653/**
Jack He815cdba2019-01-30 17:24:55 -08002654 * Logs when a Bluetooth socket’s connection state changed
2655 *
2656 * Logged from:
2657 * system/bt
2658 */
2659message BluetoothSocketConnectionStateChanged {
2660 // An identifier that can be used to match events for this device.
2661 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2662 // Salt: Randomly generated 256 bit value
2663 // Hash algorithm: HMAC-SHA256
2664 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002665 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002666 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002667 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002668 // Default 0 when unknown or don't care
2669 optional int32 port = 2;
2670 // Socket type as mentioned in
2671 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2672 // Default: SOCKET_TYPE_UNKNOWN
2673 optional android.bluetooth.SocketTypeEnum type = 3;
2674 // Socket connection state
2675 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2676 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2677 // Number of bytes sent to remote device during this connection
2678 optional int64 tx_bytes = 5;
2679 // Number of bytes received from remote device during this connection
2680 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002681 // Socket owner's UID
2682 optional int32 uid = 7 [(is_uid) = true];
2683 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2684 // |port| must be spawned by |server_port|
2685 // Default 0 when unknown or don't care
2686 optional int32 server_port = 8;
2687 // Whether this is a server listener socket
2688 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002689 // An identifier that can be used to match events for this device.
2690 // The incremental identifier is locally generated and guaranteed not derived
2691 // from any globally unique hardware id.
2692 // For paired devices, it stays consistent between Bluetooth toggling for the
2693 // same remote device.
2694 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2695 // session for the same remote device.
2696 // Default: 0 if the device's metric id is unknown.
2697 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002698}
2699
2700/**
Jack He71426802019-04-02 13:32:52 -07002701 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2702 *
2703 * Logged from:
2704 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2705 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2706 *
2707 */
2708message BluetoothClassOfDeviceReported {
2709 // An identifier that can be used to match events for this device.
2710 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2711 // Salt: Randomly generated 256 bit value
2712 // Hash algorithm: HMAC-SHA256
2713 // Size: 32 byte
2714 // Default: null or empty if this is a server listener socket
2715 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2716 // Class of Device (CoD) value including both Major, Minor device class and service class
2717 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2718 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2719 // Default: 0
2720 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002721 // An identifier that can be used to match events for this device.
2722 // The incremental identifier is locally generated and guaranteed not derived
2723 // from any globally unique hardware id.
2724 // For paired devices, it stays consistent between Bluetooth toggling for the
2725 // same remote device.
2726 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2727 // session for the same remote device.
2728 // Default: 0 if the device's metric id is unknown.
2729 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002730}
2731
2732/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002733 * Logs when something is plugged into or removed from the USB-C connector.
2734 *
2735 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002736 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002737 */
2738message UsbConnectorStateChanged {
2739 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002740 STATE_DISCONNECTED = 0;
2741 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002742 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002743 optional State state = 1
2744 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2745 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002746 // Last active session in ms.
2747 // 0 when the port is in connected state.
2748 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002749}
2750
2751/**
2752 * Logs the reported speaker impedance.
2753 *
2754 * Logged from:
2755 * Vendor audio implementation.
2756 */
2757message SpeakerImpedanceReported {
2758 optional int32 speaker_location = 1;
2759 optional int32 impedance = 2;
2760}
2761
2762/**
2763 * Logs the report of a failed hardware.
2764 *
2765 * Logged from:
2766 * Vendor HALs.
2767 *
2768 */
2769message HardwareFailed {
2770 enum HardwareType {
2771 HARDWARE_FAILED_UNKNOWN = 0;
2772 HARDWARE_FAILED_MICROPHONE = 1;
2773 HARDWARE_FAILED_CODEC = 2;
2774 HARDWARE_FAILED_SPEAKER = 3;
2775 HARDWARE_FAILED_FINGERPRINT = 4;
2776 }
2777 optional HardwareType hardware_type = 1;
2778
Maggie White6dcd8572019-01-31 14:11:50 -08002779 /**
2780 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002781 * the same hardware_type. The specific locations are vendor defined integers,
2782 * referring to board-specific numbering schemes.
2783 */
2784 optional int32 hardware_location = 2;
2785
Maggie White6dcd8572019-01-31 14:11:50 -08002786 /**
2787 * failure_code is specific to the HardwareType of the failed hardware.
2788 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002789 */
Maggie White6dcd8572019-01-31 14:11:50 -08002790 enum HardwareErrorCode {
2791 UNKNOWN = 0;
2792 COMPLETE = 1;
2793 SPEAKER_HIGH_Z = 2;
2794 SPEAKER_SHORT = 3;
2795 FINGERPRINT_SENSOR_BROKEN = 4;
2796 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002797 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002798 }
2799 optional int32 failure_code = 3;
2800}
2801
2802/**
2803 * Log an event when the device has been physically dropped.
2804 * Reported from the /vendor partition.
2805 */
2806message PhysicalDropDetected {
2807 // Confidence that the event was actually a drop, 0 -> 100
2808 optional int32 confidence_pctg = 1;
2809 // Peak acceleration of the drop, in 1/1000s of a g.
2810 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002811 // Duration of freefall in ms
2812 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002813}
2814
2815/**
2816 * Log bucketed battery charge cycles.
2817 *
2818 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002819 * a given charge point. For example, if 10 cycle buckets are
2820 * initialized, bucket 1 is the lowest 1/10th of the battery,
2821 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002822 *
2823 * Logged from:
2824 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2825 */
2826message ChargeCyclesReported {
2827 optional int32 cycle_bucket_1 = 1;
2828 optional int32 cycle_bucket_2 = 2;
2829 optional int32 cycle_bucket_3 = 3;
2830 optional int32 cycle_bucket_4 = 4;
2831 optional int32 cycle_bucket_5 = 5;
2832 optional int32 cycle_bucket_6 = 6;
2833 optional int32 cycle_bucket_7 = 7;
2834 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002835 optional int32 cycle_bucket_9 = 9;
2836 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002837}
2838
2839/**
Howard Roa46b6582018-09-18 16:45:02 -07002840 * Log battery health snapshot.
2841 *
2842 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2843 * are snapshotted periodically over 24hrs.
2844 */
2845message BatteryHealthSnapshot {
2846 enum BatterySnapshotType {
2847 UNKNOWN = 0;
2848 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2849 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2850 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2851 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2852 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2853 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2854 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2855 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2856 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2857 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2858 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2859 }
2860 optional BatterySnapshotType type = 1;
2861 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002862 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002863 // Voltage Battery Voltage, in microVolts.
2864 optional int32 voltage_micro_volt = 3;
2865 // Current Battery current, in microAmps.
2866 optional int32 current_micro_amps = 4;
2867 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2868 optional int32 open_circuit_micro_volt = 5;
2869 // Resistance Battery Resistance, in microOhms.
2870 optional int32 resistance_micro_ohm = 6;
2871 // Level Battery Level, as % of full.
2872 optional int32 level_percent = 7;
2873}
2874
2875/**
2876 * Log slow I/O operations on the primary storage.
2877 */
2878message SlowIo {
2879 // Classifications of IO Operations.
2880 enum IoOperation {
2881 UNKNOWN = 0;
2882 READ = 1;
2883 WRITE = 2;
2884 UNMAP = 3;
2885 SYNC = 4;
2886 }
2887 optional IoOperation operation = 1;
2888
2889 // The number of slow IO operations of this type over 24 hours.
2890 optional int32 count = 2;
2891}
2892
2893/**
2894 * Log battery caused shutdown with the last recorded voltage.
2895 */
2896message BatteryCausedShutdown {
2897 // The last recorded battery voltage prior to shutdown.
2898 optional int32 last_recorded_micro_volt = 1;
2899}
2900
2901/**
Tej Singha72344992019-04-17 18:55:08 -07002902 * Logs when ThermalService receives throttling events.
2903 *
2904 * Logged from:
2905 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2906 */
2907message ThermalThrottlingSeverityStateChanged {
2908 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2909 optional android.os.TemperatureTypeEnum sensor_type = 1;
2910
2911 // The name of the temperature source. Eg. CPU0
2912 optional string sensor_name = 2;
2913
2914 // Temperature in tenths of a degree C.
2915 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2916 optional int32 temperature_deci_celsius = 3;
2917
2918 // Relative severity of the throttling, see enum definition.
2919 optional android.os.ThrottlingSeverityEnum severity = 4;
2920}
2921
2922/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002923 * Logs the duration of a davey (jank of >=700ms) when it occurs
2924 *
2925 * Logged from:
2926 * frameworks/base/libs/hwui/JankTracker.cpp
2927 */
2928message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002929 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002930 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002931
Tej Singhbb8554a2018-01-26 11:59:14 -08002932 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002933 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002934}
2935
2936/**
Bookatze5885242017-10-24 20:10:31 -07002937 * Logs phone signal strength changes.
2938 *
2939 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002940 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002941 */
2942message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002943 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2944 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002945}
2946
Yangster4ccebea2018-10-09 17:09:02 -07002947
2948/**
2949 * Logs when the phone state, sim state or signal strength changes
2950 *
2951 * Logged from:
2952 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2953 */
2954message PhoneServiceStateChanged {
2955 optional android.telephony.ServiceStateEnum state = 1;
2956 optional android.telephony.SimStateEnum sim_state = 2;
2957 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2958}
2959
2960/**
2961 * Logs when the phone becomes on or off.
2962 *
2963 * Logged from:
2964 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2965 */
2966message PhoneStateChanged {
2967 enum State {
2968 OFF = 0;
2969 ON = 1;
2970 }
2971 optional State state = 1;
2972}
2973
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002974message BackGesture {
2975 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002976 DEFAULT_BACK_TYPE = 0;
2977 COMPLETED = 1;
2978 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2979 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2980 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2981 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2982 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2983 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2984 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002985 }
2986 optional BackType type = 1;
2987
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002988 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2989 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2990 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2991 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2992 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2993 optional int32 left_boundary = 8; // left edge width + left inset
2994 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2995
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002996 enum WindowHorizontalLocation {
2997 DEFAULT_LOCATION = 0;
2998 LEFT = 1;
2999 RIGHT = 2;
3000 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003001 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003002}
3003
3004message ExclusionRectStateChanged {
3005 optional string component_name = 1; // if not available, simply packageName
3006 optional int32 requested_height = 2; // px
3007 optional int32 rejected_height = 3; // px
3008
3009 enum WindowHorizontalLocation {
3010 DEFAULT_LOCATION = 0;
3011 LEFT = 1;
3012 RIGHT = 2;
3013 }
3014 optional WindowHorizontalLocation x_location = 4;
3015 optional bool landscape = 5;
3016 optional bool splitscreen = 6;
3017 optional int32 duration_millis = 7;
3018}
3019
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003020/**
3021 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3022 *
3023 * Logged from:
3024 * packages/apps/Launcher3
3025 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003026message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003027 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003028 optional android.stats.launcher.LauncherState src_state = 2;
3029 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003030 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3031 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3032
3033 // The event id (e.g., app launch, drag and drop, long press)
3034 optional int32 event_id = 6;
3035 // The event's source or target id (e.g., icon, task, button)
3036 optional int32 target_id = 7;
3037 // If the target needs to be tracked, use this id field
3038 optional int32 instance_id = 8;
3039 optional int32 uid = 9 [(is_uid) = true];
3040 optional string package_name = 10;
3041 optional string component_name = 11;
3042
3043 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003044 optional int32 grid_x = 12 [default = -1];
3045 optional int32 grid_y = 13 [default = -1];
3046 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003047
3048 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003049 optional int32 grid_x_parent = 15 [default = -1];
3050 optional int32 grid_y_parent = 16 [default = -1];
3051 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003052
3053 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3054 optional int32 hierarchy = 18;
3055
3056 optional bool is_work_profile = 19;
3057
3058 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003059 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003060
3061 // e.g., folderLabelState can be captured in the following two fields
3062 optional int32 from_state = 21;
3063 optional int32 to_state = 22;
3064
3065 // e.g., autofilled or suggested texts that are not user entered
3066 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003067
3068 // e.g., number of contents inside a container (e.g., icons inside a folder)
3069 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003070}
3071
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003072/**
3073 * Used for snapshot of the HomeScreen UI elements
3074 *
3075 * Logged from:
3076 * packages/apps/Launcher3
3077 */
3078message LauncherStaticLayout {
3079 // The event id (e.g., snapshot, drag and drop)
3080 optional int32 event_id = 1;
3081 // The event's source or target id (e.g., icon, shortcut, widget)
3082 optional int32 target_id = 2;
3083 // If the target needs to be tracked, use this id field
3084 optional int32 instance_id = 3;
3085 optional int32 uid = 4 [(is_uid) = true];
3086 optional string package_name = 5;
3087 optional string component_name = 6;
3088
3089 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003090 optional int32 grid_x = 7 [default = -1];
3091 optional int32 grid_y = 8 [default = -1];
3092 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003093
3094 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003095 // e.g., when used with widgets target, use these values for (span_x, span_y)
3096 optional int32 grid_x_parent = 10 [default = -1];
3097 optional int32 grid_y_parent = 11 [default = -1];
3098 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003099
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003100 // UNKNOWN = 0
3101 // HOTSEAT = 1
3102 // WORKSPACE = 2
3103 // FOLDER_HOTSEAT = 3
3104 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003105 optional int32 hierarchy = 13;
3106
3107 optional bool is_work_profile = 14;
3108
3109 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3110 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003111
3112 // e.g., number of icons inside a folder
3113 optional int32 cardinality = 16;
3114
3115 // e.g., (x, y) span of the widget inside homescreen grid system
3116 optional int32 span_x = 17 [default = 1];
3117 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003118}
3119
3120/**
3121 * Logs when Wallpaper or ThemePicker UI has changed.
3122 *
3123 * Logged from:
3124 * packages/apps/ThemePicker
3125 * packages/apps/WallpaperPicker2
3126 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003127message StyleUIChanged {
3128 optional android.stats.style.Action action = 1;
3129 optional int32 color_package_hash = 2;
3130 optional int32 font_package_hash = 3;
3131 optional int32 shape_package_hash = 4;
3132 optional int32 clock_package_hash = 5;
3133 optional int32 launcher_grid = 6;
3134 optional int32 wallpaper_category_hash = 7;
3135 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003136 optional int32 color_preference = 9;
3137 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003138}
3139
David Chenc28b2bb2017-10-24 12:52:52 -07003140/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003141 * Logs when Settings UI has changed.
3142 *
3143 * Logged from:
3144 * packages/apps/Settings
3145 */
3146message SettingsUIChanged {
3147 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003148 * Where this SettingsUIChange event comes from. For example, if
3149 * it's a PAGE_VISIBLE event, where the page is opened from.
3150 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003151 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003152
3153 /**
3154 * What the UI action is.
3155 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003156 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003157
3158 /**
3159 * Where the action is happening
3160 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003161 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003162
3163 /**
3164 * What preference changed in this event.
3165 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003166 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003167
3168 /**
3169 * The new value of the changed preference.
3170 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003171 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003172}
3173
3174/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003175 * Logs basic timing information about touch events.
3176 * Reported at most every 5 minutes while device is being interacted with.
3177 *
3178 * Logged from:
3179 * frameworks/native/services/inputflinger
3180 */
3181message TouchEventReported {
3182 /**
3183 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003184 * and the standard deviation of the time spent processing touchscreen events
3185 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003186 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003187 * On supported devices, the starting point is taken during the hard interrupt inside the
3188 * kernel touch driver. On all other devices, the starting point is taken inside
3189 * the kernel's input event subsystem upon receipt of the input event.
3190 * The ending point is taken inside InputDispatcher, just after the input event
3191 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003192 */
3193 // Minimum value
3194 optional float latency_min_micros = 1;
3195 // Maximum value
3196 optional float latency_max_micros = 2;
3197 // Average value
3198 optional float latency_mean_micros = 3;
3199 // Standard deviation
3200 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003201 // Number of touch events (input_event) in this report
3202 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003203}
3204
3205/**
Philip Quinn0eded622019-01-29 12:46:28 -08003206 * Logs gesture classification and timing information for touch events.
3207 *
3208 * Logged from:
3209 * frameworks/base/core/java/android/view/GestureDetector.java
3210 * frameworks/base/core/java/android/view/View.java
3211 */
3212message TouchGestureClassified {
3213 // The source of the classification (e.g. Java class name).
3214 optional string source = 1;
3215
3216 enum Classification {
3217 UNKNOWN_CLASSIFICATION = 0;
3218 SINGLE_TAP = 1;
3219 DOUBLE_TAP = 2;
3220 LONG_PRESS = 3;
3221 DEEP_PRESS = 4;
3222 SCROLL = 5;
3223 }
3224 // The classification of the gesture.
3225 optional Classification classification = 2;
3226
3227 // The interval from the start of a touch event stream until the
3228 // classification was made.
3229 optional int32 latency_millis = 3;
3230
3231 // The distance from the location of the first touch event to the
3232 // location of the touch event when the classification was made.
3233 optional float displacement_px = 4;
3234}
3235
3236/**
David Chenc28b2bb2017-10-24 12:52:52 -07003237 * Logs that a setting was updated.
3238 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003239 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003240 * The tag and is_default allow resetting of settings to default values based on the specified
3241 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3242 */
3243message SettingChanged {
3244 // The name of the setting.
3245 optional string setting = 1;
3246
3247 // The change being imposed on this setting. May represent a number, eg "3".
3248 optional string value = 2;
3249
3250 // The new value of this setting. For most settings, this is same as value. For some settings,
3251 // value is +X or -X where X represents an element in a set. For example, if the previous value
3252 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3253 // The +/- feature is currently only used for location_providers_allowed.
3254 optional string new_value = 3;
3255
3256 // The previous value of this setting.
3257 optional string prev_value = 4;
3258
3259 // The tag used with the is_default for resetting sets of settings. This is generally null.
3260 optional string tag = 5;
3261
Bookatz90867622018-01-31 15:05:57 -08003262 // True if this setting with tag should be resettable.
3263 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003264
David Chenbd789912018-03-16 17:19:55 -07003265 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003266 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003267
3268 enum ChangeReason {
3269 UPDATED = 1; // Updated can be an insertion or an update.
3270 DELETED = 2;
3271 }
3272 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003273}
Chenjie Yub3dda412017-10-24 13:41:59 -07003274
Chenjie Yu05013b32017-11-21 10:21:41 -08003275/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003276 * Logs activity going to foreground or background
3277 *
3278 * Logged from:
3279 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3280 */
3281message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003282 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003283 optional string pkg_name = 2;
3284 optional string class_name = 3;
3285
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003286 enum State {
3287 BACKGROUND = 0;
3288 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003289 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003290 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003291}
David Chenc8a43242017-10-17 16:23:28 -07003292
3293/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003294 * Logs when a volume entered low Storage state.
3295 * Logged from:
3296 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3297 */
3298message LowStorageStateChanged {
3299 // Volume that ran out of storage.
3300 optional string volume_description = 1;
3301
3302 enum State {
3303 UNKNOWN = 0;
3304 OFF = 1;
3305 ON = 2;
3306 }
3307 optional State state = 2;
3308}
3309
3310/**
3311 * Logs when an app is downgraded.
3312 * Logged from:
3313 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3314 */
3315message AppDowngraded {
3316 optional string package_name = 1;
3317 // Size of the package (all data) before being downgraded.
3318 optional int64 size_in_bytes_before = 2;
3319 // Size of the package (all data) after being downgraded.
3320 optional int64 size_in_bytes_after = 3;
3321
3322 optional bool aggressive = 4;
3323}
3324
3325/**
3326 * Logs when an app is optimized after being downgraded.
3327 * Logged from:
3328 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3329 */
3330message AppOptimizedAfterDowngraded {
3331 optional string package_name = 1;
3332}
3333
3334/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003335 * Logs whenever an app is installed on external storage.
3336 * Logged from:
3337 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3338 */
3339message AppInstallOnExternalStorageReported {
3340 // The type of external storage.
3341 optional android.stats.storage.ExternalStorageType storage_type = 1;
3342 // The name of the package that is installed on the sd card.
3343 optional string package_name = 2;
3344}
3345
3346/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003347 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003348 * Logged from:
3349 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3350 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003351message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003352 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003353
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003355
3356 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003357 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003358 optional string process_name = 3;
3359
3360 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003361 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003362
3363 optional string package_name = 5;
3364
3365 enum InstantApp {
3366 UNAVAILABLE = 0;
3367 FALSE = 1;
3368 TRUE = 2;
3369 }
3370 optional InstantApp is_instant_app = 6;
3371
3372 enum ForegroundState {
3373 UNKNOWN = 0;
3374 BACKGROUND = 1;
3375 FOREGROUND = 2;
3376 }
3377 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003378
3379 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003380}
David Chen9e3808c2017-11-20 17:25:34 -08003381
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003382/**
3383 * Logs when a WTF (What a Terrible Failure) happened.
3384 * Logged from:
3385 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3386 */
3387message WTFOccurred {
3388 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003389
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003390 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003391
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003392 // The name of the process.
3393 // system_server if it is not by an app
3394 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003395
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003396 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003397 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003398
3399 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003400}
3401
3402/**
3403 * Logs when system server reports low memory.
3404 * Logged from:
3405 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3406 */
3407message LowMemReported {
3408}
3409
3410/**
3411 * Logs when an app ANR (App Not Responding) occurs.
3412 * Logged from:
3413 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3414 */
3415message ANROccurred {
3416 optional int32 uid = 1 [(is_uid) = true];
3417
3418 optional string process_name = 2;
3419
3420 optional string short_component_name = 3;
3421
3422 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003423
3424 enum InstantApp {
3425 UNAVAILABLE = 0;
3426 FALSE = 1;
3427 TRUE = 2;
3428 }
3429 optional InstantApp is_instant_app = 5;
3430
3431 enum ForegroundState {
3432 UNKNOWN = 0;
3433 BACKGROUND = 1;
3434 FOREGROUND = 2;
3435 }
3436 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003437
3438 optional android.server.ErrorSource error_source = 7;
3439
3440 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003441}
3442
Bookatza7020bd2018-08-28 16:29:35 -07003443/**
3444 * Logs when the vibrator state changes.
3445 * Logged from:
3446 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3447 */
3448message VibratorStateChanged {
3449 repeated AttributionNode attribution_node = 1;
3450
3451 enum State {
3452 OFF = 0;
3453 ON = 1;
3454 }
3455 optional State state = 2;
3456
3457 // Duration (in milliseconds) requested to keep the vibrator on.
3458 // Only applicable for State == ON.
3459 optional int64 duration_millis = 3;
3460}
3461
David Chen0a368b22017-12-06 16:28:16 -08003462/*
3463 * Allows other apps to push events into statsd.
3464 * Logged from:
3465 * frameworks/base/core/java/android/util/StatsLog.java
3466 */
David Chen0b5c90c2018-01-25 16:51:49 -08003467message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003468 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003469 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003470
3471 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3472 optional int32 label = 2;
3473
3474 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3475 // predicates for the metrics).
3476 enum State {
3477 UNKNOWN = 0;
3478 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3479 STOP = 2;
3480 START = 3;
3481 }
3482 optional State state = 3;
3483}
3484
David Chen9e3808c2017-11-20 17:25:34 -08003485/**
Bookatz7948c872018-09-04 12:58:33 -07003486 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3487 * For example, this could be due to the user manually changing the time.
3488 *
3489 * Logged from:
3490 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3491 */
3492message WallClockTimeShifted {
3493 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3494 optional int64 wall_clock_timestamp_millis = 1;
3495}
3496
3497/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003498 * Logs when statsd detects an anomaly.
3499 *
3500 * Logged from:
3501 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3502 */
3503message AnomalyDetected {
3504 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003505 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003506
Yangster-mac94e197c2018-01-02 16:03:03 -08003507 // Id of the config whose anomaly detection alert fired.
3508 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003509
Yangster-mac94e197c2018-01-02 16:03:03 -08003510 // Id of the alert (i.e. name of the anomaly that was detected).
3511 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003512}
3513
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003514message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003515 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003516 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003517
3518 // The app package name.
3519 optional string pkg_name = 2;
3520
3521 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003522 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003523 WARM = 1;
3524 HOT = 2;
3525 COLD = 3;
3526 }
3527 // The transition type.
3528 optional TransitionType type = 3;
3529
3530 // The activity name.
3531 optional string activity_name = 4;
3532
3533 // The name of the calling app. Empty if not set.
3534 optional string calling_pkg_name = 5;
3535
3536 // Whether the app is an instant app.
3537 optional bool is_instant_app = 6;
3538
3539 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003540 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003541
Bookatz80d11a02018-01-16 10:46:35 -08003542 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003543
David Chen0b5c90c2018-01-25 16:51:49 -08003544 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003545 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003546 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003547 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003548 optional int32 bind_application_delay_millis = 11;
3549 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003550
3551 // Empty if not set.
3552 optional string launch_token = 13;
3553
Calin Juravle759fbda2018-02-20 19:52:30 +00003554 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003555 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003556
3557 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003558 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003559}
3560
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003561message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003562 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003563 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003564
3565 // The app package name.
3566 optional string pkg_name = 2;
3567
3568 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003569 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003570 WARM = 1;
3571 HOT = 2;
3572 COLD = 3;
3573 }
3574 // The transition type.
3575 optional TransitionType type = 3;
3576
3577 // The activity name.
3578 optional string activity_name = 4;
3579}
3580
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003581message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003582 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003583 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584
3585 // The app package name.
3586 optional string pkg_name = 2;
3587
3588 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003589 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003590 WITH_BUNDLE = 1;
3591 WITHOUT_BUNDLE = 2;
3592 }
3593 // The transition type.
3594 optional TransitionType type = 3;
3595
3596 // The activity name.
3597 optional string activity_name = 4;
3598
3599 optional bool transition_process_running = 5;
3600
3601 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003602 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003603}
3604
Bookatz8fcd09a2017-12-18 13:01:10 -08003605/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003606 * Logs a picture-in-picture action
3607 * Logged from:
3608 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3609 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3610 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3611 */
3612message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003613 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003614 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003615
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003616 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003617
Chenjie Yu52cacc62017-12-08 18:11:45 -08003618 enum State {
3619 ENTERED = 1;
3620 EXPANDED_TO_FULL_SCREEN = 2;
3621 MINIMIZED = 3;
3622 DISMISSED = 4;
3623 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003624 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003625}
3626
3627/**
Chenjie Yue8904192017-12-08 19:12:57 -08003628 * Logs overlay action
3629 * Logged from:
3630 * services/core/java/com/android/server/wm/Session.java
3631 */
3632message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003633 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003634
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003635 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003636
3637 optional bool using_alert_window = 3;
3638
3639 enum State {
3640 ENTERED = 1;
3641 EXITED = 2;
3642 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003643 optional State state = 4
3644 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003645}
3646
Adam Bookatz38767932020-02-05 12:13:40 -08003647/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003648 * Logs foreground service starts and stops.
3649 * Note that this is not when a service starts or stops, but when it is
3650 * considered foreground.
3651 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003652 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003653 */
3654message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003655 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003656 // package_name + "/" + class_name
3657 optional string short_name = 2;
3658
3659 enum State {
3660 ENTER = 1;
3661 EXIT = 2;
3662 }
3663 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003664
3665 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3666 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3667 optional bool allow_while_in_use_permission = 4;
3668}
3669
3670/**
3671 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3672 * A foreground service session is any continuous period during which the uid holds at least one
3673 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3674 * Accesses initiated while the uid is in the TOP state are ignored.
3675 * Sessions with no attempted accesses are not logged.
3676 * Logged from
3677 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3678 */
3679message ForegroundServiceAppOpSessionEnded {
3680 optional int32 uid = 1 [(is_uid) = true];
3681
3682 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003683 // Only following four ops are logged
3684 // COARSE_LOCATION = 0
3685 // FINE_LOCATION = 1
3686 // CAMERA = 26
3687 // RECORD_AUDIO = 27
3688 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003689
3690 // The uid's permission mode for accessing the AppOp during this fgs session.
3691 enum Mode {
3692 MODE_UNKNOWN = 0;
3693 MODE_ALLOWED = 1; // Always allowed
3694 MODE_IGNORED = 2; // Denied
3695 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3696 }
3697 optional Mode app_op_mode = 3;
3698
3699 // Number of times this AppOp was requested and allowed.
3700 optional int32 count_ops_accepted = 4;
3701 // Number of times this AppOp was requested but denied.
3702 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003703}
3704
Chenjie Yue8904192017-12-08 19:12:57 -08003705/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003706 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3707 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3708 * attributed back to the parent (host) uid. One example is Chrome.
3709 *
3710 * Logged from:
3711 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3712 */
3713message IsolatedUidChanged {
3714 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003715 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003716 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003717 optional int32 parent_uid = 1;
3718
3719 optional int32 isolated_uid = 2;
3720
3721 // We expect an isolated uid to be removed before if it's used for another parent uid.
3722 enum Event {
3723 REMOVED = 0;
3724 CREATED = 1;
3725 }
3726 optional Event event = 3;
3727}
3728
3729/*
3730 * Logs the reception of an incoming network packet causing the main system to wake up for
3731 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3732 * and processed by WakeupController.cpp.
3733 */
3734message PacketWakeupOccurred {
3735 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3736 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003737 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003738 // The interface name on which the packet was received.
3739 optional string iface = 2;
3740 // The ethertype value of the packet.
3741 optional int32 ethertype = 3;
3742 // String representation of the destination MAC address of the packet.
3743 optional string destination_hardware_address = 4;
3744 // String representation of the source address of the packet if this was an IP packet.
3745 optional string source_ip = 5;
3746 // String representation of the destination address of the packet if this was an IP packet.
3747 optional string destination_ip = 6;
3748 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3749 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3750 // families.
3751 optional int32 ip_next_header = 7;
3752 // The source port if this was a TCP or UDP packet.
3753 optional int32 source_port = 8;
3754 // The destination port if this was a TCP or UDP packet.
3755 optional int32 destination_port = 9;
3756}
3757
3758/*
3759 * Logs the memory stats for an app on startup.
3760 * Logged from:
3761 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3762 */
3763message AppStartMemoryStateCaptured {
3764 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003765 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003766
3767 // The process name.
3768 optional string process_name = 2;
3769
3770 // The activity name.
3771 optional string activity_name = 3;
3772
3773 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003775
3776 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003777 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003778
3779 // RSS
3780 optional int64 rss_in_bytes = 6;
3781
3782 // CACHE
3783 optional int64 cache_in_bytes = 7;
3784
3785 // SWAP
3786 optional int64 swap_in_bytes = 8;
3787}
3788
3789/*
3790 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3791 * for LMK event.
3792 * Logged from:
3793 * system/core/lmkd/lmkd.c
3794 */
3795message LmkStateChanged {
3796 enum State {
3797 UNKNOWN = 0;
3798 START = 1;
3799 STOP = 2;
3800 }
3801 optional State state = 1;
3802}
3803
3804/*
3805 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3806 * Logged from:
3807 * system/core/lmkd/lmkd.c
3808 */
3809message LmkKillOccurred {
3810 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003811 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003812
3813 // The process name.
3814 optional string process_name = 2;
3815
3816 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003817 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818
3819 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003820 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003821
3822 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003823 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003824
3825 // RSS
3826 optional int64 rss_in_bytes = 6;
3827
3828 // CACHE
3829 optional int64 cache_in_bytes = 7;
3830
3831 // SWAP
3832 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003833
3834 // The elapsed real time of start of the process.
3835 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003836
3837 // Min oom adj score considered by lmkd.
3838 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003839}
3840
Rajeev Kumar51b54602018-03-01 12:18:26 -08003841/*
3842 * Logs when the ActivityManagerService detects that an app died.
3843 *
3844 * Logged from:
3845 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3846 */
3847message AppDied {
3848 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003849 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003850}
3851
Howard Ro21a039c2018-08-06 14:55:47 -07003852/**
3853 * An atom for generic metrics logging. Available from Android Q.
3854 */
3855message GenericAtom {
3856 // The uid of the application that sent this custom atom.
3857 optional int32 uid = 1 [(is_uid) = true];
3858
3859 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003860 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003861}
3862
Tej Singhd6d6d772018-09-05 17:41:25 -07003863/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003864 * Atom for simple logging of user interaction and impression events, such as "the user touched
3865 * this button" or "this dialog was displayed".
3866 * Keep the UI event stream clean: don't use for system or background events.
3867 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003868 *
3869 * Logged from:
3870 * frameworks/base/services/core/java/com/android/server/
3871 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003872 */
3873message UiEventReported {
3874 // The event_id.
3875 optional int32 event_id = 1;
3876 // The event's source or target uid and package, if applicable.
3877 // For example, the package posting a notification, or the destination package of a share.
3878 optional int32 uid = 2 [(is_uid) = true];
3879 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003880 // An identifier used to disambiguate which logs refer to a particular instance of some
3881 // UI element. Useful when there might be multiple instances simultaneously active.
3882 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003883}
3884
3885/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003886 * Reports a notification was created or updated.
3887 *
3888 * Logged from:
3889 * frameworks/base/services/core/java/com/android/server/notification/
3890 */
3891message NotificationReported {
3892 // The event_id (as for UiEventReported).
3893 optional int32 event_id = 1;
3894 // The notifying app's uid and package.
3895 optional int32 uid = 2 [(is_uid) = true];
3896 optional string package_name = 3;
3897 // A small system-assigned identifier for the notification.
3898 // Locally probably-unique, but expect collisions across users and/or days.
3899 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003900 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3901 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003902
3903 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003904 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3905 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3906 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003907
3908 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003909 optional string category = 10; // App-assigned notification category (API-defined strings)
3910 optional int32 style = 11; // App-assigned notification style
3911 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003912
3913 // Ordering, importance and interruptiveness
3914
Will Brockman7614f6962020-02-10 19:43:03 -05003915 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003916
Will Brockman7614f6962020-02-10 19:43:03 -05003917 optional android.stats.sysui.NotificationImportance importance = 14;
3918 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003919
3920 enum NotificationImportanceExplanation {
3921 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3922 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3923 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3924 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3925 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3926 // Like _APP, but based on pre-channels priority signal.
3927 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3928 }
3929
Will Brockman7614f6962020-02-10 19:43:03 -05003930 optional NotificationImportanceExplanation importance_source = 16;
3931 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3932 optional NotificationImportanceExplanation importance_initial_source = 18;
3933 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3934 optional int32 assistant_hash = 20;
3935 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003936}
3937
3938message Notification {
3939 // The notifying app's uid and package.
3940 optional int32 uid = 1 [(is_uid) = true];
3941 optional string package_name = 2;
3942 // A small system-assigned identifier for the notification.
3943 optional int32 instance_id = 3;
3944
3945 // Grouping information.
3946 optional int32 group_instance_id = 4;
3947 optional bool is_group_summary = 5;
3948
3949 // The section of the shade that the notification is in.
3950 // See NotificationSectionsManager.PriorityBucket.
3951 enum NotificationSection {
3952 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003953 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003954 SECTION_MEDIA_CONTROLS = 2;
3955 SECTION_PEOPLE = 3;
3956 SECTION_ALERTING = 4;
3957 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003958 }
3959 optional NotificationSection section = 6;
3960}
3961
3962message NotificationList {
3963 repeated Notification notifications = 1; // An ordered sequence of notifications.
3964}
3965
3966/**
3967 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3968 *
3969 * Logged from:
3970 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3971 */
3972message NotificationPanelReported {
3973 // The event_id (as for UiEventReported).
3974 optional int32 event_id = 1;
3975 optional int32 num_notifications = 2;
3976 // The notifications in the panel, in the order that they appear there.
3977 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3978}
3979
3980/**
3981 * Reports a notification channel, or channel group, was created, updated, or deleted.
3982 *
3983 * Logged from:
3984 * frameworks/base/services/core/java/com/android/server/notification/
3985 */
3986message NotificationChannelModified {
3987 // The event_id (as for UiEventReported).
3988 optional int32 event_id = 1;
3989 // The notifying app's uid and package.
3990 optional int32 uid = 2 [(is_uid) = true];
3991 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003992 // Hash of app-assigned notification channel ID or channel-group ID
3993 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003994 // Previous importance setting, if applicable
3995 optional android.stats.sysui.NotificationImportance old_importance = 5;
3996 // New importance setting
3997 optional android.stats.sysui.NotificationImportance importance = 6;
3998}
3999
4000
4001/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004002 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004003 *
4004 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004005 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004006 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004007message BiometricAcquired {
4008 // Biometric modality that was acquired.
4009 optional android.hardware.biometrics.ModalityEnum modality = 1;
4010 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4011 optional int32 user = 2;
4012 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4013 optional bool is_crypto = 3;
4014 // Action that the device is performing. Acquired messages are only expected for enroll and
4015 // authenticate. Other actions may indicate an error.
4016 optional android.hardware.biometrics.ActionEnum action = 4;
4017 // The client that this acquisition was received for.
4018 optional android.hardware.biometrics.ClientEnum client = 5;
4019 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4020 optional int32 acquire_info = 6;
4021 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4022 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004023 // Dictates if this message should trigger additional debugging.
4024 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004025}
4026
4027/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004028 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004029 *
4030 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004031 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004032 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004033message BiometricAuthenticated {
4034 // Biometric modality that was used.
4035 optional android.hardware.biometrics.ModalityEnum modality = 1;
4036 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4037 optional int32 user = 2;
4038 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4039 // storage.
4040 optional bool is_crypto = 3;
4041 // The client that this acquisition was received for.
4042 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004043 // If authentication requires user confirmation. See BiometricPrompt's
4044 // setRequireConfirmation(bool) method.
4045 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004046
Kevin Chyn1741a072019-01-17 11:54:40 -08004047 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004048 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004049 REJECTED = 1;
4050 PENDING_CONFIRMATION = 2;
4051 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004052 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004053
4054 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004055 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004056 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4057 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4058 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4059 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004060 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004061 // Dictates if this message should trigger additional debugging.
4062 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004063}
4064
4065/**
4066 * Logs when a biometric error occurs.
4067 *
4068 * Logged from:
4069 * frameworks/base/services/core/java/com/android/server/biometrics
4070 */
4071message BiometricErrorOccurred {
4072 // Biometric modality that was used.
4073 optional android.hardware.biometrics.ModalityEnum modality = 1;
4074 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4075 optional int32 user = 2;
4076 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4077 optional bool is_crypto = 3;
4078 // Action that the device is performing.
4079 optional android.hardware.biometrics.ActionEnum action = 4;
4080 // The client that this acquisition was received for.
4081 optional android.hardware.biometrics.ClientEnum client = 5;
4082 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4083 // are unique to modality.
4084 optional int32 error_info = 6;
4085 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4086 // by the vendor and not specified by the HIDL interface.
4087 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004088 // Dictates if this message should trigger additional debugging.
4089 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004090 // Time spent during the authentication attempt.
4091 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004092}
4093
4094/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004095 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004096 * Logged from:
4097 * frameworks/base/services/core/java/com/android/server/biometrics
4098 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004099message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004100 // Biometric modality.
4101 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004102 // Type of issue detected.
4103 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004104 // Dictates if this message should trigger additional debugging.
4105 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004106}
Howard Ro688ae182018-09-25 00:09:36 -07004107
joshmccloskey6f952b22019-03-25 20:59:35 -07004108/**
4109 * Logs when a biometric enrollment occurs.
4110 *
4111 * Logged from:
4112 * frameworks/base/services/core/java/com/android/server/biometrics
4113 */
4114message BiometricEnrolled {
4115 // Biometric modality that was used.
4116 optional android.hardware.biometrics.ModalityEnum modality = 1;
4117 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4118 optional int32 user = 2;
4119 // The amount of time the enrollment took in milliseconds.
4120 optional int64 latency_millis = 3;
4121 // Whether or not the enrollment was successful.
4122 optional bool success = 4;
4123}
4124
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004125/*
Tej Singh0d176952019-01-16 19:10:54 -08004126 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004127 */
Tej Singh0d176952019-01-16 19:10:54 -08004128message FlagFlipUpdateOccurred {
4129 // If the event is from a flag config package, specify the package name.
4130 optional string flag_flip_package_name = 1;
4131
4132 // The order id of the package
4133 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004134}
4135
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004136/**
4137 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004138 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004139 */
4140message TrainExperimentIds {
4141 repeated int64 experiment_id = 1;
4142}
4143
Yangster-macb89807e2018-11-15 21:10:57 -08004144/*
4145 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004146 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004147 */
4148message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004149 // Name of the train.
4150 optional string train_name = 1;
4151 // Version code for a "train" of packages that need to be installed atomically
4152 optional int64 train_version_code = 2;
4153 // After installation of this package, device requires a restart.
4154 optional bool requires_staging = 3;
4155 // Rollback should be enabled for this install.
4156 optional bool rollback_enabled = 4;
4157 // Requires low latency monitoring if possible.
4158 optional bool requires_low_latency_monitor = 5;
4159
Yangster-macb89807e2018-11-15 21:10:57 -08004160 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004161 UNKNOWN = 0;
4162 INSTALL_REQUESTED = 1;
4163 INSTALL_STARTED = 2;
4164 INSTALL_STAGED_NOT_READY = 3;
4165 INSTALL_STAGED_READY = 4;
4166 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004167 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4168 // and INSTALL_FAILURE_COMMIT.
4169 INSTALL_FAILURE = 6 [deprecated = true];
4170 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004171 INSTALL_CANCELLED = 7;
4172 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004173 INSTALLER_ROLLBACK_INITIATED = 9;
4174 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4175 INSTALLER_ROLLBACK_STAGED = 11;
4176 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4177 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4178 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4179 INSTALLER_ROLLBACK_SUCCESS = 15;
4180 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004181 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4182 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4183 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4184 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4185 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4186 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004187 INSTALL_FAILURE_DOWNLOAD = 23;
4188 INSTALL_FAILURE_STATE_MISMATCH = 24;
4189 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004190 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004191 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004192 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004193 // Possible experiment ids for monitoring this push.
4194 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4195 // user id
4196 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004197 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004198 // Whether or not this is a rollback event
4199 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004200}
4201
Tej Singhc9203082019-05-03 13:42:23 -07004202/* Test atom, is not logged anywhere */
4203message TestAtomReported {
4204 repeated AttributionNode attribution_node = 1;
4205 optional int32 int_field = 2;
4206 optional int64 long_field = 3;
4207 optional float float_field = 4;
4208 optional string string_field = 5;
4209 optional bool boolean_field = 6;
4210 enum State {
4211 UNKNOWN = 0;
4212 OFF = 1;
4213 ON = 2;
4214 }
4215 optional State state = 7;
4216 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4217}
4218
Maggie Whitefc1aa592018-11-28 21:55:23 -08004219/** Represents USB port overheat event. */
4220message UsbPortOverheatEvent {
4221 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4222 optional int32 plug_temperature_deci_c = 1;
4223
4224 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4225 optional int32 max_temperature_deci_c = 2;
4226
4227 /* Time between USB plug event and overheat threshold trip, in seconds. */
4228 optional int32 time_to_overheat_secs = 3;
4229
4230 /* Time between overheat threshold trip and hysteresis, in seconds. */
4231 optional int32 time_to_hysteresis_secs = 4;
4232
4233 /* Time between hysteresis and active mitigation ending, in seconds. */
4234 optional int32 time_to_inactive_secs = 5;
4235};
4236
Maggie White8735b852019-01-18 11:40:49 -08004237/**
4238 * Logs total effective full charge and discharge cycles on a battery.
4239 * Here are some examples of one effective cycle:
4240 * 1) the battery charges from 0% to 100% and drains back to 0%,
4241 * 2) charging from 50% to 100% and draining back to 50% twice.
4242 * Pulled from:
4243 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4244 */
4245message BatteryCycleCount {
4246 /* Number of total charge and discharge cycles on the system battery. */
4247 optional int32 cycle_count = 1;
4248}
4249
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004250/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004251 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4252 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004253 * Pulled from:
4254 * StatsCompanionService
4255 */
4256
Carmen Agimof12dec122019-03-06 16:14:38 +00004257message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004258
Carmen Agimof12dec122019-03-06 16:14:38 +00004259 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004260 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004261 PUBLIC = 1;
4262 PRIVATE = 2;
4263 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004264 }
4265
Carmen Agimof12dec122019-03-06 16:14:38 +00004266 // The type of external storage.
4267 optional android.stats.storage.ExternalStorageType storage_type = 1;
4268 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4269 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004270 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004271 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004272}
4273
Yangster-macb89807e2018-11-15 21:10:57 -08004274/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004275 * Logs when a connection becomes available and lost.
4276 * Logged in StatsCompanionService.java
4277 */
4278message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004279 // Id of the network.
4280 optional int32 net_id = 1;
4281
4282 enum State {
4283 UNKNOWN = 0;
4284 CONNECTED = 1;
4285 DISCONNECTED = 2;
4286 }
4287 // Connected state of a network.
4288 optional State state = 2;
4289}
4290
4291/**
4292 * Logs when a service starts and stops.
4293 * Logged from:
4294 * services/core/java/com/android/server/am/ActiveServices.java
4295 */
4296message ServiceStateChanged {
4297
4298 optional int32 uid = 1 [(is_uid) = true];
4299
4300 optional string package_name = 2;
4301
4302 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004303
4304 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004305 START = 1;
4306 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004307 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004308
4309 optional State state = 4;
4310}
4311
4312/**
4313 * Logs when a service is launched.
4314 * Logged from:
4315 * services/core/java/com/android/server/am/ActiveServices.java
4316 */
4317message ServiceLaunchReported {
4318
4319 optional int32 uid = 1 [(is_uid) = true];
4320
4321 optional string package_name = 2;
4322
4323 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004324}
Howard Ro688ae182018-09-25 00:09:36 -07004325
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004326/**
4327 * Logs when a hidden API is used.
4328 *
4329 * Logged from:
4330 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4331 */
4332message HiddenApiUsed {
4333 // The uid of the app making the hidden access.
4334 optional int32 uid = 1 [(is_uid) = true];
4335
4336 // Signature of the method or field accessed.
4337 optional string signature = 2;
4338
4339 enum AccessMethod {
4340 NONE = 0;
4341 REFLECTION = 1;
4342 JNI = 2;
4343 LINKING = 3;
4344 }
4345
4346 // Type of access.
4347 optional AccessMethod access_method = 3;
4348
4349 // Whether the access was prevented or not.
4350 optional bool access_denied = 4;
4351}
4352
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004353/**
4354 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4355 * - When user sees privacy chip
4356 * - When user clicks privacy chip
4357 * - How does the user exit the Privacy Dialog
4358 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004359 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4360 */
4361message PrivacyIndicatorsInteracted {
4362
4363 enum Type {
4364 UNKNOWN = 0;
4365 CHIP_VIEWED = 1;
4366 CHIP_CLICKED = 2;
4367 DIALOG_PRIVACY_SETTINGS = 3;
4368 DIALOG_DISMISS = 4;
4369 DIALOG_LINE_ITEM = 5;
4370 }
4371
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004372 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004373
4374 // Used if the type is LINE_ITEM
4375 optional string package_name = 2;
4376}
4377
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004378/**
4379 * Logs information about a package that is moved from the internal to external storage and vice
4380 * versa.
4381 * It logs the package name, the type of the external storage where the package is installed
4382 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4383 * and the move type: if it's from internal to external or the other way around.
4384 *
4385 * Logged from:
4386 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4387 */
4388message AppMovedStorageReported {
4389 enum MoveType {
4390 UNKNOWN = 0;
4391 TO_EXTERNAL = 1;
4392 TO_INTERNAL = 2;
4393 }
4394 // The type of the external storage.
4395 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4396 // The type of move.
4397 optional MoveType move_type = 2;
4398 // The name of the package that was moved.
4399 optional string package_name = 3;
4400}
4401
jianjin8f2dee02019-03-29 14:03:08 -07004402/**
4403 * Logs when system server watchdog occurs.
4404 * Logged from:
4405 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4406 */
4407message SystemServerWatchdogOccurred {
4408 optional string subject = 1;
4409}
4410
4411/**
4412 * Logs when new file added to tombstones.
4413 * Logged from:
4414 * frameworks/base/core/java/com/android/server/BootReceiver.java
4415 */
4416message TombStoneOccurred {
4417}
4418
Hai Zhang5d3328d2019-04-13 21:25:06 +08004419/*
4420 * Information about a role request
4421 *
4422 * Logged from:
4423 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4424 */
4425message RoleRequestResultReported {
4426 // UID of application requesting the role
4427 optional int32 requesting_uid = 1;
4428
4429 // Package name of application requesting the role
4430 optional string requesting_package_name = 2;
4431
4432 // The role to be granted
4433 optional string role_name = 3;
4434
4435 // The count of applications qualifying for the role
4436 optional int32 qualifying_count = 4;
4437
4438 // UID of application current granted the role
4439 optional int32 current_uid = 5;
4440
4441 // Package name of application current granted the role
4442 optional string current_package_name = 6;
4443
4444 // UID of another application that user chose to grant the role to, instead of the requesting
4445 // application
4446 optional int32 granted_another_uid = 7;
4447
4448 // Package name of another application that user chose to grant the role to, instead of the
4449 // requesting application
4450 optional string granted_another_package_name = 8;
4451
4452 enum Result {
4453 UNDEFINED = 0;
4454 // role request was ignored
4455 IGNORED = 1;
4456 // role request was ignored because it's already granted
4457 IGNORED_ALREADY_GRANTED = 2;
4458 // role request was ignored because the application isn't qualified
4459 IGNORED_NOT_QUALIFIED = 3;
4460 // role request was ignored because user said it should be always denied
4461 IGNORED_USER_ALWAYS_DENIED = 4;
4462 // role was granted by user action
4463 USER_GRANTED = 5;
4464 // role was denied by user action
4465 USER_DENIED = 6;
4466 // role was denied by user granting another application the role
4467 USER_DENIED_GRANTED_ANOTHER = 7;
4468 // role was denied and set to be always denied by the user
4469 USER_DENIED_WITH_ALWAYS = 8;
4470 }
4471 // The result of the role request
4472 optional Result result = 9;
4473}
4474
Mark Tabrya824a642019-11-05 12:26:12 -08004475/**
4476 * Logs when a Vehicle Maps Service client's connection state has changed
4477 *
4478 * Logged from:
4479 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4480 */
4481message VmsClientConnectionStateChanged {
4482 // The UID of the VMS client app
4483 optional int32 uid = 1 [(is_uid) = true];
4484
4485 enum State {
4486 UNKNOWN = 0;
4487 // Attempting to connect to the client
4488 CONNECTING = 1;
4489 // Client connection established
4490 CONNECTED = 2;
4491 // Client connection closed unexpectedly
4492 DISCONNECTED = 3;
4493 // Client connection closed by VMS
4494 TERMINATED = 4;
4495 // Error establishing the client connection
4496 CONNECTION_ERROR = 5;
4497 }
4498
4499 optional State state = 2;
4500}
4501
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004502/**
4503 * Logs when MediaProvider has successfully finished scanning a storage volume.
4504 *
4505 * Logged from:
4506 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4507 */
shafik43825842020-04-02 17:30:24 +01004508message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004509 enum Reason {
4510 // Scan triggered due to unknown reason
4511 UNKNOWN = 0;
4512 // Scan triggered due to storage volume being mounted
4513 MOUNTED = 1;
4514 // Scan triggered due to explicit user action or app request
4515 DEMAND = 2;
4516 // Scan triggered due to idle maintenance
4517 IDLE = 3;
4518 }
4519
4520 // Volume type that this event pertains to
4521 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4522 // Reason why this scan was triggered
4523 optional Reason reason = 2;
4524 // Total number of files scanned
4525 optional int64 item_count = 3;
4526 // Duration of scan, normalized per file
4527 optional float normalized_duration_millis = 4;
4528 // Number of database inserts, normalized per file
4529 optional float normalized_insert_count = 5;
4530 // Number of database updates, normalized per file
4531 optional float normalized_update_count = 6;
4532 // Number of database deletes, normalized per file
4533 optional float normalized_delete_count = 7;
4534}
4535
4536/**
4537 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4538 *
4539 * Logged from:
4540 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4541 */
shafik43825842020-04-02 17:30:24 +01004542message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004543 // Volume type that this event pertains to
4544 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004545 // UID of app that requested deletion
4546 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004547 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004548 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004549}
4550
4551/**
4552 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4553 *
4554 * Logged from:
4555 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4556 */
shafik43825842020-04-02 17:30:24 +01004557message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004558 enum Result {
4559 UNKNOWN = 0;
4560 USER_GRANTED = 1;
4561 AUTO_GRANTED = 2;
4562 USER_DENIED = 3;
4563 USER_DENIED_WITH_PREJUDICE = 4;
4564 AUTO_DENIED = 5;
4565 }
4566
4567 // Volume type that this event pertains to
4568 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004569 // UID of app that requested permission
4570 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004571 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004572 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004573 // Result of this request
shafik43825842020-04-02 17:30:24 +01004574 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004575}
4576
4577/**
4578 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4579 *
4580 * Logged from:
4581 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4582 */
shafik43825842020-04-02 17:30:24 +01004583message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004584 // Volume type that this event pertains to
4585 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4586 // Old database version code
4587 optional int32 version_from = 2;
4588 // New database version code
4589 optional int32 version_to = 3;
4590 // Total number of files in database
4591 optional int64 item_count = 4;
4592 // Duration of schema change, normalized per file
4593 optional float normalized_duration_millis = 5;
4594}
4595
4596/**
4597 * Logs when MediaProvider has finished an idle maintenance job.
4598 *
4599 * Logged from:
4600 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4601 */
shafik43825842020-04-02 17:30:24 +01004602message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004603 // Volume type that this event pertains to
4604 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4605
4606 // Total number of files in database
4607 optional int64 item_count = 2;
4608 // Duration of idle maintenance, normalized per file
4609 optional float normalized_duration_millis = 3;
4610 // Number of thumbnails found to be stale, normalized per file
4611 optional float normalized_stale_thumbnails = 4;
4612 // Number of items found to be expired, normalized per file
4613 optional float normalized_expired_media = 5;
4614}
4615
Keun young Park3e033cb2019-12-18 11:27:35 -08004616/**
4617 * Represents boot time event with duration in ms.
4618 *
4619 * Logged from: bootstat and various system server components. Check each enums for details.
4620 */
4621message BootTimeEventDuration {
4622 enum DurationEvent {
4623 UNKNOWN = 0;
4624 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4625 ABSOLUTE_BOOT_TIME = 1;
4626 // Bootloader's 1st stage execution time.
4627 // Logged from bootstat.
4628 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4629 // Bootloader's 1st stage loading time.
4630 // Logged from bootstat.
4631 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4632 // Bootloader's kernel loading time.
4633 // Logged from bootstat.
4634 BOOTLOADER_KERNEL_LOAD = 4;
4635 // Bootloader's 2nd stage execution time.
4636 // Logged from bootstat.
4637 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4638 // Bootloader's 2nd stage loading time.
4639 // Logged from bootstat.
4640 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4641 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4642 // for locked device.
4643 // Logged from bootstat.
4644 BOOTLOADER_UI_WAIT = 7;
4645 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4646 // Logged from bootstat.
4647 BOOTLOADER_TOTAL = 8;
4648 // Shutdown duration inside init for the reboot before the current boot up.
4649 // Logged from f/b/services/.../BootReceiver.java.
4650 SHUTDOWN_DURATION = 9;
4651 // Total time for mounting of disk devices during bootup.
4652 // Logged from f/b/services/.../BootReceiver.java.
4653 MOUNT_DEFAULT_DURATION = 10;
4654 // Total time for early stage mounting of disk devices during bootup.
4655 // Logged from f/b/services/.../BootReceiver.java.
4656 MOUNT_EARLY_DURATION = 11;
4657 // Total time for late stage mounting of disk devices during bootup.
4658 // Logged from f/b/services/.../BootReceiver.java.
4659 MOUNT_LATE_DURATION = 12;
4660 // Average time to scan non-system app after OTA
4661 // Logged from f/b/services/.../PackageManagerService.java
4662 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4663 // Time to initialize Package manager after OTA
4664 // Logged from f/b/services/.../PackageManagerService.java
4665 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4666 // Time to scan all system app from Package manager after OTA
4667 // Logged from f/b/services/.../PackageManagerService.java
4668 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4669 // Init's total time for cold boot stage.
4670 // Logged from bootstat.
4671 COLDBOOT_WAIT = 16;
4672 // Init's total time for initializing selinux.
4673 // Logged from bootstat.
4674 SELINUX_INIT = 17;
4675 // Time since last factory reset.
4676 // Logged from bootstat.
4677 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004678 // Init's total time spent for completing the 1st stage.
4679 // Logged from bootstat.
4680 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004681 }
4682
4683 // Type of the event.
4684 optional DurationEvent event = 1;
4685 // Duration of the event in ms.
4686 optional int64 duration_millis = 2;
4687}
4688
4689/**
4690 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4691 * since boot-up.
4692 *
4693 * Logged from: bootstat and various system server components. Check each enums for details.
4694 */
4695message BootTimeEventElapsedTime {
4696 enum ElapsedTimeEvent {
4697 UNKNOWN = 0;
4698 // Time when init starts 1st stage. Logged from bootstat.
4699 ANDROID_INIT_STAGE_1 = 1;
4700 // Time when sys.boot_completed prop is set.
4701 // Logged from bootstat.
4702 BOOT_COMPLETE = 2;
4703 // BOOT_COMPLETE for encrypted device.
4704 BOOT_COMPLETE_ENCRYPTION = 3;
4705 // BOOT_COMPLETE for device with no encryption.
4706 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4707 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004708 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004709 // BOOT_COMPLETE after factory reset.
4710 FACTORY_RESET_BOOT_COMPLETE = 6;
4711 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4712 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004713 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4714 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004715 // BOOT_COMPLETE after OTA.
4716 OTA_BOOT_COMPLETE = 9;
4717 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4718 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004719 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4720 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004721 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4722 // Logged from f/b/services/.../UserController.java
4723 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4724 // Time when the system starts sending BOOT_COMPLETED broadcast.
4725 // Logged from f/b/services/.../UserController.java
4726 FRAMEWORK_BOOT_COMPLETED = 13;
4727 // Time when the package manager starts init.
4728 // Logged from f/b/services/.../SystemServer.java
4729 PACKAGE_MANAGER_INIT_START = 14;
4730 // Time when package manager is ready
4731 // Logged from f/b/services/.../SystemServer.java
4732 PACKAGE_MANAGER_INIT_READY = 15;
4733 // Represents the time when user has entered unlock credential for system with user pin.
4734 // Logged from bootstat.
4735 POST_DECRYPT = 16;
4736 // Represents the start of zygote's init.
4737 // Logged from zygote itself.
4738 ZYGOTE_INIT_START = 17;
4739 // Represents the start of secondary zygote's init.
4740 // TODO: add logging to zygote
4741 SECONDARY_ZYGOTE_INIT_START = 18;
4742 // Represents the start of system server's init.
4743 // Logged from f/b/services/.../SystemServer.java
4744 SYSTEM_SERVER_INIT_START = 19;
4745 // Represents the completion of system server's init.
4746 // Logged from f/b/services/.../SystemServer.java
4747 SYSTEM_SERVER_READY = 20;
4748 // Represents the start of launcher during boot-up.
4749 // TODO: add logging
4750 LAUNCHER_START = 21;
4751 // Represents the completion of launcher's initial rendering. User can use other apps from
4752 // launcher from this point.
4753 // TODO: add logging
4754 LAUNCHER_SHOWN = 22;
4755 }
4756
4757 // Type of the event.
4758 optional ElapsedTimeEvent event = 1;
4759 // Time since bootup for the event.
4760 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4761 optional int64 time_millis = 2;
4762}
4763
4764/**
4765 * Boot time events with UTC time.
4766 *
4767 * Logged from: bootstat and various system server components. Check each enums for details.
4768 */
4769message BootTimeEventUtcTime {
4770 enum UtcTimeEvent {
4771 UNKNOWN = 0;
4772 // Time of the bootstat's marking of 1st boot after the last factory reset.
4773 // Logged from bootstat.
4774 FACTORY_RESET_RESET_TIME = 1;
4775 // The time when bootstat records FACTORY_RESET_* events. This is close to
4776 // BOOT_COMPLETE time for the current bootup.
4777 // Logged from bootstat.
4778 FACTORY_RESET_CURRENT_TIME = 2;
4779 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4780 // Logged from bootstat.
4781 FACTORY_RESET_RECORD_VALUE = 3;
4782 }
4783
4784 // Type of the event.
4785 optional UtcTimeEvent event = 1;
4786 // UTC time for the event.
4787 optional int64 utc_time_secs = 2;
4788}
4789
4790/**
4791 * Boot time events representing specific error code during bootup.
4792 * Meaning of error code can be different per each event type.
4793 *
4794 * Logged from: bootstat and various system server components. Check each enums for details.
4795 */
4796message BootTimeEventErrorCode {
4797 enum ErrorCodeEvent {
4798 UNKNOWN = 0;
4799 // Linux error code for time() call to get the current UTC time.
4800 // Logged from bootstat.
4801 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4802 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4803 // as UMOUNT_STAT_* from init/reboot.cpp.
4804 // Logged from f/b/services/.../BootReceiver.java.
4805 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004806 // Reprepsents fie system mounting error code of /data partition for the current boot.
4807 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004808 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004809 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004810 }
4811
4812 // Type of the event.
4813 optional ErrorCodeEvent event = 1;
4814 // error code defined per each event type.
4815 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4816 // FS_MGR_FS_STAT.
4817 optional int32 error_code = 2;
4818}
4819
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004820/**
4821 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4822 * after an OTA.
4823 *
4824 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004825 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004826 */
4827message SnapshotMergeReported {
4828 // Keep in sync with
4829 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4830 enum UpdateState {
4831 // No update or merge is in progress.
4832 NONE = 0;
4833 // An update is applying; snapshots may already exist.
4834 INITIATED = 1;
4835 // An update is pending, but has not been successfully booted yet.
4836 UNVERIFIED = 2;
4837 // The kernel is merging in the background.
4838 MERGING = 3;
4839 // Post-merge cleanup steps could not be completed due to a transient
4840 // error, but the next reboot will finish any pending operations.
4841 MERGE_NEEDS_REBOOT = 4;
4842 // Merging is complete, and needs to be acknowledged.
4843 MERGE_COMPLETED = 5;
4844 // Merging failed due to an unrecoverable error.
4845 MERGE_FAILED = 6;
4846 // The update was implicitly cancelled, either by a rollback or a flash
4847 // operation via fastboot. This state can only be returned by WaitForMerge.
4848 CANCELLED = 7;
4849 };
4850
4851 // Status of the update after the merge attempts.
4852 optional UpdateState final_state = 1;
4853
4854 // Time to complete a merge operation in milliseconds.
4855 // A negative value corresponds to the case in which the merge operation
4856 // was interrupted and resumed (e.g. in case of a system reboot during the
4857 // merge).
4858 optional int64 duration_millis = 2;
4859
4860 // Number of reboots that occurred after issuing and before completing the
4861 // merge of all the snapshot devices.
4862 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004863
4864 // The device has been upgraded to Virtual A/B.
4865 optional bool is_vab_retrofit = 4;
4866
4867 // Space that has been temporarily allocated in the /data partition
4868 // containing the dm-snapshot's copy-on-write data generated during a
4869 // Virtual A/B update.
4870 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004871}
4872
Chenjie Yubbcbc602018-02-05 16:51:52 -08004873//////////////////////////////////////////////////////////////////////
4874// Pulled atoms below this line //
4875//////////////////////////////////////////////////////////////////////
4876
4877/**
David Chenc8a43242017-10-17 16:23:28 -07004878 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4879 *
4880 * Pulled from:
4881 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4882 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004883message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004884 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004885
4886 optional int64 rx_bytes = 2;
4887
4888 optional int64 rx_packets = 3;
4889
4890 optional int64 tx_bytes = 4;
4891
4892 optional int64 tx_packets = 5;
4893}
4894
4895/**
4896 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4897 *
4898 * Pulled from:
4899 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4900 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004901message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004902 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004903
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004904 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4905 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004906
4907 optional int64 rx_bytes = 3;
4908
4909 optional int64 rx_packets = 4;
4910
4911 optional int64 tx_bytes = 5;
4912
4913 optional int64 tx_packets = 6;
4914}
4915
4916/**
4917 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4918 *
4919 * Pulled from:
4920 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4921 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004922message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004923 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004924
4925 optional int64 rx_bytes = 2;
4926
4927 optional int64 rx_packets = 3;
4928
4929 optional int64 tx_bytes = 4;
4930
4931 optional int64 tx_packets = 5;
4932}
4933
4934/**
4935 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4936 *
4937 * Pulled from:
4938 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4939 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004940message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004941 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004942
Yao Chenc40a19d2018-03-15 16:48:25 -07004943 // 1 denotes foreground and 0 denotes background. This is called Set in
4944 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004945 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004946
4947 optional int64 rx_bytes = 3;
4948
4949 optional int64 rx_packets = 4;
4950
4951 optional int64 tx_bytes = 5;
4952
4953 optional int64 tx_packets = 6;
4954}
4955
4956/**
junyulai8d1a6092020-05-07 13:38:15 +08004957 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004958 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4959 * the caller must not assume any row of data is one full report when filtering with a set of
4960 * matching conditions, because future data may represent with multiple rows what is currently
4961 * represented by one.
4962 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4963 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004964 *
4965 * Pulled from:
4966 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4967 */
4968message DataUsageBytesTransfer {
4969 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4970 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4971 // states combined, not including debug states. See NetworkStats#SET_*.
4972 optional int32 state = 1;
4973
4974 optional int64 rx_bytes = 2;
4975
4976 optional int64 rx_packets = 3;
4977
4978 optional int64 tx_bytes = 4;
4979
4980 optional int64 tx_packets = 5;
4981
4982 // Radio Access Technology (RAT) type of this record, should be one of
4983 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4984 // the record is for all rat types combined.
4985 optional int32 rat_type = 6;
4986
4987 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004988 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004989 optional string sim_mcc = 7;
4990 optional string sim_mnc = 8;
4991
junyulai8b794b72020-05-19 17:36:13 +08004992 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4993 // See TelephonyManager#getSimCarrierId.
4994 optional int32 carrier_id = 9;
4995
junyulai8d1a6092020-05-07 13:38:15 +08004996 // Enumeration of opportunistic states with an additional ALL state indicates the record is
4997 // combined regardless of the boolean value in its field.
4998 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08004999 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005000 ALL = 1;
5001 OPPORTUNISTIC = 2;
5002 NOT_OPPORTUNISTIC = 3;
5003 }
5004 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005005 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005006 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005007 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005008}
5009
5010/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005011 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5012 *
5013 * Pulled from:
5014 * StatsCompanionService
5015 */
5016message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005017 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005018
5019 optional int64 rx_bytes = 2;
5020
5021 optional int64 tx_bytes = 3;
5022}
5023
5024/**
David Chenc8a43242017-10-17 16:23:28 -07005025 * Pulls the kernel wakelock durations. This atom is adapted from
5026 * android/internal/os/KernelWakelockStats.java
5027 *
5028 * Pulled from:
5029 * StatsCompanionService using KernelWakelockReader.
5030 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005031message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005032 optional string name = 1;
5033
5034 optional int32 count = 2;
5035
5036 optional int32 version = 3;
5037
Yangster-maca8a30442018-10-13 23:46:34 -07005038 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005039}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005040
Chenjie Yu05013b32017-11-21 10:21:41 -08005041/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005042 * Pulls low power state information. If power.stats HAL is not available, this
5043 * includes platform and subsystem sleep state information,
5044 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5045 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005046 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005047 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005048 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5049 * as defined in:
5050 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005051 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005052message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005053 // Subsystem name
5054 optional string subsystem_name = 1;
5055 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5056 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005057 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5058 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005059 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005060 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005061 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005062 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005063 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005064}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005065
Chenjie Yu05013b32017-11-21 10:21:41 -08005066/**
Bookatz92da2832018-11-01 18:10:03 -07005067 * Pulls on-device power measurement information.
5068 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5069 * Pulled from:
5070 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5071 */
5072message OnDevicePowerMeasurement {
5073 // Name of the subsystem (to which the rail belongs).
5074 optional string subsystem_name = 1;
5075
5076 // Rail name. The rail lies within the subsystem.
5077 optional string rail_name = 2;
5078
5079 // Time (in ms since boot) at which the rail energy value was measured.
5080 // This may differ slightly from the time that statsd logs this information.
5081 optional uint64 measurement_timestamp_millis = 3;
5082
5083 // Accumulated energy used via the rail since device boot in uWs.
5084 optional uint64 energy_microwatt_secs = 4;
5085}
5086
5087/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005088 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005089 * Pulls the time the cpu spend on the frequency index. Frequency index
5090 * starts from highest to lowest. The value should be monotonically
5091 * increasing since boot. However, if there is a cpu
5092 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005093 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005094message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005095 optional uint32 cluster = 1;
5096 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005097 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005098}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005099
Chenjie Yu05013b32017-11-21 10:21:41 -08005100/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005101 * Pulls Cpu Time Per Uid.
5102 * Note that isolated process uid time should be attributed to host uids.
5103 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005104message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005105 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005106 optional uint64 user_time_micros = 2;
5107 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005108}
5109
5110/**
5111 * Pulls Cpu Time Per Uid per frequency.
5112 * Note that isolated process uid time should be attributed to host uids.
5113 * For each uid, we order the time by descending frequencies.
5114 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005115message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005116 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005117 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005118 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005119}
Hugo Benichi884970e2017-11-14 22:42:46 +09005120
Chenjie Yu05013b32017-11-21 10:21:41 -08005121/**
5122 * Pulls Wifi Controller Activity Energy Info
5123 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005124message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005125 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005126 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005127 // stack reported state
5128 // TODO: replace this with proto enum
5129 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005130 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005131 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005132 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005133 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005134 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005135 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005136 // product of current(mA), voltage(V) and time(ms)
5137 optional uint64 controller_energy_used = 6;
5138}
5139
5140/**
5141 * Pulls Modem Activity Energy Info
5142 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005143message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005144 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005145 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005146 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005147 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005148 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005149 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005150 /**
5151 * Tx power index
5152 * index 0 = tx_power < 0dBm
5153 * index 1 = 0dBm < tx_power < 5dBm
5154 * index 2 = 5dBm < tx_power < 15dBm
5155 * index 3 = 15dBm < tx_power < 20dBm
5156 * index 4 = tx_power > 20dBm
5157 */
5158 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005159 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005160 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005161 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005162 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005163 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005164 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005165 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005166 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005167 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005168 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005169 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005170 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005171 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005172}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005173
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005174/**
5175 * Pulls Bluetooth Activity Energy Info
5176 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5177 */
5178message BluetoothActivityInfo {
5179 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005180 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005181 // bluetooth stack state
5182 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005183 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005184 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005185 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005186 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005187 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005188 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005189 // product of current(mA), voltage(V) and time(ms)
5190 optional uint64 energy_used = 6;
5191}
5192
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005193/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005194 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005195 *
5196 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005197 */
5198message ProcessMemoryState {
5199 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005200 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005201
5202 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005203 // Usually package name, "system" for system server.
5204 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005205 optional string process_name = 2;
5206
Rafal Slawikda51b932018-12-13 16:31:33 +00005207 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005208 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005209
5210 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005211 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005212
5213 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005214 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005215
Rajeev Kumar90235992018-01-29 11:06:48 -08005216 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005217 // Value is read from memory.stat, field total_rss if per-app memory
5218 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005219 optional int64 rss_in_bytes = 6;
5220
5221 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005222 // Value is read from memory.stat, field total_cache if per-app memory
5223 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005224 optional int64 cache_in_bytes = 7;
5225
5226 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005227 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005228 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005229 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005230
Rafal Slawik203c3db2019-09-25 19:53:01 +01005231 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005232 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005233
Rafal Slawik203c3db2019-09-25 19:53:01 +01005234 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5235 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005236
Rafal Slawik203c3db2019-09-25 19:53:01 +01005237 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5238 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005239}
5240
5241/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005242 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005243 *
5244 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5245 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005246 *
5247 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005248 */
5249message ProcessMemoryHighWaterMark {
5250 // The uid if available. -1 means not available.
5251 optional int32 uid = 1 [(is_uid) = true];
5252
Rafal Slawikda51b932018-12-13 16:31:33 +00005253 // The process name.
5254 // Usually package name or process cmdline.
5255 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005256 optional string process_name = 2;
5257
Rafal Slawik239b6802019-09-09 18:46:01 +01005258 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5259 // computed by converting kilobytes to bytes.
5260 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5261
Rafal Slawik3bea8952018-11-15 12:39:33 +00005262 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5263 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005264 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005265}
5266
5267/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005268 * Logs the memory stats for a process.
5269 *
5270 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5271 * and for selected native processes.
5272 */
5273message ProcessMemorySnapshot {
5274 // The uid if available. -1 means not available.
5275 optional int32 uid = 1 [(is_uid) = true];
5276
5277 // The process name.
5278 // Usually package name or process cmdline.
5279 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5280 optional string process_name = 2;
5281
5282 // The pid of the process.
5283 // Allows to disambiguate instances of the process.
5284 optional int32 pid = 3;
5285
5286 // The current OOM score adjustment value.
5287 // Read from ProcessRecord for managed processes.
5288 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5289 optional int32 oom_score_adj = 4;
5290
5291 // The current RSS of the process.
5292 // VmRSS from /proc/pid/status.
5293 optional int32 rss_in_kilobytes = 5;
5294
5295 // The current anon RSS of the process.
5296 // RssAnon from /proc/pid/status.
5297 optional int32 anon_rss_in_kilobytes = 6;
5298
5299 // The current swap size of the process.
5300 // VmSwap from /proc/pid/status.
5301 optional int32 swap_in_kilobytes = 7;
5302
5303 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5304 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5305}
5306
5307/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005308 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005309 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005310message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005311 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005312}
5313
5314/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005315 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005316 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005317message SystemUptime {
5318 // Milliseconds since the system was booted.
5319 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5320 // for external input).
5321 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005322 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005323}
5324
5325/*
5326 * Reads from /proc/uid_concurrent_active_time which has the format:
5327 * active: X (X is # cores)
5328 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5329 * [uid1]: [time-0] [time-1] [time-2] ... ...
5330 * ...
5331 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5332 * The file contains a monotonically increasing count of time for a single boot.
5333 */
5334message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005335 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005336 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005337}
5338
5339/**
5340 * Reads from /proc/uid_concurrent_policy_time which has the format:
5341 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5342 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5343 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5344 * ...
5345 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5346 * The file contains a monotonically increasing count of time for a single boot.
5347 */
5348message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005349 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005350 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005351 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005352}
5353
5354/*
5355 * Pulls free disk space, for data, system partition and temporary directory.
5356 */
5357message DiskSpace {
5358 // available bytes in data partition
5359 optional uint64 data_available_bytes = 1;
5360 // available bytes in system partition
5361 optional uint64 system_available_bytes = 2;
5362 // available bytes in download cache or temp directories
5363 optional uint64 temp_available_bytes = 3;
5364}
Tej Singhbf972d92018-01-10 20:51:13 -08005365
5366/**
5367 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005368 *
5369 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005370 */
5371message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005372 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005373}
5374
5375/**
5376 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005377 * Pulled from:
5378 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005379 */
5380message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005381 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005382}
5383
5384/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005385 * Pulls battery voltage.
5386 * Pulled from:
5387 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5388 */
5389message BatteryVoltage {
5390 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005391 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005392}
5393
5394/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005395 * Pulls battery level (percent full, from 0 to 100).
5396 *
5397 * Pulled from:
5398 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5399 */
5400message BatteryLevel {
5401 // Battery level. Should be in [0, 100].
5402 optional int32 battery_level = 1;
5403}
5404
5405/**
Tej Singhd89137e2018-03-26 14:51:40 -07005406 * Pulls the temperature of various parts of the device.
5407 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005408 *
Maggie White442b6312019-04-05 16:26:44 -07005409 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005410 */
5411message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005412 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005413 optional android.os.TemperatureTypeEnum sensor_location = 1;
5414
5415 // The name of the temperature source. Eg. CPU0
5416 optional string sensor_name = 2;
5417
Tej Singhd89137e2018-03-26 14:51:40 -07005418 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005419 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005420 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005421
5422 // Relative severity of the throttling, see enum definition.
5423 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005424}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005425
5426/**
5427 * Pulls the statistics of calls to Binder.
5428 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005429 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5430 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005431 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005432 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005433 */
5434message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005435 // UID of the process responsible for the binder transaction. It will be set if the process
5436 // executing the binder transaction attribute the transaction to another uid using
5437 // Binder.setThreadWorkSource().
5438 //
5439 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005440 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005441 // UID of the process executing the binder transaction.
5442 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005443 // Fully qualified class name of the API call.
5444 //
5445 // This is a system server class name.
5446 //
5447 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5448 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5449 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5450 // commonly used APIs.
5451 optional string service_class_name = 2;
5452 // Method name of the API call. It can also be a transaction code if we cannot
5453 // resolve it to a name. See Binder#getTransactionName.
5454 //
5455 // This is a system server method name.
5456 optional string service_method_name = 3;
5457 // Total number of API calls.
5458 optional int64 call_count = 4;
5459 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5460 optional bool screen_interactive = 13;
5461 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5462 // call_count will be equal to recorded_call_count.
5463 //
5464 // If recorded_call_count is different than call_count, it means data collection has been
5465 // sampled. All the fields below will be sampled in this case.
5466 optional int64 recorded_call_count = 12;
5467 // Number of exceptions thrown by the API.
5468 optional int64 recorded_exception_count = 5;
5469 // Total latency of all API calls.
5470 // Average can be computed using total_latency_micros / recorded_call_count.
5471 optional int64 recorded_total_latency_micros = 6;
5472 // Maximum latency of one API call.
5473 optional int64 recorded_max_latency_micros = 7;
5474 // Total CPU usage of all API calls.
5475 // Average can be computed using total_cpu_micros / recorded_call_count.
5476 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5477 optional int64 recorded_total_cpu_micros = 8;
5478 // Maximum CPU usage of one API call.
5479 optional int64 recorded_max_cpu_micros = 9;
5480 // Maximum parcel reply size of one API call.
5481 optional int64 recorded_max_reply_size_bytes = 10;
5482 // Maximum parcel request size of one API call.
5483 optional int64 recorded_max_request_size_bytes = 11;
5484}
5485
5486/**
5487 * Pulls the statistics of exceptions during calls to Binder.
5488 *
5489 * Binder stats are cumulative from boot unless somebody reset the data using
5490 * > adb shell dumpsys binder_calls_stats --reset
5491 */
5492message BinderCallsExceptions {
5493 // Exception class name, e.g. java.lang.IllegalArgumentException.
5494 //
5495 // This is an exception class name thrown by the system server.
5496 optional string exception_class_name = 1;
5497 // Total number of exceptions.
5498 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005499}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005500
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005501/**
5502 * Pulls the statistics of message dispatching on HandlerThreads.
5503 *
5504 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5505 * config on the device.
5506 *
5507 * Next tag: 11
5508 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005509message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005510 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005511 optional int32 uid = 1 [(is_uid) = true];
5512
5513 // Fully qualified class name of the handler target class.
5514 //
5515 // This field does not contain PII. This is a system server class name.
5516 optional string handler_class_name = 2;
5517
5518 // The name of the thread that runs the Looper.
5519 //
5520 // This field does not contain PII. This is a system server thread name.
5521 optional string looper_thread_name = 3;
5522
5523 // The name of the dispatched message.
5524 //
5525 // This field does not contain PII. This is a system server constant or class
5526 // name.
5527 optional string message_name = 4;
5528
5529 // Total number of successfully dispatched messages.
5530 optional int64 message_count = 5;
5531
5532 // Total number of messages that failed dispatching.
5533 optional int64 exception_count = 6;
5534
5535 // Total number of processed messages we have data recorded for. If we
5536 // collected data for all the messages, message_count will be equal to
5537 // recorded_message_count.
5538 //
5539 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005540 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005541 optional int64 recorded_message_count = 7;
5542
5543 // Total latency of all processed messages.
5544 // Average can be computed using recorded_total_latency_micros /
5545 // recorded_message_count.
5546 optional int64 recorded_total_latency_micros = 8;
5547
5548 // Total CPU usage of all processed message.
5549 // Average can be computed using recorded_total_cpu_micros /
5550 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005551 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005552 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005553
5554 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5555 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005556
5557 // Max recorded CPU usage of all processed messages.
5558 optional int64 recorded_max_cpu_micros = 11;
5559
5560 // Max recorded latency of all processed messages.
5561 optional int64 recorded_max_latency_micros = 12;
5562
5563 // Total number of messages we tracked the dispatching delay for. If we
5564 // collected data for all the messages, message_count will be equal to
5565 // recorded_delay_message_count.
5566 //
5567 // If recorded_delay_message_count is different than message_count, it means data
5568 // collection has been sampled or/and not all messages specified the target dispatch time.
5569 // The fields below will be sampled in this case.
5570 optional int64 recorded_delay_message_count = 13;
5571
5572 // Total dispatching delay of all processed messages.
5573 // Calculated as a difference between the target dispatching time (Message.when)
5574 // and the actual dispatching time.
5575 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5576 optional int64 recorded_total_delay_millis = 14;
5577
5578 // Max dispatching delay of all processed messages.
5579 // Calculated as a difference between the target dispatching time (Message.when)
5580 // and the actual dispatching time.
5581 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005582}
Tej Singh86dc9db2018-09-06 00:39:57 +00005583
5584/**
5585 * Pulls disk information, such as write speed and latency.
5586 */
5587message DiskStats {
5588 // Time taken to open, write 512B to, and close a file.
5589 // -1 if error performing the check.
5590 optional int64 data_write_latency_millis = 1;
5591
5592 optional bool file_based_encryption = 2;
5593
5594 // Recent disk write speed in kB/s.
5595 // -1 if error querying storageed.
5596 // 0 if data is unavailable.
5597 optional int32 recent_disk_write_speed = 3;
5598}
5599
5600
5601/**
5602 * Free and total bytes of the Data, Cache, and System partition.
5603 */
5604message DirectoryUsage {
5605 enum Directory {
5606 UNKNOWN = 0;
5607 DATA = 1;
5608 CACHE = 2;
5609 SYSTEM = 3;
5610 }
5611 optional Directory directory = 1;
5612 optional int64 free_bytes = 2;
5613 optional int64 total_bytes = 3;
5614}
5615
5616
5617/**
5618 * Size of an application: apk size, data size, and cache size.
5619 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5620 * Information is only reported for apps with the primary user (user 0).
5621 * Sizes are aggregated by package name.
5622 */
5623message AppSize {
5624 // Including uids will involve modifying diskstats logic.
5625 optional string package_name = 1;
5626 // App size in bytes. -1 if unavailable.
5627 optional int64 app_size_bytes = 2;
5628 // App data size in bytes. -1 if unavailable.
5629 optional int64 app_data_size_bytes = 3;
5630 // App cache size in bytes. -1 if unavailable.
5631 optional int64 app_cache_size_bytes = 4;
5632 // Time that the cache file was produced.
5633 // Uses System.currentTimeMillis(), which is wall clock time.
5634 optional int64 cache_time_millis = 5;
5635}
5636
5637
5638/**
5639 * Size of a particular category. Eg: photos, videos.
5640 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5641 */
5642message CategorySize {
5643 enum Category {
5644 UNKNOWN = 0;
5645 APP_SIZE = 1;
5646 APP_DATA_SIZE = 2;
5647 APP_CACHE_SIZE = 3;
5648 PHOTOS = 4;
5649 VIDEOS = 5;
5650 AUDIO = 6;
5651 DOWNLOADS = 7;
5652 SYSTEM = 8;
5653 OTHER = 9;
5654 }
5655 optional Category category = 1;
5656 // Category size in bytes.
5657 optional int64 size_bytes = 2;
5658 // Time that the cache file was produced.
5659 // Uses System.currentTimeMillis(), which is wall clock time.
5660 optional int64 cache_time_millis = 3;
5661}
Tej Singhd6d6d772018-09-05 17:41:25 -07005662
5663/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005664 * Pulls per uid I/O stats. The stats are cumulative since boot.
5665 *
5666 * Read/write bytes are I/O events from a storage device
5667 * Read/write chars are data requested by read/write syscalls, and can be
5668 * satisfied by caching.
5669 *
5670 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5671 */
5672message DiskIo {
5673 optional int32 uid = 1 [(is_uid) = true];
5674 optional int64 fg_chars_read = 2;
5675 optional int64 fg_chars_write = 3;
5676 optional int64 fg_bytes_read = 4;
5677 optional int64 fg_bytes_write = 5;
5678 optional int64 bg_chars_read = 6;
5679 optional int64 bg_chars_write = 7;
5680 optional int64 bg_bytes_read = 8;
5681 optional int64 bg_bytes_write = 9;
5682 optional int64 fg_fsync = 10;
5683 optional int64 bg_fsync= 11;
5684}
5685
5686
5687/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005688 * Pulls the number of fingerprints for each user.
5689 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005690 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005691 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005692message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005693 // The associated user. Eg: 0 for owners, 10+ for others.
5694 // Defined in android/os/UserHandle.java
5695 optional int32 user = 1;
5696 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005697 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005698}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005699
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005700/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005701 * Pulls the number of faces for each user.
5702 *
5703 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5704 */
5705message NumFacesEnrolled {
5706 // The associated user. Eg: 0 for owners, 10+ for others.
5707 // Defined in android/os/UserHandle.java
5708 optional int32 user = 1;
5709 // Number of faces registered to that user.
5710 optional int32 num_faces_enrolled = 2;
5711}
5712/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005713 * A mapping of role holder -> role
5714 */
5715message RoleHolder {
5716 // uid of the role holder
5717 optional int32 uid = 1 [(is_uid) = true];
5718
5719 // package name of the role holder
5720 optional string package_name = 2;
5721
5722 // the role held
5723 optional string role = 3;
5724}
5725
Yangsteraf9aee72018-10-12 09:26:16 -07005726message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005727 // These are all in byte resolution.
5728 optional int64 min = 1 [deprecated = true];
5729 optional int64 average = 2 [deprecated = true];
5730 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005731
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005732 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5733 // int64 fields.
5734 optional int32 mean_kb = 4;
5735 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005736}
5737
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005738// A reduced subset of process states; reducing the number of possible states allows more
5739// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5740enum ProcessStateAggregated {
5741 PROCESS_STATE_UNKNOWN = 0;
5742 // Persistent system process.
5743 PROCESS_STATE_PERSISTENT = 1;
5744 // Top activity; actually any visible activity.
5745 PROCESS_STATE_TOP = 2;
5746 // Process binding to top or a foreground service.
5747 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5748 // Processing running a foreground service.
5749 PROCESS_STATE_FGS = 4;
5750 // Important foreground process (ime, wallpaper, etc).
5751 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5752 // Important background process.
5753 PROCESS_STATE_BACKGROUND = 6;
5754 // Process running a receiver.
5755 PROCESS_STATE_RECEIVER = 7;
5756 // All kinds of cached processes.
5757 PROCESS_STATE_CACHED = 8;
5758}
5759
5760// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005761message ProcessStatsStateProto {
5762 optional android.service.procstats.ScreenState screen_state = 1;
5763
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005764 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005765
5766 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5767 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005768 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5769
5770 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005771
5772 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005773 optional int64 duration_millis = 4 [deprecated = true];
5774 // Same as above, but with minute resolution so it fits into an int32.
5775 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005776
5777 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005778 optional int64 realtime_duration_millis = 9 [deprecated = true];
5779 // Same as above, but with minute resolution so it fits into an int32.
5780 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005781
5782 // # of samples taken
5783 optional int32 sample_size = 5;
5784
5785 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005786 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005787
5788 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005789 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005790
5791 // RSS is memory resident for this process
5792 optional AggStats rss = 8;
5793}
5794
Jing Ji060d6862020-04-13 19:36:31 -07005795// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005796message ProcessStatsProto {
5797 // Name of process.
5798 optional string process = 1;
5799
5800 // Uid of the process.
5801 optional int32 uid = 2;
5802
5803 // Information about how often kills occurred
5804 message Kill {
5805 // Count of excessive CPU kills
5806 optional int32 cpu = 1;
5807
5808 // Count of kills when cached
5809 optional int32 cached = 2;
5810
5811 // PSS stats during cached kill
5812 optional AggStats cached_pss = 3;
5813 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005814 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005815
5816 // Time and memory spent in various states.
5817 repeated ProcessStatsStateProto states = 5;
5818
5819 // Total time process has been running... screen_state, memory_state, and process_state
5820 // will not be set.
5821 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005822
5823 // Association data for this process in this state;
5824 // each entry here is one association.
5825 repeated ProcessStatsAssociationProto assocs = 7;
5826}
5827
5828// Next Tag: 5
5829message ProcessStatsAssociationProto {
5830 // Procss Name of the associated process (client process of service binding)
5831 optional string assoc_process_name = 1;
5832
5833 // Package Name of the associated package (client package of service binding)
5834 optional string assoc_package_name = 2;
5835
5836 // Total count of the times this association (service binding) appeared.
5837 optional int32 total_count = 3;
5838
5839 // Uptime total duration in seconds this association (service binding) was around.
5840 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005841}
5842
5843message PackageServiceOperationStatsProto {
5844 // Operate enum: Started, Foreground, Bound, Executing
5845 optional android.service.procstats.ServiceOperationState operation = 1;
5846
5847 // Number of times the service was in this operation.
5848 optional int32 count = 2;
5849
5850 // Information about a state the service can be in.
5851 message StateStats {
5852 // Screen state enum.
5853 optional android.service.procstats.ScreenState screen_state = 1;
5854 // Memory state enum.
5855 optional android.service.procstats.MemoryState memory_state = 2;
5856
5857 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005858 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005859 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005860 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005861 }
5862 repeated StateStats state_stats = 3;
5863}
5864
5865message PackageServiceStatsProto {
5866 // Name of service component.
5867 optional string service_name = 1;
5868
5869 // The operation stats.
5870 // The package_name, package_uid, package_version, service_name will not be set to save space.
5871 repeated PackageServiceOperationStatsProto operation_stats = 2;
5872}
5873
5874message PackageAssociationSourceProcessStatsProto {
5875 // Uid of the process.
5876 optional int32 process_uid = 1;
5877 // Process name.
5878 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005879 // Package name.
5880 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005881 // Total count of the times this association appeared.
5882 optional int32 total_count = 3;
5883
5884 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005885 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005886
5887 // Total count of the times this association became actively impacting its target process.
5888 optional int32 active_count = 5;
5889
5890 // Information on one source in this association.
5891 message StateStats {
5892 // Process state enum.
5893 optional android.service.procstats.ProcessState process_state = 1;
5894 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005895 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005896 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005897 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005898 }
5899 repeated StateStats active_state_stats = 6;
5900}
5901
5902message PackageAssociationProcessStatsProto {
5903 // Name of the target component.
5904 optional string component_name = 1;
5905 // Information on one source in this association.
5906 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5907}
5908
5909
5910message ProcessStatsPackageProto {
5911 // Name of package.
5912 optional string package = 1;
5913
5914 // Uid of the package.
5915 optional int32 uid = 2;
5916
5917 // Version of the package.
5918 optional int64 version = 3;
5919
5920 // Stats for each process running with the package loaded in to it.
5921 repeated ProcessStatsProto process_stats = 4;
5922
5923 // Stats for each of the package's services.
5924 repeated PackageServiceStatsProto service_stats = 5;
5925
5926 // Stats for each association with the package.
5927 repeated PackageAssociationProcessStatsProto association_stats = 6;
5928}
5929
5930message ProcessStatsSectionProto {
5931 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005932 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005933
5934 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005935 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005936
5937 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005938 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005939
5940 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005941 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005942
5943 // System runtime library. e.g. "libdvm.so", "libart.so".
5944 optional string runtime = 5;
5945
5946 // whether kernel reports swapped pss.
5947 optional bool has_swapped_pss = 6;
5948
5949 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5950 enum Status {
5951 STATUS_UNKNOWN = 0;
5952 STATUS_COMPLETE = 1;
5953 STATUS_PARTIAL = 2;
5954 STATUS_SHUTDOWN = 3;
5955 STATUS_SYSPROPS = 4;
5956 }
5957 repeated Status status = 7;
5958
Chenjie Yub2ecc792019-01-17 10:27:26 -08005959 // Number of pages available of various types and sizes, representation fragmentation.
5960 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5961
Yangsteraf9aee72018-10-12 09:26:16 -07005962 // Stats for each process.
5963 repeated ProcessStatsProto process_stats = 8;
5964
5965 // Stats for each package.
5966 repeated ProcessStatsPackageProto package_stats = 9;
5967}
5968
Chenjie Yub2ecc792019-01-17 10:27:26 -08005969message ProcessStatsAvailablePagesProto {
5970 // Node these pages are in (as per /proc/pagetypeinfo)
5971 optional int32 node = 1;
5972
5973 // Zone these pages are in (as per /proc/pagetypeinfo)
5974 optional string zone = 2;
5975
5976 // Label for the type of these pages (as per /proc/pagetypeinfo)
5977 optional string label = 3;
5978
5979 // Distribution of number of pages available by order size. First entry in array is
5980 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5981 repeated int32 pages_per_order = 4;
5982}
5983
Chenjie Yu12e5e672018-09-14 15:54:59 -07005984/**
5985 * Pulled from ProcessStatsService.java
5986 */
5987message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005988 optional ProcessStatsSectionProto proc_stats_section = 1;
5989}
5990
Chenjie Yuf910b7802019-01-11 16:08:20 -08005991/**
5992 * Pulled from ProcessStatsService.java
5993 */
5994message ProcStatsPkgProc {
5995 optional ProcessStatsSectionProto proc_stats_section = 1;
5996}
5997
Chris Wrencdea3b72019-11-22 16:58:17 -05005998// Next Tag: 2
5999message PackageRemoteViewInfoProto {
6000 optional string package_name = 1;
6001 // add per-package additional info here (like channels)
6002}
6003
6004// Next Tag: 2
6005message NotificationRemoteViewsProto {
6006 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6007}
6008
6009/**
6010 * Pulled from NotificationManagerService.java
6011 */
6012message NotificationRemoteViews {
6013 optional NotificationRemoteViewsProto notification_remote_views = 1;
6014}
6015
Yotam Aron74299972020-01-16 16:20:58 +02006016/**
6017 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6018 */
6019message PackageNotificationPreferences {
6020 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006021 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006022 // Notification importance, which specifies when and how a notification is displayed.
6023 // Specified under core/java/android/app/NotificationManager.java.
6024 optional int32 importance = 2;
6025 // Lockscreen visibility as set by the user.
6026 optional int32 visibility = 3;
6027 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6028 // PreferencesHelper.java)
6029 optional int32 user_locked_fields = 4;
6030}
6031
6032/**
6033 * Atom that contains a list of a package's channel preferences, pulled from
6034 * NotificationManagerService.java.
6035 */
6036message PackageNotificationChannelPreferences {
6037 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006038 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006039 // Channel's ID. Should always be available.
6040 optional string channel_id = 2;
6041 // Channel's name. Should always be available.
6042 optional string channel_name = 3;
6043 // Channel's description. Optionally set by the channel creator.
6044 optional string description = 4;
6045 // Notification importance, which specifies when and how a notification is displayed. Specified
6046 // under core/java/android/app/NotificationManager.java.
6047 optional int32 importance = 5;
6048 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6049 // at core/java/android/app/NotificationChannel.java
6050 optional int32 user_locked_fields = 6;
6051 // Indicates if the channel was deleted by the app.
6052 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006053 // Indicates if the channel was marked as a conversation by the app.
6054 optional bool is_conversation = 8;
6055 // Indicates if the channel is a conversation that was demoted by the user.
6056 optional bool is_demoted_conversation = 9;
6057 // Indicates if the channel is a conversation that was marked as important by the user.
6058 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006059}
6060
6061/**
6062 * Atom that contains a list of a package's channel group preferences, pulled from
6063 * NotificationManagerService.java.
6064 */
6065message PackageNotificationChannelGroupPreferences {
6066 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006067 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006068 // Channel Group's ID. Should always be available.
6069 optional string group_id = 2;
6070 // Channel Group's name. Should always be available.
6071 optional string group_name = 3;
6072 // Channel Group's description. Optionally set by group creator.
6073 optional string description = 4;
6074 // Indicates if notifications from this channel group are blocked.
6075 optional bool is_blocked = 5;
6076 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6077 // at core/java/android/app/NotificationChannelGroup.java
6078 optional int32 user_locked_fields = 6;
6079}
6080
Yangsteraf9aee72018-10-12 09:26:16 -07006081message PowerProfileProto {
6082 optional double cpu_suspend = 1;
6083
6084 optional double cpu_idle = 2;
6085
6086 optional double cpu_active = 3;
6087
6088 message CpuCluster {
6089 optional int32 id = 1;
6090 optional double cluster_power = 2;
6091 optional int32 cores = 3;
6092 repeated int64 speed = 4;
6093 repeated double core_power = 5;
6094 }
6095
6096 repeated CpuCluster cpu_cluster = 40;
6097
6098 optional double wifi_scan = 4;
6099
6100 optional double wifi_on = 5;
6101
6102 optional double wifi_active = 6;
6103
6104 optional double wifi_controller_idle = 7;
6105
6106 optional double wifi_controller_rx = 8;
6107
6108 optional double wifi_controller_tx = 9;
6109
6110 repeated double wifi_controller_tx_levels = 10;
6111
6112 optional double wifi_controller_operating_voltage = 11;
6113
6114 optional double bluetooth_controller_idle = 12;
6115
6116 optional double bluetooth_controller_rx = 13;
6117
6118 optional double bluetooth_controller_tx = 14;
6119
6120 optional double bluetooth_controller_operating_voltage = 15;
6121
6122 optional double modem_controller_sleep = 16;
6123
6124 optional double modem_controller_idle = 17;
6125
6126 optional double modem_controller_rx = 18;
6127
6128 repeated double modem_controller_tx = 19;
6129
6130 optional double modem_controller_operating_voltage = 20;
6131
6132 optional double gps_on = 21;
6133
6134 repeated double gps_signal_quality_based = 22;
6135
6136 optional double gps_operating_voltage = 23;
6137
6138 optional double bluetooth_on = 24;
6139
6140 optional double bluetooth_active = 25;
6141
6142 optional double bluetooth_at_cmd = 26;
6143
6144 optional double ambient_display = 27;
6145
6146 optional double screen_on = 28;
6147
6148 optional double radio_on = 29;
6149
6150 optional double radio_scanning = 30;
6151
6152 optional double radio_active = 31;
6153
6154 optional double screen_full = 32;
6155
6156 optional double audio = 33;
6157
6158 optional double video = 34;
6159
6160 optional double flashlight = 35;
6161
6162 optional double memory = 36;
6163
6164 optional double camera = 37;
6165
6166 optional double wifi_batched_scan = 38;
6167
6168 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006169}
Chenjie Yuab530202018-09-26 12:39:20 -07006170
6171/**
6172 * power_profile.xml and other constants for power model calculations.
6173 * Pulled from PowerProfile.java
6174 */
6175message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006176 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006177}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006178
6179/**
arangelovd5db50e2018-10-12 20:24:39 +01006180 * Logs when a user restriction was added or removed.
6181 *
6182 * Logged from:
6183 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6184 */
6185message UserRestrictionChanged {
6186 // The raw string of the user restriction as defined in UserManager.
6187 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6188 optional string restriction = 1;
6189 // Whether the restriction is enabled or disabled.
6190 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006191}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006192
6193/**
6194 * Pulls process user time and system time. Puller takes a snapshot of all pids
6195 * in the system and returns cpu stats for those that are working at the time.
6196 * Dead pids will be dropped. Kernel processes are excluded.
6197 * Min cool-down is 5 sec.
6198 */
6199message ProcessCpuTime {
6200 optional int32 uid = 1 [(is_uid) = true];
6201
6202 optional string process_name = 2;
6203 // Process cpu time in user space, cumulative from boot/process start
6204 optional int64 user_time_millis = 3;
6205 // Process cpu time in system space, cumulative from boot/process start
6206 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006207}
Misha Wagner5a51e002018-10-03 15:04:09 +01006208
6209/**
6210 * Pulls the CPU usage for each thread.
6211 *
6212 * Read from /proc/$PID/task/$TID/time_in_state files.
6213 *
6214 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6215 * time_in_state files not being present on some phones, have not been addressed. These should be
6216 * considered before a public release.
6217 */
6218message CpuTimePerThreadFreq {
6219 // UID that owns the process.
6220 optional int32 uid = 1 [(is_uid) = true];
6221 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006222 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006223 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006224 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006225 // Name of the process taken from `/proc/$PID/cmdline`.
6226 optional string process_name = 4;
6227 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6228 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006229
6230 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6231 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6232 // frequencies are given here as the alternative is sending eight separate atoms. This method
6233 // significantly reduces the amount of data created
6234 optional int32 frequency1_khz = 6;
6235 optional int32 time1_millis = 7;
6236 optional int32 frequency2_khz = 8;
6237 optional int32 time2_millis = 9;
6238 optional int32 frequency3_khz = 10;
6239 optional int32 time3_millis = 11;
6240 optional int32 frequency4_khz = 12;
6241 optional int32 time4_millis = 13;
6242 optional int32 frequency5_khz = 14;
6243 optional int32 time5_millis = 15;
6244 optional int32 frequency6_khz = 16;
6245 optional int32 time6_millis = 17;
6246 optional int32 frequency7_khz = 18;
6247 optional int32 time7_millis = 19;
6248 optional int32 frequency8_khz = 20;
6249 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006250}
Bookatz75ee60422018-11-09 12:27:37 -08006251
6252/**
Bookatz366a4432018-11-20 09:42:33 -08006253 * Pulls information about the device's build.
6254 */
6255message BuildInformation {
6256 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6257 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6258 optional string fingerprint = 1;
6259
6260 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6261 optional string brand = 2;
6262
6263 // Build.PRODUCT. The name of the overall product.
6264 optional string product = 3;
6265
6266 // Build.DEVICE. The name of the industrial design.
6267 optional string device = 4;
6268
6269 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6270 optional string version_release = 5;
6271
6272 // Build.ID. E.g. a label like "M4-rc20".
6273 optional string id = 6;
6274
6275 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6276 // represent this build.
6277 optional string version_incremental = 7;
6278
6279 // Build.TYPE. The type of build, like "user" or "eng".
6280 optional string type = 8;
6281
6282 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6283 optional string tags = 9;
6284}
6285
6286/**
Adam He420947c2019-01-23 15:59:09 -08006287 * Logs information about mismatched caller for content capture.
6288 *
6289 * Logged from:
6290 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6291 */
6292message ContentCaptureCallerMismatchReported {
6293 optional string intended_package = 1;
6294 optional string calling_package = 2;
6295}
6296
6297/**
6298 * Logs information about content capture service events.
6299 *
6300 * Logged from:
6301 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6302 */
6303message ContentCaptureServiceEvents {
6304 // The type of event.
6305 enum Event {
6306 UNKNOWN = 0;
6307 ON_CONNECTED = 1;
6308 ON_DISCONNECTED = 2;
6309 SET_WHITELIST = 3;
6310 SET_DISABLED = 4;
6311 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006312 ON_DATA_SHARE_REQUEST = 6;
6313 ACCEPT_DATA_SHARE_REQUEST = 7;
6314 REJECT_DATA_SHARE_REQUEST = 8;
6315 DATA_SHARE_WRITE_FINISHED = 9;
6316 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6317 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6318 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6319 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6320 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6321 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006322 }
6323 optional Event event = 1;
6324 // component/package of content capture service.
6325 optional string service_info = 2;
6326 // component/package of target.
6327 // it's a concatenated list of component/package for SET_WHITELIST event
6328 // separated by " ".
6329 optional string target_info = 3;
6330}
6331
6332/**
6333 * Logs information about content capture session events.
6334 *
6335 * Logged from:
6336 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6337 */
6338message ContentCaptureSessionEvents {
6339 // The type of event.
6340 enum Event {
6341 UNKNOWN = 0;
6342 ON_SESSION_STARTED = 1;
6343 ON_SESSION_FINISHED = 2;
6344 SESSION_NOT_CREATED = 3;
6345 }
6346 optional int32 session_id = 1;
6347 optional Event event = 2;
6348 // (n/a on session finished)
6349 optional int32 state_flags = 3;
6350 // component/package of content capture service.
6351 optional string service_info = 4;
6352 // component/package of app.
6353 // (n/a on session finished)
6354 optional string app_info = 5;
6355 optional bool is_child_session = 6;
6356}
6357
6358/**
6359 * Logs information about session being flushed.
6360 *
6361 * Logged from:
6362 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6363 */
6364message ContentCaptureFlushed {
6365 optional int32 session_id = 1;
6366 // component/package of content capture service.
6367 optional string service_info = 2;
6368 // component/package of app.
6369 optional string app_info = 3;
6370 // session start/finish events
6371 optional int32 child_session_started = 4;
6372 optional int32 child_session_finished = 5;
6373 // count of view events.
6374 optional int32 view_appeared_count = 6;
6375 optional int32 view_disappeared_count = 7;
6376 optional int32 view_text_changed_count = 8;
6377
6378 // Flush stats.
6379 optional int32 max_events = 9;
6380 optional int32 idle_flush_freq = 10;
6381 optional int32 text_flush_freq = 11;
6382 optional int32 flush_reason = 12;
6383}
6384
6385/**
Bookatz75ee60422018-11-09 12:27:37 -08006386 * Pulls on-device BatteryStats power use calculations for the overall device.
6387 */
6388message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006389 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6390 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6391 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6392 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006393}
6394
6395/**
6396 * Pulls on-device BatteryStats power use calculations broken down by uid.
6397 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6398 * that is attributed to non-uid items. They must all be included to get the total power use.
6399 */
6400message DeviceCalculatedPowerBlameUid {
6401 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6402 optional int32 uid = 1 [(is_uid) = true];
6403
Bookatz3dbc13a2018-12-21 12:16:51 -08006404 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6405 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6406 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006407}
6408
6409/**
6410 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6411 * drain type.
6412 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6413 * is attributed uids. They must all be included to get the total power use.
6414 */
6415message DeviceCalculatedPowerBlameOther {
6416 // The type of item whose power use is being reported.
6417 enum DrainType {
6418 AMBIENT_DISPLAY = 0;
6419 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6420 BLUETOOTH = 2;
6421 CAMERA = 3;
6422 // Cell-standby
6423 CELL = 4;
6424 FLASHLIGHT = 5;
6425 IDLE = 6;
6426 MEMORY = 7;
6427 // Amount that total computed drain exceeded the drain estimated using the
6428 // battery level changes and capacity.
6429 OVERCOUNTED = 8;
6430 PHONE = 9;
6431 SCREEN = 10;
6432 // Amount that total computed drain was below the drain estimated using the
6433 // battery level changes and capacity.
6434 UNACCOUNTED = 11;
6435 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6436 WIFI = 13;
6437 }
6438 optional DrainType drain_type = 1;
6439
Bookatz3dbc13a2018-12-21 12:16:51 -08006440 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6441 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6442 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006443}
arangelov4e994062018-11-13 16:12:38 +00006444
6445/**
6446 * Logs device policy features.
6447 *
6448 * Logged from:
6449 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6450 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6451 */
6452message DevicePolicyEvent {
6453 // The event id - unique for each event.
6454 optional android.stats.devicepolicy.EventId event_id = 1;
6455 // The admin package name.
6456 optional string admin_package_name = 2;
6457 // A generic integer parameter.
6458 optional int32 integer_value = 3;
6459 // A generic boolean parameter.
6460 optional bool boolean_value = 4;
6461 // A parameter specifying a time period in milliseconds.
6462 optional uint64 time_period_millis = 5;
6463 // A parameter specifying a list of package names, bundle extras or string parameters.
6464 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6465}
shawnlinea5b66b2018-11-13 15:05:29 +08006466
6467/**
6468 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6469 *
6470 * Logged from:
6471 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6472 */
6473message DocsUILaunchReported {
6474 optional android.stats.docsui.LaunchAction launch_action = 1;
6475 optional bool has_initial_uri = 2;
6476 optional android.stats.docsui.MimeType mime_type = 3;
6477 optional android.stats.docsui.Root initial_root = 4;
6478}
6479
6480/**
6481 * Logs root/app visited event in file managers/picker. Call this when the user
6482 * taps on root/app in hamburger menu.
6483 *
6484 * Logged from:
6485 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6486 */
6487message DocsUIRootVisitedReported {
6488 optional android.stats.docsui.ContextScope scope = 1;
6489 optional android.stats.docsui.Root root = 2;
6490}
6491
6492/**
6493 * Logs file operation stats. Call this when a file operation has completed.
6494 *
6495 * Logged from:
6496 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6497 */
6498message DocsUIFileOperationReported {
6499 optional android.stats.docsui.Provider provider = 1;
6500 optional android.stats.docsui.FileOperation file_op = 2;
6501}
6502
6503/**
6504 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6505 * mode.
6506 *
6507 * Logged from:
6508 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6509 */
6510message DocsUIFileOperationCopyMoveModeReported {
6511 optional android.stats.docsui.FileOperation file_op = 1;
6512 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6513}
6514
6515
6516/**
6517 * Logs file sub operation stats. Call this when a file operation has failed.
6518 *
6519 * Logged from:
6520 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6521 */
6522message DocsUIFileOperationFailureReported {
6523 optional android.stats.docsui.Authority authority = 1;
6524 optional android.stats.docsui.SubFileOperation sub_op = 2;
6525}
6526
6527/**
6528* Logs the cancellation of a file operation. Call this when a job is canceled
6529*
6530* Logged from:
6531* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6532*/
6533message DocsUIFileOperationCanceledReported {
6534 optional android.stats.docsui.FileOperation file_op = 1;
6535}
6536
6537/**
6538 * Logs startup time in milliseconds.
6539 *
6540 * Logged from:
6541 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6542 */
6543message DocsUIStartupMsReported {
6544 optional int32 startup_millis = 1;
6545}
6546
6547/**
6548 * Logs the action that was started by user.
6549 *
6550 * Logged from:
6551 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6552 */
6553message DocsUIUserActionReported {
6554 optional android.stats.docsui.UserAction action = 1;
6555}
6556
6557/**
6558 * Logs the invalid type when invalid scoped access is requested.
6559 *
6560 * Logged from:
6561 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6562 */
6563message DocsUIInvalidScopedAccessRequestReported {
6564 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006565}
Ben Murdochbab399f62018-12-06 11:01:38 +00006566
6567/**
shawnlina75e82d2019-01-07 10:31:12 +08006568 * Logs the package name that launches docsui picker mode.
6569 *
6570 * Logged from:
6571 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6572 */
6573message DocsUIPickerLaunchedFromReported {
6574 optional string package_name = 1;
6575}
6576
6577/**
6578 * Logs the search type.
6579 *
6580 * Logged from:
6581 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6582 */
6583message DocsUISearchTypeReported {
6584 optional android.stats.docsui.SearchType search_type = 1;
6585}
6586
6587/**
6588 * Logs the search mode.
6589 *
6590 * Logged from:
6591 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6592 */
6593message DocsUISearchModeReported {
6594 optional android.stats.docsui.SearchMode search_mode = 1;
6595}
6596
6597/**
6598 * Logs the pick result information.
6599 *
6600 * Logged from:
6601 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6602 */
6603message DocsUIPickResultReported {
6604 optional int32 total_action_count = 1;
6605 optional int64 duration_millis = 2;
6606 optional int32 file_count= 3;
6607 optional bool is_searching = 4;
6608 optional android.stats.docsui.Root picked_from = 5;
6609 optional android.stats.docsui.MimeType mime_type = 6;
6610 optional int32 repeatedly_pick_times = 7;
6611}
6612
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006613/** Logs the drag and drop of files.
6614
6615 * Logged from:
6616 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6617 */
6618message DocsUIDragAndDropReported {
6619 optional bool drag_initiated_from_docsui = 1;
6620}
6621
shawnlina75e82d2019-01-07 10:31:12 +08006622/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006623 * Logs when an app's memory is compacted.
6624 *
6625 * Logged from:
6626 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6627 */
6628message AppCompacted {
6629 // The pid of the process being compacted.
6630 optional int32 pid = 1;
6631
6632 // The name of the process being compacted.
6633 optional string process_name = 2;
6634
6635 // The type of compaction.
6636 enum Action {
6637 UNKNOWN = 0;
6638 SOME = 1;
6639 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006640 PERSISTENT = 3;
6641 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006642 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006643 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006644
6645 // Total RSS in kilobytes consumed by the process prior to compaction.
6646 optional int64 before_rss_total_kilobytes = 4;
6647
6648 // File RSS in kilobytes consumed by the process prior to compaction.
6649 optional int64 before_rss_file_kilobytes = 5;
6650
6651 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6652 optional int64 before_rss_anon_kilobytes = 6;
6653
6654 // Swap in kilobytes consumed by the process prior to compaction.
6655 optional int64 before_swap_kilobytes = 7;
6656
6657 // Total RSS in kilobytes consumed by the process after compaction.
6658 optional int64 after_rss_total_kilobytes = 8;
6659
6660 // File RSS in kilobytes consumed by the process after compaction.
6661 optional int64 after_rss_file_kilobytes = 9;
6662
6663 // Anonymous RSS in kilobytes consumed by the process after compaction.
6664 optional int64 after_rss_anon_kilobytes = 10;
6665
6666 // Swap in kilobytes consumed by the process after compaction.
6667 optional int64 after_swap_kilobytes = 11;
6668
6669 // The time taken to perform compaction in milliseconds.
6670 optional int64 time_to_compact_millis = 12;
6671
6672 // The last compaction action performed for this app.
6673 optional Action last_action = 13;
6674
Ben Murdoch01720b82018-12-19 18:03:44 +00006675 // The last time that compaction was attempted on this process in milliseconds
6676 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6677 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006678
Ben Murdoch885c21b2019-03-15 18:02:04 +00006679 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006680 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006681
6682 // The process state at the time of compaction.
6683 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006684
6685 // Free ZRAM in kilobytes before compaction.
6686 optional int64 before_zram_free_kilobytes = 17;
6687
6688 // Free ZRAM in kilobytes after compaction.
6689 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006690}
lifr157fc552018-12-12 16:38:04 +08006691
6692/**
lifrb6b90b62019-03-29 00:40:17 +08006693 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6694 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6695 *
lifr1f74b052019-04-16 22:16:30 +08006696 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6697 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6698 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6699 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006700 */
6701message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006702 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006703
lifr1f74b052019-04-16 22:16:30 +08006704 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006705
6706 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006707 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006708
lifr1f74b052019-04-16 22:16:30 +08006709 // Only valid for event_type = EVENT_GETADDRINFO.
6710 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006711
lifr1f74b052019-04-16 22:16:30 +08006712 // Flags passed to android_res_nsend() defined in multinetwork.h
6713 // Only valid for event_type = EVENT_RESNSEND.
6714 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006715
lifrad9becc2019-05-20 11:04:41 +08006716 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006717
6718 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006719 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006720
6721 // Additional pass-through fields opaque to statsd.
6722 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006723 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006724
6725 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6726 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006727}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006728
6729/**
6730 * Logs when a data stall event occurs.
6731 *
6732 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006733 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006734 */
6735message DataStallEvent {
6736 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006737 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006738 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6739 optional int32 evaluation_type = 1;
6740 // See definition in data_stall_event.proto.
6741 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6742 // See definition in data_stall_event.proto.
6743 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6744 // See definition in data_stall_event.proto.
6745 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6746 // See definition in data_stall_event.proto.
6747 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6748 // See definition in data_stall_event.proto.
6749 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006750 // The tcp packets fail rate from the latest tcp polling.
6751 optional int32 tcp_fail_rate = 7;
6752 // Number of packets sent since the last received packet.
6753 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006754}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006755
6756/*
6757 * Logs when RescueParty resets some set of experiment flags.
6758 *
6759 * Logged from:
6760 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6761 */
6762message RescuePartyResetReported {
6763 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6764 optional int32 rescue_level = 1;
6765}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006766
6767/**
6768 * Logs when signed config is received from an APK, and if that config was applied successfully.
6769 * Logged from:
6770 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6771 */
6772message SignedConfigReported {
6773 enum Type {
6774 UNKNOWN_TYPE = 0;
6775 GLOBAL_SETTINGS = 1;
6776 }
6777 optional Type type = 1;
6778
6779 // The final status of the signed config received.
6780 enum Status {
6781 UNKNOWN_STATUS = 0;
6782 APPLIED = 1;
6783 BASE64_FAILURE_CONFIG = 2;
6784 BASE64_FAILURE_SIGNATURE = 3;
6785 SECURITY_EXCEPTION = 4;
6786 INVALID_CONFIG = 5;
6787 OLD_CONFIG = 6;
6788 SIGNATURE_CHECK_FAILED = 7;
6789 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006790 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006791 }
6792 optional Status status = 2;
6793
6794 // The version of the signed config processed.
6795 optional int32 version = 3;
6796
6797 // The package name that the config was extracted from.
6798 optional string from_package = 4;
6799
6800 enum Key {
6801 NO_KEY = 0;
6802 DEBUG = 1;
6803 PRODUCTION = 2;
6804 }
6805 // Which key was used to verify the config.
6806 optional Key verified_with = 5;
6807}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006808
6809/*
6810 * Logs GNSS Network-Initiated (NI) location events.
6811 *
6812 * Logged from:
6813 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6814 */
6815message GnssNiEventReported {
6816 // The type of GnssNiEvent.
6817 enum EventType {
6818 UNKNOWN = 0;
6819 NI_REQUEST = 1;
6820 NI_RESPONSE = 2;
6821 }
6822 optional EventType event_type = 1;
6823
6824 // An ID generated by HAL to associate NI notifications and UI responses.
6825 optional int32 notification_id = 2;
6826
6827 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006828 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006829
6830 // NI requires notification.
6831 optional bool need_notify = 4;
6832
6833 // NI requires verification.
6834 optional bool need_verify = 5;
6835
6836 // NI requires privacy override, no notification/minimal trace.
6837 optional bool privacy_override = 6;
6838
6839 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6840 // seconds.
6841 optional int32 timeout = 7;
6842
6843 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006844 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006845
6846 // String representing the requester of the network inititated location request.
6847 optional string requestor_id = 9;
6848
6849 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6850 // network initiated location request.
6851 optional string text = 10;
6852
6853 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006854 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006855
6856 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006857 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006858
6859 // True if SUPL ES is enabled.
6860 optional bool is_supl_es_enabled = 13;
6861
6862 // True if GNSS location is enabled.
6863 optional bool is_location_enabled = 14;
6864
6865 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006866 optional android.server.location.GnssUserResponseType user_response = 15;
6867}
6868
6869/**
6870 * Logs GNSS non-framework (NFW) location notification.
6871 *
6872 * Logged from:
6873 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6874 */
6875message GnssNfwNotificationReported {
6876 // Package name of the Android proxy application representing the non-framework entity that
6877 // requested location. Set to empty string if unknown.
6878 optional string proxy_app_package_name = 1;
6879
6880 // Protocol stack that initiated the non-framework location request.
6881 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6882
6883 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6884 // set to empty string. This field is opaque to the framework and used for logging purposes.
6885 optional string other_protocol_stack_name = 3;
6886
6887 // Source initiating/receiving the location information.
6888 optional android.server.location.NfwRequestor requestor = 4;
6889
6890 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6891 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6892 // and used for logging purposes.
6893 optional string requestor_id = 5;
6894
6895 // Indicates whether location information was provided for this request.
6896 optional android.server.location.NfwResponseType response_type = 6;
6897
6898 // True if the device is in user initiated emergency session.
6899 optional bool in_emergency_mode = 7;
6900
6901 // True if cached location is provided.
6902 optional bool is_cached_location = 8;
6903
6904 // True if proxy app permission mismatch between framework and GNSS HAL.
6905 optional bool is_permission_mismatched = 9;
6906}
6907
6908/**
6909 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6910 *
6911 * Logged from:
6912 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6913 */
6914message GnssConfigurationReported {
6915 // SUPL host name.
6916 optional string supl_host = 1;
6917
6918 // SUPL port number.
6919 optional int32 supl_port = 2;
6920
6921 // C2K host name.
6922 optional string c2k_host = 3;
6923
6924 // C2K port number.
6925 optional int32 c2k_port = 4;
6926
6927 // The SUPL version requested by Carrier.
6928 optional int32 supl_ver = 5;
6929
6930 // The SUPL mode.
6931 optional android.server.location.SuplMode supl_mode = 6;
6932
6933 // True if NI emergency SUPL restrictions is enabled.
6934 optional bool supl_es = 7;
6935
6936 // LTE Positioning Profile settings
6937 optional android.server.location.LppProfile lpp_profile = 8;
6938
6939 // Positioning protocol on A-Glonass system.
6940 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6941
6942 // True if emergency PDN is used. Otherwise, regular PDN is used.
6943 optional bool use_emergency_pdn_for_emergency_supl= 10;
6944
6945 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6946 optional android.server.location.GpsLock gps_lock = 11;
6947
6948 // Number of seconds to extend the emergency session duration post emergency call.
6949 optional int32 es_extension_sec = 12;
6950
6951 // The full list of package names of proxy Android applications representing the non-framework
6952 // location access entities (on/off the device) for which the framework user has granted
6953 // non-framework location access permission. The package names are concatenated in one string
6954 // with spaces as separators.
6955 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006956}
Jack Yu95b64f32018-12-13 18:26:11 +08006957
6958/**
6959 * Logs when a NFC device's error occurred.
6960 * Logged from:
6961 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6962 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6963 */
6964message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006965 enum Type {
6966 UNKNOWN = 0;
6967 CMD_TIMEOUT = 1;
6968 ERROR_NOTIFICATION = 2;
6969 AID_OVERFLOW = 3;
6970 }
6971 optional Type type = 1;
6972 // If it's nci cmd timeout, log the timeout command.
6973 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006974
Alex Salod7c3eef2019-01-25 14:43:27 -08006975 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006976}
6977
6978/**
6979 * Logs when a NFC device's state changed event
6980 * Logged from:
6981 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6982 */
6983message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006984 enum State {
6985 UNKNOWN = 0;
6986 OFF = 1;
6987 ON = 2;
6988 ON_LOCKED = 3; // Secure Nfc enabled.
6989 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6990 }
6991 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006992}
6993
6994/**
6995 * Logs when a NFC Beam Transaction occurred.
6996 * Logged from:
6997 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6998 */
6999message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007000 enum Operation {
7001 UNKNOWN = 0;
7002 SEND = 1;
7003 RECEIVE = 2;
7004 }
7005 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007006}
7007
7008/**
7009 * Logs when a NFC Card Emulation Transaction occurred.
7010 * Logged from:
7011 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7012 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7013 */
7014message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007015 enum Category {
7016 UNKNOWN = 0;
7017 HCE_PAYMENT = 1;
7018 HCE_OTHER = 2;
7019 OFFHOST = 3;
7020 }
7021 // Transaction belongs to HCE payment or HCE other category, or offhost.
7022 optional Category category = 1;
7023 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7024 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007025}
7026
7027/**
7028 * Logs when a NFC Tag event occurred.
7029 * Logged from:
7030 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7031 */
7032message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007033 enum Type {
7034 UNKNOWN = 0;
7035 URL = 1;
7036 BT_PAIRING = 2;
7037 PROVISION = 3;
7038 WIFI_CONNECT = 4;
7039 APP_LAUNCH = 5;
7040 OTHERS = 6;
7041 }
7042 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007043}
7044
7045/**
7046 * Logs when Hce transaction triggered
7047 * Logged from:
7048 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7049 */
7050message NfcHceTransactionOccurred {
7051 // The latency period(in microseconds) it took for the first HCE data
7052 // exchange.
7053 optional uint32 latency_micros = 1;
7054}
7055
7056/**
7057 * Logs when SecureElement state event changed
7058 * Logged from:
7059 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7060 */
7061message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007062 enum State {
7063 UNKNOWN = 0;
7064 INITIALIZED = 1;
7065 DISCONNECTED = 2;
7066 CONNECTED = 3;
7067 HALCRASH = 4;
7068 }
7069 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007070
Alex Salod7c3eef2019-01-25 14:43:27 -08007071 optional string state_change_reason = 2;
7072 // SIMx or eSEx.
7073 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007074}
7075
7076/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007077 * Information about a permission grant request
7078 */
7079message PermissionGrantRequestResultReported {
7080 // unique value identifying an API call. A API call might result in multiple of these atoms
7081 optional int64 request_id = 1;
7082
7083 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007084 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007085
7086 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007087 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007088
7089 // The permission to be granted
7090 optional string permission_name = 4;
7091
7092 // If the permission was explicitly requested via the API or added by the system
7093 optional bool is_implicit = 5;
7094
7095 enum Result {
7096 UNDEFINED = 0;
7097 // permission request was ignored
7098 IGNORED = 1;
7099 // permission request was ignored because it was user fixed
7100 IGNORED_USER_FIXED = 2;
7101 // permission request was ignored because it was policy fixed
7102 IGNORED_POLICY_FIXED = 3;
7103 // permission was granted by user action
7104 USER_GRANTED = 4;
7105 // permission was automatically granted
7106 AUTO_GRANTED = 5;
7107 // permission was denied by user action
7108 USER_DENIED = 6;
7109 // permission was denied with prejudice by the user
7110 USER_DENIED_WITH_PREJUDICE = 7;
7111 // permission was automatically denied
7112 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007113 // permission request was ignored because permission is restricted
7114 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007115 // one time permission was granted by user action
7116 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007117 // user ignored request by leaving the request screen without choosing any option
7118 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007119 // user granted the permission after being linked to settings
7120 USER_GRANTED_IN_SETTINGS = 12;
7121 // user denied the permission after being linked to settings
7122 USER_DENIED_IN_SETTINGS = 13;
7123 // user denied the permission with prejudice after being linked to settings
7124 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7125 // permission was automatically revoked after one-time permission expired
7126 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007127 // permission was automatically revoked for unused app
7128 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007129 }
7130 // The result of the permission grant
7131 optional Result result = 6;
7132}
7133
7134/**
Jack Yu95b64f32018-12-13 18:26:11 +08007135 * Logs when Omapi API used
7136 * Logged from:
7137 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7138 */
7139message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007140 enum Operation {
7141 UNKNOWN = 0;
7142 OPEN_CHANNEL = 1;
7143 }
7144 optional Operation operation = 1;
7145 // SIMx or eSEx.
7146 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007147
Alex Salod7c3eef2019-01-25 14:43:27 -08007148 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007149}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007150
7151/**
Alex Saloa060aee2019-01-21 14:36:41 -08007152 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7153 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007154 * Logged from:
7155 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7156 */
7157message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007158 optional int64 dispatch_latency_millis = 1;
7159}
7160
7161/**
7162 * Logs AttentionManagerService attention check result.
7163 *
7164 * Logged from:
7165 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7166 */
7167message AttentionManagerServiceResultReported {
7168 // See core/java/android/service/attention/AttentionService.java
7169 enum AttentionCheckResult {
7170 UNKNOWN = 20;
7171 ATTENTION_SUCCESS_ABSENT = 0;
7172 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007173 ATTENTION_FAILURE_UNKNOWN = 2;
7174 ATTENTION_FAILURE_CANCELLED = 3;
7175 ATTENTION_FAILURE_PREEMPTED = 4;
7176 ATTENTION_FAILURE_TIMED_OUT = 5;
7177 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007178 }
7179 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007180}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007181
7182/**
7183 * Logs when an adb connection changes state.
7184 *
7185 * Logged from:
7186 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7187 */
7188message AdbConnectionChanged {
7189 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7190 // previously selected for this system.
7191 optional int64 last_connection_time_millis = 1;
7192
7193 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7194 // to reconnect via adb without user interaction.
7195 optional int64 auth_window_millis = 2;
7196
7197 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7198 optional android.debug.AdbConnectionStateEnum state = 3;
7199
7200 // True if the 'always allow' option was selected for this system.
7201 optional bool always_allow = 4;
7202}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007203
7204/*
7205 * Logs the reported speech DSP status.
7206 *
7207 * Logged from:
7208 * Vendor audio implementation.
7209 */
7210message SpeechDspStatReported {
7211 // The total Speech DSP uptime in milliseconds.
7212 optional int32 total_uptime_millis = 1;
7213 // The total Speech DSP downtime in milliseconds.
7214 optional int32 total_downtime_millis = 2;
7215 optional int32 total_crash_count = 3;
7216 optional int32 total_recover_count = 4;
7217}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007218
7219/**
7220 * Logs USB connector contaminant status.
7221 *
7222 * Logged from: USB Service.
7223 */
7224message UsbContaminantReported {
7225 optional string id = 1;
7226 optional android.service.usb.ContaminantPresenceStatus status = 2;
7227}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007228
7229/**
7230 * This atom is for debugging purpose.
7231 */
7232message DebugElapsedClock {
7233 // Monotically increasing value for each pull.
7234 optional int64 pull_count = 1;
7235 // Time from System.elapsedRealtime.
7236 optional int64 elapsed_clock_millis = 2;
7237 // Time from System.elapsedRealtime.
7238 optional int64 same_elapsed_clock_millis = 3;
7239 // Diff between current elapsed time and elapsed time from previous pull.
7240 optional int64 elapsed_clock_diff_millis = 4;
7241
7242 enum Type {
7243 TYPE_UNKNOWN = 0;
7244 ALWAYS_PRESENT = 1;
7245 PRESENT_ON_ODD_PULLS = 2;
7246 }
7247 // Type of behavior for the pulled data.
7248 optional Type type = 5;
7249}
7250
7251/**
7252 * This atom is for debugging purpose.
7253 */
7254message DebugFailingElapsedClock {
7255 // Monotically increasing value for each pull.
7256 optional int64 pull_count = 1;
7257 // Time from System.elapsedRealtime.
7258 optional int64 elapsed_clock_millis = 2;
7259 // Time from System.elapsedRealtime.
7260 optional int64 same_elapsed_clock_millis = 3;
7261 // Diff between current elapsed time and elapsed time from previous pull.
7262 optional int64 elapsed_clock_diff_millis = 4;
7263}
Steven Wuacef6bb2019-01-23 14:21:17 -05007264
7265/** Logs System UI bubbles event changed.
7266 *
7267 * Logged from:
7268 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7269 */
7270message BubbleUIChanged {
7271
7272 // The app package that is posting the bubble.
7273 optional string package_name = 1;
7274
7275 // The notification channel that is posting the bubble.
7276 optional string notification_channel = 2;
7277
7278 // The notification id associated with the posted bubble.
7279 optional int32 notification_id = 3;
7280
7281 // The position of the bubble within the bubble stack.
7282 optional int32 position = 4;
7283
7284 // The total number of bubbles within the bubble stack.
7285 optional int32 total_number = 5;
7286
7287 // User interactions with the bubble.
7288 enum Action {
7289 UNKNOWN = 0;
7290 POSTED = 1;
7291 UPDATED = 2;
7292 EXPANDED = 3;
7293 COLLAPSED = 4;
7294 DISMISSED = 5;
7295 STACK_DISMISSED = 6;
7296 STACK_MOVED = 7;
7297 HEADER_GO_TO_APP = 8;
7298 HEADER_GO_TO_SETTINGS = 9;
7299 PERMISSION_OPT_IN = 10;
7300 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007301 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007302 SWIPE_LEFT = 13;
7303 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007304 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007305 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007306 }
7307 optional Action action = 6;
7308
7309 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7310 optional float normalized_x_position = 7;
7311 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007312
7313 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7314 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007315
7316 // Whether the bubble is an on-going one.
7317 optional bool is_ongoing = 10;
7318
7319 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007320 // This is deprecated and the value should be ignored.
7321 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007322}
Kweku Adams8845d012018-12-11 20:06:45 -08007323
7324/**
Steven Wu552f63f2019-02-05 13:41:36 -05007325 * Logs System UI bubbles developer errors.
7326 *
7327 * Logged from:
7328 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7329 */
7330message BubbleDeveloperErrorReported {
7331
7332 // The app package that is posting the bubble.
7333 optional string package_name = 1;
7334
7335 // Bubble developer error type enums.
7336 enum Error {
7337 UNKNOWN = 0;
7338 ACTIVITY_INFO_MISSING = 1;
7339 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7340 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7341 }
7342 optional Error error = 2 [default = UNKNOWN];
7343}
7344
7345/**
Kweku Adams8845d012018-12-11 20:06:45 -08007346 * Logs that a constraint for a scheduled job has changed.
7347 *
7348 * Logged from:
7349 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7350 */
7351message ScheduledJobConstraintChanged {
7352 repeated AttributionNode attribution_node = 1;
7353
7354 // Name of the job.
7355 optional string job_name = 2;
7356
7357 optional com.android.server.job.ConstraintEnum constraint = 3;
7358
7359 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007360 UNKNOWN = 0;
7361 UNSATISFIED = 1;
7362 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007363 }
7364 optional State state = 4;
7365}
Alex Salod7c3eef2019-01-25 14:43:27 -08007366
7367/**
7368 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7369 * returns true.
7370 *
7371 * Logged from:
7372 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7373 */
7374message ScreenTimeoutExtensionReported {
7375 // Describes how many times in a row did the power manager reset the screen off timeout.
7376 optional uint32 consecutive_timeout_extended_count = 1;
7377}
Hui Yu885aca12019-01-10 17:11:34 -08007378
7379/*
7380* Logs number of milliseconds it takes to start a process.
7381* The definition of app process start time is from the app launch time to
7382* the time that Zygote finished forking the app process and loaded the
7383* application package's java classes.
7384
7385* This metric is different from AppStartOccurred which is for foreground
7386* activity only.
7387
7388* ProcessStartTime can report all processes (both foreground and background)
7389* start time.
7390*
7391* Logged from:
7392* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7393*/
7394message ProcessStartTime {
7395 // The uid of the ProcessRecord.
7396 optional int32 uid = 1 [(is_uid) = true];
7397
7398 // The process pid.
7399 optional int32 pid = 2;
7400
7401 // The process name.
7402 // Usually package name, "system" for system server.
7403 // Provided by ActivityManagerService.
7404 optional string process_name = 3;
7405
7406 enum StartType {
7407 UNKNOWN = 0;
7408 WARM = 1;
7409 HOT = 2;
7410 COLD = 3;
7411 }
7412
7413 // The start type.
7414 optional StartType type = 4;
7415
7416 // The elapsed realtime at the start of the process.
7417 optional int64 process_start_time_millis = 5;
7418
7419 // Number of milliseconds it takes to reach bind application.
7420 optional int32 bind_application_delay_millis = 6;
7421
7422 // Number of milliseconds it takes to finish start of the process.
7423 optional int32 process_start_delay_millis = 7;
7424
7425 // hostingType field in ProcessRecord, the component type such as "activity",
7426 // "service", "content provider", "broadcast" or other strings.
7427 optional string hosting_type = 8;
7428
7429 // hostingNameStr field in ProcessRecord. The component class name that runs
7430 // in this process.
7431 optional string hosting_name = 9;
7432}
7433
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007434/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007435 * Track Media Codec usage
7436 * Logged from:
7437 * frameworks/av/media/libstagefright/MediaCodec.cpp
7438 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7439 */
7440message MediametricsCodecReported {
7441 optional int64 timestamp_nanos = 1;
7442 optional string package_name = 2;
7443 optional int64 package_version_code = 3;
7444 optional int64 media_apex_version = 4;
7445
7446 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7447}
7448
7449/**
7450 * Track Media Extractor (pulling video/audio streams out of containers) usage
7451 * Logged from:
7452 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7453 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7454 */
7455message MediametricsExtractorReported {
7456 optional int64 timestamp_nanos = 1;
7457 optional string package_name = 2;
7458 optional int64 package_version_code = 3;
7459 optional int64 media_apex_version = 4;
7460
7461 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7462}
7463
7464/**
7465 * Track how we arbitrate between microphone/input requests.
7466 * Logged from
7467 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7468 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7469 */
7470message MediametricsAudiopolicyReported {
7471 optional int64 timestamp_nanos = 1;
7472 optional string package_name = 2;
7473 optional int64 package_version_code = 3;
7474 optional int64 media_apex_version = 4;
7475
7476 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7477}
7478
7479/**
7480 * Track how we arbitrate between microphone requests.
7481 * Logged from
7482 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7483 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7484 */
7485message MediametricsAudiorecordReported {
7486 optional int64 timestamp_nanos = 1;
7487 optional string package_name = 2;
7488 optional int64 package_version_code = 3;
7489 optional int64 media_apex_version = 4;
7490
7491 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7492}
7493
7494/**
7495 * Track how we arbitrate between microphone/input requests.
7496 * Logged from
7497 * frameworks/av/media/libnblog/ReportPerformance.cpp
7498 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7499 */
7500message MediametricsAudiothreadReported {
7501 optional int64 timestamp_nanos = 1;
7502 optional string package_name = 2;
7503 optional int64 package_version_code = 3;
7504 optional int64 media_apex_version = 4;
7505
7506 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7507}
7508
7509/**
7510 * Track how we arbitrate between microphone/input requests.
7511 * Logged from
7512 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7513 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7514 */
7515message MediametricsAudiotrackReported {
7516 optional int64 timestamp_nanos = 1;
7517 optional string package_name = 2;
7518 optional int64 package_version_code = 3;
7519 optional int64 media_apex_version = 4;
7520
7521 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7522}
7523
7524/**
7525 * Track information about DRM framework performance
7526 * Logged from
7527 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7528 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7529 */
7530message MediametricsMediadrmReported {
7531 optional int64 timestamp_nanos = 1;
7532 optional string package_name = 2;
7533 optional int64 package_version_code = 3;
7534 optional int64 media_apex_version = 4;
7535
7536 // vendor+description tell about which DRM plugin is in use on this device
7537 optional string vendor = 5;
7538 optional string description = 6;
7539 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7540 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7541}
7542
7543/**
7544 * Track information about the widevine DRM plugin performance
7545 * Logged from
7546 * vendor/widevine/libwvdrmengine/cdm/metrics
7547 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7548 */
7549message MediametricsDrmWidevineReported {
7550 optional int64 timestamp_nanos = 1;
7551 optional string package_name = 2;
7552 optional int64 package_version_code = 3;
7553 optional int64 media_apex_version = 4;
7554
7555 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7556}
7557
7558/**
7559 * Track information about recordings (e.g. camcorder)
7560 * Logged from
7561 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7562 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7563 */
7564message MediametricsRecorderReported {
7565 optional int64 timestamp_nanos = 1;
7566 optional string package_name = 2;
7567 optional int64 package_version_code = 3;
7568 optional int64 media_apex_version = 4;
7569
7570 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7571}
7572
7573/**
7574 * Track Media Player usage
7575 * Logged from:
7576 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7577 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7578 */
7579message MediametricsNuPlayerReported {
7580 optional int64 timestamp_nanos = 1;
7581 optional string package_name = 2;
7582 optional int64 package_version_code = 3;
7583 optional int64 media_apex_version = 4;
7584
7585 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7586}
7587
7588/**
Robert Shiha4beed32019-08-19 14:15:23 -07007589 * Track Legacy DRM usage
7590 * Logged from
7591 * frameworks/av/drm/drmserver/DrmManager.cpp
7592 */
7593message MediametricsDrmManagerReported {
7594 optional int64 timestamp_nanos = 1;
7595 optional string package_name = 2;
7596 optional int64 package_version_code = 3;
7597 optional int64 media_apex_version = 4;
7598
7599 enum Method {
7600 METHOD_NOT_FOUND = -1;
7601 GET_CONSTRAINTS = 0;
7602 GET_METADATA = 1;
7603 CAN_HANDLE = 2;
7604 PROCESS_DRM_INFO = 3;
7605 ACQUIRE_DRM_INFO = 4;
7606 SAVE_RIGHTS = 5;
7607 GET_ORIGINAL_MIME_TYPE = 6;
7608 GET_DRM_OBJECT_TYPE = 7;
7609 CHECK_RIGHTS_STATUS = 8;
7610 REMOVE_RIGHTS = 9;
7611 REMOVE_ALL_RIGHTS = 10;
7612 OPEN_CONVERT_SESSION = 11;
7613 OPEN_DECRYPT_SESSION = 12;
7614 }
7615
7616 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7617 optional string plugin_id = 5;
7618 optional string description = 6;
7619 optional Method method = 7;
7620 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007621
7622 optional int64 get_constraints_count = 9;
7623 optional int64 get_metadata_count = 10;
7624 optional int64 can_handle_count = 11;
7625 optional int64 process_drm_info_count = 12;
7626 optional int64 acquire_drm_info_count = 13;
7627 optional int64 save_rights_count = 14;
7628 optional int64 get_original_mime_type_count = 15;
7629 optional int64 get_drm_object_type_count = 16;
7630 optional int64 check_rights_status_count = 17;
7631 optional int64 remove_rights_count = 18;
7632 optional int64 remove_all_rights_count = 19;
7633 optional int64 open_convert_session_count = 20;
7634 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007635}
7636
7637/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007638 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007639 * Pulled from: StatsCompanionService
7640*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007641message DangerousPermissionState {
7642 // Name of the permission
7643 optional string permission_name = 1;
7644
7645 // Uid of the package
7646 optional int32 uid = 2 [(is_uid) = true];
7647
7648 // Package requesting the permission
7649 optional string package_name = 3;
7650
7651 // If the permission is granted to the uid
7652 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007653
7654 // Permission flags as per android.content.pm.PermissionFlags
7655 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007656}
7657
Michael Groover4a0ca942019-01-24 17:41:25 -08007658/**
7659 * Logs when a package is denied access to a device identifier based on the new access requirements.
7660 *
7661 * Logged from:
7662 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7663 */
7664message DeviceIdentifierAccessDenied {
7665 // The name of the package denied access to the requested device identifier.
7666 optional string package_name = 1;
7667
7668 // The name of the device identifier method the package attempted to invoke.
7669 optional string method_name = 2;
7670
7671 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007672 // Starting from Android 11, this boolean is not set and will always be false.
7673 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007674
7675 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007676 // Starting from Android 11, this boolean is not set and will always be false.
7677 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007678}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007679
7680/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007681 * Pulls the ongoing mainline install train version code.
7682 * Pulled from StatsCompanionService
7683 */
7684message TrainInfo {
7685 optional int64 train_version_code = 1;
7686
7687 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007688
7689 optional string train_name = 3;
7690
7691 enum Status {
7692 UNKNOWN = 0;
7693 INSTALL_REQUESTED = 1;
7694 INSTALL_STARTED = 2;
7695 INSTALL_STAGED_NOT_READY = 3;
7696 INSTALL_STAGED_READY = 4;
7697 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007698 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7699 // and INSTALL_FAILURE_COMMIT.
7700 INSTALL_FAILURE = 6 [deprecated = true];
7701 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007702 INSTALL_CANCELLED = 7;
7703 INSTALLER_ROLLBACK_REQUESTED = 8;
7704 INSTALLER_ROLLBACK_INITIATED = 9;
7705 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7706 INSTALLER_ROLLBACK_STAGED = 11;
7707 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7708 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7709 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7710 INSTALLER_ROLLBACK_SUCCESS = 15;
7711 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007712 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7713 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7714 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7715 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7716 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7717 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007718 INSTALL_FAILURE_DOWNLOAD = 23;
7719 INSTALL_FAILURE_STATE_MISMATCH = 24;
7720 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007721 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007722 }
7723 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007724}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007725
7726/**
7727 * Logs the gesture stage changed event.
7728 *
7729 * Logged from:
7730 * frameworks/base/packages/SystemUI/
7731 */
7732message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007733 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007734}
7735
7736/**
7737 * Logs the feedback type.
7738 *
7739 * Logged from:
7740 * frameworks/base/packages/SystemUI/
7741 */
7742message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007743 // Whether or not the gesture was used.
7744 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007745}
7746
7747/**
7748 * Logs the progress.
7749 *
7750 * Logged from:
7751 * frameworks/base/packages/SystemUI/
7752 */
7753message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007754 // [0,100] progress for the assist gesture.
7755 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007756}
Neil Fullerdb14b482019-02-05 19:44:44 +00007757
7758/*
7759 * Information about the time zone data on a device.
7760 */
7761message TimeZoneDataInfo {
7762 // A version identifier for the data set on device. e.g. "2018i"
7763 optional string tzdb_version = 1;
7764}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007765
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007766/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007767 * Logs the GPU stats global health information.
7768 *
7769 * Logged from:
7770 * frameworks/native/services/gpuservice/gpustats/
7771 */
7772message GpuStatsGlobalInfo {
7773 // Package name of the gpu driver.
7774 optional string driver_package_name = 1;
7775
7776 // Version name of the gpu driver.
7777 optional string driver_version_name = 2;
7778
7779 // Version code of the gpu driver.
7780 optional int64 driver_version_code = 3;
7781
7782 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7783 optional int64 driver_build_time = 4;
7784
7785 // Total count of the gl driver gets loaded.
7786 optional int64 gl_loading_count = 5;
7787
7788 // Total count of the gl driver fails to be loaded.
7789 optional int64 gl_loading_failure_count = 6;
7790
7791 // Total count of the Vulkan driver gets loaded.
7792 optional int64 vk_loading_count = 7;
7793
7794 // Total count of the Vulkan driver fails to be loaded.
7795 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007796
7797 // Api version of the system Vulkan driver.
7798 optional int32 vulkan_version = 9;
7799
7800 // Api version of the system CPU Vulkan driver.
7801 optional int32 cpu_vulkan_version = 10;
7802
7803 // Api version of the system GLES driver.
7804 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007805
7806 // Total count of the angle driver gets loaded.
7807 optional int64 angle_loading_count = 12;
7808
7809 // Total count of the angle driver fails to be loaded.
7810 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007811}
7812
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007813/**
7814 * GPU driver loading time info.
7815 */
7816message GpuDriverLoadingTime {
7817 // List of all the driver loading times for this app. The list size is
7818 // capped at 50.
7819 repeated int64 driver_loading_time = 1;
7820}
7821
7822/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007823 * Logs the GPU stats per app health information.
7824 *
7825 * Logged from:
7826 * frameworks/native/services/gpuservice/gpustats/
7827 */
7828message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007829 // Package name of the application that loads the gpu driver. Total number
7830 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007831 optional string app_package_name = 1;
7832
7833 // Version code of the gpu driver this app loads.
7834 optional int64 driver_version_code = 2;
7835
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007836 // gl driver loading time info.
7837 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7838 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007839
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007840 // Vulkan driver loading time info.
7841 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7842 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007843
7844 // Angle driver loading time info.
7845 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7846 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007847
7848 // CPU Vulkan implementation is in use.
7849 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007850
7851 // App is not doing pre-rotation correctly.
7852 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007853
7854 // App creates GLESv1 context.
7855 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007856}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007857
7858/*
7859 * Logs the size of the system ion heap.
7860 *
7861 * Pulled from StatsCompanionService.
7862 */
7863message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007864 // Deprecated due to limited support of ion stats in debugfs.
7865 // Use `IonHeapSize` instead.
7866 option deprecated = true;
7867
Rafal Slawikd4e87572019-03-12 13:08:38 +00007868 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007869 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007870 optional int64 size_in_bytes = 1;
7871}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007872
Rafal Slawik77987ed2019-06-17 12:28:23 +01007873/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007874 * Logs the total size of the ion heap.
7875 *
7876 * Pulled from StatsCompanionService.
7877 */
7878message IonHeapSize {
7879 // Total size of all ion heaps in kilobytes.
7880 // Read from: /sys/kernel/ion/total_heaps_kb.
7881 optional int32 total_size_kb = 1;
7882}
7883
7884/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007885 * Logs the per-process size of the system ion heap.
7886 *
7887 * Pulled from StatsCompanionService.
7888 */
7889message ProcessSystemIonHeapSize {
7890 // The uid if available. -1 means not available.
7891 optional int32 uid = 1 [(is_uid) = true];
7892
7893 // The process name (from /proc/PID/cmdline).
7894 optional string process_name = 2;
7895
7896 // Sum of sizes of all allocations.
7897 optional int32 total_size_in_kilobytes = 3;
7898
7899 // Number of allocations.
7900 optional int32 allocation_count = 4;
7901
7902 // Size of the largest allocation.
7903 optional int32 max_size_in_kilobytes = 5;
7904}
7905
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007906/**
7907 * Push network stack events.
7908 *
7909 * Log from:
7910 * frameworks/base/packages/NetworkStack/
7911 */
7912message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007913 // The id that indicates the event reported from NetworkStack.
7914 optional int32 event_id = 1;
7915 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007916 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7917}
Carmen Agimofa769c152019-03-04 14:39:14 +00007918
7919/**
7920 * Logs the apps that are installed on the external storage.
7921 * Pulled from:
7922 * StatsCompanionService
7923 */
7924message AppsOnExternalStorageInfo {
7925 // The type of the external storage.
7926 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7927 // The name of the package that is installed on the external storage.
7928 optional string package_name = 2;
7929}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007930
7931/**
7932 * Logs the settings related to Face.
7933 * Logged from:
7934 * frameworks/base/services/core/java/com/android/server/stats
7935 */
7936message FaceSettings {
7937 // Whether or not face unlock is allowed on Keyguard.
7938 optional bool unlock_keyguard_enabled = 1;
7939 // Whether or not face unlock dismisses the Keyguard.
7940 optional bool unlock_dismisses_keyguard = 2;
7941 // Whether or not face unlock requires attention.
7942 optional bool unlock_attention_required = 3;
7943 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7944 optional bool unlock_app_enabled = 4;
7945 // Whether or not face unlock always requires user confirmation.
7946 optional bool unlock_always_require_confirmation = 5;
7947 // Whether or not a diverse set of poses are required during enrollment.
7948 optional bool unlock_diversity_required = 6;
7949}
Maggie White442b6312019-04-05 16:26:44 -07007950
7951/**
7952 * Logs cooling devices maintained by the kernel.
7953 *
7954 * Pulled from StatsCompanionService.java
7955 */
7956message CoolingDevice {
7957 // The type of cooling device being reported. Eg. CPU, GPU...
7958 optional android.os.CoolingTypeEnum device_location = 1;
7959 // The name of the cooling device source. Eg. CPU0
7960 optional string device_name = 2;
7961 // Current throttle state of the cooling device. The value can any unsigned
7962 // integer between 0 and max_state defined in its driver. 0 means device is
7963 // not in throttling, higher value means deeper throttling.
7964 optional int32 state = 3;
7965}
Ben Blount763a5d52019-04-10 11:48:58 -07007966
7967/**
7968 * Intelligence has several counter-type events that don't warrant a
7969 * full separate atom. These are primarily API call counters but also include
7970 * counters for feature usage and specific failure modes.
7971 *
7972 * Logged from the Intelligence mainline module.
7973 */
7974message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007975 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007976 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007977 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007978 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007979 // How many times the event occured (to report a batch of high frequency events).
7980 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007981 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007982 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007983}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007984
7985/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007986 * Logs when Car Power state changed.
7987 *
7988 * Logged from:
7989 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7990 */
7991message CarPowerStateChanged {
7992 // States come from CpmsState in CarPowerManagementService.java.
7993 enum State {
7994 WAIT_FOR_VHAL = 0;
7995 ON = 1;
7996 SHUTDOWN_PREPARE = 2;
7997 WAIT_FOR_FINISH = 3;
7998 SUSPEND = 4;
7999 SIMULATE_SLEEP = 5;
8000 }
8001 optional State state = 1;
8002}
8003
8004/**
8005 * Logs whether GarageMode is entered.
8006 *
8007 * Logged from:
8008 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8009 */
8010message GarageModeInfo {
8011 // Whether GarageMode is entered.
8012 optional bool is_garage_mode = 1;
8013}
Martijn Coenencd95d462019-04-25 17:09:45 +02008014
8015/**
8016 * Historical app ops data per package.
8017 */
8018message AppOps {
8019 // Uid of the package requesting the op
8020 optional int32 uid = 1 [(is_uid) = true];
8021
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008022 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008023 optional string package_name = 2;
8024
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008025 // operation id
8026 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008027
8028 // The number of times the op was granted while the app was in the
8029 // foreground (only for trusted requests)
8030 optional int64 trusted_foreground_granted_count = 4;
8031
8032 // The number of times the op was granted while the app was in the
8033 // background (only for trusted requests)
8034 optional int64 trusted_background_granted_count = 5;
8035
8036 // The number of times the op was rejected while the app was in the
8037 // foreground (only for trusted requests)
8038 optional int64 trusted_foreground_rejected_count = 6;
8039
8040 // The number of times the op was rejected while the app was in the
8041 // background (only for trusted requests)
8042 optional int64 trusted_background_rejected_count = 7;
8043
8044 // For long-running operations, total duration of the operation
8045 // while the app was in the foreground (only for trusted requests)
8046 optional int64 trusted_foreground_duration_millis = 8;
8047
8048 // For long-running operations, total duration of the operation
8049 // while the app was in the background (only for trusted requests)
8050 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008051
8052 // Whether AppOps is guarded by Runtime permission
8053 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008054}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008055
8056/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008057 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008058 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008059message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008060 // Uid of the package requesting the op
8061 optional int32 uid = 1 [(is_uid) = true];
8062
8063 // Name of the package performing the op
8064 optional string package_name = 2;
8065
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008066 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8067 // Attributions must be provided through manifest using <attribution> tag available in R and
8068 // above.
8069 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008070
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008071 // operation id
8072 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008073
8074 // The number of times the op was granted while the app was in the
8075 // foreground (only for trusted requests)
8076 optional int64 trusted_foreground_granted_count = 5;
8077
8078 // The number of times the op was granted while the app was in the
8079 // background (only for trusted requests)
8080 optional int64 trusted_background_granted_count = 6;
8081
8082 // The number of times the op was rejected while the app was in the
8083 // foreground (only for trusted requests)
8084 optional int64 trusted_foreground_rejected_count = 7;
8085
8086 // The number of times the op was rejected while the app was in the
8087 // background (only for trusted requests)
8088 optional int64 trusted_background_rejected_count = 8;
8089
8090 // For long-running operations, total duration of the operation
8091 // while the app was in the foreground (only for trusted requests)
8092 optional int64 trusted_foreground_duration_millis = 9;
8093
8094 // For long-running operations, total duration of the operation
8095 // while the app was in the background (only for trusted requests)
8096 optional int64 trusted_background_duration_millis = 10;
8097
8098 // Whether AppOps is guarded by Runtime permission
8099 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008100
8101 // Sampling rate used on device, from 0 to 100
8102 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008103}
8104
8105/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008106 * Location Manager API Usage information(e.g. API under usage,
8107 * API call's parameters).
8108 * Logged from:
8109 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8110 */
8111message LocationManagerApiUsageReported {
8112
8113 // Indicating if usage starts or usage ends.
8114 optional android.stats.location.UsageState state = 1;
8115
8116 // LocationManagerService's API in use.
8117 // We can identify which API from LocationManager is
8118 // invoking current LMS API by the combination of
8119 // API parameter(e.g. is_listener_null, is_intent_null,
8120 // is_location_request_null)
8121 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8122
8123 // Name of the package calling the API.
8124 optional string calling_package_name = 3;
8125
8126 // Type of the location provider.
8127 optional android.stats.location.ProviderType provider = 4;
8128
8129 // Quality of the location request
8130 optional android.stats.location.LocationRequestQuality quality = 5;
8131
8132 // The desired interval for active location updates, in milliseconds.
8133 // Bucketized to reduce cardinality.
8134 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8135
8136 // Minimum distance between location updates, in meters.
8137 // Bucketized to reduce cardinality.
8138 optional android.stats.location.SmallestDisplacementBucket
8139 bucketized_smallest_displacement = 7;
8140
8141 // The number of location updates.
8142 optional int64 num_updates = 8;
8143
8144 // The request expiration time, in millisecond since boot.
8145 // Bucketized to reduce cardinality.
8146 optional android.stats.location.ExpirationBucket
8147 bucketized_expire_in = 9;
8148
8149 // Type of Callback passed in for this API.
8150 optional android.stats.location.CallbackType callback_type = 10;
8151
8152 // The radius of the central point of the alert
8153 // region, in meters. Only for API REQUEST_GEOFENCE.
8154 // Bucketized to reduce cardinality.
8155 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8156
8157 // Activity Importance of API caller.
8158 // Categorized to 3 types that are interesting from location's perspective.
8159 optional android.stats.location.ActivityImportance activiy_importance = 12;
8160}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008161
8162/**
8163 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8164 */
8165message ReviewPermissionsFragmentResultReported {
8166 // unique value identifying a permission group change. A permission group change might result
8167 // in multiple of these atoms
8168 optional int64 change_id = 1;
8169
8170 // UID of package the permission belongs to
8171 optional int32 uid = 2 [(is_uid) = true];
8172
8173 // Name of package the permission belongs to
8174 optional string package_name = 3;
8175
8176 // The permission to be granted
8177 optional string permission_name = 4;
8178
8179 // The result of the permission grant
8180 optional bool permission_granted = 5;
8181}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008182
8183/**
8184* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8185* Logged from: RuntimePermissionUpdgradeController
8186*/
8187message RuntimePermissionsUpgradeResult {
8188 // Permission granted as result of upgrade
8189 optional string permission_name = 1;
8190
8191 // UID of package granted permission
8192 optional int32 uid = 2 [(is_uid) = true];
8193
8194 // Name of package granted permission
8195 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008196}
8197
8198/**
8199* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8200*/
8201message GrantPermissionsActivityButtonActions {
8202 // Permission granted as result of upgrade
8203 optional string permission_group_name = 1;
8204
8205 // UID of package granted permission
8206 optional int32 uid = 2 [(is_uid) = true];
8207
8208 // Name of package requesting permission
8209 optional string package_name = 3;
8210
8211 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8212 // LABEL_ constants in GrantPermissionActivity.java
8213 optional int32 buttons_presented = 4;
8214
8215 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8216 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008217
8218 // id which identifies single session of user interacting with permission controller
8219 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008220}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008221
8222/**
8223 * Information about LocationAccessCheck notification presented to user
8224 */
8225message LocationAccessCheckNotificationAction {
8226
8227 // id which identifies single session of user interacting with permission controller
8228 optional int64 session_id = 1;
8229
8230 // Uid of package for which location access check is presented
8231 optional int32 package_uid = 2;
8232
8233 // Name of package for which location access check is presented
8234 optional string package_name = 3;
8235
8236 enum Result {
8237 UNDEFINED = 0;
8238 // notification was presented to the user
8239 NOTIFICATION_PRESENTED = 1;
8240 // notification was declined by the user
8241 NOTIFICATION_DECLINED = 2;
8242 // notification was clicked by the user
8243 NOTIFICATION_CLICKED = 3;
8244 }
8245
8246 // View / interaction recorded
8247 optional Result result = 4;
8248}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008249
8250/**
8251 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8252 */
8253message AppPermissionFragmentActionReported {
8254 // id which identifies single session of user interacting with permission controller
8255 optional int64 session_id = 1;
8256
8257 // unique value identifying a permission group change. A permission group change might result
8258 // in multiple of these atoms
8259 optional int64 change_id = 2;
8260
8261 // UID of package the permission belongs to
8262 optional int32 uid = 3 [(is_uid) = true];
8263
8264 // Name of package the permission belongs to
8265 optional string package_name = 4;
8266
8267 // The permission to be granted
8268 optional string permission_name = 5;
8269
8270 // The result of the permission grant
8271 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008272
8273 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8274 optional int32 permission_flags = 7;
8275
8276 enum Button {
8277 UNDEFINED = 0;
8278 // Allow button
8279 ALLOW = 1;
8280 // Deny button
8281 DENY = 2;
8282 // Ask every time button
8283 ASK_EVERY_TIME = 3;
8284 // Allow all the time button
8285 ALLOW_ALWAYS = 4;
8286 // Allow only while using the app button
8287 ALLOW_FOREGROUND = 5;
8288 // Same is Deny button but shown in while in use dialog
8289 DENY_FOREGROUND = 6;
8290 }
8291
8292 // Button pressed in the dialog
8293 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008294}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008295
8296/**
8297* Information about a AppPermissionFragment viewed by user
8298*/
8299message AppPermissionFragmentViewed {
8300 // id which identifies single session of user interacting with permission controller
8301 optional int64 session_id = 1;
8302
8303 // UID of package for which permissions are viewed
8304 optional int32 uid = 2 [(is_uid) = true];
8305
8306 // Name of package for which permissions are viewed
8307 optional string package_name = 3;
8308
8309 // Permission group viewed
8310 optional string permission_group_name = 4;
8311}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008312
8313/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008314* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8315* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008316*/
8317message AppPermissionsFragmentViewed {
8318 // id which identifies single session of user interacting with permission controller
8319 optional int64 session_id = 1;
8320
8321 // id which identifies single view as every view might have several logging records
8322 // with different package information attached
8323 optional int64 view_id = 2;
8324
8325 // Permission group viewed
8326 optional string permission_group_name = 3;
8327
8328 // UID of package for which permissions are viewed
8329 optional int32 uid = 4 [(is_uid) = true];
8330
8331 // Name of package for which permissions are viewed
8332 optional string package_name = 5;
8333
8334 // Category in which permission is included
8335 enum Category {
8336 UNDEFINED = 0;
8337 ALLOWED = 1;
8338 ALLOWED_FOREGROUND = 2;
8339 DENIED = 3;
8340 }
8341 optional Category category = 6;
8342}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008343/**
8344* Information about a PermissionAppsFragment viewed by user.
8345* Logged from ui/handheld/PermissionAppsFragment.java
8346*/
8347message PermissionAppsFragmentViewed {
8348 // id which identifies single session of user interacting with permission controller
8349 optional int64 session_id = 1;
8350
8351 // id which identifies single view as every view might have several logging records
8352 // with different package information attached
8353 optional int64 view_id = 2;
8354
8355 // Permission group viewed
8356 optional string permission_group_name = 3;
8357
8358 // UID of package for which permissions are viewed
8359 optional int32 uid = 4 [(is_uid) = true];
8360
8361 // Name of package for which permissions are viewed
8362 optional string package_name = 5;
8363
8364 // Category in which app is included
8365 enum Category {
8366 UNDEFINED = 0;
8367 ALLOWED = 1;
8368 ALLOWED_FOREGROUND = 2;
8369 DENIED = 3;
8370 }
8371 optional Category category = 6;
8372}
Tony Make2b1b672019-07-29 16:59:47 +01008373
8374/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008375* Log that the Auto Revoke notification has been clicked
8376* Logged from ui/ManagePermissionsActivity
8377*/
8378message AutoRevokeNotificationClicked {
8379 // id which identifies single session of user interacting with permission controller
8380 optional int64 session_id = 1;
8381}
8382
8383/**
8384* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8385* auto revoked for it.
8386* Logged from ui/handheld/AutoRevokeFragment
8387*/
8388message AutoRevokeFragmentAppViewed {
8389 // id which identifies single session of user interacting with permission controller
8390 optional int64 session_id = 1;
8391
8392 // UID of package for which permissions are viewed
8393 optional int32 uid = 2 [(is_uid) = true];
8394
8395 // Name of package for which permissions are viewed
8396 optional string package_name = 3;
8397
8398 // The name of a permission group that has been revoked
8399 optional string permission_group_name = 4;
8400
8401 // The age of the app- more than three months old, or more than six months
8402 enum Age {
8403 UNDEFINED = 0;
8404 NEWER_BUCKET = 1;
8405 OLDER_BUCKET = 2;
8406 }
8407
8408 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8409 optional Age age = 5;
8410}
8411
8412/**
8413* Log that the user has interacted with an app on the auto revoke fragment
8414* Logged from ui/handheld/AutoRevokeFragment
8415*/
8416message AutoRevokedAppInteraction {
8417 // id which identifies single session of user interacting with permission controller
8418 optional int64 session_id = 1;
8419
8420 // UID of package for which permissions are viewed
8421 optional int32 uid = 2 [(is_uid) = true];
8422
8423 // Name of package for which permissions are viewed
8424 optional string package_name = 3;
8425
8426 enum Action {
8427 UNDEFINED = 0;
8428 REMOVE = 1;
8429 OPEN = 2;
8430 APP_INFO = 3;
8431 PERMISSIONS = 4;
8432 REMOVE_IN_SETTINGS = 5;
8433 OPEN_IN_SETTINGS = 6;
8434 }
8435
8436 // The action the user took to interact with the app
8437 optional Action action = 4;
8438}
8439
8440/**
8441* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8442* auto revoke, or that the auto revoke switch has been changed
8443* Logged from ui/handheld/AppPermissionGroupsFragment
8444 */
8445message AppPermissionGroupsFragmentAutoRevokeAction {
8446 // id which identifies single session of user interacting with permission controller
8447 optional int64 session_id = 1;
8448
8449 // UID of package for which permissions are viewed
8450 optional int32 uid = 2 [(is_uid) = true];
8451
8452 // Name of package for which permissions are viewed
8453 optional string package_name = 3;
8454
8455 enum Action {
8456 UNDEFINED = 0;
8457 OPENED_FOR_AUTO_REVOKE = 1;
8458 OPENED_FROM_INTENT = 2;
8459 SWITCH_ENABLED = 3;
8460 SWITCH_DISABLED = 4;
8461 }
8462
8463 // The action the user took to interact with the fragment
8464 optional Action action = 4;
8465}
8466
8467/**
Tony Make2b1b672019-07-29 16:59:47 +01008468 * Logs when there is a smart selection related event.
8469 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8470 * Logged from: TextClassifierEventLogger.java
8471 */
8472message TextSelectionEvent {
8473 // A session ID.
8474 optional string session_id = 1;
8475
8476 // Event type of this event.
8477 optional android.stats.textclassifier.EventType event_type = 2;
8478
Tony Mak9c84bd22019-12-09 07:27:25 +00008479 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008480 optional string model_name = 3;
8481
8482 // Type of widget that was involved in triggering this event.
8483 optional android.stats.textclassifier.WidgetType widget_type = 4;
8484
8485 // Index of this event in a session.
8486 optional int32 event_index = 5;
8487
8488 // Entity type that is involved.
8489 optional string entity_type = 6;
8490
8491 // Relative word index of the start of the selection.
8492 optional int32 relative_word_start_index = 7;
8493
8494 // Relative word (exclusive) index of the end of the selection.
8495 optional int32 relative_word_end_index = 8;
8496
8497 // Relative word index of the start of the smart selection.
8498 optional int32 relative_suggested_word_start_index = 9;
8499
8500 // Relative word (exclusive) index of the end of the smart selection.
8501 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008502
8503 // Name of source package.
8504 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008505
8506 // Name of the LangID model that is involved in this event.
8507 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008508}
8509
8510/**
8511 * Logs when there is a smart linkify related event.
8512 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8513 * Logged from: TextClassifierEventLogger.java
8514 */
8515message TextLinkifyEvent {
8516 // A session ID.
8517 optional string session_id = 1;
8518
8519 // Event type of this event.
8520 optional android.stats.textclassifier.EventType event_type = 2;
8521
Tony Mak9c84bd22019-12-09 07:27:25 +00008522 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008523 optional string model_name = 3;
8524
8525 // Type of widget that was involved in triggering this event.
8526 optional android.stats.textclassifier.WidgetType widget_type = 4;
8527
8528 // Index of this event in a session.
8529 optional int32 event_index = 5;
8530
8531 // Entity type that is involved.
8532 optional string entity_type = 6;
8533
8534 // Number of links detected.
8535 optional int32 num_links = 7;
8536
8537 // The total length of all links.
8538 optional int32 linked_text_length = 8;
8539
8540 // Length of input text.
8541 optional int32 text_length = 9;
8542
8543 // Time spent on generating links in ms.
8544 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008545
8546 // Name of source package.
8547 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008548
8549 // Name of the LangID model that is involved in this event.
8550 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008551}
8552
8553/**
8554 * Logs when there is a conversation actions related event.
8555 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8556 * Logged from: TextClassifierEventLogger.java
8557 */
8558message ConversationActionsEvent {
8559 // A session ID.
8560 optional string session_id = 1;
8561
8562 // Event type of this event.
8563 optional android.stats.textclassifier.EventType event_type = 2;
8564
Tony Mak9c84bd22019-12-09 07:27:25 +00008565 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008566 optional string model_name = 3;
8567
8568 // Type of widget that was involved in triggering this event.
8569 optional android.stats.textclassifier.WidgetType widget_type = 4;
8570
8571 // The first entity type that is involved.
8572 optional string first_entity_type = 5;
8573
8574 // The second entity type that is involved.
8575 optional string second_entity_type = 6;
8576
8577 // The third entity type that is involved.
8578 optional string third_entity_type = 7;
8579
8580 // The score of the first entity type.
8581 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008582
8583 // Name of source package.
8584 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008585
8586 // Name of the annotator model that is involved in this event.
8587 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008588
8589 // Name of the LangID model that is involved in this event.
8590 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008591}
8592
8593/**
8594 * Logs when there is a language detection related event.
8595 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8596 * Logged from: TextClassifierEventLogger.java
8597 */
8598message LanguageDetectionEvent {
8599 // A session ID.
8600 optional string session_id = 1;
8601
8602 // Event type of this event.
8603 optional android.stats.textclassifier.EventType event_type = 2;
8604
Tony Mak9c84bd22019-12-09 07:27:25 +00008605 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008606 optional string model_name = 3;
8607
8608 // Type of widget that was involved in triggering this event.
8609 optional android.stats.textclassifier.WidgetType widget_type = 4;
8610
8611 // Detected language.
8612 optional string language_tag = 5;
8613
8614 // Score of the detected language.
8615 optional float score = 6;
8616
8617 // Position of this action.
8618 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008619
8620 // Name of source package.
8621 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008622}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008623
8624/**
8625 * Information about an OTA update attempt by update_engine.
8626 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8627 */
8628message UpdateEngineUpdateAttemptReported {
8629 // The number of attempts for the update engine to apply a given payload.
8630 optional int32 attempt_number = 1;
8631
8632 optional android.stats.otaupdate.PayloadType payload_type = 2;
8633
8634 // The total time in minutes for the update engine to apply a given payload.
8635 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8636 // it's increased when the system is sleeping.
8637 optional int32 duration_boottime_in_minutes = 3;
8638
8639 // The total time in minutes for the update engine to apply a given payload.
8640 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8641 // and it's not increased when the system is sleeping.
8642 optional int32 duration_monotonic_in_minutes = 4;
8643
8644 // The size of the payload in MiBs.
8645 optional int32 payload_size_mib = 5;
8646
8647 // The attempt result reported by the update engine for an OTA update.
8648 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8649
8650 // The error code reported by the update engine after an OTA update attempt
8651 // on A/B devices.
8652 optional android.stats.otaupdate.ErrorCode error_code = 7;
8653
8654 // The build fingerprint of the source system. The value is read from a
8655 // system property when the device takes the update. e.g.
8656 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8657 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008658
8659 // Size of super partition.
8660 optional int64 super_partition_size_bytes = 9;
8661
8662 // Size of current slot within the super partition.
8663 optional int64 slot_size_bytes = 10;
8664
8665 // Free space available in the super partition.
8666 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008667}
8668
8669/**
8670 * Information about all the attempts the device make before finishing the
8671 * successful update.
8672 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8673 */
8674message UpdateEngineSuccessfulUpdateReported {
8675 // The number of attempts for the update engine to apply the payload for a
8676 // successful update.
8677 optional int32 attempt_count = 1;
8678
8679 optional android.stats.otaupdate.PayloadType payload_type = 2;
8680
8681 optional int32 payload_size_mib = 3;
8682
8683 // The total number of bytes downloaded by update_engine since the last
8684 // successful update.
8685 optional int32 total_bytes_downloaded_mib = 4;
8686
8687 // The ratio in percentage of the over-downloaded bytes compared to the
8688 // total bytes needed to successfully install the update. e.g. 200 if we
8689 // download 200MiB in total for a 100MiB package.
8690 optional int32 download_overhead_percentage = 5;
8691
8692 // The total time in minutes for the update engine to apply the payload for a
8693 // successful update.
8694 optional int32 total_duration_minutes = 6;
8695
8696 // The number of reboot of the device during a successful update.
8697 optional int32 reboot_count = 7;
8698}
Alec Mourie088e762019-07-02 13:10:55 -07008699
8700/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008701 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8702 * key to indicate whether it was successful or not.
8703 *
8704 * Logged from:
8705 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8706 */
8707message RebootEscrowRecoveryReported {
8708 optional bool successful = 1;
8709}
8710
8711/**
Alec Mourie088e762019-07-02 13:10:55 -07008712 * Global display pipeline metrics reported by SurfaceFlinger.
8713 * Pulled from:
8714 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8715 */
8716message SurfaceflingerStatsGlobalInfo {
8717 // Total number of frames presented during the tracing period
8718 optional int64 total_frames = 1;
8719 // Total number of frames missed
8720 optional int64 missed_frames = 2;
8721 // Total number of frames that fell back to client composition
8722 optional int64 client_composition_frames = 3;
8723 // Total time the display was turned on
8724 optional int64 display_on_millis = 4;
8725 // Total time that was spent performing animations.
8726 // This is derived from the present-to-present layer histogram
8727 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008728 // Total number of event connections tracked by SurfaceFlinger at the time
8729 // of this pull. If this number grows prohibitively large, then this can
8730 // cause jank due to resource contention.
8731 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008732 // Set of timings measured from when SurfaceFlinger began compositing a
8733 // frame, until the frame was requested to be presented to the display. This
8734 // measures SurfaceFlinger's total CPU walltime on the critical path per
8735 // frame.
8736 optional FrameTimingHistogram frame_duration = 7
8737 [(android.os.statsd.log_mode) = MODE_BYTES];
8738 // Set of timings measured from when SurfaceFlinger first began using the
8739 // GPU to composite a frame, until the GPU has finished compositing that
8740 // frame. This measures the total additional time SurfaceFlinger needed to
8741 // perform due to falling back into GPU composition.
8742 optional FrameTimingHistogram render_engine_timing = 8
8743 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008744}
8745
8746/**
8747 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8748 * The number of layers uploaded will be restricted due to size limitations.
8749 * Pulled from:
8750 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8751 */
8752message SurfaceflingerStatsLayerInfo {
8753 // The layer for this set of metrics
8754 // For now we can infer that the package name is included in the layer
8755 // name.
8756 optional string layer_name = 1;
8757 // Total number of frames presented
8758 optional int64 total_frames = 2;
8759 // Total number of dropped frames while latching a buffer for this layer.
8760 optional int64 dropped_frames = 3;
8761 // Set of timings measured between successive presentation timestamps.
8762 optional FrameTimingHistogram present_to_present = 4
8763 [(android.os.statsd.log_mode) = MODE_BYTES];
8764 // Set of timings measured from when an app queued a buffer for
8765 // presentation, until the buffer was actually presented to the
8766 // display.
8767 optional FrameTimingHistogram post_to_present = 5
8768 [(android.os.statsd.log_mode) = MODE_BYTES];
8769 // Set of timings measured from when a buffer is ready to be presented,
8770 // until the buffer was actually presented to the display.
8771 optional FrameTimingHistogram acquire_to_present = 6
8772 [(android.os.statsd.log_mode) = MODE_BYTES];
8773 // Set of timings measured from when a buffer was latched by
8774 // SurfaceFlinger, until the buffer was presented to the display
8775 optional FrameTimingHistogram latch_to_present = 7
8776 [(android.os.statsd.log_mode) = MODE_BYTES];
8777 // Set of timings measured from the desired presentation to the actual
8778 // presentation time
8779 optional FrameTimingHistogram desired_to_present = 8
8780 [(android.os.statsd.log_mode) = MODE_BYTES];
8781 // Set of timings measured from when an app queued a buffer for
8782 // presentation, until the buffer was ready to be presented.
8783 optional FrameTimingHistogram post_to_acquire = 9
8784 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008785 // Frames missed latch because the acquire fence didn't fire
8786 optional int64 late_acquire_frames = 10;
8787 // Frames latched early because the desired present time was bad
8788 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008789}
8790
8791/**
8792 * Histogram of frame counts bucketed by time in milliseconds.
8793 * Because of size limitations, we hard-cap the number of buckets, with
8794 * buckets for corresponding to larger milliseconds being less precise.
8795 */
8796message FrameTimingHistogram {
8797 // Timings in milliseconds that describes a set of histogram buckets
8798 repeated int32 time_millis_buckets = 1;
8799 // Number of frames that match to each time_millis, i.e. the bucket
8800 // contents
8801 // It's required that len(time_millis) == len(frame_count)
8802 repeated int64 frame_counts = 2;
8803}
Emilian Peev6729f372019-08-29 09:14:09 -07008804
Emilian Peev6729f372019-08-29 09:14:09 -07008805/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008806 * Janky event as reported by SurfaceFlinger.
8807 * This event is intended to be consumed by a Perfetto subscriber for
8808 * automated trace collection.
8809 *
8810 * Logged from:
8811 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8812 */
8813message DisplayJankReported {
8814 // Informational field for how long the janky event lasted in milliseconds
8815 optional int64 event_duration_millis = 1;
8816 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8817 // the display on time.
8818 optional int32 present_deadlines_missed = 2;
8819}
8820
8821/**
Emilian Peev6729f372019-08-29 09:14:09 -07008822 * Information about camera facing and API level usage.
8823 * Logged from:
8824 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8825 */
8826message CameraActionEvent {
8827 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008828 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008829
8830 // Camera API level used
8831 optional int32 api_level = 2;
8832
8833 // Name of client package
8834 optional string package_name = 3;
8835
8836 // Camera facing
8837 enum Facing {
8838 UNKNOWN = 0;
8839 BACK = 1;
8840 FRONT = 2;
8841 EXTERNAL = 3;
8842 }
8843 optional Facing facing = 4;
8844}
atrost01a20932019-08-28 15:40:37 +01008845
8846/**
8847 * Logs when a compatibility change is affecting an app.
8848 *
8849 * Logged from:
8850 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8851 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8852 */
8853message AppCompatibilityChangeReported {
8854 // The UID of the app being affected by the compatibilty change.
8855 optional int32 uid = 1 [(is_uid) = true];
8856
8857 // The ID of the change affecting the app.
8858 optional int64 change_id = 2;
8859
8860 enum State {
8861 UNKNOWN_STATE = 0;
8862 ENABLED = 1;
8863 DISABLED = 2;
8864 LOGGED = 3;
8865 }
8866
8867 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8868 // logged otherwise.
8869 optional State state = 3;
8870
8871 enum Source {
8872 UNKNOWN_SOURCE = 0;
8873 APP_PROCESS = 1;
8874 SYSTEM_SERVER = 2;
8875 }
8876
8877 // Where it was logged from.
8878 optional Source source = 4;
8879
8880}
Hector Dearman40579f62019-11-01 13:19:30 +00008881
8882/**
8883 * Logged from
8884 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8885 */
8886message PerfettoUploaded {
8887 enum Event {
8888 PERFETTO_UNDEFINED = 0;
8889 PERFETTO_TRACE_BEGIN = 1;
8890 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8891 PERFETTO_ON_CONNECT = 3;
8892 PERFETTO_ON_TRACING_DISABLED = 4;
8893 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8894 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8895 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8896 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8897 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8898 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8899 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8900 PERFETTO_TRIGGER_BEGIN = 12;
8901 PERFETTO_TRIGGER_SUCCESS = 13;
8902 PERFETTO_TRIGGER_FAILURE = 14;
8903 PERFETTO_HIT_GUARDRAILS = 15;
8904 PERFETTO_ON_TIMEOUT = 16;
8905 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8906 }
8907
8908 // Which stage of the pipeline we are reporting from.
8909 optional Event event = 1;
8910
8911 // UUID matching the one set inside the SystemInfo trace packet.
8912 optional int64 trace_uuid_lsb = 2;
8913 optional int64 trace_uuid_msb = 3;
8914}
Mark Tabrya824a642019-11-05 12:26:12 -08008915
8916/**
8917 * Pulls client metrics on data transferred via Vehicle Maps Service.
8918 * Metrics are keyed by uid + layer.
8919 *
8920 * Pulled from:
8921 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8922 */
8923message VmsClientStats {
8924 // UID of the VMS client app
8925 optional int32 uid = 1 [(is_uid) = true];
8926
8927 // VMS layer definition
8928 optional int32 layer_type = 2;
8929 optional int32 layer_channel = 3;
8930 optional int32 layer_version = 4;
8931
8932 // Bytes and packets sent by the client for the layer
8933 optional int64 tx_bytes = 5;
8934 optional int64 tx_packets = 6;
8935
8936 // Bytes and packets received by the client for the layer
8937 optional int64 rx_bytes = 7;
8938 optional int64 rx_packets = 8;
8939
8940 // Bytes and packets dropped due to client error
8941 optional int64 dropped_bytes = 9;
8942 optional int64 dropped_packets = 10;
8943}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008944
8945/**
8946 * State of a dangerous permission requested by a package - sampled
8947 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8948*/
8949message DangerousPermissionStateSampled {
8950 // Name of the permission
8951 optional string permission_name = 1;
8952
8953 // Uid of the package
8954 optional int32 uid = 2 [(is_uid) = true];
8955
8956 // If the permission is granted to the uid
8957 optional bool is_granted = 3;
8958
8959 // Permission flags as per android.content.pm.PermissionFlags
8960 optional int32 permission_flags = 4;
8961}
8962
Stan Iliev637ba5e2019-08-16 13:43:08 -04008963/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008964 * HWUI stats for a given app.
8965 */
8966message GraphicsStats {
8967 // The package name of the app
8968 optional string package_name = 1;
8969
8970 // The version code of the app
8971 optional int64 version_code = 2;
8972
8973 // The start & end timestamps in UTC as
8974 // milliseconds since January 1, 1970
8975 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008976 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008977
Stan Ilievb6517192020-02-18 10:12:42 -05008978 optional int64 end_millis = 4;
8979
8980 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8981 enum PipelineType {
8982 UNKNOWN = 0;
8983 GL = 1;
8984 VULKAN = 2;
8985 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008986
8987 // HWUI renders pipeline type: GL or Vulkan.
8988 optional PipelineType pipeline = 5;
8989
8990 // Distinct frame count.
8991 optional int32 total_frames = 6;
8992
8993 // Number of "missed vsync" events.
8994 optional int32 missed_vsync_count = 7;
8995
8996 // Number of frames in triple-buffering scenario (high input latency)
8997 optional int32 high_input_latency_count = 8;
8998
8999 // Number of "slow UI thread" events.
9000 optional int32 slow_ui_thread_count = 9;
9001
9002 // Number of "slow bitmap upload" events.
9003 optional int32 slow_bitmap_upload_count = 10;
9004
9005 // Number of "slow draw" events.
9006 optional int32 slow_draw_count = 11;
9007
9008 // Number of frames that missed their deadline (aka, visibly janked)
9009 optional int32 missed_deadline_count = 12;
9010
9011 // The frame time histogram for the package
9012 optional FrameTimingHistogram cpu_histogram = 13
9013 [(android.os.statsd.log_mode) = MODE_BYTES];
9014
9015 // The gpu frame time histogram for the package
9016 optional FrameTimingHistogram gpu_histogram = 14
9017 [(android.os.statsd.log_mode) = MODE_BYTES];
9018
9019 // UI mainline module version.
9020 optional int64 version_ui_module = 15;
9021
9022 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9023 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9024 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9025 // more apps are running / rendering.
9026 optional bool is_today = 16;
9027}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009028
9029/**
9030 * Message related to dangerous (runtime) app ops access
9031 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009032message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009033 // Uid of the package accessing app op
9034 optional int32 uid = 1 [(is_uid) = true];
9035
9036 // Name of the package accessing app op
9037 optional string package_name = 2;
9038
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009039 // deprecated - set to empty string
9040 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009041
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009042 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009043 // API. Attributions must be provided through manifest using <attribution> tag available in R
9044 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009045 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009046
9047 // message related to app op access, limited to 600 chars by API
9048 optional string message = 5;
9049
9050 enum SamplingStrategy {
9051 DEFAULT = 0;
9052 UNIFORM = 1;
9053 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009054 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009055 }
9056
9057 // sampling strategy used to collect this message
9058 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009059
9060 // operation id
9061 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009062}
9063
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009064/*
9065 * Logs userspace reboot outcome and duration.
9066 *
9067 * Logged from:
9068 * frameworks/base/core/java/com/android/server/BootReceiver.java
9069 */
9070message UserspaceRebootReported {
9071 // Possible outcomes of userspace reboot.
9072 enum Outcome {
9073 // Default value in case platform failed to determine the outcome.
9074 OUTCOME_UNKNOWN = 0;
9075 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9076 SUCCESS = 1;
9077 // Userspace reboot shutdown sequence was aborted.
9078 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9079 // Remounting userdata into checkpointing mode failed.
9080 FAILED_USERDATA_REMOUNT = 3;
9081 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9082 // reboot.
9083 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9084 }
9085 // Outcome of userspace reboot. Always set.
9086 optional Outcome outcome = 1;
9087 // Duration of userspace reboot in case it has a successful outcome.
9088 // Duration is measured as time between userspace reboot was initiated and until boot completed
9089 // (e.g. sys.boot_completed=1).
9090 optional int64 duration_millis = 2;
9091 // State of primary user's (user0) credential encryption storage.
9092 enum UserEncryptionState {
9093 // Default value.
9094 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9095 // Credential encrypted storage is unlocked.
9096 UNLOCKED = 1;
9097 // Credential encrypted storage is locked.
9098 LOCKED = 2;
9099 }
9100 // State of primary user's encryption storage at the moment boot completed. Always set.
9101 optional UserEncryptionState user_encryption_state = 3;
9102}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009103
9104/*
9105 * Logs integrity check information during each install.
9106 *
9107 * Logged from:
9108 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9109 */
9110message IntegrityCheckResultReported {
9111 optional string package_name = 1;
9112 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009113 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009114 optional string installer_package_name = 4;
9115 enum Response {
9116 UNKNOWN = 0;
9117 ALLOWED = 1;
9118 REJECTED = 2;
9119 FORCE_ALLOWED = 3;
9120 }
9121 optional Response response = 5;
9122 // An estimate on the cause of the response. This will only be populated for
9123 // REJECTED and FORCE_ALLOWED
9124 optional bool caused_by_app_cert_rule = 6;
9125 optional bool caused_by_installer_rule = 7;
9126}
9127
9128/**
9129 * Logs the information about the rules and the provider whenever rules are
9130 * pushed into AppIntegrityManager.
9131 *
9132 * Logged from:
9133 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9134 */
9135message IntegrityRulesPushed {
9136 optional bool success = 1;
9137 // Package name of the app that pushed the rules.
9138 optional string rule_provider = 2;
9139 // Version string of arbitrary format provided by the rule provider to
9140 // identify the rules.
9141 optional string rule_version = 3;
9142}
Jordan Liubedfa702019-12-20 15:08:45 -08009143
9144/**
9145 * Logs when a cell broadcast message is received on the device.
9146 *
9147 * Logged from CellBroadcastService module:
9148 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9149 */
9150message CellBroadcastMessageReported {
9151 // The type of Cell Broadcast message
9152 enum CbType {
9153 UNKNOWN_TYPE = 0;
9154 GSM = 1;
9155 CDMA = 2;
9156 CDMA_SPC = 3;
9157 }
9158
9159 // GSM, CDMA, CDMA-SCP
9160 optional CbType type = 1;
9161}
9162
9163/**
9164 * Logs when an error occurs while handling a cell broadcast message;
9165 *
9166 * Logged from CellBroadcastService module:
9167 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9168 */
9169message CellBroadcastMessageError {
9170 // The type of error raised when trying to handle a cell broadcast message
9171 enum ErrorType {
9172 UNKNOWN_TYPE = 0;
9173 CDMA_DECODING_ERROR = 1;
9174 CDMA_SCP_EMPTY = 2;
9175 CDMA_SCP_HANDLING_ERROR = 3;
9176 GSM_INVALID_HEADER_LENGTH = 4;
9177 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9178 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9179 GSM_INVALID_PDU = 7;
9180 GSM_INVALID_GEO_FENCING_DATA = 8;
9181 GSM_UMTS_INVALID_WAC = 9;
9182 FAILED_TO_INSERT_TO_DB = 10;
9183 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9184 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9185 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9186 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
9187 }
9188
9189 // What kind of error occurred
9190 optional ErrorType type = 1;
9191
9192 // Exception message (or log message) associated with the error (max 1000 chars)
9193 optional string exception_message = 2;
9194}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009195
9196/**
Henry Fange316ab62020-04-21 18:43:14 -07009197 * Logs when a tune occurs through device's Frontend.
9198 * This is atom ID 276.
9199 *
9200 * Logged from:
9201 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9202 */
9203message TvTunerStateChanged {
9204 enum State {
9205 UNKNOWN = 0;
9206 TUNING = 1; // Signal is tuned
9207 LOCKED = 2; // the signal is locked
9208 NOT_LOCKED = 3; // the signal isn’t locked.
9209 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9210 SCANNING = 5; // the signal is scanned
9211 SCAN_STOPPED = 6; // the scan is stopped.
9212 }
9213 // The uid of the application that sent this custom atom.
9214 optional int32 uid = 1 [(is_uid) = true];
9215 // new state
9216 optional State state = 2;
9217}
9218/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009219 * Logs when an app is frozen or unfrozen.
9220 *
9221 * Logged from:
9222 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9223 */
9224message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009225 // The type of event.
9226 enum Action {
9227 UNKNOWN = 0;
9228 FREEZE_APP = 1;
9229 UNFREEZE_APP = 2;
9230 }
9231 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009232
Blake Kragten6ce382a2020-01-16 20:20:46 -08009233 // Pid of the process being frozen.
9234 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009235
Blake Kragten6ce382a2020-01-16 20:20:46 -08009236 // Name of the process being frozen.
9237 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009238
Blake Kragten6ce382a2020-01-16 20:20:46 -08009239 // Time since last unfrozen.
9240 optional int64 time_unfrozen_millis = 4;
9241}
9242
9243/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009244 * Pulls information for a single voice call.
9245 *
9246 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9247 *
9248 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009249 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009250 */
9251message VoiceCallSession {
9252 // Bearer (IMS or CS) when the call started.
9253 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9254
9255 // Bearer (IMS or CS) when the call ended.
9256 // The bearer may change during the call, e.g. due to SRVCC.
9257 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9258
9259 // Direction of the call (incoming or outgoing).
9260 optional android.telephony.CallDirectionEnum direction = 3;
9261
9262 // Time spent setting up the call.
9263 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9264
9265 // Whether the call ended before the setup was completed.
9266 optional bool setup_failed = 5;
9267
9268 // IMS reason code or CS disconnect cause.
9269 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9270 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9271 optional int32 disconnect_reason_code = 6;
9272
9273 // IMS extra code or CS precise disconnect cause.
9274 // For IMS, this code is vendor-specific
9275 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9276 optional int32 disconnect_extra_code = 7;
9277
9278 // IMS extra message or CS vendor cause.
9279 optional string disconnect_extra_message = 8;
9280
9281 // Radio access technology (RAT) used when call started.
9282 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9283
9284 // Radio access technology (RAT) used when call terminated.
9285 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9286
9287 // Number of times RAT changed during the call.
9288 optional int64 rat_switch_count = 11;
9289
9290 // A bitmask of all codecs used during the call.
9291 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9292 optional int64 codec_bitmask = 12;
9293
9294 // Number of other calls going on during call setup, for the same SIM slot.
9295 optional int32 concurrent_call_count_at_start = 13;
9296
9297 // Number of other calls going on during call termination, for the same SIM slot.
9298 optional int32 concurrent_call_count_at_end = 14;
9299
9300 // Index of the SIM is used, 0 for single-SIM devices.
9301 optional int32 sim_slot_index = 15;
9302
9303 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9304 optional bool is_multi_sim = 16;
9305
9306 // Whether the call was made with an eSIM profile.
9307 optional bool is_esim = 17;
9308
9309 // Carrier ID of the SIM card.
9310 // See https://source.android.com/devices/tech/config/carrierid.
9311 optional int32 carrier_id = 18;
9312
Chi Zhangba1b03a2020-04-21 17:17:56 -07009313 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009314 optional bool srvcc_completed = 19;
9315
9316 // Number of SRVCC failures.
9317 optional int64 srvcc_failure_count = 20;
9318
9319 // Number of SRVCC cancellations.
9320 optional int64 srvcc_cancellation_count = 21;
9321
Chi Zhangba1b03a2020-04-21 17:17:56 -07009322 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9323 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009324 optional bool rtt_enabled = 22;
9325
9326 // Whether this was an emergency call.
9327 optional bool is_emergency = 23;
9328
9329 // Whether the call was performed while roaming.
9330 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009331
9332 // A random number used as the dimension field to pull multiple atoms.
9333 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009334}
9335
9336/**
9337 * Pulls voice call radio access technology (RAT) usage.
9338 *
9339 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9340 * time. The atom will be skipped if not enough data is available.
9341 *
9342 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009343 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009344 */
9345message VoiceCallRatUsage {
9346 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9347 optional int32 carrier_id = 1;
9348
9349 // Radio access technology.
9350 optional android.telephony.NetworkTypeEnum rat = 2;
9351
9352 // Total duration that voice calls spent on this carrier and RAT.
9353 optional int64 total_duration_seconds = 3;
9354
9355 // Total number of calls using this carrier and RAT.
9356 // A call is counted once even if it used the RAT multiple times.
9357 optional int64 call_count = 4;
9358}
9359
9360/**
9361 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9362 *
9363 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009364 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009365 */
9366message SimSlotState {
9367 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9368 optional int32 active_slot_count = 1;
9369
9370 // Number of SIM cards (both physical and active eSIM profiles).
9371 // This number is always equal to or less than the number of active SIM slots.
9372 optional int32 sim_count = 2;
9373
9374 // Number of active eSIM profiles.
9375 // This number is always equal to or less than the number of SIMs.
9376 optional int32 esim_count = 3;
9377}
9378
9379/**
9380 * Pulls supported cellular radio access technologies.
9381 *
9382 * This atom reports the capabilities of the device, rather than the network it has access to.
9383 *
9384 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009385 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009386 */
9387message SupportedRadioAccessFamily {
9388 // A bitmask of supported radio technologies.
9389 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9390 optional int64 network_type_bitmask = 1;
9391}
9392
9393/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009394 * Logs gnss stats from location service provider
9395 *
9396 * Pulled from:
9397 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9398 */
9399
9400message GnssStats {
9401 // Number of location reports since boot
9402 optional int64 location_reports = 1;
9403
9404 // Total pulled reports of Location failures since boot
9405 optional int64 location_failure_reports = 2;
9406
9407 // Number of time to first fix reports since boot
9408 optional int64 time_to_first_fix_reports = 3;
9409
9410 // Total pulled reported time to first fix (in milli-seconds) since boot
9411 optional int64 time_to_first_fix_milli_s = 4;
9412
9413 // Number of position accuracy reports since boot
9414 optional int64 position_accuracy_reports = 5;
9415
9416 // Total pulled reported position accuracy (in meters) since boot
9417 optional int64 position_accuracy_meters = 6;
9418
9419 // Number of top 4 average CN0 reports since boot
9420 optional int64 top_four_average_cn0_reports = 7;
9421
9422 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9423 optional int64 top_four_average_cn0_db_mhz = 8;
9424
9425 // Number of l5 top 4 average CN0 reports since boot
9426 optional int64 l5_top_four_average_cn0_reports = 9;
9427
9428 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9429 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9430
9431 // Total number of sv status messages reports since boot
9432 optional int64 sv_status_reports = 11;
9433
9434 // Total number of sv status messages reports, where sv is used in fix since boot
9435 optional int64 sv_status_reports_used_in_fix = 12;
9436
9437 // Total number of L5 sv status messages reports since boot
9438 optional int64 l5_sv_status_reports = 13;
9439
9440 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9441 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009442}
Kweku Adams12752132020-02-18 15:36:48 -08009443
9444/**
9445 * Logs when an app is moved to a different standby bucket.
9446 *
9447 * Logged from:
9448 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9449 */
9450message AppStandbyBucketChanged {
9451 optional string package_name = 1;
9452
9453 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9454 optional int32 user_id = 2;
9455
9456 // These enum values match the constants defined in UsageStatsManager.java.
9457 enum Bucket {
9458 BUCKET_UNKNOWN = 0;
9459 BUCKET_EXEMPTED = 5;
9460 BUCKET_ACTIVE = 10;
9461 BUCKET_WORKING_SET = 20;
9462 BUCKET_FREQUENT = 30;
9463 BUCKET_RARE = 40;
9464 BUCKET_RESTRICTED = 45;
9465 BUCKET_NEVER = 50;
9466 }
9467 optional Bucket bucket = 3;
9468
9469 enum MainReason {
9470 MAIN_UNKNOWN = 0;
9471 MAIN_DEFAULT = 0x0100;
9472 MAIN_TIMEOUT = 0x0200;
9473 MAIN_USAGE = 0x0300;
9474 MAIN_FORCED_BY_USER = 0x0400;
9475 MAIN_PREDICTED = 0x0500;
9476 MAIN_FORCED_BY_SYSTEM = 0x0600;
9477 }
9478 optional MainReason main_reason = 4;
9479
9480 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9481 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9482 // UsageStatsManager.java.
9483 optional int32 sub_reason = 5;
9484}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009485
9486/**
9487* Reports a started sharesheet transaction.
9488*
9489* Logged from:
9490* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9491*/
9492message SharesheetStarted {
9493 // The event_id (as for UiEventReported).
9494 optional int32 event_id = 1;
9495 // The calling app's package name.
9496 optional string package_name = 2;
9497 // An identifier to tie together multiple logs relating to the same share event
9498 optional int32 instance_id = 3;
9499 // The mime type of the share
9500 optional string mime_type = 4;
9501 // The number of direct targets the calling app is providing that will be shown.
9502 optional int32 num_app_provided_direct_targets = 5;
9503 // The number of app targets the calling app is providing that will be shown.
9504 optional int32 num_app_provided_app_targets = 6;
9505 // True if the share originates from the workprofile
9506 optional bool is_workprofile = 7;
9507
9508 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009509 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009510 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9511 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9512 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9513 }
9514 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009515 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009516
9517 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9518 INTENT_DEFAULT = 0;
9519 INTENT_ACTION_VIEW = 1;
9520 INTENT_ACTION_EDIT = 2;
9521 INTENT_ACTION_SEND = 3;
9522 INTENT_ACTION_SENDTO = 4;
9523 INTENT_ACTION_SEND_MULTIPLE = 5;
9524 INTENT_ACTION_IMAGE_CAPTURE = 6;
9525 INTENT_ACTION_MAIN = 7;
9526 }
9527 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009528 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009529}
9530
9531/**
9532 * Reports a ranking selection event.
9533 *
9534 * Logged from:
9535 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9536 */
9537message RankingSelected {
9538 // The event_id (as for UiEventReported).
9539 optional int32 event_id = 1;
9540 // The relevant app's package name (can be source or picked package).
9541 optional string package_name = 2;
9542 // An identifier to tie together multiple logs relating to the same share event.
9543 optional int32 instance_id = 3;
9544 // Which of the ranked targets got picked, default starting position 0.
9545 optional int32 position_picked = 4;
9546}
Raff Tsaiea4db182020-03-06 07:45:43 +08009547
9548/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009549 * Logs when TvSettings UI is interacted at.
9550 *
9551 * Logged from: packages/apps/TvSettings
9552 */
9553message TvSettingsUIInteracted {
9554
9555 /** The UI action category */
9556 optional android.app.tvsettings.Action action = 1;
9557
9558 /** The ID of the entry that the users actioned on */
9559 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009560}
9561
9562/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009563 * Logs information about a package installation using package installer V2 APIs.
9564 *
9565 * Logged from:
9566 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9567 */
9568message PackageInstallerV2Reported {
9569 // Whether this installation uses Incremental File System
9570 optional bool is_incremental = 1;
9571 // Name of the package that is intended to be installed
9572 optional string package_name = 2;
9573 // The duration between when the install was requested to when the install has completed
9574 optional int64 duration_millis = 3;
9575 // Installation result in final integer, which are SystemApi's.
9576 // Return_code 1 indicates success.
9577 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9578 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009579 // Total size of the APKs installed for this package
9580 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009581}
9582
9583/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009584 * Logs settings provider values.
9585 *
9586 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9587 * then write the value to proto.
9588 *
9589 */
9590message SettingSnapshot {
9591
9592 // Setting key
9593 optional string name = 1;
9594
9595 enum SettingsValueType {
9596 NOTASSIGNED = 0;
9597 ASSIGNED_BOOL_TYPE = 1;
9598 ASSIGNED_INT_TYPE = 2;
9599 ASSIGNED_FLOAT_TYPE = 3;
9600 ASSIGNED_STRING_TYPE = 4;
9601 };
9602 // Setting value type
9603 optional SettingsValueType type = 2;
9604
9605 optional bool bool_value = 3;
9606
9607 optional int32 int_value = 4;
9608
9609 optional float float_value = 5;
9610
9611 optional string str_value = 6;
9612
9613 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9614 optional int32 user_id = 7;
9615}
Varun Shahacb56342019-12-18 11:45:38 -08009616
9617/**
9618 * An event logged to indicate that a user journey is about to be performed. This atom includes
9619 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9620 * will immediately follow this atom which will describe the event(s) and its state.
9621 *
9622 * Logged from:
9623 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9624 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9625 */
9626message UserLifecycleJourneyReported {
9627 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9628 // UserLifecycleEventOccurred atom)
9629 optional int64 session_id = 1;
9630
9631 // Indicates what type of user journey this session is related to
9632 enum Journey {
9633 UNKNOWN = 0; // Undefined user lifecycle journey
9634 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9635 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9636 USER_START = 3; // A user start journey
9637 USER_CREATE = 4; // A user creation journey
9638 }
9639 optional Journey journey = 2;
9640 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9641 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9642 optional int32 origin_user = 3;
9643 // Which user the journey is targeting
9644 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9645 optional int32 target_user = 4;
9646
9647 // What is the user type of the target user
9648 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9649 enum UserType {
9650 TYPE_UNKNOWN = 0;
9651 FULL_SYSTEM = 1;
9652 FULL_SECONDARY = 2;
9653 FULL_GUEST = 3;
9654 FULL_DEMO = 4;
9655 FULL_RESTRICTED = 5;
9656 PROFILE_MANAGED = 6;
9657 SYSTEM_HEADLESS = 7;
9658 }
9659 optional UserType user_type = 5;
9660 // What are the flags attached to the target user
9661 optional int32 user_flags = 6;
9662}
9663
9664/**
9665 * An event logged when a specific user lifecycle event is performed. These events should be
9666 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9667 * Note: journeys can span over multiple events, hence some events may share a single session id.
9668 *
9669 * Logged from:
9670 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9671 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9672 */
9673message UserLifecycleEventOccurred {
9674 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9675 optional int64 session_id = 1;
9676 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9677 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9678 optional int32 user_id = 2;
9679
9680 enum Event {
9681 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9682 SWITCH_USER = 1; // Indicates that this is a user switch event
9683 START_USER = 2; // Indicates that this is a user start event
9684 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -07009685 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
9686 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
9687 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -08009688 }
9689 optional Event event = 3;
9690
9691 enum State {
9692 NONE = 0; // Indicates the associated event has no start/end defined
9693 BEGIN = 1;
9694 FINISH = 2;
9695 }
9696 optional State state = 4; // Represents the state of an event (beginning/ending)
9697}
jasonwshsu81173e32020-03-27 15:22:03 +08009698
9699/**
9700 * Logs when accessibility shortcut clicked.
9701 *
9702 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009703 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009704 */
9705message AccessibilityShortcutReported {
9706 // The accessibility feature(including installed a11y service, framework a11y feature,
9707 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9708 optional string package_name = 1;
9709
9710 // The definition of the accessibility shortcut.
9711 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9712 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9713
9714 // The definition of the service status.
9715 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9716 optional android.stats.accessibility.ServiceStatus service_status = 3;
9717}
9718
9719/**
9720 * Logs when accessibility service status changed.
9721 *
9722 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009723 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009724 */
9725message AccessibilityServiceReported {
9726 // The accessibility service package name.
9727 optional string package_name = 1;
9728
9729 // The definition of the service status.
9730 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9731 optional android.stats.accessibility.ServiceStatus service_status = 2;
9732}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009733
Denny cy Lee57b31282020-04-17 10:08:52 +08009734message DisplayWakeReason {
9735 // Wake_up_reason code
9736 // If LOWORD(wake_up_reason) = 0
9737 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9738 // else reference wake_up_reason to
9739 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9740 optional int32 wake_up_reason = 1;
9741 // Count of wake up by reason
9742 optional int32 wake_times = 2;
9743}
9744
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009745/**
9746 * Logs app usage events.
9747 */
9748message AppUsageEventOccurred {
9749 optional int32 uid = 1 [(is_uid) = true];
9750 optional string package_name = 2;
9751 optional string class_name = 3;
9752
9753 enum EventType {
9754 NONE = 0;
9755 MOVE_TO_FOREGROUND = 1;
9756 MOVE_TO_BACKGROUND = 2;
9757 }
9758 optional EventType event_type = 4;
9759}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009760
9761/*
9762 * Quality metrics logged when EVS cameras are active.
9763 *
9764 * Logged from:
9765 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9766 */
9767message EvsUsageStatsReported {
9768
9769 // Camera identifier to distinguish the source camera device. This is not
9770 // globally unique and therefore cannot be used to identify the user and/or
9771 // the device.
9772 optional int32 device_id = 1;
9773
9774 // Peak number of clients during the service
9775 optional int32 peak_num_clients = 2;
9776
9777 // Number of erroneous events during the service
9778 optional int32 num_errors = 3;
9779
9780 // Round trip latency of the very first frame
9781 optional int64 first_latency_millis = 4;
9782
9783 // Average frame round trip latency
9784 optional float avg_latency_millis = 5;
9785
9786 // Peak frame round trip latency
9787 optional int64 peak_latency_millis = 6;
9788
9789 // Total number of frames received
9790 optional int64 total_frames = 7;
9791
9792 // Number of frames ignored
9793 optional int64 ignored_frames = 8;
9794
9795 // Number of dropped frames to synchronize camera devices
9796 optional int64 dropped_frames_to_sync = 9;
9797
9798 // The duration of the service
9799 optional int64 duration_millis = 10;
9800}
Robert Leecccdc152020-04-23 13:22:46 +08009801
9802/**
9803 * Logs audio power usage stats.
9804 *
9805 * Pushed from:
9806 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9807 */
9808message AudioPowerUsageDataReported {
9809 /**
9810 * Device used for input/output
9811 *
9812 * All audio devices please refer to below file:
9813 * system/media/audio/include/system/audio-base.h
9814 *
9815 * Define our own enum values because we don't report all audio devices.
9816 * Currently, we only report built-in audio devices such as handset, speaker,
9817 * built-in mics, common audio devices such as wired headset, usb headset
9818 * and bluetooth devices.
9819 */
9820 enum AudioDevice {
9821 OUTPUT_EARPIECE = 0x1; // handset
9822 OUTPUT_SPEAKER = 0x2; // dual speaker
9823 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9824 OUTPUT_USB_HEADSET = 0x8; // usb headset
9825 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9826 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9827 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9828
9829 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9830 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9831 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9832 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9833 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9834 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9835 }
9836 optional AudioDevice audio_device = 1;
9837
9838 // Duration of the audio in seconds
9839 optional int32 duration_secs = 2;
9840
9841 // Average volume (0 ... 1.0)
9842 optional float average_volume = 3;
9843
9844 enum AudioType {
9845 UNKNOWN_TYPE = 0;
9846 VOICE_CALL_TYPE = 1; // voice call
9847 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9848 MEDIA_TYPE = 3; // music and system sound
9849 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9850 ALARM_TYPE = 5; // alarm type
9851 // record type
9852 CAMCORDER_TYPE = 6; // camcorder
9853 RECORD_TYPE = 7; // other recording
9854 }
9855 optional AudioType type = 4;
9856}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009857
9858/**
9859 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9860 *
9861 * Pulled from:
9862 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9863 */
9864message BytesTransferByTagAndMetered {
9865 optional int32 uid = 1 [(is_uid) = true];
9866
9867 optional bool is_metered = 2;
9868
9869 optional int32 tag = 3;
9870
9871 optional int64 rx_bytes = 4;
9872
9873 optional int64 rx_packets = 5;
9874
9875 optional int64 tx_bytes = 6;
9876
9877 optional int64 tx_packets = 7;
9878}
Robert Luo2f52f042020-05-11 16:39:24 +08009879
9880/*
9881 * Logs when the Media Output Switcher finishes a media switch operation.
9882 *
9883 * Logged from:
9884 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9885 */
9886message MediaOutputOpSwitchReported {
9887 // Source medium type before switching.
9888 optional android.app.settings.mediaoutput.MediumType source = 1;
9889
9890 // Target medium type after switching.
9891 optional android.app.settings.mediaoutput.MediumType target = 2;
9892
9893 // The result of switching.
9894 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9895
9896 // The detail code of a switching result.
9897 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9898
9899 /*
9900 * The package name of a pre-installed app, whose media session is being switched.
9901 */
9902 optional string media_session_package_name = 5;
9903
9904 // The amount of available wired devices when a switching is being performed.
9905 optional int32 available_wired_device_count = 6;
9906
9907 // The amount of available Bluetooth devices a switching is being performed.
9908 optional int32 available_bt_device_count = 7;
9909
9910 // The amount of available remote devices when a switching is being performed.
9911 optional int32 available_remote_device_count = 8;
9912
9913 // The amount of applied devices within a remote dynamic group after a switching is done.
9914 optional int32 applied_device_count_within_remote_group = 9;
9915}