blob: 9abae528b4743d7ab8d12d54d366715e5421c957 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Robert Luo2f52f042020-05-11 16:39:24 +080027import "frameworks/base/core/proto/android/app/media_output_enum.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070028import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080029import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080030import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080031import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080032import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080033import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080034import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080035import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080036import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080039import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080040import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080041import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080042import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080044import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080045import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080046import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070049import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080050import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070051import "frameworks/base/core/proto/android/stats/enums.proto";
52import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070053import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070054import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080055import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070056import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000057import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080058import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050059import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080060import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080061import "frameworks/base/core/proto/android/telephony/enums.proto";
62import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080063import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010064import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070065import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080066
Yao Chend54f9dd2017-10-17 17:37:48 +000067/**
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * raw stats log events from the Android system, also known as "atoms."
70 *
71 * This field contains a single oneof with all of the available messages.
72 * The stats-log-api-gen tool runs as part of the Android build and
73 * generates the android.util.StatsLog class, which contains the constants
74 * and methods that Android uses to log.
75 *
Stefan Lafonae2df012017-11-14 09:17:21 -080076 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000077 * Instead, statsd on Android constructs these messages synthetically,
78 * in the format defined here and in stats_log.proto.
79 */
Stefan Lafonae2df012017-11-14 09:17:21 -080080message Atom {
81 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070082 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070083 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070084 BleScanStateChanged ble_scan_state_changed = 2
85 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080087 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SensorStateChanged sensor_state_changed =
89 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080090 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070091 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
92 ScheduledJobStateChanged scheduled_job_state_changed =
93 8 [(module) = "framework", (module) = "statsdtest"];
94 ScreenBrightnessChanged screen_brightness_changed =
95 9 [(module) = "framework", (module) = "statsdtest"];
96 WakelockStateChanged wakelock_state_changed =
97 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080098 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
99 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700100 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
101 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800102 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
103 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
104 14 [(module) = "framework"];
105 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
106 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
107 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
108 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800109 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700110 BatterySaverModeStateChanged battery_saver_mode_state_changed =
111 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800112 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
113 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700114 AudioStateChanged audio_state_changed =
115 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
117 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
118 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700119 UidProcessStateChanged uid_process_state_changed =
120 27 [(module) = "framework", (module) = "statsdtest"];
121 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
122 28 [(module) = "framework", (module) = "statsdtest"];
123 ScreenStateChanged screen_state_changed =
124 29 [(module) = "framework", (module) = "statsdtest"];
125 BatteryLevelChanged battery_level_changed =
126 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800127 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800128 PluggedStateChanged plugged_state_changed = 32
129 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800131 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800132 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
133 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800134 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
135 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
136 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700137 PhoneSignalStrengthChanged phone_signal_strength_changed =
138 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 SettingChanged setting_changed = 41 [(module) = "framework"];
140 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 42 [(module) = "framework", (module) = "statsdtest"];
142 IsolatedUidChanged isolated_uid_changed =
143 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800144 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
145 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800146 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800147 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800148 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700149 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800150 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
151 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800152 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800153 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800154 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800155 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800156 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
157 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800158 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800159 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700160 OverlayStateChanged overlay_state_changed =
161 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 ForegroundServiceStateChanged foreground_service_state_changed
163 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700164 CallStateChanged call_state_changed =
165 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800166 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
167 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
168 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800169 AppDied app_died = 65 [(module) = "framework"];
170 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
171 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800172 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
173 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
175 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800176 SpeakerImpedanceReported speaker_impedance_reported = 71;
177 HardwareFailed hardware_failed = 72;
178 PhysicalDropDetected physical_drop_detected = 73;
179 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800180 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
181 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700183 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ANROccurred anr_occurred = 79 [(module) = "framework"];
185 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
186 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700187 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800189 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800190 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
191 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700192 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800193 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
194 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
195 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
196 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700197 BatteryHealthSnapshot battery_health_snapshot = 91;
198 SlowIo slow_io = 92;
199 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100202 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800203 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700205 // TODO: service state change is very noisy shortly after boot, as well
206 // as at other transitions - coming out of doze, device plugged in, etc.
207 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
209 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
210 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800211 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800212 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800213 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
214 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
215 105 [(module) = "docsui"];
216 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
217 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
218 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
219 108 [(module) = "docsui"];
220 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
221 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
222 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
223 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800225 WifiRunningStateChanged wifi_running_state_changed = 114
226 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800229 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800230 117 [(module) = "docsui"];
231 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
232 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
233 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
234 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
236 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
237 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800238 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
239 125 [(module) = "bluetooth"];
240 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
241 126 [(module) = "bluetooth"];
242 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
243 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000245 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800246 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
247 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
248 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800249 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800250 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
251 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
252 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
253 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
254 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
255 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800256 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
257 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
259 142 [(module) = "framework"];
260 AttentionManagerServiceResultReported attention_manager_service_result_reported =
261 143 [(module) = "framework"];
262 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800263 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800264 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800265 WatchdogRollbackOccurred watchdog_rollback_occurred =
266 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800267 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
268 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800269 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800270 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
271 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800272 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
273 151 [(module) = "bluetooth"];
274 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
275 152 [(module) = "bluetooth"];
276 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
277 153 [(module) = "bluetooth"];
278 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
279 154 [(module) = "bluetooth"];
280 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
281 155 [(module) = "bluetooth"];
282 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
283 156 [(module) = "bluetooth"];
284 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
285 157 [(module) = "bluetooth"];
286 BluetoothDeviceFailedContactCounterReported
287 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
288 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
289 159 [(module) = "bluetooth"];
290 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
291 160 [(module) = "bluetooth"];
292 BluetoothQualityReportReported bluetooth_quality_report_reported =
293 161 [(module) = "bluetooth"];
294 BluetoothDeviceInfoReported bluetooth_device_info_reported =
295 162 [(module) = "bluetooth"];
296 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
297 163 [(module) = "bluetooth"];
298 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
299 164 [(module) = "bluetooth"];
300 BluetoothBondStateChanged bluetooth_bond_state_changed =
301 165 [(module) = "bluetooth"];
302 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
303 166 [(module) = "bluetooth"];
304 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
305 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
307 168 [(module) = "framework"];
308 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700309 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800311 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800312 DeviceIdentifierAccessDenied device_identifier_access_denied =
313 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800315 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
316 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
317 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
319 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700321 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 180 [(module) = "permissioncontroller"];
323 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
324 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800326 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
327 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
328 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
329 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800330 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
331 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700332 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 188 [(module) = "intelligence"];
334 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
335 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800336 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800337 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800338 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
339 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
340 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
341 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
342 MediametricsCodecReported mediametrics_codec_reported = 195;
343 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
344 MediametricsExtractorReported mediametrics_extractor_reported = 197;
345 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
346 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
347 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700348 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800349 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
350 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800351 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
353 206 [(module) = "framework"];
354 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
355 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
356 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
357 LocationManagerApiUsageReported location_manager_api_usage_reported =
358 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100361 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100363 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100365 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100367 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100369 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100371 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100373 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
376 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
377 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
378 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800380 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700381 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
382 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100384 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800385 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800387 VmsClientConnectionStateChanged vms_client_connection_state_changed =
388 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100389 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
390 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
391 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800392 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100393 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
394 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800395 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800396 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
397 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
398 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
399 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800400 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000402 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800403 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500404 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
405 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800406 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
407 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800408 CellBroadcastMessageReported cb_message_reported =
409 249 [(module) = "cellbroadcast"];
410 CellBroadcastMessageError cb_message_error =
411 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700412 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
413 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
414 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800415 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000416 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800417 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
418 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800419 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800420 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500421 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
422 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700449
450 // StatsdStats tracks platform atoms with ids upto 500.
451 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000452 }
David Chenc8a43242017-10-17 16:23:28 -0700453
David Chen6e3e6cb2018-01-03 16:14:06 -0800454 // Pulled events will start at field 10000.
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700455 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700456 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
458 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700459 MobileBytesTransfer mobile_bytes_transfer =
460 10002 [(module) = "framework", (truncate_timestamp) = true];
461 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
462 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
464 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700465 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700467 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800468 CpuTimePerUidFreq cpu_time_per_uid_freq =
469 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800470 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
471 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
472 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
473 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
474 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700475 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700476 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700477 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700478 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800479 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
480 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700481 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800482 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800483 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800484 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 DiskStats disk_stats = 10025 [(module) = "framework"];
486 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
487 AppSize app_size = 10027 [(module) = "framework"];
488 CategorySize category_size = 10028 [(module) = "framework"];
489 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800490 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800491 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
492 DiskIo disk_io = 10032 [(module) = "framework"];
493 PowerProfile power_profile = 10033 [(module) = "framework"];
494 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
495 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
496 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700497 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800498 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
499 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
500 10040 [(module) = "framework"];
501 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
502 10041 [(module) = "framework"];
503 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800504 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800505 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800506 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
508 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
509 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
510 RoleHolder role_holder = 10049 [(module) = "framework"];
511 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800512 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800513 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
514 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800515 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
516 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800517 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
518 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
519 FaceSettings face_settings = 10058 [(module) = "framework"];
520 CoolingDevice cooling_device = 10059 [(module) = "framework"];
521 AppOps app_ops = 10060 [(module) = "framework"];
522 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700523 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
524 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800525 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800526 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800527 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
528 DangerousPermissionStateSampled dangerous_permission_state_sampled =
529 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400530 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000531 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000532 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200533 PackageNotificationPreferences package_notification_preferences =
534 10071 [(module) = "framework"];
535 PackageNotificationChannelPreferences package_notification_channel_preferences =
536 10072 [(module) = "framework"];
537 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
538 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800539 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800540 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700541 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
542 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
543 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
544 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800545 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Lee57b31282020-04-17 10:08:52 +0800546 DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800547 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700548 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
549 10083 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700550 }
yroa1fe77c2018-02-26 14:22:54 -0800551
Bookatz76aafcf2018-09-17 16:17:10 -0700552 // DO NOT USE field numbers above 100,000 in AOSP.
553 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
554 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100555
556 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700557}
558
Yao Chend54f9dd2017-10-17 17:37:48 +0000559/**
Yangster-mac20877162017-12-22 17:19:39 -0800560 * This proto represents a node of an attribution chain.
561 * Note: All attribution chains are represented as a repeated field of type
562 * AttributionNode. It is understood that in such arrays, the order is that
563 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000564 */
Yangster-mac20877162017-12-22 17:19:39 -0800565message AttributionNode {
566 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800567 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800568
Yangster-mac20877162017-12-22 17:19:39 -0800569 // The (optional) string tag for an element in the attribution chain. If the
570 // element has no tag, it is encoded as an empty string.
571 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700572}
573
Yangster-mac48b3d622018-08-18 12:38:11 -0700574message KeyValuePair {
575 optional int32 key = 1;
576 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700577 int32 value_int = 2;
578 int64 value_long = 3;
579 string value_str = 4;
580 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700581 }
582}
583
584message KeyValuePairsAtom {
585 optional int32 uid = 1;
586 repeated KeyValuePair pairs = 2;
587}
588
Yao Chend54f9dd2017-10-17 17:37:48 +0000589/*
590 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800591 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000592 *
593 * RULES:
594 * - The field ids for each atom must start at 1, and count upwards by 1.
595 * Skipping field ids is not allowed.
596 * - These form an API, so renaming, renumbering or removing fields is
597 * not allowed between android releases. (This is not currently enforced,
598 * but there will be a tool to enforce this restriction).
599 * - The types must be built-in protocol buffer types, namely, no sub-messages
600 * are allowed (yet). The bytes type is also not allowed.
601 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800602 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000603 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800604 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000605 * - A field that is a uid should be a string field, tagged with the [xxx]
606 * annotation. The generated code on android will be represented by UIDs,
607 * and those UIDs will be translated in xxx to those strings.
608 *
609 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700610 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000611 * - If there is a UID, it goes first. Think in an object-oriented fashion.
612 * *****************************************************************************
613 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700614
Yao Chend54f9dd2017-10-17 17:37:48 +0000615/**
Tej Singha72344992019-04-17 18:55:08 -0700616 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700617 * Logs when the Thermal service HAL notifies the throttling start/stop events.
618 *
619 * Logged from:
620 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
621 */
622message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700623 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700624 optional android.os.TemperatureTypeEnum sensor_type = 1;
625
Maggie White442b6312019-04-05 16:26:44 -0700626 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700627 enum State {
628 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700629 START = 1; // START indicated that throttling was triggered.
630 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700631 }
Yangster-mace16189a2018-08-26 12:20:16 -0700632 optional State state = 2;
633
634 optional float temperature = 3;
635}
636
637/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000638 * Logs when the screen state changes.
639 *
640 * Logged from:
641 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
642 */
643message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800644 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800645 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700646 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700647}
Yao Chend54f9dd2017-10-17 17:37:48 +0000648
649/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700650 * Logs that the process state of the uid, as determined by ActivityManager
651 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000652 *
653 * Logged from:
654 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
655 */
Bookatzc1a050a2017-10-10 15:49:28 -0700656message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700657 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000658
Bookatzdb026a22018-01-10 19:01:56 -0800659 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800660 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700661 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000662}
663
664/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700665 * Logs process state change of a process, as per the activity manager.
666 *
667 * Logged from:
668 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
669 */
670message ProcessStateChanged {
671 optional int32 uid = 1;
672 optional string process_name = 2;
673 optional string package_name = 3;
674 // TODO: remove this when validation is done
675 optional int64 version = 5;
676 // The state, from frameworks/base/core/proto/android/app/enums.proto.
677 optional android.app.ProcessStateEnum state = 4;
678}
679
680/**
681 * Logs when ActivityManagerService sleep state is changed.
682 *
683 * Logged from:
684 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
685 */
686message ActivityManagerSleepStateChanged {
687 // TODO: import frameworks proto
688 enum State {
689 UNKNOWN = 0;
690 ASLEEP = 1;
691 AWAKE = 2;
692 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700693 optional State state = 1
694 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700695}
696
697/**
698 * Logs when system memory state changes.
699 *
700 * Logged from:
701 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
702 */
703message MemoryFactorStateChanged {
704 // TODO: import frameworks proto
705 enum State {
706 MEMORY_UNKNOWN = 0;
707 NORMAL = 1; // normal.
708 MODERATE = 2; // moderate memory pressure.
709 LOW = 3; // low memory.
710 CRITICAL = 4; // critical memory.
711
712 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700713 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700714}
715
716/**
717 * Logs when app is using too much cpu, according to ActivityManagerService.
718 *
719 * Logged from:
720 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
721 */
722message ExcessiveCpuUsageReported {
723 optional int32 uid = 1;
724 optional string process_name = 2;
725 optional string package_name = 3;
726 // package version. TODO: remove this when validation is done
727 optional int64 version = 4;
728}
729
730/**
731 * Logs when a cached process is killed, along with its pss.
732 *
733 * Logged from:
734 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
735 */
736message CachedKillReported {
737 optional int32 uid = 1;
738 optional string process_name = 2;
739 optional string package_name = 3;
740 // TODO: remove this when validation is done
741 optional int64 version = 5;
742 optional int64 pss = 4;
743}
744
745/**
xshu2c3d9e42019-09-26 17:54:02 -0700746 * Logs the change in wifi health.
747 *
748 * Logged from:
749 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
750 */
751message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800752 enum Band {
753 UNKNOWN = 0;
754 // All of 2.4GHz band
755 BAND_2G = 1;
756 // Frequencies in the range of [5150, 5250) GHz
757 BAND_5G_LOW = 2;
758 // Frequencies in the range of [5250, 5725) GHz
759 BAND_5G_MIDDLE = 3;
760 // Frequencies in the range of [5725, 5850) GHz
761 BAND_5G_HIGH = 4;
762 // Frequencies in the range of [5925, 6425) GHz
763 BAND_6G_LOW = 5;
764 // Frequencies in the range of [6425, 6875) GHz
765 BAND_6G_MIDDLE = 6;
766 // Frequencies in the range of [6875, 7125) GHz
767 BAND_6G_HIGH = 7;
768 }
xshu2c3d9e42019-09-26 17:54:02 -0700769 // duration this stat is obtained over in milliseconds
770 optional int32 duration_millis = 1;
771 // whether wifi is classified as sufficient for the user's data traffic, determined
772 // by whether the calculated throughput exceeds the average demand within |duration_millis|
773 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700774 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800775 optional bool is_cell_data_available = 3;
776 // the Band bucket the connected network is on
777 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700778}
779
780/**
781 * Logged when wifi detects a significant change in connection failure rate.
782 *
783 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
784 *
785 */
786message WifiFailureStatReported {
787 enum AbnormalityType {
788 UNKNOWN = 0;
789 SIGNIFICANT_INCREASE = 1;
790 SIGNIFICANT_DECREASE = 2;
791 SIMPLY_HIGH = 3;
792 }
793 enum FailureType {
794 FAILURE_UNKNOWN = 0;
795 FAILURE_CONNECTION = 1;
796 FAILURE_ASSOCIATION_REJECTION = 2;
797 FAILURE_ASSOCIATION_TIMEOUT = 3;
798 FAILURE_AUTHENTICATION = 4;
799 FAILURE_NON_LOCAL_DISCONNECTION = 5;
800 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
801 }
802 // Reason for uploading this stat
803 optional AbnormalityType abnormality_type = 1;
804 // The particular type of failure
805 optional FailureType failure_type = 2;
806 // How many times we have encountered this combination of AbnormalityType and FailureType
807 optional int32 failure_count = 3;
808}
809
810/**
811 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
812 *
813 * Logged from:
814 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
815 */
816message WifiConnectionResultReported {
817 enum FailureCode {
818 FAILURE_UNKNOWN = 0;
819 FAILURE_ASSOCIATION_TIMEOUT = 1;
820 FAILURE_ASSOCIATION_REJECTION = 2;
821 FAILURE_AUTHENTICATION_GENERAL = 3;
822 FAILURE_AUTHENTICATION_EAP = 4;
823 FAILURE_DHCP = 5;
824 FAILURE_NETWORK_DISCONNECTION = 6;
825 FAILURE_ROAM_TIMEOUT = 7;
826 }
827 // true represents a successful connection
828 optional bool connection_result = 1;
829 // reason for the connection failure
830 optional FailureCode failure_code = 2;
831 // scan rssi before the connection attempt
832 optional int32 rssi = 3;
833}
834
835/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700836 * Logs when memory stats of a process is reported.
837 *
838 * Logged from:
839 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
840 */
841message ProcessMemoryStatReported {
842 optional int32 uid = 1;
843 optional string process_name = 2;
844 optional string package_name = 3;
845 //TODO: remove this when validation is done
846 optional int64 version = 9;
847 optional int64 pss = 4;
848 optional int64 uss = 5;
849 optional int64 rss = 6;
850 enum Type {
851 ADD_PSS_INTERNAL_SINGLE = 0;
852 ADD_PSS_INTERNAL_ALL_MEM = 1;
853 ADD_PSS_INTERNAL_ALL_POLL = 2;
854 ADD_PSS_EXTERNAL = 3;
855 ADD_PSS_EXTERNAL_SLOW = 4;
856 }
857 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800858 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700859}
860
861/**
Bookatzc1a050a2017-10-10 15:49:28 -0700862 * Logs that a process started, finished, crashed, or ANRed.
863 *
864 * Logged from:
865 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
866 */
867message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700868 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700869
David Chen0b5c90c2018-01-25 16:51:49 -0800870 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800871 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700872
Bookatzddccf0a2017-11-28 16:48:14 -0800873 // What lifecycle state the process changed to.
874 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875 enum State {
876 FINISHED = 0;
877 STARTED = 1;
878 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800879 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800880 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700881}
882
Bookatzc1a050a2017-10-10 15:49:28 -0700883/**
884 * Logs when the ble scan state changes.
885 *
886 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700887 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700888 */
889message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800890 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700891 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700892
893 enum State {
894 OFF = 0;
895 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700896 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
897 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700898 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800899 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700900 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800901 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700902 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800903 (state_field_option).nested = true
904 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700905
Bookatze5ec0b42018-03-26 13:34:56 -0700906 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700907 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700908 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700909 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700910 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700911 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700912}
913
914/**
915 * Logs reporting of a ble scan finding results.
916 *
917 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700918 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700919 */
Bookatzae6738e2018-09-13 11:38:56 -0700920// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700921message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800922 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700923
924 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800925 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700926}
927
928/**
929 * Logs when a sensor state changes.
930 *
931 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700932 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700933 */
934message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800935 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700936
Bookatzc1a050a2017-10-10 15:49:28 -0700937 // The id (int) of the sensor.
938 optional int32 sensor_id = 2;
939
940 enum State {
941 OFF = 0;
942 ON = 1;
943 }
944 optional State state = 3;
945}
946
Bookatzc1a050a2017-10-10 15:49:28 -0700947/**
948 * Logs when GPS state changes.
949 *
950 * Logged from:
951 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
952 */
953message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800954 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
956 enum State {
957 OFF = 0;
958 ON = 1;
959 }
960 optional State state = 2;
961}
962
Bookatz48d362e2018-11-06 15:49:08 -0800963/**
964 * Logs when GPS signal quality.
965 *
966 * Logged from:
967 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
968 */
969message GpsSignalQualityChanged {
970 optional android.server.location.GpsSignalQualityEnum level = 1;
971}
972
Bookatzc1a050a2017-10-10 15:49:28 -0700973
974/**
975 * Logs when a sync manager sync state changes.
976 *
977 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700978 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700979 */
980message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800981 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700982
David Chen0b5c90c2018-01-25 16:51:49 -0800983 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800984 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700985
986 enum State {
987 OFF = 0;
988 ON = 1;
989 }
990 optional State state = 3;
991}
992
Yangster-mac96353002018-09-05 11:18:55 -0700993/*
994 * Deferred job stats.
995 *
996 * Logged from:
997 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
998*/
999message DeferredJobStatsReported {
1000 repeated AttributionNode attribution_node = 1;
1001
1002 // Number of jobs deferred.
1003 optional int32 num_jobs_deferred = 2;
1004
1005 // Time since the last job runs.
1006 optional int64 time_since_last_job_millis = 3;
1007}
1008
Bookatzc1a050a2017-10-10 15:49:28 -07001009/**
1010 * Logs when a job scheduler job state changes.
1011 *
1012 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001013 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001014 */
1015message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001016 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001017
1018 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001019 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001020
1021 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001022 FINISHED = 0;
1023 STARTED = 1;
1024 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001025 }
1026 optional State state = 3;
1027
Tej Singh33a412b2018-03-16 18:43:59 -07001028 // The reason a job has stopped.
1029 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001030 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001031 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001032
1033 // The standby bucket of the app that scheduled the job. These match the framework constants
1034 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1035 // already assigned 0.
1036 enum Bucket {
1037 UNKNOWN = -1;
1038 ACTIVE = 0;
1039 WORKING_SET = 1;
1040 FREQUENT = 2;
1041 RARE = 3;
1042 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001043 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001044 }
1045 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1046
1047 // The job id (as assigned by the app).
1048 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001049
1050 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1051 // constraints as they are always assumed to be set.
1052 optional bool has_charging_constraint = 7;
1053 optional bool has_battery_not_low_constraint = 8;
1054 optional bool has_storage_not_low_constraint = 9;
1055 optional bool has_timing_delay_constraint = 10;
1056 optional bool has_deadline_constraint = 11;
1057 optional bool has_idle_constraint = 12;
1058 optional bool has_connectivity_constraint = 13;
1059 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001060}
1061
1062/**
1063 * Logs when the audio state changes.
1064 *
1065 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001066 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001067 */
1068message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001069 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001070
1071 enum State {
1072 OFF = 0;
1073 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001074 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1075 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001076 }
1077 optional State state = 2;
1078}
1079
1080/**
1081 * Logs when the video codec state changes.
1082 *
1083 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001084 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001085 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001086message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001087 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001088
1089 enum State {
1090 OFF = 0;
1091 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001092 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1093 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001094 }
1095 optional State state = 2;
1096}
1097
1098/**
1099 * Logs when the flashlight state changes.
1100 *
1101 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001102 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001103 */
1104message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001105 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001106
1107 enum State {
1108 OFF = 0;
1109 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001110 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1111 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001112 }
1113 optional State state = 2;
1114}
1115
1116/**
1117 * Logs when the camera state changes.
1118 *
1119 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001120 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001121 */
1122message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001123 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001124
1125 enum State {
1126 OFF = 0;
1127 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001128 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1129 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001130 }
1131 optional State state = 2;
1132}
1133
1134/**
1135 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001136 *
1137 * Logged from:
1138 * TODO
1139 */
Bookatzd6746242017-10-24 18:39:35 -07001140message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001141 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001142 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001143
Bookatz1a1b0462018-01-12 11:47:03 -08001144 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1145 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001146 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001147
1148 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001149 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001150
1151 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001152 RELEASE = 0;
1153 ACQUIRE = 1;
1154 CHANGE_RELEASE = 2;
1155 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001156 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001157 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001158 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001159 (state_field_option).default_state_value = 0,
1160 (state_field_option).nested = true
1161 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001162}
1163
1164/**
Bookatzc1a050a2017-10-10 15:49:28 -07001165 * Logs when a partial wakelock is considered 'long' (over 1 min).
1166 *
1167 * Logged from:
1168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1169 */
1170message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001171 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001172
Yao Chend54f9dd2017-10-17 17:37:48 +00001173 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1174 optional string tag = 2;
1175
Bookatzc1a050a2017-10-10 15:49:28 -07001176 // TODO: I have no idea what this is.
1177 optional string history_tag = 3;
1178
1179 enum State {
1180 OFF = 0;
1181 ON = 1;
1182 }
1183 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001184}
1185
Bookatzc1a050a2017-10-10 15:49:28 -07001186/**
Bookatza66083f2018-09-20 17:24:00 -07001187 * Logs when the device is interactive, according to the PowerManager Notifier.
1188 *
1189 * Logged from:
1190 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1191 */
1192message InteractiveStateChanged {
1193 enum State {
1194 OFF = 0;
1195 ON = 1;
1196 }
1197 optional State state = 1;
1198}
1199
1200/**
Bookatzc1a050a2017-10-10 15:49:28 -07001201 * Logs Battery Saver state change.
1202 *
1203 * Logged from:
1204 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1205 */
1206message BatterySaverModeStateChanged {
1207 enum State {
1208 OFF = 0;
1209 ON = 1;
1210 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001211 optional State state = 1
1212 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001213}
1214
1215/**
1216 * Logs Doze mode state change.
1217 *
1218 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001219 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001220 */
1221message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001222 optional android.server.DeviceIdleModeEnum state = 1
1223 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001224}
1225
1226
1227/**
1228 * Logs state change of Doze mode including maintenance windows.
1229 *
1230 * Logged from:
1231 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1232 */
1233message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001234 optional android.server.DeviceIdleModeEnum state = 1
1235 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001236}
1237
1238/**
1239 * Logs screen brightness level.
1240 *
1241 * Logged from:
1242 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1243 */
1244message ScreenBrightnessChanged {
1245 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1246 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001247}
1248
1249/**
1250 * Logs battery level (percent full, from 0 to 100).
1251 *
1252 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001253 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001254 */
1255message BatteryLevelChanged {
1256 // Battery level. Should be in [0, 100].
1257 optional int32 battery_level = 1;
1258}
1259
1260/**
1261 * Logs change in charging status of the device.
1262 *
1263 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001264 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001265 */
1266message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001267 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001268 optional android.os.BatteryStatusEnum state = 1
1269 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001270}
1271
1272/**
1273 * Logs whether the device is plugged in, and what power source it is using.
1274 *
1275 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001276 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001277 */
1278message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001279 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001280 optional android.os.BatteryPluggedStateEnum state = 1
1281 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001282}
1283
Bookatz8c6571b2017-10-24 15:04:41 -07001284/**
1285 * Logs when an app's wakeup alarm fires.
1286 *
1287 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001288 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001289 */
1290message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001291 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001292
1293 // Name of the wakeup alarm.
1294 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001295
1296 // Name of source package (for historical reasons, since BatteryStats tracked it).
1297 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001298
Ben Murdoch3389f1522019-05-21 15:05:34 +01001299 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001300 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001301}
1302
1303/**
1304 * Logs when an an app causes the mobile radio to change state.
1305 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1306 *
1307 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001308 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001309 */
1310message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001311 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001312
Bookatz1a1b0462018-01-12 11:47:03 -08001313 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1314 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001315}
1316
1317/**
1318 * Logs when an an app causes the wifi radio to change state.
1319 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1320 *
1321 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001322 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001323 */
1324message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001325 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001326
Bookatz1a1b0462018-01-12 11:47:03 -08001327 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1328 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001329}
1330
1331/**
1332 * Logs kernel wakeup reasons and aborts.
1333 *
1334 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001335 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001336 */
1337message KernelWakeupReported {
1338 // Name of the kernel wakeup reason (or abort).
1339 optional string wakeup_reason_name = 1;
1340
1341 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001342 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001343}
1344
1345/**
Bookatzda1798c2018-12-13 14:16:00 -08001346 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001347 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001348 *
1349 * Logged from:
1350 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1351 */
1352message WifiEnabledStateChanged {
1353 enum State {
1354 OFF = 0;
1355 ON = 1;
1356 }
1357 optional State state = 1;
1358}
1359
1360/**
tsaichristinececebdc2020-02-04 14:05:56 -08001361 * This atom is deprecated starting in R.
1362 *
Bookatzda1798c2018-12-13 14:16:00 -08001363 * 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 -08001364 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1365 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001366 *
1367 * Logged from:
1368 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1369 */
1370message WifiRunningStateChanged {
1371 repeated AttributionNode attribution_node = 1;
1372
1373 enum State {
1374 OFF = 0;
1375 ON = 1;
1376 }
1377 optional State state = 2;
1378}
1379
1380/**
Bookatze5885242017-10-24 20:10:31 -07001381 * Logs wifi locks held by an app.
1382 *
1383 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001384 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001385 */
1386message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001387 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001388
1389 enum State {
1390 OFF = 0;
1391 ON = 1;
1392 }
1393 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001394
1395 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1396 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001397}
1398
1399/**
1400 * Logs wifi signal strength changes.
1401 *
1402 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001403 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001404 */
1405message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001406 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1407 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001408}
1409
1410/**
1411 * Logs wifi scans performed by an app.
1412 *
1413 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001414 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001415 */
1416message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001417 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001418
1419 enum State {
1420 OFF = 0;
1421 ON = 1;
1422 }
1423 optional State state = 2;
1424}
1425
1426/**
Tej Singh4503e102018-01-04 14:35:01 -08001427 * Logs wifi multicast locks held by an app
1428 *
1429 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001430 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001431 */
1432message WifiMulticastLockStateChanged {
1433 repeated AttributionNode attribution_node = 1;
1434
1435 enum State {
1436 OFF = 0;
1437 ON = 1;
1438 }
1439 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001440
1441 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001442}
1443
1444/**
Tej Singh1ea42892018-01-19 09:27:00 -08001445 * Logs shutdown reason and duration on next boot.
1446 *
1447 * Logged from:
1448 * frameworks/base/core/java/com/android/server/BootReceiver.java
1449 */
1450message ShutdownSequenceReported {
1451 // True if shutdown is for a reboot. Default: false if we do not know.
1452 optional bool reboot = 1;
1453
1454 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1455 optional string reason = 2;
1456
1457 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1458 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001459 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001460
1461 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001462 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001463}
1464
Tej Singh6483ea42018-01-25 17:45:49 -08001465
1466/**
1467 * Logs boot reason and duration.
1468 *
1469 * Logged from:
1470 * system/core/bootstat/bootstat.cpp
1471 */
1472message BootSequenceReported {
1473 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1474 // Default: "<EMPTY>" if not available.
1475 optional string bootloader_reason = 1;
1476
1477 // Reason for system boot. Eg. bootloader, reboot,userrequested
1478 // Default: "<EMPTY>" if not available.
1479 optional string system_reason = 2;
1480
1481 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001482 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001483
1484 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001485 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001486
1487 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001488 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001489
1490 // Time since last boot in ms. Default: 0 if not available.
1491 optional int64 time_since_last_boot = 6;
1492}
1493
Tej Singhc477d9c2018-02-05 18:31:39 -08001494
1495/**
1496 * Logs call state and disconnect cause (if applicable).
1497 *
1498 * Logged from:
1499 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1500 */
1501message CallStateChanged {
1502 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1503 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1504 optional android.telecom.CallStateEnum call_state = 1;
1505
1506 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1507 // This value is only applicable when the call_state is DISCONNECTED, and
1508 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1509 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1510 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1511
1512 // True if the call is self-managed, which are apps that use the
1513 // telecom infrastructure to make their own calls.
1514 optional bool self_managed = 3;
1515
1516 // True if call is external. External calls are calls on connected Wear
1517 // devices but show up in Telecom so the user can pull them onto the device.
1518 optional bool external_call = 4;
1519}
1520
Tej Singh1ea42892018-01-19 09:27:00 -08001521/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001522 * Logs keyguard state. The keyguard is the lock screen.
1523 *
1524 * Logged from:
1525 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1526 */
1527message KeyguardStateChanged {
1528 enum State {
1529 UNKNOWN = 0;
1530 // The keyguard is hidden when the phone is unlocked.
1531 HIDDEN = 1;
1532 // The keyguard is shown when the phone is locked (screen turns off).
1533 SHOWN= 2;
1534 // The keyguard is occluded when something is overlaying the keyguard.
1535 // Eg. Opening the camera while on the lock screen.
1536 OCCLUDED = 3;
1537 }
1538 optional State state = 1;
1539}
1540
1541/**
1542 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1543 * prompts the user to enter a password (pattern, pin, etc).
1544 *
1545 * Logged from:
1546 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1547 */
1548
1549message KeyguardBouncerStateChanged {
1550 enum State {
1551 UNKNOWN = 0;
1552 // Bouncer is hidden, either as a result of successfully entering the
1553 // password, screen timing out, or user going back to lock screen.
1554 HIDDEN = 1;
1555 // This is when the user is being prompted to enter the password.
1556 SHOWN = 2;
1557 }
1558 optional State state = 1;
1559}
1560
1561/**
1562 * Logs the result of entering a password into the keyguard bouncer.
1563 *
1564 * Logged from:
1565 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1566 */
1567message KeyguardBouncerPasswordEntered {
1568 enum BouncerResult {
1569 UNKNOWN = 0;
1570 // The password entered was incorrect.
1571 FAILURE = 1;
1572 // The password entered was correct.
1573 SUCCESS = 2;
1574 }
1575 optional BouncerResult result = 1;
1576}
1577
Tej Singha883b372018-02-15 11:30:01 -08001578/*
1579 * Logs changes to the configuration of the device. The configuration is defined
1580 * in frameworks/base/core/java/android/content/res/Configuration.java
1581 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1582 * Please go there to interpret the possible values each field can be.
1583 *
1584 * Logged from:
1585 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1586 */
1587message ResourceConfigurationChanged {
1588 // Bit mask of color capabilities of the screen.
1589 // Contains information about the color gamut and hdr mode of the screen.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001591 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001592
1593 // The target screen density being rendered to.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001595 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001596
1597 // Current user preference for the scaling factor for fonts,
1598 // relative to the base density scaling.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001600 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001601
1602 // Flag indicating whether the hard keyboard is hidden.
1603 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001604 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001605
1606 // The type of keyboard attached to the device.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1608 optional int32 keyboard = 5;
1609
1610 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001612 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001613
1614 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1615 // 0 if undefined.
1616 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1617 optional int32 mcc = 7;
1618
1619 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1620 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1621 // MNC_ZERO symbol defined in Configuration.java.
1622 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1623 optional int32 mnc = 8;
1624
1625 // The kind of navigation available on the device.
1626 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1627 optional int32 navigation = 9;
1628
1629 // Flag indicating whether the navigation is available.
1630 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001631 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001632
1633 // Overall orientation of the screen.
1634 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1635 optional int32 orientation = 11;
1636
1637 // The current height of the available screen space, in dp units.
1638 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001639 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001640
1641 // Bit mask of overall layout of the screen.
1642 // Contains information about screen size, whether the screen is wider/taller
1643 // than normal, whether the screen layout is right-tl-left or left-to-right,
1644 // and whether the screen has a rounded shape.
1645 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001646 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001647
1648 // Current width of the available screen space, in dp units.
1649 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001650 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001651
1652 // The smallest screen size an application will see in normal operation.
1653 // This is the smallest value of both screenWidthDp and screenHeightDp
1654 // in portrait and landscape.
1655 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001656 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001657
1658 // The type of touch screen attached to the device.
1659 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1660 optional int32 touchscreen = 16;
1661
1662 // Bit mask of the ui mode.
1663 // Contains information about the overall ui mode of the device.
1664 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1665 // Also contains information about whether the device is in night mode.
1666 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001667 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001668}
1669
Tej Singheee317b2018-03-07 19:28:05 -08001670
1671/**
1672 * Logs changes in the connection state of the mobile radio.
1673 *
1674 * Logged from:
1675 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1676 */
1677message MobileConnectionStateChanged {
1678 // States are from the state machine DataConnection.java.
1679 enum State {
1680 UNKNOWN = 0;
1681 // The connection is inactive, or disconnected.
1682 INACTIVE = 1;
1683 // The connection is being activated, or connecting.
1684 ACTIVATING = 2;
1685 // The connection is active, or connected.
1686 ACTIVE = 3;
1687 // The connection is disconnecting.
1688 DISCONNECTING = 4;
1689 // The connection is disconnecting after creating a connection.
1690 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1691 }
1692 optional State state = 1;
1693 // For multi-sim phones, this distinguishes between the sim cards.
1694 optional int32 sim_slot_index = 2;
1695 // Used to identify the connection. Starts at 0 and increments by 1 for
1696 // every new network created. Resets whenever the device reboots.
1697 optional int32 data_connection_id = 3;
1698 // A bitmask for the capabilities of this connection.
1699 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1700 // Default value (if we have no information): 0
1701 optional int64 capabilities = 4;
1702 // If this connection has internet.
1703 // This just checks if the DEFAULT bit of capabilities is set.
1704 optional bool has_internet = 5;
1705}
1706
1707/**
1708 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1709 *
1710 * Logged from:
1711 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1712 */
1713message MobileRadioTechnologyChanged {
1714 optional android.telephony.NetworkTypeEnum state = 1;
1715 // For multi-sim phones, this distinguishes between the sim cards.
1716 optional int32 sim_slot_index = 2;
1717}
1718
Andrew Chantb56388b2018-03-22 21:07:33 -07001719/**
1720 * Logs the VID and PID of any connected USB devices.
1721 *
1722 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1723 *
1724 * Logged by Vendor.
1725 */
1726message UsbDeviceAttached {
1727 optional int32 vid = 1;
1728 optional int32 pid = 2;
1729 optional bool has_audio = 3;
1730 optional bool has_hid = 4;
1731 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001732 enum State {
1733 STATE_DISCONNECTED = 0;
1734 STATE_CONNECTED = 1;
1735 }
1736 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001737 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001738}
1739
Tej Singheee317b2018-03-07 19:28:05 -08001740
Tej Singhdd7bd352018-02-09 19:33:15 -08001741/**
Tej Singh5d991e12018-03-09 19:48:11 -08001742 * Logs when Bluetooth is enabled and disabled.
1743 *
1744 * Logged from:
1745 * services/core/java/com/android/server/BluetoothManagerService.java
1746 */
1747message BluetoothEnabledStateChanged {
1748 repeated AttributionNode attribution_node = 1;
1749 // Whether or not bluetooth is enabled on the device.
1750 enum State {
1751 UNKNOWN = 0;
1752 ENABLED = 1;
1753 DISABLED = 2;
1754 }
1755 optional State state = 2;
1756 // The reason for being enabled/disabled.
1757 // Eg. Airplane mode, crash, application request.
1758 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1759 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001760 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001761}
1762
1763/**
Jack Hed9837c82019-01-09 01:19:13 -08001764 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001765 *
1766 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001767 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1768 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001769 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001770 */
1771message BluetoothConnectionStateChanged {
1772 // The state of the connection.
1773 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1774 optional android.bluetooth.ConnectionStateEnum state = 1;
1775 // An identifier that can be used to match connect and disconnect events.
1776 // Currently is last two bytes of a hash of a device level ID and
1777 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001778 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001779 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001780 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1781 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001782 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001783 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001784 // An identifier that can be used to match events for this device.
1785 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1786 // Salt: Randomly generated 256 bit value
1787 // Hash algorithm: HMAC-SHA256
1788 // Size: 32 byte
1789 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001790 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001791 // An identifier that can be used to match events for this device.
1792 // The incremental identifier is locally generated and guaranteed not derived
1793 // from any globally unique hardware id.
1794 // For paired devices, it stays consistent between Bluetooth toggling for the
1795 // same remote device.
1796 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1797 // session for the same remote device.
1798 // Default: 0 if the device's metric id is unknown.
1799 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001800}
1801
1802/**
1803 * Logs when a Bluetooth device connects and disconnects over ACL
1804 *
1805 * Logged from:
1806 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1807 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001808 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001809 */
1810message BluetoothAclConnectionStateChanged {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // The state of the connection.
1819 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1820 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001821 // An identifier that can be used to match events for this device.
1822 // The incremental identifier is locally generated and guaranteed not derived
1823 // from any globally unique hardware id.
1824 // For paired devices, it stays consistent between Bluetooth toggling for the
1825 // same remote device.
1826 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1827 // session for the same remote device.
1828 // Default: 0 if the device's metric id is unknown.
1829 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001830}
1831
1832/**
1833 * Logs when a Bluetooth device connects and disconnects over SCO
1834 *
1835 * Logged from:
1836 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1837 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1838 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001839 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001840 */
1841message BluetoothScoConnectionStateChanged {
1842 // An identifier that can be used to match events for this device.
1843 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1844 // Salt: Randomly generated 256 bit value
1845 // Hash algorithm: HMAC-SHA256
1846 // Size: 32 byte
1847 // Default: null or empty if the device identifier is not known
1848 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1849 // The state of the connection.
1850 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1851 optional android.bluetooth.ConnectionStateEnum state = 2;
1852 // Codec used for this SCO connection
1853 // Default: UNKNOWN
1854 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001855 // An identifier that can be used to match events for this device.
1856 // The incremental identifier is locally generated and guaranteed not derived
1857 // from any globally unique hardware id.
1858 // For paired devices, it stays consistent between Bluetooth toggling for the
1859 // same remote device.
1860 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1861 // session for the same remote device.
1862 // Default: 0 if the device's metric id is unknown.
1863 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001864}
1865
Jack Hec27040a2019-01-09 20:54:41 -08001866/**
1867 * Logged when active device of a profile changes
1868 *
1869 * Logged from:
1870 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1871 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1872 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1873 */
1874message BluetoothActiveDeviceChanged {
1875 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1876 // From android.bluetooth.BluetoothProfile
1877 optional int32 bt_profile = 1;
1878 // An identifier that can be used to match events for this new active device.
1879 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1880 // Salt: Randomly generated 256 bit value
1881 // Hash algorithm: HMAC-SHA256
1882 // Size: 32 byte
1883 // Default: null or empty if there is no active device for this profile
1884 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001885 // An identifier that can be used to match events for this device.
1886 // The incremental identifier is locally generated and guaranteed not derived
1887 // from any globally unique hardware id.
1888 // For paired devices, it stays consistent between Bluetooth toggling for the
1889 // same remote device.
1890 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1891 // session for the same remote device.
1892 // Default: 0 if the device's metric id is unknown.
1893 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001894}
1895
Jack Heab86dbd22018-12-18 15:43:27 -08001896// Logs when there is an event affecting Bluetooth device's link layer connection.
1897// - This event is triggered when there is a related HCI command or event
1898// - Users of this metrics can deduce Bluetooth device's connection state from these events
1899// - HCI commands are logged before the command is sent, after receiving command status, and after
1900// receiving command complete
1901// - HCI events are logged when they arrive
1902//
1903// Low level log from system/bt
1904//
1905// Bluetooth classic commands:
1906// - CMD_CREATE_CONNECTION
1907// - CMD_DISCONNECT
1908// - CMD_CREATE_CONNECTION_CANCEL
1909// - CMD_ACCEPT_CONNECTION_REQUEST
1910// - CMD_REJECT_CONNECTION_REQUEST
1911// - CMD_SETUP_ESCO_CONNECTION
1912// - CMD_ACCEPT_ESCO_CONNECTION
1913// - CMD_REJECT_ESCO_CONNECTION
1914// - CMD_ENH_SETUP_ESCO_CONNECTION
1915// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1916//
1917// Bluetooth low energy commands:
1918// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1919// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1920// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1921// - CMD_BLE_CLEAR_WHITE_LIST
1922// - CMD_BLE_ADD_WHITE_LIST
1923// - CMD_BLE_REMOVE_WHITE_LIST
1924//
1925// Bluetooth classic events:
1926// - EVT_CONNECTION_COMP
1927// - EVT_CONNECTION_REQUEST
1928// - EVT_DISCONNECTION_COMP
1929// - EVT_ESCO_CONNECTION_COMP
1930// - EVT_ESCO_CONNECTION_CHANGED
1931//
1932// Bluetooth low energy meta events:
1933// - BLE_EVT_CONN_COMPLETE_EVT
1934// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1935//
1936// Next tag: 10
1937message BluetoothLinkLayerConnectionEvent {
1938 // An identifier that can be used to match events for this device.
1939 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1940 // Salt: Randomly generated 256 bit value
1941 // Hash algorithm: HMAC-SHA256
1942 // Size: 32 byte
1943 // Default: null or empty if the device identifier is not known
1944 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1945 // Connection handle of this connection if available
1946 // Range: 0x0000 - 0x0EFF (12 bits)
1947 // Default: 0xFFFF if the handle is unknown
1948 optional int32 connection_handle = 2;
1949 // Direction of the link
1950 // Default: DIRECTION_UNKNOWN
1951 optional android.bluetooth.DirectionEnum direction = 3;
1952 // Type of this link
1953 // Default: LINK_TYPE_UNKNOWN
1954 optional android.bluetooth.LinkTypeEnum type = 4;
1955
1956 // Reason metadata for this link layer connection event, rules for interpretation:
1957 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1958 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1959 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1960 // set and valid, ignore hci_ble_event
1961
1962 // HCI command associated with this event
1963 // Default: CMD_UNKNOWN
1964 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1965 // HCI event associated with this event
1966 // Default: EVT_UNKNOWN
1967 optional android.bluetooth.hci.EventEnum hci_event = 6;
1968 // HCI BLE meta event associated with this event
1969 // Default: BLE_EVT_UNKNOWN
1970 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1971 // HCI command status code if this is triggerred by hci_cmd
1972 // Default: STATUS_UNKNOWN
1973 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1974 // HCI reason code associated with this event
1975 // Default: STATUS_UNKNOWN
1976 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001977 // An identifier that can be used to match events for this device.
1978 // The incremental identifier is locally generated and guaranteed not derived
1979 // from any globally unique hardware id.
1980 // For paired devices, it stays consistent between Bluetooth toggling for the
1981 // same remote device.
1982 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1983 // session for the same remote device.
1984 // Default: 0 if the device's metric id is unknown.
1985 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001986}
1987
Howard Roe103fe22019-01-17 16:52:16 -08001988/**
1989 * Logs when a module is rolled back by Watchdog.
1990 *
1991 * Logged from: Rollback Manager
1992 */
1993message WatchdogRollbackOccurred {
1994 enum RollbackType {
1995 UNKNOWN = 0;
1996 ROLLBACK_INITIATE = 1;
1997 ROLLBACK_SUCCESS = 2;
1998 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001999 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002000 }
2001 optional RollbackType rollback_type = 1;
2002
2003 optional string package_name = 2;
2004
2005 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002006
2007 enum RollbackReasonType {
2008 REASON_UNKNOWN = 0;
2009 REASON_NATIVE_CRASH = 1;
2010 REASON_EXPLICIT_HEALTH_CHECK = 2;
2011 REASON_APP_CRASH = 3;
2012 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002013 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002014 }
2015 optional RollbackReasonType rollback_reason = 4;
2016
2017 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2018 // is initiated. Empty if the package is unknown.
2019 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002020
2021 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002022}
2023
Jack Hec27040a2019-01-09 20:54:41 -08002024/**
2025 * Logs when there is a change in Bluetooth A2DP playback state
2026 *
2027 * Logged from:
2028 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2029 */
2030message BluetoothA2dpPlaybackStateChanged {
2031 // An identifier that can be used to match events for this device.
2032 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2033 // Salt: Randomly generated 256 bit value
2034 // Hash algorithm: HMAC-SHA256
2035 // Size: 32 byte
2036 // Default: null or empty if the device identifier is not known
2037 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2038 // Current playback state
2039 // Default: PLAYBACK_STATE_UNKNOWN
2040 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2041 // Current audio coding mode
2042 // Default: AUDIO_CODING_MODE_UNKNOWN
2043 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002044 // An identifier that can be used to match events for this device.
2045 // The incremental identifier is locally generated and guaranteed not derived
2046 // from any globally unique hardware id.
2047 // For paired devices, it stays consistent between Bluetooth toggling for the
2048 // same remote device.
2049 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2050 // session for the same remote device.
2051 // Default: 0 if the device's metric id is unknown.
2052 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002053}
2054
2055/**
2056 * Logs when there is a change in A2DP codec config for a particular remote device
2057 *
2058 * Logged from:
2059 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2060 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2061 */
2062message BluetoothA2dpCodecConfigChanged {
2063 // An identifier that can be used to match events for this device.
2064 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2065 // Salt: Randomly generated 256 bit value
2066 // Hash algorithm: HMAC-SHA256
2067 // Size: 32 byte
2068 // Default: null or empty if the device identifier is not known
2069 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2070 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2071 // Default SOURCE_CODEC_TYPE_INVALID
2072 optional int32 codec_type = 2;
2073 // Codec priroity, the higher the more preferred, -1 for disabled
2074 // Default: CODEC_PRIORITY_DEFAULT
2075 optional int32 codec_priority = 3;
2076 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2077 // Default: SAMPLE_RATE_NONE
2078 optional int32 sample_rate = 4;
2079 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2080 // Default: BITS_PER_SAMPLE_NONE
2081 optional int32 bits_per_sample = 5;
2082 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2083 // Default: CHANNEL_MODE_NONE
2084 optional int32 channel_mode = 6;
2085 // Codec specific values
2086 // Default 0
2087 optional int64 codec_specific_1 = 7;
2088 optional int64 codec_specific_2 = 8;
2089 optional int64 codec_specific_3 = 9;
2090 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002091 // An identifier that can be used to match events for this device.
2092 // The incremental identifier is locally generated and guaranteed not derived
2093 // from any globally unique hardware id.
2094 // For paired devices, it stays consistent between Bluetooth toggling for the
2095 // same remote device.
2096 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2097 // session for the same remote device.
2098 // Default: 0 if the device's metric id is unknown.
2099 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002100}
2101
2102/**
2103 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2104 * Each codec's capability is logged separately due to statsd restriction
2105 *
2106 * Logged from:
2107 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2108 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2109 */
2110message BluetoothA2dpCodecCapabilityChanged {
2111 // An identifier that can be used to match events for this device.
2112 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2113 // Salt: Randomly generated 256 bit value
2114 // Hash algorithm: HMAC-SHA256
2115 // Size: 32 byte
2116 // Default: null or empty if the device identifier is not known
2117 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2118 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2119 // Default SOURCE_CODEC_TYPE_INVALID
2120 optional int32 codec_type = 2;
2121 // Codec priroity, the higher the more preferred, -1 for disabled
2122 // Default: CODEC_PRIORITY_DEFAULT
2123 optional int32 codec_priority = 3;
2124 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2125 // in BluetoothCodecConfig
2126 // Default: empty and SAMPLE_RATE_NONE for individual item
2127 optional int32 sample_rate = 4;
2128 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2129 // in BluetoothCodecConfig
2130 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2131 optional int32 bits_per_sample = 5;
2132 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2133 // BluetoothCodecConfig
2134 // Default: empty and CHANNEL_MODE_NONE for individual item
2135 optional int32 channel_mode = 6;
2136 // Codec specific values
2137 // Default 0
2138 optional int64 codec_specific_1 = 7;
2139 optional int64 codec_specific_2 = 8;
2140 optional int64 codec_specific_3 = 9;
2141 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002142 // An identifier that can be used to match events for this device.
2143 // The incremental identifier is locally generated and guaranteed not derived
2144 // from any globally unique hardware id.
2145 // For paired devices, it stays consistent between Bluetooth toggling for the
2146 // same remote device.
2147 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2148 // session for the same remote device.
2149 // Default: 0 if the device's metric id is unknown.
2150 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002151}
2152
2153/**
2154 * Logs when A2DP failed to read from PCM source.
2155 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2156 *
2157 * Logged from:
2158 * system/bt
2159 */
2160message BluetoothA2dpAudioUnderrunReported {
2161 // An identifier that can be used to match events for this device.
2162 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2163 // Salt: Randomly generated 256 bit value
2164 // Hash algorithm: HMAC-SHA256
2165 // Size: 32 byte
2166 // Default: null or empty if the device identifier is not known
2167 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2168 // Encoding interval in nanoseconds
2169 // Default: 0
2170 optional int64 encoding_interval_nanos = 2;
2171 // Number of bytes of PCM data that could not be read from the source
2172 // Default: 0
2173 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002174 // An identifier that can be used to match events for this device.
2175 // The incremental identifier is locally generated and guaranteed not derived
2176 // from any globally unique hardware id.
2177 // For paired devices, it stays consistent between Bluetooth toggling for the
2178 // same remote device.
2179 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2180 // session for the same remote device.
2181 // Default: 0 if the device's metric id is unknown.
2182 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002183}
2184
2185/**
2186 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2187 * buffer queue is full and we have to drop data
2188 *
2189 * Logged from:
2190 * system/bt
2191 */
2192message BluetoothA2dpAudioOverrunReported {
2193 // An identifier that can be used to match events for this device.
2194 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2195 // Salt: Randomly generated 256 bit value
2196 // Hash algorithm: HMAC-SHA256
2197 // Size: 32 byte
2198 // Default: null or empty if the device identifier is not known
2199 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2200 // Encoding interval in nanoseconds
2201 // Default: 0
2202 optional int64 encoding_interval_nanos = 2;
2203 // Number of buffers dropped in this event
2204 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2205 // Default: 0
2206 optional int32 num_dropped_buffers = 3;
2207 // Number of encoded buffers dropped in this event
2208 // Default 0
2209 optional int32 num_dropped_encoded_frames = 4;
2210 // Number of encoded bytes dropped in this event
2211 // Default: 0
2212 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002213 // An identifier that can be used to match events for this device.
2214 // The incremental identifier is locally generated and guaranteed not derived
2215 // from any globally unique hardware id.
2216 // For paired devices, it stays consistent between Bluetooth toggling for the
2217 // same remote device.
2218 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2219 // session for the same remote device.
2220 // Default: 0 if the device's metric id is unknown.
2221 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002222}
2223
2224/**
2225 * Logs when we receive reports regarding a device's RSSI value
2226 *
2227 * Logged from:
2228 * system/bt
2229 */
2230message BluetoothDeviceRssiReported {
2231 // An identifier that can be used to match events for this device.
2232 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2233 // Salt: Randomly generated 256 bit value
2234 // Hash algorithm: HMAC-SHA256
2235 // Size: 32 byte
2236 // Default: null or empty if the device identifier is not known
2237 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2238 // Connection handle of this connection if available
2239 // Range: 0x0000 - 0x0EFF (12 bits)
2240 // Default: 0xFFFF if the handle is unknown
2241 optional int32 connection_handle = 2;
2242 // HCI command status code if this is triggerred by hci_cmd
2243 // Default: STATUS_UNKNOWN
2244 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2245 // BR/EDR
2246 // Range: -128 ≤ N ≤ 127 (signed integer)
2247 // Units: dB
2248 // LE:
2249 // Range: -127 to 20, 127 (signed integer)
2250 // Units: dBm
2251 // Invalid when an out of range value is reported
2252 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002253 // An identifier that can be used to match events for this device.
2254 // The incremental identifier is locally generated and guaranteed not derived
2255 // from any globally unique hardware id.
2256 // For paired devices, it stays consistent between Bluetooth toggling for the
2257 // same remote device.
2258 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2259 // session for the same remote device.
2260 // Default: 0 if the device's metric id is unknown.
2261 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002262}
2263
2264/**
2265 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2266 *
2267 * Logged from:
2268 * system/bt
2269 */
2270message BluetoothDeviceFailedContactCounterReported {
2271 // An identifier that can be used to match events for this device.
2272 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2273 // Salt: Randomly generated 256 bit value
2274 // Hash algorithm: HMAC-SHA256
2275 // Size: 32 byte
2276 // Default: null or empty if the device identifier is not known
2277 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2278 // Connection handle of this connection if available
2279 // Range: 0x0000 - 0x0EFF (12 bits)
2280 // Default: 0xFFFF if the handle is unknown
2281 optional int32 connection_handle = 2;
2282 // HCI command status code if this is triggerred by hci_cmd
2283 // Default: STATUS_UNKNOWN
2284 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2285 // Number of consecutive failed contacts for a connection corresponding to the Handle
2286 // Range: uint16_t, 0-0xFFFF
2287 // Default: 0xFFFFF
2288 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002289 // An identifier that can be used to match events for this device.
2290 // The incremental identifier is locally generated and guaranteed not derived
2291 // from any globally unique hardware id.
2292 // For paired devices, it stays consistent between Bluetooth toggling for the
2293 // same remote device.
2294 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2295 // session for the same remote device.
2296 // Default: 0 if the device's metric id is unknown.
2297 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002298}
2299
2300/**
2301 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2302 *
2303 * Logged from:
2304 * system/bt
2305 */
2306message BluetoothDeviceTxPowerLevelReported {
2307 // An identifier that can be used to match events for this device.
2308 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2309 // Salt: Randomly generated 256 bit value
2310 // Hash algorithm: HMAC-SHA256
2311 // Size: 32 byte
2312 // Default: null or empty if the device identifier is not known
2313 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2314 // Connection handle of this connection if available
2315 // Range: 0x0000 - 0x0EFF (12 bits)
2316 // Default: 0xFFFF if the handle is unknown
2317 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002318 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002319 // Default: STATUS_UNKNOWN
2320 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2321 // Range: -30 ≤ N ≤ 20
2322 // Units: dBm
2323 // Invalid when an out of range value is reported
2324 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002325 // An identifier that can be used to match events for this device.
2326 // The incremental identifier is locally generated and guaranteed not derived
2327 // from any globally unique hardware id.
2328 // For paired devices, it stays consistent between Bluetooth toggling for the
2329 // same remote device.
2330 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2331 // session for the same remote device.
2332 // Default: 0 if the device's metric id is unknown.
2333 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002334}
Jack Heab86dbd22018-12-18 15:43:27 -08002335
Tej Singh5d991e12018-03-09 19:48:11 -08002336/**
Jack He1021a612019-01-20 21:22:46 -08002337 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2338 * receiving an HCI command from the host
2339 *
2340 * Logged from: system/bt
2341 */
2342message BluetoothHciTimeoutReported {
2343 // HCI command associated with this event
2344 // Default: CMD_UNKNOWN
2345 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2346}
2347
2348/**
2349 * Logs when we receive Bluetooth Link Quality Report event from the controller
2350 * See Android Bluetooth HCI specification for more details
2351 *
2352 * Note: all count and bytes field are counted since last event
2353 *
2354 * Logged from: system/bt
2355 */
2356message BluetoothQualityReportReported {
2357 // Quality report ID
2358 // Original type: uint8_t
2359 // Default: BQR_ID_UNKNOWN
2360 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2361 // Packet type of the connection
2362 // Original type: uint8_t
2363 // Default: BQR_PACKET_TYPE_UNKNOWN
2364 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2365 // Connection handle of the connection
2366 // Original type: uint16_t
2367 optional int32 connection_handle = 3;
2368 // Performing Role for the connection
2369 // Original type: uint8_t
2370 optional int32 connection_role = 4;
2371 // Current Transmit Power Level for the connection. This value is the same as the controller's
2372 // response to the HCI_Read_Transmit_Power_Level HCI command
2373 // Original type: uint8_t
2374 optional int32 tx_power_level = 5;
2375 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2376 // absolute receiver signal strength value
2377 // Original type: int8_t
2378 optional int32 rssi = 6;
2379 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2380 // channels used by the link currently
2381 // Original type: uint8_t
2382 optional int32 snr = 7;
2383 // Indicates the number of unused channels in AFH_channel_map
2384 // Original type: uint8_t
2385 optional int32 unused_afh_channel_count = 8;
2386 // Indicates the number of the channels which are interfered and quality is bad but are still
2387 // selected for AFH
2388 // Original type: uint8_t
2389 optional int32 afh_select_unideal_channel_count = 9;
2390 // Current Link Supervision Timeout Setting
2391 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2392 // Original type: uint16_t
2393 optional int32 lsto = 10;
2394 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2395 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2396 // 0x01 (Piconet Clock)
2397 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2398 // Original type: uint32_t
2399 optional int64 connection_piconet_clock = 11;
2400 // The count of retransmission
2401 // Original type: uint32_t
2402 optional int64 retransmission_count = 12;
2403 // The count of no RX
2404 // Original type: uint32_t
2405 optional int64 no_rx_count = 13;
2406 // The count of NAK (Negative Acknowledge)
2407 // Original type: uint32_t
2408 optional int64 nak_count = 14;
2409 // Controller timestamp of last TX ACK
2410 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2411 // Original type: uint32_t
2412 optional int64 last_tx_ack_timestamp = 15;
2413 // The count of Flow-off (STOP)
2414 // Original type: uint32_t
2415 optional int64 flow_off_count = 16;
2416 // Controller timestamp of last Flow-on (GO)
2417 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2418 // Original type: uint32_t
2419 optional int64 last_flow_on_timestamp = 17;
2420 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2421 // Original type: uint32_t
2422 optional int64 buffer_overflow_bytes = 18;
2423 // Buffer underflow count (in byte) since last event
2424 // Original type: uint32_t
2425 optional int64 buffer_underflow_bytes = 19;
2426}
2427
2428/**
2429 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2430 *
2431 * Notes:
2432 * - Each event can be partially filled as we might learn different pieces of device
2433 * information at different time
2434 * - Multiple device info events can be combined to give more complete picture
2435 * - When multiple device info events tries to describe the same information, the
2436 * later one wins
2437 *
2438 * Logged from:
2439 * packages/apps/Bluetooth
2440 */
Jack Heaea26982019-04-04 11:19:48 -07002441message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002442 // An identifier that can be used to match events for this device.
2443 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2444 // Salt: Randomly generated 256 bit value
2445 // Hash algorithm: HMAC-SHA256
2446 // Size: 32 byte
2447 // Default: null or empty if the device identifier is not known
2448 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2449 // Where is this device info obtained from
2450 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2451 // Name of the data source
2452 // For EXTERNAL: package name of the data source
2453 // For INTERNAL: null for general case, component name otherwise
2454 optional string source_name = 3;
2455 // Name of the manufacturer of this device
2456 optional string manufacturer = 4;
2457 // Model of this device
2458 optional string model = 5;
2459 // Hardware version of this device
2460 optional string hardware_version = 6;
2461 // Software version of this device
2462 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002463 // An identifier that can be used to match events for this device.
2464 // The incremental identifier is locally generated and guaranteed not derived
2465 // from any globally unique hardware id.
2466 // For paired devices, it stays consistent between Bluetooth toggling for the
2467 // same remote device.
2468 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2469 // session for the same remote device.
2470 // Default: 0 if the device's metric id is unknown.
2471 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002472}
2473
2474/**
2475 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2476 * device, as documented by the Bluetooth Core HCI specification
2477 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2478 * Vol 2, Part E, Page 1118
2479 *
2480 * Logged from:
2481 * system/bt
2482 */
2483message BluetoothRemoteVersionInfoReported {
2484 // Connection handle of the connection
2485 // Original type: uint16_t
2486 optional int32 connection_handle = 1;
2487 // HCI command status code
2488 // Default: STATUS_UNKNOWN
2489 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2490 // 1 byte Version of current LMP in the remote controller
2491 optional int32 lmp_version = 3;
2492 // 2 bytes LMP manufacturer code of the remote controller
2493 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2494 optional int32 lmp_manufacturer_code = 4;
2495 // 4 bytes subversion of the LMP in the remote controller
2496 optional int32 lmp_subversion = 5;
2497}
2498
2499/**
2500 * Logs when certain Bluetooth SDP attributes are discovered
2501 * Constant definitions are from:
2502 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2503 *
2504 * Current logged attributes:
2505 * - BluetoothProfileDescriptorList
2506 * - Supported Features Bitmask
2507 *
2508 * Logged from:
2509 * system/bt
2510 */
2511message BluetoothSdpAttributeReported {
2512 // An identifier that can be used to match events for this device.
2513 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2514 // Salt: Randomly generated 256 bit value
2515 // Hash algorithm: HMAC-SHA256
2516 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2517 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2518 // Original type: uint16_t
2519 optional int32 protocol_uuid = 2;
2520 // Short form UUIDs used to identify Bluetooth SDP attribute types
2521 // Original type: uint16_t
2522 optional int32 attribute_id = 3;
2523 // Attribute value for the particular attribute
2524 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002525 // An identifier that can be used to match events for this device.
2526 // The incremental identifier is locally generated and guaranteed not derived
2527 // from any globally unique hardware id.
2528 // For paired devices, it stays consistent between Bluetooth toggling for the
2529 // same remote device.
2530 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2531 // session for the same remote device.
2532 // Default: 0 if the device's metric id is unknown.
2533 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002534}
2535
2536/**
2537 * Logs when bond state of a Bluetooth device changes
2538 *
2539 * Logged from:
2540 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2541 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2542 */
2543message BluetoothBondStateChanged {
2544 // An identifier that can be used to match events for this device.
2545 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2546 // Salt: Randomly generated 256 bit value
2547 // Hash algorithm: HMAC-SHA256
2548 // Size: 32 byte
2549 // Default: null or empty if the device identifier is not known
2550 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2551 // Preferred transport type to remote dual mode device
2552 // Default: TRANSPORT_AUTO means no preference
2553 optional android.bluetooth.TransportTypeEnum transport = 2;
2554 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2555 // Default: UNKNOWN
2556 optional android.bluetooth.DeviceTypeEnum type = 3;
2557 // Current bond state (NONE, BONDING, BONDED)
2558 // Default: BOND_STATE_UNKNOWN
2559 optional android.bluetooth.BondStateEnum bond_state = 4;
2560 // Bonding sub state
2561 // Default: BOND_SUB_STATE_UNKNOWN
2562 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2563 // Unbond Reason
2564 // Default: UNBOND_REASON_UNKNOWN
2565 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002566 // An identifier that can be used to match events for this device.
2567 // The incremental identifier is locally generated and guaranteed not derived
2568 // from any globally unique hardware id.
2569 // For paired devices, it stays consistent between Bluetooth toggling for the
2570 // same remote device.
2571 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2572 // session for the same remote device.
2573 // Default: 0 if the device's metric id is unknown.
2574 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002575}
2576
2577/**
2578 * Logs there is an event related Bluetooth classic pairing
2579 *
2580 * Logged from:
2581 * system/bt
2582 */
2583message BluetoothClassicPairingEventReported {
2584 // An identifier that can be used to match events for this device.
2585 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2586 // Salt: Randomly generated 256 bit value
2587 // Hash algorithm: HMAC-SHA256
2588 // Size: 32 byte
2589 // Default: null or empty if the device identifier is not known
2590 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2591 // Connection handle of this connection if available
2592 // Range: 0x0000 - 0x0EFF (12 bits)
2593 // Default: 0xFFFF if the handle is unknown
2594 optional int32 connection_handle = 2;
2595 // HCI command associated with this event
2596 // Default: CMD_UNKNOWN
2597 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2598 // HCI event associated with this event
2599 // Default: EVT_UNKNOWN
2600 optional android.bluetooth.hci.EventEnum hci_event = 4;
2601 // HCI command status code if this is triggerred by hci_cmd
2602 // Default: STATUS_UNKNOWN
2603 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2604 // HCI reason code associated with this event
2605 // Default: STATUS_UNKNOWN
2606 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002607 // A status value related to this specific event
2608 // Default: 0
2609 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002610 // An identifier that can be used to match events for this device.
2611 // The incremental identifier is locally generated and guaranteed not derived
2612 // from any globally unique hardware id.
2613 // For paired devices, it stays consistent between Bluetooth toggling for the
2614 // same remote device.
2615 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2616 // session for the same remote device.
2617 // Default: 0 if the device's metric id is unknown.
2618 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002619}
2620
2621/**
2622 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2623 *
2624 * Logged from:
2625 * system/bt
2626 */
2627message BluetoothSmpPairingEventReported {
2628 // An identifier that can be used to match events for this device.
2629 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2630 // Salt: Randomly generated 256 bit value
2631 // Hash algorithm: HMAC-SHA256
2632 // Size: 32 byte
2633 // Default: null or empty if the device identifier is not known
2634 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2635 // SMP command sent or received over L2CAP
2636 // Default: CMD_UNKNOWN
2637 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2638 // Whether this command is sent or received
2639 // Default: DIRECTION_UNKNOWN
2640 optional android.bluetooth.DirectionEnum direction = 3;
2641 // SMP failure reason code
2642 // Default: PAIRING_FAIL_REASON_DEFAULT
2643 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002644 // An identifier that can be used to match events for this device.
2645 // The incremental identifier is locally generated and guaranteed not derived
2646 // from any globally unique hardware id.
2647 // For paired devices, it stays consistent between Bluetooth toggling for the
2648 // same remote device.
2649 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2650 // session for the same remote device.
2651 // Default: 0 if the device's metric id is unknown.
2652 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002653}
2654
2655/**
Jack He815cdba2019-01-30 17:24:55 -08002656 * Logs when a Bluetooth socket’s connection state changed
2657 *
2658 * Logged from:
2659 * system/bt
2660 */
2661message BluetoothSocketConnectionStateChanged {
2662 // An identifier that can be used to match events for this device.
2663 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2664 // Salt: Randomly generated 256 bit value
2665 // Hash algorithm: HMAC-SHA256
2666 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002667 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002668 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002669 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002670 // Default 0 when unknown or don't care
2671 optional int32 port = 2;
2672 // Socket type as mentioned in
2673 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2674 // Default: SOCKET_TYPE_UNKNOWN
2675 optional android.bluetooth.SocketTypeEnum type = 3;
2676 // Socket connection state
2677 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2678 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2679 // Number of bytes sent to remote device during this connection
2680 optional int64 tx_bytes = 5;
2681 // Number of bytes received from remote device during this connection
2682 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002683 // Socket owner's UID
2684 optional int32 uid = 7 [(is_uid) = true];
2685 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2686 // |port| must be spawned by |server_port|
2687 // Default 0 when unknown or don't care
2688 optional int32 server_port = 8;
2689 // Whether this is a server listener socket
2690 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002691 // An identifier that can be used to match events for this device.
2692 // The incremental identifier is locally generated and guaranteed not derived
2693 // from any globally unique hardware id.
2694 // For paired devices, it stays consistent between Bluetooth toggling for the
2695 // same remote device.
2696 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2697 // session for the same remote device.
2698 // Default: 0 if the device's metric id is unknown.
2699 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002700}
2701
2702/**
Jack He71426802019-04-02 13:32:52 -07002703 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2704 *
2705 * Logged from:
2706 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2707 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2708 *
2709 */
2710message BluetoothClassOfDeviceReported {
2711 // An identifier that can be used to match events for this device.
2712 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2713 // Salt: Randomly generated 256 bit value
2714 // Hash algorithm: HMAC-SHA256
2715 // Size: 32 byte
2716 // Default: null or empty if this is a server listener socket
2717 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2718 // Class of Device (CoD) value including both Major, Minor device class and service class
2719 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2720 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2721 // Default: 0
2722 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002723 // An identifier that can be used to match events for this device.
2724 // The incremental identifier is locally generated and guaranteed not derived
2725 // from any globally unique hardware id.
2726 // For paired devices, it stays consistent between Bluetooth toggling for the
2727 // same remote device.
2728 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2729 // session for the same remote device.
2730 // Default: 0 if the device's metric id is unknown.
2731 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002732}
2733
2734/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002735 * Logs when something is plugged into or removed from the USB-C connector.
2736 *
2737 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002738 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002739 */
2740message UsbConnectorStateChanged {
2741 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002742 STATE_DISCONNECTED = 0;
2743 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002744 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002745 optional State state = 1
2746 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2747 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002748 // Last active session in ms.
2749 // 0 when the port is in connected state.
2750 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002751}
2752
2753/**
2754 * Logs the reported speaker impedance.
2755 *
2756 * Logged from:
2757 * Vendor audio implementation.
2758 */
2759message SpeakerImpedanceReported {
2760 optional int32 speaker_location = 1;
2761 optional int32 impedance = 2;
2762}
2763
2764/**
2765 * Logs the report of a failed hardware.
2766 *
2767 * Logged from:
2768 * Vendor HALs.
2769 *
2770 */
2771message HardwareFailed {
2772 enum HardwareType {
2773 HARDWARE_FAILED_UNKNOWN = 0;
2774 HARDWARE_FAILED_MICROPHONE = 1;
2775 HARDWARE_FAILED_CODEC = 2;
2776 HARDWARE_FAILED_SPEAKER = 3;
2777 HARDWARE_FAILED_FINGERPRINT = 4;
2778 }
2779 optional HardwareType hardware_type = 1;
2780
Maggie White6dcd8572019-01-31 14:11:50 -08002781 /**
2782 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002783 * the same hardware_type. The specific locations are vendor defined integers,
2784 * referring to board-specific numbering schemes.
2785 */
2786 optional int32 hardware_location = 2;
2787
Maggie White6dcd8572019-01-31 14:11:50 -08002788 /**
2789 * failure_code is specific to the HardwareType of the failed hardware.
2790 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002791 */
Maggie White6dcd8572019-01-31 14:11:50 -08002792 enum HardwareErrorCode {
2793 UNKNOWN = 0;
2794 COMPLETE = 1;
2795 SPEAKER_HIGH_Z = 2;
2796 SPEAKER_SHORT = 3;
2797 FINGERPRINT_SENSOR_BROKEN = 4;
2798 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002799 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002800 }
2801 optional int32 failure_code = 3;
2802}
2803
2804/**
2805 * Log an event when the device has been physically dropped.
2806 * Reported from the /vendor partition.
2807 */
2808message PhysicalDropDetected {
2809 // Confidence that the event was actually a drop, 0 -> 100
2810 optional int32 confidence_pctg = 1;
2811 // Peak acceleration of the drop, in 1/1000s of a g.
2812 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002813 // Duration of freefall in ms
2814 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002815}
2816
2817/**
2818 * Log bucketed battery charge cycles.
2819 *
2820 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002821 * a given charge point. For example, if 10 cycle buckets are
2822 * initialized, bucket 1 is the lowest 1/10th of the battery,
2823 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002824 *
2825 * Logged from:
2826 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2827 */
2828message ChargeCyclesReported {
2829 optional int32 cycle_bucket_1 = 1;
2830 optional int32 cycle_bucket_2 = 2;
2831 optional int32 cycle_bucket_3 = 3;
2832 optional int32 cycle_bucket_4 = 4;
2833 optional int32 cycle_bucket_5 = 5;
2834 optional int32 cycle_bucket_6 = 6;
2835 optional int32 cycle_bucket_7 = 7;
2836 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002837 optional int32 cycle_bucket_9 = 9;
2838 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002839}
2840
2841/**
Howard Roa46b6582018-09-18 16:45:02 -07002842 * Log battery health snapshot.
2843 *
2844 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2845 * are snapshotted periodically over 24hrs.
2846 */
2847message BatteryHealthSnapshot {
2848 enum BatterySnapshotType {
2849 UNKNOWN = 0;
2850 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2851 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2852 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2853 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2854 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2855 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2856 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2857 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2858 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2859 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2860 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2861 }
2862 optional BatterySnapshotType type = 1;
2863 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002864 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002865 // Voltage Battery Voltage, in microVolts.
2866 optional int32 voltage_micro_volt = 3;
2867 // Current Battery current, in microAmps.
2868 optional int32 current_micro_amps = 4;
2869 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2870 optional int32 open_circuit_micro_volt = 5;
2871 // Resistance Battery Resistance, in microOhms.
2872 optional int32 resistance_micro_ohm = 6;
2873 // Level Battery Level, as % of full.
2874 optional int32 level_percent = 7;
2875}
2876
2877/**
2878 * Log slow I/O operations on the primary storage.
2879 */
2880message SlowIo {
2881 // Classifications of IO Operations.
2882 enum IoOperation {
2883 UNKNOWN = 0;
2884 READ = 1;
2885 WRITE = 2;
2886 UNMAP = 3;
2887 SYNC = 4;
2888 }
2889 optional IoOperation operation = 1;
2890
2891 // The number of slow IO operations of this type over 24 hours.
2892 optional int32 count = 2;
2893}
2894
2895/**
2896 * Log battery caused shutdown with the last recorded voltage.
2897 */
2898message BatteryCausedShutdown {
2899 // The last recorded battery voltage prior to shutdown.
2900 optional int32 last_recorded_micro_volt = 1;
2901}
2902
2903/**
Tej Singha72344992019-04-17 18:55:08 -07002904 * Logs when ThermalService receives throttling events.
2905 *
2906 * Logged from:
2907 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2908 */
2909message ThermalThrottlingSeverityStateChanged {
2910 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2911 optional android.os.TemperatureTypeEnum sensor_type = 1;
2912
2913 // The name of the temperature source. Eg. CPU0
2914 optional string sensor_name = 2;
2915
2916 // Temperature in tenths of a degree C.
2917 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2918 optional int32 temperature_deci_celsius = 3;
2919
2920 // Relative severity of the throttling, see enum definition.
2921 optional android.os.ThrottlingSeverityEnum severity = 4;
2922}
2923
2924/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002925 * Logs the duration of a davey (jank of >=700ms) when it occurs
2926 *
2927 * Logged from:
2928 * frameworks/base/libs/hwui/JankTracker.cpp
2929 */
2930message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002931 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002932 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002933
Tej Singhbb8554a2018-01-26 11:59:14 -08002934 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002935 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002936}
2937
2938/**
Bookatze5885242017-10-24 20:10:31 -07002939 * Logs phone signal strength changes.
2940 *
2941 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002942 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002943 */
2944message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002945 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2946 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002947}
2948
Yangster4ccebea2018-10-09 17:09:02 -07002949
2950/**
2951 * Logs when the phone state, sim state or signal strength changes
2952 *
2953 * Logged from:
2954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2955 */
2956message PhoneServiceStateChanged {
2957 optional android.telephony.ServiceStateEnum state = 1;
2958 optional android.telephony.SimStateEnum sim_state = 2;
2959 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2960}
2961
2962/**
2963 * Logs when the phone becomes on or off.
2964 *
2965 * Logged from:
2966 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2967 */
2968message PhoneStateChanged {
2969 enum State {
2970 OFF = 0;
2971 ON = 1;
2972 }
2973 optional State state = 1;
2974}
2975
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002976message BackGesture {
2977 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002978 DEFAULT_BACK_TYPE = 0;
2979 COMPLETED = 1;
2980 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2981 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2982 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2983 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2984 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2985 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2986 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002987 }
2988 optional BackType type = 1;
2989
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002990 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2991 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2992 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2993 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2994 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2995 optional int32 left_boundary = 8; // left edge width + left inset
2996 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2997
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002998 enum WindowHorizontalLocation {
2999 DEFAULT_LOCATION = 0;
3000 LEFT = 1;
3001 RIGHT = 2;
3002 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003003 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003004}
3005
3006message ExclusionRectStateChanged {
3007 optional string component_name = 1; // if not available, simply packageName
3008 optional int32 requested_height = 2; // px
3009 optional int32 rejected_height = 3; // px
3010
3011 enum WindowHorizontalLocation {
3012 DEFAULT_LOCATION = 0;
3013 LEFT = 1;
3014 RIGHT = 2;
3015 }
3016 optional WindowHorizontalLocation x_location = 4;
3017 optional bool landscape = 5;
3018 optional bool splitscreen = 6;
3019 optional int32 duration_millis = 7;
3020}
3021
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003022/**
3023 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3024 *
3025 * Logged from:
3026 * packages/apps/Launcher3
3027 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003028message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003029 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003030 optional android.stats.launcher.LauncherState src_state = 2;
3031 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003032 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3033 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3034
3035 // The event id (e.g., app launch, drag and drop, long press)
3036 optional int32 event_id = 6;
3037 // The event's source or target id (e.g., icon, task, button)
3038 optional int32 target_id = 7;
3039 // If the target needs to be tracked, use this id field
3040 optional int32 instance_id = 8;
3041 optional int32 uid = 9 [(is_uid) = true];
3042 optional string package_name = 10;
3043 optional string component_name = 11;
3044
3045 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003046 optional int32 grid_x = 12 [default = -1];
3047 optional int32 grid_y = 13 [default = -1];
3048 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003049
3050 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003051 optional int32 grid_x_parent = 15 [default = -1];
3052 optional int32 grid_y_parent = 16 [default = -1];
3053 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003054
3055 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3056 optional int32 hierarchy = 18;
3057
3058 optional bool is_work_profile = 19;
3059
3060 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003061 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003062
3063 // e.g., folderLabelState can be captured in the following two fields
3064 optional int32 from_state = 21;
3065 optional int32 to_state = 22;
3066
3067 // e.g., autofilled or suggested texts that are not user entered
3068 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003069
3070 // e.g., number of contents inside a container (e.g., icons inside a folder)
3071 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003072}
3073
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003074/**
3075 * Used for snapshot of the HomeScreen UI elements
3076 *
3077 * Logged from:
3078 * packages/apps/Launcher3
3079 */
3080message LauncherStaticLayout {
3081 // The event id (e.g., snapshot, drag and drop)
3082 optional int32 event_id = 1;
3083 // The event's source or target id (e.g., icon, shortcut, widget)
3084 optional int32 target_id = 2;
3085 // If the target needs to be tracked, use this id field
3086 optional int32 instance_id = 3;
3087 optional int32 uid = 4 [(is_uid) = true];
3088 optional string package_name = 5;
3089 optional string component_name = 6;
3090
3091 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003092 optional int32 grid_x = 7 [default = -1];
3093 optional int32 grid_y = 8 [default = -1];
3094 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003095
3096 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003097 // e.g., when used with widgets target, use these values for (span_x, span_y)
3098 optional int32 grid_x_parent = 10 [default = -1];
3099 optional int32 grid_y_parent = 11 [default = -1];
3100 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003101
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003102 // UNKNOWN = 0
3103 // HOTSEAT = 1
3104 // WORKSPACE = 2
3105 // FOLDER_HOTSEAT = 3
3106 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003107 optional int32 hierarchy = 13;
3108
3109 optional bool is_work_profile = 14;
3110
3111 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3112 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003113
3114 // e.g., number of icons inside a folder
3115 optional int32 cardinality = 16;
3116
3117 // e.g., (x, y) span of the widget inside homescreen grid system
3118 optional int32 span_x = 17 [default = 1];
3119 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003120}
3121
3122/**
3123 * Logs when Wallpaper or ThemePicker UI has changed.
3124 *
3125 * Logged from:
3126 * packages/apps/ThemePicker
3127 * packages/apps/WallpaperPicker2
3128 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003129message StyleUIChanged {
3130 optional android.stats.style.Action action = 1;
3131 optional int32 color_package_hash = 2;
3132 optional int32 font_package_hash = 3;
3133 optional int32 shape_package_hash = 4;
3134 optional int32 clock_package_hash = 5;
3135 optional int32 launcher_grid = 6;
3136 optional int32 wallpaper_category_hash = 7;
3137 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003138 optional int32 color_preference = 9;
3139 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003140}
3141
David Chenc28b2bb2017-10-24 12:52:52 -07003142/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003143 * Logs when Settings UI has changed.
3144 *
3145 * Logged from:
3146 * packages/apps/Settings
3147 */
3148message SettingsUIChanged {
3149 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003150 * Where this SettingsUIChange event comes from. For example, if
3151 * it's a PAGE_VISIBLE event, where the page is opened from.
3152 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003153 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003154
3155 /**
3156 * What the UI action is.
3157 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003158 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003159
3160 /**
3161 * Where the action is happening
3162 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003163 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003164
3165 /**
3166 * What preference changed in this event.
3167 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003168 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003169
3170 /**
3171 * The new value of the changed preference.
3172 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003173 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003174}
3175
3176/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003177 * Logs basic timing information about touch events.
3178 * Reported at most every 5 minutes while device is being interacted with.
3179 *
3180 * Logged from:
3181 * frameworks/native/services/inputflinger
3182 */
3183message TouchEventReported {
3184 /**
3185 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003186 * and the standard deviation of the time spent processing touchscreen events
3187 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003188 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003189 * On supported devices, the starting point is taken during the hard interrupt inside the
3190 * kernel touch driver. On all other devices, the starting point is taken inside
3191 * the kernel's input event subsystem upon receipt of the input event.
3192 * The ending point is taken inside InputDispatcher, just after the input event
3193 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003194 */
3195 // Minimum value
3196 optional float latency_min_micros = 1;
3197 // Maximum value
3198 optional float latency_max_micros = 2;
3199 // Average value
3200 optional float latency_mean_micros = 3;
3201 // Standard deviation
3202 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003203 // Number of touch events (input_event) in this report
3204 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003205}
3206
3207/**
Philip Quinn0eded622019-01-29 12:46:28 -08003208 * Logs gesture classification and timing information for touch events.
3209 *
3210 * Logged from:
3211 * frameworks/base/core/java/android/view/GestureDetector.java
3212 * frameworks/base/core/java/android/view/View.java
3213 */
3214message TouchGestureClassified {
3215 // The source of the classification (e.g. Java class name).
3216 optional string source = 1;
3217
3218 enum Classification {
3219 UNKNOWN_CLASSIFICATION = 0;
3220 SINGLE_TAP = 1;
3221 DOUBLE_TAP = 2;
3222 LONG_PRESS = 3;
3223 DEEP_PRESS = 4;
3224 SCROLL = 5;
3225 }
3226 // The classification of the gesture.
3227 optional Classification classification = 2;
3228
3229 // The interval from the start of a touch event stream until the
3230 // classification was made.
3231 optional int32 latency_millis = 3;
3232
3233 // The distance from the location of the first touch event to the
3234 // location of the touch event when the classification was made.
3235 optional float displacement_px = 4;
3236}
3237
3238/**
David Chenc28b2bb2017-10-24 12:52:52 -07003239 * Logs that a setting was updated.
3240 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003241 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003242 * The tag and is_default allow resetting of settings to default values based on the specified
3243 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3244 */
3245message SettingChanged {
3246 // The name of the setting.
3247 optional string setting = 1;
3248
3249 // The change being imposed on this setting. May represent a number, eg "3".
3250 optional string value = 2;
3251
3252 // The new value of this setting. For most settings, this is same as value. For some settings,
3253 // value is +X or -X where X represents an element in a set. For example, if the previous value
3254 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3255 // The +/- feature is currently only used for location_providers_allowed.
3256 optional string new_value = 3;
3257
3258 // The previous value of this setting.
3259 optional string prev_value = 4;
3260
3261 // The tag used with the is_default for resetting sets of settings. This is generally null.
3262 optional string tag = 5;
3263
Bookatz90867622018-01-31 15:05:57 -08003264 // True if this setting with tag should be resettable.
3265 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003266
David Chenbd789912018-03-16 17:19:55 -07003267 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003268 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003269
3270 enum ChangeReason {
3271 UPDATED = 1; // Updated can be an insertion or an update.
3272 DELETED = 2;
3273 }
3274 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003275}
Chenjie Yub3dda412017-10-24 13:41:59 -07003276
Chenjie Yu05013b32017-11-21 10:21:41 -08003277/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003278 * Logs activity going to foreground or background
3279 *
3280 * Logged from:
3281 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3282 */
3283message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003284 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003285 optional string pkg_name = 2;
3286 optional string class_name = 3;
3287
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003288 enum State {
3289 BACKGROUND = 0;
3290 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003291 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003292 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003293}
David Chenc8a43242017-10-17 16:23:28 -07003294
3295/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003296 * Logs when a volume entered low Storage state.
3297 * Logged from:
3298 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3299 */
3300message LowStorageStateChanged {
3301 // Volume that ran out of storage.
3302 optional string volume_description = 1;
3303
3304 enum State {
3305 UNKNOWN = 0;
3306 OFF = 1;
3307 ON = 2;
3308 }
3309 optional State state = 2;
3310}
3311
3312/**
3313 * Logs when an app is downgraded.
3314 * Logged from:
3315 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3316 */
3317message AppDowngraded {
3318 optional string package_name = 1;
3319 // Size of the package (all data) before being downgraded.
3320 optional int64 size_in_bytes_before = 2;
3321 // Size of the package (all data) after being downgraded.
3322 optional int64 size_in_bytes_after = 3;
3323
3324 optional bool aggressive = 4;
3325}
3326
3327/**
3328 * Logs when an app is optimized after being downgraded.
3329 * Logged from:
3330 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3331 */
3332message AppOptimizedAfterDowngraded {
3333 optional string package_name = 1;
3334}
3335
3336/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003337 * Logs whenever an app is installed on external storage.
3338 * Logged from:
3339 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3340 */
3341message AppInstallOnExternalStorageReported {
3342 // The type of external storage.
3343 optional android.stats.storage.ExternalStorageType storage_type = 1;
3344 // The name of the package that is installed on the sd card.
3345 optional string package_name = 2;
3346}
3347
3348/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003349 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003350 * Logged from:
3351 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3352 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003353message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003354 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003355
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003356 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003357
3358 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003359 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003360 optional string process_name = 3;
3361
3362 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003363 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003364
3365 optional string package_name = 5;
3366
3367 enum InstantApp {
3368 UNAVAILABLE = 0;
3369 FALSE = 1;
3370 TRUE = 2;
3371 }
3372 optional InstantApp is_instant_app = 6;
3373
3374 enum ForegroundState {
3375 UNKNOWN = 0;
3376 BACKGROUND = 1;
3377 FOREGROUND = 2;
3378 }
3379 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003380
3381 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003382}
David Chen9e3808c2017-11-20 17:25:34 -08003383
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003384/**
3385 * Logs when a WTF (What a Terrible Failure) happened.
3386 * Logged from:
3387 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3388 */
3389message WTFOccurred {
3390 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003391
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003392 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003393
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003394 // The name of the process.
3395 // system_server if it is not by an app
3396 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003397
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003398 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003399 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003400
3401 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003402}
3403
3404/**
3405 * Logs when system server reports low memory.
3406 * Logged from:
3407 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3408 */
3409message LowMemReported {
3410}
3411
3412/**
3413 * Logs when an app ANR (App Not Responding) occurs.
3414 * Logged from:
3415 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3416 */
3417message ANROccurred {
3418 optional int32 uid = 1 [(is_uid) = true];
3419
3420 optional string process_name = 2;
3421
3422 optional string short_component_name = 3;
3423
3424 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003425
3426 enum InstantApp {
3427 UNAVAILABLE = 0;
3428 FALSE = 1;
3429 TRUE = 2;
3430 }
3431 optional InstantApp is_instant_app = 5;
3432
3433 enum ForegroundState {
3434 UNKNOWN = 0;
3435 BACKGROUND = 1;
3436 FOREGROUND = 2;
3437 }
3438 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003439
3440 optional android.server.ErrorSource error_source = 7;
3441
3442 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003443}
3444
Bookatza7020bd2018-08-28 16:29:35 -07003445/**
3446 * Logs when the vibrator state changes.
3447 * Logged from:
3448 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3449 */
3450message VibratorStateChanged {
3451 repeated AttributionNode attribution_node = 1;
3452
3453 enum State {
3454 OFF = 0;
3455 ON = 1;
3456 }
3457 optional State state = 2;
3458
3459 // Duration (in milliseconds) requested to keep the vibrator on.
3460 // Only applicable for State == ON.
3461 optional int64 duration_millis = 3;
3462}
3463
David Chen0a368b22017-12-06 16:28:16 -08003464/*
3465 * Allows other apps to push events into statsd.
3466 * Logged from:
3467 * frameworks/base/core/java/android/util/StatsLog.java
3468 */
David Chen0b5c90c2018-01-25 16:51:49 -08003469message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003470 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003471 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003472
3473 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3474 optional int32 label = 2;
3475
3476 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3477 // predicates for the metrics).
3478 enum State {
3479 UNKNOWN = 0;
3480 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3481 STOP = 2;
3482 START = 3;
3483 }
3484 optional State state = 3;
3485}
3486
David Chen9e3808c2017-11-20 17:25:34 -08003487/**
Bookatz7948c872018-09-04 12:58:33 -07003488 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3489 * For example, this could be due to the user manually changing the time.
3490 *
3491 * Logged from:
3492 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3493 */
3494message WallClockTimeShifted {
3495 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3496 optional int64 wall_clock_timestamp_millis = 1;
3497}
3498
3499/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003500 * Logs when statsd detects an anomaly.
3501 *
3502 * Logged from:
3503 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3504 */
3505message AnomalyDetected {
3506 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003507 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003508
Yangster-mac94e197c2018-01-02 16:03:03 -08003509 // Id of the config whose anomaly detection alert fired.
3510 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003511
Yangster-mac94e197c2018-01-02 16:03:03 -08003512 // Id of the alert (i.e. name of the anomaly that was detected).
3513 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003514}
3515
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003516message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003517 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003518 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003519
3520 // The app package name.
3521 optional string pkg_name = 2;
3522
3523 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003524 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003525 WARM = 1;
3526 HOT = 2;
3527 COLD = 3;
3528 }
3529 // The transition type.
3530 optional TransitionType type = 3;
3531
3532 // The activity name.
3533 optional string activity_name = 4;
3534
3535 // The name of the calling app. Empty if not set.
3536 optional string calling_pkg_name = 5;
3537
3538 // Whether the app is an instant app.
3539 optional bool is_instant_app = 6;
3540
3541 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003542 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003543
Bookatz80d11a02018-01-16 10:46:35 -08003544 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003545
David Chen0b5c90c2018-01-25 16:51:49 -08003546 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003547 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003548 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003549 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003550 optional int32 bind_application_delay_millis = 11;
3551 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003552
3553 // Empty if not set.
3554 optional string launch_token = 13;
3555
Calin Juravle759fbda2018-02-20 19:52:30 +00003556 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003557 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003558
3559 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003560 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003561}
3562
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003563message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003564 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003565 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003566
3567 // The app package name.
3568 optional string pkg_name = 2;
3569
3570 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003571 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003572 WARM = 1;
3573 HOT = 2;
3574 COLD = 3;
3575 }
3576 // The transition type.
3577 optional TransitionType type = 3;
3578
3579 // The activity name.
3580 optional string activity_name = 4;
3581}
3582
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003583message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003585 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003586
3587 // The app package name.
3588 optional string pkg_name = 2;
3589
3590 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003591 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003592 WITH_BUNDLE = 1;
3593 WITHOUT_BUNDLE = 2;
3594 }
3595 // The transition type.
3596 optional TransitionType type = 3;
3597
3598 // The activity name.
3599 optional string activity_name = 4;
3600
3601 optional bool transition_process_running = 5;
3602
3603 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003604 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003605}
3606
Bookatz8fcd09a2017-12-18 13:01:10 -08003607/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003608 * Logs a picture-in-picture action
3609 * Logged from:
3610 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3611 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3612 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3613 */
3614message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003615 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003616 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003617
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003618 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003619
Chenjie Yu52cacc62017-12-08 18:11:45 -08003620 enum State {
3621 ENTERED = 1;
3622 EXPANDED_TO_FULL_SCREEN = 2;
3623 MINIMIZED = 3;
3624 DISMISSED = 4;
3625 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003626 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003627}
3628
3629/**
Chenjie Yue8904192017-12-08 19:12:57 -08003630 * Logs overlay action
3631 * Logged from:
3632 * services/core/java/com/android/server/wm/Session.java
3633 */
3634message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003635 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003636
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003637 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003638
3639 optional bool using_alert_window = 3;
3640
3641 enum State {
3642 ENTERED = 1;
3643 EXITED = 2;
3644 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003645 optional State state = 4
3646 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003647}
3648
Adam Bookatz38767932020-02-05 12:13:40 -08003649/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003650 * Logs foreground service starts and stops.
3651 * Note that this is not when a service starts or stops, but when it is
3652 * considered foreground.
3653 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003654 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003655 */
3656message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003657 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003658 // package_name + "/" + class_name
3659 optional string short_name = 2;
3660
3661 enum State {
3662 ENTER = 1;
3663 EXIT = 2;
3664 }
3665 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003666
3667 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3668 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3669 optional bool allow_while_in_use_permission = 4;
3670}
3671
3672/**
3673 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3674 * A foreground service session is any continuous period during which the uid holds at least one
3675 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3676 * Accesses initiated while the uid is in the TOP state are ignored.
3677 * Sessions with no attempted accesses are not logged.
3678 * Logged from
3679 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3680 */
3681message ForegroundServiceAppOpSessionEnded {
3682 optional int32 uid = 1 [(is_uid) = true];
3683
3684 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003685 // Only following four ops are logged
3686 // COARSE_LOCATION = 0
3687 // FINE_LOCATION = 1
3688 // CAMERA = 26
3689 // RECORD_AUDIO = 27
3690 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003691
3692 // The uid's permission mode for accessing the AppOp during this fgs session.
3693 enum Mode {
3694 MODE_UNKNOWN = 0;
3695 MODE_ALLOWED = 1; // Always allowed
3696 MODE_IGNORED = 2; // Denied
3697 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3698 }
3699 optional Mode app_op_mode = 3;
3700
3701 // Number of times this AppOp was requested and allowed.
3702 optional int32 count_ops_accepted = 4;
3703 // Number of times this AppOp was requested but denied.
3704 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003705}
3706
Chenjie Yue8904192017-12-08 19:12:57 -08003707/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003708 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3709 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3710 * attributed back to the parent (host) uid. One example is Chrome.
3711 *
3712 * Logged from:
3713 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3714 */
3715message IsolatedUidChanged {
3716 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003717 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003718 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003719 optional int32 parent_uid = 1;
3720
3721 optional int32 isolated_uid = 2;
3722
3723 // We expect an isolated uid to be removed before if it's used for another parent uid.
3724 enum Event {
3725 REMOVED = 0;
3726 CREATED = 1;
3727 }
3728 optional Event event = 3;
3729}
3730
3731/*
3732 * Logs the reception of an incoming network packet causing the main system to wake up for
3733 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3734 * and processed by WakeupController.cpp.
3735 */
3736message PacketWakeupOccurred {
3737 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3738 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003739 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003740 // The interface name on which the packet was received.
3741 optional string iface = 2;
3742 // The ethertype value of the packet.
3743 optional int32 ethertype = 3;
3744 // String representation of the destination MAC address of the packet.
3745 optional string destination_hardware_address = 4;
3746 // String representation of the source address of the packet if this was an IP packet.
3747 optional string source_ip = 5;
3748 // String representation of the destination address of the packet if this was an IP packet.
3749 optional string destination_ip = 6;
3750 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3751 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3752 // families.
3753 optional int32 ip_next_header = 7;
3754 // The source port if this was a TCP or UDP packet.
3755 optional int32 source_port = 8;
3756 // The destination port if this was a TCP or UDP packet.
3757 optional int32 destination_port = 9;
3758}
3759
3760/*
3761 * Logs the memory stats for an app on startup.
3762 * Logged from:
3763 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3764 */
3765message AppStartMemoryStateCaptured {
3766 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003767 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003768
3769 // The process name.
3770 optional string process_name = 2;
3771
3772 // The activity name.
3773 optional string activity_name = 3;
3774
3775 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003776 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003777
3778 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003779 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003780
3781 // RSS
3782 optional int64 rss_in_bytes = 6;
3783
3784 // CACHE
3785 optional int64 cache_in_bytes = 7;
3786
3787 // SWAP
3788 optional int64 swap_in_bytes = 8;
3789}
3790
3791/*
3792 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3793 * for LMK event.
3794 * Logged from:
3795 * system/core/lmkd/lmkd.c
3796 */
3797message LmkStateChanged {
3798 enum State {
3799 UNKNOWN = 0;
3800 START = 1;
3801 STOP = 2;
3802 }
3803 optional State state = 1;
3804}
3805
3806/*
3807 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3808 * Logged from:
3809 * system/core/lmkd/lmkd.c
3810 */
3811message LmkKillOccurred {
3812 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003813 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003814
3815 // The process name.
3816 optional string process_name = 2;
3817
3818 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003819 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003820
3821 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003822 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003823
3824 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003825 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003826
3827 // RSS
3828 optional int64 rss_in_bytes = 6;
3829
3830 // CACHE
3831 optional int64 cache_in_bytes = 7;
3832
3833 // SWAP
3834 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003835
3836 // The elapsed real time of start of the process.
3837 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003838
3839 // Min oom adj score considered by lmkd.
3840 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003841}
3842
Rajeev Kumar51b54602018-03-01 12:18:26 -08003843/*
3844 * Logs when the ActivityManagerService detects that an app died.
3845 *
3846 * Logged from:
3847 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3848 */
3849message AppDied {
3850 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003851 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003852}
3853
Howard Ro21a039c2018-08-06 14:55:47 -07003854/**
3855 * An atom for generic metrics logging. Available from Android Q.
3856 */
3857message GenericAtom {
3858 // The uid of the application that sent this custom atom.
3859 optional int32 uid = 1 [(is_uid) = true];
3860
3861 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003862 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003863}
3864
Tej Singhd6d6d772018-09-05 17:41:25 -07003865/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003866 * Atom for simple logging of user interaction and impression events, such as "the user touched
3867 * this button" or "this dialog was displayed".
3868 * Keep the UI event stream clean: don't use for system or background events.
3869 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003870 *
3871 * Logged from:
3872 * frameworks/base/services/core/java/com/android/server/
3873 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003874 */
3875message UiEventReported {
3876 // The event_id.
3877 optional int32 event_id = 1;
3878 // The event's source or target uid and package, if applicable.
3879 // For example, the package posting a notification, or the destination package of a share.
3880 optional int32 uid = 2 [(is_uid) = true];
3881 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003882 // An identifier used to disambiguate which logs refer to a particular instance of some
3883 // UI element. Useful when there might be multiple instances simultaneously active.
3884 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003885}
3886
3887/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003888 * Reports a notification was created or updated.
3889 *
3890 * Logged from:
3891 * frameworks/base/services/core/java/com/android/server/notification/
3892 */
3893message NotificationReported {
3894 // The event_id (as for UiEventReported).
3895 optional int32 event_id = 1;
3896 // The notifying app's uid and package.
3897 optional int32 uid = 2 [(is_uid) = true];
3898 optional string package_name = 3;
3899 // A small system-assigned identifier for the notification.
3900 // Locally probably-unique, but expect collisions across users and/or days.
3901 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003902 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3903 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003904
3905 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003906 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3907 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3908 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003909
3910 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003911 optional string category = 10; // App-assigned notification category (API-defined strings)
3912 optional int32 style = 11; // App-assigned notification style
3913 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003914
3915 // Ordering, importance and interruptiveness
3916
Will Brockman7614f6962020-02-10 19:43:03 -05003917 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003918
Will Brockman7614f6962020-02-10 19:43:03 -05003919 optional android.stats.sysui.NotificationImportance importance = 14;
3920 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003921
3922 enum NotificationImportanceExplanation {
3923 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3924 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3925 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3926 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3927 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3928 // Like _APP, but based on pre-channels priority signal.
3929 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3930 }
3931
Will Brockman7614f6962020-02-10 19:43:03 -05003932 optional NotificationImportanceExplanation importance_source = 16;
3933 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3934 optional NotificationImportanceExplanation importance_initial_source = 18;
3935 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3936 optional int32 assistant_hash = 20;
3937 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003938}
3939
3940message Notification {
3941 // The notifying app's uid and package.
3942 optional int32 uid = 1 [(is_uid) = true];
3943 optional string package_name = 2;
3944 // A small system-assigned identifier for the notification.
3945 optional int32 instance_id = 3;
3946
3947 // Grouping information.
3948 optional int32 group_instance_id = 4;
3949 optional bool is_group_summary = 5;
3950
3951 // The section of the shade that the notification is in.
3952 // See NotificationSectionsManager.PriorityBucket.
3953 enum NotificationSection {
3954 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003955 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003956 SECTION_MEDIA_CONTROLS = 2;
3957 SECTION_PEOPLE = 3;
3958 SECTION_ALERTING = 4;
3959 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003960 }
3961 optional NotificationSection section = 6;
3962}
3963
3964message NotificationList {
3965 repeated Notification notifications = 1; // An ordered sequence of notifications.
3966}
3967
3968/**
3969 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3970 *
3971 * Logged from:
3972 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3973 */
3974message NotificationPanelReported {
3975 // The event_id (as for UiEventReported).
3976 optional int32 event_id = 1;
3977 optional int32 num_notifications = 2;
3978 // The notifications in the panel, in the order that they appear there.
3979 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3980}
3981
3982/**
3983 * Reports a notification channel, or channel group, was created, updated, or deleted.
3984 *
3985 * Logged from:
3986 * frameworks/base/services/core/java/com/android/server/notification/
3987 */
3988message NotificationChannelModified {
3989 // The event_id (as for UiEventReported).
3990 optional int32 event_id = 1;
3991 // The notifying app's uid and package.
3992 optional int32 uid = 2 [(is_uid) = true];
3993 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003994 // Hash of app-assigned notification channel ID or channel-group ID
3995 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003996 // Previous importance setting, if applicable
3997 optional android.stats.sysui.NotificationImportance old_importance = 5;
3998 // New importance setting
3999 optional android.stats.sysui.NotificationImportance importance = 6;
4000}
4001
4002
4003/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004004 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004005 *
4006 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004007 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004008 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004009message BiometricAcquired {
4010 // Biometric modality that was acquired.
4011 optional android.hardware.biometrics.ModalityEnum modality = 1;
4012 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4013 optional int32 user = 2;
4014 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4015 optional bool is_crypto = 3;
4016 // Action that the device is performing. Acquired messages are only expected for enroll and
4017 // authenticate. Other actions may indicate an error.
4018 optional android.hardware.biometrics.ActionEnum action = 4;
4019 // The client that this acquisition was received for.
4020 optional android.hardware.biometrics.ClientEnum client = 5;
4021 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4022 optional int32 acquire_info = 6;
4023 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4024 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004025 // Dictates if this message should trigger additional debugging.
4026 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004027}
4028
4029/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004030 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004031 *
4032 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004033 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004034 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004035message BiometricAuthenticated {
4036 // Biometric modality that was used.
4037 optional android.hardware.biometrics.ModalityEnum modality = 1;
4038 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4039 optional int32 user = 2;
4040 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4041 // storage.
4042 optional bool is_crypto = 3;
4043 // The client that this acquisition was received for.
4044 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004045 // If authentication requires user confirmation. See BiometricPrompt's
4046 // setRequireConfirmation(bool) method.
4047 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004048
Kevin Chyn1741a072019-01-17 11:54:40 -08004049 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004050 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004051 REJECTED = 1;
4052 PENDING_CONFIRMATION = 2;
4053 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004054 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004055
4056 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004057 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004058 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4059 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4060 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4061 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004062 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004063 // Dictates if this message should trigger additional debugging.
4064 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004065}
4066
4067/**
4068 * Logs when a biometric error occurs.
4069 *
4070 * Logged from:
4071 * frameworks/base/services/core/java/com/android/server/biometrics
4072 */
4073message BiometricErrorOccurred {
4074 // Biometric modality that was used.
4075 optional android.hardware.biometrics.ModalityEnum modality = 1;
4076 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4077 optional int32 user = 2;
4078 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4079 optional bool is_crypto = 3;
4080 // Action that the device is performing.
4081 optional android.hardware.biometrics.ActionEnum action = 4;
4082 // The client that this acquisition was received for.
4083 optional android.hardware.biometrics.ClientEnum client = 5;
4084 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4085 // are unique to modality.
4086 optional int32 error_info = 6;
4087 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4088 // by the vendor and not specified by the HIDL interface.
4089 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004090 // Dictates if this message should trigger additional debugging.
4091 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004092 // Time spent during the authentication attempt.
4093 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004094}
4095
4096/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004097 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004098 * Logged from:
4099 * frameworks/base/services/core/java/com/android/server/biometrics
4100 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004101message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004102 // Biometric modality.
4103 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004104 // Type of issue detected.
4105 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004106 // Dictates if this message should trigger additional debugging.
4107 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004108}
Howard Ro688ae182018-09-25 00:09:36 -07004109
joshmccloskey6f952b22019-03-25 20:59:35 -07004110/**
4111 * Logs when a biometric enrollment occurs.
4112 *
4113 * Logged from:
4114 * frameworks/base/services/core/java/com/android/server/biometrics
4115 */
4116message BiometricEnrolled {
4117 // Biometric modality that was used.
4118 optional android.hardware.biometrics.ModalityEnum modality = 1;
4119 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4120 optional int32 user = 2;
4121 // The amount of time the enrollment took in milliseconds.
4122 optional int64 latency_millis = 3;
4123 // Whether or not the enrollment was successful.
4124 optional bool success = 4;
4125}
4126
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004127/*
Tej Singh0d176952019-01-16 19:10:54 -08004128 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004129 */
Tej Singh0d176952019-01-16 19:10:54 -08004130message FlagFlipUpdateOccurred {
4131 // If the event is from a flag config package, specify the package name.
4132 optional string flag_flip_package_name = 1;
4133
4134 // The order id of the package
4135 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004136}
4137
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004138/**
4139 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004140 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004141 */
4142message TrainExperimentIds {
4143 repeated int64 experiment_id = 1;
4144}
4145
Yangster-macb89807e2018-11-15 21:10:57 -08004146/*
4147 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004148 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004149 */
4150message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004151 // Name of the train.
4152 optional string train_name = 1;
4153 // Version code for a "train" of packages that need to be installed atomically
4154 optional int64 train_version_code = 2;
4155 // After installation of this package, device requires a restart.
4156 optional bool requires_staging = 3;
4157 // Rollback should be enabled for this install.
4158 optional bool rollback_enabled = 4;
4159 // Requires low latency monitoring if possible.
4160 optional bool requires_low_latency_monitor = 5;
4161
Yangster-macb89807e2018-11-15 21:10:57 -08004162 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004163 UNKNOWN = 0;
4164 INSTALL_REQUESTED = 1;
4165 INSTALL_STARTED = 2;
4166 INSTALL_STAGED_NOT_READY = 3;
4167 INSTALL_STAGED_READY = 4;
4168 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004169 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4170 // and INSTALL_FAILURE_COMMIT.
4171 INSTALL_FAILURE = 6 [deprecated = true];
4172 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004173 INSTALL_CANCELLED = 7;
4174 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004175 INSTALLER_ROLLBACK_INITIATED = 9;
4176 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4177 INSTALLER_ROLLBACK_STAGED = 11;
4178 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4179 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4180 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4181 INSTALLER_ROLLBACK_SUCCESS = 15;
4182 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004183 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4184 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4185 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4186 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4187 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4188 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004189 INSTALL_FAILURE_DOWNLOAD = 23;
4190 INSTALL_FAILURE_STATE_MISMATCH = 24;
4191 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004192 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004193 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004194 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004195 // Possible experiment ids for monitoring this push.
4196 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4197 // user id
4198 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004199 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004200 // Whether or not this is a rollback event
4201 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004202}
4203
Tej Singhc9203082019-05-03 13:42:23 -07004204/* Test atom, is not logged anywhere */
4205message TestAtomReported {
4206 repeated AttributionNode attribution_node = 1;
4207 optional int32 int_field = 2;
4208 optional int64 long_field = 3;
4209 optional float float_field = 4;
4210 optional string string_field = 5;
4211 optional bool boolean_field = 6;
4212 enum State {
4213 UNKNOWN = 0;
4214 OFF = 1;
4215 ON = 2;
4216 }
4217 optional State state = 7;
4218 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4219}
4220
Maggie Whitefc1aa592018-11-28 21:55:23 -08004221/** Represents USB port overheat event. */
4222message UsbPortOverheatEvent {
4223 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4224 optional int32 plug_temperature_deci_c = 1;
4225
4226 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4227 optional int32 max_temperature_deci_c = 2;
4228
4229 /* Time between USB plug event and overheat threshold trip, in seconds. */
4230 optional int32 time_to_overheat_secs = 3;
4231
4232 /* Time between overheat threshold trip and hysteresis, in seconds. */
4233 optional int32 time_to_hysteresis_secs = 4;
4234
4235 /* Time between hysteresis and active mitigation ending, in seconds. */
4236 optional int32 time_to_inactive_secs = 5;
4237};
4238
Maggie White8735b852019-01-18 11:40:49 -08004239/**
4240 * Logs total effective full charge and discharge cycles on a battery.
4241 * Here are some examples of one effective cycle:
4242 * 1) the battery charges from 0% to 100% and drains back to 0%,
4243 * 2) charging from 50% to 100% and draining back to 50% twice.
4244 * Pulled from:
4245 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4246 */
4247message BatteryCycleCount {
4248 /* Number of total charge and discharge cycles on the system battery. */
4249 optional int32 cycle_count = 1;
4250}
4251
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004252/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004253 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4254 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004255 * Pulled from:
4256 * StatsCompanionService
4257 */
4258
Carmen Agimof12dec122019-03-06 16:14:38 +00004259message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004260
Carmen Agimof12dec122019-03-06 16:14:38 +00004261 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004262 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004263 PUBLIC = 1;
4264 PRIVATE = 2;
4265 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004266 }
4267
Carmen Agimof12dec122019-03-06 16:14:38 +00004268 // The type of external storage.
4269 optional android.stats.storage.ExternalStorageType storage_type = 1;
4270 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4271 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004272 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004273 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004274}
4275
Yangster-macb89807e2018-11-15 21:10:57 -08004276/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004277 * Logs when a connection becomes available and lost.
4278 * Logged in StatsCompanionService.java
4279 */
4280message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004281 // Id of the network.
4282 optional int32 net_id = 1;
4283
4284 enum State {
4285 UNKNOWN = 0;
4286 CONNECTED = 1;
4287 DISCONNECTED = 2;
4288 }
4289 // Connected state of a network.
4290 optional State state = 2;
4291}
4292
4293/**
4294 * Logs when a service starts and stops.
4295 * Logged from:
4296 * services/core/java/com/android/server/am/ActiveServices.java
4297 */
4298message ServiceStateChanged {
4299
4300 optional int32 uid = 1 [(is_uid) = true];
4301
4302 optional string package_name = 2;
4303
4304 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004305
4306 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004307 START = 1;
4308 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004309 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004310
4311 optional State state = 4;
4312}
4313
4314/**
4315 * Logs when a service is launched.
4316 * Logged from:
4317 * services/core/java/com/android/server/am/ActiveServices.java
4318 */
4319message ServiceLaunchReported {
4320
4321 optional int32 uid = 1 [(is_uid) = true];
4322
4323 optional string package_name = 2;
4324
4325 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004326}
Howard Ro688ae182018-09-25 00:09:36 -07004327
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004328/**
4329 * Logs when a hidden API is used.
4330 *
4331 * Logged from:
4332 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4333 */
4334message HiddenApiUsed {
4335 // The uid of the app making the hidden access.
4336 optional int32 uid = 1 [(is_uid) = true];
4337
4338 // Signature of the method or field accessed.
4339 optional string signature = 2;
4340
4341 enum AccessMethod {
4342 NONE = 0;
4343 REFLECTION = 1;
4344 JNI = 2;
4345 LINKING = 3;
4346 }
4347
4348 // Type of access.
4349 optional AccessMethod access_method = 3;
4350
4351 // Whether the access was prevented or not.
4352 optional bool access_denied = 4;
4353}
4354
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004355/**
4356 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4357 * - When user sees privacy chip
4358 * - When user clicks privacy chip
4359 * - How does the user exit the Privacy Dialog
4360 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004361 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4362 */
4363message PrivacyIndicatorsInteracted {
4364
4365 enum Type {
4366 UNKNOWN = 0;
4367 CHIP_VIEWED = 1;
4368 CHIP_CLICKED = 2;
4369 DIALOG_PRIVACY_SETTINGS = 3;
4370 DIALOG_DISMISS = 4;
4371 DIALOG_LINE_ITEM = 5;
4372 }
4373
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004374 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004375
4376 // Used if the type is LINE_ITEM
4377 optional string package_name = 2;
4378}
4379
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004380/**
4381 * Logs information about a package that is moved from the internal to external storage and vice
4382 * versa.
4383 * It logs the package name, the type of the external storage where the package is installed
4384 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4385 * and the move type: if it's from internal to external or the other way around.
4386 *
4387 * Logged from:
4388 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4389 */
4390message AppMovedStorageReported {
4391 enum MoveType {
4392 UNKNOWN = 0;
4393 TO_EXTERNAL = 1;
4394 TO_INTERNAL = 2;
4395 }
4396 // The type of the external storage.
4397 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4398 // The type of move.
4399 optional MoveType move_type = 2;
4400 // The name of the package that was moved.
4401 optional string package_name = 3;
4402}
4403
jianjin8f2dee02019-03-29 14:03:08 -07004404/**
4405 * Logs when system server watchdog occurs.
4406 * Logged from:
4407 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4408 */
4409message SystemServerWatchdogOccurred {
4410 optional string subject = 1;
4411}
4412
4413/**
4414 * Logs when new file added to tombstones.
4415 * Logged from:
4416 * frameworks/base/core/java/com/android/server/BootReceiver.java
4417 */
4418message TombStoneOccurred {
4419}
4420
Hai Zhang5d3328d2019-04-13 21:25:06 +08004421/*
4422 * Information about a role request
4423 *
4424 * Logged from:
4425 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4426 */
4427message RoleRequestResultReported {
4428 // UID of application requesting the role
4429 optional int32 requesting_uid = 1;
4430
4431 // Package name of application requesting the role
4432 optional string requesting_package_name = 2;
4433
4434 // The role to be granted
4435 optional string role_name = 3;
4436
4437 // The count of applications qualifying for the role
4438 optional int32 qualifying_count = 4;
4439
4440 // UID of application current granted the role
4441 optional int32 current_uid = 5;
4442
4443 // Package name of application current granted the role
4444 optional string current_package_name = 6;
4445
4446 // UID of another application that user chose to grant the role to, instead of the requesting
4447 // application
4448 optional int32 granted_another_uid = 7;
4449
4450 // Package name of another application that user chose to grant the role to, instead of the
4451 // requesting application
4452 optional string granted_another_package_name = 8;
4453
4454 enum Result {
4455 UNDEFINED = 0;
4456 // role request was ignored
4457 IGNORED = 1;
4458 // role request was ignored because it's already granted
4459 IGNORED_ALREADY_GRANTED = 2;
4460 // role request was ignored because the application isn't qualified
4461 IGNORED_NOT_QUALIFIED = 3;
4462 // role request was ignored because user said it should be always denied
4463 IGNORED_USER_ALWAYS_DENIED = 4;
4464 // role was granted by user action
4465 USER_GRANTED = 5;
4466 // role was denied by user action
4467 USER_DENIED = 6;
4468 // role was denied by user granting another application the role
4469 USER_DENIED_GRANTED_ANOTHER = 7;
4470 // role was denied and set to be always denied by the user
4471 USER_DENIED_WITH_ALWAYS = 8;
4472 }
4473 // The result of the role request
4474 optional Result result = 9;
4475}
4476
Mark Tabrya824a642019-11-05 12:26:12 -08004477/**
4478 * Logs when a Vehicle Maps Service client's connection state has changed
4479 *
4480 * Logged from:
4481 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4482 */
4483message VmsClientConnectionStateChanged {
4484 // The UID of the VMS client app
4485 optional int32 uid = 1 [(is_uid) = true];
4486
4487 enum State {
4488 UNKNOWN = 0;
4489 // Attempting to connect to the client
4490 CONNECTING = 1;
4491 // Client connection established
4492 CONNECTED = 2;
4493 // Client connection closed unexpectedly
4494 DISCONNECTED = 3;
4495 // Client connection closed by VMS
4496 TERMINATED = 4;
4497 // Error establishing the client connection
4498 CONNECTION_ERROR = 5;
4499 }
4500
4501 optional State state = 2;
4502}
4503
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004504/**
4505 * Logs when MediaProvider has successfully finished scanning a storage volume.
4506 *
4507 * Logged from:
4508 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4509 */
shafik43825842020-04-02 17:30:24 +01004510message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004511 enum Reason {
4512 // Scan triggered due to unknown reason
4513 UNKNOWN = 0;
4514 // Scan triggered due to storage volume being mounted
4515 MOUNTED = 1;
4516 // Scan triggered due to explicit user action or app request
4517 DEMAND = 2;
4518 // Scan triggered due to idle maintenance
4519 IDLE = 3;
4520 }
4521
4522 // Volume type that this event pertains to
4523 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4524 // Reason why this scan was triggered
4525 optional Reason reason = 2;
4526 // Total number of files scanned
4527 optional int64 item_count = 3;
4528 // Duration of scan, normalized per file
4529 optional float normalized_duration_millis = 4;
4530 // Number of database inserts, normalized per file
4531 optional float normalized_insert_count = 5;
4532 // Number of database updates, normalized per file
4533 optional float normalized_update_count = 6;
4534 // Number of database deletes, normalized per file
4535 optional float normalized_delete_count = 7;
4536}
4537
4538/**
4539 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4540 *
4541 * Logged from:
4542 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4543 */
shafik43825842020-04-02 17:30:24 +01004544message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004545 // Volume type that this event pertains to
4546 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004547 // UID of app that requested deletion
4548 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004549 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004550 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004551}
4552
4553/**
4554 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4555 *
4556 * Logged from:
4557 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4558 */
shafik43825842020-04-02 17:30:24 +01004559message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004560 enum Result {
4561 UNKNOWN = 0;
4562 USER_GRANTED = 1;
4563 AUTO_GRANTED = 2;
4564 USER_DENIED = 3;
4565 USER_DENIED_WITH_PREJUDICE = 4;
4566 AUTO_DENIED = 5;
4567 }
4568
4569 // Volume type that this event pertains to
4570 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004571 // UID of app that requested permission
4572 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004573 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004574 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004575 // Result of this request
shafik43825842020-04-02 17:30:24 +01004576 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004577}
4578
4579/**
4580 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4581 *
4582 * Logged from:
4583 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4584 */
shafik43825842020-04-02 17:30:24 +01004585message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004586 // Volume type that this event pertains to
4587 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4588 // Old database version code
4589 optional int32 version_from = 2;
4590 // New database version code
4591 optional int32 version_to = 3;
4592 // Total number of files in database
4593 optional int64 item_count = 4;
4594 // Duration of schema change, normalized per file
4595 optional float normalized_duration_millis = 5;
4596}
4597
4598/**
4599 * Logs when MediaProvider has finished an idle maintenance job.
4600 *
4601 * Logged from:
4602 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4603 */
shafik43825842020-04-02 17:30:24 +01004604message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004605 // Volume type that this event pertains to
4606 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4607
4608 // Total number of files in database
4609 optional int64 item_count = 2;
4610 // Duration of idle maintenance, normalized per file
4611 optional float normalized_duration_millis = 3;
4612 // Number of thumbnails found to be stale, normalized per file
4613 optional float normalized_stale_thumbnails = 4;
4614 // Number of items found to be expired, normalized per file
4615 optional float normalized_expired_media = 5;
4616}
4617
Keun young Park3e033cb2019-12-18 11:27:35 -08004618/**
4619 * Represents boot time event with duration in ms.
4620 *
4621 * Logged from: bootstat and various system server components. Check each enums for details.
4622 */
4623message BootTimeEventDuration {
4624 enum DurationEvent {
4625 UNKNOWN = 0;
4626 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4627 ABSOLUTE_BOOT_TIME = 1;
4628 // Bootloader's 1st stage execution time.
4629 // Logged from bootstat.
4630 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4631 // Bootloader's 1st stage loading time.
4632 // Logged from bootstat.
4633 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4634 // Bootloader's kernel loading time.
4635 // Logged from bootstat.
4636 BOOTLOADER_KERNEL_LOAD = 4;
4637 // Bootloader's 2nd stage execution time.
4638 // Logged from bootstat.
4639 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4640 // Bootloader's 2nd stage loading time.
4641 // Logged from bootstat.
4642 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4643 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4644 // for locked device.
4645 // Logged from bootstat.
4646 BOOTLOADER_UI_WAIT = 7;
4647 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4648 // Logged from bootstat.
4649 BOOTLOADER_TOTAL = 8;
4650 // Shutdown duration inside init for the reboot before the current boot up.
4651 // Logged from f/b/services/.../BootReceiver.java.
4652 SHUTDOWN_DURATION = 9;
4653 // Total time for mounting of disk devices during bootup.
4654 // Logged from f/b/services/.../BootReceiver.java.
4655 MOUNT_DEFAULT_DURATION = 10;
4656 // Total time for early stage mounting of disk devices during bootup.
4657 // Logged from f/b/services/.../BootReceiver.java.
4658 MOUNT_EARLY_DURATION = 11;
4659 // Total time for late stage mounting of disk devices during bootup.
4660 // Logged from f/b/services/.../BootReceiver.java.
4661 MOUNT_LATE_DURATION = 12;
4662 // Average time to scan non-system app after OTA
4663 // Logged from f/b/services/.../PackageManagerService.java
4664 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4665 // Time to initialize Package manager after OTA
4666 // Logged from f/b/services/.../PackageManagerService.java
4667 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4668 // Time to scan all system app from Package manager after OTA
4669 // Logged from f/b/services/.../PackageManagerService.java
4670 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4671 // Init's total time for cold boot stage.
4672 // Logged from bootstat.
4673 COLDBOOT_WAIT = 16;
4674 // Init's total time for initializing selinux.
4675 // Logged from bootstat.
4676 SELINUX_INIT = 17;
4677 // Time since last factory reset.
4678 // Logged from bootstat.
4679 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004680 // Init's total time spent for completing the 1st stage.
4681 // Logged from bootstat.
4682 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004683 }
4684
4685 // Type of the event.
4686 optional DurationEvent event = 1;
4687 // Duration of the event in ms.
4688 optional int64 duration_millis = 2;
4689}
4690
4691/**
4692 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4693 * since boot-up.
4694 *
4695 * Logged from: bootstat and various system server components. Check each enums for details.
4696 */
4697message BootTimeEventElapsedTime {
4698 enum ElapsedTimeEvent {
4699 UNKNOWN = 0;
4700 // Time when init starts 1st stage. Logged from bootstat.
4701 ANDROID_INIT_STAGE_1 = 1;
4702 // Time when sys.boot_completed prop is set.
4703 // Logged from bootstat.
4704 BOOT_COMPLETE = 2;
4705 // BOOT_COMPLETE for encrypted device.
4706 BOOT_COMPLETE_ENCRYPTION = 3;
4707 // BOOT_COMPLETE for device with no encryption.
4708 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4709 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004710 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004711 // BOOT_COMPLETE after factory reset.
4712 FACTORY_RESET_BOOT_COMPLETE = 6;
4713 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4714 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004715 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4716 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004717 // BOOT_COMPLETE after OTA.
4718 OTA_BOOT_COMPLETE = 9;
4719 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4720 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004721 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4722 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004723 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4724 // Logged from f/b/services/.../UserController.java
4725 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4726 // Time when the system starts sending BOOT_COMPLETED broadcast.
4727 // Logged from f/b/services/.../UserController.java
4728 FRAMEWORK_BOOT_COMPLETED = 13;
4729 // Time when the package manager starts init.
4730 // Logged from f/b/services/.../SystemServer.java
4731 PACKAGE_MANAGER_INIT_START = 14;
4732 // Time when package manager is ready
4733 // Logged from f/b/services/.../SystemServer.java
4734 PACKAGE_MANAGER_INIT_READY = 15;
4735 // Represents the time when user has entered unlock credential for system with user pin.
4736 // Logged from bootstat.
4737 POST_DECRYPT = 16;
4738 // Represents the start of zygote's init.
4739 // Logged from zygote itself.
4740 ZYGOTE_INIT_START = 17;
4741 // Represents the start of secondary zygote's init.
4742 // TODO: add logging to zygote
4743 SECONDARY_ZYGOTE_INIT_START = 18;
4744 // Represents the start of system server's init.
4745 // Logged from f/b/services/.../SystemServer.java
4746 SYSTEM_SERVER_INIT_START = 19;
4747 // Represents the completion of system server's init.
4748 // Logged from f/b/services/.../SystemServer.java
4749 SYSTEM_SERVER_READY = 20;
4750 // Represents the start of launcher during boot-up.
4751 // TODO: add logging
4752 LAUNCHER_START = 21;
4753 // Represents the completion of launcher's initial rendering. User can use other apps from
4754 // launcher from this point.
4755 // TODO: add logging
4756 LAUNCHER_SHOWN = 22;
4757 }
4758
4759 // Type of the event.
4760 optional ElapsedTimeEvent event = 1;
4761 // Time since bootup for the event.
4762 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4763 optional int64 time_millis = 2;
4764}
4765
4766/**
4767 * Boot time events with UTC time.
4768 *
4769 * Logged from: bootstat and various system server components. Check each enums for details.
4770 */
4771message BootTimeEventUtcTime {
4772 enum UtcTimeEvent {
4773 UNKNOWN = 0;
4774 // Time of the bootstat's marking of 1st boot after the last factory reset.
4775 // Logged from bootstat.
4776 FACTORY_RESET_RESET_TIME = 1;
4777 // The time when bootstat records FACTORY_RESET_* events. This is close to
4778 // BOOT_COMPLETE time for the current bootup.
4779 // Logged from bootstat.
4780 FACTORY_RESET_CURRENT_TIME = 2;
4781 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4782 // Logged from bootstat.
4783 FACTORY_RESET_RECORD_VALUE = 3;
4784 }
4785
4786 // Type of the event.
4787 optional UtcTimeEvent event = 1;
4788 // UTC time for the event.
4789 optional int64 utc_time_secs = 2;
4790}
4791
4792/**
4793 * Boot time events representing specific error code during bootup.
4794 * Meaning of error code can be different per each event type.
4795 *
4796 * Logged from: bootstat and various system server components. Check each enums for details.
4797 */
4798message BootTimeEventErrorCode {
4799 enum ErrorCodeEvent {
4800 UNKNOWN = 0;
4801 // Linux error code for time() call to get the current UTC time.
4802 // Logged from bootstat.
4803 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4804 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4805 // as UMOUNT_STAT_* from init/reboot.cpp.
4806 // Logged from f/b/services/.../BootReceiver.java.
4807 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004808 // Reprepsents fie system mounting error code of /data partition for the current boot.
4809 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004810 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004811 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004812 }
4813
4814 // Type of the event.
4815 optional ErrorCodeEvent event = 1;
4816 // error code defined per each event type.
4817 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4818 // FS_MGR_FS_STAT.
4819 optional int32 error_code = 2;
4820}
4821
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004822/**
4823 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4824 * after an OTA.
4825 *
4826 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004827 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004828 */
4829message SnapshotMergeReported {
4830 // Keep in sync with
4831 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4832 enum UpdateState {
4833 // No update or merge is in progress.
4834 NONE = 0;
4835 // An update is applying; snapshots may already exist.
4836 INITIATED = 1;
4837 // An update is pending, but has not been successfully booted yet.
4838 UNVERIFIED = 2;
4839 // The kernel is merging in the background.
4840 MERGING = 3;
4841 // Post-merge cleanup steps could not be completed due to a transient
4842 // error, but the next reboot will finish any pending operations.
4843 MERGE_NEEDS_REBOOT = 4;
4844 // Merging is complete, and needs to be acknowledged.
4845 MERGE_COMPLETED = 5;
4846 // Merging failed due to an unrecoverable error.
4847 MERGE_FAILED = 6;
4848 // The update was implicitly cancelled, either by a rollback or a flash
4849 // operation via fastboot. This state can only be returned by WaitForMerge.
4850 CANCELLED = 7;
4851 };
4852
4853 // Status of the update after the merge attempts.
4854 optional UpdateState final_state = 1;
4855
4856 // Time to complete a merge operation in milliseconds.
4857 // A negative value corresponds to the case in which the merge operation
4858 // was interrupted and resumed (e.g. in case of a system reboot during the
4859 // merge).
4860 optional int64 duration_millis = 2;
4861
4862 // Number of reboots that occurred after issuing and before completing the
4863 // merge of all the snapshot devices.
4864 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004865
4866 // The device has been upgraded to Virtual A/B.
4867 optional bool is_vab_retrofit = 4;
4868
4869 // Space that has been temporarily allocated in the /data partition
4870 // containing the dm-snapshot's copy-on-write data generated during a
4871 // Virtual A/B update.
4872 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004873}
4874
Chenjie Yubbcbc602018-02-05 16:51:52 -08004875//////////////////////////////////////////////////////////////////////
4876// Pulled atoms below this line //
4877//////////////////////////////////////////////////////////////////////
4878
4879/**
David Chenc8a43242017-10-17 16:23:28 -07004880 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4881 *
4882 * Pulled from:
4883 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4884 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004885message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004886 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004887
4888 optional int64 rx_bytes = 2;
4889
4890 optional int64 rx_packets = 3;
4891
4892 optional int64 tx_bytes = 4;
4893
4894 optional int64 tx_packets = 5;
4895}
4896
4897/**
4898 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4899 *
4900 * Pulled from:
4901 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4902 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004903message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004904 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004905
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004906 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4907 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004908
4909 optional int64 rx_bytes = 3;
4910
4911 optional int64 rx_packets = 4;
4912
4913 optional int64 tx_bytes = 5;
4914
4915 optional int64 tx_packets = 6;
4916}
4917
4918/**
4919 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4920 *
4921 * Pulled from:
4922 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4923 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004924message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004925 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004926
4927 optional int64 rx_bytes = 2;
4928
4929 optional int64 rx_packets = 3;
4930
4931 optional int64 tx_bytes = 4;
4932
4933 optional int64 tx_packets = 5;
4934}
4935
4936/**
4937 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4938 *
4939 * Pulled from:
4940 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4941 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004942message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004943 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004944
Yao Chenc40a19d2018-03-15 16:48:25 -07004945 // 1 denotes foreground and 0 denotes background. This is called Set in
4946 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004947 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004948
4949 optional int64 rx_bytes = 3;
4950
4951 optional int64 rx_packets = 4;
4952
4953 optional int64 tx_bytes = 5;
4954
4955 optional int64 tx_packets = 6;
4956}
4957
4958/**
junyulai8d1a6092020-05-07 13:38:15 +08004959 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004960 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4961 * the caller must not assume any row of data is one full report when filtering with a set of
4962 * matching conditions, because future data may represent with multiple rows what is currently
4963 * represented by one.
4964 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4965 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004966 *
4967 * Pulled from:
4968 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4969 */
4970message DataUsageBytesTransfer {
4971 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4972 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4973 // states combined, not including debug states. See NetworkStats#SET_*.
4974 optional int32 state = 1;
4975
4976 optional int64 rx_bytes = 2;
4977
4978 optional int64 rx_packets = 3;
4979
4980 optional int64 tx_bytes = 4;
4981
4982 optional int64 tx_packets = 5;
4983
4984 // Radio Access Technology (RAT) type of this record, should be one of
4985 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
4986 // the record is for all rat types combined.
4987 optional int32 rat_type = 6;
4988
4989 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08004990 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08004991 optional string sim_mcc = 7;
4992 optional string sim_mnc = 8;
4993
junyulai8b794b72020-05-19 17:36:13 +08004994 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
4995 // See TelephonyManager#getSimCarrierId.
4996 optional int32 carrier_id = 9;
4997
junyulai8d1a6092020-05-07 13:38:15 +08004998 // Enumeration of opportunistic states with an additional ALL state indicates the record is
4999 // combined regardless of the boolean value in its field.
5000 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005001 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005002 ALL = 1;
5003 OPPORTUNISTIC = 2;
5004 NOT_OPPORTUNISTIC = 3;
5005 }
5006 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005007 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005008 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005009 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005010}
5011
5012/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005013 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5014 *
5015 * Pulled from:
5016 * StatsCompanionService
5017 */
5018message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005019 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005020
5021 optional int64 rx_bytes = 2;
5022
5023 optional int64 tx_bytes = 3;
5024}
5025
5026/**
David Chenc8a43242017-10-17 16:23:28 -07005027 * Pulls the kernel wakelock durations. This atom is adapted from
5028 * android/internal/os/KernelWakelockStats.java
5029 *
5030 * Pulled from:
5031 * StatsCompanionService using KernelWakelockReader.
5032 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005033message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005034 optional string name = 1;
5035
5036 optional int32 count = 2;
5037
5038 optional int32 version = 3;
5039
Yangster-maca8a30442018-10-13 23:46:34 -07005040 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005041}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005042
Chenjie Yu05013b32017-11-21 10:21:41 -08005043/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005044 * Pulls low power state information. If power.stats HAL is not available, this
5045 * includes platform and subsystem sleep state information,
5046 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5047 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005048 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005049 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005050 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5051 * as defined in:
5052 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005053 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005054message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005055 // Subsystem name
5056 optional string subsystem_name = 1;
5057 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5058 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005059 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5060 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005061 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005062 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005063 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005064 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005066}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005067
Chenjie Yu05013b32017-11-21 10:21:41 -08005068/**
Bookatz92da2832018-11-01 18:10:03 -07005069 * Pulls on-device power measurement information.
5070 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5071 * Pulled from:
5072 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5073 */
5074message OnDevicePowerMeasurement {
5075 // Name of the subsystem (to which the rail belongs).
5076 optional string subsystem_name = 1;
5077
5078 // Rail name. The rail lies within the subsystem.
5079 optional string rail_name = 2;
5080
5081 // Time (in ms since boot) at which the rail energy value was measured.
5082 // This may differ slightly from the time that statsd logs this information.
5083 optional uint64 measurement_timestamp_millis = 3;
5084
5085 // Accumulated energy used via the rail since device boot in uWs.
5086 optional uint64 energy_microwatt_secs = 4;
5087}
5088
5089/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005090 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005091 * Pulls the time the cpu spend on the frequency index. Frequency index
5092 * starts from highest to lowest. The value should be monotonically
5093 * increasing since boot. However, if there is a cpu
5094 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005095 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005096message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005097 optional uint32 cluster = 1;
5098 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005099 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005100}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005101
Chenjie Yu05013b32017-11-21 10:21:41 -08005102/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005103 * Pulls Cpu Time Per Uid.
5104 * Note that isolated process uid time should be attributed to host uids.
5105 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005106message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005107 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005108 optional uint64 user_time_micros = 2;
5109 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005110}
5111
5112/**
5113 * Pulls Cpu Time Per Uid per frequency.
5114 * Note that isolated process uid time should be attributed to host uids.
5115 * For each uid, we order the time by descending frequencies.
5116 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005117message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005118 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005119 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005120 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005121}
Hugo Benichi884970e2017-11-14 22:42:46 +09005122
Chenjie Yu05013b32017-11-21 10:21:41 -08005123/**
5124 * Pulls Wifi Controller Activity Energy Info
5125 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005126message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005127 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005128 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005129 // stack reported state
5130 // TODO: replace this with proto enum
5131 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005132 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005133 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005134 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005135 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005136 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005137 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005138 // product of current(mA), voltage(V) and time(ms)
5139 optional uint64 controller_energy_used = 6;
5140}
5141
5142/**
5143 * Pulls Modem Activity Energy Info
5144 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005145message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005146 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005147 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005148 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005149 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005150 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005151 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005152 /**
5153 * Tx power index
5154 * index 0 = tx_power < 0dBm
5155 * index 1 = 0dBm < tx_power < 5dBm
5156 * index 2 = 5dBm < tx_power < 15dBm
5157 * index 3 = 15dBm < tx_power < 20dBm
5158 * index 4 = tx_power > 20dBm
5159 */
5160 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005161 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005162 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005163 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005164 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005165 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005166 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005167 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005168 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005169 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005170 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005171 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005172 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005173 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005174}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005175
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005176/**
5177 * Pulls Bluetooth Activity Energy Info
5178 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5179 */
5180message BluetoothActivityInfo {
5181 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005182 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005183 // bluetooth stack state
5184 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005185 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005186 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005187 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005188 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005189 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005190 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005191 // product of current(mA), voltage(V) and time(ms)
5192 optional uint64 energy_used = 6;
5193}
5194
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005195/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005196 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005197 *
5198 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005199 */
5200message ProcessMemoryState {
5201 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005202 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005203
5204 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005205 // Usually package name, "system" for system server.
5206 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005207 optional string process_name = 2;
5208
Rafal Slawikda51b932018-12-13 16:31:33 +00005209 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005210 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005211
5212 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005213 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005214
5215 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005216 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005217
Rajeev Kumar90235992018-01-29 11:06:48 -08005218 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005219 // Value is read from memory.stat, field total_rss if per-app memory
5220 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005221 optional int64 rss_in_bytes = 6;
5222
5223 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005224 // Value is read from memory.stat, field total_cache if per-app memory
5225 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005226 optional int64 cache_in_bytes = 7;
5227
5228 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005229 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005230 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005231 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005232
Rafal Slawik203c3db2019-09-25 19:53:01 +01005233 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005234 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005235
Rafal Slawik203c3db2019-09-25 19:53:01 +01005236 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5237 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005238
Rafal Slawik203c3db2019-09-25 19:53:01 +01005239 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5240 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005241}
5242
5243/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005244 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005245 *
5246 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5247 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005248 *
5249 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005250 */
5251message ProcessMemoryHighWaterMark {
5252 // The uid if available. -1 means not available.
5253 optional int32 uid = 1 [(is_uid) = true];
5254
Rafal Slawikda51b932018-12-13 16:31:33 +00005255 // The process name.
5256 // Usually package name or process cmdline.
5257 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005258 optional string process_name = 2;
5259
Rafal Slawik239b6802019-09-09 18:46:01 +01005260 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5261 // computed by converting kilobytes to bytes.
5262 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5263
Rafal Slawik3bea8952018-11-15 12:39:33 +00005264 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5265 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005266 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005267}
5268
5269/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005270 * Logs the memory stats for a process.
5271 *
5272 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5273 * and for selected native processes.
5274 */
5275message ProcessMemorySnapshot {
5276 // The uid if available. -1 means not available.
5277 optional int32 uid = 1 [(is_uid) = true];
5278
5279 // The process name.
5280 // Usually package name or process cmdline.
5281 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5282 optional string process_name = 2;
5283
5284 // The pid of the process.
5285 // Allows to disambiguate instances of the process.
5286 optional int32 pid = 3;
5287
5288 // The current OOM score adjustment value.
5289 // Read from ProcessRecord for managed processes.
5290 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5291 optional int32 oom_score_adj = 4;
5292
5293 // The current RSS of the process.
5294 // VmRSS from /proc/pid/status.
5295 optional int32 rss_in_kilobytes = 5;
5296
5297 // The current anon RSS of the process.
5298 // RssAnon from /proc/pid/status.
5299 optional int32 anon_rss_in_kilobytes = 6;
5300
5301 // The current swap size of the process.
5302 // VmSwap from /proc/pid/status.
5303 optional int32 swap_in_kilobytes = 7;
5304
5305 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5306 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5307}
5308
5309/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005310 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005311 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005312message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005313 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005314}
5315
5316/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005317 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005318 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005319message SystemUptime {
5320 // Milliseconds since the system was booted.
5321 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5322 // for external input).
5323 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005324 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005325}
5326
5327/*
5328 * Reads from /proc/uid_concurrent_active_time which has the format:
5329 * active: X (X is # cores)
5330 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5331 * [uid1]: [time-0] [time-1] [time-2] ... ...
5332 * ...
5333 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5334 * The file contains a monotonically increasing count of time for a single boot.
5335 */
5336message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005337 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005338 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005339}
5340
5341/**
5342 * Reads from /proc/uid_concurrent_policy_time which has the format:
5343 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5344 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5345 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5346 * ...
5347 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5348 * The file contains a monotonically increasing count of time for a single boot.
5349 */
5350message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005351 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005352 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005353 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005354}
5355
5356/*
5357 * Pulls free disk space, for data, system partition and temporary directory.
5358 */
5359message DiskSpace {
5360 // available bytes in data partition
5361 optional uint64 data_available_bytes = 1;
5362 // available bytes in system partition
5363 optional uint64 system_available_bytes = 2;
5364 // available bytes in download cache or temp directories
5365 optional uint64 temp_available_bytes = 3;
5366}
Tej Singhbf972d92018-01-10 20:51:13 -08005367
5368/**
5369 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005370 *
5371 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005372 */
5373message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005374 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005375}
5376
5377/**
5378 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005379 * Pulled from:
5380 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005381 */
5382message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005383 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005384}
5385
5386/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005387 * Pulls battery voltage.
5388 * Pulled from:
5389 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5390 */
5391message BatteryVoltage {
5392 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005393 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005394}
5395
5396/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005397 * Pulls battery level (percent full, from 0 to 100).
5398 *
5399 * Pulled from:
5400 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5401 */
5402message BatteryLevel {
5403 // Battery level. Should be in [0, 100].
5404 optional int32 battery_level = 1;
5405}
5406
5407/**
Tej Singhd89137e2018-03-26 14:51:40 -07005408 * Pulls the temperature of various parts of the device.
5409 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005410 *
Maggie White442b6312019-04-05 16:26:44 -07005411 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005412 */
5413message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005414 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005415 optional android.os.TemperatureTypeEnum sensor_location = 1;
5416
5417 // The name of the temperature source. Eg. CPU0
5418 optional string sensor_name = 2;
5419
Tej Singhd89137e2018-03-26 14:51:40 -07005420 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005421 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005422 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005423
5424 // Relative severity of the throttling, see enum definition.
5425 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005426}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005427
5428/**
5429 * Pulls the statistics of calls to Binder.
5430 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005431 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5432 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005433 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005434 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005435 */
5436message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005437 // UID of the process responsible for the binder transaction. It will be set if the process
5438 // executing the binder transaction attribute the transaction to another uid using
5439 // Binder.setThreadWorkSource().
5440 //
5441 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005442 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005443 // UID of the process executing the binder transaction.
5444 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005445 // Fully qualified class name of the API call.
5446 //
5447 // This is a system server class name.
5448 //
5449 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5450 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5451 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5452 // commonly used APIs.
5453 optional string service_class_name = 2;
5454 // Method name of the API call. It can also be a transaction code if we cannot
5455 // resolve it to a name. See Binder#getTransactionName.
5456 //
5457 // This is a system server method name.
5458 optional string service_method_name = 3;
5459 // Total number of API calls.
5460 optional int64 call_count = 4;
5461 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5462 optional bool screen_interactive = 13;
5463 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5464 // call_count will be equal to recorded_call_count.
5465 //
5466 // If recorded_call_count is different than call_count, it means data collection has been
5467 // sampled. All the fields below will be sampled in this case.
5468 optional int64 recorded_call_count = 12;
5469 // Number of exceptions thrown by the API.
5470 optional int64 recorded_exception_count = 5;
5471 // Total latency of all API calls.
5472 // Average can be computed using total_latency_micros / recorded_call_count.
5473 optional int64 recorded_total_latency_micros = 6;
5474 // Maximum latency of one API call.
5475 optional int64 recorded_max_latency_micros = 7;
5476 // Total CPU usage of all API calls.
5477 // Average can be computed using total_cpu_micros / recorded_call_count.
5478 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5479 optional int64 recorded_total_cpu_micros = 8;
5480 // Maximum CPU usage of one API call.
5481 optional int64 recorded_max_cpu_micros = 9;
5482 // Maximum parcel reply size of one API call.
5483 optional int64 recorded_max_reply_size_bytes = 10;
5484 // Maximum parcel request size of one API call.
5485 optional int64 recorded_max_request_size_bytes = 11;
5486}
5487
5488/**
5489 * Pulls the statistics of exceptions during calls to Binder.
5490 *
5491 * Binder stats are cumulative from boot unless somebody reset the data using
5492 * > adb shell dumpsys binder_calls_stats --reset
5493 */
5494message BinderCallsExceptions {
5495 // Exception class name, e.g. java.lang.IllegalArgumentException.
5496 //
5497 // This is an exception class name thrown by the system server.
5498 optional string exception_class_name = 1;
5499 // Total number of exceptions.
5500 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005501}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005502
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005503/**
5504 * Pulls the statistics of message dispatching on HandlerThreads.
5505 *
5506 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5507 * config on the device.
5508 *
5509 * Next tag: 11
5510 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005511message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005512 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005513 optional int32 uid = 1 [(is_uid) = true];
5514
5515 // Fully qualified class name of the handler target class.
5516 //
5517 // This field does not contain PII. This is a system server class name.
5518 optional string handler_class_name = 2;
5519
5520 // The name of the thread that runs the Looper.
5521 //
5522 // This field does not contain PII. This is a system server thread name.
5523 optional string looper_thread_name = 3;
5524
5525 // The name of the dispatched message.
5526 //
5527 // This field does not contain PII. This is a system server constant or class
5528 // name.
5529 optional string message_name = 4;
5530
5531 // Total number of successfully dispatched messages.
5532 optional int64 message_count = 5;
5533
5534 // Total number of messages that failed dispatching.
5535 optional int64 exception_count = 6;
5536
5537 // Total number of processed messages we have data recorded for. If we
5538 // collected data for all the messages, message_count will be equal to
5539 // recorded_message_count.
5540 //
5541 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005542 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005543 optional int64 recorded_message_count = 7;
5544
5545 // Total latency of all processed messages.
5546 // Average can be computed using recorded_total_latency_micros /
5547 // recorded_message_count.
5548 optional int64 recorded_total_latency_micros = 8;
5549
5550 // Total CPU usage of all processed message.
5551 // Average can be computed using recorded_total_cpu_micros /
5552 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005553 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005554 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005555
5556 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5557 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005558
5559 // Max recorded CPU usage of all processed messages.
5560 optional int64 recorded_max_cpu_micros = 11;
5561
5562 // Max recorded latency of all processed messages.
5563 optional int64 recorded_max_latency_micros = 12;
5564
5565 // Total number of messages we tracked the dispatching delay for. If we
5566 // collected data for all the messages, message_count will be equal to
5567 // recorded_delay_message_count.
5568 //
5569 // If recorded_delay_message_count is different than message_count, it means data
5570 // collection has been sampled or/and not all messages specified the target dispatch time.
5571 // The fields below will be sampled in this case.
5572 optional int64 recorded_delay_message_count = 13;
5573
5574 // Total dispatching delay of all processed messages.
5575 // Calculated as a difference between the target dispatching time (Message.when)
5576 // and the actual dispatching time.
5577 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5578 optional int64 recorded_total_delay_millis = 14;
5579
5580 // Max dispatching delay of all processed messages.
5581 // Calculated as a difference between the target dispatching time (Message.when)
5582 // and the actual dispatching time.
5583 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005584}
Tej Singh86dc9db2018-09-06 00:39:57 +00005585
5586/**
5587 * Pulls disk information, such as write speed and latency.
5588 */
5589message DiskStats {
5590 // Time taken to open, write 512B to, and close a file.
5591 // -1 if error performing the check.
5592 optional int64 data_write_latency_millis = 1;
5593
5594 optional bool file_based_encryption = 2;
5595
5596 // Recent disk write speed in kB/s.
5597 // -1 if error querying storageed.
5598 // 0 if data is unavailable.
5599 optional int32 recent_disk_write_speed = 3;
5600}
5601
5602
5603/**
5604 * Free and total bytes of the Data, Cache, and System partition.
5605 */
5606message DirectoryUsage {
5607 enum Directory {
5608 UNKNOWN = 0;
5609 DATA = 1;
5610 CACHE = 2;
5611 SYSTEM = 3;
5612 }
5613 optional Directory directory = 1;
5614 optional int64 free_bytes = 2;
5615 optional int64 total_bytes = 3;
5616}
5617
5618
5619/**
5620 * Size of an application: apk size, data size, and cache size.
5621 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5622 * Information is only reported for apps with the primary user (user 0).
5623 * Sizes are aggregated by package name.
5624 */
5625message AppSize {
5626 // Including uids will involve modifying diskstats logic.
5627 optional string package_name = 1;
5628 // App size in bytes. -1 if unavailable.
5629 optional int64 app_size_bytes = 2;
5630 // App data size in bytes. -1 if unavailable.
5631 optional int64 app_data_size_bytes = 3;
5632 // App cache size in bytes. -1 if unavailable.
5633 optional int64 app_cache_size_bytes = 4;
5634 // Time that the cache file was produced.
5635 // Uses System.currentTimeMillis(), which is wall clock time.
5636 optional int64 cache_time_millis = 5;
5637}
5638
5639
5640/**
5641 * Size of a particular category. Eg: photos, videos.
5642 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5643 */
5644message CategorySize {
5645 enum Category {
5646 UNKNOWN = 0;
5647 APP_SIZE = 1;
5648 APP_DATA_SIZE = 2;
5649 APP_CACHE_SIZE = 3;
5650 PHOTOS = 4;
5651 VIDEOS = 5;
5652 AUDIO = 6;
5653 DOWNLOADS = 7;
5654 SYSTEM = 8;
5655 OTHER = 9;
5656 }
5657 optional Category category = 1;
5658 // Category size in bytes.
5659 optional int64 size_bytes = 2;
5660 // Time that the cache file was produced.
5661 // Uses System.currentTimeMillis(), which is wall clock time.
5662 optional int64 cache_time_millis = 3;
5663}
Tej Singhd6d6d772018-09-05 17:41:25 -07005664
5665/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005666 * Pulls per uid I/O stats. The stats are cumulative since boot.
5667 *
5668 * Read/write bytes are I/O events from a storage device
5669 * Read/write chars are data requested by read/write syscalls, and can be
5670 * satisfied by caching.
5671 *
5672 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5673 */
5674message DiskIo {
5675 optional int32 uid = 1 [(is_uid) = true];
5676 optional int64 fg_chars_read = 2;
5677 optional int64 fg_chars_write = 3;
5678 optional int64 fg_bytes_read = 4;
5679 optional int64 fg_bytes_write = 5;
5680 optional int64 bg_chars_read = 6;
5681 optional int64 bg_chars_write = 7;
5682 optional int64 bg_bytes_read = 8;
5683 optional int64 bg_bytes_write = 9;
5684 optional int64 fg_fsync = 10;
5685 optional int64 bg_fsync= 11;
5686}
5687
5688
5689/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005690 * Pulls the number of fingerprints for each user.
5691 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005692 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005693 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005694message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005695 // The associated user. Eg: 0 for owners, 10+ for others.
5696 // Defined in android/os/UserHandle.java
5697 optional int32 user = 1;
5698 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005699 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005700}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005701
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005702/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005703 * Pulls the number of faces for each user.
5704 *
5705 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5706 */
5707message NumFacesEnrolled {
5708 // The associated user. Eg: 0 for owners, 10+ for others.
5709 // Defined in android/os/UserHandle.java
5710 optional int32 user = 1;
5711 // Number of faces registered to that user.
5712 optional int32 num_faces_enrolled = 2;
5713}
5714/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005715 * A mapping of role holder -> role
5716 */
5717message RoleHolder {
5718 // uid of the role holder
5719 optional int32 uid = 1 [(is_uid) = true];
5720
5721 // package name of the role holder
5722 optional string package_name = 2;
5723
5724 // the role held
5725 optional string role = 3;
5726}
5727
Yangsteraf9aee72018-10-12 09:26:16 -07005728message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005729 // These are all in byte resolution.
5730 optional int64 min = 1 [deprecated = true];
5731 optional int64 average = 2 [deprecated = true];
5732 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005733
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005734 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5735 // int64 fields.
5736 optional int32 mean_kb = 4;
5737 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005738}
5739
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005740// A reduced subset of process states; reducing the number of possible states allows more
5741// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5742enum ProcessStateAggregated {
5743 PROCESS_STATE_UNKNOWN = 0;
5744 // Persistent system process.
5745 PROCESS_STATE_PERSISTENT = 1;
5746 // Top activity; actually any visible activity.
5747 PROCESS_STATE_TOP = 2;
5748 // Process binding to top or a foreground service.
5749 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5750 // Processing running a foreground service.
5751 PROCESS_STATE_FGS = 4;
5752 // Important foreground process (ime, wallpaper, etc).
5753 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5754 // Important background process.
5755 PROCESS_STATE_BACKGROUND = 6;
5756 // Process running a receiver.
5757 PROCESS_STATE_RECEIVER = 7;
5758 // All kinds of cached processes.
5759 PROCESS_STATE_CACHED = 8;
5760}
5761
5762// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005763message ProcessStatsStateProto {
5764 optional android.service.procstats.ScreenState screen_state = 1;
5765
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005766 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005767
5768 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5769 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005770 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5771
5772 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005773
5774 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005775 optional int64 duration_millis = 4 [deprecated = true];
5776 // Same as above, but with minute resolution so it fits into an int32.
5777 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005778
5779 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005780 optional int64 realtime_duration_millis = 9 [deprecated = true];
5781 // Same as above, but with minute resolution so it fits into an int32.
5782 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005783
5784 // # of samples taken
5785 optional int32 sample_size = 5;
5786
5787 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005788 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005789
5790 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005791 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005792
5793 // RSS is memory resident for this process
5794 optional AggStats rss = 8;
5795}
5796
Jing Ji060d6862020-04-13 19:36:31 -07005797// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005798message ProcessStatsProto {
5799 // Name of process.
5800 optional string process = 1;
5801
5802 // Uid of the process.
5803 optional int32 uid = 2;
5804
5805 // Information about how often kills occurred
5806 message Kill {
5807 // Count of excessive CPU kills
5808 optional int32 cpu = 1;
5809
5810 // Count of kills when cached
5811 optional int32 cached = 2;
5812
5813 // PSS stats during cached kill
5814 optional AggStats cached_pss = 3;
5815 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005816 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005817
5818 // Time and memory spent in various states.
5819 repeated ProcessStatsStateProto states = 5;
5820
5821 // Total time process has been running... screen_state, memory_state, and process_state
5822 // will not be set.
5823 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005824
5825 // Association data for this process in this state;
5826 // each entry here is one association.
5827 repeated ProcessStatsAssociationProto assocs = 7;
5828}
5829
5830// Next Tag: 5
5831message ProcessStatsAssociationProto {
5832 // Procss Name of the associated process (client process of service binding)
5833 optional string assoc_process_name = 1;
5834
5835 // Package Name of the associated package (client package of service binding)
5836 optional string assoc_package_name = 2;
5837
5838 // Total count of the times this association (service binding) appeared.
5839 optional int32 total_count = 3;
5840
5841 // Uptime total duration in seconds this association (service binding) was around.
5842 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005843}
5844
5845message PackageServiceOperationStatsProto {
5846 // Operate enum: Started, Foreground, Bound, Executing
5847 optional android.service.procstats.ServiceOperationState operation = 1;
5848
5849 // Number of times the service was in this operation.
5850 optional int32 count = 2;
5851
5852 // Information about a state the service can be in.
5853 message StateStats {
5854 // Screen state enum.
5855 optional android.service.procstats.ScreenState screen_state = 1;
5856 // Memory state enum.
5857 optional android.service.procstats.MemoryState memory_state = 2;
5858
5859 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005860 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005861 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005862 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005863 }
5864 repeated StateStats state_stats = 3;
5865}
5866
5867message PackageServiceStatsProto {
5868 // Name of service component.
5869 optional string service_name = 1;
5870
5871 // The operation stats.
5872 // The package_name, package_uid, package_version, service_name will not be set to save space.
5873 repeated PackageServiceOperationStatsProto operation_stats = 2;
5874}
5875
5876message PackageAssociationSourceProcessStatsProto {
5877 // Uid of the process.
5878 optional int32 process_uid = 1;
5879 // Process name.
5880 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005881 // Package name.
5882 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005883 // Total count of the times this association appeared.
5884 optional int32 total_count = 3;
5885
5886 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005887 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005888
5889 // Total count of the times this association became actively impacting its target process.
5890 optional int32 active_count = 5;
5891
5892 // Information on one source in this association.
5893 message StateStats {
5894 // Process state enum.
5895 optional android.service.procstats.ProcessState process_state = 1;
5896 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005897 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005898 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005899 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005900 }
5901 repeated StateStats active_state_stats = 6;
5902}
5903
5904message PackageAssociationProcessStatsProto {
5905 // Name of the target component.
5906 optional string component_name = 1;
5907 // Information on one source in this association.
5908 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5909}
5910
5911
5912message ProcessStatsPackageProto {
5913 // Name of package.
5914 optional string package = 1;
5915
5916 // Uid of the package.
5917 optional int32 uid = 2;
5918
5919 // Version of the package.
5920 optional int64 version = 3;
5921
5922 // Stats for each process running with the package loaded in to it.
5923 repeated ProcessStatsProto process_stats = 4;
5924
5925 // Stats for each of the package's services.
5926 repeated PackageServiceStatsProto service_stats = 5;
5927
5928 // Stats for each association with the package.
5929 repeated PackageAssociationProcessStatsProto association_stats = 6;
5930}
5931
5932message ProcessStatsSectionProto {
5933 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005934 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005935
5936 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005937 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005938
5939 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005940 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005941
5942 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005943 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005944
5945 // System runtime library. e.g. "libdvm.so", "libart.so".
5946 optional string runtime = 5;
5947
5948 // whether kernel reports swapped pss.
5949 optional bool has_swapped_pss = 6;
5950
5951 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5952 enum Status {
5953 STATUS_UNKNOWN = 0;
5954 STATUS_COMPLETE = 1;
5955 STATUS_PARTIAL = 2;
5956 STATUS_SHUTDOWN = 3;
5957 STATUS_SYSPROPS = 4;
5958 }
5959 repeated Status status = 7;
5960
Chenjie Yub2ecc792019-01-17 10:27:26 -08005961 // Number of pages available of various types and sizes, representation fragmentation.
5962 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5963
Yangsteraf9aee72018-10-12 09:26:16 -07005964 // Stats for each process.
5965 repeated ProcessStatsProto process_stats = 8;
5966
5967 // Stats for each package.
5968 repeated ProcessStatsPackageProto package_stats = 9;
5969}
5970
Chenjie Yub2ecc792019-01-17 10:27:26 -08005971message ProcessStatsAvailablePagesProto {
5972 // Node these pages are in (as per /proc/pagetypeinfo)
5973 optional int32 node = 1;
5974
5975 // Zone these pages are in (as per /proc/pagetypeinfo)
5976 optional string zone = 2;
5977
5978 // Label for the type of these pages (as per /proc/pagetypeinfo)
5979 optional string label = 3;
5980
5981 // Distribution of number of pages available by order size. First entry in array is
5982 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5983 repeated int32 pages_per_order = 4;
5984}
5985
Chenjie Yu12e5e672018-09-14 15:54:59 -07005986/**
5987 * Pulled from ProcessStatsService.java
5988 */
5989message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005990 optional ProcessStatsSectionProto proc_stats_section = 1;
5991}
5992
Chenjie Yuf910b7802019-01-11 16:08:20 -08005993/**
5994 * Pulled from ProcessStatsService.java
5995 */
5996message ProcStatsPkgProc {
5997 optional ProcessStatsSectionProto proc_stats_section = 1;
5998}
5999
Chris Wrencdea3b72019-11-22 16:58:17 -05006000// Next Tag: 2
6001message PackageRemoteViewInfoProto {
6002 optional string package_name = 1;
6003 // add per-package additional info here (like channels)
6004}
6005
6006// Next Tag: 2
6007message NotificationRemoteViewsProto {
6008 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6009}
6010
6011/**
6012 * Pulled from NotificationManagerService.java
6013 */
6014message NotificationRemoteViews {
6015 optional NotificationRemoteViewsProto notification_remote_views = 1;
6016}
6017
Yotam Aron74299972020-01-16 16:20:58 +02006018/**
6019 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6020 */
6021message PackageNotificationPreferences {
6022 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006023 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006024 // Notification importance, which specifies when and how a notification is displayed.
6025 // Specified under core/java/android/app/NotificationManager.java.
6026 optional int32 importance = 2;
6027 // Lockscreen visibility as set by the user.
6028 optional int32 visibility = 3;
6029 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6030 // PreferencesHelper.java)
6031 optional int32 user_locked_fields = 4;
6032}
6033
6034/**
6035 * Atom that contains a list of a package's channel preferences, pulled from
6036 * NotificationManagerService.java.
6037 */
6038message PackageNotificationChannelPreferences {
6039 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006040 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006041 // Channel's ID. Should always be available.
6042 optional string channel_id = 2;
6043 // Channel's name. Should always be available.
6044 optional string channel_name = 3;
6045 // Channel's description. Optionally set by the channel creator.
6046 optional string description = 4;
6047 // Notification importance, which specifies when and how a notification is displayed. Specified
6048 // under core/java/android/app/NotificationManager.java.
6049 optional int32 importance = 5;
6050 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6051 // at core/java/android/app/NotificationChannel.java
6052 optional int32 user_locked_fields = 6;
6053 // Indicates if the channel was deleted by the app.
6054 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006055 // Indicates if the channel was marked as a conversation by the app.
6056 optional bool is_conversation = 8;
6057 // Indicates if the channel is a conversation that was demoted by the user.
6058 optional bool is_demoted_conversation = 9;
6059 // Indicates if the channel is a conversation that was marked as important by the user.
6060 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006061}
6062
6063/**
6064 * Atom that contains a list of a package's channel group preferences, pulled from
6065 * NotificationManagerService.java.
6066 */
6067message PackageNotificationChannelGroupPreferences {
6068 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006069 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006070 // Channel Group's ID. Should always be available.
6071 optional string group_id = 2;
6072 // Channel Group's name. Should always be available.
6073 optional string group_name = 3;
6074 // Channel Group's description. Optionally set by group creator.
6075 optional string description = 4;
6076 // Indicates if notifications from this channel group are blocked.
6077 optional bool is_blocked = 5;
6078 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6079 // at core/java/android/app/NotificationChannelGroup.java
6080 optional int32 user_locked_fields = 6;
6081}
6082
Yangsteraf9aee72018-10-12 09:26:16 -07006083message PowerProfileProto {
6084 optional double cpu_suspend = 1;
6085
6086 optional double cpu_idle = 2;
6087
6088 optional double cpu_active = 3;
6089
6090 message CpuCluster {
6091 optional int32 id = 1;
6092 optional double cluster_power = 2;
6093 optional int32 cores = 3;
6094 repeated int64 speed = 4;
6095 repeated double core_power = 5;
6096 }
6097
6098 repeated CpuCluster cpu_cluster = 40;
6099
6100 optional double wifi_scan = 4;
6101
6102 optional double wifi_on = 5;
6103
6104 optional double wifi_active = 6;
6105
6106 optional double wifi_controller_idle = 7;
6107
6108 optional double wifi_controller_rx = 8;
6109
6110 optional double wifi_controller_tx = 9;
6111
6112 repeated double wifi_controller_tx_levels = 10;
6113
6114 optional double wifi_controller_operating_voltage = 11;
6115
6116 optional double bluetooth_controller_idle = 12;
6117
6118 optional double bluetooth_controller_rx = 13;
6119
6120 optional double bluetooth_controller_tx = 14;
6121
6122 optional double bluetooth_controller_operating_voltage = 15;
6123
6124 optional double modem_controller_sleep = 16;
6125
6126 optional double modem_controller_idle = 17;
6127
6128 optional double modem_controller_rx = 18;
6129
6130 repeated double modem_controller_tx = 19;
6131
6132 optional double modem_controller_operating_voltage = 20;
6133
6134 optional double gps_on = 21;
6135
6136 repeated double gps_signal_quality_based = 22;
6137
6138 optional double gps_operating_voltage = 23;
6139
6140 optional double bluetooth_on = 24;
6141
6142 optional double bluetooth_active = 25;
6143
6144 optional double bluetooth_at_cmd = 26;
6145
6146 optional double ambient_display = 27;
6147
6148 optional double screen_on = 28;
6149
6150 optional double radio_on = 29;
6151
6152 optional double radio_scanning = 30;
6153
6154 optional double radio_active = 31;
6155
6156 optional double screen_full = 32;
6157
6158 optional double audio = 33;
6159
6160 optional double video = 34;
6161
6162 optional double flashlight = 35;
6163
6164 optional double memory = 36;
6165
6166 optional double camera = 37;
6167
6168 optional double wifi_batched_scan = 38;
6169
6170 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006171}
Chenjie Yuab530202018-09-26 12:39:20 -07006172
6173/**
6174 * power_profile.xml and other constants for power model calculations.
6175 * Pulled from PowerProfile.java
6176 */
6177message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006178 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006179}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006180
6181/**
arangelovd5db50e2018-10-12 20:24:39 +01006182 * Logs when a user restriction was added or removed.
6183 *
6184 * Logged from:
6185 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6186 */
6187message UserRestrictionChanged {
6188 // The raw string of the user restriction as defined in UserManager.
6189 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6190 optional string restriction = 1;
6191 // Whether the restriction is enabled or disabled.
6192 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006193}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006194
6195/**
6196 * Pulls process user time and system time. Puller takes a snapshot of all pids
6197 * in the system and returns cpu stats for those that are working at the time.
6198 * Dead pids will be dropped. Kernel processes are excluded.
6199 * Min cool-down is 5 sec.
6200 */
6201message ProcessCpuTime {
6202 optional int32 uid = 1 [(is_uid) = true];
6203
6204 optional string process_name = 2;
6205 // Process cpu time in user space, cumulative from boot/process start
6206 optional int64 user_time_millis = 3;
6207 // Process cpu time in system space, cumulative from boot/process start
6208 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006209}
Misha Wagner5a51e002018-10-03 15:04:09 +01006210
6211/**
6212 * Pulls the CPU usage for each thread.
6213 *
6214 * Read from /proc/$PID/task/$TID/time_in_state files.
6215 *
6216 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6217 * time_in_state files not being present on some phones, have not been addressed. These should be
6218 * considered before a public release.
6219 */
6220message CpuTimePerThreadFreq {
6221 // UID that owns the process.
6222 optional int32 uid = 1 [(is_uid) = true];
6223 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006224 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006225 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006226 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006227 // Name of the process taken from `/proc/$PID/cmdline`.
6228 optional string process_name = 4;
6229 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6230 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006231
6232 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6233 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6234 // frequencies are given here as the alternative is sending eight separate atoms. This method
6235 // significantly reduces the amount of data created
6236 optional int32 frequency1_khz = 6;
6237 optional int32 time1_millis = 7;
6238 optional int32 frequency2_khz = 8;
6239 optional int32 time2_millis = 9;
6240 optional int32 frequency3_khz = 10;
6241 optional int32 time3_millis = 11;
6242 optional int32 frequency4_khz = 12;
6243 optional int32 time4_millis = 13;
6244 optional int32 frequency5_khz = 14;
6245 optional int32 time5_millis = 15;
6246 optional int32 frequency6_khz = 16;
6247 optional int32 time6_millis = 17;
6248 optional int32 frequency7_khz = 18;
6249 optional int32 time7_millis = 19;
6250 optional int32 frequency8_khz = 20;
6251 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006252}
Bookatz75ee60422018-11-09 12:27:37 -08006253
6254/**
Bookatz366a4432018-11-20 09:42:33 -08006255 * Pulls information about the device's build.
6256 */
6257message BuildInformation {
6258 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6259 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6260 optional string fingerprint = 1;
6261
6262 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6263 optional string brand = 2;
6264
6265 // Build.PRODUCT. The name of the overall product.
6266 optional string product = 3;
6267
6268 // Build.DEVICE. The name of the industrial design.
6269 optional string device = 4;
6270
6271 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6272 optional string version_release = 5;
6273
6274 // Build.ID. E.g. a label like "M4-rc20".
6275 optional string id = 6;
6276
6277 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6278 // represent this build.
6279 optional string version_incremental = 7;
6280
6281 // Build.TYPE. The type of build, like "user" or "eng".
6282 optional string type = 8;
6283
6284 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6285 optional string tags = 9;
6286}
6287
6288/**
Adam He420947c2019-01-23 15:59:09 -08006289 * Logs information about mismatched caller for content capture.
6290 *
6291 * Logged from:
6292 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6293 */
6294message ContentCaptureCallerMismatchReported {
6295 optional string intended_package = 1;
6296 optional string calling_package = 2;
6297}
6298
6299/**
6300 * Logs information about content capture service events.
6301 *
6302 * Logged from:
6303 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6304 */
6305message ContentCaptureServiceEvents {
6306 // The type of event.
6307 enum Event {
6308 UNKNOWN = 0;
6309 ON_CONNECTED = 1;
6310 ON_DISCONNECTED = 2;
6311 SET_WHITELIST = 3;
6312 SET_DISABLED = 4;
6313 ON_USER_DATA_REMOVED = 5;
6314 }
6315 optional Event event = 1;
6316 // component/package of content capture service.
6317 optional string service_info = 2;
6318 // component/package of target.
6319 // it's a concatenated list of component/package for SET_WHITELIST event
6320 // separated by " ".
6321 optional string target_info = 3;
6322}
6323
6324/**
6325 * Logs information about content capture session events.
6326 *
6327 * Logged from:
6328 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6329 */
6330message ContentCaptureSessionEvents {
6331 // The type of event.
6332 enum Event {
6333 UNKNOWN = 0;
6334 ON_SESSION_STARTED = 1;
6335 ON_SESSION_FINISHED = 2;
6336 SESSION_NOT_CREATED = 3;
6337 }
6338 optional int32 session_id = 1;
6339 optional Event event = 2;
6340 // (n/a on session finished)
6341 optional int32 state_flags = 3;
6342 // component/package of content capture service.
6343 optional string service_info = 4;
6344 // component/package of app.
6345 // (n/a on session finished)
6346 optional string app_info = 5;
6347 optional bool is_child_session = 6;
6348}
6349
6350/**
6351 * Logs information about session being flushed.
6352 *
6353 * Logged from:
6354 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6355 */
6356message ContentCaptureFlushed {
6357 optional int32 session_id = 1;
6358 // component/package of content capture service.
6359 optional string service_info = 2;
6360 // component/package of app.
6361 optional string app_info = 3;
6362 // session start/finish events
6363 optional int32 child_session_started = 4;
6364 optional int32 child_session_finished = 5;
6365 // count of view events.
6366 optional int32 view_appeared_count = 6;
6367 optional int32 view_disappeared_count = 7;
6368 optional int32 view_text_changed_count = 8;
6369
6370 // Flush stats.
6371 optional int32 max_events = 9;
6372 optional int32 idle_flush_freq = 10;
6373 optional int32 text_flush_freq = 11;
6374 optional int32 flush_reason = 12;
6375}
6376
6377/**
Bookatz75ee60422018-11-09 12:27:37 -08006378 * Pulls on-device BatteryStats power use calculations for the overall device.
6379 */
6380message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006381 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6382 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6383 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6384 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006385}
6386
6387/**
6388 * Pulls on-device BatteryStats power use calculations broken down by uid.
6389 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6390 * that is attributed to non-uid items. They must all be included to get the total power use.
6391 */
6392message DeviceCalculatedPowerBlameUid {
6393 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6394 optional int32 uid = 1 [(is_uid) = true];
6395
Bookatz3dbc13a2018-12-21 12:16:51 -08006396 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6397 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6398 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006399}
6400
6401/**
6402 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6403 * drain type.
6404 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6405 * is attributed uids. They must all be included to get the total power use.
6406 */
6407message DeviceCalculatedPowerBlameOther {
6408 // The type of item whose power use is being reported.
6409 enum DrainType {
6410 AMBIENT_DISPLAY = 0;
6411 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6412 BLUETOOTH = 2;
6413 CAMERA = 3;
6414 // Cell-standby
6415 CELL = 4;
6416 FLASHLIGHT = 5;
6417 IDLE = 6;
6418 MEMORY = 7;
6419 // Amount that total computed drain exceeded the drain estimated using the
6420 // battery level changes and capacity.
6421 OVERCOUNTED = 8;
6422 PHONE = 9;
6423 SCREEN = 10;
6424 // Amount that total computed drain was below the drain estimated using the
6425 // battery level changes and capacity.
6426 UNACCOUNTED = 11;
6427 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6428 WIFI = 13;
6429 }
6430 optional DrainType drain_type = 1;
6431
Bookatz3dbc13a2018-12-21 12:16:51 -08006432 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6433 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6434 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006435}
arangelov4e994062018-11-13 16:12:38 +00006436
6437/**
6438 * Logs device policy features.
6439 *
6440 * Logged from:
6441 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6442 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6443 */
6444message DevicePolicyEvent {
6445 // The event id - unique for each event.
6446 optional android.stats.devicepolicy.EventId event_id = 1;
6447 // The admin package name.
6448 optional string admin_package_name = 2;
6449 // A generic integer parameter.
6450 optional int32 integer_value = 3;
6451 // A generic boolean parameter.
6452 optional bool boolean_value = 4;
6453 // A parameter specifying a time period in milliseconds.
6454 optional uint64 time_period_millis = 5;
6455 // A parameter specifying a list of package names, bundle extras or string parameters.
6456 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6457}
shawnlinea5b66b2018-11-13 15:05:29 +08006458
6459/**
6460 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6461 *
6462 * Logged from:
6463 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6464 */
6465message DocsUILaunchReported {
6466 optional android.stats.docsui.LaunchAction launch_action = 1;
6467 optional bool has_initial_uri = 2;
6468 optional android.stats.docsui.MimeType mime_type = 3;
6469 optional android.stats.docsui.Root initial_root = 4;
6470}
6471
6472/**
6473 * Logs root/app visited event in file managers/picker. Call this when the user
6474 * taps on root/app in hamburger menu.
6475 *
6476 * Logged from:
6477 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6478 */
6479message DocsUIRootVisitedReported {
6480 optional android.stats.docsui.ContextScope scope = 1;
6481 optional android.stats.docsui.Root root = 2;
6482}
6483
6484/**
6485 * Logs file operation stats. Call this when a file operation has completed.
6486 *
6487 * Logged from:
6488 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6489 */
6490message DocsUIFileOperationReported {
6491 optional android.stats.docsui.Provider provider = 1;
6492 optional android.stats.docsui.FileOperation file_op = 2;
6493}
6494
6495/**
6496 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6497 * mode.
6498 *
6499 * Logged from:
6500 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6501 */
6502message DocsUIFileOperationCopyMoveModeReported {
6503 optional android.stats.docsui.FileOperation file_op = 1;
6504 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6505}
6506
6507
6508/**
6509 * Logs file sub operation stats. Call this when a file operation has failed.
6510 *
6511 * Logged from:
6512 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6513 */
6514message DocsUIFileOperationFailureReported {
6515 optional android.stats.docsui.Authority authority = 1;
6516 optional android.stats.docsui.SubFileOperation sub_op = 2;
6517}
6518
6519/**
6520* Logs the cancellation of a file operation. Call this when a job is canceled
6521*
6522* Logged from:
6523* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6524*/
6525message DocsUIFileOperationCanceledReported {
6526 optional android.stats.docsui.FileOperation file_op = 1;
6527}
6528
6529/**
6530 * Logs startup time in milliseconds.
6531 *
6532 * Logged from:
6533 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6534 */
6535message DocsUIStartupMsReported {
6536 optional int32 startup_millis = 1;
6537}
6538
6539/**
6540 * Logs the action that was started by user.
6541 *
6542 * Logged from:
6543 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6544 */
6545message DocsUIUserActionReported {
6546 optional android.stats.docsui.UserAction action = 1;
6547}
6548
6549/**
6550 * Logs the invalid type when invalid scoped access is requested.
6551 *
6552 * Logged from:
6553 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6554 */
6555message DocsUIInvalidScopedAccessRequestReported {
6556 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006557}
Ben Murdochbab399f62018-12-06 11:01:38 +00006558
6559/**
shawnlina75e82d2019-01-07 10:31:12 +08006560 * Logs the package name that launches docsui picker mode.
6561 *
6562 * Logged from:
6563 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6564 */
6565message DocsUIPickerLaunchedFromReported {
6566 optional string package_name = 1;
6567}
6568
6569/**
6570 * Logs the search type.
6571 *
6572 * Logged from:
6573 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6574 */
6575message DocsUISearchTypeReported {
6576 optional android.stats.docsui.SearchType search_type = 1;
6577}
6578
6579/**
6580 * Logs the search mode.
6581 *
6582 * Logged from:
6583 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6584 */
6585message DocsUISearchModeReported {
6586 optional android.stats.docsui.SearchMode search_mode = 1;
6587}
6588
6589/**
6590 * Logs the pick result information.
6591 *
6592 * Logged from:
6593 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6594 */
6595message DocsUIPickResultReported {
6596 optional int32 total_action_count = 1;
6597 optional int64 duration_millis = 2;
6598 optional int32 file_count= 3;
6599 optional bool is_searching = 4;
6600 optional android.stats.docsui.Root picked_from = 5;
6601 optional android.stats.docsui.MimeType mime_type = 6;
6602 optional int32 repeatedly_pick_times = 7;
6603}
6604
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006605/** Logs the drag and drop of files.
6606
6607 * Logged from:
6608 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6609 */
6610message DocsUIDragAndDropReported {
6611 optional bool drag_initiated_from_docsui = 1;
6612}
6613
shawnlina75e82d2019-01-07 10:31:12 +08006614/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006615 * Logs when an app's memory is compacted.
6616 *
6617 * Logged from:
6618 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6619 */
6620message AppCompacted {
6621 // The pid of the process being compacted.
6622 optional int32 pid = 1;
6623
6624 // The name of the process being compacted.
6625 optional string process_name = 2;
6626
6627 // The type of compaction.
6628 enum Action {
6629 UNKNOWN = 0;
6630 SOME = 1;
6631 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006632 PERSISTENT = 3;
6633 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006634 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006635 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006636
6637 // Total RSS in kilobytes consumed by the process prior to compaction.
6638 optional int64 before_rss_total_kilobytes = 4;
6639
6640 // File RSS in kilobytes consumed by the process prior to compaction.
6641 optional int64 before_rss_file_kilobytes = 5;
6642
6643 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6644 optional int64 before_rss_anon_kilobytes = 6;
6645
6646 // Swap in kilobytes consumed by the process prior to compaction.
6647 optional int64 before_swap_kilobytes = 7;
6648
6649 // Total RSS in kilobytes consumed by the process after compaction.
6650 optional int64 after_rss_total_kilobytes = 8;
6651
6652 // File RSS in kilobytes consumed by the process after compaction.
6653 optional int64 after_rss_file_kilobytes = 9;
6654
6655 // Anonymous RSS in kilobytes consumed by the process after compaction.
6656 optional int64 after_rss_anon_kilobytes = 10;
6657
6658 // Swap in kilobytes consumed by the process after compaction.
6659 optional int64 after_swap_kilobytes = 11;
6660
6661 // The time taken to perform compaction in milliseconds.
6662 optional int64 time_to_compact_millis = 12;
6663
6664 // The last compaction action performed for this app.
6665 optional Action last_action = 13;
6666
Ben Murdoch01720b82018-12-19 18:03:44 +00006667 // The last time that compaction was attempted on this process in milliseconds
6668 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6669 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006670
Ben Murdoch885c21b2019-03-15 18:02:04 +00006671 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006672 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006673
6674 // The process state at the time of compaction.
6675 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006676
6677 // Free ZRAM in kilobytes before compaction.
6678 optional int64 before_zram_free_kilobytes = 17;
6679
6680 // Free ZRAM in kilobytes after compaction.
6681 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006682}
lifr157fc552018-12-12 16:38:04 +08006683
6684/**
lifrb6b90b62019-03-29 00:40:17 +08006685 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6686 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6687 *
lifr1f74b052019-04-16 22:16:30 +08006688 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6689 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6690 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6691 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006692 */
6693message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006694 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006695
lifr1f74b052019-04-16 22:16:30 +08006696 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006697
6698 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006699 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006700
lifr1f74b052019-04-16 22:16:30 +08006701 // Only valid for event_type = EVENT_GETADDRINFO.
6702 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006703
lifr1f74b052019-04-16 22:16:30 +08006704 // Flags passed to android_res_nsend() defined in multinetwork.h
6705 // Only valid for event_type = EVENT_RESNSEND.
6706 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006707
lifrad9becc2019-05-20 11:04:41 +08006708 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006709
6710 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006711 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006712
6713 // Additional pass-through fields opaque to statsd.
6714 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006715 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006716
6717 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6718 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006719}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006720
6721/**
6722 * Logs when a data stall event occurs.
6723 *
6724 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006725 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006726 */
6727message DataStallEvent {
6728 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006729 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006730 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6731 optional int32 evaluation_type = 1;
6732 // See definition in data_stall_event.proto.
6733 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6734 // See definition in data_stall_event.proto.
6735 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6736 // See definition in data_stall_event.proto.
6737 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6738 // See definition in data_stall_event.proto.
6739 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6740 // See definition in data_stall_event.proto.
6741 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006742 // The tcp packets fail rate from the latest tcp polling.
6743 optional int32 tcp_fail_rate = 7;
6744 // Number of packets sent since the last received packet.
6745 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006746}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006747
6748/*
6749 * Logs when RescueParty resets some set of experiment flags.
6750 *
6751 * Logged from:
6752 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6753 */
6754message RescuePartyResetReported {
6755 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6756 optional int32 rescue_level = 1;
6757}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006758
6759/**
6760 * Logs when signed config is received from an APK, and if that config was applied successfully.
6761 * Logged from:
6762 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6763 */
6764message SignedConfigReported {
6765 enum Type {
6766 UNKNOWN_TYPE = 0;
6767 GLOBAL_SETTINGS = 1;
6768 }
6769 optional Type type = 1;
6770
6771 // The final status of the signed config received.
6772 enum Status {
6773 UNKNOWN_STATUS = 0;
6774 APPLIED = 1;
6775 BASE64_FAILURE_CONFIG = 2;
6776 BASE64_FAILURE_SIGNATURE = 3;
6777 SECURITY_EXCEPTION = 4;
6778 INVALID_CONFIG = 5;
6779 OLD_CONFIG = 6;
6780 SIGNATURE_CHECK_FAILED = 7;
6781 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006782 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006783 }
6784 optional Status status = 2;
6785
6786 // The version of the signed config processed.
6787 optional int32 version = 3;
6788
6789 // The package name that the config was extracted from.
6790 optional string from_package = 4;
6791
6792 enum Key {
6793 NO_KEY = 0;
6794 DEBUG = 1;
6795 PRODUCTION = 2;
6796 }
6797 // Which key was used to verify the config.
6798 optional Key verified_with = 5;
6799}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006800
6801/*
6802 * Logs GNSS Network-Initiated (NI) location events.
6803 *
6804 * Logged from:
6805 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6806 */
6807message GnssNiEventReported {
6808 // The type of GnssNiEvent.
6809 enum EventType {
6810 UNKNOWN = 0;
6811 NI_REQUEST = 1;
6812 NI_RESPONSE = 2;
6813 }
6814 optional EventType event_type = 1;
6815
6816 // An ID generated by HAL to associate NI notifications and UI responses.
6817 optional int32 notification_id = 2;
6818
6819 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006820 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006821
6822 // NI requires notification.
6823 optional bool need_notify = 4;
6824
6825 // NI requires verification.
6826 optional bool need_verify = 5;
6827
6828 // NI requires privacy override, no notification/minimal trace.
6829 optional bool privacy_override = 6;
6830
6831 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6832 // seconds.
6833 optional int32 timeout = 7;
6834
6835 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006836 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006837
6838 // String representing the requester of the network inititated location request.
6839 optional string requestor_id = 9;
6840
6841 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6842 // network initiated location request.
6843 optional string text = 10;
6844
6845 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006846 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006847
6848 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006849 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006850
6851 // True if SUPL ES is enabled.
6852 optional bool is_supl_es_enabled = 13;
6853
6854 // True if GNSS location is enabled.
6855 optional bool is_location_enabled = 14;
6856
6857 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006858 optional android.server.location.GnssUserResponseType user_response = 15;
6859}
6860
6861/**
6862 * Logs GNSS non-framework (NFW) location notification.
6863 *
6864 * Logged from:
6865 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6866 */
6867message GnssNfwNotificationReported {
6868 // Package name of the Android proxy application representing the non-framework entity that
6869 // requested location. Set to empty string if unknown.
6870 optional string proxy_app_package_name = 1;
6871
6872 // Protocol stack that initiated the non-framework location request.
6873 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6874
6875 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6876 // set to empty string. This field is opaque to the framework and used for logging purposes.
6877 optional string other_protocol_stack_name = 3;
6878
6879 // Source initiating/receiving the location information.
6880 optional android.server.location.NfwRequestor requestor = 4;
6881
6882 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6883 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6884 // and used for logging purposes.
6885 optional string requestor_id = 5;
6886
6887 // Indicates whether location information was provided for this request.
6888 optional android.server.location.NfwResponseType response_type = 6;
6889
6890 // True if the device is in user initiated emergency session.
6891 optional bool in_emergency_mode = 7;
6892
6893 // True if cached location is provided.
6894 optional bool is_cached_location = 8;
6895
6896 // True if proxy app permission mismatch between framework and GNSS HAL.
6897 optional bool is_permission_mismatched = 9;
6898}
6899
6900/**
6901 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6902 *
6903 * Logged from:
6904 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6905 */
6906message GnssConfigurationReported {
6907 // SUPL host name.
6908 optional string supl_host = 1;
6909
6910 // SUPL port number.
6911 optional int32 supl_port = 2;
6912
6913 // C2K host name.
6914 optional string c2k_host = 3;
6915
6916 // C2K port number.
6917 optional int32 c2k_port = 4;
6918
6919 // The SUPL version requested by Carrier.
6920 optional int32 supl_ver = 5;
6921
6922 // The SUPL mode.
6923 optional android.server.location.SuplMode supl_mode = 6;
6924
6925 // True if NI emergency SUPL restrictions is enabled.
6926 optional bool supl_es = 7;
6927
6928 // LTE Positioning Profile settings
6929 optional android.server.location.LppProfile lpp_profile = 8;
6930
6931 // Positioning protocol on A-Glonass system.
6932 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6933
6934 // True if emergency PDN is used. Otherwise, regular PDN is used.
6935 optional bool use_emergency_pdn_for_emergency_supl= 10;
6936
6937 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6938 optional android.server.location.GpsLock gps_lock = 11;
6939
6940 // Number of seconds to extend the emergency session duration post emergency call.
6941 optional int32 es_extension_sec = 12;
6942
6943 // The full list of package names of proxy Android applications representing the non-framework
6944 // location access entities (on/off the device) for which the framework user has granted
6945 // non-framework location access permission. The package names are concatenated in one string
6946 // with spaces as separators.
6947 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006948}
Jack Yu95b64f32018-12-13 18:26:11 +08006949
6950/**
6951 * Logs when a NFC device's error occurred.
6952 * Logged from:
6953 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6954 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6955 */
6956message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006957 enum Type {
6958 UNKNOWN = 0;
6959 CMD_TIMEOUT = 1;
6960 ERROR_NOTIFICATION = 2;
6961 AID_OVERFLOW = 3;
6962 }
6963 optional Type type = 1;
6964 // If it's nci cmd timeout, log the timeout command.
6965 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006966
Alex Salod7c3eef2019-01-25 14:43:27 -08006967 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006968}
6969
6970/**
6971 * Logs when a NFC device's state changed event
6972 * Logged from:
6973 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6974 */
6975message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006976 enum State {
6977 UNKNOWN = 0;
6978 OFF = 1;
6979 ON = 2;
6980 ON_LOCKED = 3; // Secure Nfc enabled.
6981 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6982 }
6983 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006984}
6985
6986/**
6987 * Logs when a NFC Beam Transaction occurred.
6988 * Logged from:
6989 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6990 */
6991message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006992 enum Operation {
6993 UNKNOWN = 0;
6994 SEND = 1;
6995 RECEIVE = 2;
6996 }
6997 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006998}
6999
7000/**
7001 * Logs when a NFC Card Emulation Transaction occurred.
7002 * Logged from:
7003 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7004 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7005 */
7006message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007007 enum Category {
7008 UNKNOWN = 0;
7009 HCE_PAYMENT = 1;
7010 HCE_OTHER = 2;
7011 OFFHOST = 3;
7012 }
7013 // Transaction belongs to HCE payment or HCE other category, or offhost.
7014 optional Category category = 1;
7015 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7016 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007017}
7018
7019/**
7020 * Logs when a NFC Tag event occurred.
7021 * Logged from:
7022 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7023 */
7024message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007025 enum Type {
7026 UNKNOWN = 0;
7027 URL = 1;
7028 BT_PAIRING = 2;
7029 PROVISION = 3;
7030 WIFI_CONNECT = 4;
7031 APP_LAUNCH = 5;
7032 OTHERS = 6;
7033 }
7034 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007035}
7036
7037/**
7038 * Logs when Hce transaction triggered
7039 * Logged from:
7040 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7041 */
7042message NfcHceTransactionOccurred {
7043 // The latency period(in microseconds) it took for the first HCE data
7044 // exchange.
7045 optional uint32 latency_micros = 1;
7046}
7047
7048/**
7049 * Logs when SecureElement state event changed
7050 * Logged from:
7051 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7052 */
7053message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007054 enum State {
7055 UNKNOWN = 0;
7056 INITIALIZED = 1;
7057 DISCONNECTED = 2;
7058 CONNECTED = 3;
7059 HALCRASH = 4;
7060 }
7061 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007062
Alex Salod7c3eef2019-01-25 14:43:27 -08007063 optional string state_change_reason = 2;
7064 // SIMx or eSEx.
7065 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007066}
7067
7068/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007069 * Information about a permission grant request
7070 */
7071message PermissionGrantRequestResultReported {
7072 // unique value identifying an API call. A API call might result in multiple of these atoms
7073 optional int64 request_id = 1;
7074
7075 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007076 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007077
7078 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007079 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007080
7081 // The permission to be granted
7082 optional string permission_name = 4;
7083
7084 // If the permission was explicitly requested via the API or added by the system
7085 optional bool is_implicit = 5;
7086
7087 enum Result {
7088 UNDEFINED = 0;
7089 // permission request was ignored
7090 IGNORED = 1;
7091 // permission request was ignored because it was user fixed
7092 IGNORED_USER_FIXED = 2;
7093 // permission request was ignored because it was policy fixed
7094 IGNORED_POLICY_FIXED = 3;
7095 // permission was granted by user action
7096 USER_GRANTED = 4;
7097 // permission was automatically granted
7098 AUTO_GRANTED = 5;
7099 // permission was denied by user action
7100 USER_DENIED = 6;
7101 // permission was denied with prejudice by the user
7102 USER_DENIED_WITH_PREJUDICE = 7;
7103 // permission was automatically denied
7104 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007105 // permission request was ignored because permission is restricted
7106 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007107 // one time permission was granted by user action
7108 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007109 // user ignored request by leaving the request screen without choosing any option
7110 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007111 // user granted the permission after being linked to settings
7112 USER_GRANTED_IN_SETTINGS = 12;
7113 // user denied the permission after being linked to settings
7114 USER_DENIED_IN_SETTINGS = 13;
7115 // user denied the permission with prejudice after being linked to settings
7116 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7117 // permission was automatically revoked after one-time permission expired
7118 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007119 // permission was automatically revoked for unused app
7120 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007121 }
7122 // The result of the permission grant
7123 optional Result result = 6;
7124}
7125
7126/**
Jack Yu95b64f32018-12-13 18:26:11 +08007127 * Logs when Omapi API used
7128 * Logged from:
7129 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7130 */
7131message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007132 enum Operation {
7133 UNKNOWN = 0;
7134 OPEN_CHANNEL = 1;
7135 }
7136 optional Operation operation = 1;
7137 // SIMx or eSEx.
7138 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007139
Alex Salod7c3eef2019-01-25 14:43:27 -08007140 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007141}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007142
7143/**
Alex Saloa060aee2019-01-21 14:36:41 -08007144 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7145 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007146 * Logged from:
7147 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7148 */
7149message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007150 optional int64 dispatch_latency_millis = 1;
7151}
7152
7153/**
7154 * Logs AttentionManagerService attention check result.
7155 *
7156 * Logged from:
7157 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7158 */
7159message AttentionManagerServiceResultReported {
7160 // See core/java/android/service/attention/AttentionService.java
7161 enum AttentionCheckResult {
7162 UNKNOWN = 20;
7163 ATTENTION_SUCCESS_ABSENT = 0;
7164 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007165 ATTENTION_FAILURE_UNKNOWN = 2;
7166 ATTENTION_FAILURE_CANCELLED = 3;
7167 ATTENTION_FAILURE_PREEMPTED = 4;
7168 ATTENTION_FAILURE_TIMED_OUT = 5;
7169 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007170 }
7171 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007172}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007173
7174/**
7175 * Logs when an adb connection changes state.
7176 *
7177 * Logged from:
7178 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7179 */
7180message AdbConnectionChanged {
7181 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7182 // previously selected for this system.
7183 optional int64 last_connection_time_millis = 1;
7184
7185 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7186 // to reconnect via adb without user interaction.
7187 optional int64 auth_window_millis = 2;
7188
7189 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7190 optional android.debug.AdbConnectionStateEnum state = 3;
7191
7192 // True if the 'always allow' option was selected for this system.
7193 optional bool always_allow = 4;
7194}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007195
7196/*
7197 * Logs the reported speech DSP status.
7198 *
7199 * Logged from:
7200 * Vendor audio implementation.
7201 */
7202message SpeechDspStatReported {
7203 // The total Speech DSP uptime in milliseconds.
7204 optional int32 total_uptime_millis = 1;
7205 // The total Speech DSP downtime in milliseconds.
7206 optional int32 total_downtime_millis = 2;
7207 optional int32 total_crash_count = 3;
7208 optional int32 total_recover_count = 4;
7209}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007210
7211/**
7212 * Logs USB connector contaminant status.
7213 *
7214 * Logged from: USB Service.
7215 */
7216message UsbContaminantReported {
7217 optional string id = 1;
7218 optional android.service.usb.ContaminantPresenceStatus status = 2;
7219}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007220
7221/**
7222 * This atom is for debugging purpose.
7223 */
7224message DebugElapsedClock {
7225 // Monotically increasing value for each pull.
7226 optional int64 pull_count = 1;
7227 // Time from System.elapsedRealtime.
7228 optional int64 elapsed_clock_millis = 2;
7229 // Time from System.elapsedRealtime.
7230 optional int64 same_elapsed_clock_millis = 3;
7231 // Diff between current elapsed time and elapsed time from previous pull.
7232 optional int64 elapsed_clock_diff_millis = 4;
7233
7234 enum Type {
7235 TYPE_UNKNOWN = 0;
7236 ALWAYS_PRESENT = 1;
7237 PRESENT_ON_ODD_PULLS = 2;
7238 }
7239 // Type of behavior for the pulled data.
7240 optional Type type = 5;
7241}
7242
7243/**
7244 * This atom is for debugging purpose.
7245 */
7246message DebugFailingElapsedClock {
7247 // Monotically increasing value for each pull.
7248 optional int64 pull_count = 1;
7249 // Time from System.elapsedRealtime.
7250 optional int64 elapsed_clock_millis = 2;
7251 // Time from System.elapsedRealtime.
7252 optional int64 same_elapsed_clock_millis = 3;
7253 // Diff between current elapsed time and elapsed time from previous pull.
7254 optional int64 elapsed_clock_diff_millis = 4;
7255}
Steven Wuacef6bb2019-01-23 14:21:17 -05007256
7257/** Logs System UI bubbles event changed.
7258 *
7259 * Logged from:
7260 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7261 */
7262message BubbleUIChanged {
7263
7264 // The app package that is posting the bubble.
7265 optional string package_name = 1;
7266
7267 // The notification channel that is posting the bubble.
7268 optional string notification_channel = 2;
7269
7270 // The notification id associated with the posted bubble.
7271 optional int32 notification_id = 3;
7272
7273 // The position of the bubble within the bubble stack.
7274 optional int32 position = 4;
7275
7276 // The total number of bubbles within the bubble stack.
7277 optional int32 total_number = 5;
7278
7279 // User interactions with the bubble.
7280 enum Action {
7281 UNKNOWN = 0;
7282 POSTED = 1;
7283 UPDATED = 2;
7284 EXPANDED = 3;
7285 COLLAPSED = 4;
7286 DISMISSED = 5;
7287 STACK_DISMISSED = 6;
7288 STACK_MOVED = 7;
7289 HEADER_GO_TO_APP = 8;
7290 HEADER_GO_TO_SETTINGS = 9;
7291 PERMISSION_OPT_IN = 10;
7292 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007293 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007294 SWIPE_LEFT = 13;
7295 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007296 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007297 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007298 }
7299 optional Action action = 6;
7300
7301 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7302 optional float normalized_x_position = 7;
7303 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007304
7305 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7306 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007307
7308 // Whether the bubble is an on-going one.
7309 optional bool is_ongoing = 10;
7310
7311 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007312 // This is deprecated and the value should be ignored.
7313 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007314}
Kweku Adams8845d012018-12-11 20:06:45 -08007315
7316/**
Steven Wu552f63f2019-02-05 13:41:36 -05007317 * Logs System UI bubbles developer errors.
7318 *
7319 * Logged from:
7320 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7321 */
7322message BubbleDeveloperErrorReported {
7323
7324 // The app package that is posting the bubble.
7325 optional string package_name = 1;
7326
7327 // Bubble developer error type enums.
7328 enum Error {
7329 UNKNOWN = 0;
7330 ACTIVITY_INFO_MISSING = 1;
7331 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7332 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7333 }
7334 optional Error error = 2 [default = UNKNOWN];
7335}
7336
7337/**
Kweku Adams8845d012018-12-11 20:06:45 -08007338 * Logs that a constraint for a scheduled job has changed.
7339 *
7340 * Logged from:
7341 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7342 */
7343message ScheduledJobConstraintChanged {
7344 repeated AttributionNode attribution_node = 1;
7345
7346 // Name of the job.
7347 optional string job_name = 2;
7348
7349 optional com.android.server.job.ConstraintEnum constraint = 3;
7350
7351 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007352 UNKNOWN = 0;
7353 UNSATISFIED = 1;
7354 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007355 }
7356 optional State state = 4;
7357}
Alex Salod7c3eef2019-01-25 14:43:27 -08007358
7359/**
7360 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7361 * returns true.
7362 *
7363 * Logged from:
7364 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7365 */
7366message ScreenTimeoutExtensionReported {
7367 // Describes how many times in a row did the power manager reset the screen off timeout.
7368 optional uint32 consecutive_timeout_extended_count = 1;
7369}
Hui Yu885aca12019-01-10 17:11:34 -08007370
7371/*
7372* Logs number of milliseconds it takes to start a process.
7373* The definition of app process start time is from the app launch time to
7374* the time that Zygote finished forking the app process and loaded the
7375* application package's java classes.
7376
7377* This metric is different from AppStartOccurred which is for foreground
7378* activity only.
7379
7380* ProcessStartTime can report all processes (both foreground and background)
7381* start time.
7382*
7383* Logged from:
7384* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7385*/
7386message ProcessStartTime {
7387 // The uid of the ProcessRecord.
7388 optional int32 uid = 1 [(is_uid) = true];
7389
7390 // The process pid.
7391 optional int32 pid = 2;
7392
7393 // The process name.
7394 // Usually package name, "system" for system server.
7395 // Provided by ActivityManagerService.
7396 optional string process_name = 3;
7397
7398 enum StartType {
7399 UNKNOWN = 0;
7400 WARM = 1;
7401 HOT = 2;
7402 COLD = 3;
7403 }
7404
7405 // The start type.
7406 optional StartType type = 4;
7407
7408 // The elapsed realtime at the start of the process.
7409 optional int64 process_start_time_millis = 5;
7410
7411 // Number of milliseconds it takes to reach bind application.
7412 optional int32 bind_application_delay_millis = 6;
7413
7414 // Number of milliseconds it takes to finish start of the process.
7415 optional int32 process_start_delay_millis = 7;
7416
7417 // hostingType field in ProcessRecord, the component type such as "activity",
7418 // "service", "content provider", "broadcast" or other strings.
7419 optional string hosting_type = 8;
7420
7421 // hostingNameStr field in ProcessRecord. The component class name that runs
7422 // in this process.
7423 optional string hosting_name = 9;
7424}
7425
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007426/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007427 * Track Media Codec usage
7428 * Logged from:
7429 * frameworks/av/media/libstagefright/MediaCodec.cpp
7430 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7431 */
7432message MediametricsCodecReported {
7433 optional int64 timestamp_nanos = 1;
7434 optional string package_name = 2;
7435 optional int64 package_version_code = 3;
7436 optional int64 media_apex_version = 4;
7437
7438 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7439}
7440
7441/**
7442 * Track Media Extractor (pulling video/audio streams out of containers) usage
7443 * Logged from:
7444 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7445 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7446 */
7447message MediametricsExtractorReported {
7448 optional int64 timestamp_nanos = 1;
7449 optional string package_name = 2;
7450 optional int64 package_version_code = 3;
7451 optional int64 media_apex_version = 4;
7452
7453 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7454}
7455
7456/**
7457 * Track how we arbitrate between microphone/input requests.
7458 * Logged from
7459 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7460 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7461 */
7462message MediametricsAudiopolicyReported {
7463 optional int64 timestamp_nanos = 1;
7464 optional string package_name = 2;
7465 optional int64 package_version_code = 3;
7466 optional int64 media_apex_version = 4;
7467
7468 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7469}
7470
7471/**
7472 * Track how we arbitrate between microphone requests.
7473 * Logged from
7474 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7475 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7476 */
7477message MediametricsAudiorecordReported {
7478 optional int64 timestamp_nanos = 1;
7479 optional string package_name = 2;
7480 optional int64 package_version_code = 3;
7481 optional int64 media_apex_version = 4;
7482
7483 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7484}
7485
7486/**
7487 * Track how we arbitrate between microphone/input requests.
7488 * Logged from
7489 * frameworks/av/media/libnblog/ReportPerformance.cpp
7490 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7491 */
7492message MediametricsAudiothreadReported {
7493 optional int64 timestamp_nanos = 1;
7494 optional string package_name = 2;
7495 optional int64 package_version_code = 3;
7496 optional int64 media_apex_version = 4;
7497
7498 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7499}
7500
7501/**
7502 * Track how we arbitrate between microphone/input requests.
7503 * Logged from
7504 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7505 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7506 */
7507message MediametricsAudiotrackReported {
7508 optional int64 timestamp_nanos = 1;
7509 optional string package_name = 2;
7510 optional int64 package_version_code = 3;
7511 optional int64 media_apex_version = 4;
7512
7513 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7514}
7515
7516/**
7517 * Track information about DRM framework performance
7518 * Logged from
7519 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7520 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7521 */
7522message MediametricsMediadrmReported {
7523 optional int64 timestamp_nanos = 1;
7524 optional string package_name = 2;
7525 optional int64 package_version_code = 3;
7526 optional int64 media_apex_version = 4;
7527
7528 // vendor+description tell about which DRM plugin is in use on this device
7529 optional string vendor = 5;
7530 optional string description = 6;
7531 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7532 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7533}
7534
7535/**
7536 * Track information about the widevine DRM plugin performance
7537 * Logged from
7538 * vendor/widevine/libwvdrmengine/cdm/metrics
7539 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7540 */
7541message MediametricsDrmWidevineReported {
7542 optional int64 timestamp_nanos = 1;
7543 optional string package_name = 2;
7544 optional int64 package_version_code = 3;
7545 optional int64 media_apex_version = 4;
7546
7547 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7548}
7549
7550/**
7551 * Track information about recordings (e.g. camcorder)
7552 * Logged from
7553 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7554 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7555 */
7556message MediametricsRecorderReported {
7557 optional int64 timestamp_nanos = 1;
7558 optional string package_name = 2;
7559 optional int64 package_version_code = 3;
7560 optional int64 media_apex_version = 4;
7561
7562 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7563}
7564
7565/**
7566 * Track Media Player usage
7567 * Logged from:
7568 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7569 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7570 */
7571message MediametricsNuPlayerReported {
7572 optional int64 timestamp_nanos = 1;
7573 optional string package_name = 2;
7574 optional int64 package_version_code = 3;
7575 optional int64 media_apex_version = 4;
7576
7577 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7578}
7579
7580/**
Robert Shiha4beed32019-08-19 14:15:23 -07007581 * Track Legacy DRM usage
7582 * Logged from
7583 * frameworks/av/drm/drmserver/DrmManager.cpp
7584 */
7585message MediametricsDrmManagerReported {
7586 optional int64 timestamp_nanos = 1;
7587 optional string package_name = 2;
7588 optional int64 package_version_code = 3;
7589 optional int64 media_apex_version = 4;
7590
7591 enum Method {
7592 METHOD_NOT_FOUND = -1;
7593 GET_CONSTRAINTS = 0;
7594 GET_METADATA = 1;
7595 CAN_HANDLE = 2;
7596 PROCESS_DRM_INFO = 3;
7597 ACQUIRE_DRM_INFO = 4;
7598 SAVE_RIGHTS = 5;
7599 GET_ORIGINAL_MIME_TYPE = 6;
7600 GET_DRM_OBJECT_TYPE = 7;
7601 CHECK_RIGHTS_STATUS = 8;
7602 REMOVE_RIGHTS = 9;
7603 REMOVE_ALL_RIGHTS = 10;
7604 OPEN_CONVERT_SESSION = 11;
7605 OPEN_DECRYPT_SESSION = 12;
7606 }
7607
7608 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7609 optional string plugin_id = 5;
7610 optional string description = 6;
7611 optional Method method = 7;
7612 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007613
7614 optional int64 get_constraints_count = 9;
7615 optional int64 get_metadata_count = 10;
7616 optional int64 can_handle_count = 11;
7617 optional int64 process_drm_info_count = 12;
7618 optional int64 acquire_drm_info_count = 13;
7619 optional int64 save_rights_count = 14;
7620 optional int64 get_original_mime_type_count = 15;
7621 optional int64 get_drm_object_type_count = 16;
7622 optional int64 check_rights_status_count = 17;
7623 optional int64 remove_rights_count = 18;
7624 optional int64 remove_all_rights_count = 19;
7625 optional int64 open_convert_session_count = 20;
7626 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007627}
7628
7629/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007630 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007631 * Pulled from: StatsCompanionService
7632*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007633message DangerousPermissionState {
7634 // Name of the permission
7635 optional string permission_name = 1;
7636
7637 // Uid of the package
7638 optional int32 uid = 2 [(is_uid) = true];
7639
7640 // Package requesting the permission
7641 optional string package_name = 3;
7642
7643 // If the permission is granted to the uid
7644 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007645
7646 // Permission flags as per android.content.pm.PermissionFlags
7647 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007648}
7649
Michael Groover4a0ca942019-01-24 17:41:25 -08007650/**
7651 * Logs when a package is denied access to a device identifier based on the new access requirements.
7652 *
7653 * Logged from:
7654 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7655 */
7656message DeviceIdentifierAccessDenied {
7657 // The name of the package denied access to the requested device identifier.
7658 optional string package_name = 1;
7659
7660 // The name of the device identifier method the package attempted to invoke.
7661 optional string method_name = 2;
7662
7663 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007664 // Starting from Android 11, this boolean is not set and will always be false.
7665 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007666
7667 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007668 // Starting from Android 11, this boolean is not set and will always be false.
7669 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007670}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007671
7672/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007673 * Pulls the ongoing mainline install train version code.
7674 * Pulled from StatsCompanionService
7675 */
7676message TrainInfo {
7677 optional int64 train_version_code = 1;
7678
7679 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007680
7681 optional string train_name = 3;
7682
7683 enum Status {
7684 UNKNOWN = 0;
7685 INSTALL_REQUESTED = 1;
7686 INSTALL_STARTED = 2;
7687 INSTALL_STAGED_NOT_READY = 3;
7688 INSTALL_STAGED_READY = 4;
7689 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007690 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7691 // and INSTALL_FAILURE_COMMIT.
7692 INSTALL_FAILURE = 6 [deprecated = true];
7693 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007694 INSTALL_CANCELLED = 7;
7695 INSTALLER_ROLLBACK_REQUESTED = 8;
7696 INSTALLER_ROLLBACK_INITIATED = 9;
7697 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7698 INSTALLER_ROLLBACK_STAGED = 11;
7699 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7700 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7701 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7702 INSTALLER_ROLLBACK_SUCCESS = 15;
7703 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007704 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7705 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7706 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7707 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7708 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7709 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007710 INSTALL_FAILURE_DOWNLOAD = 23;
7711 INSTALL_FAILURE_STATE_MISMATCH = 24;
7712 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007713 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007714 }
7715 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007716}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007717
7718/**
7719 * Logs the gesture stage changed event.
7720 *
7721 * Logged from:
7722 * frameworks/base/packages/SystemUI/
7723 */
7724message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007725 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007726}
7727
7728/**
7729 * Logs the feedback type.
7730 *
7731 * Logged from:
7732 * frameworks/base/packages/SystemUI/
7733 */
7734message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007735 // Whether or not the gesture was used.
7736 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007737}
7738
7739/**
7740 * Logs the progress.
7741 *
7742 * Logged from:
7743 * frameworks/base/packages/SystemUI/
7744 */
7745message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007746 // [0,100] progress for the assist gesture.
7747 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007748}
Neil Fullerdb14b482019-02-05 19:44:44 +00007749
7750/*
7751 * Information about the time zone data on a device.
7752 */
7753message TimeZoneDataInfo {
7754 // A version identifier for the data set on device. e.g. "2018i"
7755 optional string tzdb_version = 1;
7756}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007757
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007758/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007759 * Logs the GPU stats global health information.
7760 *
7761 * Logged from:
7762 * frameworks/native/services/gpuservice/gpustats/
7763 */
7764message GpuStatsGlobalInfo {
7765 // Package name of the gpu driver.
7766 optional string driver_package_name = 1;
7767
7768 // Version name of the gpu driver.
7769 optional string driver_version_name = 2;
7770
7771 // Version code of the gpu driver.
7772 optional int64 driver_version_code = 3;
7773
7774 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7775 optional int64 driver_build_time = 4;
7776
7777 // Total count of the gl driver gets loaded.
7778 optional int64 gl_loading_count = 5;
7779
7780 // Total count of the gl driver fails to be loaded.
7781 optional int64 gl_loading_failure_count = 6;
7782
7783 // Total count of the Vulkan driver gets loaded.
7784 optional int64 vk_loading_count = 7;
7785
7786 // Total count of the Vulkan driver fails to be loaded.
7787 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007788
7789 // Api version of the system Vulkan driver.
7790 optional int32 vulkan_version = 9;
7791
7792 // Api version of the system CPU Vulkan driver.
7793 optional int32 cpu_vulkan_version = 10;
7794
7795 // Api version of the system GLES driver.
7796 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007797
7798 // Total count of the angle driver gets loaded.
7799 optional int64 angle_loading_count = 12;
7800
7801 // Total count of the angle driver fails to be loaded.
7802 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007803}
7804
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007805/**
7806 * GPU driver loading time info.
7807 */
7808message GpuDriverLoadingTime {
7809 // List of all the driver loading times for this app. The list size is
7810 // capped at 50.
7811 repeated int64 driver_loading_time = 1;
7812}
7813
7814/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007815 * Logs the GPU stats per app health information.
7816 *
7817 * Logged from:
7818 * frameworks/native/services/gpuservice/gpustats/
7819 */
7820message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007821 // Package name of the application that loads the gpu driver. Total number
7822 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007823 optional string app_package_name = 1;
7824
7825 // Version code of the gpu driver this app loads.
7826 optional int64 driver_version_code = 2;
7827
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007828 // gl driver loading time info.
7829 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7830 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007831
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007832 // Vulkan driver loading time info.
7833 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7834 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007835
7836 // Angle driver loading time info.
7837 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7838 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007839
7840 // CPU Vulkan implementation is in use.
7841 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007842
7843 // App is not doing pre-rotation correctly.
7844 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007845
7846 // App creates GLESv1 context.
7847 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007848}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007849
7850/*
7851 * Logs the size of the system ion heap.
7852 *
7853 * Pulled from StatsCompanionService.
7854 */
7855message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007856 // Deprecated due to limited support of ion stats in debugfs.
7857 // Use `IonHeapSize` instead.
7858 option deprecated = true;
7859
Rafal Slawikd4e87572019-03-12 13:08:38 +00007860 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007861 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007862 optional int64 size_in_bytes = 1;
7863}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007864
Rafal Slawik77987ed2019-06-17 12:28:23 +01007865/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007866 * Logs the total size of the ion heap.
7867 *
7868 * Pulled from StatsCompanionService.
7869 */
7870message IonHeapSize {
7871 // Total size of all ion heaps in kilobytes.
7872 // Read from: /sys/kernel/ion/total_heaps_kb.
7873 optional int32 total_size_kb = 1;
7874}
7875
7876/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007877 * Logs the per-process size of the system ion heap.
7878 *
7879 * Pulled from StatsCompanionService.
7880 */
7881message ProcessSystemIonHeapSize {
7882 // The uid if available. -1 means not available.
7883 optional int32 uid = 1 [(is_uid) = true];
7884
7885 // The process name (from /proc/PID/cmdline).
7886 optional string process_name = 2;
7887
7888 // Sum of sizes of all allocations.
7889 optional int32 total_size_in_kilobytes = 3;
7890
7891 // Number of allocations.
7892 optional int32 allocation_count = 4;
7893
7894 // Size of the largest allocation.
7895 optional int32 max_size_in_kilobytes = 5;
7896}
7897
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007898/**
7899 * Push network stack events.
7900 *
7901 * Log from:
7902 * frameworks/base/packages/NetworkStack/
7903 */
7904message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007905 // The id that indicates the event reported from NetworkStack.
7906 optional int32 event_id = 1;
7907 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007908 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7909}
Carmen Agimofa769c152019-03-04 14:39:14 +00007910
7911/**
7912 * Logs the apps that are installed on the external storage.
7913 * Pulled from:
7914 * StatsCompanionService
7915 */
7916message AppsOnExternalStorageInfo {
7917 // The type of the external storage.
7918 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7919 // The name of the package that is installed on the external storage.
7920 optional string package_name = 2;
7921}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007922
7923/**
7924 * Logs the settings related to Face.
7925 * Logged from:
7926 * frameworks/base/services/core/java/com/android/server/stats
7927 */
7928message FaceSettings {
7929 // Whether or not face unlock is allowed on Keyguard.
7930 optional bool unlock_keyguard_enabled = 1;
7931 // Whether or not face unlock dismisses the Keyguard.
7932 optional bool unlock_dismisses_keyguard = 2;
7933 // Whether or not face unlock requires attention.
7934 optional bool unlock_attention_required = 3;
7935 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7936 optional bool unlock_app_enabled = 4;
7937 // Whether or not face unlock always requires user confirmation.
7938 optional bool unlock_always_require_confirmation = 5;
7939 // Whether or not a diverse set of poses are required during enrollment.
7940 optional bool unlock_diversity_required = 6;
7941}
Maggie White442b6312019-04-05 16:26:44 -07007942
7943/**
7944 * Logs cooling devices maintained by the kernel.
7945 *
7946 * Pulled from StatsCompanionService.java
7947 */
7948message CoolingDevice {
7949 // The type of cooling device being reported. Eg. CPU, GPU...
7950 optional android.os.CoolingTypeEnum device_location = 1;
7951 // The name of the cooling device source. Eg. CPU0
7952 optional string device_name = 2;
7953 // Current throttle state of the cooling device. The value can any unsigned
7954 // integer between 0 and max_state defined in its driver. 0 means device is
7955 // not in throttling, higher value means deeper throttling.
7956 optional int32 state = 3;
7957}
Ben Blount763a5d52019-04-10 11:48:58 -07007958
7959/**
7960 * Intelligence has several counter-type events that don't warrant a
7961 * full separate atom. These are primarily API call counters but also include
7962 * counters for feature usage and specific failure modes.
7963 *
7964 * Logged from the Intelligence mainline module.
7965 */
7966message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007967 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007968 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007969 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007970 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007971 // How many times the event occured (to report a batch of high frequency events).
7972 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007973 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007974 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007975}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007976
7977/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007978 * Logs when Car Power state changed.
7979 *
7980 * Logged from:
7981 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7982 */
7983message CarPowerStateChanged {
7984 // States come from CpmsState in CarPowerManagementService.java.
7985 enum State {
7986 WAIT_FOR_VHAL = 0;
7987 ON = 1;
7988 SHUTDOWN_PREPARE = 2;
7989 WAIT_FOR_FINISH = 3;
7990 SUSPEND = 4;
7991 SIMULATE_SLEEP = 5;
7992 }
7993 optional State state = 1;
7994}
7995
7996/**
7997 * Logs whether GarageMode is entered.
7998 *
7999 * Logged from:
8000 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8001 */
8002message GarageModeInfo {
8003 // Whether GarageMode is entered.
8004 optional bool is_garage_mode = 1;
8005}
Martijn Coenencd95d462019-04-25 17:09:45 +02008006
8007/**
8008 * Historical app ops data per package.
8009 */
8010message AppOps {
8011 // Uid of the package requesting the op
8012 optional int32 uid = 1 [(is_uid) = true];
8013
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008014 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008015 optional string package_name = 2;
8016
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008017 // operation id
8018 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008019
8020 // The number of times the op was granted while the app was in the
8021 // foreground (only for trusted requests)
8022 optional int64 trusted_foreground_granted_count = 4;
8023
8024 // The number of times the op was granted while the app was in the
8025 // background (only for trusted requests)
8026 optional int64 trusted_background_granted_count = 5;
8027
8028 // The number of times the op was rejected while the app was in the
8029 // foreground (only for trusted requests)
8030 optional int64 trusted_foreground_rejected_count = 6;
8031
8032 // The number of times the op was rejected while the app was in the
8033 // background (only for trusted requests)
8034 optional int64 trusted_background_rejected_count = 7;
8035
8036 // For long-running operations, total duration of the operation
8037 // while the app was in the foreground (only for trusted requests)
8038 optional int64 trusted_foreground_duration_millis = 8;
8039
8040 // For long-running operations, total duration of the operation
8041 // while the app was in the background (only for trusted requests)
8042 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008043
8044 // Whether AppOps is guarded by Runtime permission
8045 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008046}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008047
8048/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008049 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008050 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008051message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008052 // Uid of the package requesting the op
8053 optional int32 uid = 1 [(is_uid) = true];
8054
8055 // Name of the package performing the op
8056 optional string package_name = 2;
8057
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008058 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8059 // Attributions must be provided through manifest using <attribution> tag available in R and
8060 // above.
8061 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008062
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008063 // operation id
8064 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008065
8066 // The number of times the op was granted while the app was in the
8067 // foreground (only for trusted requests)
8068 optional int64 trusted_foreground_granted_count = 5;
8069
8070 // The number of times the op was granted while the app was in the
8071 // background (only for trusted requests)
8072 optional int64 trusted_background_granted_count = 6;
8073
8074 // The number of times the op was rejected while the app was in the
8075 // foreground (only for trusted requests)
8076 optional int64 trusted_foreground_rejected_count = 7;
8077
8078 // The number of times the op was rejected while the app was in the
8079 // background (only for trusted requests)
8080 optional int64 trusted_background_rejected_count = 8;
8081
8082 // For long-running operations, total duration of the operation
8083 // while the app was in the foreground (only for trusted requests)
8084 optional int64 trusted_foreground_duration_millis = 9;
8085
8086 // For long-running operations, total duration of the operation
8087 // while the app was in the background (only for trusted requests)
8088 optional int64 trusted_background_duration_millis = 10;
8089
8090 // Whether AppOps is guarded by Runtime permission
8091 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008092
8093 // Sampling rate used on device, from 0 to 100
8094 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008095}
8096
8097/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008098 * Location Manager API Usage information(e.g. API under usage,
8099 * API call's parameters).
8100 * Logged from:
8101 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8102 */
8103message LocationManagerApiUsageReported {
8104
8105 // Indicating if usage starts or usage ends.
8106 optional android.stats.location.UsageState state = 1;
8107
8108 // LocationManagerService's API in use.
8109 // We can identify which API from LocationManager is
8110 // invoking current LMS API by the combination of
8111 // API parameter(e.g. is_listener_null, is_intent_null,
8112 // is_location_request_null)
8113 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8114
8115 // Name of the package calling the API.
8116 optional string calling_package_name = 3;
8117
8118 // Type of the location provider.
8119 optional android.stats.location.ProviderType provider = 4;
8120
8121 // Quality of the location request
8122 optional android.stats.location.LocationRequestQuality quality = 5;
8123
8124 // The desired interval for active location updates, in milliseconds.
8125 // Bucketized to reduce cardinality.
8126 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8127
8128 // Minimum distance between location updates, in meters.
8129 // Bucketized to reduce cardinality.
8130 optional android.stats.location.SmallestDisplacementBucket
8131 bucketized_smallest_displacement = 7;
8132
8133 // The number of location updates.
8134 optional int64 num_updates = 8;
8135
8136 // The request expiration time, in millisecond since boot.
8137 // Bucketized to reduce cardinality.
8138 optional android.stats.location.ExpirationBucket
8139 bucketized_expire_in = 9;
8140
8141 // Type of Callback passed in for this API.
8142 optional android.stats.location.CallbackType callback_type = 10;
8143
8144 // The radius of the central point of the alert
8145 // region, in meters. Only for API REQUEST_GEOFENCE.
8146 // Bucketized to reduce cardinality.
8147 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8148
8149 // Activity Importance of API caller.
8150 // Categorized to 3 types that are interesting from location's perspective.
8151 optional android.stats.location.ActivityImportance activiy_importance = 12;
8152}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008153
8154/**
8155 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8156 */
8157message ReviewPermissionsFragmentResultReported {
8158 // unique value identifying a permission group change. A permission group change might result
8159 // in multiple of these atoms
8160 optional int64 change_id = 1;
8161
8162 // UID of package the permission belongs to
8163 optional int32 uid = 2 [(is_uid) = true];
8164
8165 // Name of package the permission belongs to
8166 optional string package_name = 3;
8167
8168 // The permission to be granted
8169 optional string permission_name = 4;
8170
8171 // The result of the permission grant
8172 optional bool permission_granted = 5;
8173}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008174
8175/**
8176* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8177* Logged from: RuntimePermissionUpdgradeController
8178*/
8179message RuntimePermissionsUpgradeResult {
8180 // Permission granted as result of upgrade
8181 optional string permission_name = 1;
8182
8183 // UID of package granted permission
8184 optional int32 uid = 2 [(is_uid) = true];
8185
8186 // Name of package granted permission
8187 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008188}
8189
8190/**
8191* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8192*/
8193message GrantPermissionsActivityButtonActions {
8194 // Permission granted as result of upgrade
8195 optional string permission_group_name = 1;
8196
8197 // UID of package granted permission
8198 optional int32 uid = 2 [(is_uid) = true];
8199
8200 // Name of package requesting permission
8201 optional string package_name = 3;
8202
8203 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8204 // LABEL_ constants in GrantPermissionActivity.java
8205 optional int32 buttons_presented = 4;
8206
8207 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8208 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008209
8210 // id which identifies single session of user interacting with permission controller
8211 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008212}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008213
8214/**
8215 * Information about LocationAccessCheck notification presented to user
8216 */
8217message LocationAccessCheckNotificationAction {
8218
8219 // id which identifies single session of user interacting with permission controller
8220 optional int64 session_id = 1;
8221
8222 // Uid of package for which location access check is presented
8223 optional int32 package_uid = 2;
8224
8225 // Name of package for which location access check is presented
8226 optional string package_name = 3;
8227
8228 enum Result {
8229 UNDEFINED = 0;
8230 // notification was presented to the user
8231 NOTIFICATION_PRESENTED = 1;
8232 // notification was declined by the user
8233 NOTIFICATION_DECLINED = 2;
8234 // notification was clicked by the user
8235 NOTIFICATION_CLICKED = 3;
8236 }
8237
8238 // View / interaction recorded
8239 optional Result result = 4;
8240}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008241
8242/**
8243 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8244 */
8245message AppPermissionFragmentActionReported {
8246 // id which identifies single session of user interacting with permission controller
8247 optional int64 session_id = 1;
8248
8249 // unique value identifying a permission group change. A permission group change might result
8250 // in multiple of these atoms
8251 optional int64 change_id = 2;
8252
8253 // UID of package the permission belongs to
8254 optional int32 uid = 3 [(is_uid) = true];
8255
8256 // Name of package the permission belongs to
8257 optional string package_name = 4;
8258
8259 // The permission to be granted
8260 optional string permission_name = 5;
8261
8262 // The result of the permission grant
8263 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008264
8265 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8266 optional int32 permission_flags = 7;
8267
8268 enum Button {
8269 UNDEFINED = 0;
8270 // Allow button
8271 ALLOW = 1;
8272 // Deny button
8273 DENY = 2;
8274 // Ask every time button
8275 ASK_EVERY_TIME = 3;
8276 // Allow all the time button
8277 ALLOW_ALWAYS = 4;
8278 // Allow only while using the app button
8279 ALLOW_FOREGROUND = 5;
8280 // Same is Deny button but shown in while in use dialog
8281 DENY_FOREGROUND = 6;
8282 }
8283
8284 // Button pressed in the dialog
8285 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008286}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008287
8288/**
8289* Information about a AppPermissionFragment viewed by user
8290*/
8291message AppPermissionFragmentViewed {
8292 // id which identifies single session of user interacting with permission controller
8293 optional int64 session_id = 1;
8294
8295 // UID of package for which permissions are viewed
8296 optional int32 uid = 2 [(is_uid) = true];
8297
8298 // Name of package for which permissions are viewed
8299 optional string package_name = 3;
8300
8301 // Permission group viewed
8302 optional string permission_group_name = 4;
8303}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008304
8305/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008306* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8307* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008308*/
8309message AppPermissionsFragmentViewed {
8310 // id which identifies single session of user interacting with permission controller
8311 optional int64 session_id = 1;
8312
8313 // id which identifies single view as every view might have several logging records
8314 // with different package information attached
8315 optional int64 view_id = 2;
8316
8317 // Permission group viewed
8318 optional string permission_group_name = 3;
8319
8320 // UID of package for which permissions are viewed
8321 optional int32 uid = 4 [(is_uid) = true];
8322
8323 // Name of package for which permissions are viewed
8324 optional string package_name = 5;
8325
8326 // Category in which permission is included
8327 enum Category {
8328 UNDEFINED = 0;
8329 ALLOWED = 1;
8330 ALLOWED_FOREGROUND = 2;
8331 DENIED = 3;
8332 }
8333 optional Category category = 6;
8334}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008335/**
8336* Information about a PermissionAppsFragment viewed by user.
8337* Logged from ui/handheld/PermissionAppsFragment.java
8338*/
8339message PermissionAppsFragmentViewed {
8340 // id which identifies single session of user interacting with permission controller
8341 optional int64 session_id = 1;
8342
8343 // id which identifies single view as every view might have several logging records
8344 // with different package information attached
8345 optional int64 view_id = 2;
8346
8347 // Permission group viewed
8348 optional string permission_group_name = 3;
8349
8350 // UID of package for which permissions are viewed
8351 optional int32 uid = 4 [(is_uid) = true];
8352
8353 // Name of package for which permissions are viewed
8354 optional string package_name = 5;
8355
8356 // Category in which app is included
8357 enum Category {
8358 UNDEFINED = 0;
8359 ALLOWED = 1;
8360 ALLOWED_FOREGROUND = 2;
8361 DENIED = 3;
8362 }
8363 optional Category category = 6;
8364}
Tony Make2b1b672019-07-29 16:59:47 +01008365
8366/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008367* Log that the Auto Revoke notification has been clicked
8368* Logged from ui/ManagePermissionsActivity
8369*/
8370message AutoRevokeNotificationClicked {
8371 // id which identifies single session of user interacting with permission controller
8372 optional int64 session_id = 1;
8373}
8374
8375/**
8376* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8377* auto revoked for it.
8378* Logged from ui/handheld/AutoRevokeFragment
8379*/
8380message AutoRevokeFragmentAppViewed {
8381 // id which identifies single session of user interacting with permission controller
8382 optional int64 session_id = 1;
8383
8384 // UID of package for which permissions are viewed
8385 optional int32 uid = 2 [(is_uid) = true];
8386
8387 // Name of package for which permissions are viewed
8388 optional string package_name = 3;
8389
8390 // The name of a permission group that has been revoked
8391 optional string permission_group_name = 4;
8392
8393 // The age of the app- more than three months old, or more than six months
8394 enum Age {
8395 UNDEFINED = 0;
8396 NEWER_BUCKET = 1;
8397 OLDER_BUCKET = 2;
8398 }
8399
8400 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8401 optional Age age = 5;
8402}
8403
8404/**
8405* Log that the user has interacted with an app on the auto revoke fragment
8406* Logged from ui/handheld/AutoRevokeFragment
8407*/
8408message AutoRevokedAppInteraction {
8409 // id which identifies single session of user interacting with permission controller
8410 optional int64 session_id = 1;
8411
8412 // UID of package for which permissions are viewed
8413 optional int32 uid = 2 [(is_uid) = true];
8414
8415 // Name of package for which permissions are viewed
8416 optional string package_name = 3;
8417
8418 enum Action {
8419 UNDEFINED = 0;
8420 REMOVE = 1;
8421 OPEN = 2;
8422 APP_INFO = 3;
8423 PERMISSIONS = 4;
8424 REMOVE_IN_SETTINGS = 5;
8425 OPEN_IN_SETTINGS = 6;
8426 }
8427
8428 // The action the user took to interact with the app
8429 optional Action action = 4;
8430}
8431
8432/**
8433* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8434* auto revoke, or that the auto revoke switch has been changed
8435* Logged from ui/handheld/AppPermissionGroupsFragment
8436 */
8437message AppPermissionGroupsFragmentAutoRevokeAction {
8438 // id which identifies single session of user interacting with permission controller
8439 optional int64 session_id = 1;
8440
8441 // UID of package for which permissions are viewed
8442 optional int32 uid = 2 [(is_uid) = true];
8443
8444 // Name of package for which permissions are viewed
8445 optional string package_name = 3;
8446
8447 enum Action {
8448 UNDEFINED = 0;
8449 OPENED_FOR_AUTO_REVOKE = 1;
8450 OPENED_FROM_INTENT = 2;
8451 SWITCH_ENABLED = 3;
8452 SWITCH_DISABLED = 4;
8453 }
8454
8455 // The action the user took to interact with the fragment
8456 optional Action action = 4;
8457}
8458
8459/**
Tony Make2b1b672019-07-29 16:59:47 +01008460 * Logs when there is a smart selection related event.
8461 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8462 * Logged from: TextClassifierEventLogger.java
8463 */
8464message TextSelectionEvent {
8465 // A session ID.
8466 optional string session_id = 1;
8467
8468 // Event type of this event.
8469 optional android.stats.textclassifier.EventType event_type = 2;
8470
Tony Mak9c84bd22019-12-09 07:27:25 +00008471 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008472 optional string model_name = 3;
8473
8474 // Type of widget that was involved in triggering this event.
8475 optional android.stats.textclassifier.WidgetType widget_type = 4;
8476
8477 // Index of this event in a session.
8478 optional int32 event_index = 5;
8479
8480 // Entity type that is involved.
8481 optional string entity_type = 6;
8482
8483 // Relative word index of the start of the selection.
8484 optional int32 relative_word_start_index = 7;
8485
8486 // Relative word (exclusive) index of the end of the selection.
8487 optional int32 relative_word_end_index = 8;
8488
8489 // Relative word index of the start of the smart selection.
8490 optional int32 relative_suggested_word_start_index = 9;
8491
8492 // Relative word (exclusive) index of the end of the smart selection.
8493 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008494
8495 // Name of source package.
8496 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008497
8498 // Name of the LangID model that is involved in this event.
8499 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008500}
8501
8502/**
8503 * Logs when there is a smart linkify related event.
8504 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8505 * Logged from: TextClassifierEventLogger.java
8506 */
8507message TextLinkifyEvent {
8508 // A session ID.
8509 optional string session_id = 1;
8510
8511 // Event type of this event.
8512 optional android.stats.textclassifier.EventType event_type = 2;
8513
Tony Mak9c84bd22019-12-09 07:27:25 +00008514 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008515 optional string model_name = 3;
8516
8517 // Type of widget that was involved in triggering this event.
8518 optional android.stats.textclassifier.WidgetType widget_type = 4;
8519
8520 // Index of this event in a session.
8521 optional int32 event_index = 5;
8522
8523 // Entity type that is involved.
8524 optional string entity_type = 6;
8525
8526 // Number of links detected.
8527 optional int32 num_links = 7;
8528
8529 // The total length of all links.
8530 optional int32 linked_text_length = 8;
8531
8532 // Length of input text.
8533 optional int32 text_length = 9;
8534
8535 // Time spent on generating links in ms.
8536 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008537
8538 // Name of source package.
8539 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008540
8541 // Name of the LangID model that is involved in this event.
8542 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008543}
8544
8545/**
8546 * Logs when there is a conversation actions related event.
8547 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8548 * Logged from: TextClassifierEventLogger.java
8549 */
8550message ConversationActionsEvent {
8551 // A session ID.
8552 optional string session_id = 1;
8553
8554 // Event type of this event.
8555 optional android.stats.textclassifier.EventType event_type = 2;
8556
Tony Mak9c84bd22019-12-09 07:27:25 +00008557 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008558 optional string model_name = 3;
8559
8560 // Type of widget that was involved in triggering this event.
8561 optional android.stats.textclassifier.WidgetType widget_type = 4;
8562
8563 // The first entity type that is involved.
8564 optional string first_entity_type = 5;
8565
8566 // The second entity type that is involved.
8567 optional string second_entity_type = 6;
8568
8569 // The third entity type that is involved.
8570 optional string third_entity_type = 7;
8571
8572 // The score of the first entity type.
8573 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008574
8575 // Name of source package.
8576 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008577
8578 // Name of the annotator model that is involved in this event.
8579 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008580
8581 // Name of the LangID model that is involved in this event.
8582 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008583}
8584
8585/**
8586 * Logs when there is a language detection related event.
8587 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8588 * Logged from: TextClassifierEventLogger.java
8589 */
8590message LanguageDetectionEvent {
8591 // A session ID.
8592 optional string session_id = 1;
8593
8594 // Event type of this event.
8595 optional android.stats.textclassifier.EventType event_type = 2;
8596
Tony Mak9c84bd22019-12-09 07:27:25 +00008597 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008598 optional string model_name = 3;
8599
8600 // Type of widget that was involved in triggering this event.
8601 optional android.stats.textclassifier.WidgetType widget_type = 4;
8602
8603 // Detected language.
8604 optional string language_tag = 5;
8605
8606 // Score of the detected language.
8607 optional float score = 6;
8608
8609 // Position of this action.
8610 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008611
8612 // Name of source package.
8613 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008614}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008615
8616/**
8617 * Information about an OTA update attempt by update_engine.
8618 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8619 */
8620message UpdateEngineUpdateAttemptReported {
8621 // The number of attempts for the update engine to apply a given payload.
8622 optional int32 attempt_number = 1;
8623
8624 optional android.stats.otaupdate.PayloadType payload_type = 2;
8625
8626 // The total time in minutes for the update engine to apply a given payload.
8627 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8628 // it's increased when the system is sleeping.
8629 optional int32 duration_boottime_in_minutes = 3;
8630
8631 // The total time in minutes for the update engine to apply a given payload.
8632 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8633 // and it's not increased when the system is sleeping.
8634 optional int32 duration_monotonic_in_minutes = 4;
8635
8636 // The size of the payload in MiBs.
8637 optional int32 payload_size_mib = 5;
8638
8639 // The attempt result reported by the update engine for an OTA update.
8640 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8641
8642 // The error code reported by the update engine after an OTA update attempt
8643 // on A/B devices.
8644 optional android.stats.otaupdate.ErrorCode error_code = 7;
8645
8646 // The build fingerprint of the source system. The value is read from a
8647 // system property when the device takes the update. e.g.
8648 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8649 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01008650
8651 // Size of super partition.
8652 optional int64 super_partition_size_bytes = 9;
8653
8654 // Size of current slot within the super partition.
8655 optional int64 slot_size_bytes = 10;
8656
8657 // Free space available in the super partition.
8658 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07008659}
8660
8661/**
8662 * Information about all the attempts the device make before finishing the
8663 * successful update.
8664 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8665 */
8666message UpdateEngineSuccessfulUpdateReported {
8667 // The number of attempts for the update engine to apply the payload for a
8668 // successful update.
8669 optional int32 attempt_count = 1;
8670
8671 optional android.stats.otaupdate.PayloadType payload_type = 2;
8672
8673 optional int32 payload_size_mib = 3;
8674
8675 // The total number of bytes downloaded by update_engine since the last
8676 // successful update.
8677 optional int32 total_bytes_downloaded_mib = 4;
8678
8679 // The ratio in percentage of the over-downloaded bytes compared to the
8680 // total bytes needed to successfully install the update. e.g. 200 if we
8681 // download 200MiB in total for a 100MiB package.
8682 optional int32 download_overhead_percentage = 5;
8683
8684 // The total time in minutes for the update engine to apply the payload for a
8685 // successful update.
8686 optional int32 total_duration_minutes = 6;
8687
8688 // The number of reboot of the device during a successful update.
8689 optional int32 reboot_count = 7;
8690}
Alec Mourie088e762019-07-02 13:10:55 -07008691
8692/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008693 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8694 * key to indicate whether it was successful or not.
8695 *
8696 * Logged from:
8697 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8698 */
8699message RebootEscrowRecoveryReported {
8700 optional bool successful = 1;
8701}
8702
8703/**
Alec Mourie088e762019-07-02 13:10:55 -07008704 * Global display pipeline metrics reported by SurfaceFlinger.
8705 * Pulled from:
8706 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8707 */
8708message SurfaceflingerStatsGlobalInfo {
8709 // Total number of frames presented during the tracing period
8710 optional int64 total_frames = 1;
8711 // Total number of frames missed
8712 optional int64 missed_frames = 2;
8713 // Total number of frames that fell back to client composition
8714 optional int64 client_composition_frames = 3;
8715 // Total time the display was turned on
8716 optional int64 display_on_millis = 4;
8717 // Total time that was spent performing animations.
8718 // This is derived from the present-to-present layer histogram
8719 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008720 // Total number of event connections tracked by SurfaceFlinger at the time
8721 // of this pull. If this number grows prohibitively large, then this can
8722 // cause jank due to resource contention.
8723 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008724 // Set of timings measured from when SurfaceFlinger began compositing a
8725 // frame, until the frame was requested to be presented to the display. This
8726 // measures SurfaceFlinger's total CPU walltime on the critical path per
8727 // frame.
8728 optional FrameTimingHistogram frame_duration = 7
8729 [(android.os.statsd.log_mode) = MODE_BYTES];
8730 // Set of timings measured from when SurfaceFlinger first began using the
8731 // GPU to composite a frame, until the GPU has finished compositing that
8732 // frame. This measures the total additional time SurfaceFlinger needed to
8733 // perform due to falling back into GPU composition.
8734 optional FrameTimingHistogram render_engine_timing = 8
8735 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008736}
8737
8738/**
8739 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8740 * The number of layers uploaded will be restricted due to size limitations.
8741 * Pulled from:
8742 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8743 */
8744message SurfaceflingerStatsLayerInfo {
8745 // The layer for this set of metrics
8746 // For now we can infer that the package name is included in the layer
8747 // name.
8748 optional string layer_name = 1;
8749 // Total number of frames presented
8750 optional int64 total_frames = 2;
8751 // Total number of dropped frames while latching a buffer for this layer.
8752 optional int64 dropped_frames = 3;
8753 // Set of timings measured between successive presentation timestamps.
8754 optional FrameTimingHistogram present_to_present = 4
8755 [(android.os.statsd.log_mode) = MODE_BYTES];
8756 // Set of timings measured from when an app queued a buffer for
8757 // presentation, until the buffer was actually presented to the
8758 // display.
8759 optional FrameTimingHistogram post_to_present = 5
8760 [(android.os.statsd.log_mode) = MODE_BYTES];
8761 // Set of timings measured from when a buffer is ready to be presented,
8762 // until the buffer was actually presented to the display.
8763 optional FrameTimingHistogram acquire_to_present = 6
8764 [(android.os.statsd.log_mode) = MODE_BYTES];
8765 // Set of timings measured from when a buffer was latched by
8766 // SurfaceFlinger, until the buffer was presented to the display
8767 optional FrameTimingHistogram latch_to_present = 7
8768 [(android.os.statsd.log_mode) = MODE_BYTES];
8769 // Set of timings measured from the desired presentation to the actual
8770 // presentation time
8771 optional FrameTimingHistogram desired_to_present = 8
8772 [(android.os.statsd.log_mode) = MODE_BYTES];
8773 // Set of timings measured from when an app queued a buffer for
8774 // presentation, until the buffer was ready to be presented.
8775 optional FrameTimingHistogram post_to_acquire = 9
8776 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008777 // Frames missed latch because the acquire fence didn't fire
8778 optional int64 late_acquire_frames = 10;
8779 // Frames latched early because the desired present time was bad
8780 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008781}
8782
8783/**
8784 * Histogram of frame counts bucketed by time in milliseconds.
8785 * Because of size limitations, we hard-cap the number of buckets, with
8786 * buckets for corresponding to larger milliseconds being less precise.
8787 */
8788message FrameTimingHistogram {
8789 // Timings in milliseconds that describes a set of histogram buckets
8790 repeated int32 time_millis_buckets = 1;
8791 // Number of frames that match to each time_millis, i.e. the bucket
8792 // contents
8793 // It's required that len(time_millis) == len(frame_count)
8794 repeated int64 frame_counts = 2;
8795}
Emilian Peev6729f372019-08-29 09:14:09 -07008796
Emilian Peev6729f372019-08-29 09:14:09 -07008797/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008798 * Janky event as reported by SurfaceFlinger.
8799 * This event is intended to be consumed by a Perfetto subscriber for
8800 * automated trace collection.
8801 *
8802 * Logged from:
8803 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8804 */
8805message DisplayJankReported {
8806 // Informational field for how long the janky event lasted in milliseconds
8807 optional int64 event_duration_millis = 1;
8808 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8809 // the display on time.
8810 optional int32 present_deadlines_missed = 2;
8811}
8812
8813/**
Emilian Peev6729f372019-08-29 09:14:09 -07008814 * Information about camera facing and API level usage.
8815 * Logged from:
8816 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8817 */
8818message CameraActionEvent {
8819 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008820 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008821
8822 // Camera API level used
8823 optional int32 api_level = 2;
8824
8825 // Name of client package
8826 optional string package_name = 3;
8827
8828 // Camera facing
8829 enum Facing {
8830 UNKNOWN = 0;
8831 BACK = 1;
8832 FRONT = 2;
8833 EXTERNAL = 3;
8834 }
8835 optional Facing facing = 4;
8836}
atrost01a20932019-08-28 15:40:37 +01008837
8838/**
8839 * Logs when a compatibility change is affecting an app.
8840 *
8841 * Logged from:
8842 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8843 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8844 */
8845message AppCompatibilityChangeReported {
8846 // The UID of the app being affected by the compatibilty change.
8847 optional int32 uid = 1 [(is_uid) = true];
8848
8849 // The ID of the change affecting the app.
8850 optional int64 change_id = 2;
8851
8852 enum State {
8853 UNKNOWN_STATE = 0;
8854 ENABLED = 1;
8855 DISABLED = 2;
8856 LOGGED = 3;
8857 }
8858
8859 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8860 // logged otherwise.
8861 optional State state = 3;
8862
8863 enum Source {
8864 UNKNOWN_SOURCE = 0;
8865 APP_PROCESS = 1;
8866 SYSTEM_SERVER = 2;
8867 }
8868
8869 // Where it was logged from.
8870 optional Source source = 4;
8871
8872}
Hector Dearman40579f62019-11-01 13:19:30 +00008873
8874/**
8875 * Logged from
8876 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8877 */
8878message PerfettoUploaded {
8879 enum Event {
8880 PERFETTO_UNDEFINED = 0;
8881 PERFETTO_TRACE_BEGIN = 1;
8882 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8883 PERFETTO_ON_CONNECT = 3;
8884 PERFETTO_ON_TRACING_DISABLED = 4;
8885 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8886 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8887 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8888 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8889 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8890 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8891 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8892 PERFETTO_TRIGGER_BEGIN = 12;
8893 PERFETTO_TRIGGER_SUCCESS = 13;
8894 PERFETTO_TRIGGER_FAILURE = 14;
8895 PERFETTO_HIT_GUARDRAILS = 15;
8896 PERFETTO_ON_TIMEOUT = 16;
8897 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8898 }
8899
8900 // Which stage of the pipeline we are reporting from.
8901 optional Event event = 1;
8902
8903 // UUID matching the one set inside the SystemInfo trace packet.
8904 optional int64 trace_uuid_lsb = 2;
8905 optional int64 trace_uuid_msb = 3;
8906}
Mark Tabrya824a642019-11-05 12:26:12 -08008907
8908/**
8909 * Pulls client metrics on data transferred via Vehicle Maps Service.
8910 * Metrics are keyed by uid + layer.
8911 *
8912 * Pulled from:
8913 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8914 */
8915message VmsClientStats {
8916 // UID of the VMS client app
8917 optional int32 uid = 1 [(is_uid) = true];
8918
8919 // VMS layer definition
8920 optional int32 layer_type = 2;
8921 optional int32 layer_channel = 3;
8922 optional int32 layer_version = 4;
8923
8924 // Bytes and packets sent by the client for the layer
8925 optional int64 tx_bytes = 5;
8926 optional int64 tx_packets = 6;
8927
8928 // Bytes and packets received by the client for the layer
8929 optional int64 rx_bytes = 7;
8930 optional int64 rx_packets = 8;
8931
8932 // Bytes and packets dropped due to client error
8933 optional int64 dropped_bytes = 9;
8934 optional int64 dropped_packets = 10;
8935}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008936
8937/**
8938 * State of a dangerous permission requested by a package - sampled
8939 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8940*/
8941message DangerousPermissionStateSampled {
8942 // Name of the permission
8943 optional string permission_name = 1;
8944
8945 // Uid of the package
8946 optional int32 uid = 2 [(is_uid) = true];
8947
8948 // If the permission is granted to the uid
8949 optional bool is_granted = 3;
8950
8951 // Permission flags as per android.content.pm.PermissionFlags
8952 optional int32 permission_flags = 4;
8953}
8954
Stan Iliev637ba5e2019-08-16 13:43:08 -04008955/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008956 * HWUI stats for a given app.
8957 */
8958message GraphicsStats {
8959 // The package name of the app
8960 optional string package_name = 1;
8961
8962 // The version code of the app
8963 optional int64 version_code = 2;
8964
8965 // The start & end timestamps in UTC as
8966 // milliseconds since January 1, 1970
8967 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008968 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008969
Stan Ilievb6517192020-02-18 10:12:42 -05008970 optional int64 end_millis = 4;
8971
8972 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8973 enum PipelineType {
8974 UNKNOWN = 0;
8975 GL = 1;
8976 VULKAN = 2;
8977 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008978
8979 // HWUI renders pipeline type: GL or Vulkan.
8980 optional PipelineType pipeline = 5;
8981
8982 // Distinct frame count.
8983 optional int32 total_frames = 6;
8984
8985 // Number of "missed vsync" events.
8986 optional int32 missed_vsync_count = 7;
8987
8988 // Number of frames in triple-buffering scenario (high input latency)
8989 optional int32 high_input_latency_count = 8;
8990
8991 // Number of "slow UI thread" events.
8992 optional int32 slow_ui_thread_count = 9;
8993
8994 // Number of "slow bitmap upload" events.
8995 optional int32 slow_bitmap_upload_count = 10;
8996
8997 // Number of "slow draw" events.
8998 optional int32 slow_draw_count = 11;
8999
9000 // Number of frames that missed their deadline (aka, visibly janked)
9001 optional int32 missed_deadline_count = 12;
9002
9003 // The frame time histogram for the package
9004 optional FrameTimingHistogram cpu_histogram = 13
9005 [(android.os.statsd.log_mode) = MODE_BYTES];
9006
9007 // The gpu frame time histogram for the package
9008 optional FrameTimingHistogram gpu_histogram = 14
9009 [(android.os.statsd.log_mode) = MODE_BYTES];
9010
9011 // UI mainline module version.
9012 optional int64 version_ui_module = 15;
9013
9014 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9015 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9016 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9017 // more apps are running / rendering.
9018 optional bool is_today = 16;
9019}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009020
9021/**
9022 * Message related to dangerous (runtime) app ops access
9023 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009024message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009025 // Uid of the package accessing app op
9026 optional int32 uid = 1 [(is_uid) = true];
9027
9028 // Name of the package accessing app op
9029 optional string package_name = 2;
9030
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009031 // deprecated - set to empty string
9032 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009033
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009034 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009035 // API. Attributions must be provided through manifest using <attribution> tag available in R
9036 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009037 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009038
9039 // message related to app op access, limited to 600 chars by API
9040 optional string message = 5;
9041
9042 enum SamplingStrategy {
9043 DEFAULT = 0;
9044 UNIFORM = 1;
9045 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009046 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009047 }
9048
9049 // sampling strategy used to collect this message
9050 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009051
9052 // operation id
9053 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009054}
9055
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009056/*
9057 * Logs userspace reboot outcome and duration.
9058 *
9059 * Logged from:
9060 * frameworks/base/core/java/com/android/server/BootReceiver.java
9061 */
9062message UserspaceRebootReported {
9063 // Possible outcomes of userspace reboot.
9064 enum Outcome {
9065 // Default value in case platform failed to determine the outcome.
9066 OUTCOME_UNKNOWN = 0;
9067 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9068 SUCCESS = 1;
9069 // Userspace reboot shutdown sequence was aborted.
9070 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9071 // Remounting userdata into checkpointing mode failed.
9072 FAILED_USERDATA_REMOUNT = 3;
9073 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9074 // reboot.
9075 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9076 }
9077 // Outcome of userspace reboot. Always set.
9078 optional Outcome outcome = 1;
9079 // Duration of userspace reboot in case it has a successful outcome.
9080 // Duration is measured as time between userspace reboot was initiated and until boot completed
9081 // (e.g. sys.boot_completed=1).
9082 optional int64 duration_millis = 2;
9083 // State of primary user's (user0) credential encryption storage.
9084 enum UserEncryptionState {
9085 // Default value.
9086 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9087 // Credential encrypted storage is unlocked.
9088 UNLOCKED = 1;
9089 // Credential encrypted storage is locked.
9090 LOCKED = 2;
9091 }
9092 // State of primary user's encryption storage at the moment boot completed. Always set.
9093 optional UserEncryptionState user_encryption_state = 3;
9094}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009095
9096/*
9097 * Logs integrity check information during each install.
9098 *
9099 * Logged from:
9100 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9101 */
9102message IntegrityCheckResultReported {
9103 optional string package_name = 1;
9104 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009105 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009106 optional string installer_package_name = 4;
9107 enum Response {
9108 UNKNOWN = 0;
9109 ALLOWED = 1;
9110 REJECTED = 2;
9111 FORCE_ALLOWED = 3;
9112 }
9113 optional Response response = 5;
9114 // An estimate on the cause of the response. This will only be populated for
9115 // REJECTED and FORCE_ALLOWED
9116 optional bool caused_by_app_cert_rule = 6;
9117 optional bool caused_by_installer_rule = 7;
9118}
9119
9120/**
9121 * Logs the information about the rules and the provider whenever rules are
9122 * pushed into AppIntegrityManager.
9123 *
9124 * Logged from:
9125 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9126 */
9127message IntegrityRulesPushed {
9128 optional bool success = 1;
9129 // Package name of the app that pushed the rules.
9130 optional string rule_provider = 2;
9131 // Version string of arbitrary format provided by the rule provider to
9132 // identify the rules.
9133 optional string rule_version = 3;
9134}
Jordan Liubedfa702019-12-20 15:08:45 -08009135
9136/**
9137 * Logs when a cell broadcast message is received on the device.
9138 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009139 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009140 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009141 * packages/apps/CellBroadcastReceiver/
9142 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009143 */
9144message CellBroadcastMessageReported {
9145 // The type of Cell Broadcast message
9146 enum CbType {
9147 UNKNOWN_TYPE = 0;
9148 GSM = 1;
9149 CDMA = 2;
9150 CDMA_SPC = 3;
9151 }
9152
Jordan Liu900e5cb2020-05-29 09:44:59 -07009153 // The parts of the cell broadcast message pipeline
9154 enum ReportSource {
9155 UNKNOWN_SOURCE = 0;
9156 FRAMEWORK = 1;
9157 CB_SERVICE = 2;
9158 CB_RECEIVER_APP = 3;
9159 }
9160
Jordan Liubedfa702019-12-20 15:08:45 -08009161 // GSM, CDMA, CDMA-SCP
9162 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009163
9164 // The source of the report
9165 optional ReportSource source = 2;
9166}
9167
9168/**
9169 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9170 *
9171 * Logged from CellBroadcastService module:
9172 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9173 */
9174message CellBroadcastMessageFiltered {
9175 enum FilterReason {
9176 NOT_FILTERED = 0;
9177 DUPLICATE_MESSAGE = 1;
9178 GEOFENCED_MESSAGE = 2;
9179 AREA_INFO_MESSAGE = 3;
9180 }
9181
9182 // GSM, CDMA, CDMA-SCP
9183 optional CellBroadcastMessageReported.CbType type = 1;
9184
9185 // The source of the report
9186 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009187}
9188
9189/**
9190 * Logs when an error occurs while handling a cell broadcast message;
9191 *
9192 * Logged from CellBroadcastService module:
9193 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9194 */
9195message CellBroadcastMessageError {
9196 // The type of error raised when trying to handle a cell broadcast message
9197 enum ErrorType {
9198 UNKNOWN_TYPE = 0;
9199 CDMA_DECODING_ERROR = 1;
9200 CDMA_SCP_EMPTY = 2;
9201 CDMA_SCP_HANDLING_ERROR = 3;
9202 GSM_INVALID_HEADER_LENGTH = 4;
9203 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9204 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9205 GSM_INVALID_PDU = 7;
9206 GSM_INVALID_GEO_FENCING_DATA = 8;
9207 GSM_UMTS_INVALID_WAC = 9;
9208 FAILED_TO_INSERT_TO_DB = 10;
9209 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9210 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9211 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9212 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009213 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009214 }
9215
9216 // What kind of error occurred
9217 optional ErrorType type = 1;
9218
9219 // Exception message (or log message) associated with the error (max 1000 chars)
9220 optional string exception_message = 2;
9221}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009222
9223/**
Henry Fange316ab62020-04-21 18:43:14 -07009224 * Logs when a tune occurs through device's Frontend.
9225 * This is atom ID 276.
9226 *
9227 * Logged from:
9228 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9229 */
9230message TvTunerStateChanged {
9231 enum State {
9232 UNKNOWN = 0;
9233 TUNING = 1; // Signal is tuned
9234 LOCKED = 2; // the signal is locked
9235 NOT_LOCKED = 3; // the signal isn’t locked.
9236 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9237 SCANNING = 5; // the signal is scanned
9238 SCAN_STOPPED = 6; // the scan is stopped.
9239 }
9240 // The uid of the application that sent this custom atom.
9241 optional int32 uid = 1 [(is_uid) = true];
9242 // new state
9243 optional State state = 2;
9244}
9245/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009246 * Logs when an app is frozen or unfrozen.
9247 *
9248 * Logged from:
9249 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9250 */
9251message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009252 // The type of event.
9253 enum Action {
9254 UNKNOWN = 0;
9255 FREEZE_APP = 1;
9256 UNFREEZE_APP = 2;
9257 }
9258 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009259
Blake Kragten6ce382a2020-01-16 20:20:46 -08009260 // Pid of the process being frozen.
9261 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009262
Blake Kragten6ce382a2020-01-16 20:20:46 -08009263 // Name of the process being frozen.
9264 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009265
Blake Kragten6ce382a2020-01-16 20:20:46 -08009266 // Time since last unfrozen.
9267 optional int64 time_unfrozen_millis = 4;
9268}
9269
9270/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009271 * Pulls information for a single voice call.
9272 *
9273 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9274 *
9275 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009276 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009277 */
9278message VoiceCallSession {
9279 // Bearer (IMS or CS) when the call started.
9280 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9281
9282 // Bearer (IMS or CS) when the call ended.
9283 // The bearer may change during the call, e.g. due to SRVCC.
9284 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9285
9286 // Direction of the call (incoming or outgoing).
9287 optional android.telephony.CallDirectionEnum direction = 3;
9288
9289 // Time spent setting up the call.
9290 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9291
9292 // Whether the call ended before the setup was completed.
9293 optional bool setup_failed = 5;
9294
9295 // IMS reason code or CS disconnect cause.
9296 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9297 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9298 optional int32 disconnect_reason_code = 6;
9299
9300 // IMS extra code or CS precise disconnect cause.
9301 // For IMS, this code is vendor-specific
9302 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9303 optional int32 disconnect_extra_code = 7;
9304
9305 // IMS extra message or CS vendor cause.
9306 optional string disconnect_extra_message = 8;
9307
9308 // Radio access technology (RAT) used when call started.
9309 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9310
9311 // Radio access technology (RAT) used when call terminated.
9312 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9313
9314 // Number of times RAT changed during the call.
9315 optional int64 rat_switch_count = 11;
9316
9317 // A bitmask of all codecs used during the call.
9318 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9319 optional int64 codec_bitmask = 12;
9320
9321 // Number of other calls going on during call setup, for the same SIM slot.
9322 optional int32 concurrent_call_count_at_start = 13;
9323
9324 // Number of other calls going on during call termination, for the same SIM slot.
9325 optional int32 concurrent_call_count_at_end = 14;
9326
9327 // Index of the SIM is used, 0 for single-SIM devices.
9328 optional int32 sim_slot_index = 15;
9329
9330 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9331 optional bool is_multi_sim = 16;
9332
9333 // Whether the call was made with an eSIM profile.
9334 optional bool is_esim = 17;
9335
9336 // Carrier ID of the SIM card.
9337 // See https://source.android.com/devices/tech/config/carrierid.
9338 optional int32 carrier_id = 18;
9339
Chi Zhangba1b03a2020-04-21 17:17:56 -07009340 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009341 optional bool srvcc_completed = 19;
9342
9343 // Number of SRVCC failures.
9344 optional int64 srvcc_failure_count = 20;
9345
9346 // Number of SRVCC cancellations.
9347 optional int64 srvcc_cancellation_count = 21;
9348
Chi Zhangba1b03a2020-04-21 17:17:56 -07009349 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9350 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009351 optional bool rtt_enabled = 22;
9352
9353 // Whether this was an emergency call.
9354 optional bool is_emergency = 23;
9355
9356 // Whether the call was performed while roaming.
9357 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009358
9359 // A random number used as the dimension field to pull multiple atoms.
9360 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009361}
9362
9363/**
9364 * Pulls voice call radio access technology (RAT) usage.
9365 *
9366 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9367 * time. The atom will be skipped if not enough data is available.
9368 *
9369 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009370 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009371 */
9372message VoiceCallRatUsage {
9373 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9374 optional int32 carrier_id = 1;
9375
9376 // Radio access technology.
9377 optional android.telephony.NetworkTypeEnum rat = 2;
9378
9379 // Total duration that voice calls spent on this carrier and RAT.
9380 optional int64 total_duration_seconds = 3;
9381
9382 // Total number of calls using this carrier and RAT.
9383 // A call is counted once even if it used the RAT multiple times.
9384 optional int64 call_count = 4;
9385}
9386
9387/**
9388 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9389 *
9390 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009391 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009392 */
9393message SimSlotState {
9394 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9395 optional int32 active_slot_count = 1;
9396
9397 // Number of SIM cards (both physical and active eSIM profiles).
9398 // This number is always equal to or less than the number of active SIM slots.
9399 optional int32 sim_count = 2;
9400
9401 // Number of active eSIM profiles.
9402 // This number is always equal to or less than the number of SIMs.
9403 optional int32 esim_count = 3;
9404}
9405
9406/**
9407 * Pulls supported cellular radio access technologies.
9408 *
9409 * This atom reports the capabilities of the device, rather than the network it has access to.
9410 *
9411 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009412 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009413 */
9414message SupportedRadioAccessFamily {
9415 // A bitmask of supported radio technologies.
9416 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9417 optional int64 network_type_bitmask = 1;
9418}
9419
9420/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009421 * Logs gnss stats from location service provider
9422 *
9423 * Pulled from:
9424 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9425 */
9426
9427message GnssStats {
9428 // Number of location reports since boot
9429 optional int64 location_reports = 1;
9430
9431 // Total pulled reports of Location failures since boot
9432 optional int64 location_failure_reports = 2;
9433
9434 // Number of time to first fix reports since boot
9435 optional int64 time_to_first_fix_reports = 3;
9436
9437 // Total pulled reported time to first fix (in milli-seconds) since boot
9438 optional int64 time_to_first_fix_milli_s = 4;
9439
9440 // Number of position accuracy reports since boot
9441 optional int64 position_accuracy_reports = 5;
9442
9443 // Total pulled reported position accuracy (in meters) since boot
9444 optional int64 position_accuracy_meters = 6;
9445
9446 // Number of top 4 average CN0 reports since boot
9447 optional int64 top_four_average_cn0_reports = 7;
9448
9449 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9450 optional int64 top_four_average_cn0_db_mhz = 8;
9451
9452 // Number of l5 top 4 average CN0 reports since boot
9453 optional int64 l5_top_four_average_cn0_reports = 9;
9454
9455 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9456 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9457
9458 // Total number of sv status messages reports since boot
9459 optional int64 sv_status_reports = 11;
9460
9461 // Total number of sv status messages reports, where sv is used in fix since boot
9462 optional int64 sv_status_reports_used_in_fix = 12;
9463
9464 // Total number of L5 sv status messages reports since boot
9465 optional int64 l5_sv_status_reports = 13;
9466
9467 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9468 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009469}
Kweku Adams12752132020-02-18 15:36:48 -08009470
9471/**
9472 * Logs when an app is moved to a different standby bucket.
9473 *
9474 * Logged from:
9475 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9476 */
9477message AppStandbyBucketChanged {
9478 optional string package_name = 1;
9479
9480 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9481 optional int32 user_id = 2;
9482
9483 // These enum values match the constants defined in UsageStatsManager.java.
9484 enum Bucket {
9485 BUCKET_UNKNOWN = 0;
9486 BUCKET_EXEMPTED = 5;
9487 BUCKET_ACTIVE = 10;
9488 BUCKET_WORKING_SET = 20;
9489 BUCKET_FREQUENT = 30;
9490 BUCKET_RARE = 40;
9491 BUCKET_RESTRICTED = 45;
9492 BUCKET_NEVER = 50;
9493 }
9494 optional Bucket bucket = 3;
9495
9496 enum MainReason {
9497 MAIN_UNKNOWN = 0;
9498 MAIN_DEFAULT = 0x0100;
9499 MAIN_TIMEOUT = 0x0200;
9500 MAIN_USAGE = 0x0300;
9501 MAIN_FORCED_BY_USER = 0x0400;
9502 MAIN_PREDICTED = 0x0500;
9503 MAIN_FORCED_BY_SYSTEM = 0x0600;
9504 }
9505 optional MainReason main_reason = 4;
9506
9507 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9508 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9509 // UsageStatsManager.java.
9510 optional int32 sub_reason = 5;
9511}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009512
9513/**
9514* Reports a started sharesheet transaction.
9515*
9516* Logged from:
9517* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9518*/
9519message SharesheetStarted {
9520 // The event_id (as for UiEventReported).
9521 optional int32 event_id = 1;
9522 // The calling app's package name.
9523 optional string package_name = 2;
9524 // An identifier to tie together multiple logs relating to the same share event
9525 optional int32 instance_id = 3;
9526 // The mime type of the share
9527 optional string mime_type = 4;
9528 // The number of direct targets the calling app is providing that will be shown.
9529 optional int32 num_app_provided_direct_targets = 5;
9530 // The number of app targets the calling app is providing that will be shown.
9531 optional int32 num_app_provided_app_targets = 6;
9532 // True if the share originates from the workprofile
9533 optional bool is_workprofile = 7;
9534
9535 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009536 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009537 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9538 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9539 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9540 }
9541 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009542 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009543
9544 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9545 INTENT_DEFAULT = 0;
9546 INTENT_ACTION_VIEW = 1;
9547 INTENT_ACTION_EDIT = 2;
9548 INTENT_ACTION_SEND = 3;
9549 INTENT_ACTION_SENDTO = 4;
9550 INTENT_ACTION_SEND_MULTIPLE = 5;
9551 INTENT_ACTION_IMAGE_CAPTURE = 6;
9552 INTENT_ACTION_MAIN = 7;
9553 }
9554 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009555 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009556}
9557
9558/**
9559 * Reports a ranking selection event.
9560 *
9561 * Logged from:
9562 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9563 */
9564message RankingSelected {
9565 // The event_id (as for UiEventReported).
9566 optional int32 event_id = 1;
9567 // The relevant app's package name (can be source or picked package).
9568 optional string package_name = 2;
9569 // An identifier to tie together multiple logs relating to the same share event.
9570 optional int32 instance_id = 3;
9571 // Which of the ranked targets got picked, default starting position 0.
9572 optional int32 position_picked = 4;
9573}
Raff Tsaiea4db182020-03-06 07:45:43 +08009574
9575/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009576 * Logs when TvSettings UI is interacted at.
9577 *
9578 * Logged from: packages/apps/TvSettings
9579 */
9580message TvSettingsUIInteracted {
9581
9582 /** The UI action category */
9583 optional android.app.tvsettings.Action action = 1;
9584
9585 /** The ID of the entry that the users actioned on */
9586 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -07009587}
9588
9589/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009590 * Logs information about a package installation using package installer V2 APIs.
9591 *
9592 * Logged from:
9593 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9594 */
9595message PackageInstallerV2Reported {
9596 // Whether this installation uses Incremental File System
9597 optional bool is_incremental = 1;
9598 // Name of the package that is intended to be installed
9599 optional string package_name = 2;
9600 // The duration between when the install was requested to when the install has completed
9601 optional int64 duration_millis = 3;
9602 // Installation result in final integer, which are SystemApi's.
9603 // Return_code 1 indicates success.
9604 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9605 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009606 // Total size of the APKs installed for this package
9607 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009608}
9609
9610/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009611 * Logs settings provider values.
9612 *
9613 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9614 * then write the value to proto.
9615 *
9616 */
9617message SettingSnapshot {
9618
9619 // Setting key
9620 optional string name = 1;
9621
9622 enum SettingsValueType {
9623 NOTASSIGNED = 0;
9624 ASSIGNED_BOOL_TYPE = 1;
9625 ASSIGNED_INT_TYPE = 2;
9626 ASSIGNED_FLOAT_TYPE = 3;
9627 ASSIGNED_STRING_TYPE = 4;
9628 };
9629 // Setting value type
9630 optional SettingsValueType type = 2;
9631
9632 optional bool bool_value = 3;
9633
9634 optional int32 int_value = 4;
9635
9636 optional float float_value = 5;
9637
9638 optional string str_value = 6;
9639
9640 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9641 optional int32 user_id = 7;
9642}
Varun Shahacb56342019-12-18 11:45:38 -08009643
9644/**
9645 * An event logged to indicate that a user journey is about to be performed. This atom includes
9646 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9647 * will immediately follow this atom which will describe the event(s) and its state.
9648 *
9649 * Logged from:
9650 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9651 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9652 */
9653message UserLifecycleJourneyReported {
9654 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9655 // UserLifecycleEventOccurred atom)
9656 optional int64 session_id = 1;
9657
9658 // Indicates what type of user journey this session is related to
9659 enum Journey {
9660 UNKNOWN = 0; // Undefined user lifecycle journey
9661 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9662 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9663 USER_START = 3; // A user start journey
9664 USER_CREATE = 4; // A user creation journey
9665 }
9666 optional Journey journey = 2;
9667 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9668 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9669 optional int32 origin_user = 3;
9670 // Which user the journey is targeting
9671 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9672 optional int32 target_user = 4;
9673
9674 // What is the user type of the target user
9675 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9676 enum UserType {
9677 TYPE_UNKNOWN = 0;
9678 FULL_SYSTEM = 1;
9679 FULL_SECONDARY = 2;
9680 FULL_GUEST = 3;
9681 FULL_DEMO = 4;
9682 FULL_RESTRICTED = 5;
9683 PROFILE_MANAGED = 6;
9684 SYSTEM_HEADLESS = 7;
9685 }
9686 optional UserType user_type = 5;
9687 // What are the flags attached to the target user
9688 optional int32 user_flags = 6;
9689}
9690
9691/**
9692 * An event logged when a specific user lifecycle event is performed. These events should be
9693 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9694 * Note: journeys can span over multiple events, hence some events may share a single session id.
9695 *
9696 * Logged from:
9697 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9698 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9699 */
9700message UserLifecycleEventOccurred {
9701 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9702 optional int64 session_id = 1;
9703 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9704 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9705 optional int32 user_id = 2;
9706
9707 enum Event {
9708 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9709 SWITCH_USER = 1; // Indicates that this is a user switch event
9710 START_USER = 2; // Indicates that this is a user start event
9711 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -07009712 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
9713 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
9714 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -08009715 }
9716 optional Event event = 3;
9717
9718 enum State {
9719 NONE = 0; // Indicates the associated event has no start/end defined
9720 BEGIN = 1;
9721 FINISH = 2;
9722 }
9723 optional State state = 4; // Represents the state of an event (beginning/ending)
9724}
jasonwshsu81173e32020-03-27 15:22:03 +08009725
9726/**
9727 * Logs when accessibility shortcut clicked.
9728 *
9729 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009730 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009731 */
9732message AccessibilityShortcutReported {
9733 // The accessibility feature(including installed a11y service, framework a11y feature,
9734 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
9735 optional string package_name = 1;
9736
9737 // The definition of the accessibility shortcut.
9738 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9739 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
9740
9741 // The definition of the service status.
9742 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9743 optional android.stats.accessibility.ServiceStatus service_status = 3;
9744}
9745
9746/**
9747 * Logs when accessibility service status changed.
9748 *
9749 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +08009750 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +08009751 */
9752message AccessibilityServiceReported {
9753 // The accessibility service package name.
9754 optional string package_name = 1;
9755
9756 // The definition of the service status.
9757 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
9758 optional android.stats.accessibility.ServiceStatus service_status = 2;
9759}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009760
Denny cy Lee57b31282020-04-17 10:08:52 +08009761message DisplayWakeReason {
9762 // Wake_up_reason code
9763 // If LOWORD(wake_up_reason) = 0
9764 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
9765 // else reference wake_up_reason to
9766 // frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
9767 optional int32 wake_up_reason = 1;
9768 // Count of wake up by reason
9769 optional int32 wake_times = 2;
9770}
9771
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -07009772/**
9773 * Logs app usage events.
9774 */
9775message AppUsageEventOccurred {
9776 optional int32 uid = 1 [(is_uid) = true];
9777 optional string package_name = 2;
9778 optional string class_name = 3;
9779
9780 enum EventType {
9781 NONE = 0;
9782 MOVE_TO_FOREGROUND = 1;
9783 MOVE_TO_BACKGROUND = 2;
9784 }
9785 optional EventType event_type = 4;
9786}
Changyeon Jo51ae3582020-04-14 09:41:00 -07009787
9788/*
9789 * Quality metrics logged when EVS cameras are active.
9790 *
9791 * Logged from:
9792 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
9793 */
9794message EvsUsageStatsReported {
9795
9796 // Camera identifier to distinguish the source camera device. This is not
9797 // globally unique and therefore cannot be used to identify the user and/or
9798 // the device.
9799 optional int32 device_id = 1;
9800
9801 // Peak number of clients during the service
9802 optional int32 peak_num_clients = 2;
9803
9804 // Number of erroneous events during the service
9805 optional int32 num_errors = 3;
9806
9807 // Round trip latency of the very first frame
9808 optional int64 first_latency_millis = 4;
9809
9810 // Average frame round trip latency
9811 optional float avg_latency_millis = 5;
9812
9813 // Peak frame round trip latency
9814 optional int64 peak_latency_millis = 6;
9815
9816 // Total number of frames received
9817 optional int64 total_frames = 7;
9818
9819 // Number of frames ignored
9820 optional int64 ignored_frames = 8;
9821
9822 // Number of dropped frames to synchronize camera devices
9823 optional int64 dropped_frames_to_sync = 9;
9824
9825 // The duration of the service
9826 optional int64 duration_millis = 10;
9827}
Robert Leecccdc152020-04-23 13:22:46 +08009828
9829/**
9830 * Logs audio power usage stats.
9831 *
9832 * Pushed from:
9833 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
9834 */
9835message AudioPowerUsageDataReported {
9836 /**
9837 * Device used for input/output
9838 *
9839 * All audio devices please refer to below file:
9840 * system/media/audio/include/system/audio-base.h
9841 *
9842 * Define our own enum values because we don't report all audio devices.
9843 * Currently, we only report built-in audio devices such as handset, speaker,
9844 * built-in mics, common audio devices such as wired headset, usb headset
9845 * and bluetooth devices.
9846 */
9847 enum AudioDevice {
9848 OUTPUT_EARPIECE = 0x1; // handset
9849 OUTPUT_SPEAKER = 0x2; // dual speaker
9850 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
9851 OUTPUT_USB_HEADSET = 0x8; // usb headset
9852 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
9853 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
9854 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
9855
9856 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
9857 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
9858 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
9859 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
9860 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
9861 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
9862 }
9863 optional AudioDevice audio_device = 1;
9864
9865 // Duration of the audio in seconds
9866 optional int32 duration_secs = 2;
9867
9868 // Average volume (0 ... 1.0)
9869 optional float average_volume = 3;
9870
9871 enum AudioType {
9872 UNKNOWN_TYPE = 0;
9873 VOICE_CALL_TYPE = 1; // voice call
9874 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
9875 MEDIA_TYPE = 3; // music and system sound
9876 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
9877 ALARM_TYPE = 5; // alarm type
9878 // record type
9879 CAMCORDER_TYPE = 6; // camcorder
9880 RECORD_TYPE = 7; // other recording
9881 }
9882 optional AudioType type = 4;
9883}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -07009884
9885/**
9886 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
9887 *
9888 * Pulled from:
9889 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
9890 */
9891message BytesTransferByTagAndMetered {
9892 optional int32 uid = 1 [(is_uid) = true];
9893
9894 optional bool is_metered = 2;
9895
9896 optional int32 tag = 3;
9897
9898 optional int64 rx_bytes = 4;
9899
9900 optional int64 rx_packets = 5;
9901
9902 optional int64 tx_bytes = 6;
9903
9904 optional int64 tx_packets = 7;
9905}
Robert Luo2f52f042020-05-11 16:39:24 +08009906
9907/*
9908 * Logs when the Media Output Switcher finishes a media switch operation.
9909 *
9910 * Logged from:
9911 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
9912 */
9913message MediaOutputOpSwitchReported {
9914 // Source medium type before switching.
9915 optional android.app.settings.mediaoutput.MediumType source = 1;
9916
9917 // Target medium type after switching.
9918 optional android.app.settings.mediaoutput.MediumType target = 2;
9919
9920 // The result of switching.
9921 optional android.app.settings.mediaoutput.SwitchResult result = 3;
9922
9923 // The detail code of a switching result.
9924 optional android.app.settings.mediaoutput.SubResult subresult = 4;
9925
9926 /*
9927 * The package name of a pre-installed app, whose media session is being switched.
9928 */
9929 optional string media_session_package_name = 5;
9930
9931 // The amount of available wired devices when a switching is being performed.
9932 optional int32 available_wired_device_count = 6;
9933
9934 // The amount of available Bluetooth devices a switching is being performed.
9935 optional int32 available_bt_device_count = 7;
9936
9937 // The amount of available remote devices when a switching is being performed.
9938 optional int32 available_remote_device_count = 8;
9939
9940 // The amount of applied devices within a remote dynamic group after a switching is done.
9941 optional int32 applied_device_count_within_remote_group = 9;
9942}