blob: 2bbce11da2fff8320f39a77380f406af621055c2 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Robert Luo2f52f042020-05-11 16:39:24 +080027import "frameworks/base/core/proto/android/app/media_output_enum.proto";
Zhen Sun0bec8d42020-03-25 17:17:29 -070028import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080029import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080030import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080031import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080032import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080033import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080034import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080035import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080036import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080038import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080039import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080040import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080041import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080042import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080044import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080045import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080046import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070049import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080050import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070051import "frameworks/base/core/proto/android/stats/enums.proto";
52import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070053import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070054import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080055import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070056import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000057import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080058import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050059import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080060import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080061import "frameworks/base/core/proto/android/telephony/enums.proto";
62import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080063import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010064import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070065import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080066
Yao Chend54f9dd2017-10-17 17:37:48 +000067/**
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * raw stats log events from the Android system, also known as "atoms."
70 *
71 * This field contains a single oneof with all of the available messages.
72 * The stats-log-api-gen tool runs as part of the Android build and
73 * generates the android.util.StatsLog class, which contains the constants
74 * and methods that Android uses to log.
75 *
Stefan Lafonae2df012017-11-14 09:17:21 -080076 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000077 * Instead, statsd on Android constructs these messages synthetically,
78 * in the format defined here and in stats_log.proto.
79 */
Stefan Lafonae2df012017-11-14 09:17:21 -080080message Atom {
81 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070082 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070083 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070084 BleScanStateChanged ble_scan_state_changed = 2
85 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080087 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SensorStateChanged sensor_state_changed =
89 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080090 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070091 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
92 ScheduledJobStateChanged scheduled_job_state_changed =
93 8 [(module) = "framework", (module) = "statsdtest"];
94 ScreenBrightnessChanged screen_brightness_changed =
95 9 [(module) = "framework", (module) = "statsdtest"];
96 WakelockStateChanged wakelock_state_changed =
97 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080098 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
99 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700100 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
101 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800102 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
103 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
104 14 [(module) = "framework"];
105 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
106 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
107 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
108 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800109 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700110 BatterySaverModeStateChanged battery_saver_mode_state_changed =
111 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800112 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
113 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700114 AudioStateChanged audio_state_changed =
115 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
117 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
118 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700119 UidProcessStateChanged uid_process_state_changed =
120 27 [(module) = "framework", (module) = "statsdtest"];
121 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
122 28 [(module) = "framework", (module) = "statsdtest"];
123 ScreenStateChanged screen_state_changed =
124 29 [(module) = "framework", (module) = "statsdtest"];
125 BatteryLevelChanged battery_level_changed =
126 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800127 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800128 PluggedStateChanged plugged_state_changed = 32
129 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800131 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800132 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
133 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800134 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
135 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
136 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700137 PhoneSignalStrengthChanged phone_signal_strength_changed =
138 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 SettingChanged setting_changed = 41 [(module) = "framework"];
140 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 42 [(module) = "framework", (module) = "statsdtest"];
142 IsolatedUidChanged isolated_uid_changed =
143 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800144 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
145 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800146 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800147 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800148 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700149 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800150 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
151 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800152 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800153 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800154 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800155 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800156 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
157 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800158 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800159 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700160 OverlayStateChanged overlay_state_changed =
161 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 ForegroundServiceStateChanged foreground_service_state_changed
163 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700164 CallStateChanged call_state_changed =
165 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800166 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
167 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
168 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800169 AppDied app_died = 65 [(module) = "framework"];
170 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
171 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800172 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
173 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800174 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
175 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800176 SpeakerImpedanceReported speaker_impedance_reported = 71;
177 HardwareFailed hardware_failed = 72;
178 PhysicalDropDetected physical_drop_detected = 73;
179 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800180 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
181 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700183 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ANROccurred anr_occurred = 79 [(module) = "framework"];
185 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
186 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700187 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800189 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800190 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
191 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700192 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800193 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
194 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
195 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
thiruram70b08432020-06-09 18:44:02 -0700196 UiEventReported ui_event_reported = 90 [(module) = "framework", (module) = "sysui"];
Howard Roa46b6582018-09-18 16:45:02 -0700197 BatteryHealthSnapshot battery_health_snapshot = 91;
198 SlowIo slow_io = 92;
199 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100202 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800203 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700205 // TODO: service state change is very noisy shortly after boot, as well
206 // as at other transitions - coming out of doze, device plugged in, etc.
207 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
209 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
210 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800211 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800212 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800213 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
214 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
215 105 [(module) = "docsui"];
216 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
217 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
218 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
219 108 [(module) = "docsui"];
220 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
221 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
222 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
223 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800225 WifiRunningStateChanged wifi_running_state_changed = 114
226 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800227 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800229 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800230 117 [(module) = "docsui"];
231 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
232 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
233 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
234 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
236 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
237 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800238 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
239 125 [(module) = "bluetooth"];
240 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
241 126 [(module) = "bluetooth"];
242 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
243 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000245 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800246 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
247 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
248 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800249 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800250 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
251 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
252 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
253 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
254 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
255 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800256 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
257 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
259 142 [(module) = "framework"];
260 AttentionManagerServiceResultReported attention_manager_service_result_reported =
261 143 [(module) = "framework"];
262 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800263 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800264 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800265 WatchdogRollbackOccurred watchdog_rollback_occurred =
266 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800267 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
268 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800269 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800270 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
271 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800272 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
273 151 [(module) = "bluetooth"];
274 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
275 152 [(module) = "bluetooth"];
276 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
277 153 [(module) = "bluetooth"];
278 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
279 154 [(module) = "bluetooth"];
280 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
281 155 [(module) = "bluetooth"];
282 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
283 156 [(module) = "bluetooth"];
284 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
285 157 [(module) = "bluetooth"];
286 BluetoothDeviceFailedContactCounterReported
287 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
288 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
289 159 [(module) = "bluetooth"];
290 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
291 160 [(module) = "bluetooth"];
292 BluetoothQualityReportReported bluetooth_quality_report_reported =
293 161 [(module) = "bluetooth"];
294 BluetoothDeviceInfoReported bluetooth_device_info_reported =
295 162 [(module) = "bluetooth"];
296 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
297 163 [(module) = "bluetooth"];
298 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
299 164 [(module) = "bluetooth"];
300 BluetoothBondStateChanged bluetooth_bond_state_changed =
301 165 [(module) = "bluetooth"];
302 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
303 166 [(module) = "bluetooth"];
304 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
305 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
307 168 [(module) = "framework"];
308 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700309 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800311 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800312 DeviceIdentifierAccessDenied device_identifier_access_denied =
313 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800315 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
316 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
317 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
319 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800320 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700321 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 180 [(module) = "permissioncontroller"];
323 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
324 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800326 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
327 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
328 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
329 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800330 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
331 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700332 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 188 [(module) = "intelligence"];
334 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
335 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800336 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800337 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800338 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
339 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
340 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
341 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
342 MediametricsCodecReported mediametrics_codec_reported = 195;
343 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
344 MediametricsExtractorReported mediametrics_extractor_reported = 197;
345 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
346 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
347 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700348 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800349 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
350 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800351 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
353 206 [(module) = "framework"];
354 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
355 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
356 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
357 LocationManagerApiUsageReported location_manager_api_usage_reported =
358 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100361 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100363 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100365 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100367 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100369 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100371 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100373 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
376 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
377 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
378 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800380 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700381 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
382 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100384 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800385 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800387 VmsClientConnectionStateChanged vms_client_connection_state_changed =
388 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100389 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
390 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
391 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800392 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100393 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
394 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800395 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800396 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
397 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
398 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
399 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800400 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000402 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800403 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500404 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
405 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800406 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
407 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800408 CellBroadcastMessageReported cb_message_reported =
409 249 [(module) = "cellbroadcast"];
410 CellBroadcastMessageError cb_message_error =
411 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700412 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
413 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
414 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800415 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000416 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800417 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
418 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800419 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800420 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500421 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
thiruram70b08432020-06-09 18:44:02 -0700422 RankingSelected ranking_selected = 260 [(module) = "framework", (module) = "sysui"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700423 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800424 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700425 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800426 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
427 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800428 AccessibilityShortcutReported accessibility_shortcut_reported =
429 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800430 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700431 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700432 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700433 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
434 270 [(module) = "permissioncontroller"];
435 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
436 271 [(module) = "permissioncontroller"];
437 AutoRevokedAppInteraction auto_revoked_app_interaction =
438 272 [(module) = "permissioncontroller", (module) = "settings"];
439 AppPermissionGroupsFragmentAutoRevokeAction
440 app_permission_groups_fragment_auto_revoke_action =
441 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700442 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800443 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700444 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800445 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
446 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700447 CellBroadcastMessageFiltered cb_message_filtered =
448 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700449 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Henry Fangfd40c072020-06-01 14:59:17 -0700450 TvCasSessionOpenStatus tv_cas_session_open_status =
451 280 [(module) = "framework"];
Govinda Wassermane4640282020-04-30 09:30:56 -0400452 AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800453 DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
Mayank Gargda5ca012020-05-14 00:23:53 -0700454 CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
455 283 [(module) = "car"];
456 CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
457 284 [(module) = "car"];
458 CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
459 285 [(module) = "car"];
460 CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
461 286 [(module) = "car"];
462 CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
463 287 [(module) = "car"];
464 CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
465 288 [(module) = "car"];
466 CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
467 289 [(module) = "car"];
lifr1cc318d2020-03-19 21:58:30 +0800468 NetworkIpProvisioningReported network_ip_provisioning_reported =
469 290 [(module) = "network_stack"];
470 NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
471 NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
472 NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700473
474 // StatsdStats tracks platform atoms with ids upto 500.
475 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000476 }
David Chenc8a43242017-10-17 16:23:28 -0700477
David Chen6e3e6cb2018-01-03 16:14:06 -0800478 // Pulled events will start at field 10000.
Denny cy Leeca62fc42020-05-28 18:13:07 +0800479 // Next: 10081
David Chenc8a43242017-10-17 16:23:28 -0700480 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
482 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700483 MobileBytesTransfer mobile_bytes_transfer =
484 10002 [(module) = "framework", (truncate_timestamp) = true];
485 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
486 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800487 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
488 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700489 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800490 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700491 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800492 CpuTimePerUidFreq cpu_time_per_uid_freq =
493 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800494 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
495 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
496 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
497 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
498 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700499 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700500 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700501 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700502 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800503 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
504 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700505 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800506 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800508 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800509 DiskStats disk_stats = 10025 [(module) = "framework"];
510 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
511 AppSize app_size = 10027 [(module) = "framework"];
512 CategorySize category_size = 10028 [(module) = "framework"];
513 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800514 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800515 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
516 DiskIo disk_io = 10032 [(module) = "framework"];
517 PowerProfile power_profile = 10033 [(module) = "framework"];
518 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
519 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
520 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700521 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800522 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
523 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
524 10040 [(module) = "framework"];
525 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
526 10041 [(module) = "framework"];
527 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800528 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800529 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800530 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800531 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
532 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
533 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
534 RoleHolder role_holder = 10049 [(module) = "framework"];
535 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800536 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800537 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
538 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800539 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
540 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800541 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
542 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
543 FaceSettings face_settings = 10058 [(module) = "framework"];
544 CoolingDevice cooling_device = 10059 [(module) = "framework"];
545 AppOps app_ops = 10060 [(module) = "framework"];
546 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700547 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
548 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800549 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800550 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800551 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
552 DangerousPermissionStateSampled dangerous_permission_state_sampled =
553 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400554 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000555 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000556 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200557 PackageNotificationPreferences package_notification_preferences =
558 10071 [(module) = "framework"];
559 PackageNotificationChannelPreferences package_notification_channel_preferences =
560 10072 [(module) = "framework"];
561 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
562 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800563 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800564 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700565 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
566 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
567 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
568 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800569 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800570 //10081 free for use
junyulai8d1a6092020-05-07 13:38:15 +0800571 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700572 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
573 10083 [(module) = "framework"];
Chris Wren93165692020-05-15 16:12:41 -0400574 DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700575 }
yroa1fe77c2018-02-26 14:22:54 -0800576
Bookatz76aafcf2018-09-17 16:17:10 -0700577 // DO NOT USE field numbers above 100,000 in AOSP.
578 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
579 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100580
581 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700582}
583
Yao Chend54f9dd2017-10-17 17:37:48 +0000584/**
Yangster-mac20877162017-12-22 17:19:39 -0800585 * This proto represents a node of an attribution chain.
586 * Note: All attribution chains are represented as a repeated field of type
587 * AttributionNode. It is understood that in such arrays, the order is that
588 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000589 */
Yangster-mac20877162017-12-22 17:19:39 -0800590message AttributionNode {
591 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800592 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800593
Yangster-mac20877162017-12-22 17:19:39 -0800594 // The (optional) string tag for an element in the attribution chain. If the
595 // element has no tag, it is encoded as an empty string.
596 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700597}
598
Yangster-mac48b3d622018-08-18 12:38:11 -0700599message KeyValuePair {
600 optional int32 key = 1;
601 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700602 int32 value_int = 2;
603 int64 value_long = 3;
604 string value_str = 4;
605 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700606 }
607}
608
609message KeyValuePairsAtom {
610 optional int32 uid = 1;
611 repeated KeyValuePair pairs = 2;
612}
613
Yao Chend54f9dd2017-10-17 17:37:48 +0000614/*
615 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800616 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000617 *
618 * RULES:
619 * - The field ids for each atom must start at 1, and count upwards by 1.
620 * Skipping field ids is not allowed.
621 * - These form an API, so renaming, renumbering or removing fields is
622 * not allowed between android releases. (This is not currently enforced,
623 * but there will be a tool to enforce this restriction).
624 * - The types must be built-in protocol buffer types, namely, no sub-messages
625 * are allowed (yet). The bytes type is also not allowed.
626 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800627 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000628 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800629 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000630 * - A field that is a uid should be a string field, tagged with the [xxx]
631 * annotation. The generated code on android will be represented by UIDs,
632 * and those UIDs will be translated in xxx to those strings.
633 *
634 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700635 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000636 * - If there is a UID, it goes first. Think in an object-oriented fashion.
637 * *****************************************************************************
638 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700639
Yao Chend54f9dd2017-10-17 17:37:48 +0000640/**
Tej Singha72344992019-04-17 18:55:08 -0700641 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700642 * Logs when the Thermal service HAL notifies the throttling start/stop events.
643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
646 */
647message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700648 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700649 optional android.os.TemperatureTypeEnum sensor_type = 1;
650
Maggie White442b6312019-04-05 16:26:44 -0700651 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700652 enum State {
653 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700654 START = 1; // START indicated that throttling was triggered.
655 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700656 }
Yangster-mace16189a2018-08-26 12:20:16 -0700657 optional State state = 2;
658
659 optional float temperature = 3;
660}
661
662/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000663 * Logs when the screen state changes.
664 *
665 * Logged from:
666 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
667 */
668message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800669 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800670 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700671 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700672}
Yao Chend54f9dd2017-10-17 17:37:48 +0000673
674/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700675 * Logs that the process state of the uid, as determined by ActivityManager
676 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000677 *
678 * Logged from:
679 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
680 */
Bookatzc1a050a2017-10-10 15:49:28 -0700681message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700682 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000683
Bookatzdb026a22018-01-10 19:01:56 -0800684 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800685 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700686 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000687}
688
689/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700690 * Logs process state change of a process, as per the activity manager.
691 *
692 * Logged from:
693 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
694 */
695message ProcessStateChanged {
696 optional int32 uid = 1;
697 optional string process_name = 2;
698 optional string package_name = 3;
699 // TODO: remove this when validation is done
700 optional int64 version = 5;
701 // The state, from frameworks/base/core/proto/android/app/enums.proto.
702 optional android.app.ProcessStateEnum state = 4;
703}
704
705/**
706 * Logs when ActivityManagerService sleep state is changed.
707 *
708 * Logged from:
709 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
710 */
711message ActivityManagerSleepStateChanged {
712 // TODO: import frameworks proto
713 enum State {
714 UNKNOWN = 0;
715 ASLEEP = 1;
716 AWAKE = 2;
717 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700718 optional State state = 1
719 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700720}
721
722/**
723 * Logs when system memory state changes.
724 *
725 * Logged from:
726 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
727 */
728message MemoryFactorStateChanged {
729 // TODO: import frameworks proto
730 enum State {
731 MEMORY_UNKNOWN = 0;
732 NORMAL = 1; // normal.
733 MODERATE = 2; // moderate memory pressure.
734 LOW = 3; // low memory.
735 CRITICAL = 4; // critical memory.
736
737 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700738 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700739}
740
741/**
742 * Logs when app is using too much cpu, according to ActivityManagerService.
743 *
744 * Logged from:
745 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
746 */
747message ExcessiveCpuUsageReported {
748 optional int32 uid = 1;
749 optional string process_name = 2;
750 optional string package_name = 3;
751 // package version. TODO: remove this when validation is done
752 optional int64 version = 4;
753}
754
755/**
756 * Logs when a cached process is killed, along with its pss.
757 *
758 * Logged from:
759 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
760 */
761message CachedKillReported {
762 optional int32 uid = 1;
763 optional string process_name = 2;
764 optional string package_name = 3;
765 // TODO: remove this when validation is done
766 optional int64 version = 5;
767 optional int64 pss = 4;
768}
769
770/**
xshu2c3d9e42019-09-26 17:54:02 -0700771 * Logs the change in wifi health.
772 *
773 * Logged from:
774 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
775 */
776message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800777 enum Band {
778 UNKNOWN = 0;
779 // All of 2.4GHz band
780 BAND_2G = 1;
781 // Frequencies in the range of [5150, 5250) GHz
782 BAND_5G_LOW = 2;
783 // Frequencies in the range of [5250, 5725) GHz
784 BAND_5G_MIDDLE = 3;
785 // Frequencies in the range of [5725, 5850) GHz
786 BAND_5G_HIGH = 4;
787 // Frequencies in the range of [5925, 6425) GHz
788 BAND_6G_LOW = 5;
789 // Frequencies in the range of [6425, 6875) GHz
790 BAND_6G_MIDDLE = 6;
791 // Frequencies in the range of [6875, 7125) GHz
792 BAND_6G_HIGH = 7;
793 }
xshu2c3d9e42019-09-26 17:54:02 -0700794 // duration this stat is obtained over in milliseconds
795 optional int32 duration_millis = 1;
796 // whether wifi is classified as sufficient for the user's data traffic, determined
797 // by whether the calculated throughput exceeds the average demand within |duration_millis|
798 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700799 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800800 optional bool is_cell_data_available = 3;
801 // the Band bucket the connected network is on
802 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700803}
804
805/**
806 * Logged when wifi detects a significant change in connection failure rate.
807 *
808 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
809 *
810 */
811message WifiFailureStatReported {
812 enum AbnormalityType {
813 UNKNOWN = 0;
814 SIGNIFICANT_INCREASE = 1;
815 SIGNIFICANT_DECREASE = 2;
816 SIMPLY_HIGH = 3;
817 }
818 enum FailureType {
819 FAILURE_UNKNOWN = 0;
820 FAILURE_CONNECTION = 1;
821 FAILURE_ASSOCIATION_REJECTION = 2;
822 FAILURE_ASSOCIATION_TIMEOUT = 3;
823 FAILURE_AUTHENTICATION = 4;
824 FAILURE_NON_LOCAL_DISCONNECTION = 5;
825 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
826 }
827 // Reason for uploading this stat
828 optional AbnormalityType abnormality_type = 1;
829 // The particular type of failure
830 optional FailureType failure_type = 2;
831 // How many times we have encountered this combination of AbnormalityType and FailureType
832 optional int32 failure_count = 3;
833}
834
835/**
836 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
837 *
838 * Logged from:
839 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
840 */
841message WifiConnectionResultReported {
842 enum FailureCode {
843 FAILURE_UNKNOWN = 0;
844 FAILURE_ASSOCIATION_TIMEOUT = 1;
845 FAILURE_ASSOCIATION_REJECTION = 2;
846 FAILURE_AUTHENTICATION_GENERAL = 3;
847 FAILURE_AUTHENTICATION_EAP = 4;
848 FAILURE_DHCP = 5;
849 FAILURE_NETWORK_DISCONNECTION = 6;
850 FAILURE_ROAM_TIMEOUT = 7;
851 }
852 // true represents a successful connection
853 optional bool connection_result = 1;
854 // reason for the connection failure
855 optional FailureCode failure_code = 2;
856 // scan rssi before the connection attempt
857 optional int32 rssi = 3;
858}
859
860/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700861 * Logs when memory stats of a process is reported.
862 *
863 * Logged from:
864 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
865 */
866message ProcessMemoryStatReported {
867 optional int32 uid = 1;
868 optional string process_name = 2;
869 optional string package_name = 3;
870 //TODO: remove this when validation is done
871 optional int64 version = 9;
872 optional int64 pss = 4;
873 optional int64 uss = 5;
874 optional int64 rss = 6;
875 enum Type {
876 ADD_PSS_INTERNAL_SINGLE = 0;
877 ADD_PSS_INTERNAL_ALL_MEM = 1;
878 ADD_PSS_INTERNAL_ALL_POLL = 2;
879 ADD_PSS_EXTERNAL = 3;
880 ADD_PSS_EXTERNAL_SLOW = 4;
881 }
882 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800883 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700884}
885
886/**
Bookatzc1a050a2017-10-10 15:49:28 -0700887 * Logs that a process started, finished, crashed, or ANRed.
888 *
889 * Logged from:
890 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
891 */
892message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700893 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700894
David Chen0b5c90c2018-01-25 16:51:49 -0800895 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800896 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700897
Bookatzddccf0a2017-11-28 16:48:14 -0800898 // What lifecycle state the process changed to.
899 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800900 enum State {
901 FINISHED = 0;
902 STARTED = 1;
903 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800904 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800905 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700906}
907
Bookatzc1a050a2017-10-10 15:49:28 -0700908/**
909 * Logs when the ble scan state changes.
910 *
911 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700912 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700913 */
914message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800915 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700916 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700917
918 enum State {
919 OFF = 0;
920 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700921 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
922 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700923 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800924 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700925 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800926 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700927 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800928 (state_field_option).nested = true
929 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700930
Bookatze5ec0b42018-03-26 13:34:56 -0700931 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700932 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700933 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700934 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700935 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700936 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700937}
938
939/**
940 * Logs reporting of a ble scan finding results.
941 *
942 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700943 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700944 */
Bookatzae6738e2018-09-13 11:38:56 -0700945// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700946message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800947 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700948
949 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800950 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700951}
952
953/**
954 * Logs when a sensor state changes.
955 *
956 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700957 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700958 */
959message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800960 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700961
Bookatzc1a050a2017-10-10 15:49:28 -0700962 // The id (int) of the sensor.
963 optional int32 sensor_id = 2;
964
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 3;
970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972/**
973 * Logs when GPS state changes.
974 *
975 * Logged from:
976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
977 */
978message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
981 enum State {
982 OFF = 0;
983 ON = 1;
984 }
985 optional State state = 2;
986}
987
Bookatz48d362e2018-11-06 15:49:08 -0800988/**
989 * Logs when GPS signal quality.
990 *
991 * Logged from:
992 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
993 */
994message GpsSignalQualityChanged {
995 optional android.server.location.GpsSignalQualityEnum level = 1;
996}
997
Bookatzc1a050a2017-10-10 15:49:28 -0700998
999/**
1000 * Logs when a sync manager sync state changes.
1001 *
1002 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001003 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001004 */
1005message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001006 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001007
David Chen0b5c90c2018-01-25 16:51:49 -08001008 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001009 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001010
1011 enum State {
1012 OFF = 0;
1013 ON = 1;
1014 }
1015 optional State state = 3;
1016}
1017
Yangster-mac96353002018-09-05 11:18:55 -07001018/*
1019 * Deferred job stats.
1020 *
1021 * Logged from:
1022 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1023*/
1024message DeferredJobStatsReported {
1025 repeated AttributionNode attribution_node = 1;
1026
1027 // Number of jobs deferred.
1028 optional int32 num_jobs_deferred = 2;
1029
1030 // Time since the last job runs.
1031 optional int64 time_since_last_job_millis = 3;
1032}
1033
Bookatzc1a050a2017-10-10 15:49:28 -07001034/**
1035 * Logs when a job scheduler job state changes.
1036 *
1037 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001038 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001039 */
1040message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001041 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001042
1043 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001044 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001045
1046 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001047 FINISHED = 0;
1048 STARTED = 1;
1049 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001050 }
1051 optional State state = 3;
1052
Tej Singh33a412b2018-03-16 18:43:59 -07001053 // The reason a job has stopped.
1054 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001055 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001056 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001057
1058 // The standby bucket of the app that scheduled the job. These match the framework constants
1059 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1060 // already assigned 0.
1061 enum Bucket {
1062 UNKNOWN = -1;
1063 ACTIVE = 0;
1064 WORKING_SET = 1;
1065 FREQUENT = 2;
1066 RARE = 3;
1067 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001068 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001069 }
1070 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1071
1072 // The job id (as assigned by the app).
1073 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001074
1075 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1076 // constraints as they are always assumed to be set.
1077 optional bool has_charging_constraint = 7;
1078 optional bool has_battery_not_low_constraint = 8;
1079 optional bool has_storage_not_low_constraint = 9;
1080 optional bool has_timing_delay_constraint = 10;
1081 optional bool has_deadline_constraint = 11;
1082 optional bool has_idle_constraint = 12;
1083 optional bool has_connectivity_constraint = 13;
1084 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001085}
1086
1087/**
1088 * Logs when the audio state changes.
1089 *
1090 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001091 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001092 */
1093message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001094 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001095
1096 enum State {
1097 OFF = 0;
1098 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001099 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1100 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001101 }
1102 optional State state = 2;
1103}
1104
1105/**
1106 * Logs when the video codec state changes.
1107 *
1108 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001109 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001110 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001111message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001112 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001113
1114 enum State {
1115 OFF = 0;
1116 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001117 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1118 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001119 }
1120 optional State state = 2;
1121}
1122
1123/**
1124 * Logs when the flashlight state changes.
1125 *
1126 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001127 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001128 */
1129message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001130 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001131
1132 enum State {
1133 OFF = 0;
1134 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001135 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1136 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001137 }
1138 optional State state = 2;
1139}
1140
1141/**
1142 * Logs when the camera state changes.
1143 *
1144 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001145 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001146 */
1147message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001148 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001149
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001153 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1154 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001155 }
1156 optional State state = 2;
1157}
1158
1159/**
1160 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001161 *
1162 * Logged from:
1163 * TODO
1164 */
Bookatzd6746242017-10-24 18:39:35 -07001165message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001166 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001167 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001168
Bookatz1a1b0462018-01-12 11:47:03 -08001169 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1170 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001171 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001172
1173 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001174 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001175
1176 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001177 RELEASE = 0;
1178 ACQUIRE = 1;
1179 CHANGE_RELEASE = 2;
1180 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001181 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001182 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001183 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001184 (state_field_option).default_state_value = 0,
1185 (state_field_option).nested = true
1186 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001187}
1188
1189/**
Bookatzc1a050a2017-10-10 15:49:28 -07001190 * Logs when a partial wakelock is considered 'long' (over 1 min).
1191 *
1192 * Logged from:
1193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1194 */
1195message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001196 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001197
Yao Chend54f9dd2017-10-17 17:37:48 +00001198 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1199 optional string tag = 2;
1200
Bookatzc1a050a2017-10-10 15:49:28 -07001201 // TODO: I have no idea what this is.
1202 optional string history_tag = 3;
1203
1204 enum State {
1205 OFF = 0;
1206 ON = 1;
1207 }
1208 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001209}
1210
Bookatzc1a050a2017-10-10 15:49:28 -07001211/**
Bookatza66083f2018-09-20 17:24:00 -07001212 * Logs when the device is interactive, according to the PowerManager Notifier.
1213 *
1214 * Logged from:
1215 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1216 */
1217message InteractiveStateChanged {
1218 enum State {
1219 OFF = 0;
1220 ON = 1;
1221 }
1222 optional State state = 1;
1223}
1224
1225/**
Bookatzc1a050a2017-10-10 15:49:28 -07001226 * Logs Battery Saver state change.
1227 *
1228 * Logged from:
1229 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1230 */
1231message BatterySaverModeStateChanged {
1232 enum State {
1233 OFF = 0;
1234 ON = 1;
1235 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001236 optional State state = 1
1237 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001238}
1239
1240/**
1241 * Logs Doze mode state change.
1242 *
1243 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001244 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001245 */
1246message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001247 optional android.server.DeviceIdleModeEnum state = 1
1248 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001249}
1250
1251
1252/**
1253 * Logs state change of Doze mode including maintenance windows.
1254 *
1255 * Logged from:
1256 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1257 */
1258message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001259 optional android.server.DeviceIdleModeEnum state = 1
1260 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001261}
1262
1263/**
1264 * Logs screen brightness level.
1265 *
1266 * Logged from:
1267 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1268 */
1269message ScreenBrightnessChanged {
1270 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1271 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001272}
1273
1274/**
1275 * Logs battery level (percent full, from 0 to 100).
1276 *
1277 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001278 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001279 */
1280message BatteryLevelChanged {
1281 // Battery level. Should be in [0, 100].
1282 optional int32 battery_level = 1;
1283}
1284
1285/**
1286 * Logs change in charging status of the device.
1287 *
1288 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001289 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001290 */
1291message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001292 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001293 optional android.os.BatteryStatusEnum state = 1
1294 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001295}
1296
1297/**
1298 * Logs whether the device is plugged in, and what power source it is using.
1299 *
1300 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001301 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001302 */
1303message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001304 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001305 optional android.os.BatteryPluggedStateEnum state = 1
1306 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001307}
1308
Bookatz8c6571b2017-10-24 15:04:41 -07001309/**
1310 * Logs when an app's wakeup alarm fires.
1311 *
1312 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001313 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001314 */
1315message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001316 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001317
1318 // Name of the wakeup alarm.
1319 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001320
1321 // Name of source package (for historical reasons, since BatteryStats tracked it).
1322 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001323
Ben Murdoch3389f1522019-05-21 15:05:34 +01001324 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001325 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001326}
1327
1328/**
1329 * Logs when an an app causes the mobile radio to change state.
1330 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1331 *
1332 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001333 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001334 */
1335message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001336 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001337
Bookatz1a1b0462018-01-12 11:47:03 -08001338 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1339 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001340}
1341
1342/**
1343 * Logs when an an app causes the wifi radio to change state.
1344 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1345 *
1346 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001347 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001348 */
1349message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001350 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001351
Bookatz1a1b0462018-01-12 11:47:03 -08001352 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1353 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001354}
1355
1356/**
1357 * Logs kernel wakeup reasons and aborts.
1358 *
1359 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001360 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001361 */
1362message KernelWakeupReported {
1363 // Name of the kernel wakeup reason (or abort).
1364 optional string wakeup_reason_name = 1;
1365
1366 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001367 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001368}
1369
1370/**
Bookatzda1798c2018-12-13 14:16:00 -08001371 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001372 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001373 *
1374 * Logged from:
1375 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1376 */
1377message WifiEnabledStateChanged {
1378 enum State {
1379 OFF = 0;
1380 ON = 1;
1381 }
1382 optional State state = 1;
1383}
1384
1385/**
tsaichristinececebdc2020-02-04 14:05:56 -08001386 * This atom is deprecated starting in R.
1387 *
Bookatzda1798c2018-12-13 14:16:00 -08001388 * 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 -08001389 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1390 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001391 *
1392 * Logged from:
1393 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1394 */
1395message WifiRunningStateChanged {
1396 repeated AttributionNode attribution_node = 1;
1397
1398 enum State {
1399 OFF = 0;
1400 ON = 1;
1401 }
1402 optional State state = 2;
1403}
1404
1405/**
Bookatze5885242017-10-24 20:10:31 -07001406 * Logs wifi locks held by an app.
1407 *
1408 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001409 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001410 */
1411message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001412 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001413
1414 enum State {
1415 OFF = 0;
1416 ON = 1;
1417 }
1418 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001419
1420 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1421 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001422}
1423
1424/**
1425 * Logs wifi signal strength changes.
1426 *
1427 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001428 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001429 */
1430message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001431 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1432 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001433}
1434
1435/**
1436 * Logs wifi scans performed by an app.
1437 *
1438 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001439 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001440 */
1441message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001442 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001443
1444 enum State {
1445 OFF = 0;
1446 ON = 1;
1447 }
1448 optional State state = 2;
1449}
1450
1451/**
Tej Singh4503e102018-01-04 14:35:01 -08001452 * Logs wifi multicast locks held by an app
1453 *
1454 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001455 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001456 */
1457message WifiMulticastLockStateChanged {
1458 repeated AttributionNode attribution_node = 1;
1459
1460 enum State {
1461 OFF = 0;
1462 ON = 1;
1463 }
1464 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001465
1466 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001467}
1468
1469/**
Tej Singh1ea42892018-01-19 09:27:00 -08001470 * Logs shutdown reason and duration on next boot.
1471 *
1472 * Logged from:
1473 * frameworks/base/core/java/com/android/server/BootReceiver.java
1474 */
1475message ShutdownSequenceReported {
1476 // True if shutdown is for a reboot. Default: false if we do not know.
1477 optional bool reboot = 1;
1478
1479 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1480 optional string reason = 2;
1481
1482 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1483 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001484 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001485
1486 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001487 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001488}
1489
Tej Singh6483ea42018-01-25 17:45:49 -08001490
1491/**
1492 * Logs boot reason and duration.
1493 *
1494 * Logged from:
1495 * system/core/bootstat/bootstat.cpp
1496 */
1497message BootSequenceReported {
1498 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1499 // Default: "<EMPTY>" if not available.
1500 optional string bootloader_reason = 1;
1501
1502 // Reason for system boot. Eg. bootloader, reboot,userrequested
1503 // Default: "<EMPTY>" if not available.
1504 optional string system_reason = 2;
1505
1506 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001507 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001508
1509 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001510 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001511
1512 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001513 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001514
1515 // Time since last boot in ms. Default: 0 if not available.
1516 optional int64 time_since_last_boot = 6;
1517}
1518
Tej Singhc477d9c2018-02-05 18:31:39 -08001519
1520/**
1521 * Logs call state and disconnect cause (if applicable).
1522 *
1523 * Logged from:
1524 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1525 */
1526message CallStateChanged {
1527 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1528 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1529 optional android.telecom.CallStateEnum call_state = 1;
1530
1531 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1532 // This value is only applicable when the call_state is DISCONNECTED, and
1533 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1534 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1535 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1536
1537 // True if the call is self-managed, which are apps that use the
1538 // telecom infrastructure to make their own calls.
1539 optional bool self_managed = 3;
1540
1541 // True if call is external. External calls are calls on connected Wear
1542 // devices but show up in Telecom so the user can pull them onto the device.
1543 optional bool external_call = 4;
1544}
1545
Tej Singh1ea42892018-01-19 09:27:00 -08001546/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001547 * Logs keyguard state. The keyguard is the lock screen.
1548 *
1549 * Logged from:
1550 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1551 */
1552message KeyguardStateChanged {
1553 enum State {
1554 UNKNOWN = 0;
1555 // The keyguard is hidden when the phone is unlocked.
1556 HIDDEN = 1;
1557 // The keyguard is shown when the phone is locked (screen turns off).
1558 SHOWN= 2;
1559 // The keyguard is occluded when something is overlaying the keyguard.
1560 // Eg. Opening the camera while on the lock screen.
1561 OCCLUDED = 3;
1562 }
1563 optional State state = 1;
1564}
1565
1566/**
1567 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1568 * prompts the user to enter a password (pattern, pin, etc).
1569 *
1570 * Logged from:
1571 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1572 */
1573
1574message KeyguardBouncerStateChanged {
1575 enum State {
1576 UNKNOWN = 0;
1577 // Bouncer is hidden, either as a result of successfully entering the
1578 // password, screen timing out, or user going back to lock screen.
1579 HIDDEN = 1;
1580 // This is when the user is being prompted to enter the password.
1581 SHOWN = 2;
1582 }
1583 optional State state = 1;
1584}
1585
1586/**
1587 * Logs the result of entering a password into the keyguard bouncer.
1588 *
1589 * Logged from:
1590 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1591 */
1592message KeyguardBouncerPasswordEntered {
1593 enum BouncerResult {
1594 UNKNOWN = 0;
1595 // The password entered was incorrect.
1596 FAILURE = 1;
1597 // The password entered was correct.
1598 SUCCESS = 2;
1599 }
1600 optional BouncerResult result = 1;
1601}
1602
Tej Singha883b372018-02-15 11:30:01 -08001603/*
1604 * Logs changes to the configuration of the device. The configuration is defined
1605 * in frameworks/base/core/java/android/content/res/Configuration.java
1606 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1607 * Please go there to interpret the possible values each field can be.
1608 *
1609 * Logged from:
1610 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1611 */
1612message ResourceConfigurationChanged {
1613 // Bit mask of color capabilities of the screen.
1614 // Contains information about the color gamut and hdr mode of the screen.
1615 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001616 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001617
1618 // The target screen density being rendered to.
1619 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001620 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001621
1622 // Current user preference for the scaling factor for fonts,
1623 // relative to the base density scaling.
1624 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001625 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001626
1627 // Flag indicating whether the hard keyboard is hidden.
1628 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001629 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001630
1631 // The type of keyboard attached to the device.
1632 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1633 optional int32 keyboard = 5;
1634
1635 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001637 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001638
1639 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1640 // 0 if undefined.
1641 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1642 optional int32 mcc = 7;
1643
1644 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1645 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1646 // MNC_ZERO symbol defined in Configuration.java.
1647 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1648 optional int32 mnc = 8;
1649
1650 // The kind of navigation available on the device.
1651 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1652 optional int32 navigation = 9;
1653
1654 // Flag indicating whether the navigation is available.
1655 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001656 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001657
1658 // Overall orientation of the screen.
1659 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1660 optional int32 orientation = 11;
1661
1662 // The current height of the available screen space, in dp units.
1663 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001664 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001665
1666 // Bit mask of overall layout of the screen.
1667 // Contains information about screen size, whether the screen is wider/taller
1668 // than normal, whether the screen layout is right-tl-left or left-to-right,
1669 // and whether the screen has a rounded shape.
1670 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001671 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001672
1673 // Current width of the available screen space, in dp units.
1674 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001675 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001676
1677 // The smallest screen size an application will see in normal operation.
1678 // This is the smallest value of both screenWidthDp and screenHeightDp
1679 // in portrait and landscape.
1680 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001681 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001682
1683 // The type of touch screen attached to the device.
1684 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1685 optional int32 touchscreen = 16;
1686
1687 // Bit mask of the ui mode.
1688 // Contains information about the overall ui mode of the device.
1689 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1690 // Also contains information about whether the device is in night mode.
1691 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001692 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001693}
1694
Tej Singheee317b2018-03-07 19:28:05 -08001695
1696/**
1697 * Logs changes in the connection state of the mobile radio.
1698 *
1699 * Logged from:
1700 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1701 */
1702message MobileConnectionStateChanged {
1703 // States are from the state machine DataConnection.java.
1704 enum State {
1705 UNKNOWN = 0;
1706 // The connection is inactive, or disconnected.
1707 INACTIVE = 1;
1708 // The connection is being activated, or connecting.
1709 ACTIVATING = 2;
1710 // The connection is active, or connected.
1711 ACTIVE = 3;
1712 // The connection is disconnecting.
1713 DISCONNECTING = 4;
1714 // The connection is disconnecting after creating a connection.
1715 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1716 }
1717 optional State state = 1;
1718 // For multi-sim phones, this distinguishes between the sim cards.
1719 optional int32 sim_slot_index = 2;
1720 // Used to identify the connection. Starts at 0 and increments by 1 for
1721 // every new network created. Resets whenever the device reboots.
1722 optional int32 data_connection_id = 3;
1723 // A bitmask for the capabilities of this connection.
1724 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1725 // Default value (if we have no information): 0
1726 optional int64 capabilities = 4;
1727 // If this connection has internet.
1728 // This just checks if the DEFAULT bit of capabilities is set.
1729 optional bool has_internet = 5;
1730}
1731
1732/**
1733 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1734 *
1735 * Logged from:
1736 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1737 */
1738message MobileRadioTechnologyChanged {
1739 optional android.telephony.NetworkTypeEnum state = 1;
1740 // For multi-sim phones, this distinguishes between the sim cards.
1741 optional int32 sim_slot_index = 2;
1742}
1743
Andrew Chantb56388b2018-03-22 21:07:33 -07001744/**
1745 * Logs the VID and PID of any connected USB devices.
1746 *
1747 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1748 *
1749 * Logged by Vendor.
1750 */
1751message UsbDeviceAttached {
1752 optional int32 vid = 1;
1753 optional int32 pid = 2;
1754 optional bool has_audio = 3;
1755 optional bool has_hid = 4;
1756 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001757 enum State {
1758 STATE_DISCONNECTED = 0;
1759 STATE_CONNECTED = 1;
1760 }
1761 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001762 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001763}
1764
Tej Singheee317b2018-03-07 19:28:05 -08001765
Tej Singhdd7bd352018-02-09 19:33:15 -08001766/**
Tej Singh5d991e12018-03-09 19:48:11 -08001767 * Logs when Bluetooth is enabled and disabled.
1768 *
1769 * Logged from:
1770 * services/core/java/com/android/server/BluetoothManagerService.java
1771 */
1772message BluetoothEnabledStateChanged {
1773 repeated AttributionNode attribution_node = 1;
1774 // Whether or not bluetooth is enabled on the device.
1775 enum State {
1776 UNKNOWN = 0;
1777 ENABLED = 1;
1778 DISABLED = 2;
1779 }
1780 optional State state = 2;
1781 // The reason for being enabled/disabled.
1782 // Eg. Airplane mode, crash, application request.
1783 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1784 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001785 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001786}
1787
1788/**
Jack Hed9837c82019-01-09 01:19:13 -08001789 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001790 *
1791 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001792 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1793 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001794 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001795 */
1796message BluetoothConnectionStateChanged {
1797 // The state of the connection.
1798 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1799 optional android.bluetooth.ConnectionStateEnum state = 1;
1800 // An identifier that can be used to match connect and disconnect events.
1801 // Currently is last two bytes of a hash of a device level ID and
1802 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001803 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001804 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001805 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1806 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001807 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001808 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001809 // An identifier that can be used to match events for this device.
1810 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1811 // Salt: Randomly generated 256 bit value
1812 // Hash algorithm: HMAC-SHA256
1813 // Size: 32 byte
1814 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001815 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001816 // An identifier that can be used to match events for this device.
1817 // The incremental identifier is locally generated and guaranteed not derived
1818 // from any globally unique hardware id.
1819 // For paired devices, it stays consistent between Bluetooth toggling for the
1820 // same remote device.
1821 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1822 // session for the same remote device.
1823 // Default: 0 if the device's metric id is unknown.
1824 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001825}
1826
1827/**
1828 * Logs when a Bluetooth device connects and disconnects over ACL
1829 *
1830 * Logged from:
1831 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1832 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001833 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001834 */
1835message BluetoothAclConnectionStateChanged {
1836 // An identifier that can be used to match events for this device.
1837 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1838 // Salt: Randomly generated 256 bit value
1839 // Hash algorithm: HMAC-SHA256
1840 // Size: 32 byte
1841 // Default: null or empty if the device identifier is not known
1842 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1843 // The state of the connection.
1844 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1845 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001846 // An identifier that can be used to match events for this device.
1847 // The incremental identifier is locally generated and guaranteed not derived
1848 // from any globally unique hardware id.
1849 // For paired devices, it stays consistent between Bluetooth toggling for the
1850 // same remote device.
1851 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1852 // session for the same remote device.
1853 // Default: 0 if the device's metric id is unknown.
1854 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001855}
1856
1857/**
1858 * Logs when a Bluetooth device connects and disconnects over SCO
1859 *
1860 * Logged from:
1861 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1862 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1863 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001864 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001865 */
1866message BluetoothScoConnectionStateChanged {
1867 // An identifier that can be used to match events for this device.
1868 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1869 // Salt: Randomly generated 256 bit value
1870 // Hash algorithm: HMAC-SHA256
1871 // Size: 32 byte
1872 // Default: null or empty if the device identifier is not known
1873 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1874 // The state of the connection.
1875 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1876 optional android.bluetooth.ConnectionStateEnum state = 2;
1877 // Codec used for this SCO connection
1878 // Default: UNKNOWN
1879 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001880 // An identifier that can be used to match events for this device.
1881 // The incremental identifier is locally generated and guaranteed not derived
1882 // from any globally unique hardware id.
1883 // For paired devices, it stays consistent between Bluetooth toggling for the
1884 // same remote device.
1885 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1886 // session for the same remote device.
1887 // Default: 0 if the device's metric id is unknown.
1888 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001889}
1890
Jack Hec27040a2019-01-09 20:54:41 -08001891/**
1892 * Logged when active device of a profile changes
1893 *
1894 * Logged from:
1895 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1896 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1897 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1898 */
1899message BluetoothActiveDeviceChanged {
1900 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1901 // From android.bluetooth.BluetoothProfile
1902 optional int32 bt_profile = 1;
1903 // An identifier that can be used to match events for this new active device.
1904 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1905 // Salt: Randomly generated 256 bit value
1906 // Hash algorithm: HMAC-SHA256
1907 // Size: 32 byte
1908 // Default: null or empty if there is no active device for this profile
1909 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001910 // An identifier that can be used to match events for this device.
1911 // The incremental identifier is locally generated and guaranteed not derived
1912 // from any globally unique hardware id.
1913 // For paired devices, it stays consistent between Bluetooth toggling for the
1914 // same remote device.
1915 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1916 // session for the same remote device.
1917 // Default: 0 if the device's metric id is unknown.
1918 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001919}
1920
Jack Heab86dbd22018-12-18 15:43:27 -08001921// Logs when there is an event affecting Bluetooth device's link layer connection.
1922// - This event is triggered when there is a related HCI command or event
1923// - Users of this metrics can deduce Bluetooth device's connection state from these events
1924// - HCI commands are logged before the command is sent, after receiving command status, and after
1925// receiving command complete
1926// - HCI events are logged when they arrive
1927//
1928// Low level log from system/bt
1929//
1930// Bluetooth classic commands:
1931// - CMD_CREATE_CONNECTION
1932// - CMD_DISCONNECT
1933// - CMD_CREATE_CONNECTION_CANCEL
1934// - CMD_ACCEPT_CONNECTION_REQUEST
1935// - CMD_REJECT_CONNECTION_REQUEST
1936// - CMD_SETUP_ESCO_CONNECTION
1937// - CMD_ACCEPT_ESCO_CONNECTION
1938// - CMD_REJECT_ESCO_CONNECTION
1939// - CMD_ENH_SETUP_ESCO_CONNECTION
1940// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1941//
1942// Bluetooth low energy commands:
1943// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1944// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1945// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1946// - CMD_BLE_CLEAR_WHITE_LIST
1947// - CMD_BLE_ADD_WHITE_LIST
1948// - CMD_BLE_REMOVE_WHITE_LIST
1949//
1950// Bluetooth classic events:
1951// - EVT_CONNECTION_COMP
1952// - EVT_CONNECTION_REQUEST
1953// - EVT_DISCONNECTION_COMP
1954// - EVT_ESCO_CONNECTION_COMP
1955// - EVT_ESCO_CONNECTION_CHANGED
1956//
1957// Bluetooth low energy meta events:
1958// - BLE_EVT_CONN_COMPLETE_EVT
1959// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1960//
1961// Next tag: 10
1962message BluetoothLinkLayerConnectionEvent {
1963 // An identifier that can be used to match events for this device.
1964 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1965 // Salt: Randomly generated 256 bit value
1966 // Hash algorithm: HMAC-SHA256
1967 // Size: 32 byte
1968 // Default: null or empty if the device identifier is not known
1969 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1970 // Connection handle of this connection if available
1971 // Range: 0x0000 - 0x0EFF (12 bits)
1972 // Default: 0xFFFF if the handle is unknown
1973 optional int32 connection_handle = 2;
1974 // Direction of the link
1975 // Default: DIRECTION_UNKNOWN
1976 optional android.bluetooth.DirectionEnum direction = 3;
1977 // Type of this link
1978 // Default: LINK_TYPE_UNKNOWN
1979 optional android.bluetooth.LinkTypeEnum type = 4;
1980
1981 // Reason metadata for this link layer connection event, rules for interpretation:
1982 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1983 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1984 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1985 // set and valid, ignore hci_ble_event
1986
1987 // HCI command associated with this event
1988 // Default: CMD_UNKNOWN
1989 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1990 // HCI event associated with this event
1991 // Default: EVT_UNKNOWN
1992 optional android.bluetooth.hci.EventEnum hci_event = 6;
1993 // HCI BLE meta event associated with this event
1994 // Default: BLE_EVT_UNKNOWN
1995 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1996 // HCI command status code if this is triggerred by hci_cmd
1997 // Default: STATUS_UNKNOWN
1998 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1999 // HCI reason code associated with this event
2000 // Default: STATUS_UNKNOWN
2001 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002002 // An identifier that can be used to match events for this device.
2003 // The incremental identifier is locally generated and guaranteed not derived
2004 // from any globally unique hardware id.
2005 // For paired devices, it stays consistent between Bluetooth toggling for the
2006 // same remote device.
2007 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2008 // session for the same remote device.
2009 // Default: 0 if the device's metric id is unknown.
2010 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002011}
2012
Howard Roe103fe22019-01-17 16:52:16 -08002013/**
2014 * Logs when a module is rolled back by Watchdog.
2015 *
2016 * Logged from: Rollback Manager
2017 */
2018message WatchdogRollbackOccurred {
2019 enum RollbackType {
2020 UNKNOWN = 0;
2021 ROLLBACK_INITIATE = 1;
2022 ROLLBACK_SUCCESS = 2;
2023 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002024 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002025 }
2026 optional RollbackType rollback_type = 1;
2027
2028 optional string package_name = 2;
2029
2030 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002031
2032 enum RollbackReasonType {
2033 REASON_UNKNOWN = 0;
2034 REASON_NATIVE_CRASH = 1;
2035 REASON_EXPLICIT_HEALTH_CHECK = 2;
2036 REASON_APP_CRASH = 3;
2037 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002038 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002039 }
2040 optional RollbackReasonType rollback_reason = 4;
2041
2042 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2043 // is initiated. Empty if the package is unknown.
2044 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002045
2046 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002047}
2048
Jack Hec27040a2019-01-09 20:54:41 -08002049/**
2050 * Logs when there is a change in Bluetooth A2DP playback state
2051 *
2052 * Logged from:
2053 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2054 */
2055message BluetoothA2dpPlaybackStateChanged {
2056 // An identifier that can be used to match events for this device.
2057 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2058 // Salt: Randomly generated 256 bit value
2059 // Hash algorithm: HMAC-SHA256
2060 // Size: 32 byte
2061 // Default: null or empty if the device identifier is not known
2062 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2063 // Current playback state
2064 // Default: PLAYBACK_STATE_UNKNOWN
2065 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2066 // Current audio coding mode
2067 // Default: AUDIO_CODING_MODE_UNKNOWN
2068 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002069 // An identifier that can be used to match events for this device.
2070 // The incremental identifier is locally generated and guaranteed not derived
2071 // from any globally unique hardware id.
2072 // For paired devices, it stays consistent between Bluetooth toggling for the
2073 // same remote device.
2074 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2075 // session for the same remote device.
2076 // Default: 0 if the device's metric id is unknown.
2077 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002078}
2079
2080/**
2081 * Logs when there is a change in A2DP codec config for a particular remote device
2082 *
2083 * Logged from:
2084 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2085 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2086 */
2087message BluetoothA2dpCodecConfigChanged {
2088 // An identifier that can be used to match events for this device.
2089 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2090 // Salt: Randomly generated 256 bit value
2091 // Hash algorithm: HMAC-SHA256
2092 // Size: 32 byte
2093 // Default: null or empty if the device identifier is not known
2094 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2095 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2096 // Default SOURCE_CODEC_TYPE_INVALID
2097 optional int32 codec_type = 2;
2098 // Codec priroity, the higher the more preferred, -1 for disabled
2099 // Default: CODEC_PRIORITY_DEFAULT
2100 optional int32 codec_priority = 3;
2101 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2102 // Default: SAMPLE_RATE_NONE
2103 optional int32 sample_rate = 4;
2104 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2105 // Default: BITS_PER_SAMPLE_NONE
2106 optional int32 bits_per_sample = 5;
2107 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2108 // Default: CHANNEL_MODE_NONE
2109 optional int32 channel_mode = 6;
2110 // Codec specific values
2111 // Default 0
2112 optional int64 codec_specific_1 = 7;
2113 optional int64 codec_specific_2 = 8;
2114 optional int64 codec_specific_3 = 9;
2115 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002116 // An identifier that can be used to match events for this device.
2117 // The incremental identifier is locally generated and guaranteed not derived
2118 // from any globally unique hardware id.
2119 // For paired devices, it stays consistent between Bluetooth toggling for the
2120 // same remote device.
2121 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2122 // session for the same remote device.
2123 // Default: 0 if the device's metric id is unknown.
2124 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002125}
2126
2127/**
2128 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2129 * Each codec's capability is logged separately due to statsd restriction
2130 *
2131 * Logged from:
2132 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2133 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2134 */
2135message BluetoothA2dpCodecCapabilityChanged {
2136 // An identifier that can be used to match events for this device.
2137 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2138 // Salt: Randomly generated 256 bit value
2139 // Hash algorithm: HMAC-SHA256
2140 // Size: 32 byte
2141 // Default: null or empty if the device identifier is not known
2142 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2143 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2144 // Default SOURCE_CODEC_TYPE_INVALID
2145 optional int32 codec_type = 2;
2146 // Codec priroity, the higher the more preferred, -1 for disabled
2147 // Default: CODEC_PRIORITY_DEFAULT
2148 optional int32 codec_priority = 3;
2149 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2150 // in BluetoothCodecConfig
2151 // Default: empty and SAMPLE_RATE_NONE for individual item
2152 optional int32 sample_rate = 4;
2153 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2154 // in BluetoothCodecConfig
2155 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2156 optional int32 bits_per_sample = 5;
2157 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2158 // BluetoothCodecConfig
2159 // Default: empty and CHANNEL_MODE_NONE for individual item
2160 optional int32 channel_mode = 6;
2161 // Codec specific values
2162 // Default 0
2163 optional int64 codec_specific_1 = 7;
2164 optional int64 codec_specific_2 = 8;
2165 optional int64 codec_specific_3 = 9;
2166 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002167 // An identifier that can be used to match events for this device.
2168 // The incremental identifier is locally generated and guaranteed not derived
2169 // from any globally unique hardware id.
2170 // For paired devices, it stays consistent between Bluetooth toggling for the
2171 // same remote device.
2172 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2173 // session for the same remote device.
2174 // Default: 0 if the device's metric id is unknown.
2175 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002176}
2177
2178/**
2179 * Logs when A2DP failed to read from PCM source.
2180 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2181 *
2182 * Logged from:
2183 * system/bt
2184 */
2185message BluetoothA2dpAudioUnderrunReported {
2186 // An identifier that can be used to match events for this device.
2187 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2188 // Salt: Randomly generated 256 bit value
2189 // Hash algorithm: HMAC-SHA256
2190 // Size: 32 byte
2191 // Default: null or empty if the device identifier is not known
2192 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2193 // Encoding interval in nanoseconds
2194 // Default: 0
2195 optional int64 encoding_interval_nanos = 2;
2196 // Number of bytes of PCM data that could not be read from the source
2197 // Default: 0
2198 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002199 // An identifier that can be used to match events for this device.
2200 // The incremental identifier is locally generated and guaranteed not derived
2201 // from any globally unique hardware id.
2202 // For paired devices, it stays consistent between Bluetooth toggling for the
2203 // same remote device.
2204 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2205 // session for the same remote device.
2206 // Default: 0 if the device's metric id is unknown.
2207 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002208}
2209
2210/**
2211 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2212 * buffer queue is full and we have to drop data
2213 *
2214 * Logged from:
2215 * system/bt
2216 */
2217message BluetoothA2dpAudioOverrunReported {
2218 // An identifier that can be used to match events for this device.
2219 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2220 // Salt: Randomly generated 256 bit value
2221 // Hash algorithm: HMAC-SHA256
2222 // Size: 32 byte
2223 // Default: null or empty if the device identifier is not known
2224 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2225 // Encoding interval in nanoseconds
2226 // Default: 0
2227 optional int64 encoding_interval_nanos = 2;
2228 // Number of buffers dropped in this event
2229 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2230 // Default: 0
2231 optional int32 num_dropped_buffers = 3;
2232 // Number of encoded buffers dropped in this event
2233 // Default 0
2234 optional int32 num_dropped_encoded_frames = 4;
2235 // Number of encoded bytes dropped in this event
2236 // Default: 0
2237 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002238 // An identifier that can be used to match events for this device.
2239 // The incremental identifier is locally generated and guaranteed not derived
2240 // from any globally unique hardware id.
2241 // For paired devices, it stays consistent between Bluetooth toggling for the
2242 // same remote device.
2243 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2244 // session for the same remote device.
2245 // Default: 0 if the device's metric id is unknown.
2246 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002247}
2248
2249/**
2250 * Logs when we receive reports regarding a device's RSSI value
2251 *
2252 * Logged from:
2253 * system/bt
2254 */
2255message BluetoothDeviceRssiReported {
2256 // An identifier that can be used to match events for this device.
2257 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2258 // Salt: Randomly generated 256 bit value
2259 // Hash algorithm: HMAC-SHA256
2260 // Size: 32 byte
2261 // Default: null or empty if the device identifier is not known
2262 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2263 // Connection handle of this connection if available
2264 // Range: 0x0000 - 0x0EFF (12 bits)
2265 // Default: 0xFFFF if the handle is unknown
2266 optional int32 connection_handle = 2;
2267 // HCI command status code if this is triggerred by hci_cmd
2268 // Default: STATUS_UNKNOWN
2269 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2270 // BR/EDR
2271 // Range: -128 ≤ N ≤ 127 (signed integer)
2272 // Units: dB
2273 // LE:
2274 // Range: -127 to 20, 127 (signed integer)
2275 // Units: dBm
2276 // Invalid when an out of range value is reported
2277 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002278 // An identifier that can be used to match events for this device.
2279 // The incremental identifier is locally generated and guaranteed not derived
2280 // from any globally unique hardware id.
2281 // For paired devices, it stays consistent between Bluetooth toggling for the
2282 // same remote device.
2283 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2284 // session for the same remote device.
2285 // Default: 0 if the device's metric id is unknown.
2286 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002287}
2288
2289/**
2290 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2291 *
2292 * Logged from:
2293 * system/bt
2294 */
2295message BluetoothDeviceFailedContactCounterReported {
2296 // An identifier that can be used to match events for this device.
2297 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2298 // Salt: Randomly generated 256 bit value
2299 // Hash algorithm: HMAC-SHA256
2300 // Size: 32 byte
2301 // Default: null or empty if the device identifier is not known
2302 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2303 // Connection handle of this connection if available
2304 // Range: 0x0000 - 0x0EFF (12 bits)
2305 // Default: 0xFFFF if the handle is unknown
2306 optional int32 connection_handle = 2;
2307 // HCI command status code if this is triggerred by hci_cmd
2308 // Default: STATUS_UNKNOWN
2309 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2310 // Number of consecutive failed contacts for a connection corresponding to the Handle
2311 // Range: uint16_t, 0-0xFFFF
2312 // Default: 0xFFFFF
2313 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002314 // An identifier that can be used to match events for this device.
2315 // The incremental identifier is locally generated and guaranteed not derived
2316 // from any globally unique hardware id.
2317 // For paired devices, it stays consistent between Bluetooth toggling for the
2318 // same remote device.
2319 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2320 // session for the same remote device.
2321 // Default: 0 if the device's metric id is unknown.
2322 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002323}
2324
2325/**
2326 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2327 *
2328 * Logged from:
2329 * system/bt
2330 */
2331message BluetoothDeviceTxPowerLevelReported {
2332 // An identifier that can be used to match events for this device.
2333 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2334 // Salt: Randomly generated 256 bit value
2335 // Hash algorithm: HMAC-SHA256
2336 // Size: 32 byte
2337 // Default: null or empty if the device identifier is not known
2338 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2339 // Connection handle of this connection if available
2340 // Range: 0x0000 - 0x0EFF (12 bits)
2341 // Default: 0xFFFF if the handle is unknown
2342 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002343 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002344 // Default: STATUS_UNKNOWN
2345 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2346 // Range: -30 ≤ N ≤ 20
2347 // Units: dBm
2348 // Invalid when an out of range value is reported
2349 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002350 // An identifier that can be used to match events for this device.
2351 // The incremental identifier is locally generated and guaranteed not derived
2352 // from any globally unique hardware id.
2353 // For paired devices, it stays consistent between Bluetooth toggling for the
2354 // same remote device.
2355 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2356 // session for the same remote device.
2357 // Default: 0 if the device's metric id is unknown.
2358 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002359}
Jack Heab86dbd22018-12-18 15:43:27 -08002360
Tej Singh5d991e12018-03-09 19:48:11 -08002361/**
Jack He1021a612019-01-20 21:22:46 -08002362 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2363 * receiving an HCI command from the host
2364 *
2365 * Logged from: system/bt
2366 */
2367message BluetoothHciTimeoutReported {
2368 // HCI command associated with this event
2369 // Default: CMD_UNKNOWN
2370 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2371}
2372
2373/**
2374 * Logs when we receive Bluetooth Link Quality Report event from the controller
2375 * See Android Bluetooth HCI specification for more details
2376 *
2377 * Note: all count and bytes field are counted since last event
2378 *
2379 * Logged from: system/bt
2380 */
2381message BluetoothQualityReportReported {
2382 // Quality report ID
2383 // Original type: uint8_t
2384 // Default: BQR_ID_UNKNOWN
2385 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2386 // Packet type of the connection
2387 // Original type: uint8_t
2388 // Default: BQR_PACKET_TYPE_UNKNOWN
2389 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2390 // Connection handle of the connection
2391 // Original type: uint16_t
2392 optional int32 connection_handle = 3;
2393 // Performing Role for the connection
2394 // Original type: uint8_t
2395 optional int32 connection_role = 4;
2396 // Current Transmit Power Level for the connection. This value is the same as the controller's
2397 // response to the HCI_Read_Transmit_Power_Level HCI command
2398 // Original type: uint8_t
2399 optional int32 tx_power_level = 5;
2400 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2401 // absolute receiver signal strength value
2402 // Original type: int8_t
2403 optional int32 rssi = 6;
2404 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2405 // channels used by the link currently
2406 // Original type: uint8_t
2407 optional int32 snr = 7;
2408 // Indicates the number of unused channels in AFH_channel_map
2409 // Original type: uint8_t
2410 optional int32 unused_afh_channel_count = 8;
2411 // Indicates the number of the channels which are interfered and quality is bad but are still
2412 // selected for AFH
2413 // Original type: uint8_t
2414 optional int32 afh_select_unideal_channel_count = 9;
2415 // Current Link Supervision Timeout Setting
2416 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2417 // Original type: uint16_t
2418 optional int32 lsto = 10;
2419 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2420 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2421 // 0x01 (Piconet Clock)
2422 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2423 // Original type: uint32_t
2424 optional int64 connection_piconet_clock = 11;
2425 // The count of retransmission
2426 // Original type: uint32_t
2427 optional int64 retransmission_count = 12;
2428 // The count of no RX
2429 // Original type: uint32_t
2430 optional int64 no_rx_count = 13;
2431 // The count of NAK (Negative Acknowledge)
2432 // Original type: uint32_t
2433 optional int64 nak_count = 14;
2434 // Controller timestamp of last TX ACK
2435 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2436 // Original type: uint32_t
2437 optional int64 last_tx_ack_timestamp = 15;
2438 // The count of Flow-off (STOP)
2439 // Original type: uint32_t
2440 optional int64 flow_off_count = 16;
2441 // Controller timestamp of last Flow-on (GO)
2442 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2443 // Original type: uint32_t
2444 optional int64 last_flow_on_timestamp = 17;
2445 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2446 // Original type: uint32_t
2447 optional int64 buffer_overflow_bytes = 18;
2448 // Buffer underflow count (in byte) since last event
2449 // Original type: uint32_t
2450 optional int64 buffer_underflow_bytes = 19;
2451}
2452
2453/**
2454 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2455 *
2456 * Notes:
2457 * - Each event can be partially filled as we might learn different pieces of device
2458 * information at different time
2459 * - Multiple device info events can be combined to give more complete picture
2460 * - When multiple device info events tries to describe the same information, the
2461 * later one wins
2462 *
2463 * Logged from:
2464 * packages/apps/Bluetooth
2465 */
Jack Heaea26982019-04-04 11:19:48 -07002466message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002467 // An identifier that can be used to match events for this device.
2468 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2469 // Salt: Randomly generated 256 bit value
2470 // Hash algorithm: HMAC-SHA256
2471 // Size: 32 byte
2472 // Default: null or empty if the device identifier is not known
2473 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2474 // Where is this device info obtained from
2475 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2476 // Name of the data source
2477 // For EXTERNAL: package name of the data source
2478 // For INTERNAL: null for general case, component name otherwise
2479 optional string source_name = 3;
2480 // Name of the manufacturer of this device
2481 optional string manufacturer = 4;
2482 // Model of this device
2483 optional string model = 5;
2484 // Hardware version of this device
2485 optional string hardware_version = 6;
2486 // Software version of this device
2487 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002488 // An identifier that can be used to match events for this device.
2489 // The incremental identifier is locally generated and guaranteed not derived
2490 // from any globally unique hardware id.
2491 // For paired devices, it stays consistent between Bluetooth toggling for the
2492 // same remote device.
2493 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2494 // session for the same remote device.
2495 // Default: 0 if the device's metric id is unknown.
2496 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002497}
2498
2499/**
2500 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2501 * device, as documented by the Bluetooth Core HCI specification
2502 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2503 * Vol 2, Part E, Page 1118
2504 *
2505 * Logged from:
2506 * system/bt
2507 */
2508message BluetoothRemoteVersionInfoReported {
2509 // Connection handle of the connection
2510 // Original type: uint16_t
2511 optional int32 connection_handle = 1;
2512 // HCI command status code
2513 // Default: STATUS_UNKNOWN
2514 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2515 // 1 byte Version of current LMP in the remote controller
2516 optional int32 lmp_version = 3;
2517 // 2 bytes LMP manufacturer code of the remote controller
2518 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2519 optional int32 lmp_manufacturer_code = 4;
2520 // 4 bytes subversion of the LMP in the remote controller
2521 optional int32 lmp_subversion = 5;
2522}
2523
2524/**
2525 * Logs when certain Bluetooth SDP attributes are discovered
2526 * Constant definitions are from:
2527 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2528 *
2529 * Current logged attributes:
2530 * - BluetoothProfileDescriptorList
2531 * - Supported Features Bitmask
2532 *
2533 * Logged from:
2534 * system/bt
2535 */
2536message BluetoothSdpAttributeReported {
2537 // An identifier that can be used to match events for this device.
2538 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2539 // Salt: Randomly generated 256 bit value
2540 // Hash algorithm: HMAC-SHA256
2541 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2542 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2543 // Original type: uint16_t
2544 optional int32 protocol_uuid = 2;
2545 // Short form UUIDs used to identify Bluetooth SDP attribute types
2546 // Original type: uint16_t
2547 optional int32 attribute_id = 3;
2548 // Attribute value for the particular attribute
2549 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002550 // An identifier that can be used to match events for this device.
2551 // The incremental identifier is locally generated and guaranteed not derived
2552 // from any globally unique hardware id.
2553 // For paired devices, it stays consistent between Bluetooth toggling for the
2554 // same remote device.
2555 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2556 // session for the same remote device.
2557 // Default: 0 if the device's metric id is unknown.
2558 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002559}
2560
2561/**
2562 * Logs when bond state of a Bluetooth device changes
2563 *
2564 * Logged from:
2565 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2566 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2567 */
2568message BluetoothBondStateChanged {
2569 // An identifier that can be used to match events for this device.
2570 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2571 // Salt: Randomly generated 256 bit value
2572 // Hash algorithm: HMAC-SHA256
2573 // Size: 32 byte
2574 // Default: null or empty if the device identifier is not known
2575 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2576 // Preferred transport type to remote dual mode device
2577 // Default: TRANSPORT_AUTO means no preference
2578 optional android.bluetooth.TransportTypeEnum transport = 2;
2579 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2580 // Default: UNKNOWN
2581 optional android.bluetooth.DeviceTypeEnum type = 3;
2582 // Current bond state (NONE, BONDING, BONDED)
2583 // Default: BOND_STATE_UNKNOWN
2584 optional android.bluetooth.BondStateEnum bond_state = 4;
2585 // Bonding sub state
2586 // Default: BOND_SUB_STATE_UNKNOWN
2587 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2588 // Unbond Reason
2589 // Default: UNBOND_REASON_UNKNOWN
2590 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002591 // An identifier that can be used to match events for this device.
2592 // The incremental identifier is locally generated and guaranteed not derived
2593 // from any globally unique hardware id.
2594 // For paired devices, it stays consistent between Bluetooth toggling for the
2595 // same remote device.
2596 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2597 // session for the same remote device.
2598 // Default: 0 if the device's metric id is unknown.
2599 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002600}
2601
2602/**
2603 * Logs there is an event related Bluetooth classic pairing
2604 *
2605 * Logged from:
2606 * system/bt
2607 */
2608message BluetoothClassicPairingEventReported {
2609 // An identifier that can be used to match events for this device.
2610 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2611 // Salt: Randomly generated 256 bit value
2612 // Hash algorithm: HMAC-SHA256
2613 // Size: 32 byte
2614 // Default: null or empty if the device identifier is not known
2615 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2616 // Connection handle of this connection if available
2617 // Range: 0x0000 - 0x0EFF (12 bits)
2618 // Default: 0xFFFF if the handle is unknown
2619 optional int32 connection_handle = 2;
2620 // HCI command associated with this event
2621 // Default: CMD_UNKNOWN
2622 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2623 // HCI event associated with this event
2624 // Default: EVT_UNKNOWN
2625 optional android.bluetooth.hci.EventEnum hci_event = 4;
2626 // HCI command status code if this is triggerred by hci_cmd
2627 // Default: STATUS_UNKNOWN
2628 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2629 // HCI reason code associated with this event
2630 // Default: STATUS_UNKNOWN
2631 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002632 // A status value related to this specific event
2633 // Default: 0
2634 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002635 // An identifier that can be used to match events for this device.
2636 // The incremental identifier is locally generated and guaranteed not derived
2637 // from any globally unique hardware id.
2638 // For paired devices, it stays consistent between Bluetooth toggling for the
2639 // same remote device.
2640 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2641 // session for the same remote device.
2642 // Default: 0 if the device's metric id is unknown.
2643 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002644}
2645
2646/**
2647 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2648 *
2649 * Logged from:
2650 * system/bt
2651 */
2652message BluetoothSmpPairingEventReported {
2653 // An identifier that can be used to match events for this device.
2654 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2655 // Salt: Randomly generated 256 bit value
2656 // Hash algorithm: HMAC-SHA256
2657 // Size: 32 byte
2658 // Default: null or empty if the device identifier is not known
2659 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2660 // SMP command sent or received over L2CAP
2661 // Default: CMD_UNKNOWN
2662 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2663 // Whether this command is sent or received
2664 // Default: DIRECTION_UNKNOWN
2665 optional android.bluetooth.DirectionEnum direction = 3;
2666 // SMP failure reason code
2667 // Default: PAIRING_FAIL_REASON_DEFAULT
2668 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002669 // An identifier that can be used to match events for this device.
2670 // The incremental identifier is locally generated and guaranteed not derived
2671 // from any globally unique hardware id.
2672 // For paired devices, it stays consistent between Bluetooth toggling for the
2673 // same remote device.
2674 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2675 // session for the same remote device.
2676 // Default: 0 if the device's metric id is unknown.
2677 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002678}
2679
2680/**
Jack He815cdba2019-01-30 17:24:55 -08002681 * Logs when a Bluetooth socket’s connection state changed
2682 *
2683 * Logged from:
2684 * system/bt
2685 */
2686message BluetoothSocketConnectionStateChanged {
2687 // An identifier that can be used to match events for this device.
2688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2689 // Salt: Randomly generated 256 bit value
2690 // Hash algorithm: HMAC-SHA256
2691 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002692 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002693 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002694 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002695 // Default 0 when unknown or don't care
2696 optional int32 port = 2;
2697 // Socket type as mentioned in
2698 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2699 // Default: SOCKET_TYPE_UNKNOWN
2700 optional android.bluetooth.SocketTypeEnum type = 3;
2701 // Socket connection state
2702 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2703 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2704 // Number of bytes sent to remote device during this connection
2705 optional int64 tx_bytes = 5;
2706 // Number of bytes received from remote device during this connection
2707 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002708 // Socket owner's UID
2709 optional int32 uid = 7 [(is_uid) = true];
2710 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2711 // |port| must be spawned by |server_port|
2712 // Default 0 when unknown or don't care
2713 optional int32 server_port = 8;
2714 // Whether this is a server listener socket
2715 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002716 // An identifier that can be used to match events for this device.
2717 // The incremental identifier is locally generated and guaranteed not derived
2718 // from any globally unique hardware id.
2719 // For paired devices, it stays consistent between Bluetooth toggling for the
2720 // same remote device.
2721 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2722 // session for the same remote device.
2723 // Default: 0 if the device's metric id is unknown.
2724 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002725}
2726
2727/**
Jack He71426802019-04-02 13:32:52 -07002728 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2729 *
2730 * Logged from:
2731 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2732 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2733 *
2734 */
2735message BluetoothClassOfDeviceReported {
2736 // An identifier that can be used to match events for this device.
2737 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2738 // Salt: Randomly generated 256 bit value
2739 // Hash algorithm: HMAC-SHA256
2740 // Size: 32 byte
2741 // Default: null or empty if this is a server listener socket
2742 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2743 // Class of Device (CoD) value including both Major, Minor device class and service class
2744 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2745 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2746 // Default: 0
2747 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002748 // An identifier that can be used to match events for this device.
2749 // The incremental identifier is locally generated and guaranteed not derived
2750 // from any globally unique hardware id.
2751 // For paired devices, it stays consistent between Bluetooth toggling for the
2752 // same remote device.
2753 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2754 // session for the same remote device.
2755 // Default: 0 if the device's metric id is unknown.
2756 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002757}
2758
2759/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002760 * Logs when something is plugged into or removed from the USB-C connector.
2761 *
2762 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002763 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002764 */
2765message UsbConnectorStateChanged {
2766 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002767 STATE_DISCONNECTED = 0;
2768 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002769 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002770 optional State state = 1
2771 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2772 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002773 // Last active session in ms.
2774 // 0 when the port is in connected state.
2775 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002776}
2777
2778/**
2779 * Logs the reported speaker impedance.
2780 *
2781 * Logged from:
2782 * Vendor audio implementation.
2783 */
2784message SpeakerImpedanceReported {
2785 optional int32 speaker_location = 1;
2786 optional int32 impedance = 2;
2787}
2788
2789/**
2790 * Logs the report of a failed hardware.
2791 *
2792 * Logged from:
2793 * Vendor HALs.
2794 *
2795 */
2796message HardwareFailed {
2797 enum HardwareType {
2798 HARDWARE_FAILED_UNKNOWN = 0;
2799 HARDWARE_FAILED_MICROPHONE = 1;
2800 HARDWARE_FAILED_CODEC = 2;
2801 HARDWARE_FAILED_SPEAKER = 3;
2802 HARDWARE_FAILED_FINGERPRINT = 4;
2803 }
2804 optional HardwareType hardware_type = 1;
2805
Maggie White6dcd8572019-01-31 14:11:50 -08002806 /**
2807 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002808 * the same hardware_type. The specific locations are vendor defined integers,
2809 * referring to board-specific numbering schemes.
2810 */
2811 optional int32 hardware_location = 2;
2812
Maggie White6dcd8572019-01-31 14:11:50 -08002813 /**
2814 * failure_code is specific to the HardwareType of the failed hardware.
2815 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002816 */
Maggie White6dcd8572019-01-31 14:11:50 -08002817 enum HardwareErrorCode {
2818 UNKNOWN = 0;
2819 COMPLETE = 1;
2820 SPEAKER_HIGH_Z = 2;
2821 SPEAKER_SHORT = 3;
2822 FINGERPRINT_SENSOR_BROKEN = 4;
2823 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002824 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002825 }
2826 optional int32 failure_code = 3;
2827}
2828
2829/**
2830 * Log an event when the device has been physically dropped.
2831 * Reported from the /vendor partition.
2832 */
2833message PhysicalDropDetected {
2834 // Confidence that the event was actually a drop, 0 -> 100
2835 optional int32 confidence_pctg = 1;
2836 // Peak acceleration of the drop, in 1/1000s of a g.
2837 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002838 // Duration of freefall in ms
2839 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002840}
2841
2842/**
2843 * Log bucketed battery charge cycles.
2844 *
2845 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002846 * a given charge point. For example, if 10 cycle buckets are
2847 * initialized, bucket 1 is the lowest 1/10th of the battery,
2848 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002849 *
2850 * Logged from:
2851 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2852 */
2853message ChargeCyclesReported {
2854 optional int32 cycle_bucket_1 = 1;
2855 optional int32 cycle_bucket_2 = 2;
2856 optional int32 cycle_bucket_3 = 3;
2857 optional int32 cycle_bucket_4 = 4;
2858 optional int32 cycle_bucket_5 = 5;
2859 optional int32 cycle_bucket_6 = 6;
2860 optional int32 cycle_bucket_7 = 7;
2861 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002862 optional int32 cycle_bucket_9 = 9;
2863 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002864}
2865
2866/**
Howard Roa46b6582018-09-18 16:45:02 -07002867 * Log battery health snapshot.
2868 *
2869 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2870 * are snapshotted periodically over 24hrs.
2871 */
2872message BatteryHealthSnapshot {
2873 enum BatterySnapshotType {
2874 UNKNOWN = 0;
2875 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2876 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2877 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2878 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2879 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2880 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2881 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2882 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2883 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2884 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2885 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2886 }
2887 optional BatterySnapshotType type = 1;
2888 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002889 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002890 // Voltage Battery Voltage, in microVolts.
2891 optional int32 voltage_micro_volt = 3;
2892 // Current Battery current, in microAmps.
2893 optional int32 current_micro_amps = 4;
2894 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2895 optional int32 open_circuit_micro_volt = 5;
2896 // Resistance Battery Resistance, in microOhms.
2897 optional int32 resistance_micro_ohm = 6;
2898 // Level Battery Level, as % of full.
2899 optional int32 level_percent = 7;
2900}
2901
2902/**
2903 * Log slow I/O operations on the primary storage.
2904 */
2905message SlowIo {
2906 // Classifications of IO Operations.
2907 enum IoOperation {
2908 UNKNOWN = 0;
2909 READ = 1;
2910 WRITE = 2;
2911 UNMAP = 3;
2912 SYNC = 4;
2913 }
2914 optional IoOperation operation = 1;
2915
2916 // The number of slow IO operations of this type over 24 hours.
2917 optional int32 count = 2;
2918}
2919
2920/**
2921 * Log battery caused shutdown with the last recorded voltage.
2922 */
2923message BatteryCausedShutdown {
2924 // The last recorded battery voltage prior to shutdown.
2925 optional int32 last_recorded_micro_volt = 1;
2926}
2927
2928/**
Tej Singha72344992019-04-17 18:55:08 -07002929 * Logs when ThermalService receives throttling events.
2930 *
2931 * Logged from:
2932 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2933 */
2934message ThermalThrottlingSeverityStateChanged {
2935 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2936 optional android.os.TemperatureTypeEnum sensor_type = 1;
2937
2938 // The name of the temperature source. Eg. CPU0
2939 optional string sensor_name = 2;
2940
2941 // Temperature in tenths of a degree C.
2942 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2943 optional int32 temperature_deci_celsius = 3;
2944
2945 // Relative severity of the throttling, see enum definition.
2946 optional android.os.ThrottlingSeverityEnum severity = 4;
2947}
2948
2949/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002950 * Logs the duration of a davey (jank of >=700ms) when it occurs
2951 *
2952 * Logged from:
2953 * frameworks/base/libs/hwui/JankTracker.cpp
2954 */
2955message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002956 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002957 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002958
Tej Singhbb8554a2018-01-26 11:59:14 -08002959 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002960 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002961}
2962
2963/**
Bookatze5885242017-10-24 20:10:31 -07002964 * Logs phone signal strength changes.
2965 *
2966 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002967 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002968 */
2969message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002970 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2971 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002972}
2973
Yangster4ccebea2018-10-09 17:09:02 -07002974
2975/**
2976 * Logs when the phone state, sim state or signal strength changes
2977 *
2978 * Logged from:
2979 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2980 */
2981message PhoneServiceStateChanged {
2982 optional android.telephony.ServiceStateEnum state = 1;
2983 optional android.telephony.SimStateEnum sim_state = 2;
2984 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2985}
2986
2987/**
2988 * Logs when the phone becomes on or off.
2989 *
2990 * Logged from:
2991 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2992 */
2993message PhoneStateChanged {
2994 enum State {
2995 OFF = 0;
2996 ON = 1;
2997 }
2998 optional State state = 1;
2999}
3000
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003001message BackGesture {
3002 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003003 DEFAULT_BACK_TYPE = 0;
3004 COMPLETED = 1;
3005 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3006 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3007 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3008 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3009 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3010 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3011 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003012 }
3013 optional BackType type = 1;
3014
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003015 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3016 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3017 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3018 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3019 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3020 optional int32 left_boundary = 8; // left edge width + left inset
3021 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3022
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003023 enum WindowHorizontalLocation {
3024 DEFAULT_LOCATION = 0;
3025 LEFT = 1;
3026 RIGHT = 2;
3027 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003028 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003029}
3030
3031message ExclusionRectStateChanged {
3032 optional string component_name = 1; // if not available, simply packageName
3033 optional int32 requested_height = 2; // px
3034 optional int32 rejected_height = 3; // px
3035
3036 enum WindowHorizontalLocation {
3037 DEFAULT_LOCATION = 0;
3038 LEFT = 1;
3039 RIGHT = 2;
3040 }
3041 optional WindowHorizontalLocation x_location = 4;
3042 optional bool landscape = 5;
3043 optional bool splitscreen = 6;
3044 optional int32 duration_millis = 7;
3045}
3046
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003047/**
3048 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3049 *
3050 * Logged from:
3051 * packages/apps/Launcher3
3052 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003053message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003054 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003055 optional android.stats.launcher.LauncherState src_state = 2;
3056 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003057 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3058 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3059
3060 // The event id (e.g., app launch, drag and drop, long press)
3061 optional int32 event_id = 6;
3062 // The event's source or target id (e.g., icon, task, button)
3063 optional int32 target_id = 7;
3064 // If the target needs to be tracked, use this id field
3065 optional int32 instance_id = 8;
3066 optional int32 uid = 9 [(is_uid) = true];
3067 optional string package_name = 10;
3068 optional string component_name = 11;
3069
3070 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003071 optional int32 grid_x = 12 [default = -1];
3072 optional int32 grid_y = 13 [default = -1];
3073 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003074
3075 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003076 optional int32 grid_x_parent = 15 [default = -1];
3077 optional int32 grid_y_parent = 16 [default = -1];
3078 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003079
3080 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3081 optional int32 hierarchy = 18;
3082
3083 optional bool is_work_profile = 19;
3084
3085 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003086 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003087
3088 // e.g., folderLabelState can be captured in the following two fields
3089 optional int32 from_state = 21;
3090 optional int32 to_state = 22;
3091
3092 // e.g., autofilled or suggested texts that are not user entered
3093 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003094
3095 // e.g., number of contents inside a container (e.g., icons inside a folder)
3096 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003097}
3098
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003099/**
3100 * Used for snapshot of the HomeScreen UI elements
3101 *
3102 * Logged from:
3103 * packages/apps/Launcher3
3104 */
3105message LauncherStaticLayout {
3106 // The event id (e.g., snapshot, drag and drop)
3107 optional int32 event_id = 1;
3108 // The event's source or target id (e.g., icon, shortcut, widget)
3109 optional int32 target_id = 2;
3110 // If the target needs to be tracked, use this id field
3111 optional int32 instance_id = 3;
3112 optional int32 uid = 4 [(is_uid) = true];
3113 optional string package_name = 5;
3114 optional string component_name = 6;
3115
3116 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003117 optional int32 grid_x = 7 [default = -1];
3118 optional int32 grid_y = 8 [default = -1];
3119 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003120
3121 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003122 // e.g., when used with widgets target, use these values for (span_x, span_y)
3123 optional int32 grid_x_parent = 10 [default = -1];
3124 optional int32 grid_y_parent = 11 [default = -1];
3125 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003126
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003127 // UNKNOWN = 0
3128 // HOTSEAT = 1
3129 // WORKSPACE = 2
3130 // FOLDER_HOTSEAT = 3
3131 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003132 optional int32 hierarchy = 13;
3133
3134 optional bool is_work_profile = 14;
3135
3136 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3137 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003138
3139 // e.g., number of icons inside a folder
3140 optional int32 cardinality = 16;
3141
3142 // e.g., (x, y) span of the widget inside homescreen grid system
3143 optional int32 span_x = 17 [default = 1];
3144 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003145}
3146
3147/**
3148 * Logs when Wallpaper or ThemePicker UI has changed.
3149 *
3150 * Logged from:
3151 * packages/apps/ThemePicker
3152 * packages/apps/WallpaperPicker2
3153 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003154message StyleUIChanged {
3155 optional android.stats.style.Action action = 1;
3156 optional int32 color_package_hash = 2;
3157 optional int32 font_package_hash = 3;
3158 optional int32 shape_package_hash = 4;
3159 optional int32 clock_package_hash = 5;
3160 optional int32 launcher_grid = 6;
3161 optional int32 wallpaper_category_hash = 7;
3162 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003163 optional int32 color_preference = 9;
3164 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003165}
3166
David Chenc28b2bb2017-10-24 12:52:52 -07003167/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003168 * Logs when Settings UI has changed.
3169 *
3170 * Logged from:
3171 * packages/apps/Settings
3172 */
3173message SettingsUIChanged {
3174 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003175 * Where this SettingsUIChange event comes from. For example, if
3176 * it's a PAGE_VISIBLE event, where the page is opened from.
3177 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003178 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003179
3180 /**
3181 * What the UI action is.
3182 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003183 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003184
3185 /**
3186 * Where the action is happening
3187 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003188 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003189
3190 /**
3191 * What preference changed in this event.
3192 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003193 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003194
3195 /**
3196 * The new value of the changed preference.
3197 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003198 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003199}
3200
3201/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003202 * Logs basic timing information about touch events.
3203 * Reported at most every 5 minutes while device is being interacted with.
3204 *
3205 * Logged from:
3206 * frameworks/native/services/inputflinger
3207 */
3208message TouchEventReported {
3209 /**
3210 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003211 * and the standard deviation of the time spent processing touchscreen events
3212 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003213 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003214 * On supported devices, the starting point is taken during the hard interrupt inside the
3215 * kernel touch driver. On all other devices, the starting point is taken inside
3216 * the kernel's input event subsystem upon receipt of the input event.
3217 * The ending point is taken inside InputDispatcher, just after the input event
3218 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003219 */
3220 // Minimum value
3221 optional float latency_min_micros = 1;
3222 // Maximum value
3223 optional float latency_max_micros = 2;
3224 // Average value
3225 optional float latency_mean_micros = 3;
3226 // Standard deviation
3227 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003228 // Number of touch events (input_event) in this report
3229 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003230}
3231
3232/**
Philip Quinn0eded622019-01-29 12:46:28 -08003233 * Logs gesture classification and timing information for touch events.
3234 *
3235 * Logged from:
3236 * frameworks/base/core/java/android/view/GestureDetector.java
3237 * frameworks/base/core/java/android/view/View.java
3238 */
3239message TouchGestureClassified {
3240 // The source of the classification (e.g. Java class name).
3241 optional string source = 1;
3242
3243 enum Classification {
3244 UNKNOWN_CLASSIFICATION = 0;
3245 SINGLE_TAP = 1;
3246 DOUBLE_TAP = 2;
3247 LONG_PRESS = 3;
3248 DEEP_PRESS = 4;
3249 SCROLL = 5;
3250 }
3251 // The classification of the gesture.
3252 optional Classification classification = 2;
3253
3254 // The interval from the start of a touch event stream until the
3255 // classification was made.
3256 optional int32 latency_millis = 3;
3257
3258 // The distance from the location of the first touch event to the
3259 // location of the touch event when the classification was made.
3260 optional float displacement_px = 4;
3261}
3262
3263/**
David Chenc28b2bb2017-10-24 12:52:52 -07003264 * Logs that a setting was updated.
3265 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003266 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003267 * The tag and is_default allow resetting of settings to default values based on the specified
3268 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3269 */
3270message SettingChanged {
3271 // The name of the setting.
3272 optional string setting = 1;
3273
3274 // The change being imposed on this setting. May represent a number, eg "3".
3275 optional string value = 2;
3276
3277 // The new value of this setting. For most settings, this is same as value. For some settings,
3278 // value is +X or -X where X represents an element in a set. For example, if the previous value
3279 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3280 // The +/- feature is currently only used for location_providers_allowed.
3281 optional string new_value = 3;
3282
3283 // The previous value of this setting.
3284 optional string prev_value = 4;
3285
3286 // The tag used with the is_default for resetting sets of settings. This is generally null.
3287 optional string tag = 5;
3288
Bookatz90867622018-01-31 15:05:57 -08003289 // True if this setting with tag should be resettable.
3290 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003291
David Chenbd789912018-03-16 17:19:55 -07003292 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003293 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003294
3295 enum ChangeReason {
3296 UPDATED = 1; // Updated can be an insertion or an update.
3297 DELETED = 2;
3298 }
3299 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003300}
Chenjie Yub3dda412017-10-24 13:41:59 -07003301
Chenjie Yu05013b32017-11-21 10:21:41 -08003302/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003303 * Logs activity going to foreground or background
3304 *
3305 * Logged from:
3306 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3307 */
3308message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003309 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003310 optional string pkg_name = 2;
3311 optional string class_name = 3;
3312
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003313 enum State {
3314 BACKGROUND = 0;
3315 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003316 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003317 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003318}
David Chenc8a43242017-10-17 16:23:28 -07003319
3320/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003321 * Logs when a volume entered low Storage state.
3322 * Logged from:
3323 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3324 */
3325message LowStorageStateChanged {
3326 // Volume that ran out of storage.
3327 optional string volume_description = 1;
3328
3329 enum State {
3330 UNKNOWN = 0;
3331 OFF = 1;
3332 ON = 2;
3333 }
3334 optional State state = 2;
3335}
3336
3337/**
3338 * Logs when an app is downgraded.
3339 * Logged from:
3340 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3341 */
3342message AppDowngraded {
3343 optional string package_name = 1;
3344 // Size of the package (all data) before being downgraded.
3345 optional int64 size_in_bytes_before = 2;
3346 // Size of the package (all data) after being downgraded.
3347 optional int64 size_in_bytes_after = 3;
3348
3349 optional bool aggressive = 4;
3350}
3351
3352/**
3353 * Logs when an app is optimized after being downgraded.
3354 * Logged from:
3355 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3356 */
3357message AppOptimizedAfterDowngraded {
3358 optional string package_name = 1;
3359}
3360
3361/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003362 * Logs whenever an app is installed on external storage.
3363 * Logged from:
3364 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3365 */
3366message AppInstallOnExternalStorageReported {
3367 // The type of external storage.
3368 optional android.stats.storage.ExternalStorageType storage_type = 1;
3369 // The name of the package that is installed on the sd card.
3370 optional string package_name = 2;
3371}
3372
3373/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003374 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003375 * Logged from:
3376 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3377 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003378message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003379 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003380
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003382
3383 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003384 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003385 optional string process_name = 3;
3386
3387 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003388 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003389
3390 optional string package_name = 5;
3391
3392 enum InstantApp {
3393 UNAVAILABLE = 0;
3394 FALSE = 1;
3395 TRUE = 2;
3396 }
3397 optional InstantApp is_instant_app = 6;
3398
3399 enum ForegroundState {
3400 UNKNOWN = 0;
3401 BACKGROUND = 1;
3402 FOREGROUND = 2;
3403 }
3404 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003405
3406 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003407}
David Chen9e3808c2017-11-20 17:25:34 -08003408
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003409/**
3410 * Logs when a WTF (What a Terrible Failure) happened.
3411 * Logged from:
3412 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3413 */
3414message WTFOccurred {
3415 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003416
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003417 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003418
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003419 // The name of the process.
3420 // system_server if it is not by an app
3421 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003422
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003423 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003424 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003425
3426 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003427}
3428
3429/**
3430 * Logs when system server reports low memory.
3431 * Logged from:
3432 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3433 */
3434message LowMemReported {
3435}
3436
3437/**
3438 * Logs when an app ANR (App Not Responding) occurs.
3439 * Logged from:
3440 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3441 */
3442message ANROccurred {
3443 optional int32 uid = 1 [(is_uid) = true];
3444
3445 optional string process_name = 2;
3446
3447 optional string short_component_name = 3;
3448
3449 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003450
3451 enum InstantApp {
3452 UNAVAILABLE = 0;
3453 FALSE = 1;
3454 TRUE = 2;
3455 }
3456 optional InstantApp is_instant_app = 5;
3457
3458 enum ForegroundState {
3459 UNKNOWN = 0;
3460 BACKGROUND = 1;
3461 FOREGROUND = 2;
3462 }
3463 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003464
3465 optional android.server.ErrorSource error_source = 7;
3466
3467 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003468}
3469
Bookatza7020bd2018-08-28 16:29:35 -07003470/**
3471 * Logs when the vibrator state changes.
3472 * Logged from:
3473 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3474 */
3475message VibratorStateChanged {
3476 repeated AttributionNode attribution_node = 1;
3477
3478 enum State {
3479 OFF = 0;
3480 ON = 1;
3481 }
3482 optional State state = 2;
3483
3484 // Duration (in milliseconds) requested to keep the vibrator on.
3485 // Only applicable for State == ON.
3486 optional int64 duration_millis = 3;
3487}
3488
David Chen0a368b22017-12-06 16:28:16 -08003489/*
3490 * Allows other apps to push events into statsd.
3491 * Logged from:
3492 * frameworks/base/core/java/android/util/StatsLog.java
3493 */
David Chen0b5c90c2018-01-25 16:51:49 -08003494message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003495 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003496 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003497
3498 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3499 optional int32 label = 2;
3500
3501 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3502 // predicates for the metrics).
3503 enum State {
3504 UNKNOWN = 0;
3505 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3506 STOP = 2;
3507 START = 3;
3508 }
3509 optional State state = 3;
3510}
3511
David Chen9e3808c2017-11-20 17:25:34 -08003512/**
Bookatz7948c872018-09-04 12:58:33 -07003513 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3514 * For example, this could be due to the user manually changing the time.
3515 *
3516 * Logged from:
3517 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3518 */
3519message WallClockTimeShifted {
3520 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3521 optional int64 wall_clock_timestamp_millis = 1;
3522}
3523
3524/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003525 * Logs when statsd detects an anomaly.
3526 *
3527 * Logged from:
3528 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3529 */
3530message AnomalyDetected {
3531 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003532 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003533
Yangster-mac94e197c2018-01-02 16:03:03 -08003534 // Id of the config whose anomaly detection alert fired.
3535 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003536
Yangster-mac94e197c2018-01-02 16:03:03 -08003537 // Id of the alert (i.e. name of the anomaly that was detected).
3538 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003539}
3540
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003541message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003542 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003543 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544
3545 // The app package name.
3546 optional string pkg_name = 2;
3547
3548 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003549 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003550 WARM = 1;
3551 HOT = 2;
3552 COLD = 3;
3553 }
3554 // The transition type.
3555 optional TransitionType type = 3;
3556
3557 // The activity name.
3558 optional string activity_name = 4;
3559
3560 // The name of the calling app. Empty if not set.
3561 optional string calling_pkg_name = 5;
3562
3563 // Whether the app is an instant app.
3564 optional bool is_instant_app = 6;
3565
3566 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003567 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003568
Bookatz80d11a02018-01-16 10:46:35 -08003569 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003570
David Chen0b5c90c2018-01-25 16:51:49 -08003571 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003572 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003573 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003574 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003575 optional int32 bind_application_delay_millis = 11;
3576 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003577
3578 // Empty if not set.
3579 optional string launch_token = 13;
3580
Calin Juravle759fbda2018-02-20 19:52:30 +00003581 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003582 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003583
3584 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003585 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003586}
3587
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003588message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003589 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003590 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003591
3592 // The app package name.
3593 optional string pkg_name = 2;
3594
3595 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003596 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003597 WARM = 1;
3598 HOT = 2;
3599 COLD = 3;
3600 }
3601 // The transition type.
3602 optional TransitionType type = 3;
3603
3604 // The activity name.
3605 optional string activity_name = 4;
3606}
3607
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003608message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003609 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003610 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003611
3612 // The app package name.
3613 optional string pkg_name = 2;
3614
3615 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003616 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003617 WITH_BUNDLE = 1;
3618 WITHOUT_BUNDLE = 2;
3619 }
3620 // The transition type.
3621 optional TransitionType type = 3;
3622
3623 // The activity name.
3624 optional string activity_name = 4;
3625
3626 optional bool transition_process_running = 5;
3627
3628 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003629 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003630}
3631
Bookatz8fcd09a2017-12-18 13:01:10 -08003632/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003633 * Logs a picture-in-picture action
3634 * Logged from:
3635 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3636 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3637 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3638 */
3639message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003640 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003641 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003642
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003643 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003644
Chenjie Yu52cacc62017-12-08 18:11:45 -08003645 enum State {
3646 ENTERED = 1;
3647 EXPANDED_TO_FULL_SCREEN = 2;
3648 MINIMIZED = 3;
3649 DISMISSED = 4;
3650 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003651 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003652}
3653
3654/**
Chenjie Yue8904192017-12-08 19:12:57 -08003655 * Logs overlay action
3656 * Logged from:
3657 * services/core/java/com/android/server/wm/Session.java
3658 */
3659message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003660 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003661
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003662 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003663
3664 optional bool using_alert_window = 3;
3665
3666 enum State {
3667 ENTERED = 1;
3668 EXITED = 2;
3669 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003670 optional State state = 4
3671 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003672}
3673
Adam Bookatz38767932020-02-05 12:13:40 -08003674/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003675 * Logs foreground service starts and stops.
3676 * Note that this is not when a service starts or stops, but when it is
3677 * considered foreground.
3678 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003679 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003680 */
3681message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003682 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003683 // package_name + "/" + class_name
3684 optional string short_name = 2;
3685
3686 enum State {
3687 ENTER = 1;
3688 EXIT = 2;
3689 }
3690 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003691
3692 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3693 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3694 optional bool allow_while_in_use_permission = 4;
3695}
3696
3697/**
3698 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3699 * A foreground service session is any continuous period during which the uid holds at least one
3700 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3701 * Accesses initiated while the uid is in the TOP state are ignored.
3702 * Sessions with no attempted accesses are not logged.
3703 * Logged from
3704 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3705 */
3706message ForegroundServiceAppOpSessionEnded {
3707 optional int32 uid = 1 [(is_uid) = true];
3708
3709 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003710 // Only following four ops are logged
3711 // COARSE_LOCATION = 0
3712 // FINE_LOCATION = 1
3713 // CAMERA = 26
3714 // RECORD_AUDIO = 27
3715 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003716
3717 // The uid's permission mode for accessing the AppOp during this fgs session.
3718 enum Mode {
3719 MODE_UNKNOWN = 0;
3720 MODE_ALLOWED = 1; // Always allowed
3721 MODE_IGNORED = 2; // Denied
3722 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3723 }
3724 optional Mode app_op_mode = 3;
3725
3726 // Number of times this AppOp was requested and allowed.
3727 optional int32 count_ops_accepted = 4;
3728 // Number of times this AppOp was requested but denied.
3729 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003730}
3731
Chenjie Yue8904192017-12-08 19:12:57 -08003732/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003733 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3734 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3735 * attributed back to the parent (host) uid. One example is Chrome.
3736 *
3737 * Logged from:
3738 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3739 */
3740message IsolatedUidChanged {
3741 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003742 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003743 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003744 optional int32 parent_uid = 1;
3745
3746 optional int32 isolated_uid = 2;
3747
3748 // We expect an isolated uid to be removed before if it's used for another parent uid.
3749 enum Event {
3750 REMOVED = 0;
3751 CREATED = 1;
3752 }
3753 optional Event event = 3;
3754}
3755
3756/*
3757 * Logs the reception of an incoming network packet causing the main system to wake up for
3758 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3759 * and processed by WakeupController.cpp.
3760 */
3761message PacketWakeupOccurred {
3762 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3763 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003764 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003765 // The interface name on which the packet was received.
3766 optional string iface = 2;
3767 // The ethertype value of the packet.
3768 optional int32 ethertype = 3;
3769 // String representation of the destination MAC address of the packet.
3770 optional string destination_hardware_address = 4;
3771 // String representation of the source address of the packet if this was an IP packet.
3772 optional string source_ip = 5;
3773 // String representation of the destination address of the packet if this was an IP packet.
3774 optional string destination_ip = 6;
3775 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3776 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3777 // families.
3778 optional int32 ip_next_header = 7;
3779 // The source port if this was a TCP or UDP packet.
3780 optional int32 source_port = 8;
3781 // The destination port if this was a TCP or UDP packet.
3782 optional int32 destination_port = 9;
3783}
3784
3785/*
3786 * Logs the memory stats for an app on startup.
3787 * Logged from:
3788 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3789 */
3790message AppStartMemoryStateCaptured {
3791 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003792 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793
3794 // The process name.
3795 optional string process_name = 2;
3796
3797 // The activity name.
3798 optional string activity_name = 3;
3799
3800 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003801 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003802
3803 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003804 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003805
3806 // RSS
3807 optional int64 rss_in_bytes = 6;
3808
3809 // CACHE
3810 optional int64 cache_in_bytes = 7;
3811
3812 // SWAP
3813 optional int64 swap_in_bytes = 8;
3814}
3815
3816/*
3817 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3818 * for LMK event.
3819 * Logged from:
3820 * system/core/lmkd/lmkd.c
3821 */
3822message LmkStateChanged {
3823 enum State {
3824 UNKNOWN = 0;
3825 START = 1;
3826 STOP = 2;
3827 }
3828 optional State state = 1;
3829}
3830
3831/*
3832 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3833 * Logged from:
3834 * system/core/lmkd/lmkd.c
3835 */
3836message LmkKillOccurred {
3837 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003838 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003839
3840 // The process name.
3841 optional string process_name = 2;
3842
3843 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003844 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003845
3846 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003847 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003848
3849 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003850 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003851
3852 // RSS
3853 optional int64 rss_in_bytes = 6;
3854
3855 // CACHE
3856 optional int64 cache_in_bytes = 7;
3857
3858 // SWAP
3859 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003860
3861 // The elapsed real time of start of the process.
3862 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003863
3864 // Min oom adj score considered by lmkd.
3865 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003866}
3867
Rajeev Kumar51b54602018-03-01 12:18:26 -08003868/*
3869 * Logs when the ActivityManagerService detects that an app died.
3870 *
3871 * Logged from:
3872 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3873 */
3874message AppDied {
3875 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003876 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003877}
3878
Howard Ro21a039c2018-08-06 14:55:47 -07003879/**
3880 * An atom for generic metrics logging. Available from Android Q.
3881 */
3882message GenericAtom {
3883 // The uid of the application that sent this custom atom.
3884 optional int32 uid = 1 [(is_uid) = true];
3885
3886 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003887 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003888}
3889
Tej Singhd6d6d772018-09-05 17:41:25 -07003890/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003891 * Atom for simple logging of user interaction and impression events, such as "the user touched
3892 * this button" or "this dialog was displayed".
3893 * Keep the UI event stream clean: don't use for system or background events.
3894 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003895 *
3896 * Logged from:
3897 * frameworks/base/services/core/java/com/android/server/
3898 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003899 */
3900message UiEventReported {
3901 // The event_id.
3902 optional int32 event_id = 1;
3903 // The event's source or target uid and package, if applicable.
3904 // For example, the package posting a notification, or the destination package of a share.
3905 optional int32 uid = 2 [(is_uid) = true];
3906 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003907 // An identifier used to disambiguate which logs refer to a particular instance of some
3908 // UI element. Useful when there might be multiple instances simultaneously active.
3909 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003910}
3911
3912/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003913 * Reports a notification was created or updated.
3914 *
3915 * Logged from:
3916 * frameworks/base/services/core/java/com/android/server/notification/
3917 */
3918message NotificationReported {
3919 // The event_id (as for UiEventReported).
3920 optional int32 event_id = 1;
3921 // The notifying app's uid and package.
3922 optional int32 uid = 2 [(is_uid) = true];
3923 optional string package_name = 3;
3924 // A small system-assigned identifier for the notification.
3925 // Locally probably-unique, but expect collisions across users and/or days.
3926 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003927 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3928 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003929
3930 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003931 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3932 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3933 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003934
3935 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003936 optional string category = 10; // App-assigned notification category (API-defined strings)
3937 optional int32 style = 11; // App-assigned notification style
3938 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003939
3940 // Ordering, importance and interruptiveness
3941
Will Brockman7614f6962020-02-10 19:43:03 -05003942 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003943
Will Brockman7614f6962020-02-10 19:43:03 -05003944 optional android.stats.sysui.NotificationImportance importance = 14;
3945 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003946
3947 enum NotificationImportanceExplanation {
3948 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3949 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3950 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3951 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3952 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3953 // Like _APP, but based on pre-channels priority signal.
3954 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3955 }
3956
Will Brockman7614f6962020-02-10 19:43:03 -05003957 optional NotificationImportanceExplanation importance_source = 16;
3958 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3959 optional NotificationImportanceExplanation importance_initial_source = 18;
3960 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3961 optional int32 assistant_hash = 20;
3962 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003963}
3964
3965message Notification {
3966 // The notifying app's uid and package.
3967 optional int32 uid = 1 [(is_uid) = true];
3968 optional string package_name = 2;
3969 // A small system-assigned identifier for the notification.
3970 optional int32 instance_id = 3;
3971
3972 // Grouping information.
3973 optional int32 group_instance_id = 4;
3974 optional bool is_group_summary = 5;
3975
3976 // The section of the shade that the notification is in.
3977 // See NotificationSectionsManager.PriorityBucket.
3978 enum NotificationSection {
3979 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003980 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003981 SECTION_MEDIA_CONTROLS = 2;
3982 SECTION_PEOPLE = 3;
3983 SECTION_ALERTING = 4;
3984 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003985 }
3986 optional NotificationSection section = 6;
3987}
3988
3989message NotificationList {
3990 repeated Notification notifications = 1; // An ordered sequence of notifications.
3991}
3992
3993/**
3994 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3995 *
3996 * Logged from:
3997 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3998 */
3999message NotificationPanelReported {
4000 // The event_id (as for UiEventReported).
4001 optional int32 event_id = 1;
4002 optional int32 num_notifications = 2;
4003 // The notifications in the panel, in the order that they appear there.
4004 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4005}
4006
4007/**
4008 * Reports a notification channel, or channel group, was created, updated, or deleted.
4009 *
4010 * Logged from:
4011 * frameworks/base/services/core/java/com/android/server/notification/
4012 */
4013message NotificationChannelModified {
4014 // The event_id (as for UiEventReported).
4015 optional int32 event_id = 1;
4016 // The notifying app's uid and package.
4017 optional int32 uid = 2 [(is_uid) = true];
4018 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004019 // Hash of app-assigned notification channel ID or channel-group ID
4020 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004021 // Previous importance setting, if applicable
4022 optional android.stats.sysui.NotificationImportance old_importance = 5;
4023 // New importance setting
4024 optional android.stats.sysui.NotificationImportance importance = 6;
4025}
4026
4027
4028/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004029 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004030 *
4031 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004032 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004033 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004034message BiometricAcquired {
4035 // Biometric modality that was acquired.
4036 optional android.hardware.biometrics.ModalityEnum modality = 1;
4037 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4038 optional int32 user = 2;
4039 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4040 optional bool is_crypto = 3;
4041 // Action that the device is performing. Acquired messages are only expected for enroll and
4042 // authenticate. Other actions may indicate an error.
4043 optional android.hardware.biometrics.ActionEnum action = 4;
4044 // The client that this acquisition was received for.
4045 optional android.hardware.biometrics.ClientEnum client = 5;
4046 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4047 optional int32 acquire_info = 6;
4048 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4049 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004050 // Dictates if this message should trigger additional debugging.
4051 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004052}
4053
4054/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004055 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004056 *
4057 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004058 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004059 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004060message BiometricAuthenticated {
4061 // Biometric modality that was used.
4062 optional android.hardware.biometrics.ModalityEnum modality = 1;
4063 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4064 optional int32 user = 2;
4065 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4066 // storage.
4067 optional bool is_crypto = 3;
4068 // The client that this acquisition was received for.
4069 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004070 // If authentication requires user confirmation. See BiometricPrompt's
4071 // setRequireConfirmation(bool) method.
4072 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004073
Kevin Chyn1741a072019-01-17 11:54:40 -08004074 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004075 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004076 REJECTED = 1;
4077 PENDING_CONFIRMATION = 2;
4078 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004079 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004080
4081 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004082 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004083 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4084 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4085 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4086 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004087 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004088 // Dictates if this message should trigger additional debugging.
4089 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004090}
4091
4092/**
4093 * Logs when a biometric error occurs.
4094 *
4095 * Logged from:
4096 * frameworks/base/services/core/java/com/android/server/biometrics
4097 */
4098message BiometricErrorOccurred {
4099 // Biometric modality that was used.
4100 optional android.hardware.biometrics.ModalityEnum modality = 1;
4101 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4102 optional int32 user = 2;
4103 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4104 optional bool is_crypto = 3;
4105 // Action that the device is performing.
4106 optional android.hardware.biometrics.ActionEnum action = 4;
4107 // The client that this acquisition was received for.
4108 optional android.hardware.biometrics.ClientEnum client = 5;
4109 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4110 // are unique to modality.
4111 optional int32 error_info = 6;
4112 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4113 // by the vendor and not specified by the HIDL interface.
4114 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004115 // Dictates if this message should trigger additional debugging.
4116 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004117 // Time spent during the authentication attempt.
4118 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004119}
4120
4121/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004122 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004123 * Logged from:
4124 * frameworks/base/services/core/java/com/android/server/biometrics
4125 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004126message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004127 // Biometric modality.
4128 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004129 // Type of issue detected.
4130 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004131 // Dictates if this message should trigger additional debugging.
4132 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004133}
Howard Ro688ae182018-09-25 00:09:36 -07004134
joshmccloskey6f952b22019-03-25 20:59:35 -07004135/**
4136 * Logs when a biometric enrollment occurs.
4137 *
4138 * Logged from:
4139 * frameworks/base/services/core/java/com/android/server/biometrics
4140 */
4141message BiometricEnrolled {
4142 // Biometric modality that was used.
4143 optional android.hardware.biometrics.ModalityEnum modality = 1;
4144 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4145 optional int32 user = 2;
4146 // The amount of time the enrollment took in milliseconds.
4147 optional int64 latency_millis = 3;
4148 // Whether or not the enrollment was successful.
4149 optional bool success = 4;
4150}
4151
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004152/*
Tej Singh0d176952019-01-16 19:10:54 -08004153 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004154 */
Tej Singh0d176952019-01-16 19:10:54 -08004155message FlagFlipUpdateOccurred {
4156 // If the event is from a flag config package, specify the package name.
4157 optional string flag_flip_package_name = 1;
4158
4159 // The order id of the package
4160 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004161}
4162
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004163/**
4164 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004165 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004166 */
4167message TrainExperimentIds {
4168 repeated int64 experiment_id = 1;
4169}
4170
Yangster-macb89807e2018-11-15 21:10:57 -08004171/*
4172 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004173 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004174 */
4175message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004176 // Name of the train.
4177 optional string train_name = 1;
4178 // Version code for a "train" of packages that need to be installed atomically
4179 optional int64 train_version_code = 2;
4180 // After installation of this package, device requires a restart.
4181 optional bool requires_staging = 3;
4182 // Rollback should be enabled for this install.
4183 optional bool rollback_enabled = 4;
4184 // Requires low latency monitoring if possible.
4185 optional bool requires_low_latency_monitor = 5;
4186
Yangster-macb89807e2018-11-15 21:10:57 -08004187 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004188 UNKNOWN = 0;
4189 INSTALL_REQUESTED = 1;
4190 INSTALL_STARTED = 2;
4191 INSTALL_STAGED_NOT_READY = 3;
4192 INSTALL_STAGED_READY = 4;
4193 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004194 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4195 // and INSTALL_FAILURE_COMMIT.
4196 INSTALL_FAILURE = 6 [deprecated = true];
4197 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004198 INSTALL_CANCELLED = 7;
4199 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004200 INSTALLER_ROLLBACK_INITIATED = 9;
4201 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4202 INSTALLER_ROLLBACK_STAGED = 11;
4203 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4204 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4205 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4206 INSTALLER_ROLLBACK_SUCCESS = 15;
4207 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004208 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4209 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4210 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4211 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4212 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4213 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004214 INSTALL_FAILURE_DOWNLOAD = 23;
4215 INSTALL_FAILURE_STATE_MISMATCH = 24;
4216 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004217 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004218 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004219 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004220 // Possible experiment ids for monitoring this push.
4221 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4222 // user id
4223 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004224 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004225 // Whether or not this is a rollback event
4226 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004227}
4228
Tej Singhc9203082019-05-03 13:42:23 -07004229/* Test atom, is not logged anywhere */
4230message TestAtomReported {
4231 repeated AttributionNode attribution_node = 1;
4232 optional int32 int_field = 2;
4233 optional int64 long_field = 3;
4234 optional float float_field = 4;
4235 optional string string_field = 5;
4236 optional bool boolean_field = 6;
4237 enum State {
4238 UNKNOWN = 0;
4239 OFF = 1;
4240 ON = 2;
4241 }
4242 optional State state = 7;
4243 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4244}
4245
Maggie Whitefc1aa592018-11-28 21:55:23 -08004246/** Represents USB port overheat event. */
4247message UsbPortOverheatEvent {
4248 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4249 optional int32 plug_temperature_deci_c = 1;
4250
4251 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4252 optional int32 max_temperature_deci_c = 2;
4253
4254 /* Time between USB plug event and overheat threshold trip, in seconds. */
4255 optional int32 time_to_overheat_secs = 3;
4256
4257 /* Time between overheat threshold trip and hysteresis, in seconds. */
4258 optional int32 time_to_hysteresis_secs = 4;
4259
4260 /* Time between hysteresis and active mitigation ending, in seconds. */
4261 optional int32 time_to_inactive_secs = 5;
4262};
4263
Maggie White8735b852019-01-18 11:40:49 -08004264/**
4265 * Logs total effective full charge and discharge cycles on a battery.
4266 * Here are some examples of one effective cycle:
4267 * 1) the battery charges from 0% to 100% and drains back to 0%,
4268 * 2) charging from 50% to 100% and draining back to 50% twice.
4269 * Pulled from:
4270 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4271 */
4272message BatteryCycleCount {
4273 /* Number of total charge and discharge cycles on the system battery. */
4274 optional int32 cycle_count = 1;
4275}
4276
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004277/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004278 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4279 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004280 * Pulled from:
4281 * StatsCompanionService
4282 */
4283
Carmen Agimof12dec122019-03-06 16:14:38 +00004284message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004285
Carmen Agimof12dec122019-03-06 16:14:38 +00004286 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004287 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004288 PUBLIC = 1;
4289 PRIVATE = 2;
4290 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004291 }
4292
Carmen Agimof12dec122019-03-06 16:14:38 +00004293 // The type of external storage.
4294 optional android.stats.storage.ExternalStorageType storage_type = 1;
4295 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4296 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004297 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004298 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004299}
4300
Yangster-macb89807e2018-11-15 21:10:57 -08004301/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004302 * Logs when a connection becomes available and lost.
4303 * Logged in StatsCompanionService.java
4304 */
4305message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004306 // Id of the network.
4307 optional int32 net_id = 1;
4308
4309 enum State {
4310 UNKNOWN = 0;
4311 CONNECTED = 1;
4312 DISCONNECTED = 2;
4313 }
4314 // Connected state of a network.
4315 optional State state = 2;
4316}
4317
4318/**
4319 * Logs when a service starts and stops.
4320 * Logged from:
4321 * services/core/java/com/android/server/am/ActiveServices.java
4322 */
4323message ServiceStateChanged {
4324
4325 optional int32 uid = 1 [(is_uid) = true];
4326
4327 optional string package_name = 2;
4328
4329 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004330
4331 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004332 START = 1;
4333 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004334 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004335
4336 optional State state = 4;
4337}
4338
4339/**
4340 * Logs when a service is launched.
4341 * Logged from:
4342 * services/core/java/com/android/server/am/ActiveServices.java
4343 */
4344message ServiceLaunchReported {
4345
4346 optional int32 uid = 1 [(is_uid) = true];
4347
4348 optional string package_name = 2;
4349
4350 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004351}
Howard Ro688ae182018-09-25 00:09:36 -07004352
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004353/**
4354 * Logs when a hidden API is used.
4355 *
4356 * Logged from:
4357 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4358 */
4359message HiddenApiUsed {
4360 // The uid of the app making the hidden access.
4361 optional int32 uid = 1 [(is_uid) = true];
4362
4363 // Signature of the method or field accessed.
4364 optional string signature = 2;
4365
4366 enum AccessMethod {
4367 NONE = 0;
4368 REFLECTION = 1;
4369 JNI = 2;
4370 LINKING = 3;
4371 }
4372
4373 // Type of access.
4374 optional AccessMethod access_method = 3;
4375
4376 // Whether the access was prevented or not.
4377 optional bool access_denied = 4;
4378}
4379
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004380/**
4381 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4382 * - When user sees privacy chip
4383 * - When user clicks privacy chip
4384 * - How does the user exit the Privacy Dialog
4385 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004386 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4387 */
4388message PrivacyIndicatorsInteracted {
4389
4390 enum Type {
4391 UNKNOWN = 0;
4392 CHIP_VIEWED = 1;
4393 CHIP_CLICKED = 2;
4394 DIALOG_PRIVACY_SETTINGS = 3;
4395 DIALOG_DISMISS = 4;
4396 DIALOG_LINE_ITEM = 5;
4397 }
4398
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004399 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004400
4401 // Used if the type is LINE_ITEM
4402 optional string package_name = 2;
4403}
4404
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004405/**
4406 * Logs information about a package that is moved from the internal to external storage and vice
4407 * versa.
4408 * It logs the package name, the type of the external storage where the package is installed
4409 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4410 * and the move type: if it's from internal to external or the other way around.
4411 *
4412 * Logged from:
4413 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4414 */
4415message AppMovedStorageReported {
4416 enum MoveType {
4417 UNKNOWN = 0;
4418 TO_EXTERNAL = 1;
4419 TO_INTERNAL = 2;
4420 }
4421 // The type of the external storage.
4422 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4423 // The type of move.
4424 optional MoveType move_type = 2;
4425 // The name of the package that was moved.
4426 optional string package_name = 3;
4427}
4428
jianjin8f2dee02019-03-29 14:03:08 -07004429/**
4430 * Logs when system server watchdog occurs.
4431 * Logged from:
4432 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4433 */
4434message SystemServerWatchdogOccurred {
4435 optional string subject = 1;
4436}
4437
4438/**
4439 * Logs when new file added to tombstones.
4440 * Logged from:
4441 * frameworks/base/core/java/com/android/server/BootReceiver.java
4442 */
4443message TombStoneOccurred {
4444}
4445
Hai Zhang5d3328d2019-04-13 21:25:06 +08004446/*
4447 * Information about a role request
4448 *
4449 * Logged from:
4450 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4451 */
4452message RoleRequestResultReported {
4453 // UID of application requesting the role
4454 optional int32 requesting_uid = 1;
4455
4456 // Package name of application requesting the role
4457 optional string requesting_package_name = 2;
4458
4459 // The role to be granted
4460 optional string role_name = 3;
4461
4462 // The count of applications qualifying for the role
4463 optional int32 qualifying_count = 4;
4464
4465 // UID of application current granted the role
4466 optional int32 current_uid = 5;
4467
4468 // Package name of application current granted the role
4469 optional string current_package_name = 6;
4470
4471 // UID of another application that user chose to grant the role to, instead of the requesting
4472 // application
4473 optional int32 granted_another_uid = 7;
4474
4475 // Package name of another application that user chose to grant the role to, instead of the
4476 // requesting application
4477 optional string granted_another_package_name = 8;
4478
4479 enum Result {
4480 UNDEFINED = 0;
4481 // role request was ignored
4482 IGNORED = 1;
4483 // role request was ignored because it's already granted
4484 IGNORED_ALREADY_GRANTED = 2;
4485 // role request was ignored because the application isn't qualified
4486 IGNORED_NOT_QUALIFIED = 3;
4487 // role request was ignored because user said it should be always denied
4488 IGNORED_USER_ALWAYS_DENIED = 4;
4489 // role was granted by user action
4490 USER_GRANTED = 5;
4491 // role was denied by user action
4492 USER_DENIED = 6;
4493 // role was denied by user granting another application the role
4494 USER_DENIED_GRANTED_ANOTHER = 7;
4495 // role was denied and set to be always denied by the user
4496 USER_DENIED_WITH_ALWAYS = 8;
4497 }
4498 // The result of the role request
4499 optional Result result = 9;
4500}
4501
Mark Tabrya824a642019-11-05 12:26:12 -08004502/**
4503 * Logs when a Vehicle Maps Service client's connection state has changed
4504 *
4505 * Logged from:
4506 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4507 */
4508message VmsClientConnectionStateChanged {
4509 // The UID of the VMS client app
4510 optional int32 uid = 1 [(is_uid) = true];
4511
4512 enum State {
4513 UNKNOWN = 0;
4514 // Attempting to connect to the client
4515 CONNECTING = 1;
4516 // Client connection established
4517 CONNECTED = 2;
4518 // Client connection closed unexpectedly
4519 DISCONNECTED = 3;
4520 // Client connection closed by VMS
4521 TERMINATED = 4;
4522 // Error establishing the client connection
4523 CONNECTION_ERROR = 5;
4524 }
4525
4526 optional State state = 2;
4527}
4528
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004529/**
4530 * Logs when MediaProvider has successfully finished scanning a storage volume.
4531 *
4532 * Logged from:
4533 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4534 */
shafik43825842020-04-02 17:30:24 +01004535message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004536 enum Reason {
4537 // Scan triggered due to unknown reason
4538 UNKNOWN = 0;
4539 // Scan triggered due to storage volume being mounted
4540 MOUNTED = 1;
4541 // Scan triggered due to explicit user action or app request
4542 DEMAND = 2;
4543 // Scan triggered due to idle maintenance
4544 IDLE = 3;
4545 }
4546
4547 // Volume type that this event pertains to
4548 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4549 // Reason why this scan was triggered
4550 optional Reason reason = 2;
4551 // Total number of files scanned
4552 optional int64 item_count = 3;
4553 // Duration of scan, normalized per file
4554 optional float normalized_duration_millis = 4;
4555 // Number of database inserts, normalized per file
4556 optional float normalized_insert_count = 5;
4557 // Number of database updates, normalized per file
4558 optional float normalized_update_count = 6;
4559 // Number of database deletes, normalized per file
4560 optional float normalized_delete_count = 7;
4561}
4562
4563/**
4564 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4565 *
4566 * Logged from:
4567 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4568 */
shafik43825842020-04-02 17:30:24 +01004569message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004570 // Volume type that this event pertains to
4571 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004572 // UID of app that requested deletion
4573 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004574 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004575 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004576}
4577
4578/**
4579 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4580 *
4581 * Logged from:
4582 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4583 */
shafik43825842020-04-02 17:30:24 +01004584message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004585 enum Result {
4586 UNKNOWN = 0;
4587 USER_GRANTED = 1;
4588 AUTO_GRANTED = 2;
4589 USER_DENIED = 3;
4590 USER_DENIED_WITH_PREJUDICE = 4;
4591 AUTO_DENIED = 5;
4592 }
4593
4594 // Volume type that this event pertains to
4595 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004596 // UID of app that requested permission
4597 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004598 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004599 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004600 // Result of this request
shafik43825842020-04-02 17:30:24 +01004601 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004602}
4603
4604/**
4605 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4606 *
4607 * Logged from:
4608 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4609 */
shafik43825842020-04-02 17:30:24 +01004610message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004611 // Volume type that this event pertains to
4612 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4613 // Old database version code
4614 optional int32 version_from = 2;
4615 // New database version code
4616 optional int32 version_to = 3;
4617 // Total number of files in database
4618 optional int64 item_count = 4;
4619 // Duration of schema change, normalized per file
4620 optional float normalized_duration_millis = 5;
4621}
4622
4623/**
4624 * Logs when MediaProvider has finished an idle maintenance job.
4625 *
4626 * Logged from:
4627 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4628 */
shafik43825842020-04-02 17:30:24 +01004629message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004630 // Volume type that this event pertains to
4631 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4632
4633 // Total number of files in database
4634 optional int64 item_count = 2;
4635 // Duration of idle maintenance, normalized per file
4636 optional float normalized_duration_millis = 3;
4637 // Number of thumbnails found to be stale, normalized per file
4638 optional float normalized_stale_thumbnails = 4;
4639 // Number of items found to be expired, normalized per file
4640 optional float normalized_expired_media = 5;
4641}
4642
Keun young Park3e033cb2019-12-18 11:27:35 -08004643/**
4644 * Represents boot time event with duration in ms.
4645 *
4646 * Logged from: bootstat and various system server components. Check each enums for details.
4647 */
4648message BootTimeEventDuration {
4649 enum DurationEvent {
4650 UNKNOWN = 0;
4651 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4652 ABSOLUTE_BOOT_TIME = 1;
4653 // Bootloader's 1st stage execution time.
4654 // Logged from bootstat.
4655 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4656 // Bootloader's 1st stage loading time.
4657 // Logged from bootstat.
4658 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4659 // Bootloader's kernel loading time.
4660 // Logged from bootstat.
4661 BOOTLOADER_KERNEL_LOAD = 4;
4662 // Bootloader's 2nd stage execution time.
4663 // Logged from bootstat.
4664 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4665 // Bootloader's 2nd stage loading time.
4666 // Logged from bootstat.
4667 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4668 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4669 // for locked device.
4670 // Logged from bootstat.
4671 BOOTLOADER_UI_WAIT = 7;
4672 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4673 // Logged from bootstat.
4674 BOOTLOADER_TOTAL = 8;
4675 // Shutdown duration inside init for the reboot before the current boot up.
4676 // Logged from f/b/services/.../BootReceiver.java.
4677 SHUTDOWN_DURATION = 9;
4678 // Total time for mounting of disk devices during bootup.
4679 // Logged from f/b/services/.../BootReceiver.java.
4680 MOUNT_DEFAULT_DURATION = 10;
4681 // Total time for early stage mounting of disk devices during bootup.
4682 // Logged from f/b/services/.../BootReceiver.java.
4683 MOUNT_EARLY_DURATION = 11;
4684 // Total time for late stage mounting of disk devices during bootup.
4685 // Logged from f/b/services/.../BootReceiver.java.
4686 MOUNT_LATE_DURATION = 12;
4687 // Average time to scan non-system app after OTA
4688 // Logged from f/b/services/.../PackageManagerService.java
4689 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4690 // Time to initialize Package manager after OTA
4691 // Logged from f/b/services/.../PackageManagerService.java
4692 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4693 // Time to scan all system app from Package manager after OTA
4694 // Logged from f/b/services/.../PackageManagerService.java
4695 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4696 // Init's total time for cold boot stage.
4697 // Logged from bootstat.
4698 COLDBOOT_WAIT = 16;
4699 // Init's total time for initializing selinux.
4700 // Logged from bootstat.
4701 SELINUX_INIT = 17;
4702 // Time since last factory reset.
4703 // Logged from bootstat.
4704 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004705 // Init's total time spent for completing the 1st stage.
4706 // Logged from bootstat.
4707 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004708 }
4709
4710 // Type of the event.
4711 optional DurationEvent event = 1;
4712 // Duration of the event in ms.
4713 optional int64 duration_millis = 2;
4714}
4715
4716/**
4717 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4718 * since boot-up.
4719 *
4720 * Logged from: bootstat and various system server components. Check each enums for details.
4721 */
4722message BootTimeEventElapsedTime {
4723 enum ElapsedTimeEvent {
4724 UNKNOWN = 0;
4725 // Time when init starts 1st stage. Logged from bootstat.
4726 ANDROID_INIT_STAGE_1 = 1;
4727 // Time when sys.boot_completed prop is set.
4728 // Logged from bootstat.
4729 BOOT_COMPLETE = 2;
4730 // BOOT_COMPLETE for encrypted device.
4731 BOOT_COMPLETE_ENCRYPTION = 3;
4732 // BOOT_COMPLETE for device with no encryption.
4733 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4734 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004735 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004736 // BOOT_COMPLETE after factory reset.
4737 FACTORY_RESET_BOOT_COMPLETE = 6;
4738 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4739 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004740 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4741 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004742 // BOOT_COMPLETE after OTA.
4743 OTA_BOOT_COMPLETE = 9;
4744 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4745 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004746 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4747 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004748 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4749 // Logged from f/b/services/.../UserController.java
4750 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4751 // Time when the system starts sending BOOT_COMPLETED broadcast.
4752 // Logged from f/b/services/.../UserController.java
4753 FRAMEWORK_BOOT_COMPLETED = 13;
4754 // Time when the package manager starts init.
4755 // Logged from f/b/services/.../SystemServer.java
4756 PACKAGE_MANAGER_INIT_START = 14;
4757 // Time when package manager is ready
4758 // Logged from f/b/services/.../SystemServer.java
4759 PACKAGE_MANAGER_INIT_READY = 15;
4760 // Represents the time when user has entered unlock credential for system with user pin.
4761 // Logged from bootstat.
4762 POST_DECRYPT = 16;
4763 // Represents the start of zygote's init.
4764 // Logged from zygote itself.
4765 ZYGOTE_INIT_START = 17;
4766 // Represents the start of secondary zygote's init.
4767 // TODO: add logging to zygote
4768 SECONDARY_ZYGOTE_INIT_START = 18;
4769 // Represents the start of system server's init.
4770 // Logged from f/b/services/.../SystemServer.java
4771 SYSTEM_SERVER_INIT_START = 19;
4772 // Represents the completion of system server's init.
4773 // Logged from f/b/services/.../SystemServer.java
4774 SYSTEM_SERVER_READY = 20;
4775 // Represents the start of launcher during boot-up.
4776 // TODO: add logging
4777 LAUNCHER_START = 21;
4778 // Represents the completion of launcher's initial rendering. User can use other apps from
4779 // launcher from this point.
4780 // TODO: add logging
4781 LAUNCHER_SHOWN = 22;
4782 }
4783
4784 // Type of the event.
4785 optional ElapsedTimeEvent event = 1;
4786 // Time since bootup for the event.
4787 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4788 optional int64 time_millis = 2;
4789}
4790
4791/**
4792 * Boot time events with UTC time.
4793 *
4794 * Logged from: bootstat and various system server components. Check each enums for details.
4795 */
4796message BootTimeEventUtcTime {
4797 enum UtcTimeEvent {
4798 UNKNOWN = 0;
4799 // Time of the bootstat's marking of 1st boot after the last factory reset.
4800 // Logged from bootstat.
4801 FACTORY_RESET_RESET_TIME = 1;
4802 // The time when bootstat records FACTORY_RESET_* events. This is close to
4803 // BOOT_COMPLETE time for the current bootup.
4804 // Logged from bootstat.
4805 FACTORY_RESET_CURRENT_TIME = 2;
4806 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4807 // Logged from bootstat.
4808 FACTORY_RESET_RECORD_VALUE = 3;
4809 }
4810
4811 // Type of the event.
4812 optional UtcTimeEvent event = 1;
4813 // UTC time for the event.
4814 optional int64 utc_time_secs = 2;
4815}
4816
4817/**
4818 * Boot time events representing specific error code during bootup.
4819 * Meaning of error code can be different per each event type.
4820 *
4821 * Logged from: bootstat and various system server components. Check each enums for details.
4822 */
4823message BootTimeEventErrorCode {
4824 enum ErrorCodeEvent {
4825 UNKNOWN = 0;
4826 // Linux error code for time() call to get the current UTC time.
4827 // Logged from bootstat.
4828 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4829 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4830 // as UMOUNT_STAT_* from init/reboot.cpp.
4831 // Logged from f/b/services/.../BootReceiver.java.
4832 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004833 // Reprepsents fie system mounting error code of /data partition for the current boot.
4834 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004835 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004836 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004837 }
4838
4839 // Type of the event.
4840 optional ErrorCodeEvent event = 1;
4841 // error code defined per each event type.
4842 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4843 // FS_MGR_FS_STAT.
4844 optional int32 error_code = 2;
4845}
4846
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004847/**
4848 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4849 * after an OTA.
4850 *
4851 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004852 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004853 */
4854message SnapshotMergeReported {
4855 // Keep in sync with
4856 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4857 enum UpdateState {
4858 // No update or merge is in progress.
4859 NONE = 0;
4860 // An update is applying; snapshots may already exist.
4861 INITIATED = 1;
4862 // An update is pending, but has not been successfully booted yet.
4863 UNVERIFIED = 2;
4864 // The kernel is merging in the background.
4865 MERGING = 3;
4866 // Post-merge cleanup steps could not be completed due to a transient
4867 // error, but the next reboot will finish any pending operations.
4868 MERGE_NEEDS_REBOOT = 4;
4869 // Merging is complete, and needs to be acknowledged.
4870 MERGE_COMPLETED = 5;
4871 // Merging failed due to an unrecoverable error.
4872 MERGE_FAILED = 6;
4873 // The update was implicitly cancelled, either by a rollback or a flash
4874 // operation via fastboot. This state can only be returned by WaitForMerge.
4875 CANCELLED = 7;
4876 };
4877
4878 // Status of the update after the merge attempts.
4879 optional UpdateState final_state = 1;
4880
4881 // Time to complete a merge operation in milliseconds.
4882 // A negative value corresponds to the case in which the merge operation
4883 // was interrupted and resumed (e.g. in case of a system reboot during the
4884 // merge).
4885 optional int64 duration_millis = 2;
4886
4887 // Number of reboots that occurred after issuing and before completing the
4888 // merge of all the snapshot devices.
4889 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004890
4891 // The device has been upgraded to Virtual A/B.
4892 optional bool is_vab_retrofit = 4;
4893
4894 // Space that has been temporarily allocated in the /data partition
4895 // containing the dm-snapshot's copy-on-write data generated during a
4896 // Virtual A/B update.
4897 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004898}
4899
Chenjie Yubbcbc602018-02-05 16:51:52 -08004900//////////////////////////////////////////////////////////////////////
4901// Pulled atoms below this line //
4902//////////////////////////////////////////////////////////////////////
4903
4904/**
David Chenc8a43242017-10-17 16:23:28 -07004905 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4906 *
4907 * Pulled from:
4908 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4909 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004910message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004911 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004912
4913 optional int64 rx_bytes = 2;
4914
4915 optional int64 rx_packets = 3;
4916
4917 optional int64 tx_bytes = 4;
4918
4919 optional int64 tx_packets = 5;
4920}
4921
4922/**
4923 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4924 *
4925 * Pulled from:
4926 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4927 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004928message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004929 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004930
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004931 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4932 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004933
4934 optional int64 rx_bytes = 3;
4935
4936 optional int64 rx_packets = 4;
4937
4938 optional int64 tx_bytes = 5;
4939
4940 optional int64 tx_packets = 6;
4941}
4942
4943/**
4944 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4945 *
4946 * Pulled from:
4947 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4948 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004949message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004950 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004951
4952 optional int64 rx_bytes = 2;
4953
4954 optional int64 rx_packets = 3;
4955
4956 optional int64 tx_bytes = 4;
4957
4958 optional int64 tx_packets = 5;
4959}
4960
4961/**
4962 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4963 *
4964 * Pulled from:
4965 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4966 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004967message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004968 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004969
Yao Chenc40a19d2018-03-15 16:48:25 -07004970 // 1 denotes foreground and 0 denotes background. This is called Set in
4971 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004972 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004973
4974 optional int64 rx_bytes = 3;
4975
4976 optional int64 rx_packets = 4;
4977
4978 optional int64 tx_bytes = 5;
4979
4980 optional int64 tx_packets = 6;
4981}
4982
4983/**
junyulai8d1a6092020-05-07 13:38:15 +08004984 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08004985 * Note that the data is expected to be sliced into more dimensions in future. In other words,
4986 * the caller must not assume any row of data is one full report when filtering with a set of
4987 * matching conditions, because future data may represent with multiple rows what is currently
4988 * represented by one.
4989 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
4990 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08004991 *
4992 * Pulled from:
4993 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
4994 */
4995message DataUsageBytesTransfer {
4996 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
4997 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
4998 // states combined, not including debug states. See NetworkStats#SET_*.
4999 optional int32 state = 1;
5000
5001 optional int64 rx_bytes = 2;
5002
5003 optional int64 rx_packets = 3;
5004
5005 optional int64 tx_bytes = 4;
5006
5007 optional int64 tx_packets = 5;
5008
5009 // Radio Access Technology (RAT) type of this record, should be one of
5010 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5011 // the record is for all rat types combined.
5012 optional int32 rat_type = 6;
5013
5014 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005015 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005016 optional string sim_mcc = 7;
5017 optional string sim_mnc = 8;
5018
junyulai8b794b72020-05-19 17:36:13 +08005019 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5020 // See TelephonyManager#getSimCarrierId.
5021 optional int32 carrier_id = 9;
5022
junyulai8d1a6092020-05-07 13:38:15 +08005023 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5024 // combined regardless of the boolean value in its field.
5025 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005026 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005027 ALL = 1;
5028 OPPORTUNISTIC = 2;
5029 NOT_OPPORTUNISTIC = 3;
5030 }
5031 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005032 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005033 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005034 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005035}
5036
5037/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005038 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5039 *
5040 * Pulled from:
5041 * StatsCompanionService
5042 */
5043message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005044 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005045
5046 optional int64 rx_bytes = 2;
5047
5048 optional int64 tx_bytes = 3;
5049}
5050
5051/**
David Chenc8a43242017-10-17 16:23:28 -07005052 * Pulls the kernel wakelock durations. This atom is adapted from
5053 * android/internal/os/KernelWakelockStats.java
5054 *
5055 * Pulled from:
5056 * StatsCompanionService using KernelWakelockReader.
5057 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005058message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005059 optional string name = 1;
5060
5061 optional int32 count = 2;
5062
5063 optional int32 version = 3;
5064
Yangster-maca8a30442018-10-13 23:46:34 -07005065 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005066}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005067
Chenjie Yu05013b32017-11-21 10:21:41 -08005068/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005069 * Pulls low power state information. If power.stats HAL is not available, this
5070 * includes platform and subsystem sleep state information,
5071 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5072 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005073 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005074 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005075 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5076 * as defined in:
5077 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005078 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005079message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005080 // Subsystem name
5081 optional string subsystem_name = 1;
5082 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5083 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005084 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5085 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005086 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005087 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005088 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005089 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005090 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005091}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005092
Chenjie Yu05013b32017-11-21 10:21:41 -08005093/**
Bookatz92da2832018-11-01 18:10:03 -07005094 * Pulls on-device power measurement information.
5095 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5096 * Pulled from:
5097 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5098 */
5099message OnDevicePowerMeasurement {
5100 // Name of the subsystem (to which the rail belongs).
5101 optional string subsystem_name = 1;
5102
5103 // Rail name. The rail lies within the subsystem.
5104 optional string rail_name = 2;
5105
5106 // Time (in ms since boot) at which the rail energy value was measured.
5107 // This may differ slightly from the time that statsd logs this information.
5108 optional uint64 measurement_timestamp_millis = 3;
5109
5110 // Accumulated energy used via the rail since device boot in uWs.
5111 optional uint64 energy_microwatt_secs = 4;
5112}
5113
5114/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005115 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005116 * Pulls the time the cpu spend on the frequency index. Frequency index
5117 * starts from highest to lowest. The value should be monotonically
5118 * increasing since boot. However, if there is a cpu
5119 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005120 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005121message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005122 optional uint32 cluster = 1;
5123 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005124 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005125}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005126
Chenjie Yu05013b32017-11-21 10:21:41 -08005127/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005128 * Pulls Cpu Time Per Uid.
5129 * Note that isolated process uid time should be attributed to host uids.
5130 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005131message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005132 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005133 optional uint64 user_time_micros = 2;
5134 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005135}
5136
5137/**
5138 * Pulls Cpu Time Per Uid per frequency.
5139 * Note that isolated process uid time should be attributed to host uids.
5140 * For each uid, we order the time by descending frequencies.
5141 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005142message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005143 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005144 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005145 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005146}
Hugo Benichi884970e2017-11-14 22:42:46 +09005147
Chenjie Yu05013b32017-11-21 10:21:41 -08005148/**
5149 * Pulls Wifi Controller Activity Energy Info
5150 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005151message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005152 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005153 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005154 // stack reported state
5155 // TODO: replace this with proto enum
5156 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005157 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005158 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005159 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005160 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005161 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005162 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005163 // product of current(mA), voltage(V) and time(ms)
5164 optional uint64 controller_energy_used = 6;
5165}
5166
5167/**
5168 * Pulls Modem Activity Energy Info
5169 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005170message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005171 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005172 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005173 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005174 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005175 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005176 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005177 /**
5178 * Tx power index
5179 * index 0 = tx_power < 0dBm
5180 * index 1 = 0dBm < tx_power < 5dBm
5181 * index 2 = 5dBm < tx_power < 15dBm
5182 * index 3 = 15dBm < tx_power < 20dBm
5183 * index 4 = tx_power > 20dBm
5184 */
5185 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005186 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005187 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005188 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005189 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005190 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005191 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005192 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005193 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005194 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005195 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005196 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005197 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005198 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005199}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005200
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005201/**
5202 * Pulls Bluetooth Activity Energy Info
5203 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5204 */
5205message BluetoothActivityInfo {
5206 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005207 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005208 // bluetooth stack state
5209 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005210 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005211 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005212 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005213 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005214 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005215 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005216 // product of current(mA), voltage(V) and time(ms)
5217 optional uint64 energy_used = 6;
5218}
5219
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005220/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005221 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005222 *
5223 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005224 */
5225message ProcessMemoryState {
5226 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005227 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005228
5229 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005230 // Usually package name, "system" for system server.
5231 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005232 optional string process_name = 2;
5233
Rafal Slawikda51b932018-12-13 16:31:33 +00005234 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005235 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005236
5237 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005238 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005239
5240 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005241 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005242
Rajeev Kumar90235992018-01-29 11:06:48 -08005243 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005244 // Value is read from memory.stat, field total_rss if per-app memory
5245 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005246 optional int64 rss_in_bytes = 6;
5247
5248 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005249 // Value is read from memory.stat, field total_cache if per-app memory
5250 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005251 optional int64 cache_in_bytes = 7;
5252
5253 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005254 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005255 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005256 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005257
Rafal Slawik203c3db2019-09-25 19:53:01 +01005258 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005259 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005260
Rafal Slawik203c3db2019-09-25 19:53:01 +01005261 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5262 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005263
Rafal Slawik203c3db2019-09-25 19:53:01 +01005264 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5265 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005266}
5267
5268/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005269 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005270 *
5271 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5272 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005273 *
5274 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005275 */
5276message ProcessMemoryHighWaterMark {
5277 // The uid if available. -1 means not available.
5278 optional int32 uid = 1 [(is_uid) = true];
5279
Rafal Slawikda51b932018-12-13 16:31:33 +00005280 // The process name.
5281 // Usually package name or process cmdline.
5282 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005283 optional string process_name = 2;
5284
Rafal Slawik239b6802019-09-09 18:46:01 +01005285 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5286 // computed by converting kilobytes to bytes.
5287 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5288
Rafal Slawik3bea8952018-11-15 12:39:33 +00005289 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5290 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005291 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005292}
5293
5294/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005295 * Logs the memory stats for a process.
5296 *
5297 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5298 * and for selected native processes.
5299 */
5300message ProcessMemorySnapshot {
5301 // The uid if available. -1 means not available.
5302 optional int32 uid = 1 [(is_uid) = true];
5303
5304 // The process name.
5305 // Usually package name or process cmdline.
5306 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5307 optional string process_name = 2;
5308
5309 // The pid of the process.
5310 // Allows to disambiguate instances of the process.
5311 optional int32 pid = 3;
5312
5313 // The current OOM score adjustment value.
5314 // Read from ProcessRecord for managed processes.
5315 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5316 optional int32 oom_score_adj = 4;
5317
5318 // The current RSS of the process.
5319 // VmRSS from /proc/pid/status.
5320 optional int32 rss_in_kilobytes = 5;
5321
5322 // The current anon RSS of the process.
5323 // RssAnon from /proc/pid/status.
5324 optional int32 anon_rss_in_kilobytes = 6;
5325
5326 // The current swap size of the process.
5327 // VmSwap from /proc/pid/status.
5328 optional int32 swap_in_kilobytes = 7;
5329
5330 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5331 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5332}
5333
5334/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005335 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005336 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005337message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005338 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005339}
5340
5341/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005342 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005343 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005344message SystemUptime {
5345 // Milliseconds since the system was booted.
5346 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5347 // for external input).
5348 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005349 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005350}
5351
5352/*
5353 * Reads from /proc/uid_concurrent_active_time which has the format:
5354 * active: X (X is # cores)
5355 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5356 * [uid1]: [time-0] [time-1] [time-2] ... ...
5357 * ...
5358 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5359 * The file contains a monotonically increasing count of time for a single boot.
5360 */
5361message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005362 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005363 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005364}
5365
5366/**
5367 * Reads from /proc/uid_concurrent_policy_time which has the format:
5368 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5369 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5370 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5371 * ...
5372 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5373 * The file contains a monotonically increasing count of time for a single boot.
5374 */
5375message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005376 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005377 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005378 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005379}
5380
5381/*
5382 * Pulls free disk space, for data, system partition and temporary directory.
5383 */
5384message DiskSpace {
5385 // available bytes in data partition
5386 optional uint64 data_available_bytes = 1;
5387 // available bytes in system partition
5388 optional uint64 system_available_bytes = 2;
5389 // available bytes in download cache or temp directories
5390 optional uint64 temp_available_bytes = 3;
5391}
Tej Singhbf972d92018-01-10 20:51:13 -08005392
5393/**
5394 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005395 *
5396 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005397 */
5398message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005399 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005400}
5401
5402/**
5403 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005404 * Pulled from:
5405 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005406 */
5407message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005408 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005409}
5410
5411/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005412 * Pulls battery voltage.
5413 * Pulled from:
5414 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5415 */
5416message BatteryVoltage {
5417 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005418 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005419}
5420
5421/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005422 * Pulls battery level (percent full, from 0 to 100).
5423 *
5424 * Pulled from:
5425 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5426 */
5427message BatteryLevel {
5428 // Battery level. Should be in [0, 100].
5429 optional int32 battery_level = 1;
5430}
5431
5432/**
Tej Singhd89137e2018-03-26 14:51:40 -07005433 * Pulls the temperature of various parts of the device.
5434 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005435 *
Maggie White442b6312019-04-05 16:26:44 -07005436 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005437 */
5438message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005439 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005440 optional android.os.TemperatureTypeEnum sensor_location = 1;
5441
5442 // The name of the temperature source. Eg. CPU0
5443 optional string sensor_name = 2;
5444
Tej Singhd89137e2018-03-26 14:51:40 -07005445 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005446 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005447 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005448
5449 // Relative severity of the throttling, see enum definition.
5450 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005451}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005452
5453/**
5454 * Pulls the statistics of calls to Binder.
5455 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005456 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5457 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005458 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005459 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005460 */
5461message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005462 // UID of the process responsible for the binder transaction. It will be set if the process
5463 // executing the binder transaction attribute the transaction to another uid using
5464 // Binder.setThreadWorkSource().
5465 //
5466 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005467 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005468 // UID of the process executing the binder transaction.
5469 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005470 // Fully qualified class name of the API call.
5471 //
5472 // This is a system server class name.
5473 //
5474 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5475 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5476 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5477 // commonly used APIs.
5478 optional string service_class_name = 2;
5479 // Method name of the API call. It can also be a transaction code if we cannot
5480 // resolve it to a name. See Binder#getTransactionName.
5481 //
5482 // This is a system server method name.
5483 optional string service_method_name = 3;
5484 // Total number of API calls.
5485 optional int64 call_count = 4;
5486 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5487 optional bool screen_interactive = 13;
5488 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5489 // call_count will be equal to recorded_call_count.
5490 //
5491 // If recorded_call_count is different than call_count, it means data collection has been
5492 // sampled. All the fields below will be sampled in this case.
5493 optional int64 recorded_call_count = 12;
5494 // Number of exceptions thrown by the API.
5495 optional int64 recorded_exception_count = 5;
5496 // Total latency of all API calls.
5497 // Average can be computed using total_latency_micros / recorded_call_count.
5498 optional int64 recorded_total_latency_micros = 6;
5499 // Maximum latency of one API call.
5500 optional int64 recorded_max_latency_micros = 7;
5501 // Total CPU usage of all API calls.
5502 // Average can be computed using total_cpu_micros / recorded_call_count.
5503 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5504 optional int64 recorded_total_cpu_micros = 8;
5505 // Maximum CPU usage of one API call.
5506 optional int64 recorded_max_cpu_micros = 9;
5507 // Maximum parcel reply size of one API call.
5508 optional int64 recorded_max_reply_size_bytes = 10;
5509 // Maximum parcel request size of one API call.
5510 optional int64 recorded_max_request_size_bytes = 11;
5511}
5512
5513/**
5514 * Pulls the statistics of exceptions during calls to Binder.
5515 *
5516 * Binder stats are cumulative from boot unless somebody reset the data using
5517 * > adb shell dumpsys binder_calls_stats --reset
5518 */
5519message BinderCallsExceptions {
5520 // Exception class name, e.g. java.lang.IllegalArgumentException.
5521 //
5522 // This is an exception class name thrown by the system server.
5523 optional string exception_class_name = 1;
5524 // Total number of exceptions.
5525 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005526}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005527
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005528/**
5529 * Pulls the statistics of message dispatching on HandlerThreads.
5530 *
5531 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5532 * config on the device.
5533 *
5534 * Next tag: 11
5535 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005536message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005537 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005538 optional int32 uid = 1 [(is_uid) = true];
5539
5540 // Fully qualified class name of the handler target class.
5541 //
5542 // This field does not contain PII. This is a system server class name.
5543 optional string handler_class_name = 2;
5544
5545 // The name of the thread that runs the Looper.
5546 //
5547 // This field does not contain PII. This is a system server thread name.
5548 optional string looper_thread_name = 3;
5549
5550 // The name of the dispatched message.
5551 //
5552 // This field does not contain PII. This is a system server constant or class
5553 // name.
5554 optional string message_name = 4;
5555
5556 // Total number of successfully dispatched messages.
5557 optional int64 message_count = 5;
5558
5559 // Total number of messages that failed dispatching.
5560 optional int64 exception_count = 6;
5561
5562 // Total number of processed messages we have data recorded for. If we
5563 // collected data for all the messages, message_count will be equal to
5564 // recorded_message_count.
5565 //
5566 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005567 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005568 optional int64 recorded_message_count = 7;
5569
5570 // Total latency of all processed messages.
5571 // Average can be computed using recorded_total_latency_micros /
5572 // recorded_message_count.
5573 optional int64 recorded_total_latency_micros = 8;
5574
5575 // Total CPU usage of all processed message.
5576 // Average can be computed using recorded_total_cpu_micros /
5577 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005578 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005579 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005580
5581 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5582 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005583
5584 // Max recorded CPU usage of all processed messages.
5585 optional int64 recorded_max_cpu_micros = 11;
5586
5587 // Max recorded latency of all processed messages.
5588 optional int64 recorded_max_latency_micros = 12;
5589
5590 // Total number of messages we tracked the dispatching delay for. If we
5591 // collected data for all the messages, message_count will be equal to
5592 // recorded_delay_message_count.
5593 //
5594 // If recorded_delay_message_count is different than message_count, it means data
5595 // collection has been sampled or/and not all messages specified the target dispatch time.
5596 // The fields below will be sampled in this case.
5597 optional int64 recorded_delay_message_count = 13;
5598
5599 // Total dispatching delay of all processed messages.
5600 // Calculated as a difference between the target dispatching time (Message.when)
5601 // and the actual dispatching time.
5602 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5603 optional int64 recorded_total_delay_millis = 14;
5604
5605 // Max dispatching delay of all processed messages.
5606 // Calculated as a difference between the target dispatching time (Message.when)
5607 // and the actual dispatching time.
5608 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005609}
Tej Singh86dc9db2018-09-06 00:39:57 +00005610
5611/**
5612 * Pulls disk information, such as write speed and latency.
5613 */
5614message DiskStats {
5615 // Time taken to open, write 512B to, and close a file.
5616 // -1 if error performing the check.
5617 optional int64 data_write_latency_millis = 1;
5618
5619 optional bool file_based_encryption = 2;
5620
5621 // Recent disk write speed in kB/s.
5622 // -1 if error querying storageed.
5623 // 0 if data is unavailable.
5624 optional int32 recent_disk_write_speed = 3;
5625}
5626
5627
5628/**
5629 * Free and total bytes of the Data, Cache, and System partition.
5630 */
5631message DirectoryUsage {
5632 enum Directory {
5633 UNKNOWN = 0;
5634 DATA = 1;
5635 CACHE = 2;
5636 SYSTEM = 3;
5637 }
5638 optional Directory directory = 1;
5639 optional int64 free_bytes = 2;
5640 optional int64 total_bytes = 3;
5641}
5642
5643
5644/**
5645 * Size of an application: apk size, data size, and cache size.
5646 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5647 * Information is only reported for apps with the primary user (user 0).
5648 * Sizes are aggregated by package name.
5649 */
5650message AppSize {
5651 // Including uids will involve modifying diskstats logic.
5652 optional string package_name = 1;
5653 // App size in bytes. -1 if unavailable.
5654 optional int64 app_size_bytes = 2;
5655 // App data size in bytes. -1 if unavailable.
5656 optional int64 app_data_size_bytes = 3;
5657 // App cache size in bytes. -1 if unavailable.
5658 optional int64 app_cache_size_bytes = 4;
5659 // Time that the cache file was produced.
5660 // Uses System.currentTimeMillis(), which is wall clock time.
5661 optional int64 cache_time_millis = 5;
5662}
5663
5664
5665/**
5666 * Size of a particular category. Eg: photos, videos.
5667 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5668 */
5669message CategorySize {
5670 enum Category {
5671 UNKNOWN = 0;
5672 APP_SIZE = 1;
5673 APP_DATA_SIZE = 2;
5674 APP_CACHE_SIZE = 3;
5675 PHOTOS = 4;
5676 VIDEOS = 5;
5677 AUDIO = 6;
5678 DOWNLOADS = 7;
5679 SYSTEM = 8;
5680 OTHER = 9;
5681 }
5682 optional Category category = 1;
5683 // Category size in bytes.
5684 optional int64 size_bytes = 2;
5685 // Time that the cache file was produced.
5686 // Uses System.currentTimeMillis(), which is wall clock time.
5687 optional int64 cache_time_millis = 3;
5688}
Tej Singhd6d6d772018-09-05 17:41:25 -07005689
5690/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005691 * Pulls per uid I/O stats. The stats are cumulative since boot.
5692 *
5693 * Read/write bytes are I/O events from a storage device
5694 * Read/write chars are data requested by read/write syscalls, and can be
5695 * satisfied by caching.
5696 *
5697 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5698 */
5699message DiskIo {
5700 optional int32 uid = 1 [(is_uid) = true];
5701 optional int64 fg_chars_read = 2;
5702 optional int64 fg_chars_write = 3;
5703 optional int64 fg_bytes_read = 4;
5704 optional int64 fg_bytes_write = 5;
5705 optional int64 bg_chars_read = 6;
5706 optional int64 bg_chars_write = 7;
5707 optional int64 bg_bytes_read = 8;
5708 optional int64 bg_bytes_write = 9;
5709 optional int64 fg_fsync = 10;
5710 optional int64 bg_fsync= 11;
5711}
5712
5713
5714/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005715 * Pulls the number of fingerprints for each user.
5716 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005717 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005718 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005719message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005720 // The associated user. Eg: 0 for owners, 10+ for others.
5721 // Defined in android/os/UserHandle.java
5722 optional int32 user = 1;
5723 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005724 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005725}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005726
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005727/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005728 * Pulls the number of faces for each user.
5729 *
5730 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5731 */
5732message NumFacesEnrolled {
5733 // The associated user. Eg: 0 for owners, 10+ for others.
5734 // Defined in android/os/UserHandle.java
5735 optional int32 user = 1;
5736 // Number of faces registered to that user.
5737 optional int32 num_faces_enrolled = 2;
5738}
5739/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005740 * A mapping of role holder -> role
5741 */
5742message RoleHolder {
5743 // uid of the role holder
5744 optional int32 uid = 1 [(is_uid) = true];
5745
5746 // package name of the role holder
5747 optional string package_name = 2;
5748
5749 // the role held
5750 optional string role = 3;
5751}
5752
Yangsteraf9aee72018-10-12 09:26:16 -07005753message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005754 // These are all in byte resolution.
5755 optional int64 min = 1 [deprecated = true];
5756 optional int64 average = 2 [deprecated = true];
5757 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005758
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005759 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5760 // int64 fields.
5761 optional int32 mean_kb = 4;
5762 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005763}
5764
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005765// A reduced subset of process states; reducing the number of possible states allows more
5766// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5767enum ProcessStateAggregated {
5768 PROCESS_STATE_UNKNOWN = 0;
5769 // Persistent system process.
5770 PROCESS_STATE_PERSISTENT = 1;
5771 // Top activity; actually any visible activity.
5772 PROCESS_STATE_TOP = 2;
5773 // Process binding to top or a foreground service.
5774 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5775 // Processing running a foreground service.
5776 PROCESS_STATE_FGS = 4;
5777 // Important foreground process (ime, wallpaper, etc).
5778 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5779 // Important background process.
5780 PROCESS_STATE_BACKGROUND = 6;
5781 // Process running a receiver.
5782 PROCESS_STATE_RECEIVER = 7;
5783 // All kinds of cached processes.
5784 PROCESS_STATE_CACHED = 8;
5785}
5786
5787// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005788message ProcessStatsStateProto {
5789 optional android.service.procstats.ScreenState screen_state = 1;
5790
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005791 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005792
5793 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5794 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005795 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5796
5797 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005798
5799 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005800 optional int64 duration_millis = 4 [deprecated = true];
5801 // Same as above, but with minute resolution so it fits into an int32.
5802 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005803
5804 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005805 optional int64 realtime_duration_millis = 9 [deprecated = true];
5806 // Same as above, but with minute resolution so it fits into an int32.
5807 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005808
5809 // # of samples taken
5810 optional int32 sample_size = 5;
5811
5812 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005813 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005814
5815 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005816 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005817
5818 // RSS is memory resident for this process
5819 optional AggStats rss = 8;
5820}
5821
Jing Ji060d6862020-04-13 19:36:31 -07005822// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005823message ProcessStatsProto {
5824 // Name of process.
5825 optional string process = 1;
5826
5827 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005828 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005829
5830 // Information about how often kills occurred
5831 message Kill {
5832 // Count of excessive CPU kills
5833 optional int32 cpu = 1;
5834
5835 // Count of kills when cached
5836 optional int32 cached = 2;
5837
5838 // PSS stats during cached kill
5839 optional AggStats cached_pss = 3;
5840 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005841 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005842
5843 // Time and memory spent in various states.
5844 repeated ProcessStatsStateProto states = 5;
5845
5846 // Total time process has been running... screen_state, memory_state, and process_state
5847 // will not be set.
5848 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005849
5850 // Association data for this process in this state;
5851 // each entry here is one association.
5852 repeated ProcessStatsAssociationProto assocs = 7;
5853}
5854
Jing Ji1cd1f602020-06-03 13:45:36 -07005855// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005856message ProcessStatsAssociationProto {
5857 // Procss Name of the associated process (client process of service binding)
5858 optional string assoc_process_name = 1;
5859
5860 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005861 optional string assoc_package_name = 2 [deprecated = true];
5862
5863 // UID of the associated process/package (client package of service binding)
5864 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005865
5866 // Total count of the times this association (service binding) appeared.
5867 optional int32 total_count = 3;
5868
5869 // Uptime total duration in seconds this association (service binding) was around.
5870 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005871}
5872
5873message PackageServiceOperationStatsProto {
5874 // Operate enum: Started, Foreground, Bound, Executing
5875 optional android.service.procstats.ServiceOperationState operation = 1;
5876
5877 // Number of times the service was in this operation.
5878 optional int32 count = 2;
5879
5880 // Information about a state the service can be in.
5881 message StateStats {
5882 // Screen state enum.
5883 optional android.service.procstats.ScreenState screen_state = 1;
5884 // Memory state enum.
5885 optional android.service.procstats.MemoryState memory_state = 2;
5886
5887 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005888 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005889 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005890 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005891 }
5892 repeated StateStats state_stats = 3;
5893}
5894
5895message PackageServiceStatsProto {
5896 // Name of service component.
5897 optional string service_name = 1;
5898
5899 // The operation stats.
5900 // The package_name, package_uid, package_version, service_name will not be set to save space.
5901 repeated PackageServiceOperationStatsProto operation_stats = 2;
5902}
5903
5904message PackageAssociationSourceProcessStatsProto {
5905 // Uid of the process.
5906 optional int32 process_uid = 1;
5907 // Process name.
5908 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005909 // Package name.
5910 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005911 // Total count of the times this association appeared.
5912 optional int32 total_count = 3;
5913
5914 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005915 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005916
5917 // Total count of the times this association became actively impacting its target process.
5918 optional int32 active_count = 5;
5919
5920 // Information on one source in this association.
5921 message StateStats {
5922 // Process state enum.
5923 optional android.service.procstats.ProcessState process_state = 1;
5924 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005925 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005926 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005927 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005928 }
5929 repeated StateStats active_state_stats = 6;
5930}
5931
5932message PackageAssociationProcessStatsProto {
5933 // Name of the target component.
5934 optional string component_name = 1;
5935 // Information on one source in this association.
5936 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5937}
5938
5939
5940message ProcessStatsPackageProto {
5941 // Name of package.
5942 optional string package = 1;
5943
5944 // Uid of the package.
5945 optional int32 uid = 2;
5946
5947 // Version of the package.
5948 optional int64 version = 3;
5949
5950 // Stats for each process running with the package loaded in to it.
5951 repeated ProcessStatsProto process_stats = 4;
5952
5953 // Stats for each of the package's services.
5954 repeated PackageServiceStatsProto service_stats = 5;
5955
5956 // Stats for each association with the package.
5957 repeated PackageAssociationProcessStatsProto association_stats = 6;
5958}
5959
5960message ProcessStatsSectionProto {
5961 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005962 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005963
5964 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005965 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005966
5967 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005968 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005969
5970 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005971 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005972
5973 // System runtime library. e.g. "libdvm.so", "libart.so".
5974 optional string runtime = 5;
5975
5976 // whether kernel reports swapped pss.
5977 optional bool has_swapped_pss = 6;
5978
5979 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5980 enum Status {
5981 STATUS_UNKNOWN = 0;
5982 STATUS_COMPLETE = 1;
5983 STATUS_PARTIAL = 2;
5984 STATUS_SHUTDOWN = 3;
5985 STATUS_SYSPROPS = 4;
5986 }
5987 repeated Status status = 7;
5988
Chenjie Yub2ecc792019-01-17 10:27:26 -08005989 // Number of pages available of various types and sizes, representation fragmentation.
5990 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5991
Yangsteraf9aee72018-10-12 09:26:16 -07005992 // Stats for each process.
5993 repeated ProcessStatsProto process_stats = 8;
5994
5995 // Stats for each package.
5996 repeated ProcessStatsPackageProto package_stats = 9;
5997}
5998
Chenjie Yub2ecc792019-01-17 10:27:26 -08005999message ProcessStatsAvailablePagesProto {
6000 // Node these pages are in (as per /proc/pagetypeinfo)
6001 optional int32 node = 1;
6002
6003 // Zone these pages are in (as per /proc/pagetypeinfo)
6004 optional string zone = 2;
6005
6006 // Label for the type of these pages (as per /proc/pagetypeinfo)
6007 optional string label = 3;
6008
6009 // Distribution of number of pages available by order size. First entry in array is
6010 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6011 repeated int32 pages_per_order = 4;
6012}
6013
Chenjie Yu12e5e672018-09-14 15:54:59 -07006014/**
6015 * Pulled from ProcessStatsService.java
6016 */
6017message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006018 optional ProcessStatsSectionProto proc_stats_section = 1;
6019}
6020
Chenjie Yuf910b7802019-01-11 16:08:20 -08006021/**
6022 * Pulled from ProcessStatsService.java
6023 */
6024message ProcStatsPkgProc {
6025 optional ProcessStatsSectionProto proc_stats_section = 1;
6026}
6027
Chris Wrencdea3b72019-11-22 16:58:17 -05006028// Next Tag: 2
6029message PackageRemoteViewInfoProto {
6030 optional string package_name = 1;
6031 // add per-package additional info here (like channels)
6032}
6033
6034// Next Tag: 2
6035message NotificationRemoteViewsProto {
6036 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6037}
6038
6039/**
6040 * Pulled from NotificationManagerService.java
6041 */
6042message NotificationRemoteViews {
6043 optional NotificationRemoteViewsProto notification_remote_views = 1;
6044}
6045
Yotam Aron74299972020-01-16 16:20:58 +02006046/**
6047 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6048 */
6049message PackageNotificationPreferences {
6050 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006051 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006052 // Notification importance, which specifies when and how a notification is displayed.
6053 // Specified under core/java/android/app/NotificationManager.java.
6054 optional int32 importance = 2;
6055 // Lockscreen visibility as set by the user.
6056 optional int32 visibility = 3;
6057 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6058 // PreferencesHelper.java)
6059 optional int32 user_locked_fields = 4;
6060}
6061
6062/**
6063 * Atom that contains a list of a package's channel preferences, pulled from
6064 * NotificationManagerService.java.
6065 */
6066message PackageNotificationChannelPreferences {
6067 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006068 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006069 // Channel's ID. Should always be available.
6070 optional string channel_id = 2;
6071 // Channel's name. Should always be available.
6072 optional string channel_name = 3;
6073 // Channel's description. Optionally set by the channel creator.
6074 optional string description = 4;
6075 // Notification importance, which specifies when and how a notification is displayed. Specified
6076 // under core/java/android/app/NotificationManager.java.
6077 optional int32 importance = 5;
6078 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6079 // at core/java/android/app/NotificationChannel.java
6080 optional int32 user_locked_fields = 6;
6081 // Indicates if the channel was deleted by the app.
6082 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006083 // Indicates if the channel was marked as a conversation by the app.
6084 optional bool is_conversation = 8;
6085 // Indicates if the channel is a conversation that was demoted by the user.
6086 optional bool is_demoted_conversation = 9;
6087 // Indicates if the channel is a conversation that was marked as important by the user.
6088 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006089}
6090
6091/**
Chris Wren93165692020-05-15 16:12:41 -04006092 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
6093 * NotificationManagerService.java.
6094 */
6095message DNDModeProto {
6096 enum Mode {
6097 ROOT_CONFIG = -1; // Used to distinguish the config (one per user) from the rules.
6098 ZEN_MODE_OFF = 0;
6099 ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6100 ZEN_MODE_NO_INTERRUPTIONS = 2;
6101 ZEN_MODE_ALARMS = 3;
6102 }
6103 optional int32 user = 1; // Android user ID (0, 1, 10, ...)
6104 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled
6105 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
6106 optional Mode zen_mode = 4;
6107 // id is one of the system default rule IDs, or empty
6108 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
6109 optional string id = 5;
6110 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
6111 optional DNDPolicyProto policy = 7;
6112}
6113
6114/**
6115 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
6116 */
6117message DNDPolicyProto {
6118 enum State {
6119 STATE_UNSET = 0;
6120 STATE_ALLOW = 1;
6121 STATE_DISALLOW = 2;
6122 }
6123 optional State calls = 1;
6124 optional State repeat_callers = 2;
6125 optional State messages = 3;
6126 optional State conversations = 4;
6127 optional State reminders = 5;
6128 optional State events = 6;
6129 optional State alarms = 7;
6130 optional State media = 8;
6131 optional State system = 9;
6132 optional State fullscreen = 10;
6133 optional State lights = 11;
6134 optional State peek = 12;
6135 optional State status_bar = 13;
6136 optional State badge = 14;
6137 optional State ambient = 15;
6138 optional State notification_list = 16;
6139
6140 enum PeopleType {
6141 PEOPLE_UNSET = 0;
6142 PEOPLE_ANYONE = 1;
6143 PEOPLE_CONTACTS = 2;
6144 PEOPLE_STARRED = 3;
6145 PEOPLE_NONE = 4;
6146 }
6147
6148 optional PeopleType allow_calls_from = 17;
6149 optional PeopleType allow_messages_from = 18;
6150
6151 enum ConversationType {
6152 CONV_UNSET = 0;
6153 CONV_ANYONE = 1;
6154 CONV_IMPORTANT = 2;
6155 CONV_NONE = 3;
6156 }
6157
6158 optional ConversationType allow_conversations_from = 19;
6159}
6160
6161/**
Yotam Aron74299972020-01-16 16:20:58 +02006162 * Atom that contains a list of a package's channel group preferences, pulled from
6163 * NotificationManagerService.java.
6164 */
6165message PackageNotificationChannelGroupPreferences {
6166 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006167 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006168 // Channel Group's ID. Should always be available.
6169 optional string group_id = 2;
6170 // Channel Group's name. Should always be available.
6171 optional string group_name = 3;
6172 // Channel Group's description. Optionally set by group creator.
6173 optional string description = 4;
6174 // Indicates if notifications from this channel group are blocked.
6175 optional bool is_blocked = 5;
6176 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6177 // at core/java/android/app/NotificationChannelGroup.java
6178 optional int32 user_locked_fields = 6;
6179}
6180
Yangsteraf9aee72018-10-12 09:26:16 -07006181message PowerProfileProto {
6182 optional double cpu_suspend = 1;
6183
6184 optional double cpu_idle = 2;
6185
6186 optional double cpu_active = 3;
6187
6188 message CpuCluster {
6189 optional int32 id = 1;
6190 optional double cluster_power = 2;
6191 optional int32 cores = 3;
6192 repeated int64 speed = 4;
6193 repeated double core_power = 5;
6194 }
6195
6196 repeated CpuCluster cpu_cluster = 40;
6197
6198 optional double wifi_scan = 4;
6199
6200 optional double wifi_on = 5;
6201
6202 optional double wifi_active = 6;
6203
6204 optional double wifi_controller_idle = 7;
6205
6206 optional double wifi_controller_rx = 8;
6207
6208 optional double wifi_controller_tx = 9;
6209
6210 repeated double wifi_controller_tx_levels = 10;
6211
6212 optional double wifi_controller_operating_voltage = 11;
6213
6214 optional double bluetooth_controller_idle = 12;
6215
6216 optional double bluetooth_controller_rx = 13;
6217
6218 optional double bluetooth_controller_tx = 14;
6219
6220 optional double bluetooth_controller_operating_voltage = 15;
6221
6222 optional double modem_controller_sleep = 16;
6223
6224 optional double modem_controller_idle = 17;
6225
6226 optional double modem_controller_rx = 18;
6227
6228 repeated double modem_controller_tx = 19;
6229
6230 optional double modem_controller_operating_voltage = 20;
6231
6232 optional double gps_on = 21;
6233
6234 repeated double gps_signal_quality_based = 22;
6235
6236 optional double gps_operating_voltage = 23;
6237
6238 optional double bluetooth_on = 24;
6239
6240 optional double bluetooth_active = 25;
6241
6242 optional double bluetooth_at_cmd = 26;
6243
6244 optional double ambient_display = 27;
6245
6246 optional double screen_on = 28;
6247
6248 optional double radio_on = 29;
6249
6250 optional double radio_scanning = 30;
6251
6252 optional double radio_active = 31;
6253
6254 optional double screen_full = 32;
6255
6256 optional double audio = 33;
6257
6258 optional double video = 34;
6259
6260 optional double flashlight = 35;
6261
6262 optional double memory = 36;
6263
6264 optional double camera = 37;
6265
6266 optional double wifi_batched_scan = 38;
6267
6268 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006269}
Chenjie Yuab530202018-09-26 12:39:20 -07006270
6271/**
6272 * power_profile.xml and other constants for power model calculations.
6273 * Pulled from PowerProfile.java
6274 */
6275message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006276 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006277}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006278
6279/**
arangelovd5db50e2018-10-12 20:24:39 +01006280 * Logs when a user restriction was added or removed.
6281 *
6282 * Logged from:
6283 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6284 */
6285message UserRestrictionChanged {
6286 // The raw string of the user restriction as defined in UserManager.
6287 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6288 optional string restriction = 1;
6289 // Whether the restriction is enabled or disabled.
6290 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006291}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006292
6293/**
6294 * Pulls process user time and system time. Puller takes a snapshot of all pids
6295 * in the system and returns cpu stats for those that are working at the time.
6296 * Dead pids will be dropped. Kernel processes are excluded.
6297 * Min cool-down is 5 sec.
6298 */
6299message ProcessCpuTime {
6300 optional int32 uid = 1 [(is_uid) = true];
6301
6302 optional string process_name = 2;
6303 // Process cpu time in user space, cumulative from boot/process start
6304 optional int64 user_time_millis = 3;
6305 // Process cpu time in system space, cumulative from boot/process start
6306 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006307}
Misha Wagner5a51e002018-10-03 15:04:09 +01006308
6309/**
6310 * Pulls the CPU usage for each thread.
6311 *
6312 * Read from /proc/$PID/task/$TID/time_in_state files.
6313 *
6314 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6315 * time_in_state files not being present on some phones, have not been addressed. These should be
6316 * considered before a public release.
6317 */
6318message CpuTimePerThreadFreq {
6319 // UID that owns the process.
6320 optional int32 uid = 1 [(is_uid) = true];
6321 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006322 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006323 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006324 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006325 // Name of the process taken from `/proc/$PID/cmdline`.
6326 optional string process_name = 4;
6327 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6328 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006329
6330 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6331 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6332 // frequencies are given here as the alternative is sending eight separate atoms. This method
6333 // significantly reduces the amount of data created
6334 optional int32 frequency1_khz = 6;
6335 optional int32 time1_millis = 7;
6336 optional int32 frequency2_khz = 8;
6337 optional int32 time2_millis = 9;
6338 optional int32 frequency3_khz = 10;
6339 optional int32 time3_millis = 11;
6340 optional int32 frequency4_khz = 12;
6341 optional int32 time4_millis = 13;
6342 optional int32 frequency5_khz = 14;
6343 optional int32 time5_millis = 15;
6344 optional int32 frequency6_khz = 16;
6345 optional int32 time6_millis = 17;
6346 optional int32 frequency7_khz = 18;
6347 optional int32 time7_millis = 19;
6348 optional int32 frequency8_khz = 20;
6349 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006350}
Bookatz75ee60422018-11-09 12:27:37 -08006351
6352/**
Bookatz366a4432018-11-20 09:42:33 -08006353 * Pulls information about the device's build.
6354 */
6355message BuildInformation {
6356 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6357 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6358 optional string fingerprint = 1;
6359
6360 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6361 optional string brand = 2;
6362
6363 // Build.PRODUCT. The name of the overall product.
6364 optional string product = 3;
6365
6366 // Build.DEVICE. The name of the industrial design.
6367 optional string device = 4;
6368
6369 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6370 optional string version_release = 5;
6371
6372 // Build.ID. E.g. a label like "M4-rc20".
6373 optional string id = 6;
6374
6375 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6376 // represent this build.
6377 optional string version_incremental = 7;
6378
6379 // Build.TYPE. The type of build, like "user" or "eng".
6380 optional string type = 8;
6381
6382 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6383 optional string tags = 9;
6384}
6385
6386/**
Adam He420947c2019-01-23 15:59:09 -08006387 * Logs information about mismatched caller for content capture.
6388 *
6389 * Logged from:
6390 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6391 */
6392message ContentCaptureCallerMismatchReported {
6393 optional string intended_package = 1;
6394 optional string calling_package = 2;
6395}
6396
6397/**
6398 * Logs information about content capture service events.
6399 *
6400 * Logged from:
6401 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6402 */
6403message ContentCaptureServiceEvents {
6404 // The type of event.
6405 enum Event {
6406 UNKNOWN = 0;
6407 ON_CONNECTED = 1;
6408 ON_DISCONNECTED = 2;
6409 SET_WHITELIST = 3;
6410 SET_DISABLED = 4;
6411 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006412 ON_DATA_SHARE_REQUEST = 6;
6413 ACCEPT_DATA_SHARE_REQUEST = 7;
6414 REJECT_DATA_SHARE_REQUEST = 8;
6415 DATA_SHARE_WRITE_FINISHED = 9;
6416 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6417 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6418 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6419 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6420 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6421 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006422 }
6423 optional Event event = 1;
6424 // component/package of content capture service.
6425 optional string service_info = 2;
6426 // component/package of target.
6427 // it's a concatenated list of component/package for SET_WHITELIST event
6428 // separated by " ".
6429 optional string target_info = 3;
6430}
6431
6432/**
6433 * Logs information about content capture session events.
6434 *
6435 * Logged from:
6436 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6437 */
6438message ContentCaptureSessionEvents {
6439 // The type of event.
6440 enum Event {
6441 UNKNOWN = 0;
6442 ON_SESSION_STARTED = 1;
6443 ON_SESSION_FINISHED = 2;
6444 SESSION_NOT_CREATED = 3;
6445 }
6446 optional int32 session_id = 1;
6447 optional Event event = 2;
6448 // (n/a on session finished)
6449 optional int32 state_flags = 3;
6450 // component/package of content capture service.
6451 optional string service_info = 4;
6452 // component/package of app.
6453 // (n/a on session finished)
6454 optional string app_info = 5;
6455 optional bool is_child_session = 6;
6456}
6457
6458/**
6459 * Logs information about session being flushed.
6460 *
6461 * Logged from:
6462 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6463 */
6464message ContentCaptureFlushed {
6465 optional int32 session_id = 1;
6466 // component/package of content capture service.
6467 optional string service_info = 2;
6468 // component/package of app.
6469 optional string app_info = 3;
6470 // session start/finish events
6471 optional int32 child_session_started = 4;
6472 optional int32 child_session_finished = 5;
6473 // count of view events.
6474 optional int32 view_appeared_count = 6;
6475 optional int32 view_disappeared_count = 7;
6476 optional int32 view_text_changed_count = 8;
6477
6478 // Flush stats.
6479 optional int32 max_events = 9;
6480 optional int32 idle_flush_freq = 10;
6481 optional int32 text_flush_freq = 11;
6482 optional int32 flush_reason = 12;
6483}
6484
6485/**
Bookatz75ee60422018-11-09 12:27:37 -08006486 * Pulls on-device BatteryStats power use calculations for the overall device.
6487 */
6488message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006489 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6490 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6491 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6492 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006493}
6494
6495/**
6496 * Pulls on-device BatteryStats power use calculations broken down by uid.
6497 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6498 * that is attributed to non-uid items. They must all be included to get the total power use.
6499 */
6500message DeviceCalculatedPowerBlameUid {
6501 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6502 optional int32 uid = 1 [(is_uid) = true];
6503
Bookatz3dbc13a2018-12-21 12:16:51 -08006504 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6505 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6506 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006507}
6508
6509/**
6510 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6511 * drain type.
6512 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6513 * is attributed uids. They must all be included to get the total power use.
6514 */
6515message DeviceCalculatedPowerBlameOther {
6516 // The type of item whose power use is being reported.
6517 enum DrainType {
6518 AMBIENT_DISPLAY = 0;
6519 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6520 BLUETOOTH = 2;
6521 CAMERA = 3;
6522 // Cell-standby
6523 CELL = 4;
6524 FLASHLIGHT = 5;
6525 IDLE = 6;
6526 MEMORY = 7;
6527 // Amount that total computed drain exceeded the drain estimated using the
6528 // battery level changes and capacity.
6529 OVERCOUNTED = 8;
6530 PHONE = 9;
6531 SCREEN = 10;
6532 // Amount that total computed drain was below the drain estimated using the
6533 // battery level changes and capacity.
6534 UNACCOUNTED = 11;
6535 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6536 WIFI = 13;
6537 }
6538 optional DrainType drain_type = 1;
6539
Bookatz3dbc13a2018-12-21 12:16:51 -08006540 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6541 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6542 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006543}
arangelov4e994062018-11-13 16:12:38 +00006544
6545/**
6546 * Logs device policy features.
6547 *
6548 * Logged from:
6549 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6550 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6551 */
6552message DevicePolicyEvent {
6553 // The event id - unique for each event.
6554 optional android.stats.devicepolicy.EventId event_id = 1;
6555 // The admin package name.
6556 optional string admin_package_name = 2;
6557 // A generic integer parameter.
6558 optional int32 integer_value = 3;
6559 // A generic boolean parameter.
6560 optional bool boolean_value = 4;
6561 // A parameter specifying a time period in milliseconds.
6562 optional uint64 time_period_millis = 5;
6563 // A parameter specifying a list of package names, bundle extras or string parameters.
6564 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6565}
shawnlinea5b66b2018-11-13 15:05:29 +08006566
6567/**
6568 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6569 *
6570 * Logged from:
6571 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6572 */
6573message DocsUILaunchReported {
6574 optional android.stats.docsui.LaunchAction launch_action = 1;
6575 optional bool has_initial_uri = 2;
6576 optional android.stats.docsui.MimeType mime_type = 3;
6577 optional android.stats.docsui.Root initial_root = 4;
6578}
6579
6580/**
6581 * Logs root/app visited event in file managers/picker. Call this when the user
6582 * taps on root/app in hamburger menu.
6583 *
6584 * Logged from:
6585 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6586 */
6587message DocsUIRootVisitedReported {
6588 optional android.stats.docsui.ContextScope scope = 1;
6589 optional android.stats.docsui.Root root = 2;
6590}
6591
6592/**
6593 * Logs file operation stats. Call this when a file operation has completed.
6594 *
6595 * Logged from:
6596 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6597 */
6598message DocsUIFileOperationReported {
6599 optional android.stats.docsui.Provider provider = 1;
6600 optional android.stats.docsui.FileOperation file_op = 2;
6601}
6602
6603/**
6604 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6605 * mode.
6606 *
6607 * Logged from:
6608 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6609 */
6610message DocsUIFileOperationCopyMoveModeReported {
6611 optional android.stats.docsui.FileOperation file_op = 1;
6612 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6613}
6614
6615
6616/**
6617 * Logs file sub operation stats. Call this when a file operation has failed.
6618 *
6619 * Logged from:
6620 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6621 */
6622message DocsUIFileOperationFailureReported {
6623 optional android.stats.docsui.Authority authority = 1;
6624 optional android.stats.docsui.SubFileOperation sub_op = 2;
6625}
6626
6627/**
6628* Logs the cancellation of a file operation. Call this when a job is canceled
6629*
6630* Logged from:
6631* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6632*/
6633message DocsUIFileOperationCanceledReported {
6634 optional android.stats.docsui.FileOperation file_op = 1;
6635}
6636
6637/**
6638 * Logs startup time in milliseconds.
6639 *
6640 * Logged from:
6641 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6642 */
6643message DocsUIStartupMsReported {
6644 optional int32 startup_millis = 1;
6645}
6646
6647/**
6648 * Logs the action that was started by user.
6649 *
6650 * Logged from:
6651 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6652 */
6653message DocsUIUserActionReported {
6654 optional android.stats.docsui.UserAction action = 1;
6655}
6656
6657/**
6658 * Logs the invalid type when invalid scoped access is requested.
6659 *
6660 * Logged from:
6661 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6662 */
6663message DocsUIInvalidScopedAccessRequestReported {
6664 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006665}
Ben Murdochbab399f2018-12-06 11:01:38 +00006666
6667/**
shawnlina75e82d2019-01-07 10:31:12 +08006668 * Logs the package name that launches docsui picker mode.
6669 *
6670 * Logged from:
6671 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6672 */
6673message DocsUIPickerLaunchedFromReported {
6674 optional string package_name = 1;
6675}
6676
6677/**
6678 * Logs the search type.
6679 *
6680 * Logged from:
6681 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6682 */
6683message DocsUISearchTypeReported {
6684 optional android.stats.docsui.SearchType search_type = 1;
6685}
6686
6687/**
6688 * Logs the search mode.
6689 *
6690 * Logged from:
6691 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6692 */
6693message DocsUISearchModeReported {
6694 optional android.stats.docsui.SearchMode search_mode = 1;
6695}
6696
6697/**
6698 * Logs the pick result information.
6699 *
6700 * Logged from:
6701 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6702 */
6703message DocsUIPickResultReported {
6704 optional int32 total_action_count = 1;
6705 optional int64 duration_millis = 2;
6706 optional int32 file_count= 3;
6707 optional bool is_searching = 4;
6708 optional android.stats.docsui.Root picked_from = 5;
6709 optional android.stats.docsui.MimeType mime_type = 6;
6710 optional int32 repeatedly_pick_times = 7;
6711}
6712
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006713/** Logs the drag and drop of files.
6714
6715 * Logged from:
6716 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6717 */
6718message DocsUIDragAndDropReported {
6719 optional bool drag_initiated_from_docsui = 1;
6720}
6721
shawnlina75e82d2019-01-07 10:31:12 +08006722/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006723 * Logs when an app's memory is compacted.
6724 *
6725 * Logged from:
6726 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6727 */
6728message AppCompacted {
6729 // The pid of the process being compacted.
6730 optional int32 pid = 1;
6731
6732 // The name of the process being compacted.
6733 optional string process_name = 2;
6734
6735 // The type of compaction.
6736 enum Action {
6737 UNKNOWN = 0;
6738 SOME = 1;
6739 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006740 PERSISTENT = 3;
6741 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006742 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006743 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006744
6745 // Total RSS in kilobytes consumed by the process prior to compaction.
6746 optional int64 before_rss_total_kilobytes = 4;
6747
6748 // File RSS in kilobytes consumed by the process prior to compaction.
6749 optional int64 before_rss_file_kilobytes = 5;
6750
6751 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6752 optional int64 before_rss_anon_kilobytes = 6;
6753
6754 // Swap in kilobytes consumed by the process prior to compaction.
6755 optional int64 before_swap_kilobytes = 7;
6756
6757 // Total RSS in kilobytes consumed by the process after compaction.
6758 optional int64 after_rss_total_kilobytes = 8;
6759
6760 // File RSS in kilobytes consumed by the process after compaction.
6761 optional int64 after_rss_file_kilobytes = 9;
6762
6763 // Anonymous RSS in kilobytes consumed by the process after compaction.
6764 optional int64 after_rss_anon_kilobytes = 10;
6765
6766 // Swap in kilobytes consumed by the process after compaction.
6767 optional int64 after_swap_kilobytes = 11;
6768
6769 // The time taken to perform compaction in milliseconds.
6770 optional int64 time_to_compact_millis = 12;
6771
6772 // The last compaction action performed for this app.
6773 optional Action last_action = 13;
6774
Ben Murdoch01720b82018-12-19 18:03:44 +00006775 // The last time that compaction was attempted on this process in milliseconds
6776 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6777 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006778
Ben Murdoch885c21b2019-03-15 18:02:04 +00006779 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006780 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006781
6782 // The process state at the time of compaction.
6783 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006784
6785 // Free ZRAM in kilobytes before compaction.
6786 optional int64 before_zram_free_kilobytes = 17;
6787
6788 // Free ZRAM in kilobytes after compaction.
6789 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006790}
lifr157fc552018-12-12 16:38:04 +08006791
6792/**
lifrb6b90b62019-03-29 00:40:17 +08006793 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6794 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6795 *
lifr1f74b052019-04-16 22:16:30 +08006796 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6797 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6798 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6799 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006800 */
6801message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006802 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006803
lifr1f74b052019-04-16 22:16:30 +08006804 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006805
6806 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006807 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006808
lifr1f74b052019-04-16 22:16:30 +08006809 // Only valid for event_type = EVENT_GETADDRINFO.
6810 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006811
lifr1f74b052019-04-16 22:16:30 +08006812 // Flags passed to android_res_nsend() defined in multinetwork.h
6813 // Only valid for event_type = EVENT_RESNSEND.
6814 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006815
lifrad9becc2019-05-20 11:04:41 +08006816 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006817
6818 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006819 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006820
6821 // Additional pass-through fields opaque to statsd.
6822 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006823 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006824
6825 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6826 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006827}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006828
6829/**
lifr1cc318d2020-03-19 21:58:30 +08006830 * logs the CapportApiData info
6831 * Logged from:
6832 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6833 */
6834message CapportApiData {
6835 // The TTL of the network connection provided by captive portal
6836 optional int32 remaining_ttl_secs = 1;
6837
6838 // The limit traffic data of the network connection provided by captive portal
6839 optional int32 remaining_bytes = 2;
6840
6841 // Is portal url option included in the DHCP packet (Yes, No)
6842 optional bool has_portal_url = 3;
6843
6844 // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
6845 optional bool has_venue_info = 4;
6846}
6847
6848/**
6849 * logs a network Probe Event
6850 * Logged from:
6851 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6852 */
6853message ProbeEvent {
6854 // The probe type (http or https, or captive portal API...)
6855 optional android.stats.connectivity.ProbeType probe_type = 1;
6856
6857 // The latency in microseconds of the probe event
6858 optional int32 latency_micros = 2;
6859
6860 // The result of the probe event
6861 optional android.stats.connectivity.ProbeResult probe_result = 3;
6862
6863 // The CaptivePortal API info
6864 optional CapportApiData capport_api_data = 4;
6865}
6866
6867/**
6868 * log each ProbeEvent in ProbeEvents
6869 * Logged from:
6870 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6871 */
6872message ProbeEvents {
6873 // Record probe event during the validation
6874 repeated ProbeEvent probe_event = 1;
6875}
6876
6877/**
6878 * The DHCP (Dynamic Host Configuration Protocol) session info
6879 * Logged from:
6880 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
6881 */
6882message DhcpSession {
6883 // The DHCP Feature(s) enabled in this session
6884 repeated android.stats.connectivity.DhcpFeature used_features = 1;
6885
6886 // The discover packet (re)transmit count
6887 optional int32 discover_count = 2;
6888
6889 // The request packet (re)transmit count
6890 optional int32 request_count = 3;
6891
6892 // The IPv4 address conflict count
6893 // (only be meaningful when duplicate address detection is enabled)
6894 optional int32 conflict_count = 4;
6895
6896 // The DHCP packet parsing error code in this session
6897 // (defined in android.net.metrics.DhcpErrorEvent)
6898 repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
6899
6900 // The result of DHCP hostname transliteration
6901 optional android.stats.connectivity.HostnameTransResult ht_result = 6;
6902}
6903
6904/**
6905 * Logs Network IP provisioning event
6906 * Logged from:
6907 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
6908 */
6909message NetworkIpProvisioningReported {
6910 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6911 optional android.stats.connectivity.TransportType transport_type = 1;
6912
6913 // The latency in microseconds of IP Provisioning over IPV4
6914 optional int32 ipv4_latency_micros = 2;
6915
6916 // The latency in microseconds of IP Provisioning over IPV6
6917 optional int32 ipv6_latency_micros = 3;
6918
6919 // The time duration between provisioning start and end (success or failure)
6920 optional int64 provisioning_duration_micros = 4;
6921
6922 // The specific disconnect reason for this IP provisioning
6923 optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
6924
6925 // Log DHCP session info (Only valid for IPv4)
6926 optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
6927
6928 // The random number between 0 ~ 999 for sampling
6929 optional int32 random_number = 7;
6930}
6931
6932/**
6933 * Logs Network DHCP Renew event
6934 * Logged from:
6935 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
6936 */
6937message NetworkDhcpRenewReported {
6938 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6939 optional android.stats.connectivity.TransportType transport_type = 1;
6940
6941 // The request packet (re)transmit count
6942 optional int32 request_count = 2;
6943
6944 // The latency in microseconds of DHCP Renew
6945 optional int32 latency_micros = 3;
6946
6947 // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
6948 optional android.stats.connectivity.DhcpErrorCode error_code = 4;
6949
6950 // The result of DHCP renew
6951 optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
6952
6953 // The random number between 0 ~ 999 for sampling
6954 optional int32 random_number = 6;
6955}
6956
6957/**
6958 * Logs Network Validation event
6959 * Logged from:
6960 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6961 */
6962message NetworkValidationReported {
6963 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6964 optional android.stats.connectivity.TransportType transport_type = 1;
6965
6966 // Record each probe event
6967 optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
6968
6969 // The result of the network validation
6970 optional android.stats.connectivity.ValidationResult validation_result = 3;
6971
6972 // The latency in microseconds of network validation
6973 optional int32 latency_micros = 4;
6974
6975 // The validation index (the first validation attempt or second, third...)
6976 optional int32 validation_index = 5;
6977
6978 // The random number between 0 ~ 999 for sampling
6979 optional int32 random_number = 6;
6980}
6981
6982/**
6983 * Logs NetworkStack Quirk event
6984 * Logged from:
6985 * packages/modules/NetworkStack/src/com/android/networkstack/
6986 */
6987message NetworkStackQuirkReported {
6988 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
6989 optional android.stats.connectivity.TransportType transport_type = 1;
6990
6991 // Record each Quirk event
6992 optional android.stats.connectivity.NetworkQuirkEvent event = 2;
6993}
6994
6995/**
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006996 * Logs when a data stall event occurs.
6997 *
6998 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00006999 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007000 */
7001message DataStallEvent {
7002 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007003 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007004 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
7005 optional int32 evaluation_type = 1;
7006 // See definition in data_stall_event.proto.
7007 optional com.android.server.connectivity.ProbeResult validation_result = 2;
7008 // See definition in data_stall_event.proto.
7009 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
7010 // See definition in data_stall_event.proto.
7011 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
7012 // See definition in data_stall_event.proto.
7013 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
7014 // See definition in data_stall_event.proto.
7015 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007016 // The tcp packets fail rate from the latest tcp polling.
7017 optional int32 tcp_fail_rate = 7;
7018 // Number of packets sent since the last received packet.
7019 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007020}
Christian Brunschenf86039e2018-12-21 12:26:14 +00007021
7022/*
7023 * Logs when RescueParty resets some set of experiment flags.
7024 *
7025 * Logged from:
7026 * frameworks/base/services/core/java/com/android/server/RescueParty.java
7027 */
7028message RescuePartyResetReported {
7029 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
7030 optional int32 rescue_level = 1;
7031}
Mathew Inwoodb375be52019-01-04 11:36:25 +00007032
7033/**
7034 * Logs when signed config is received from an APK, and if that config was applied successfully.
7035 * Logged from:
7036 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
7037 */
7038message SignedConfigReported {
7039 enum Type {
7040 UNKNOWN_TYPE = 0;
7041 GLOBAL_SETTINGS = 1;
7042 }
7043 optional Type type = 1;
7044
7045 // The final status of the signed config received.
7046 enum Status {
7047 UNKNOWN_STATUS = 0;
7048 APPLIED = 1;
7049 BASE64_FAILURE_CONFIG = 2;
7050 BASE64_FAILURE_SIGNATURE = 3;
7051 SECURITY_EXCEPTION = 4;
7052 INVALID_CONFIG = 5;
7053 OLD_CONFIG = 6;
7054 SIGNATURE_CHECK_FAILED = 7;
7055 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00007056 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00007057 }
7058 optional Status status = 2;
7059
7060 // The version of the signed config processed.
7061 optional int32 version = 3;
7062
7063 // The package name that the config was extracted from.
7064 optional string from_package = 4;
7065
7066 enum Key {
7067 NO_KEY = 0;
7068 DEBUG = 1;
7069 PRODUCTION = 2;
7070 }
7071 // Which key was used to verify the config.
7072 optional Key verified_with = 5;
7073}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007074
7075/*
7076 * Logs GNSS Network-Initiated (NI) location events.
7077 *
7078 * Logged from:
7079 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7080 */
7081message GnssNiEventReported {
7082 // The type of GnssNiEvent.
7083 enum EventType {
7084 UNKNOWN = 0;
7085 NI_REQUEST = 1;
7086 NI_RESPONSE = 2;
7087 }
7088 optional EventType event_type = 1;
7089
7090 // An ID generated by HAL to associate NI notifications and UI responses.
7091 optional int32 notification_id = 2;
7092
7093 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007094 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007095
7096 // NI requires notification.
7097 optional bool need_notify = 4;
7098
7099 // NI requires verification.
7100 optional bool need_verify = 5;
7101
7102 // NI requires privacy override, no notification/minimal trace.
7103 optional bool privacy_override = 6;
7104
7105 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
7106 // seconds.
7107 optional int32 timeout = 7;
7108
7109 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007110 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007111
7112 // String representing the requester of the network inititated location request.
7113 optional string requestor_id = 9;
7114
7115 // Notification message text string representing the service(for eg. SUPL-service) who sent the
7116 // network initiated location request.
7117 optional string text = 10;
7118
7119 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007120 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007121
7122 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007123 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007124
7125 // True if SUPL ES is enabled.
7126 optional bool is_supl_es_enabled = 13;
7127
7128 // True if GNSS location is enabled.
7129 optional bool is_location_enabled = 14;
7130
7131 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007132 optional android.server.location.GnssUserResponseType user_response = 15;
7133}
7134
7135/**
7136 * Logs GNSS non-framework (NFW) location notification.
7137 *
7138 * Logged from:
7139 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7140 */
7141message GnssNfwNotificationReported {
7142 // Package name of the Android proxy application representing the non-framework entity that
7143 // requested location. Set to empty string if unknown.
7144 optional string proxy_app_package_name = 1;
7145
7146 // Protocol stack that initiated the non-framework location request.
7147 optional android.server.location.NfwProtocolStack protocol_stack = 2;
7148
7149 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
7150 // set to empty string. This field is opaque to the framework and used for logging purposes.
7151 optional string other_protocol_stack_name = 3;
7152
7153 // Source initiating/receiving the location information.
7154 optional android.server.location.NfwRequestor requestor = 4;
7155
7156 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
7157 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
7158 // and used for logging purposes.
7159 optional string requestor_id = 5;
7160
7161 // Indicates whether location information was provided for this request.
7162 optional android.server.location.NfwResponseType response_type = 6;
7163
7164 // True if the device is in user initiated emergency session.
7165 optional bool in_emergency_mode = 7;
7166
7167 // True if cached location is provided.
7168 optional bool is_cached_location = 8;
7169
7170 // True if proxy app permission mismatch between framework and GNSS HAL.
7171 optional bool is_permission_mismatched = 9;
7172}
7173
7174/**
7175 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7176 *
7177 * Logged from:
7178 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7179 */
7180message GnssConfigurationReported {
7181 // SUPL host name.
7182 optional string supl_host = 1;
7183
7184 // SUPL port number.
7185 optional int32 supl_port = 2;
7186
7187 // C2K host name.
7188 optional string c2k_host = 3;
7189
7190 // C2K port number.
7191 optional int32 c2k_port = 4;
7192
7193 // The SUPL version requested by Carrier.
7194 optional int32 supl_ver = 5;
7195
7196 // The SUPL mode.
7197 optional android.server.location.SuplMode supl_mode = 6;
7198
7199 // True if NI emergency SUPL restrictions is enabled.
7200 optional bool supl_es = 7;
7201
7202 // LTE Positioning Profile settings
7203 optional android.server.location.LppProfile lpp_profile = 8;
7204
7205 // Positioning protocol on A-Glonass system.
7206 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7207
7208 // True if emergency PDN is used. Otherwise, regular PDN is used.
7209 optional bool use_emergency_pdn_for_emergency_supl= 10;
7210
7211 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7212 optional android.server.location.GpsLock gps_lock = 11;
7213
7214 // Number of seconds to extend the emergency session duration post emergency call.
7215 optional int32 es_extension_sec = 12;
7216
7217 // The full list of package names of proxy Android applications representing the non-framework
7218 // location access entities (on/off the device) for which the framework user has granted
7219 // non-framework location access permission. The package names are concatenated in one string
7220 // with spaces as separators.
7221 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007222}
Jack Yu95b64f32018-12-13 18:26:11 +08007223
7224/**
7225 * Logs when a NFC device's error occurred.
7226 * Logged from:
7227 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7228 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7229 */
7230message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007231 enum Type {
7232 UNKNOWN = 0;
7233 CMD_TIMEOUT = 1;
7234 ERROR_NOTIFICATION = 2;
7235 AID_OVERFLOW = 3;
7236 }
7237 optional Type type = 1;
7238 // If it's nci cmd timeout, log the timeout command.
7239 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007240
Alex Salod7c3eef2019-01-25 14:43:27 -08007241 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007242}
7243
7244/**
7245 * Logs when a NFC device's state changed event
7246 * Logged from:
7247 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7248 */
7249message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007250 enum State {
7251 UNKNOWN = 0;
7252 OFF = 1;
7253 ON = 2;
7254 ON_LOCKED = 3; // Secure Nfc enabled.
7255 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7256 }
7257 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007258}
7259
7260/**
7261 * Logs when a NFC Beam Transaction occurred.
7262 * Logged from:
7263 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7264 */
7265message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007266 enum Operation {
7267 UNKNOWN = 0;
7268 SEND = 1;
7269 RECEIVE = 2;
7270 }
7271 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007272}
7273
7274/**
7275 * Logs when a NFC Card Emulation Transaction occurred.
7276 * Logged from:
7277 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7278 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7279 */
7280message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007281 enum Category {
7282 UNKNOWN = 0;
7283 HCE_PAYMENT = 1;
7284 HCE_OTHER = 2;
7285 OFFHOST = 3;
7286 }
7287 // Transaction belongs to HCE payment or HCE other category, or offhost.
7288 optional Category category = 1;
7289 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7290 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007291}
7292
7293/**
7294 * Logs when a NFC Tag event occurred.
7295 * Logged from:
7296 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7297 */
7298message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007299 enum Type {
7300 UNKNOWN = 0;
7301 URL = 1;
7302 BT_PAIRING = 2;
7303 PROVISION = 3;
7304 WIFI_CONNECT = 4;
7305 APP_LAUNCH = 5;
7306 OTHERS = 6;
7307 }
7308 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007309}
7310
7311/**
7312 * Logs when Hce transaction triggered
7313 * Logged from:
7314 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7315 */
7316message NfcHceTransactionOccurred {
7317 // The latency period(in microseconds) it took for the first HCE data
7318 // exchange.
7319 optional uint32 latency_micros = 1;
7320}
7321
7322/**
7323 * Logs when SecureElement state event changed
7324 * Logged from:
7325 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7326 */
7327message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007328 enum State {
7329 UNKNOWN = 0;
7330 INITIALIZED = 1;
7331 DISCONNECTED = 2;
7332 CONNECTED = 3;
7333 HALCRASH = 4;
7334 }
7335 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007336
Alex Salod7c3eef2019-01-25 14:43:27 -08007337 optional string state_change_reason = 2;
7338 // SIMx or eSEx.
7339 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007340}
7341
7342/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007343 * Information about a permission grant request
7344 */
7345message PermissionGrantRequestResultReported {
7346 // unique value identifying an API call. A API call might result in multiple of these atoms
7347 optional int64 request_id = 1;
7348
7349 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007350 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007351
7352 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007353 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007354
7355 // The permission to be granted
7356 optional string permission_name = 4;
7357
7358 // If the permission was explicitly requested via the API or added by the system
7359 optional bool is_implicit = 5;
7360
7361 enum Result {
7362 UNDEFINED = 0;
7363 // permission request was ignored
7364 IGNORED = 1;
7365 // permission request was ignored because it was user fixed
7366 IGNORED_USER_FIXED = 2;
7367 // permission request was ignored because it was policy fixed
7368 IGNORED_POLICY_FIXED = 3;
7369 // permission was granted by user action
7370 USER_GRANTED = 4;
7371 // permission was automatically granted
7372 AUTO_GRANTED = 5;
7373 // permission was denied by user action
7374 USER_DENIED = 6;
7375 // permission was denied with prejudice by the user
7376 USER_DENIED_WITH_PREJUDICE = 7;
7377 // permission was automatically denied
7378 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007379 // permission request was ignored because permission is restricted
7380 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007381 // one time permission was granted by user action
7382 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007383 // user ignored request by leaving the request screen without choosing any option
7384 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007385 // user granted the permission after being linked to settings
7386 USER_GRANTED_IN_SETTINGS = 12;
7387 // user denied the permission after being linked to settings
7388 USER_DENIED_IN_SETTINGS = 13;
7389 // user denied the permission with prejudice after being linked to settings
7390 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7391 // permission was automatically revoked after one-time permission expired
7392 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007393 // permission was automatically revoked for unused app
7394 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007395 }
7396 // The result of the permission grant
7397 optional Result result = 6;
7398}
7399
7400/**
Jack Yu95b64f32018-12-13 18:26:11 +08007401 * Logs when Omapi API used
7402 * Logged from:
7403 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7404 */
7405message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007406 enum Operation {
7407 UNKNOWN = 0;
7408 OPEN_CHANNEL = 1;
7409 }
7410 optional Operation operation = 1;
7411 // SIMx or eSEx.
7412 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007413
Alex Salod7c3eef2019-01-25 14:43:27 -08007414 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007415}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007416
7417/**
Alex Saloa060aee2019-01-21 14:36:41 -08007418 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7419 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007420 * Logged from:
7421 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7422 */
7423message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007424 optional int64 dispatch_latency_millis = 1;
7425}
7426
7427/**
7428 * Logs AttentionManagerService attention check result.
7429 *
7430 * Logged from:
7431 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7432 */
7433message AttentionManagerServiceResultReported {
7434 // See core/java/android/service/attention/AttentionService.java
7435 enum AttentionCheckResult {
7436 UNKNOWN = 20;
7437 ATTENTION_SUCCESS_ABSENT = 0;
7438 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007439 ATTENTION_FAILURE_UNKNOWN = 2;
7440 ATTENTION_FAILURE_CANCELLED = 3;
7441 ATTENTION_FAILURE_PREEMPTED = 4;
7442 ATTENTION_FAILURE_TIMED_OUT = 5;
7443 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007444 }
7445 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007446}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007447
7448/**
7449 * Logs when an adb connection changes state.
7450 *
7451 * Logged from:
7452 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7453 */
7454message AdbConnectionChanged {
7455 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7456 // previously selected for this system.
7457 optional int64 last_connection_time_millis = 1;
7458
7459 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7460 // to reconnect via adb without user interaction.
7461 optional int64 auth_window_millis = 2;
7462
7463 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7464 optional android.debug.AdbConnectionStateEnum state = 3;
7465
7466 // True if the 'always allow' option was selected for this system.
7467 optional bool always_allow = 4;
7468}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007469
7470/*
7471 * Logs the reported speech DSP status.
7472 *
7473 * Logged from:
7474 * Vendor audio implementation.
7475 */
7476message SpeechDspStatReported {
7477 // The total Speech DSP uptime in milliseconds.
7478 optional int32 total_uptime_millis = 1;
7479 // The total Speech DSP downtime in milliseconds.
7480 optional int32 total_downtime_millis = 2;
7481 optional int32 total_crash_count = 3;
7482 optional int32 total_recover_count = 4;
7483}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007484
7485/**
7486 * Logs USB connector contaminant status.
7487 *
7488 * Logged from: USB Service.
7489 */
7490message UsbContaminantReported {
7491 optional string id = 1;
7492 optional android.service.usb.ContaminantPresenceStatus status = 2;
7493}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007494
7495/**
7496 * This atom is for debugging purpose.
7497 */
7498message DebugElapsedClock {
7499 // Monotically increasing value for each pull.
7500 optional int64 pull_count = 1;
7501 // Time from System.elapsedRealtime.
7502 optional int64 elapsed_clock_millis = 2;
7503 // Time from System.elapsedRealtime.
7504 optional int64 same_elapsed_clock_millis = 3;
7505 // Diff between current elapsed time and elapsed time from previous pull.
7506 optional int64 elapsed_clock_diff_millis = 4;
7507
7508 enum Type {
7509 TYPE_UNKNOWN = 0;
7510 ALWAYS_PRESENT = 1;
7511 PRESENT_ON_ODD_PULLS = 2;
7512 }
7513 // Type of behavior for the pulled data.
7514 optional Type type = 5;
7515}
7516
7517/**
7518 * This atom is for debugging purpose.
7519 */
7520message DebugFailingElapsedClock {
7521 // Monotically increasing value for each pull.
7522 optional int64 pull_count = 1;
7523 // Time from System.elapsedRealtime.
7524 optional int64 elapsed_clock_millis = 2;
7525 // Time from System.elapsedRealtime.
7526 optional int64 same_elapsed_clock_millis = 3;
7527 // Diff between current elapsed time and elapsed time from previous pull.
7528 optional int64 elapsed_clock_diff_millis = 4;
7529}
Steven Wuacef6bb2019-01-23 14:21:17 -05007530
7531/** Logs System UI bubbles event changed.
7532 *
7533 * Logged from:
7534 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7535 */
7536message BubbleUIChanged {
7537
7538 // The app package that is posting the bubble.
7539 optional string package_name = 1;
7540
7541 // The notification channel that is posting the bubble.
7542 optional string notification_channel = 2;
7543
7544 // The notification id associated with the posted bubble.
7545 optional int32 notification_id = 3;
7546
7547 // The position of the bubble within the bubble stack.
7548 optional int32 position = 4;
7549
7550 // The total number of bubbles within the bubble stack.
7551 optional int32 total_number = 5;
7552
7553 // User interactions with the bubble.
7554 enum Action {
7555 UNKNOWN = 0;
7556 POSTED = 1;
7557 UPDATED = 2;
7558 EXPANDED = 3;
7559 COLLAPSED = 4;
7560 DISMISSED = 5;
7561 STACK_DISMISSED = 6;
7562 STACK_MOVED = 7;
7563 HEADER_GO_TO_APP = 8;
7564 HEADER_GO_TO_SETTINGS = 9;
7565 PERMISSION_OPT_IN = 10;
7566 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007567 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007568 SWIPE_LEFT = 13;
7569 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007570 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007571 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007572 }
7573 optional Action action = 6;
7574
7575 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7576 optional float normalized_x_position = 7;
7577 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007578
7579 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7580 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007581
7582 // Whether the bubble is an on-going one.
7583 optional bool is_ongoing = 10;
7584
7585 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007586 // This is deprecated and the value should be ignored.
7587 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007588}
Kweku Adams8845d012018-12-11 20:06:45 -08007589
7590/**
Steven Wu552f63f2019-02-05 13:41:36 -05007591 * Logs System UI bubbles developer errors.
7592 *
7593 * Logged from:
7594 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7595 */
7596message BubbleDeveloperErrorReported {
7597
7598 // The app package that is posting the bubble.
7599 optional string package_name = 1;
7600
7601 // Bubble developer error type enums.
7602 enum Error {
7603 UNKNOWN = 0;
7604 ACTIVITY_INFO_MISSING = 1;
7605 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7606 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7607 }
7608 optional Error error = 2 [default = UNKNOWN];
7609}
7610
7611/**
Kweku Adams8845d012018-12-11 20:06:45 -08007612 * Logs that a constraint for a scheduled job has changed.
7613 *
7614 * Logged from:
7615 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7616 */
7617message ScheduledJobConstraintChanged {
7618 repeated AttributionNode attribution_node = 1;
7619
7620 // Name of the job.
7621 optional string job_name = 2;
7622
7623 optional com.android.server.job.ConstraintEnum constraint = 3;
7624
7625 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007626 UNKNOWN = 0;
7627 UNSATISFIED = 1;
7628 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007629 }
7630 optional State state = 4;
7631}
Alex Salod7c3eef2019-01-25 14:43:27 -08007632
7633/**
7634 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7635 * returns true.
7636 *
7637 * Logged from:
7638 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7639 */
7640message ScreenTimeoutExtensionReported {
7641 // Describes how many times in a row did the power manager reset the screen off timeout.
7642 optional uint32 consecutive_timeout_extended_count = 1;
7643}
Hui Yu885aca12019-01-10 17:11:34 -08007644
7645/*
7646* Logs number of milliseconds it takes to start a process.
7647* The definition of app process start time is from the app launch time to
7648* the time that Zygote finished forking the app process and loaded the
7649* application package's java classes.
7650
7651* This metric is different from AppStartOccurred which is for foreground
7652* activity only.
7653
7654* ProcessStartTime can report all processes (both foreground and background)
7655* start time.
7656*
7657* Logged from:
7658* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7659*/
7660message ProcessStartTime {
7661 // The uid of the ProcessRecord.
7662 optional int32 uid = 1 [(is_uid) = true];
7663
7664 // The process pid.
7665 optional int32 pid = 2;
7666
7667 // The process name.
7668 // Usually package name, "system" for system server.
7669 // Provided by ActivityManagerService.
7670 optional string process_name = 3;
7671
7672 enum StartType {
7673 UNKNOWN = 0;
7674 WARM = 1;
7675 HOT = 2;
7676 COLD = 3;
7677 }
7678
7679 // The start type.
7680 optional StartType type = 4;
7681
7682 // The elapsed realtime at the start of the process.
7683 optional int64 process_start_time_millis = 5;
7684
7685 // Number of milliseconds it takes to reach bind application.
7686 optional int32 bind_application_delay_millis = 6;
7687
7688 // Number of milliseconds it takes to finish start of the process.
7689 optional int32 process_start_delay_millis = 7;
7690
7691 // hostingType field in ProcessRecord, the component type such as "activity",
7692 // "service", "content provider", "broadcast" or other strings.
7693 optional string hosting_type = 8;
7694
7695 // hostingNameStr field in ProcessRecord. The component class name that runs
7696 // in this process.
7697 optional string hosting_name = 9;
7698}
7699
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007700/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007701 * Track Media Codec usage
7702 * Logged from:
7703 * frameworks/av/media/libstagefright/MediaCodec.cpp
7704 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7705 */
7706message MediametricsCodecReported {
7707 optional int64 timestamp_nanos = 1;
7708 optional string package_name = 2;
7709 optional int64 package_version_code = 3;
7710 optional int64 media_apex_version = 4;
7711
7712 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7713}
7714
7715/**
7716 * Track Media Extractor (pulling video/audio streams out of containers) usage
7717 * Logged from:
7718 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7719 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7720 */
7721message MediametricsExtractorReported {
7722 optional int64 timestamp_nanos = 1;
7723 optional string package_name = 2;
7724 optional int64 package_version_code = 3;
7725 optional int64 media_apex_version = 4;
7726
7727 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7728}
7729
7730/**
7731 * Track how we arbitrate between microphone/input requests.
7732 * Logged from
7733 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7734 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7735 */
7736message MediametricsAudiopolicyReported {
7737 optional int64 timestamp_nanos = 1;
7738 optional string package_name = 2;
7739 optional int64 package_version_code = 3;
7740 optional int64 media_apex_version = 4;
7741
7742 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7743}
7744
7745/**
7746 * Track how we arbitrate between microphone requests.
7747 * Logged from
7748 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7749 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7750 */
7751message MediametricsAudiorecordReported {
7752 optional int64 timestamp_nanos = 1;
7753 optional string package_name = 2;
7754 optional int64 package_version_code = 3;
7755 optional int64 media_apex_version = 4;
7756
7757 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7758}
7759
7760/**
7761 * Track how we arbitrate between microphone/input requests.
7762 * Logged from
7763 * frameworks/av/media/libnblog/ReportPerformance.cpp
7764 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7765 */
7766message MediametricsAudiothreadReported {
7767 optional int64 timestamp_nanos = 1;
7768 optional string package_name = 2;
7769 optional int64 package_version_code = 3;
7770 optional int64 media_apex_version = 4;
7771
7772 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7773}
7774
7775/**
7776 * Track how we arbitrate between microphone/input requests.
7777 * Logged from
7778 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7779 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7780 */
7781message MediametricsAudiotrackReported {
7782 optional int64 timestamp_nanos = 1;
7783 optional string package_name = 2;
7784 optional int64 package_version_code = 3;
7785 optional int64 media_apex_version = 4;
7786
7787 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7788}
7789
7790/**
7791 * Track information about DRM framework performance
7792 * Logged from
7793 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7794 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7795 */
7796message MediametricsMediadrmReported {
7797 optional int64 timestamp_nanos = 1;
7798 optional string package_name = 2;
7799 optional int64 package_version_code = 3;
7800 optional int64 media_apex_version = 4;
7801
7802 // vendor+description tell about which DRM plugin is in use on this device
7803 optional string vendor = 5;
7804 optional string description = 6;
7805 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7806 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7807}
7808
7809/**
7810 * Track information about the widevine DRM plugin performance
7811 * Logged from
7812 * vendor/widevine/libwvdrmengine/cdm/metrics
7813 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7814 */
7815message MediametricsDrmWidevineReported {
7816 optional int64 timestamp_nanos = 1;
7817 optional string package_name = 2;
7818 optional int64 package_version_code = 3;
7819 optional int64 media_apex_version = 4;
7820
7821 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7822}
7823
7824/**
7825 * Track information about recordings (e.g. camcorder)
7826 * Logged from
7827 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7828 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7829 */
7830message MediametricsRecorderReported {
7831 optional int64 timestamp_nanos = 1;
7832 optional string package_name = 2;
7833 optional int64 package_version_code = 3;
7834 optional int64 media_apex_version = 4;
7835
7836 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7837}
7838
7839/**
7840 * Track Media Player usage
7841 * Logged from:
7842 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7843 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7844 */
7845message MediametricsNuPlayerReported {
7846 optional int64 timestamp_nanos = 1;
7847 optional string package_name = 2;
7848 optional int64 package_version_code = 3;
7849 optional int64 media_apex_version = 4;
7850
7851 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7852}
7853
7854/**
Robert Shiha4beed32019-08-19 14:15:23 -07007855 * Track Legacy DRM usage
7856 * Logged from
7857 * frameworks/av/drm/drmserver/DrmManager.cpp
7858 */
7859message MediametricsDrmManagerReported {
7860 optional int64 timestamp_nanos = 1;
7861 optional string package_name = 2;
7862 optional int64 package_version_code = 3;
7863 optional int64 media_apex_version = 4;
7864
7865 enum Method {
7866 METHOD_NOT_FOUND = -1;
7867 GET_CONSTRAINTS = 0;
7868 GET_METADATA = 1;
7869 CAN_HANDLE = 2;
7870 PROCESS_DRM_INFO = 3;
7871 ACQUIRE_DRM_INFO = 4;
7872 SAVE_RIGHTS = 5;
7873 GET_ORIGINAL_MIME_TYPE = 6;
7874 GET_DRM_OBJECT_TYPE = 7;
7875 CHECK_RIGHTS_STATUS = 8;
7876 REMOVE_RIGHTS = 9;
7877 REMOVE_ALL_RIGHTS = 10;
7878 OPEN_CONVERT_SESSION = 11;
7879 OPEN_DECRYPT_SESSION = 12;
7880 }
7881
7882 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7883 optional string plugin_id = 5;
7884 optional string description = 6;
7885 optional Method method = 7;
7886 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007887
7888 optional int64 get_constraints_count = 9;
7889 optional int64 get_metadata_count = 10;
7890 optional int64 can_handle_count = 11;
7891 optional int64 process_drm_info_count = 12;
7892 optional int64 acquire_drm_info_count = 13;
7893 optional int64 save_rights_count = 14;
7894 optional int64 get_original_mime_type_count = 15;
7895 optional int64 get_drm_object_type_count = 16;
7896 optional int64 check_rights_status_count = 17;
7897 optional int64 remove_rights_count = 18;
7898 optional int64 remove_all_rights_count = 19;
7899 optional int64 open_convert_session_count = 20;
7900 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007901}
7902
7903/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007904 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007905 * Pulled from: StatsCompanionService
7906*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007907message DangerousPermissionState {
7908 // Name of the permission
7909 optional string permission_name = 1;
7910
7911 // Uid of the package
7912 optional int32 uid = 2 [(is_uid) = true];
7913
7914 // Package requesting the permission
7915 optional string package_name = 3;
7916
7917 // If the permission is granted to the uid
7918 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007919
7920 // Permission flags as per android.content.pm.PermissionFlags
7921 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007922}
7923
Michael Groover4a0ca942019-01-24 17:41:25 -08007924/**
7925 * Logs when a package is denied access to a device identifier based on the new access requirements.
7926 *
7927 * Logged from:
7928 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7929 */
7930message DeviceIdentifierAccessDenied {
7931 // The name of the package denied access to the requested device identifier.
7932 optional string package_name = 1;
7933
7934 // The name of the device identifier method the package attempted to invoke.
7935 optional string method_name = 2;
7936
7937 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007938 // Starting from Android 11, this boolean is not set and will always be false.
7939 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007940
7941 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007942 // Starting from Android 11, this boolean is not set and will always be false.
7943 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007944}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007945
7946/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007947 * Pulls the ongoing mainline install train version code.
7948 * Pulled from StatsCompanionService
7949 */
7950message TrainInfo {
7951 optional int64 train_version_code = 1;
7952
7953 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007954
7955 optional string train_name = 3;
7956
7957 enum Status {
7958 UNKNOWN = 0;
7959 INSTALL_REQUESTED = 1;
7960 INSTALL_STARTED = 2;
7961 INSTALL_STAGED_NOT_READY = 3;
7962 INSTALL_STAGED_READY = 4;
7963 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007964 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7965 // and INSTALL_FAILURE_COMMIT.
7966 INSTALL_FAILURE = 6 [deprecated = true];
7967 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007968 INSTALL_CANCELLED = 7;
7969 INSTALLER_ROLLBACK_REQUESTED = 8;
7970 INSTALLER_ROLLBACK_INITIATED = 9;
7971 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7972 INSTALLER_ROLLBACK_STAGED = 11;
7973 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7974 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7975 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7976 INSTALLER_ROLLBACK_SUCCESS = 15;
7977 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007978 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7979 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7980 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7981 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7982 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7983 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007984 INSTALL_FAILURE_DOWNLOAD = 23;
7985 INSTALL_FAILURE_STATE_MISMATCH = 24;
7986 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007987 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007988 }
7989 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007990}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007991
7992/**
7993 * Logs the gesture stage changed event.
7994 *
7995 * Logged from:
7996 * frameworks/base/packages/SystemUI/
7997 */
7998message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007999 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008000}
8001
8002/**
8003 * Logs the feedback type.
8004 *
8005 * Logged from:
8006 * frameworks/base/packages/SystemUI/
8007 */
8008message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008009 // Whether or not the gesture was used.
8010 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008011}
8012
8013/**
8014 * Logs the progress.
8015 *
8016 * Logged from:
8017 * frameworks/base/packages/SystemUI/
8018 */
8019message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008020 // [0,100] progress for the assist gesture.
8021 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008022}
Neil Fullerdb14b482019-02-05 19:44:44 +00008023
8024/*
8025 * Information about the time zone data on a device.
8026 */
8027message TimeZoneDataInfo {
8028 // A version identifier for the data set on device. e.g. "2018i"
8029 optional string tzdb_version = 1;
8030}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008031
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008032/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008033 * Logs the GPU stats global health information.
8034 *
8035 * Logged from:
8036 * frameworks/native/services/gpuservice/gpustats/
8037 */
8038message GpuStatsGlobalInfo {
8039 // Package name of the gpu driver.
8040 optional string driver_package_name = 1;
8041
8042 // Version name of the gpu driver.
8043 optional string driver_version_name = 2;
8044
8045 // Version code of the gpu driver.
8046 optional int64 driver_version_code = 3;
8047
8048 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
8049 optional int64 driver_build_time = 4;
8050
8051 // Total count of the gl driver gets loaded.
8052 optional int64 gl_loading_count = 5;
8053
8054 // Total count of the gl driver fails to be loaded.
8055 optional int64 gl_loading_failure_count = 6;
8056
8057 // Total count of the Vulkan driver gets loaded.
8058 optional int64 vk_loading_count = 7;
8059
8060 // Total count of the Vulkan driver fails to be loaded.
8061 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07008062
8063 // Api version of the system Vulkan driver.
8064 optional int32 vulkan_version = 9;
8065
8066 // Api version of the system CPU Vulkan driver.
8067 optional int32 cpu_vulkan_version = 10;
8068
8069 // Api version of the system GLES driver.
8070 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008071
8072 // Total count of the angle driver gets loaded.
8073 optional int64 angle_loading_count = 12;
8074
8075 // Total count of the angle driver fails to be loaded.
8076 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008077}
8078
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008079/**
8080 * GPU driver loading time info.
8081 */
8082message GpuDriverLoadingTime {
8083 // List of all the driver loading times for this app. The list size is
8084 // capped at 50.
8085 repeated int64 driver_loading_time = 1;
8086}
8087
8088/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008089 * Logs the GPU stats per app health information.
8090 *
8091 * Logged from:
8092 * frameworks/native/services/gpuservice/gpustats/
8093 */
8094message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008095 // Package name of the application that loads the gpu driver. Total number
8096 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008097 optional string app_package_name = 1;
8098
8099 // Version code of the gpu driver this app loads.
8100 optional int64 driver_version_code = 2;
8101
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008102 // gl driver loading time info.
8103 optional GpuDriverLoadingTime gl_driver_loading_time = 3
8104 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008105
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008106 // Vulkan driver loading time info.
8107 optional GpuDriverLoadingTime vk_driver_loading_time = 4
8108 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008109
8110 // Angle driver loading time info.
8111 optional GpuDriverLoadingTime angle_driver_loading_time = 5
8112 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07008113
8114 // CPU Vulkan implementation is in use.
8115 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07008116
8117 // App is not doing pre-rotation correctly.
8118 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08008119
8120 // App creates GLESv1 context.
8121 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008122}
Rafal Slawikd4e87572019-03-12 13:08:38 +00008123
8124/*
8125 * Logs the size of the system ion heap.
8126 *
8127 * Pulled from StatsCompanionService.
8128 */
8129message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008130 // Deprecated due to limited support of ion stats in debugfs.
8131 // Use `IonHeapSize` instead.
8132 option deprecated = true;
8133
Rafal Slawikd4e87572019-03-12 13:08:38 +00008134 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008135 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00008136 optional int64 size_in_bytes = 1;
8137}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008138
Rafal Slawik77987ed2019-06-17 12:28:23 +01008139/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008140 * Logs the total size of the ion heap.
8141 *
8142 * Pulled from StatsCompanionService.
8143 */
8144message IonHeapSize {
8145 // Total size of all ion heaps in kilobytes.
8146 // Read from: /sys/kernel/ion/total_heaps_kb.
8147 optional int32 total_size_kb = 1;
8148}
8149
8150/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01008151 * Logs the per-process size of the system ion heap.
8152 *
8153 * Pulled from StatsCompanionService.
8154 */
8155message ProcessSystemIonHeapSize {
8156 // The uid if available. -1 means not available.
8157 optional int32 uid = 1 [(is_uid) = true];
8158
8159 // The process name (from /proc/PID/cmdline).
8160 optional string process_name = 2;
8161
8162 // Sum of sizes of all allocations.
8163 optional int32 total_size_in_kilobytes = 3;
8164
8165 // Number of allocations.
8166 optional int32 allocation_count = 4;
8167
8168 // Size of the largest allocation.
8169 optional int32 max_size_in_kilobytes = 5;
8170}
8171
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008172/**
8173 * Push network stack events.
8174 *
8175 * Log from:
8176 * frameworks/base/packages/NetworkStack/
8177 */
8178message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008179 // The id that indicates the event reported from NetworkStack.
8180 optional int32 event_id = 1;
8181 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008182 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8183}
Carmen Agimofa769c152019-03-04 14:39:14 +00008184
8185/**
8186 * Logs the apps that are installed on the external storage.
8187 * Pulled from:
8188 * StatsCompanionService
8189 */
8190message AppsOnExternalStorageInfo {
8191 // The type of the external storage.
8192 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8193 // The name of the package that is installed on the external storage.
8194 optional string package_name = 2;
8195}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008196
8197/**
8198 * Logs the settings related to Face.
8199 * Logged from:
8200 * frameworks/base/services/core/java/com/android/server/stats
8201 */
8202message FaceSettings {
8203 // Whether or not face unlock is allowed on Keyguard.
8204 optional bool unlock_keyguard_enabled = 1;
8205 // Whether or not face unlock dismisses the Keyguard.
8206 optional bool unlock_dismisses_keyguard = 2;
8207 // Whether or not face unlock requires attention.
8208 optional bool unlock_attention_required = 3;
8209 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8210 optional bool unlock_app_enabled = 4;
8211 // Whether or not face unlock always requires user confirmation.
8212 optional bool unlock_always_require_confirmation = 5;
8213 // Whether or not a diverse set of poses are required during enrollment.
8214 optional bool unlock_diversity_required = 6;
8215}
Maggie White442b6312019-04-05 16:26:44 -07008216
8217/**
8218 * Logs cooling devices maintained by the kernel.
8219 *
8220 * Pulled from StatsCompanionService.java
8221 */
8222message CoolingDevice {
8223 // The type of cooling device being reported. Eg. CPU, GPU...
8224 optional android.os.CoolingTypeEnum device_location = 1;
8225 // The name of the cooling device source. Eg. CPU0
8226 optional string device_name = 2;
8227 // Current throttle state of the cooling device. The value can any unsigned
8228 // integer between 0 and max_state defined in its driver. 0 means device is
8229 // not in throttling, higher value means deeper throttling.
8230 optional int32 state = 3;
8231}
Ben Blount763a5d52019-04-10 11:48:58 -07008232
8233/**
8234 * Intelligence has several counter-type events that don't warrant a
8235 * full separate atom. These are primarily API call counters but also include
8236 * counters for feature usage and specific failure modes.
8237 *
8238 * Logged from the Intelligence mainline module.
8239 */
8240message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008241 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008242 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008243 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008244 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008245 // How many times the event occured (to report a batch of high frequency events).
8246 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008247 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008248 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008249}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008250
8251/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008252 * Logs when Car Power state changed.
8253 *
8254 * Logged from:
8255 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8256 */
8257message CarPowerStateChanged {
8258 // States come from CpmsState in CarPowerManagementService.java.
8259 enum State {
8260 WAIT_FOR_VHAL = 0;
8261 ON = 1;
8262 SHUTDOWN_PREPARE = 2;
8263 WAIT_FOR_FINISH = 3;
8264 SUSPEND = 4;
8265 SIMULATE_SLEEP = 5;
8266 }
8267 optional State state = 1;
8268}
8269
8270/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008271 * Logs when Car User Hal is requested to switch/create/remove user.
8272 *
8273 * Logged from:
8274 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8275 */
8276message CarUserHalModifyUserRequestReported {
8277 // Request id for the request.
8278 optional int32 request_id = 1;
8279 // Request type.
8280 enum RequestType {
8281 UNKNOWN = 0;
8282 // Car user manager requested user switch.
8283 SWITCH_REQUEST_ANDROID = 1;
8284 // OEM requested User switch.
8285 SWITCH_REQUEST_OEM = 2;
8286 // Hal switch requested after android switch using activity manager.
8287 SWITCH_REQUEST_LEGACY = 3;
8288 // Create User
8289 CREATE_REQUEST = 4;
8290 // Remove User
8291 REMOVE_REQUEST = 5;
8292 }
8293 optional RequestType request_type = 2;
8294 // Android User id of the current user which can only be 0, 10, 11 and so on.
8295 // -1 if not available.
8296 optional int32 user_id = 3;
8297 // VHAL flags of the current user. (-1 if not available)
8298 optional int32 user_flags = 4;
8299 // Android User id of the target user for switch/create/remove. It can only
8300 // be 0, 10, 11 and so on. -1 if not available.
8301 optional int32 target_user_id = 5;
8302 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8303 optional int32 target_user_flags = 6;
8304 // Request timeout Milliseconds (-1 if not available)
8305 optional int32 timeout_millis = 7;
8306}
8307
8308/**
8309 * Logs when Car User Hal responds to switch/create user request.
8310 *
8311 * Logged from:
8312 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8313 */
8314message CarUserHalModifyUserResponseReported {
8315 // Request id of the request associated with the response.
8316 optional int32 request_id = 1;
8317 // Car user hal callback status.
8318 enum CallbackStatus {
8319 UNKNOWN = 0;
8320 // Hal response was invalid.
8321 INVALID = 1;
8322 // Hal response was ok.
8323 OK = 2;
8324 // Hal timeout during set call.
8325 HAL_SET_TIMEOUT = 3;
8326 // Hal response timeout.
8327 HAL_RESPONSE_TIMEOUT = 4;
8328 // Hal responded with wrong info.
8329 WRONG_HAL_RESPONSE = 5;
8330 // Hal is processing multiple requests simultaneously.
8331 CONCURRENT_OPERATION = 6;
8332 }
8333 optional CallbackStatus callback_status = 2;
8334
8335 // Hal request status for user switch/create/remove.
8336 enum HalRequestStatus {
8337 UNSPECIFIED = 0;
8338 // Hal request for user switch/create is successful.
8339 SUCCESS = 1;
8340 // Hal request for user switch/create failed.
8341 FAILURE = 2;
8342 }
8343 optional HalRequestStatus request_status = 3;
8344}
8345
8346/**
8347 * Logs when post switch response is posted to Car User Hal.
8348 *
8349 * Logged from:
8350 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8351 */
8352message CarUserHalPostSwitchResponseReported {
8353 // Request id.
8354 optional int32 request_id = 1;
8355
8356 // Android user switch status.
8357 enum UserSwitchStatus {
8358 UNKNOWN = 0;
8359 // Android user switch is successful.
8360 SUCCESS = 1;
8361 // Android user switch failed.
8362 FAILURE = 2;
8363 }
8364 optional UserSwitchStatus switch_status = 2;
8365}
8366
8367/**
8368 * Logs when initial user information is requested from Car User Hal.
8369 *
8370 * Logged from:
8371 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8372 */
8373message CarUserHalInitialUserInfoRequestReported {
8374 // Request id for the request.
8375 optional int32 request_id = 1;
8376
8377 // Request type for initial user information.
8378 enum InitialUserInfoRequestType {
8379 UNKNOWN = 0;
8380 // At the first time Android was booted (or after a factory reset).
8381 FIRST_BOOT = 1;
8382 // At the first time Android was booted after the system was updated.
8383 FIRST_BOOT_AFTER_OTA = 2;
8384 // When Android was booted "from scratch".
8385 COLD_BOOT = 3;
8386 // When Android was resumed after the system was suspended to memory.
8387 RESUME = 4;
8388 }
8389 optional InitialUserInfoRequestType request_type = 2;
8390 // Request timeout Milliseconds (-1 if not available)
8391 optional int32 timeout_millis = 3;
8392}
8393
8394/**
8395 * Logs when Car User Hal responds to initial user information requests.
8396 *
8397 * Logged from:
8398 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8399 */
8400message CarUserHalInitialUserInfoResponseReported {
8401 // Request id of the request associated with the response.
8402 optional int32 request_id = 1;
8403 // Car user hal callback status.
8404 enum CallbackStatus {
8405 UNKNOWN = 0;
8406 // Hal response was invalid.
8407 INVALID = 1;
8408 // Hal response was ok.
8409 OK = 2;
8410 // Hal timeout during set call.
8411 HAL_SET_TIMEOUT = 3;
8412 // Hal response timeout.
8413 HAL_RESPONSE_TIMEOUT = 4;
8414 // Hal responded with wrong info.
8415 WRONG_HAL_RESPONSE = 5;
8416 // Hal is processing multiple requests simultaneously.
8417 CONCURRENT_OPERATION = 6;
8418 }
8419 optional CallbackStatus callback_status = 2;
8420 // Response for initial user information request.
8421 enum InitialUserInfoResponseAction {
8422 UNSPECIFIED = 0;
8423 // Let the Android System decide what to do.
8424 DEFAULT = 1;
8425 // Switch to an existing Android user.
8426 SWITCH = 2;
8427 // Create a new Android user (and switch to it).
8428 CREATE = 3;
8429 }
8430 optional InitialUserInfoResponseAction response_action = 3;
8431 // Android User id of the target user which can only be 0, 10, 11 and so on.
8432 // -1 if not available.
8433 optional int32 target_user = 4;
8434 // VHAL flags of the current user. (-1 if not available)
8435 optional int32 target_user_flags = 5;
8436 // User locales
8437 optional string user_locales = 6;
8438}
8439
8440/**
8441 * Logs when set user association is requested from Car User Hal.
8442 *
8443 * Logged from:
8444 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8445 */
8446message CarUserHalUserAssociationRequestReported {
8447 // Request id for the request.
8448 optional int32 request_id = 1;
8449 // Request type.
8450 enum RequestType {
8451 UNKNOWN = 0;
8452 // For setting user association information.
8453 SET = 1;
8454 // For getting user association information.
8455 GET = 2;
8456 }
8457 optional RequestType request_type = 2;
8458 // Android User id of the current user which can only be 0, 10, 11 and so on.
8459 // -1 if not available.
8460 optional int32 current_user_id = 3;
8461 // VHAL flags of the current user. (-1 if not available)
8462 optional int32 current_user_flags = 4;
8463 // Number of the set associations requested.
8464 optional int32 number_associations = 5;
8465 // Concatenated string for the types from set associations request.
8466 // This is a string converted from an array of integers.
8467 optional string user_identification_association_types = 6;
8468 // Concatenated string for the values from set associations request.
8469 // This is a string converted from an array of integers.
8470 optional string user_identification_association_values = 7;
8471}
8472
8473/**
8474 * Logs when Car User Hal responds to set user association requests.
8475 *
8476 * Logged from:
8477 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8478 */
8479message CarUserHalSetUserAssociationResponseReported {
8480 // Request id of the request associated with the response.
8481 optional int32 request_id = 1;
8482 // Car user hal callback status.
8483 enum CallbackStatus {
8484 UNKNOWN = 0;
8485 // Hal response was invalid.
8486 INVALID = 1;
8487 // Hal response was ok.
8488 OK = 2;
8489 // Hal timeout during set call.
8490 HAL_SET_TIMEOUT = 3;
8491 // Hal response timeout.
8492 HAL_RESPONSE_TIMEOUT = 4;
8493 // Hal responded with wrong info.
8494 WRONG_HAL_RESPONSE = 5;
8495 // Hal is processing multiple requests simultaneously.
8496 CONCURRENT_OPERATION = 6;
8497 }
8498 optional CallbackStatus callback_status = 2;
8499 // Number of the set associations in the response.
8500 optional int32 number_associations = 3;
8501 // Concatenated string for the types from set associations request.
8502 // This is a string converted from an array of integers.
8503 optional string user_identification_association_types = 4;
8504 // Concatenated string for the values from set associations request.
8505 // This is a string converted from an array of integers.
8506 optional string user_identification_association_values = 5;
8507}
8508
8509/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008510 * Logs whether GarageMode is entered.
8511 *
8512 * Logged from:
8513 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8514 */
8515message GarageModeInfo {
8516 // Whether GarageMode is entered.
8517 optional bool is_garage_mode = 1;
8518}
Martijn Coenencd95d462019-04-25 17:09:45 +02008519
8520/**
8521 * Historical app ops data per package.
8522 */
8523message AppOps {
8524 // Uid of the package requesting the op
8525 optional int32 uid = 1 [(is_uid) = true];
8526
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008527 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008528 optional string package_name = 2;
8529
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008530 // operation id
8531 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008532
8533 // The number of times the op was granted while the app was in the
8534 // foreground (only for trusted requests)
8535 optional int64 trusted_foreground_granted_count = 4;
8536
8537 // The number of times the op was granted while the app was in the
8538 // background (only for trusted requests)
8539 optional int64 trusted_background_granted_count = 5;
8540
8541 // The number of times the op was rejected while the app was in the
8542 // foreground (only for trusted requests)
8543 optional int64 trusted_foreground_rejected_count = 6;
8544
8545 // The number of times the op was rejected while the app was in the
8546 // background (only for trusted requests)
8547 optional int64 trusted_background_rejected_count = 7;
8548
8549 // For long-running operations, total duration of the operation
8550 // while the app was in the foreground (only for trusted requests)
8551 optional int64 trusted_foreground_duration_millis = 8;
8552
8553 // For long-running operations, total duration of the operation
8554 // while the app was in the background (only for trusted requests)
8555 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008556
8557 // Whether AppOps is guarded by Runtime permission
8558 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008559}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008560
8561/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008562 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008563 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008564message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008565 // Uid of the package requesting the op
8566 optional int32 uid = 1 [(is_uid) = true];
8567
8568 // Name of the package performing the op
8569 optional string package_name = 2;
8570
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008571 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8572 // Attributions must be provided through manifest using <attribution> tag available in R and
8573 // above.
8574 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008575
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008576 // operation id
8577 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008578
8579 // The number of times the op was granted while the app was in the
8580 // foreground (only for trusted requests)
8581 optional int64 trusted_foreground_granted_count = 5;
8582
8583 // The number of times the op was granted while the app was in the
8584 // background (only for trusted requests)
8585 optional int64 trusted_background_granted_count = 6;
8586
8587 // The number of times the op was rejected while the app was in the
8588 // foreground (only for trusted requests)
8589 optional int64 trusted_foreground_rejected_count = 7;
8590
8591 // The number of times the op was rejected while the app was in the
8592 // background (only for trusted requests)
8593 optional int64 trusted_background_rejected_count = 8;
8594
8595 // For long-running operations, total duration of the operation
8596 // while the app was in the foreground (only for trusted requests)
8597 optional int64 trusted_foreground_duration_millis = 9;
8598
8599 // For long-running operations, total duration of the operation
8600 // while the app was in the background (only for trusted requests)
8601 optional int64 trusted_background_duration_millis = 10;
8602
8603 // Whether AppOps is guarded by Runtime permission
8604 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008605
8606 // Sampling rate used on device, from 0 to 100
8607 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008608}
8609
8610/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008611 * Location Manager API Usage information(e.g. API under usage,
8612 * API call's parameters).
8613 * Logged from:
8614 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8615 */
8616message LocationManagerApiUsageReported {
8617
8618 // Indicating if usage starts or usage ends.
8619 optional android.stats.location.UsageState state = 1;
8620
8621 // LocationManagerService's API in use.
8622 // We can identify which API from LocationManager is
8623 // invoking current LMS API by the combination of
8624 // API parameter(e.g. is_listener_null, is_intent_null,
8625 // is_location_request_null)
8626 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8627
8628 // Name of the package calling the API.
8629 optional string calling_package_name = 3;
8630
8631 // Type of the location provider.
8632 optional android.stats.location.ProviderType provider = 4;
8633
8634 // Quality of the location request
8635 optional android.stats.location.LocationRequestQuality quality = 5;
8636
8637 // The desired interval for active location updates, in milliseconds.
8638 // Bucketized to reduce cardinality.
8639 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8640
8641 // Minimum distance between location updates, in meters.
8642 // Bucketized to reduce cardinality.
8643 optional android.stats.location.SmallestDisplacementBucket
8644 bucketized_smallest_displacement = 7;
8645
8646 // The number of location updates.
8647 optional int64 num_updates = 8;
8648
8649 // The request expiration time, in millisecond since boot.
8650 // Bucketized to reduce cardinality.
8651 optional android.stats.location.ExpirationBucket
8652 bucketized_expire_in = 9;
8653
8654 // Type of Callback passed in for this API.
8655 optional android.stats.location.CallbackType callback_type = 10;
8656
8657 // The radius of the central point of the alert
8658 // region, in meters. Only for API REQUEST_GEOFENCE.
8659 // Bucketized to reduce cardinality.
8660 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8661
8662 // Activity Importance of API caller.
8663 // Categorized to 3 types that are interesting from location's perspective.
8664 optional android.stats.location.ActivityImportance activiy_importance = 12;
8665}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008666
8667/**
8668 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8669 */
8670message ReviewPermissionsFragmentResultReported {
8671 // unique value identifying a permission group change. A permission group change might result
8672 // in multiple of these atoms
8673 optional int64 change_id = 1;
8674
8675 // UID of package the permission belongs to
8676 optional int32 uid = 2 [(is_uid) = true];
8677
8678 // Name of package the permission belongs to
8679 optional string package_name = 3;
8680
8681 // The permission to be granted
8682 optional string permission_name = 4;
8683
8684 // The result of the permission grant
8685 optional bool permission_granted = 5;
8686}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008687
8688/**
8689* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8690* Logged from: RuntimePermissionUpdgradeController
8691*/
8692message RuntimePermissionsUpgradeResult {
8693 // Permission granted as result of upgrade
8694 optional string permission_name = 1;
8695
8696 // UID of package granted permission
8697 optional int32 uid = 2 [(is_uid) = true];
8698
8699 // Name of package granted permission
8700 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008701}
8702
8703/**
8704* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8705*/
8706message GrantPermissionsActivityButtonActions {
8707 // Permission granted as result of upgrade
8708 optional string permission_group_name = 1;
8709
8710 // UID of package granted permission
8711 optional int32 uid = 2 [(is_uid) = true];
8712
8713 // Name of package requesting permission
8714 optional string package_name = 3;
8715
8716 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8717 // LABEL_ constants in GrantPermissionActivity.java
8718 optional int32 buttons_presented = 4;
8719
8720 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8721 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008722
8723 // id which identifies single session of user interacting with permission controller
8724 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008725}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008726
8727/**
8728 * Information about LocationAccessCheck notification presented to user
8729 */
8730message LocationAccessCheckNotificationAction {
8731
8732 // id which identifies single session of user interacting with permission controller
8733 optional int64 session_id = 1;
8734
8735 // Uid of package for which location access check is presented
8736 optional int32 package_uid = 2;
8737
8738 // Name of package for which location access check is presented
8739 optional string package_name = 3;
8740
8741 enum Result {
8742 UNDEFINED = 0;
8743 // notification was presented to the user
8744 NOTIFICATION_PRESENTED = 1;
8745 // notification was declined by the user
8746 NOTIFICATION_DECLINED = 2;
8747 // notification was clicked by the user
8748 NOTIFICATION_CLICKED = 3;
8749 }
8750
8751 // View / interaction recorded
8752 optional Result result = 4;
8753}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008754
8755/**
8756 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8757 */
8758message AppPermissionFragmentActionReported {
8759 // id which identifies single session of user interacting with permission controller
8760 optional int64 session_id = 1;
8761
8762 // unique value identifying a permission group change. A permission group change might result
8763 // in multiple of these atoms
8764 optional int64 change_id = 2;
8765
8766 // UID of package the permission belongs to
8767 optional int32 uid = 3 [(is_uid) = true];
8768
8769 // Name of package the permission belongs to
8770 optional string package_name = 4;
8771
8772 // The permission to be granted
8773 optional string permission_name = 5;
8774
8775 // The result of the permission grant
8776 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008777
8778 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8779 optional int32 permission_flags = 7;
8780
8781 enum Button {
8782 UNDEFINED = 0;
8783 // Allow button
8784 ALLOW = 1;
8785 // Deny button
8786 DENY = 2;
8787 // Ask every time button
8788 ASK_EVERY_TIME = 3;
8789 // Allow all the time button
8790 ALLOW_ALWAYS = 4;
8791 // Allow only while using the app button
8792 ALLOW_FOREGROUND = 5;
8793 // Same is Deny button but shown in while in use dialog
8794 DENY_FOREGROUND = 6;
8795 }
8796
8797 // Button pressed in the dialog
8798 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008799}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008800
8801/**
8802* Information about a AppPermissionFragment viewed by user
8803*/
8804message AppPermissionFragmentViewed {
8805 // id which identifies single session of user interacting with permission controller
8806 optional int64 session_id = 1;
8807
8808 // UID of package for which permissions are viewed
8809 optional int32 uid = 2 [(is_uid) = true];
8810
8811 // Name of package for which permissions are viewed
8812 optional string package_name = 3;
8813
8814 // Permission group viewed
8815 optional string permission_group_name = 4;
8816}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008817
8818/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008819* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8820* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008821*/
8822message AppPermissionsFragmentViewed {
8823 // id which identifies single session of user interacting with permission controller
8824 optional int64 session_id = 1;
8825
8826 // id which identifies single view as every view might have several logging records
8827 // with different package information attached
8828 optional int64 view_id = 2;
8829
8830 // Permission group viewed
8831 optional string permission_group_name = 3;
8832
8833 // UID of package for which permissions are viewed
8834 optional int32 uid = 4 [(is_uid) = true];
8835
8836 // Name of package for which permissions are viewed
8837 optional string package_name = 5;
8838
8839 // Category in which permission is included
8840 enum Category {
8841 UNDEFINED = 0;
8842 ALLOWED = 1;
8843 ALLOWED_FOREGROUND = 2;
8844 DENIED = 3;
8845 }
8846 optional Category category = 6;
8847}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008848/**
8849* Information about a PermissionAppsFragment viewed by user.
8850* Logged from ui/handheld/PermissionAppsFragment.java
8851*/
8852message PermissionAppsFragmentViewed {
8853 // id which identifies single session of user interacting with permission controller
8854 optional int64 session_id = 1;
8855
8856 // id which identifies single view as every view might have several logging records
8857 // with different package information attached
8858 optional int64 view_id = 2;
8859
8860 // Permission group viewed
8861 optional string permission_group_name = 3;
8862
8863 // UID of package for which permissions are viewed
8864 optional int32 uid = 4 [(is_uid) = true];
8865
8866 // Name of package for which permissions are viewed
8867 optional string package_name = 5;
8868
8869 // Category in which app is included
8870 enum Category {
8871 UNDEFINED = 0;
8872 ALLOWED = 1;
8873 ALLOWED_FOREGROUND = 2;
8874 DENIED = 3;
8875 }
8876 optional Category category = 6;
8877}
Tony Make2b1b672019-07-29 16:59:47 +01008878
8879/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008880* Log that the Auto Revoke notification has been clicked
8881* Logged from ui/ManagePermissionsActivity
8882*/
8883message AutoRevokeNotificationClicked {
8884 // id which identifies single session of user interacting with permission controller
8885 optional int64 session_id = 1;
8886}
8887
8888/**
8889* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8890* auto revoked for it.
8891* Logged from ui/handheld/AutoRevokeFragment
8892*/
8893message AutoRevokeFragmentAppViewed {
8894 // id which identifies single session of user interacting with permission controller
8895 optional int64 session_id = 1;
8896
8897 // UID of package for which permissions are viewed
8898 optional int32 uid = 2 [(is_uid) = true];
8899
8900 // Name of package for which permissions are viewed
8901 optional string package_name = 3;
8902
8903 // The name of a permission group that has been revoked
8904 optional string permission_group_name = 4;
8905
8906 // The age of the app- more than three months old, or more than six months
8907 enum Age {
8908 UNDEFINED = 0;
8909 NEWER_BUCKET = 1;
8910 OLDER_BUCKET = 2;
8911 }
8912
8913 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
8914 optional Age age = 5;
8915}
8916
8917/**
8918* Log that the user has interacted with an app on the auto revoke fragment
8919* Logged from ui/handheld/AutoRevokeFragment
8920*/
8921message AutoRevokedAppInteraction {
8922 // id which identifies single session of user interacting with permission controller
8923 optional int64 session_id = 1;
8924
8925 // UID of package for which permissions are viewed
8926 optional int32 uid = 2 [(is_uid) = true];
8927
8928 // Name of package for which permissions are viewed
8929 optional string package_name = 3;
8930
8931 enum Action {
8932 UNDEFINED = 0;
8933 REMOVE = 1;
8934 OPEN = 2;
8935 APP_INFO = 3;
8936 PERMISSIONS = 4;
8937 REMOVE_IN_SETTINGS = 5;
8938 OPEN_IN_SETTINGS = 6;
8939 }
8940
8941 // The action the user took to interact with the app
8942 optional Action action = 4;
8943}
8944
8945/**
8946* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
8947* auto revoke, or that the auto revoke switch has been changed
8948* Logged from ui/handheld/AppPermissionGroupsFragment
8949 */
8950message AppPermissionGroupsFragmentAutoRevokeAction {
8951 // id which identifies single session of user interacting with permission controller
8952 optional int64 session_id = 1;
8953
8954 // UID of package for which permissions are viewed
8955 optional int32 uid = 2 [(is_uid) = true];
8956
8957 // Name of package for which permissions are viewed
8958 optional string package_name = 3;
8959
8960 enum Action {
8961 UNDEFINED = 0;
8962 OPENED_FOR_AUTO_REVOKE = 1;
8963 OPENED_FROM_INTENT = 2;
8964 SWITCH_ENABLED = 3;
8965 SWITCH_DISABLED = 4;
8966 }
8967
8968 // The action the user took to interact with the fragment
8969 optional Action action = 4;
8970}
8971
8972/**
Tony Make2b1b672019-07-29 16:59:47 +01008973 * Logs when there is a smart selection related event.
8974 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8975 * Logged from: TextClassifierEventLogger.java
8976 */
8977message TextSelectionEvent {
8978 // A session ID.
8979 optional string session_id = 1;
8980
8981 // Event type of this event.
8982 optional android.stats.textclassifier.EventType event_type = 2;
8983
Tony Mak9c84bd22019-12-09 07:27:25 +00008984 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008985 optional string model_name = 3;
8986
8987 // Type of widget that was involved in triggering this event.
8988 optional android.stats.textclassifier.WidgetType widget_type = 4;
8989
8990 // Index of this event in a session.
8991 optional int32 event_index = 5;
8992
8993 // Entity type that is involved.
8994 optional string entity_type = 6;
8995
8996 // Relative word index of the start of the selection.
8997 optional int32 relative_word_start_index = 7;
8998
8999 // Relative word (exclusive) index of the end of the selection.
9000 optional int32 relative_word_end_index = 8;
9001
9002 // Relative word index of the start of the smart selection.
9003 optional int32 relative_suggested_word_start_index = 9;
9004
9005 // Relative word (exclusive) index of the end of the smart selection.
9006 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009007
9008 // Name of source package.
9009 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009010
9011 // Name of the LangID model that is involved in this event.
9012 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009013}
9014
9015/**
9016 * Logs when there is a smart linkify related event.
9017 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9018 * Logged from: TextClassifierEventLogger.java
9019 */
9020message TextLinkifyEvent {
9021 // A session ID.
9022 optional string session_id = 1;
9023
9024 // Event type of this event.
9025 optional android.stats.textclassifier.EventType event_type = 2;
9026
Tony Mak9c84bd22019-12-09 07:27:25 +00009027 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009028 optional string model_name = 3;
9029
9030 // Type of widget that was involved in triggering this event.
9031 optional android.stats.textclassifier.WidgetType widget_type = 4;
9032
9033 // Index of this event in a session.
9034 optional int32 event_index = 5;
9035
9036 // Entity type that is involved.
9037 optional string entity_type = 6;
9038
9039 // Number of links detected.
9040 optional int32 num_links = 7;
9041
9042 // The total length of all links.
9043 optional int32 linked_text_length = 8;
9044
9045 // Length of input text.
9046 optional int32 text_length = 9;
9047
9048 // Time spent on generating links in ms.
9049 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009050
9051 // Name of source package.
9052 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009053
9054 // Name of the LangID model that is involved in this event.
9055 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009056}
9057
9058/**
9059 * Logs when there is a conversation actions related event.
9060 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9061 * Logged from: TextClassifierEventLogger.java
9062 */
9063message ConversationActionsEvent {
9064 // A session ID.
9065 optional string session_id = 1;
9066
9067 // Event type of this event.
9068 optional android.stats.textclassifier.EventType event_type = 2;
9069
Tony Mak9c84bd22019-12-09 07:27:25 +00009070 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009071 optional string model_name = 3;
9072
9073 // Type of widget that was involved in triggering this event.
9074 optional android.stats.textclassifier.WidgetType widget_type = 4;
9075
9076 // The first entity type that is involved.
9077 optional string first_entity_type = 5;
9078
9079 // The second entity type that is involved.
9080 optional string second_entity_type = 6;
9081
9082 // The third entity type that is involved.
9083 optional string third_entity_type = 7;
9084
9085 // The score of the first entity type.
9086 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01009087
9088 // Name of source package.
9089 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00009090
9091 // Name of the annotator model that is involved in this event.
9092 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00009093
9094 // Name of the LangID model that is involved in this event.
9095 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01009096}
9097
9098/**
9099 * Logs when there is a language detection related event.
9100 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9101 * Logged from: TextClassifierEventLogger.java
9102 */
9103message LanguageDetectionEvent {
9104 // A session ID.
9105 optional string session_id = 1;
9106
9107 // Event type of this event.
9108 optional android.stats.textclassifier.EventType event_type = 2;
9109
Tony Mak9c84bd22019-12-09 07:27:25 +00009110 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009111 optional string model_name = 3;
9112
9113 // Type of widget that was involved in triggering this event.
9114 optional android.stats.textclassifier.WidgetType widget_type = 4;
9115
9116 // Detected language.
9117 optional string language_tag = 5;
9118
9119 // Score of the detected language.
9120 optional float score = 6;
9121
9122 // Position of this action.
9123 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01009124
9125 // Name of source package.
9126 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01009127}
Tianjie Xu167c3db2019-07-22 14:25:14 -07009128
9129/**
9130 * Information about an OTA update attempt by update_engine.
9131 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9132 */
9133message UpdateEngineUpdateAttemptReported {
9134 // The number of attempts for the update engine to apply a given payload.
9135 optional int32 attempt_number = 1;
9136
9137 optional android.stats.otaupdate.PayloadType payload_type = 2;
9138
9139 // The total time in minutes for the update engine to apply a given payload.
9140 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
9141 // it's increased when the system is sleeping.
9142 optional int32 duration_boottime_in_minutes = 3;
9143
9144 // The total time in minutes for the update engine to apply a given payload.
9145 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
9146 // and it's not increased when the system is sleeping.
9147 optional int32 duration_monotonic_in_minutes = 4;
9148
9149 // The size of the payload in MiBs.
9150 optional int32 payload_size_mib = 5;
9151
9152 // The attempt result reported by the update engine for an OTA update.
9153 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
9154
9155 // The error code reported by the update engine after an OTA update attempt
9156 // on A/B devices.
9157 optional android.stats.otaupdate.ErrorCode error_code = 7;
9158
9159 // The build fingerprint of the source system. The value is read from a
9160 // system property when the device takes the update. e.g.
9161 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
9162 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01009163
9164 // Size of super partition.
9165 optional int64 super_partition_size_bytes = 9;
9166
9167 // Size of current slot within the super partition.
9168 optional int64 slot_size_bytes = 10;
9169
9170 // Free space available in the super partition.
9171 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009172}
9173
9174/**
9175 * Information about all the attempts the device make before finishing the
9176 * successful update.
9177 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9178 */
9179message UpdateEngineSuccessfulUpdateReported {
9180 // The number of attempts for the update engine to apply the payload for a
9181 // successful update.
9182 optional int32 attempt_count = 1;
9183
9184 optional android.stats.otaupdate.PayloadType payload_type = 2;
9185
9186 optional int32 payload_size_mib = 3;
9187
9188 // The total number of bytes downloaded by update_engine since the last
9189 // successful update.
9190 optional int32 total_bytes_downloaded_mib = 4;
9191
9192 // The ratio in percentage of the over-downloaded bytes compared to the
9193 // total bytes needed to successfully install the update. e.g. 200 if we
9194 // download 200MiB in total for a 100MiB package.
9195 optional int32 download_overhead_percentage = 5;
9196
9197 // The total time in minutes for the update engine to apply the payload for a
9198 // successful update.
9199 optional int32 total_duration_minutes = 6;
9200
9201 // The number of reboot of the device during a successful update.
9202 optional int32 reboot_count = 7;
9203}
Alec Mourie088e762019-07-02 13:10:55 -07009204
9205/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009206 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9207 * key to indicate whether it was successful or not.
9208 *
9209 * Logged from:
9210 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9211 */
9212message RebootEscrowRecoveryReported {
9213 optional bool successful = 1;
9214}
9215
9216/**
Alec Mourie088e762019-07-02 13:10:55 -07009217 * Global display pipeline metrics reported by SurfaceFlinger.
9218 * Pulled from:
9219 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9220 */
9221message SurfaceflingerStatsGlobalInfo {
9222 // Total number of frames presented during the tracing period
9223 optional int64 total_frames = 1;
9224 // Total number of frames missed
9225 optional int64 missed_frames = 2;
9226 // Total number of frames that fell back to client composition
9227 optional int64 client_composition_frames = 3;
9228 // Total time the display was turned on
9229 optional int64 display_on_millis = 4;
9230 // Total time that was spent performing animations.
9231 // This is derived from the present-to-present layer histogram
9232 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009233 // Total number of event connections tracked by SurfaceFlinger at the time
9234 // of this pull. If this number grows prohibitively large, then this can
9235 // cause jank due to resource contention.
9236 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009237 // Set of timings measured from when SurfaceFlinger began compositing a
9238 // frame, until the frame was requested to be presented to the display. This
9239 // measures SurfaceFlinger's total CPU walltime on the critical path per
9240 // frame.
9241 optional FrameTimingHistogram frame_duration = 7
9242 [(android.os.statsd.log_mode) = MODE_BYTES];
9243 // Set of timings measured from when SurfaceFlinger first began using the
9244 // GPU to composite a frame, until the GPU has finished compositing that
9245 // frame. This measures the total additional time SurfaceFlinger needed to
9246 // perform due to falling back into GPU composition.
9247 optional FrameTimingHistogram render_engine_timing = 8
9248 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009249}
9250
9251/**
9252 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9253 * The number of layers uploaded will be restricted due to size limitations.
9254 * Pulled from:
9255 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9256 */
9257message SurfaceflingerStatsLayerInfo {
9258 // The layer for this set of metrics
9259 // For now we can infer that the package name is included in the layer
9260 // name.
9261 optional string layer_name = 1;
9262 // Total number of frames presented
9263 optional int64 total_frames = 2;
9264 // Total number of dropped frames while latching a buffer for this layer.
9265 optional int64 dropped_frames = 3;
9266 // Set of timings measured between successive presentation timestamps.
9267 optional FrameTimingHistogram present_to_present = 4
9268 [(android.os.statsd.log_mode) = MODE_BYTES];
9269 // Set of timings measured from when an app queued a buffer for
9270 // presentation, until the buffer was actually presented to the
9271 // display.
9272 optional FrameTimingHistogram post_to_present = 5
9273 [(android.os.statsd.log_mode) = MODE_BYTES];
9274 // Set of timings measured from when a buffer is ready to be presented,
9275 // until the buffer was actually presented to the display.
9276 optional FrameTimingHistogram acquire_to_present = 6
9277 [(android.os.statsd.log_mode) = MODE_BYTES];
9278 // Set of timings measured from when a buffer was latched by
9279 // SurfaceFlinger, until the buffer was presented to the display
9280 optional FrameTimingHistogram latch_to_present = 7
9281 [(android.os.statsd.log_mode) = MODE_BYTES];
9282 // Set of timings measured from the desired presentation to the actual
9283 // presentation time
9284 optional FrameTimingHistogram desired_to_present = 8
9285 [(android.os.statsd.log_mode) = MODE_BYTES];
9286 // Set of timings measured from when an app queued a buffer for
9287 // presentation, until the buffer was ready to be presented.
9288 optional FrameTimingHistogram post_to_acquire = 9
9289 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009290 // Frames missed latch because the acquire fence didn't fire
9291 optional int64 late_acquire_frames = 10;
9292 // Frames latched early because the desired present time was bad
9293 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009294}
9295
9296/**
9297 * Histogram of frame counts bucketed by time in milliseconds.
9298 * Because of size limitations, we hard-cap the number of buckets, with
9299 * buckets for corresponding to larger milliseconds being less precise.
9300 */
9301message FrameTimingHistogram {
9302 // Timings in milliseconds that describes a set of histogram buckets
9303 repeated int32 time_millis_buckets = 1;
9304 // Number of frames that match to each time_millis, i.e. the bucket
9305 // contents
9306 // It's required that len(time_millis) == len(frame_count)
9307 repeated int64 frame_counts = 2;
9308}
Emilian Peev6729f372019-08-29 09:14:09 -07009309
Emilian Peev6729f372019-08-29 09:14:09 -07009310/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009311 * Janky event as reported by SurfaceFlinger.
9312 * This event is intended to be consumed by a Perfetto subscriber for
9313 * automated trace collection.
9314 *
9315 * Logged from:
9316 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9317 */
9318message DisplayJankReported {
9319 // Informational field for how long the janky event lasted in milliseconds
9320 optional int64 event_duration_millis = 1;
9321 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9322 // the display on time.
9323 optional int32 present_deadlines_missed = 2;
9324}
9325
9326/**
Emilian Peev6729f372019-08-29 09:14:09 -07009327 * Information about camera facing and API level usage.
9328 * Logged from:
9329 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9330 */
9331message CameraActionEvent {
9332 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009333 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009334
9335 // Camera API level used
9336 optional int32 api_level = 2;
9337
9338 // Name of client package
9339 optional string package_name = 3;
9340
9341 // Camera facing
9342 enum Facing {
9343 UNKNOWN = 0;
9344 BACK = 1;
9345 FRONT = 2;
9346 EXTERNAL = 3;
9347 }
9348 optional Facing facing = 4;
9349}
atrost01a20932019-08-28 15:40:37 +01009350
9351/**
9352 * Logs when a compatibility change is affecting an app.
9353 *
9354 * Logged from:
9355 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9356 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9357 */
9358message AppCompatibilityChangeReported {
9359 // The UID of the app being affected by the compatibilty change.
9360 optional int32 uid = 1 [(is_uid) = true];
9361
9362 // The ID of the change affecting the app.
9363 optional int64 change_id = 2;
9364
9365 enum State {
9366 UNKNOWN_STATE = 0;
9367 ENABLED = 1;
9368 DISABLED = 2;
9369 LOGGED = 3;
9370 }
9371
9372 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9373 // logged otherwise.
9374 optional State state = 3;
9375
9376 enum Source {
9377 UNKNOWN_SOURCE = 0;
9378 APP_PROCESS = 1;
9379 SYSTEM_SERVER = 2;
9380 }
9381
9382 // Where it was logged from.
9383 optional Source source = 4;
9384
9385}
Hector Dearman40579f62019-11-01 13:19:30 +00009386
9387/**
9388 * Logged from
9389 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9390 */
9391message PerfettoUploaded {
9392 enum Event {
9393 PERFETTO_UNDEFINED = 0;
9394 PERFETTO_TRACE_BEGIN = 1;
9395 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9396 PERFETTO_ON_CONNECT = 3;
9397 PERFETTO_ON_TRACING_DISABLED = 4;
9398 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9399 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9400 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9401 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9402 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9403 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9404 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9405 PERFETTO_TRIGGER_BEGIN = 12;
9406 PERFETTO_TRIGGER_SUCCESS = 13;
9407 PERFETTO_TRIGGER_FAILURE = 14;
9408 PERFETTO_HIT_GUARDRAILS = 15;
9409 PERFETTO_ON_TIMEOUT = 16;
9410 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9411 }
9412
9413 // Which stage of the pipeline we are reporting from.
9414 optional Event event = 1;
9415
9416 // UUID matching the one set inside the SystemInfo trace packet.
9417 optional int64 trace_uuid_lsb = 2;
9418 optional int64 trace_uuid_msb = 3;
9419}
Mark Tabrya824a642019-11-05 12:26:12 -08009420
9421/**
9422 * Pulls client metrics on data transferred via Vehicle Maps Service.
9423 * Metrics are keyed by uid + layer.
9424 *
9425 * Pulled from:
9426 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9427 */
9428message VmsClientStats {
9429 // UID of the VMS client app
9430 optional int32 uid = 1 [(is_uid) = true];
9431
9432 // VMS layer definition
9433 optional int32 layer_type = 2;
9434 optional int32 layer_channel = 3;
9435 optional int32 layer_version = 4;
9436
9437 // Bytes and packets sent by the client for the layer
9438 optional int64 tx_bytes = 5;
9439 optional int64 tx_packets = 6;
9440
9441 // Bytes and packets received by the client for the layer
9442 optional int64 rx_bytes = 7;
9443 optional int64 rx_packets = 8;
9444
9445 // Bytes and packets dropped due to client error
9446 optional int64 dropped_bytes = 9;
9447 optional int64 dropped_packets = 10;
9448}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009449
9450/**
9451 * State of a dangerous permission requested by a package - sampled
9452 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9453*/
9454message DangerousPermissionStateSampled {
9455 // Name of the permission
9456 optional string permission_name = 1;
9457
9458 // Uid of the package
9459 optional int32 uid = 2 [(is_uid) = true];
9460
9461 // If the permission is granted to the uid
9462 optional bool is_granted = 3;
9463
9464 // Permission flags as per android.content.pm.PermissionFlags
9465 optional int32 permission_flags = 4;
9466}
9467
Stan Iliev637ba5e2019-08-16 13:43:08 -04009468/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009469 * HWUI stats for a given app.
9470 */
9471message GraphicsStats {
9472 // The package name of the app
9473 optional string package_name = 1;
9474
9475 // The version code of the app
9476 optional int64 version_code = 2;
9477
9478 // The start & end timestamps in UTC as
9479 // milliseconds since January 1, 1970
9480 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009481 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009482
Stan Ilievb6517192020-02-18 10:12:42 -05009483 optional int64 end_millis = 4;
9484
9485 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9486 enum PipelineType {
9487 UNKNOWN = 0;
9488 GL = 1;
9489 VULKAN = 2;
9490 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009491
9492 // HWUI renders pipeline type: GL or Vulkan.
9493 optional PipelineType pipeline = 5;
9494
9495 // Distinct frame count.
9496 optional int32 total_frames = 6;
9497
9498 // Number of "missed vsync" events.
9499 optional int32 missed_vsync_count = 7;
9500
9501 // Number of frames in triple-buffering scenario (high input latency)
9502 optional int32 high_input_latency_count = 8;
9503
9504 // Number of "slow UI thread" events.
9505 optional int32 slow_ui_thread_count = 9;
9506
9507 // Number of "slow bitmap upload" events.
9508 optional int32 slow_bitmap_upload_count = 10;
9509
9510 // Number of "slow draw" events.
9511 optional int32 slow_draw_count = 11;
9512
9513 // Number of frames that missed their deadline (aka, visibly janked)
9514 optional int32 missed_deadline_count = 12;
9515
9516 // The frame time histogram for the package
9517 optional FrameTimingHistogram cpu_histogram = 13
9518 [(android.os.statsd.log_mode) = MODE_BYTES];
9519
9520 // The gpu frame time histogram for the package
9521 optional FrameTimingHistogram gpu_histogram = 14
9522 [(android.os.statsd.log_mode) = MODE_BYTES];
9523
9524 // UI mainline module version.
9525 optional int64 version_ui_module = 15;
9526
9527 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9528 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9529 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9530 // more apps are running / rendering.
9531 optional bool is_today = 16;
9532}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009533
9534/**
9535 * Message related to dangerous (runtime) app ops access
9536 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009537message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009538 // Uid of the package accessing app op
9539 optional int32 uid = 1 [(is_uid) = true];
9540
9541 // Name of the package accessing app op
9542 optional string package_name = 2;
9543
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009544 // deprecated - set to empty string
9545 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009546
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009547 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009548 // API. Attributions must be provided through manifest using <attribution> tag available in R
9549 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009550 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009551
9552 // message related to app op access, limited to 600 chars by API
9553 optional string message = 5;
9554
9555 enum SamplingStrategy {
9556 DEFAULT = 0;
9557 UNIFORM = 1;
9558 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009559 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009560 }
9561
9562 // sampling strategy used to collect this message
9563 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009564
9565 // operation id
9566 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009567}
9568
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009569/*
9570 * Logs userspace reboot outcome and duration.
9571 *
9572 * Logged from:
9573 * frameworks/base/core/java/com/android/server/BootReceiver.java
9574 */
9575message UserspaceRebootReported {
9576 // Possible outcomes of userspace reboot.
9577 enum Outcome {
9578 // Default value in case platform failed to determine the outcome.
9579 OUTCOME_UNKNOWN = 0;
9580 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9581 SUCCESS = 1;
9582 // Userspace reboot shutdown sequence was aborted.
9583 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9584 // Remounting userdata into checkpointing mode failed.
9585 FAILED_USERDATA_REMOUNT = 3;
9586 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9587 // reboot.
9588 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9589 }
9590 // Outcome of userspace reboot. Always set.
9591 optional Outcome outcome = 1;
9592 // Duration of userspace reboot in case it has a successful outcome.
9593 // Duration is measured as time between userspace reboot was initiated and until boot completed
9594 // (e.g. sys.boot_completed=1).
9595 optional int64 duration_millis = 2;
9596 // State of primary user's (user0) credential encryption storage.
9597 enum UserEncryptionState {
9598 // Default value.
9599 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9600 // Credential encrypted storage is unlocked.
9601 UNLOCKED = 1;
9602 // Credential encrypted storage is locked.
9603 LOCKED = 2;
9604 }
9605 // State of primary user's encryption storage at the moment boot completed. Always set.
9606 optional UserEncryptionState user_encryption_state = 3;
9607}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009608
9609/*
9610 * Logs integrity check information during each install.
9611 *
9612 * Logged from:
9613 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9614 */
9615message IntegrityCheckResultReported {
9616 optional string package_name = 1;
9617 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009618 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009619 optional string installer_package_name = 4;
9620 enum Response {
9621 UNKNOWN = 0;
9622 ALLOWED = 1;
9623 REJECTED = 2;
9624 FORCE_ALLOWED = 3;
9625 }
9626 optional Response response = 5;
9627 // An estimate on the cause of the response. This will only be populated for
9628 // REJECTED and FORCE_ALLOWED
9629 optional bool caused_by_app_cert_rule = 6;
9630 optional bool caused_by_installer_rule = 7;
9631}
9632
9633/**
9634 * Logs the information about the rules and the provider whenever rules are
9635 * pushed into AppIntegrityManager.
9636 *
9637 * Logged from:
9638 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9639 */
9640message IntegrityRulesPushed {
9641 optional bool success = 1;
9642 // Package name of the app that pushed the rules.
9643 optional string rule_provider = 2;
9644 // Version string of arbitrary format provided by the rule provider to
9645 // identify the rules.
9646 optional string rule_version = 3;
9647}
Jordan Liubedfa702019-12-20 15:08:45 -08009648
9649/**
9650 * Logs when a cell broadcast message is received on the device.
9651 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009652 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009653 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009654 * packages/apps/CellBroadcastReceiver/
9655 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009656 */
9657message CellBroadcastMessageReported {
9658 // The type of Cell Broadcast message
9659 enum CbType {
9660 UNKNOWN_TYPE = 0;
9661 GSM = 1;
9662 CDMA = 2;
9663 CDMA_SPC = 3;
9664 }
9665
Jordan Liu900e5cb2020-05-29 09:44:59 -07009666 // The parts of the cell broadcast message pipeline
9667 enum ReportSource {
9668 UNKNOWN_SOURCE = 0;
9669 FRAMEWORK = 1;
9670 CB_SERVICE = 2;
9671 CB_RECEIVER_APP = 3;
9672 }
9673
Jordan Liubedfa702019-12-20 15:08:45 -08009674 // GSM, CDMA, CDMA-SCP
9675 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009676
9677 // The source of the report
9678 optional ReportSource source = 2;
9679}
9680
9681/**
9682 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9683 *
9684 * Logged from CellBroadcastService module:
9685 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9686 */
9687message CellBroadcastMessageFiltered {
9688 enum FilterReason {
9689 NOT_FILTERED = 0;
9690 DUPLICATE_MESSAGE = 1;
9691 GEOFENCED_MESSAGE = 2;
9692 AREA_INFO_MESSAGE = 3;
9693 }
9694
9695 // GSM, CDMA, CDMA-SCP
9696 optional CellBroadcastMessageReported.CbType type = 1;
9697
9698 // The source of the report
9699 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009700}
9701
9702/**
9703 * Logs when an error occurs while handling a cell broadcast message;
9704 *
9705 * Logged from CellBroadcastService module:
9706 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9707 */
9708message CellBroadcastMessageError {
9709 // The type of error raised when trying to handle a cell broadcast message
9710 enum ErrorType {
9711 UNKNOWN_TYPE = 0;
9712 CDMA_DECODING_ERROR = 1;
9713 CDMA_SCP_EMPTY = 2;
9714 CDMA_SCP_HANDLING_ERROR = 3;
9715 GSM_INVALID_HEADER_LENGTH = 4;
9716 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9717 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9718 GSM_INVALID_PDU = 7;
9719 GSM_INVALID_GEO_FENCING_DATA = 8;
9720 GSM_UMTS_INVALID_WAC = 9;
9721 FAILED_TO_INSERT_TO_DB = 10;
9722 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9723 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9724 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9725 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009726 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009727 }
9728
9729 // What kind of error occurred
9730 optional ErrorType type = 1;
9731
9732 // Exception message (or log message) associated with the error (max 1000 chars)
9733 optional string exception_message = 2;
9734}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009735
9736/**
Henry Fange316ab62020-04-21 18:43:14 -07009737 * Logs when a tune occurs through device's Frontend.
9738 * This is atom ID 276.
9739 *
9740 * Logged from:
9741 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9742 */
9743message TvTunerStateChanged {
9744 enum State {
9745 UNKNOWN = 0;
9746 TUNING = 1; // Signal is tuned
9747 LOCKED = 2; // the signal is locked
9748 NOT_LOCKED = 3; // the signal isn’t locked.
9749 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9750 SCANNING = 5; // the signal is scanned
9751 SCAN_STOPPED = 6; // the scan is stopped.
9752 }
9753 // The uid of the application that sent this custom atom.
9754 optional int32 uid = 1 [(is_uid) = true];
9755 // new state
9756 optional State state = 2;
9757}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009758
9759/**
9760 * Logs the status of a dvr playback or record.
9761 * This is atom ID 279.
9762 *
9763 * Logged from:
9764 * frameworks/base/media/java/android/media/tv/tuner/dvr
9765 */
9766message TvTunerDvrStatus {
9767 enum Type {
9768 UNKNOWN_TYPE = 0;
9769 PLAYBACK = 1; // is a playback
9770 RECORD = 2; // is a record
9771 }
9772 enum State {
9773 UNKNOWN_STATE = 0;
9774 STARTED = 1; // DVR is started
9775 STOPPED = 2; // DVR is stopped
9776 }
9777 // The uid of the application that sent this custom atom.
9778 optional int32 uid = 1 [(is_uid) = true];
9779 // DVR type
9780 optional Type type = 2;
9781 // DVR state
9782 optional State state = 3;
9783 // Identify the segment of a record or playback
9784 optional int32 segment_id = 4;
9785 // indicate how many overflow or underflow happened between started to stopped
9786 optional int32 overflow_underflow_count = 5;
9787}
Henry Fangfd40c072020-06-01 14:59:17 -07009788
9789/**
9790 * Logs when a cas session opened through MediaCas.
9791 * This is atom ID 280.
9792 *
9793 * Logged from:
9794 * frameworks/base/media/java/android/media/MediaCas.java
9795 */
9796message TvCasSessionOpenStatus {
9797 enum State {
9798 UNKNOWN = 0;
9799 SUCCEEDED = 1; // indicate that the session is opened successfully.
9800 FAILED = 2; // indicate that the session isn’t opened successfully.
9801 }
9802 // The uid of the application that sent this custom atom.
9803 optional int32 uid = 1 [(is_uid) = true];
9804 // Cas system Id
9805 optional int32 cas_system_id = 2;
9806 // State of the session
9807 optional State state = 3;
9808}
9809
Henry Fange316ab62020-04-21 18:43:14 -07009810/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009811 * Logs when an app is frozen or unfrozen.
9812 *
9813 * Logged from:
9814 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9815 */
9816message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009817 // The type of event.
9818 enum Action {
9819 UNKNOWN = 0;
9820 FREEZE_APP = 1;
9821 UNFREEZE_APP = 2;
9822 }
9823 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009824
Blake Kragten6ce382a2020-01-16 20:20:46 -08009825 // Pid of the process being frozen.
9826 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009827
Blake Kragten6ce382a2020-01-16 20:20:46 -08009828 // Name of the process being frozen.
9829 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009830
Blake Kragten6ce382a2020-01-16 20:20:46 -08009831 // Time since last unfrozen.
9832 optional int64 time_unfrozen_millis = 4;
9833}
9834
9835/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009836 * Pulls information for a single voice call.
9837 *
9838 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9839 *
9840 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009841 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009842 */
9843message VoiceCallSession {
9844 // Bearer (IMS or CS) when the call started.
9845 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9846
9847 // Bearer (IMS or CS) when the call ended.
9848 // The bearer may change during the call, e.g. due to SRVCC.
9849 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9850
9851 // Direction of the call (incoming or outgoing).
9852 optional android.telephony.CallDirectionEnum direction = 3;
9853
9854 // Time spent setting up the call.
9855 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9856
9857 // Whether the call ended before the setup was completed.
9858 optional bool setup_failed = 5;
9859
9860 // IMS reason code or CS disconnect cause.
9861 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9862 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9863 optional int32 disconnect_reason_code = 6;
9864
9865 // IMS extra code or CS precise disconnect cause.
9866 // For IMS, this code is vendor-specific
9867 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9868 optional int32 disconnect_extra_code = 7;
9869
9870 // IMS extra message or CS vendor cause.
9871 optional string disconnect_extra_message = 8;
9872
9873 // Radio access technology (RAT) used when call started.
9874 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9875
9876 // Radio access technology (RAT) used when call terminated.
9877 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9878
9879 // Number of times RAT changed during the call.
9880 optional int64 rat_switch_count = 11;
9881
9882 // A bitmask of all codecs used during the call.
9883 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9884 optional int64 codec_bitmask = 12;
9885
9886 // Number of other calls going on during call setup, for the same SIM slot.
9887 optional int32 concurrent_call_count_at_start = 13;
9888
9889 // Number of other calls going on during call termination, for the same SIM slot.
9890 optional int32 concurrent_call_count_at_end = 14;
9891
9892 // Index of the SIM is used, 0 for single-SIM devices.
9893 optional int32 sim_slot_index = 15;
9894
9895 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9896 optional bool is_multi_sim = 16;
9897
9898 // Whether the call was made with an eSIM profile.
9899 optional bool is_esim = 17;
9900
9901 // Carrier ID of the SIM card.
9902 // See https://source.android.com/devices/tech/config/carrierid.
9903 optional int32 carrier_id = 18;
9904
Chi Zhangba1b03a2020-04-21 17:17:56 -07009905 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -07009906 optional bool srvcc_completed = 19;
9907
9908 // Number of SRVCC failures.
9909 optional int64 srvcc_failure_count = 20;
9910
9911 // Number of SRVCC cancellations.
9912 optional int64 srvcc_cancellation_count = 21;
9913
Chi Zhangba1b03a2020-04-21 17:17:56 -07009914 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
9915 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -07009916 optional bool rtt_enabled = 22;
9917
9918 // Whether this was an emergency call.
9919 optional bool is_emergency = 23;
9920
9921 // Whether the call was performed while roaming.
9922 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -07009923
9924 // A random number used as the dimension field to pull multiple atoms.
9925 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -07009926}
9927
9928/**
9929 * Pulls voice call radio access technology (RAT) usage.
9930 *
9931 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9932 * time. The atom will be skipped if not enough data is available.
9933 *
9934 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009935 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009936 */
9937message VoiceCallRatUsage {
9938 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9939 optional int32 carrier_id = 1;
9940
9941 // Radio access technology.
9942 optional android.telephony.NetworkTypeEnum rat = 2;
9943
9944 // Total duration that voice calls spent on this carrier and RAT.
9945 optional int64 total_duration_seconds = 3;
9946
9947 // Total number of calls using this carrier and RAT.
9948 // A call is counted once even if it used the RAT multiple times.
9949 optional int64 call_count = 4;
9950}
9951
9952/**
9953 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9954 *
9955 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009956 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009957 */
9958message SimSlotState {
9959 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9960 optional int32 active_slot_count = 1;
9961
9962 // Number of SIM cards (both physical and active eSIM profiles).
9963 // This number is always equal to or less than the number of active SIM slots.
9964 optional int32 sim_count = 2;
9965
9966 // Number of active eSIM profiles.
9967 // This number is always equal to or less than the number of SIMs.
9968 optional int32 esim_count = 3;
9969}
9970
9971/**
9972 * Pulls supported cellular radio access technologies.
9973 *
9974 * This atom reports the capabilities of the device, rather than the network it has access to.
9975 *
9976 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009977 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009978 */
9979message SupportedRadioAccessFamily {
9980 // A bitmask of supported radio technologies.
9981 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9982 optional int64 network_type_bitmask = 1;
9983}
9984
9985/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009986 * Logs gnss stats from location service provider
9987 *
9988 * Pulled from:
9989 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9990 */
9991
9992message GnssStats {
9993 // Number of location reports since boot
9994 optional int64 location_reports = 1;
9995
9996 // Total pulled reports of Location failures since boot
9997 optional int64 location_failure_reports = 2;
9998
9999 // Number of time to first fix reports since boot
10000 optional int64 time_to_first_fix_reports = 3;
10001
10002 // Total pulled reported time to first fix (in milli-seconds) since boot
Blake Kragten850a9d432020-06-11 09:05:39 -070010003 optional int64 time_to_first_fix_millis = 4;
Blake Kragten6ce382a2020-01-16 20:20:46 -080010004
10005 // Number of position accuracy reports since boot
10006 optional int64 position_accuracy_reports = 5;
10007
10008 // Total pulled reported position accuracy (in meters) since boot
10009 optional int64 position_accuracy_meters = 6;
10010
10011 // Number of top 4 average CN0 reports since boot
10012 optional int64 top_four_average_cn0_reports = 7;
10013
10014 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
10015 optional int64 top_four_average_cn0_db_mhz = 8;
10016
10017 // Number of l5 top 4 average CN0 reports since boot
10018 optional int64 l5_top_four_average_cn0_reports = 9;
10019
10020 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
10021 optional int64 l5_top_four_average_cn0_db_mhz = 10;
10022
10023 // Total number of sv status messages reports since boot
10024 optional int64 sv_status_reports = 11;
10025
10026 // Total number of sv status messages reports, where sv is used in fix since boot
10027 optional int64 sv_status_reports_used_in_fix = 12;
10028
10029 // Total number of L5 sv status messages reports since boot
10030 optional int64 l5_sv_status_reports = 13;
10031
10032 // Total number of L5 sv status messages reports, where sv is used in fix since boot
10033 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -080010034}
Kweku Adams12752132020-02-18 15:36:48 -080010035
10036/**
10037 * Logs when an app is moved to a different standby bucket.
10038 *
10039 * Logged from:
10040 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
10041 */
10042message AppStandbyBucketChanged {
10043 optional string package_name = 1;
10044
10045 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
10046 optional int32 user_id = 2;
10047
10048 // These enum values match the constants defined in UsageStatsManager.java.
10049 enum Bucket {
10050 BUCKET_UNKNOWN = 0;
10051 BUCKET_EXEMPTED = 5;
10052 BUCKET_ACTIVE = 10;
10053 BUCKET_WORKING_SET = 20;
10054 BUCKET_FREQUENT = 30;
10055 BUCKET_RARE = 40;
10056 BUCKET_RESTRICTED = 45;
10057 BUCKET_NEVER = 50;
10058 }
10059 optional Bucket bucket = 3;
10060
10061 enum MainReason {
10062 MAIN_UNKNOWN = 0;
10063 MAIN_DEFAULT = 0x0100;
10064 MAIN_TIMEOUT = 0x0200;
10065 MAIN_USAGE = 0x0300;
10066 MAIN_FORCED_BY_USER = 0x0400;
10067 MAIN_PREDICTED = 0x0500;
10068 MAIN_FORCED_BY_SYSTEM = 0x0600;
10069 }
10070 optional MainReason main_reason = 4;
10071
10072 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
10073 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
10074 // UsageStatsManager.java.
10075 optional int32 sub_reason = 5;
10076}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010077
10078/**
10079* Reports a started sharesheet transaction.
10080*
10081* Logged from:
10082* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
10083*/
10084message SharesheetStarted {
10085 // The event_id (as for UiEventReported).
10086 optional int32 event_id = 1;
10087 // The calling app's package name.
10088 optional string package_name = 2;
10089 // An identifier to tie together multiple logs relating to the same share event
10090 optional int32 instance_id = 3;
10091 // The mime type of the share
10092 optional string mime_type = 4;
10093 // The number of direct targets the calling app is providing that will be shown.
10094 optional int32 num_app_provided_direct_targets = 5;
10095 // The number of app targets the calling app is providing that will be shown.
10096 optional int32 num_app_provided_app_targets = 6;
10097 // True if the share originates from the workprofile
10098 optional bool is_workprofile = 7;
10099
10100 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010101 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010102 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
10103 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
10104 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
10105 }
10106 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010107 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010108
10109 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
10110 INTENT_DEFAULT = 0;
10111 INTENT_ACTION_VIEW = 1;
10112 INTENT_ACTION_EDIT = 2;
10113 INTENT_ACTION_SEND = 3;
10114 INTENT_ACTION_SENDTO = 4;
10115 INTENT_ACTION_SEND_MULTIPLE = 5;
10116 INTENT_ACTION_IMAGE_CAPTURE = 6;
10117 INTENT_ACTION_MAIN = 7;
10118 }
10119 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010120 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010121}
10122
10123/**
10124 * Reports a ranking selection event.
10125 *
10126 * Logged from:
10127 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
10128 */
10129message RankingSelected {
10130 // The event_id (as for UiEventReported).
10131 optional int32 event_id = 1;
10132 // The relevant app's package name (can be source or picked package).
10133 optional string package_name = 2;
10134 // An identifier to tie together multiple logs relating to the same share event.
10135 optional int32 instance_id = 3;
10136 // Which of the ranked targets got picked, default starting position 0.
10137 optional int32 position_picked = 4;
10138}
Raff Tsaiea4db182020-03-06 07:45:43 +080010139
10140/**
Zhen Sun0bec8d42020-03-25 17:17:29 -070010141 * Logs when TvSettings UI is interacted at.
10142 *
10143 * Logged from: packages/apps/TvSettings
10144 */
10145message TvSettingsUIInteracted {
10146
10147 /** The UI action category */
10148 optional android.app.tvsettings.Action action = 1;
10149
10150 /** The ID of the entry that the users actioned on */
10151 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -070010152}
10153
10154/**
Songchun Fanc296cf72020-03-31 18:38:52 -070010155 * Logs information about a package installation using package installer V2 APIs.
10156 *
10157 * Logged from:
10158 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
10159 */
10160message PackageInstallerV2Reported {
10161 // Whether this installation uses Incremental File System
10162 optional bool is_incremental = 1;
10163 // Name of the package that is intended to be installed
10164 optional string package_name = 2;
10165 // The duration between when the install was requested to when the install has completed
10166 optional int64 duration_millis = 3;
10167 // Installation result in final integer, which are SystemApi's.
10168 // Return_code 1 indicates success.
10169 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
10170 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010171 // Total size of the APKs installed for this package
10172 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010173}
10174
10175/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010176 * Logs settings provider values.
10177 *
10178 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10179 * then write the value to proto.
10180 *
10181 */
10182message SettingSnapshot {
10183
10184 // Setting key
10185 optional string name = 1;
10186
10187 enum SettingsValueType {
10188 NOTASSIGNED = 0;
10189 ASSIGNED_BOOL_TYPE = 1;
10190 ASSIGNED_INT_TYPE = 2;
10191 ASSIGNED_FLOAT_TYPE = 3;
10192 ASSIGNED_STRING_TYPE = 4;
10193 };
10194 // Setting value type
10195 optional SettingsValueType type = 2;
10196
10197 optional bool bool_value = 3;
10198
10199 optional int32 int_value = 4;
10200
10201 optional float float_value = 5;
10202
10203 optional string str_value = 6;
10204
10205 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10206 optional int32 user_id = 7;
10207}
Varun Shahacb56342019-12-18 11:45:38 -080010208
10209/**
10210 * An event logged to indicate that a user journey is about to be performed. This atom includes
10211 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10212 * will immediately follow this atom which will describe the event(s) and its state.
10213 *
10214 * Logged from:
10215 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10216 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10217 */
10218message UserLifecycleJourneyReported {
10219 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10220 // UserLifecycleEventOccurred atom)
10221 optional int64 session_id = 1;
10222
10223 // Indicates what type of user journey this session is related to
10224 enum Journey {
10225 UNKNOWN = 0; // Undefined user lifecycle journey
10226 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10227 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10228 USER_START = 3; // A user start journey
10229 USER_CREATE = 4; // A user creation journey
10230 }
10231 optional Journey journey = 2;
10232 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10233 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10234 optional int32 origin_user = 3;
10235 // Which user the journey is targeting
10236 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10237 optional int32 target_user = 4;
10238
10239 // What is the user type of the target user
10240 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10241 enum UserType {
10242 TYPE_UNKNOWN = 0;
10243 FULL_SYSTEM = 1;
10244 FULL_SECONDARY = 2;
10245 FULL_GUEST = 3;
10246 FULL_DEMO = 4;
10247 FULL_RESTRICTED = 5;
10248 PROFILE_MANAGED = 6;
10249 SYSTEM_HEADLESS = 7;
10250 }
10251 optional UserType user_type = 5;
10252 // What are the flags attached to the target user
10253 optional int32 user_flags = 6;
10254}
10255
10256/**
10257 * An event logged when a specific user lifecycle event is performed. These events should be
10258 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10259 * Note: journeys can span over multiple events, hence some events may share a single session id.
10260 *
10261 * Logged from:
10262 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10263 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10264 */
10265message UserLifecycleEventOccurred {
10266 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10267 optional int64 session_id = 1;
10268 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10269 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10270 optional int32 user_id = 2;
10271
10272 enum Event {
10273 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10274 SWITCH_USER = 1; // Indicates that this is a user switch event
10275 START_USER = 2; // Indicates that this is a user start event
10276 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010277 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10278 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10279 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010280 }
10281 optional Event event = 3;
10282
10283 enum State {
10284 NONE = 0; // Indicates the associated event has no start/end defined
10285 BEGIN = 1;
10286 FINISH = 2;
10287 }
10288 optional State state = 4; // Represents the state of an event (beginning/ending)
10289}
jasonwshsu81173e32020-03-27 15:22:03 +080010290
10291/**
10292 * Logs when accessibility shortcut clicked.
10293 *
10294 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010295 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010296 */
10297message AccessibilityShortcutReported {
10298 // The accessibility feature(including installed a11y service, framework a11y feature,
10299 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10300 optional string package_name = 1;
10301
10302 // The definition of the accessibility shortcut.
10303 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10304 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10305
10306 // The definition of the service status.
10307 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10308 optional android.stats.accessibility.ServiceStatus service_status = 3;
10309}
10310
10311/**
10312 * Logs when accessibility service status changed.
10313 *
10314 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010315 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010316 */
10317message AccessibilityServiceReported {
10318 // The accessibility service package name.
10319 optional string package_name = 1;
10320
10321 // The definition of the service status.
10322 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10323 optional android.stats.accessibility.ServiceStatus service_status = 2;
10324}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010325
Denny cy Leeca62fc42020-05-28 18:13:07 +080010326/**
10327 * Logs when display wake up.
10328 *
10329 * Logged from:
10330 * services/core/java/com/android/server/power/Notifier.java
10331 */
10332
10333message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010334 // Wake_up_reason code
10335 // If LOWORD(wake_up_reason) = 0
10336 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10337 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010338 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010339 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010340}
10341
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010342/**
10343 * Logs app usage events.
10344 */
10345message AppUsageEventOccurred {
10346 optional int32 uid = 1 [(is_uid) = true];
10347 optional string package_name = 2;
10348 optional string class_name = 3;
10349
10350 enum EventType {
10351 NONE = 0;
10352 MOVE_TO_FOREGROUND = 1;
10353 MOVE_TO_BACKGROUND = 2;
10354 }
10355 optional EventType event_type = 4;
10356}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010357
10358/*
10359 * Quality metrics logged when EVS cameras are active.
10360 *
10361 * Logged from:
10362 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10363 */
10364message EvsUsageStatsReported {
10365
10366 // Camera identifier to distinguish the source camera device. This is not
10367 // globally unique and therefore cannot be used to identify the user and/or
10368 // the device.
10369 optional int32 device_id = 1;
10370
10371 // Peak number of clients during the service
10372 optional int32 peak_num_clients = 2;
10373
10374 // Number of erroneous events during the service
10375 optional int32 num_errors = 3;
10376
10377 // Round trip latency of the very first frame
10378 optional int64 first_latency_millis = 4;
10379
10380 // Average frame round trip latency
10381 optional float avg_latency_millis = 5;
10382
10383 // Peak frame round trip latency
10384 optional int64 peak_latency_millis = 6;
10385
10386 // Total number of frames received
10387 optional int64 total_frames = 7;
10388
10389 // Number of frames ignored
10390 optional int64 ignored_frames = 8;
10391
10392 // Number of dropped frames to synchronize camera devices
10393 optional int64 dropped_frames_to_sync = 9;
10394
10395 // The duration of the service
10396 optional int64 duration_millis = 10;
10397}
Robert Leecccdc152020-04-23 13:22:46 +080010398
10399/**
10400 * Logs audio power usage stats.
10401 *
10402 * Pushed from:
10403 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10404 */
10405message AudioPowerUsageDataReported {
10406 /**
10407 * Device used for input/output
10408 *
10409 * All audio devices please refer to below file:
10410 * system/media/audio/include/system/audio-base.h
10411 *
10412 * Define our own enum values because we don't report all audio devices.
10413 * Currently, we only report built-in audio devices such as handset, speaker,
10414 * built-in mics, common audio devices such as wired headset, usb headset
10415 * and bluetooth devices.
10416 */
10417 enum AudioDevice {
10418 OUTPUT_EARPIECE = 0x1; // handset
10419 OUTPUT_SPEAKER = 0x2; // dual speaker
10420 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10421 OUTPUT_USB_HEADSET = 0x8; // usb headset
10422 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10423 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10424 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10425
10426 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10427 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10428 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10429 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10430 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10431 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10432 }
10433 optional AudioDevice audio_device = 1;
10434
10435 // Duration of the audio in seconds
10436 optional int32 duration_secs = 2;
10437
10438 // Average volume (0 ... 1.0)
10439 optional float average_volume = 3;
10440
10441 enum AudioType {
10442 UNKNOWN_TYPE = 0;
10443 VOICE_CALL_TYPE = 1; // voice call
10444 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10445 MEDIA_TYPE = 3; // music and system sound
10446 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10447 ALARM_TYPE = 5; // alarm type
10448 // record type
10449 CAMCORDER_TYPE = 6; // camcorder
10450 RECORD_TYPE = 7; // other recording
10451 }
10452 optional AudioType type = 4;
10453}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010454
10455/**
10456 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10457 *
10458 * Pulled from:
10459 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10460 */
10461message BytesTransferByTagAndMetered {
10462 optional int32 uid = 1 [(is_uid) = true];
10463
10464 optional bool is_metered = 2;
10465
10466 optional int32 tag = 3;
10467
10468 optional int64 rx_bytes = 4;
10469
10470 optional int64 rx_packets = 5;
10471
10472 optional int64 tx_bytes = 6;
10473
10474 optional int64 tx_packets = 7;
10475}
Robert Luo2f52f042020-05-11 16:39:24 +080010476
10477/*
10478 * Logs when the Media Output Switcher finishes a media switch operation.
10479 *
10480 * Logged from:
10481 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10482 */
10483message MediaOutputOpSwitchReported {
10484 // Source medium type before switching.
10485 optional android.app.settings.mediaoutput.MediumType source = 1;
10486
10487 // Target medium type after switching.
10488 optional android.app.settings.mediaoutput.MediumType target = 2;
10489
10490 // The result of switching.
10491 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10492
10493 // The detail code of a switching result.
10494 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10495
10496 /*
10497 * The package name of a pre-installed app, whose media session is being switched.
10498 */
10499 optional string media_session_package_name = 5;
10500
10501 // The amount of available wired devices when a switching is being performed.
10502 optional int32 available_wired_device_count = 6;
10503
10504 // The amount of available Bluetooth devices a switching is being performed.
10505 optional int32 available_bt_device_count = 7;
10506
10507 // The amount of available remote devices when a switching is being performed.
10508 optional int32 available_remote_device_count = 8;
10509
10510 // The amount of applied devices within a remote dynamic group after a switching is done.
10511 optional int32 applied_device_count_within_remote_group = 9;
10512}
Govinda Wassermane4640282020-04-30 09:30:56 -040010513
10514/**
10515 * Logs when the Assistant is invoked.
10516 *
10517 * Logged from:
10518 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10519 */
10520message AssistantInvocationReported {
10521
10522 // The event_id (as for UiEventReported).
10523 optional int32 event_id = 1;
10524
10525 // The registered Assistant's uid and package (as for UiEventReported).
10526 optional int32 uid = 2 [(is_uid) = true];
10527 optional string package_name = 3;
10528
10529 // An identifier used to disambiguate which logs refer to a particular invocation of the
10530 // Assistant (as for UiEventReported).
10531 optional int32 instance_id = 4;
10532
10533 // The state of the device at the time of invocation.
10534 enum DeviceState {
10535 UNKNOWN_DEVICE_STATE = 0;
10536 AOD1 = 1;
10537 AOD2 = 2;
10538 BOUNCER = 3;
10539 UNLOCKED_LOCKSCREEN = 4;
10540 LAUNCHER_HOME = 5;
10541 LAUNCHER_OVERVIEW = 6;
10542 LAUNCHER_ALL_APPS = 7;
10543 APP_DEFAULT = 8;
10544 APP_IMMERSIVE = 9;
10545 APP_FULLSCREEN = 10;
10546 }
10547 optional DeviceState device_state = 5;
10548
10549 // Whether the Assistant handles were showing at the time of invocation.
10550 optional bool assistant_handles_showing = 6;
10551}