blob: 278278fc18c4792b63d7636499ff3e68f088943e [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"];
Andy Hung48cffa32020-05-01 09:54:02 -0700473 MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
474 294;
475 MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
476 295;
477 MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
478 296;
479 MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
480 297;
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700481 BlobCommitted blob_committed = 298 [(module) = "framework"];
482 BlobLeased blob_leased = 299 [(module) = "framework"];
483 BlobOpened blob_opened = 300 [(module) = "framework"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700484
485 // StatsdStats tracks platform atoms with ids upto 500.
486 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000487 }
David Chenc8a43242017-10-17 16:23:28 -0700488
David Chen6e3e6cb2018-01-03 16:14:06 -0800489 // Pulled events will start at field 10000.
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700490 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700491 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800492 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
493 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700494 MobileBytesTransfer mobile_bytes_transfer =
495 10002 [(module) = "framework", (truncate_timestamp) = true];
496 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
497 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800498 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
499 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700500 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800501 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700502 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800503 CpuTimePerUidFreq cpu_time_per_uid_freq =
504 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800505 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
506 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
507 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
508 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
509 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700510 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700511 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700512 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700513 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800514 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
515 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700516 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800517 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800518 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800519 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800520 DiskStats disk_stats = 10025 [(module) = "framework"];
521 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
522 AppSize app_size = 10027 [(module) = "framework"];
523 CategorySize category_size = 10028 [(module) = "framework"];
524 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800525 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
527 DiskIo disk_io = 10032 [(module) = "framework"];
528 PowerProfile power_profile = 10033 [(module) = "framework"];
529 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
530 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
531 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700532 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800533 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
534 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
535 10040 [(module) = "framework"];
536 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
537 10041 [(module) = "framework"];
538 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800539 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800540 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800541 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800542 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
543 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
544 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
545 RoleHolder role_holder = 10049 [(module) = "framework"];
546 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800547 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800548 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
549 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800550 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
551 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800552 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
553 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
554 FaceSettings face_settings = 10058 [(module) = "framework"];
555 CoolingDevice cooling_device = 10059 [(module) = "framework"];
556 AppOps app_ops = 10060 [(module) = "framework"];
557 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700558 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
559 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800560 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800561 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800562 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
563 DangerousPermissionStateSampled dangerous_permission_state_sampled =
564 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400565 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000566 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000567 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200568 PackageNotificationPreferences package_notification_preferences =
569 10071 [(module) = "framework"];
570 PackageNotificationChannelPreferences package_notification_channel_preferences =
571 10072 [(module) = "framework"];
572 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
573 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800574 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800575 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700576 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
577 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
578 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
579 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800580 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700581 BlobInfo blob_info = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800582 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700583 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
584 10083 [(module) = "framework"];
Chris Wren93165692020-05-15 16:12:41 -0400585 DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700586 }
yroa1fe77c2018-02-26 14:22:54 -0800587
Bookatz76aafcf2018-09-17 16:17:10 -0700588 // DO NOT USE field numbers above 100,000 in AOSP.
589 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
590 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100591
592 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700593}
594
Yao Chend54f9dd2017-10-17 17:37:48 +0000595/**
Yangster-mac20877162017-12-22 17:19:39 -0800596 * This proto represents a node of an attribution chain.
597 * Note: All attribution chains are represented as a repeated field of type
598 * AttributionNode. It is understood that in such arrays, the order is that
599 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000600 */
Yangster-mac20877162017-12-22 17:19:39 -0800601message AttributionNode {
602 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800603 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800604
Yangster-mac20877162017-12-22 17:19:39 -0800605 // The (optional) string tag for an element in the attribution chain. If the
606 // element has no tag, it is encoded as an empty string.
607 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700608}
609
Yangster-mac48b3d622018-08-18 12:38:11 -0700610message KeyValuePair {
611 optional int32 key = 1;
612 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700613 int32 value_int = 2;
614 int64 value_long = 3;
615 string value_str = 4;
616 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700617 }
618}
619
620message KeyValuePairsAtom {
621 optional int32 uid = 1;
622 repeated KeyValuePair pairs = 2;
623}
624
Yao Chend54f9dd2017-10-17 17:37:48 +0000625/*
626 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800627 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000628 *
629 * RULES:
630 * - The field ids for each atom must start at 1, and count upwards by 1.
631 * Skipping field ids is not allowed.
632 * - These form an API, so renaming, renumbering or removing fields is
633 * not allowed between android releases. (This is not currently enforced,
634 * but there will be a tool to enforce this restriction).
635 * - The types must be built-in protocol buffer types, namely, no sub-messages
636 * are allowed (yet). The bytes type is also not allowed.
637 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800638 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000639 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800640 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000641 * - A field that is a uid should be a string field, tagged with the [xxx]
642 * annotation. The generated code on android will be represented by UIDs,
643 * and those UIDs will be translated in xxx to those strings.
644 *
645 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700646 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000647 * - If there is a UID, it goes first. Think in an object-oriented fashion.
648 * *****************************************************************************
649 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700650
Yao Chend54f9dd2017-10-17 17:37:48 +0000651/**
Tej Singha72344992019-04-17 18:55:08 -0700652 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700653 * Logs when the Thermal service HAL notifies the throttling start/stop events.
654 *
655 * Logged from:
656 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
657 */
658message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700659 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700660 optional android.os.TemperatureTypeEnum sensor_type = 1;
661
Maggie White442b6312019-04-05 16:26:44 -0700662 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700663 enum State {
664 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700665 START = 1; // START indicated that throttling was triggered.
666 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700667 }
Yangster-mace16189a2018-08-26 12:20:16 -0700668 optional State state = 2;
669
670 optional float temperature = 3;
671}
672
673/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000674 * Logs when the screen state changes.
675 *
676 * Logged from:
677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
678 */
679message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800680 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800681 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700682 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700683}
Yao Chend54f9dd2017-10-17 17:37:48 +0000684
685/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700686 * Logs that the process state of the uid, as determined by ActivityManager
687 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000688 *
689 * Logged from:
690 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
691 */
Bookatzc1a050a2017-10-10 15:49:28 -0700692message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700693 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000694
Bookatzdb026a22018-01-10 19:01:56 -0800695 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800696 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700697 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000698}
699
700/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700701 * Logs process state change of a process, as per the activity manager.
702 *
703 * Logged from:
704 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
705 */
706message ProcessStateChanged {
707 optional int32 uid = 1;
708 optional string process_name = 2;
709 optional string package_name = 3;
710 // TODO: remove this when validation is done
711 optional int64 version = 5;
712 // The state, from frameworks/base/core/proto/android/app/enums.proto.
713 optional android.app.ProcessStateEnum state = 4;
714}
715
716/**
717 * Logs when ActivityManagerService sleep state is changed.
718 *
719 * Logged from:
720 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
721 */
722message ActivityManagerSleepStateChanged {
723 // TODO: import frameworks proto
724 enum State {
725 UNKNOWN = 0;
726 ASLEEP = 1;
727 AWAKE = 2;
728 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700729 optional State state = 1
730 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700731}
732
733/**
734 * Logs when system memory state changes.
735 *
736 * Logged from:
737 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
738 */
739message MemoryFactorStateChanged {
740 // TODO: import frameworks proto
741 enum State {
742 MEMORY_UNKNOWN = 0;
743 NORMAL = 1; // normal.
744 MODERATE = 2; // moderate memory pressure.
745 LOW = 3; // low memory.
746 CRITICAL = 4; // critical memory.
747
748 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700749 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700750}
751
752/**
753 * Logs when app is using too much cpu, according to ActivityManagerService.
754 *
755 * Logged from:
756 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
757 */
758message ExcessiveCpuUsageReported {
759 optional int32 uid = 1;
760 optional string process_name = 2;
761 optional string package_name = 3;
762 // package version. TODO: remove this when validation is done
763 optional int64 version = 4;
764}
765
766/**
767 * Logs when a cached process is killed, along with its pss.
768 *
769 * Logged from:
770 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
771 */
772message CachedKillReported {
773 optional int32 uid = 1;
774 optional string process_name = 2;
775 optional string package_name = 3;
776 // TODO: remove this when validation is done
777 optional int64 version = 5;
778 optional int64 pss = 4;
779}
780
781/**
xshu2c3d9e42019-09-26 17:54:02 -0700782 * Logs the change in wifi health.
783 *
784 * Logged from:
785 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
786 */
787message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800788 enum Band {
789 UNKNOWN = 0;
790 // All of 2.4GHz band
791 BAND_2G = 1;
792 // Frequencies in the range of [5150, 5250) GHz
793 BAND_5G_LOW = 2;
794 // Frequencies in the range of [5250, 5725) GHz
795 BAND_5G_MIDDLE = 3;
796 // Frequencies in the range of [5725, 5850) GHz
797 BAND_5G_HIGH = 4;
798 // Frequencies in the range of [5925, 6425) GHz
799 BAND_6G_LOW = 5;
800 // Frequencies in the range of [6425, 6875) GHz
801 BAND_6G_MIDDLE = 6;
802 // Frequencies in the range of [6875, 7125) GHz
803 BAND_6G_HIGH = 7;
804 }
xshu2c3d9e42019-09-26 17:54:02 -0700805 // duration this stat is obtained over in milliseconds
806 optional int32 duration_millis = 1;
807 // whether wifi is classified as sufficient for the user's data traffic, determined
808 // by whether the calculated throughput exceeds the average demand within |duration_millis|
809 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700810 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800811 optional bool is_cell_data_available = 3;
812 // the Band bucket the connected network is on
813 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700814}
815
816/**
817 * Logged when wifi detects a significant change in connection failure rate.
818 *
819 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
820 *
821 */
822message WifiFailureStatReported {
823 enum AbnormalityType {
824 UNKNOWN = 0;
825 SIGNIFICANT_INCREASE = 1;
826 SIGNIFICANT_DECREASE = 2;
827 SIMPLY_HIGH = 3;
828 }
829 enum FailureType {
830 FAILURE_UNKNOWN = 0;
831 FAILURE_CONNECTION = 1;
832 FAILURE_ASSOCIATION_REJECTION = 2;
833 FAILURE_ASSOCIATION_TIMEOUT = 3;
834 FAILURE_AUTHENTICATION = 4;
835 FAILURE_NON_LOCAL_DISCONNECTION = 5;
836 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
837 }
838 // Reason for uploading this stat
839 optional AbnormalityType abnormality_type = 1;
840 // The particular type of failure
841 optional FailureType failure_type = 2;
842 // How many times we have encountered this combination of AbnormalityType and FailureType
843 optional int32 failure_count = 3;
844}
845
846/**
847 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
848 *
849 * Logged from:
850 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
851 */
852message WifiConnectionResultReported {
853 enum FailureCode {
854 FAILURE_UNKNOWN = 0;
855 FAILURE_ASSOCIATION_TIMEOUT = 1;
856 FAILURE_ASSOCIATION_REJECTION = 2;
857 FAILURE_AUTHENTICATION_GENERAL = 3;
858 FAILURE_AUTHENTICATION_EAP = 4;
859 FAILURE_DHCP = 5;
860 FAILURE_NETWORK_DISCONNECTION = 6;
861 FAILURE_ROAM_TIMEOUT = 7;
862 }
863 // true represents a successful connection
864 optional bool connection_result = 1;
865 // reason for the connection failure
866 optional FailureCode failure_code = 2;
867 // scan rssi before the connection attempt
868 optional int32 rssi = 3;
869}
870
871/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700872 * Logs when memory stats of a process is reported.
873 *
874 * Logged from:
875 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
876 */
877message ProcessMemoryStatReported {
878 optional int32 uid = 1;
879 optional string process_name = 2;
880 optional string package_name = 3;
881 //TODO: remove this when validation is done
882 optional int64 version = 9;
883 optional int64 pss = 4;
884 optional int64 uss = 5;
885 optional int64 rss = 6;
886 enum Type {
887 ADD_PSS_INTERNAL_SINGLE = 0;
888 ADD_PSS_INTERNAL_ALL_MEM = 1;
889 ADD_PSS_INTERNAL_ALL_POLL = 2;
890 ADD_PSS_EXTERNAL = 3;
891 ADD_PSS_EXTERNAL_SLOW = 4;
892 }
893 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800894 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700895}
896
897/**
Bookatzc1a050a2017-10-10 15:49:28 -0700898 * Logs that a process started, finished, crashed, or ANRed.
899 *
900 * Logged from:
901 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
902 */
903message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700904 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700905
David Chen0b5c90c2018-01-25 16:51:49 -0800906 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800907 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700908
Bookatzddccf0a2017-11-28 16:48:14 -0800909 // What lifecycle state the process changed to.
910 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800911 enum State {
912 FINISHED = 0;
913 STARTED = 1;
914 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800915 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700917}
918
Bookatzc1a050a2017-10-10 15:49:28 -0700919/**
920 * Logs when the ble scan state changes.
921 *
922 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700923 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700924 */
925message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800926 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700927 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700928
929 enum State {
930 OFF = 0;
931 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700932 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
933 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700934 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800935 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700936 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800937 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700938 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800939 (state_field_option).nested = true
940 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700941
Bookatze5ec0b42018-03-26 13:34:56 -0700942 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700943 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700944 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700945 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700946 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700947 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700948}
949
950/**
951 * Logs reporting of a ble scan finding results.
952 *
953 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700954 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700955 */
Bookatzae6738e2018-09-13 11:38:56 -0700956// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700957message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700959
960 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800961 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700962}
963
964/**
965 * Logs when a sensor state changes.
966 *
967 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700968 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700969 */
970message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800971 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700972
Bookatzc1a050a2017-10-10 15:49:28 -0700973 // The id (int) of the sensor.
974 optional int32 sensor_id = 2;
975
976 enum State {
977 OFF = 0;
978 ON = 1;
979 }
980 optional State state = 3;
981}
982
Bookatzc1a050a2017-10-10 15:49:28 -0700983/**
984 * Logs when GPS state changes.
985 *
986 * Logged from:
987 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
988 */
989message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700991
992 enum State {
993 OFF = 0;
994 ON = 1;
995 }
996 optional State state = 2;
997}
998
Bookatz48d362e2018-11-06 15:49:08 -0800999/**
1000 * Logs when GPS signal quality.
1001 *
1002 * Logged from:
1003 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
1004 */
1005message GpsSignalQualityChanged {
1006 optional android.server.location.GpsSignalQualityEnum level = 1;
1007}
1008
Bookatzc1a050a2017-10-10 15:49:28 -07001009
1010/**
1011 * Logs when a sync manager sync state changes.
1012 *
1013 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001014 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001015 */
1016message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001018
David Chen0b5c90c2018-01-25 16:51:49 -08001019 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001020 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001021
1022 enum State {
1023 OFF = 0;
1024 ON = 1;
1025 }
1026 optional State state = 3;
1027}
1028
Yangster-mac96353002018-09-05 11:18:55 -07001029/*
1030 * Deferred job stats.
1031 *
1032 * Logged from:
1033 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1034*/
1035message DeferredJobStatsReported {
1036 repeated AttributionNode attribution_node = 1;
1037
1038 // Number of jobs deferred.
1039 optional int32 num_jobs_deferred = 2;
1040
1041 // Time since the last job runs.
1042 optional int64 time_since_last_job_millis = 3;
1043}
1044
Bookatzc1a050a2017-10-10 15:49:28 -07001045/**
1046 * Logs when a job scheduler job state changes.
1047 *
1048 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001049 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001050 */
1051message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001052 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001053
1054 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001055 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001056
1057 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001058 FINISHED = 0;
1059 STARTED = 1;
1060 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001061 }
1062 optional State state = 3;
1063
Tej Singh33a412b2018-03-16 18:43:59 -07001064 // The reason a job has stopped.
1065 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001066 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001067 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001068
1069 // The standby bucket of the app that scheduled the job. These match the framework constants
1070 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1071 // already assigned 0.
1072 enum Bucket {
1073 UNKNOWN = -1;
1074 ACTIVE = 0;
1075 WORKING_SET = 1;
1076 FREQUENT = 2;
1077 RARE = 3;
1078 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001079 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001080 }
1081 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1082
1083 // The job id (as assigned by the app).
1084 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001085
1086 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1087 // constraints as they are always assumed to be set.
1088 optional bool has_charging_constraint = 7;
1089 optional bool has_battery_not_low_constraint = 8;
1090 optional bool has_storage_not_low_constraint = 9;
1091 optional bool has_timing_delay_constraint = 10;
1092 optional bool has_deadline_constraint = 11;
1093 optional bool has_idle_constraint = 12;
1094 optional bool has_connectivity_constraint = 13;
1095 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001096}
1097
1098/**
1099 * Logs when the audio state changes.
1100 *
1101 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001102 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001103 */
1104message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001105 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001106
1107 enum State {
1108 OFF = 0;
1109 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001110 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1111 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001112 }
1113 optional State state = 2;
1114}
1115
1116/**
1117 * Logs when the video codec state changes.
1118 *
1119 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001120 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001121 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001122message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001123 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001124
1125 enum State {
1126 OFF = 0;
1127 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001128 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1129 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001130 }
1131 optional State state = 2;
1132}
1133
1134/**
1135 * Logs when the flashlight state changes.
1136 *
1137 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001138 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001139 */
1140message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001141 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001142
1143 enum State {
1144 OFF = 0;
1145 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001146 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1147 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001148 }
1149 optional State state = 2;
1150}
1151
1152/**
1153 * Logs when the camera state changes.
1154 *
1155 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001156 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001157 */
1158message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001159 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001160
1161 enum State {
1162 OFF = 0;
1163 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001164 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1165 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001166 }
1167 optional State state = 2;
1168}
1169
1170/**
1171 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001172 *
1173 * Logged from:
1174 * TODO
1175 */
Bookatzd6746242017-10-24 18:39:35 -07001176message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001177 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001178 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001179
Bookatz1a1b0462018-01-12 11:47:03 -08001180 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1181 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001182 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001183
1184 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001185 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001186
1187 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001188 RELEASE = 0;
1189 ACQUIRE = 1;
1190 CHANGE_RELEASE = 2;
1191 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001192 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001193 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001194 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001195 (state_field_option).default_state_value = 0,
1196 (state_field_option).nested = true
1197 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001198}
1199
1200/**
Bookatzc1a050a2017-10-10 15:49:28 -07001201 * Logs when a partial wakelock is considered 'long' (over 1 min).
1202 *
1203 * Logged from:
1204 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1205 */
1206message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001207 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001208
Yao Chend54f9dd2017-10-17 17:37:48 +00001209 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1210 optional string tag = 2;
1211
Bookatzc1a050a2017-10-10 15:49:28 -07001212 // TODO: I have no idea what this is.
1213 optional string history_tag = 3;
1214
1215 enum State {
1216 OFF = 0;
1217 ON = 1;
1218 }
1219 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001220}
1221
Bookatzc1a050a2017-10-10 15:49:28 -07001222/**
Bookatza66083f2018-09-20 17:24:00 -07001223 * Logs when the device is interactive, according to the PowerManager Notifier.
1224 *
1225 * Logged from:
1226 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1227 */
1228message InteractiveStateChanged {
1229 enum State {
1230 OFF = 0;
1231 ON = 1;
1232 }
1233 optional State state = 1;
1234}
1235
1236/**
Bookatzc1a050a2017-10-10 15:49:28 -07001237 * Logs Battery Saver state change.
1238 *
1239 * Logged from:
1240 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1241 */
1242message BatterySaverModeStateChanged {
1243 enum State {
1244 OFF = 0;
1245 ON = 1;
1246 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001247 optional State state = 1
1248 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001249}
1250
1251/**
1252 * Logs Doze mode state change.
1253 *
1254 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001255 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001256 */
1257message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001258 optional android.server.DeviceIdleModeEnum state = 1
1259 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001260}
1261
1262
1263/**
1264 * Logs state change of Doze mode including maintenance windows.
1265 *
1266 * Logged from:
1267 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1268 */
1269message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001270 optional android.server.DeviceIdleModeEnum state = 1
1271 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001272}
1273
1274/**
1275 * Logs screen brightness level.
1276 *
1277 * Logged from:
1278 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1279 */
1280message ScreenBrightnessChanged {
1281 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1282 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001283}
1284
1285/**
1286 * Logs battery level (percent full, from 0 to 100).
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 BatteryLevelChanged {
1292 // Battery level. Should be in [0, 100].
1293 optional int32 battery_level = 1;
1294}
1295
1296/**
1297 * Logs change in charging status of the device.
1298 *
1299 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001300 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001301 */
1302message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001303 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001304 optional android.os.BatteryStatusEnum state = 1
1305 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001306}
1307
1308/**
1309 * Logs whether the device is plugged in, and what power source it is using.
1310 *
1311 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001312 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001313 */
1314message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001315 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001316 optional android.os.BatteryPluggedStateEnum state = 1
1317 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001318}
1319
Bookatz8c6571b2017-10-24 15:04:41 -07001320/**
1321 * Logs when an app's wakeup alarm fires.
1322 *
1323 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001324 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001325 */
1326message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001327 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001328
1329 // Name of the wakeup alarm.
1330 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001331
1332 // Name of source package (for historical reasons, since BatteryStats tracked it).
1333 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001334
Ben Murdoch3389f1522019-05-21 15:05:34 +01001335 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001336 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001337}
1338
1339/**
1340 * Logs when an an app causes the mobile radio to change state.
1341 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1342 *
1343 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001344 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001345 */
1346message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001347 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001348
Bookatz1a1b0462018-01-12 11:47:03 -08001349 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1350 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001351}
1352
1353/**
1354 * Logs when an an app causes the wifi radio to change state.
1355 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1356 *
1357 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001358 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001359 */
1360message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001361 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001362
Bookatz1a1b0462018-01-12 11:47:03 -08001363 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1364 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001365}
1366
1367/**
1368 * Logs kernel wakeup reasons and aborts.
1369 *
1370 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001371 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001372 */
1373message KernelWakeupReported {
1374 // Name of the kernel wakeup reason (or abort).
1375 optional string wakeup_reason_name = 1;
1376
1377 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001378 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001379}
1380
1381/**
Bookatzda1798c2018-12-13 14:16:00 -08001382 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001383 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001384 *
1385 * Logged from:
1386 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1387 */
1388message WifiEnabledStateChanged {
1389 enum State {
1390 OFF = 0;
1391 ON = 1;
1392 }
1393 optional State state = 1;
1394}
1395
1396/**
tsaichristinececebdc2020-02-04 14:05:56 -08001397 * This atom is deprecated starting in R.
1398 *
Bookatzda1798c2018-12-13 14:16:00 -08001399 * 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 -08001400 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1401 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001402 *
1403 * Logged from:
1404 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1405 */
1406message WifiRunningStateChanged {
1407 repeated AttributionNode attribution_node = 1;
1408
1409 enum State {
1410 OFF = 0;
1411 ON = 1;
1412 }
1413 optional State state = 2;
1414}
1415
1416/**
Bookatze5885242017-10-24 20:10:31 -07001417 * Logs wifi locks held by an app.
1418 *
1419 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001420 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001421 */
1422message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001423 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001424
1425 enum State {
1426 OFF = 0;
1427 ON = 1;
1428 }
1429 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001430
1431 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1432 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001433}
1434
1435/**
1436 * Logs wifi signal strength changes.
1437 *
1438 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001439 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001440 */
1441message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001442 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1443 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001444}
1445
1446/**
1447 * Logs wifi scans performed by an app.
1448 *
1449 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001450 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001451 */
1452message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001453 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001454
1455 enum State {
1456 OFF = 0;
1457 ON = 1;
1458 }
1459 optional State state = 2;
1460}
1461
1462/**
Tej Singh4503e102018-01-04 14:35:01 -08001463 * Logs wifi multicast locks held by an app
1464 *
1465 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001466 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001467 */
1468message WifiMulticastLockStateChanged {
1469 repeated AttributionNode attribution_node = 1;
1470
1471 enum State {
1472 OFF = 0;
1473 ON = 1;
1474 }
1475 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001476
1477 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001478}
1479
1480/**
Tej Singh1ea42892018-01-19 09:27:00 -08001481 * Logs shutdown reason and duration on next boot.
1482 *
1483 * Logged from:
1484 * frameworks/base/core/java/com/android/server/BootReceiver.java
1485 */
1486message ShutdownSequenceReported {
1487 // True if shutdown is for a reboot. Default: false if we do not know.
1488 optional bool reboot = 1;
1489
1490 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1491 optional string reason = 2;
1492
1493 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1494 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001495 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001496
1497 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001498 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001499}
1500
Tej Singh6483ea42018-01-25 17:45:49 -08001501
1502/**
1503 * Logs boot reason and duration.
1504 *
1505 * Logged from:
1506 * system/core/bootstat/bootstat.cpp
1507 */
1508message BootSequenceReported {
1509 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1510 // Default: "<EMPTY>" if not available.
1511 optional string bootloader_reason = 1;
1512
1513 // Reason for system boot. Eg. bootloader, reboot,userrequested
1514 // Default: "<EMPTY>" if not available.
1515 optional string system_reason = 2;
1516
1517 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001518 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001519
1520 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001521 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001522
1523 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001524 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001525
1526 // Time since last boot in ms. Default: 0 if not available.
1527 optional int64 time_since_last_boot = 6;
1528}
1529
Tej Singhc477d9c2018-02-05 18:31:39 -08001530
1531/**
1532 * Logs call state and disconnect cause (if applicable).
1533 *
1534 * Logged from:
1535 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1536 */
1537message CallStateChanged {
1538 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1539 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1540 optional android.telecom.CallStateEnum call_state = 1;
1541
1542 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1543 // This value is only applicable when the call_state is DISCONNECTED, and
1544 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1545 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1546 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1547
1548 // True if the call is self-managed, which are apps that use the
1549 // telecom infrastructure to make their own calls.
1550 optional bool self_managed = 3;
1551
1552 // True if call is external. External calls are calls on connected Wear
1553 // devices but show up in Telecom so the user can pull them onto the device.
1554 optional bool external_call = 4;
1555}
1556
Tej Singh1ea42892018-01-19 09:27:00 -08001557/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001558 * Logs keyguard state. The keyguard is the lock screen.
1559 *
1560 * Logged from:
1561 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1562 */
1563message KeyguardStateChanged {
1564 enum State {
1565 UNKNOWN = 0;
1566 // The keyguard is hidden when the phone is unlocked.
1567 HIDDEN = 1;
1568 // The keyguard is shown when the phone is locked (screen turns off).
1569 SHOWN= 2;
1570 // The keyguard is occluded when something is overlaying the keyguard.
1571 // Eg. Opening the camera while on the lock screen.
1572 OCCLUDED = 3;
1573 }
1574 optional State state = 1;
1575}
1576
1577/**
1578 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1579 * prompts the user to enter a password (pattern, pin, etc).
1580 *
1581 * Logged from:
1582 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1583 */
1584
1585message KeyguardBouncerStateChanged {
1586 enum State {
1587 UNKNOWN = 0;
1588 // Bouncer is hidden, either as a result of successfully entering the
1589 // password, screen timing out, or user going back to lock screen.
1590 HIDDEN = 1;
1591 // This is when the user is being prompted to enter the password.
1592 SHOWN = 2;
1593 }
1594 optional State state = 1;
1595}
1596
1597/**
1598 * Logs the result of entering a password into the keyguard bouncer.
1599 *
1600 * Logged from:
1601 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1602 */
1603message KeyguardBouncerPasswordEntered {
1604 enum BouncerResult {
1605 UNKNOWN = 0;
1606 // The password entered was incorrect.
1607 FAILURE = 1;
1608 // The password entered was correct.
1609 SUCCESS = 2;
1610 }
1611 optional BouncerResult result = 1;
1612}
1613
Tej Singha883b372018-02-15 11:30:01 -08001614/*
1615 * Logs changes to the configuration of the device. The configuration is defined
1616 * in frameworks/base/core/java/android/content/res/Configuration.java
1617 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1618 * Please go there to interpret the possible values each field can be.
1619 *
1620 * Logged from:
1621 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1622 */
1623message ResourceConfigurationChanged {
1624 // Bit mask of color capabilities of the screen.
1625 // Contains information about the color gamut and hdr mode of the screen.
1626 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001627 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001628
1629 // The target screen density being rendered to.
1630 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001631 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001632
1633 // Current user preference for the scaling factor for fonts,
1634 // relative to the base density scaling.
1635 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001636 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001637
1638 // Flag indicating whether the hard keyboard is hidden.
1639 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001640 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001641
1642 // The type of keyboard attached to the device.
1643 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1644 optional int32 keyboard = 5;
1645
1646 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1647 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001648 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001649
1650 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1651 // 0 if undefined.
1652 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1653 optional int32 mcc = 7;
1654
1655 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1656 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1657 // MNC_ZERO symbol defined in Configuration.java.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1659 optional int32 mnc = 8;
1660
1661 // The kind of navigation available on the device.
1662 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1663 optional int32 navigation = 9;
1664
1665 // Flag indicating whether the navigation is available.
1666 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001667 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001668
1669 // Overall orientation of the screen.
1670 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1671 optional int32 orientation = 11;
1672
1673 // The current height of the available screen space, in dp units.
1674 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001675 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001676
1677 // Bit mask of overall layout of the screen.
1678 // Contains information about screen size, whether the screen is wider/taller
1679 // than normal, whether the screen layout is right-tl-left or left-to-right,
1680 // and whether the screen has a rounded shape.
1681 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001682 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001683
1684 // Current width of the available screen space, in dp units.
1685 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001686 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001687
1688 // The smallest screen size an application will see in normal operation.
1689 // This is the smallest value of both screenWidthDp and screenHeightDp
1690 // in portrait and landscape.
1691 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001692 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001693
1694 // The type of touch screen attached to the device.
1695 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1696 optional int32 touchscreen = 16;
1697
1698 // Bit mask of the ui mode.
1699 // Contains information about the overall ui mode of the device.
1700 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1701 // Also contains information about whether the device is in night mode.
1702 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001703 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001704}
1705
Tej Singheee317b2018-03-07 19:28:05 -08001706
1707/**
1708 * Logs changes in the connection state of the mobile radio.
1709 *
1710 * Logged from:
1711 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1712 */
1713message MobileConnectionStateChanged {
1714 // States are from the state machine DataConnection.java.
1715 enum State {
1716 UNKNOWN = 0;
1717 // The connection is inactive, or disconnected.
1718 INACTIVE = 1;
1719 // The connection is being activated, or connecting.
1720 ACTIVATING = 2;
1721 // The connection is active, or connected.
1722 ACTIVE = 3;
1723 // The connection is disconnecting.
1724 DISCONNECTING = 4;
1725 // The connection is disconnecting after creating a connection.
1726 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1727 }
1728 optional State state = 1;
1729 // For multi-sim phones, this distinguishes between the sim cards.
1730 optional int32 sim_slot_index = 2;
1731 // Used to identify the connection. Starts at 0 and increments by 1 for
1732 // every new network created. Resets whenever the device reboots.
1733 optional int32 data_connection_id = 3;
1734 // A bitmask for the capabilities of this connection.
1735 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1736 // Default value (if we have no information): 0
1737 optional int64 capabilities = 4;
1738 // If this connection has internet.
1739 // This just checks if the DEFAULT bit of capabilities is set.
1740 optional bool has_internet = 5;
1741}
1742
1743/**
1744 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1745 *
1746 * Logged from:
1747 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1748 */
1749message MobileRadioTechnologyChanged {
1750 optional android.telephony.NetworkTypeEnum state = 1;
1751 // For multi-sim phones, this distinguishes between the sim cards.
1752 optional int32 sim_slot_index = 2;
1753}
1754
Andrew Chantb56388b2018-03-22 21:07:33 -07001755/**
1756 * Logs the VID and PID of any connected USB devices.
1757 *
1758 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1759 *
1760 * Logged by Vendor.
1761 */
1762message UsbDeviceAttached {
1763 optional int32 vid = 1;
1764 optional int32 pid = 2;
1765 optional bool has_audio = 3;
1766 optional bool has_hid = 4;
1767 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001768 enum State {
1769 STATE_DISCONNECTED = 0;
1770 STATE_CONNECTED = 1;
1771 }
1772 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001773 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001774}
1775
Tej Singheee317b2018-03-07 19:28:05 -08001776
Tej Singhdd7bd352018-02-09 19:33:15 -08001777/**
Tej Singh5d991e12018-03-09 19:48:11 -08001778 * Logs when Bluetooth is enabled and disabled.
1779 *
1780 * Logged from:
1781 * services/core/java/com/android/server/BluetoothManagerService.java
1782 */
1783message BluetoothEnabledStateChanged {
1784 repeated AttributionNode attribution_node = 1;
1785 // Whether or not bluetooth is enabled on the device.
1786 enum State {
1787 UNKNOWN = 0;
1788 ENABLED = 1;
1789 DISABLED = 2;
1790 }
1791 optional State state = 2;
1792 // The reason for being enabled/disabled.
1793 // Eg. Airplane mode, crash, application request.
1794 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1795 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001796 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001797}
1798
1799/**
Jack Hed9837c82019-01-09 01:19:13 -08001800 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001801 *
1802 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001803 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1804 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001805 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001806 */
1807message BluetoothConnectionStateChanged {
1808 // The state of the connection.
1809 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1810 optional android.bluetooth.ConnectionStateEnum state = 1;
1811 // An identifier that can be used to match connect and disconnect events.
1812 // Currently is last two bytes of a hash of a device level ID and
1813 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001814 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001815 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001816 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1817 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001818 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001819 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001820 // An identifier that can be used to match events for this device.
1821 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1822 // Salt: Randomly generated 256 bit value
1823 // Hash algorithm: HMAC-SHA256
1824 // Size: 32 byte
1825 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001826 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001827 // An identifier that can be used to match events for this device.
1828 // The incremental identifier is locally generated and guaranteed not derived
1829 // from any globally unique hardware id.
1830 // For paired devices, it stays consistent between Bluetooth toggling for the
1831 // same remote device.
1832 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1833 // session for the same remote device.
1834 // Default: 0 if the device's metric id is unknown.
1835 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001836}
1837
1838/**
1839 * Logs when a Bluetooth device connects and disconnects over ACL
1840 *
1841 * Logged from:
1842 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1843 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001844 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001845 */
1846message BluetoothAclConnectionStateChanged {
1847 // An identifier that can be used to match events for this device.
1848 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1849 // Salt: Randomly generated 256 bit value
1850 // Hash algorithm: HMAC-SHA256
1851 // Size: 32 byte
1852 // Default: null or empty if the device identifier is not known
1853 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1854 // The state of the connection.
1855 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1856 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001857 // An identifier that can be used to match events for this device.
1858 // The incremental identifier is locally generated and guaranteed not derived
1859 // from any globally unique hardware id.
1860 // For paired devices, it stays consistent between Bluetooth toggling for the
1861 // same remote device.
1862 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1863 // session for the same remote device.
1864 // Default: 0 if the device's metric id is unknown.
1865 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001866}
1867
1868/**
1869 * Logs when a Bluetooth device connects and disconnects over SCO
1870 *
1871 * Logged from:
1872 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1873 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1874 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001875 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001876 */
1877message BluetoothScoConnectionStateChanged {
1878 // An identifier that can be used to match events for this device.
1879 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1880 // Salt: Randomly generated 256 bit value
1881 // Hash algorithm: HMAC-SHA256
1882 // Size: 32 byte
1883 // Default: null or empty if the device identifier is not known
1884 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1885 // The state of the connection.
1886 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1887 optional android.bluetooth.ConnectionStateEnum state = 2;
1888 // Codec used for this SCO connection
1889 // Default: UNKNOWN
1890 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001891 // An identifier that can be used to match events for this device.
1892 // The incremental identifier is locally generated and guaranteed not derived
1893 // from any globally unique hardware id.
1894 // For paired devices, it stays consistent between Bluetooth toggling for the
1895 // same remote device.
1896 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1897 // session for the same remote device.
1898 // Default: 0 if the device's metric id is unknown.
1899 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001900}
1901
Jack Hec27040a2019-01-09 20:54:41 -08001902/**
1903 * Logged when active device of a profile changes
1904 *
1905 * Logged from:
1906 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1907 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1908 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1909 */
1910message BluetoothActiveDeviceChanged {
1911 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1912 // From android.bluetooth.BluetoothProfile
1913 optional int32 bt_profile = 1;
1914 // An identifier that can be used to match events for this new active device.
1915 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1916 // Salt: Randomly generated 256 bit value
1917 // Hash algorithm: HMAC-SHA256
1918 // Size: 32 byte
1919 // Default: null or empty if there is no active device for this profile
1920 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001921 // An identifier that can be used to match events for this device.
1922 // The incremental identifier is locally generated and guaranteed not derived
1923 // from any globally unique hardware id.
1924 // For paired devices, it stays consistent between Bluetooth toggling for the
1925 // same remote device.
1926 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1927 // session for the same remote device.
1928 // Default: 0 if the device's metric id is unknown.
1929 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001930}
1931
Jack Heab86dbd22018-12-18 15:43:27 -08001932// Logs when there is an event affecting Bluetooth device's link layer connection.
1933// - This event is triggered when there is a related HCI command or event
1934// - Users of this metrics can deduce Bluetooth device's connection state from these events
1935// - HCI commands are logged before the command is sent, after receiving command status, and after
1936// receiving command complete
1937// - HCI events are logged when they arrive
1938//
1939// Low level log from system/bt
1940//
1941// Bluetooth classic commands:
1942// - CMD_CREATE_CONNECTION
1943// - CMD_DISCONNECT
1944// - CMD_CREATE_CONNECTION_CANCEL
1945// - CMD_ACCEPT_CONNECTION_REQUEST
1946// - CMD_REJECT_CONNECTION_REQUEST
1947// - CMD_SETUP_ESCO_CONNECTION
1948// - CMD_ACCEPT_ESCO_CONNECTION
1949// - CMD_REJECT_ESCO_CONNECTION
1950// - CMD_ENH_SETUP_ESCO_CONNECTION
1951// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1952//
1953// Bluetooth low energy commands:
1954// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1955// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1956// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1957// - CMD_BLE_CLEAR_WHITE_LIST
1958// - CMD_BLE_ADD_WHITE_LIST
1959// - CMD_BLE_REMOVE_WHITE_LIST
1960//
1961// Bluetooth classic events:
1962// - EVT_CONNECTION_COMP
1963// - EVT_CONNECTION_REQUEST
1964// - EVT_DISCONNECTION_COMP
1965// - EVT_ESCO_CONNECTION_COMP
1966// - EVT_ESCO_CONNECTION_CHANGED
1967//
1968// Bluetooth low energy meta events:
1969// - BLE_EVT_CONN_COMPLETE_EVT
1970// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1971//
1972// Next tag: 10
1973message BluetoothLinkLayerConnectionEvent {
1974 // An identifier that can be used to match events for this device.
1975 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1976 // Salt: Randomly generated 256 bit value
1977 // Hash algorithm: HMAC-SHA256
1978 // Size: 32 byte
1979 // Default: null or empty if the device identifier is not known
1980 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1981 // Connection handle of this connection if available
1982 // Range: 0x0000 - 0x0EFF (12 bits)
1983 // Default: 0xFFFF if the handle is unknown
1984 optional int32 connection_handle = 2;
1985 // Direction of the link
1986 // Default: DIRECTION_UNKNOWN
1987 optional android.bluetooth.DirectionEnum direction = 3;
1988 // Type of this link
1989 // Default: LINK_TYPE_UNKNOWN
1990 optional android.bluetooth.LinkTypeEnum type = 4;
1991
1992 // Reason metadata for this link layer connection event, rules for interpretation:
1993 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1994 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1995 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1996 // set and valid, ignore hci_ble_event
1997
1998 // HCI command associated with this event
1999 // Default: CMD_UNKNOWN
2000 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
2001 // HCI event associated with this event
2002 // Default: EVT_UNKNOWN
2003 optional android.bluetooth.hci.EventEnum hci_event = 6;
2004 // HCI BLE meta event associated with this event
2005 // Default: BLE_EVT_UNKNOWN
2006 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
2007 // HCI command status code if this is triggerred by hci_cmd
2008 // Default: STATUS_UNKNOWN
2009 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
2010 // HCI reason code associated with this event
2011 // Default: STATUS_UNKNOWN
2012 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002013 // An identifier that can be used to match events for this device.
2014 // The incremental identifier is locally generated and guaranteed not derived
2015 // from any globally unique hardware id.
2016 // For paired devices, it stays consistent between Bluetooth toggling for the
2017 // same remote device.
2018 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2019 // session for the same remote device.
2020 // Default: 0 if the device's metric id is unknown.
2021 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002022}
2023
Howard Roe103fe22019-01-17 16:52:16 -08002024/**
2025 * Logs when a module is rolled back by Watchdog.
2026 *
2027 * Logged from: Rollback Manager
2028 */
2029message WatchdogRollbackOccurred {
2030 enum RollbackType {
2031 UNKNOWN = 0;
2032 ROLLBACK_INITIATE = 1;
2033 ROLLBACK_SUCCESS = 2;
2034 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002035 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002036 }
2037 optional RollbackType rollback_type = 1;
2038
2039 optional string package_name = 2;
2040
2041 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002042
2043 enum RollbackReasonType {
2044 REASON_UNKNOWN = 0;
2045 REASON_NATIVE_CRASH = 1;
2046 REASON_EXPLICIT_HEALTH_CHECK = 2;
2047 REASON_APP_CRASH = 3;
2048 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002049 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002050 }
2051 optional RollbackReasonType rollback_reason = 4;
2052
2053 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2054 // is initiated. Empty if the package is unknown.
2055 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002056
2057 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002058}
2059
Jack Hec27040a2019-01-09 20:54:41 -08002060/**
2061 * Logs when there is a change in Bluetooth A2DP playback state
2062 *
2063 * Logged from:
2064 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2065 */
2066message BluetoothA2dpPlaybackStateChanged {
2067 // An identifier that can be used to match events for this device.
2068 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2069 // Salt: Randomly generated 256 bit value
2070 // Hash algorithm: HMAC-SHA256
2071 // Size: 32 byte
2072 // Default: null or empty if the device identifier is not known
2073 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2074 // Current playback state
2075 // Default: PLAYBACK_STATE_UNKNOWN
2076 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2077 // Current audio coding mode
2078 // Default: AUDIO_CODING_MODE_UNKNOWN
2079 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002080 // An identifier that can be used to match events for this device.
2081 // The incremental identifier is locally generated and guaranteed not derived
2082 // from any globally unique hardware id.
2083 // For paired devices, it stays consistent between Bluetooth toggling for the
2084 // same remote device.
2085 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2086 // session for the same remote device.
2087 // Default: 0 if the device's metric id is unknown.
2088 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002089}
2090
2091/**
2092 * Logs when there is a change in A2DP codec config for a particular remote device
2093 *
2094 * Logged from:
2095 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2096 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2097 */
2098message BluetoothA2dpCodecConfigChanged {
2099 // An identifier that can be used to match events for this device.
2100 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2101 // Salt: Randomly generated 256 bit value
2102 // Hash algorithm: HMAC-SHA256
2103 // Size: 32 byte
2104 // Default: null or empty if the device identifier is not known
2105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2106 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2107 // Default SOURCE_CODEC_TYPE_INVALID
2108 optional int32 codec_type = 2;
2109 // Codec priroity, the higher the more preferred, -1 for disabled
2110 // Default: CODEC_PRIORITY_DEFAULT
2111 optional int32 codec_priority = 3;
2112 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2113 // Default: SAMPLE_RATE_NONE
2114 optional int32 sample_rate = 4;
2115 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2116 // Default: BITS_PER_SAMPLE_NONE
2117 optional int32 bits_per_sample = 5;
2118 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2119 // Default: CHANNEL_MODE_NONE
2120 optional int32 channel_mode = 6;
2121 // Codec specific values
2122 // Default 0
2123 optional int64 codec_specific_1 = 7;
2124 optional int64 codec_specific_2 = 8;
2125 optional int64 codec_specific_3 = 9;
2126 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002127 // An identifier that can be used to match events for this device.
2128 // The incremental identifier is locally generated and guaranteed not derived
2129 // from any globally unique hardware id.
2130 // For paired devices, it stays consistent between Bluetooth toggling for the
2131 // same remote device.
2132 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2133 // session for the same remote device.
2134 // Default: 0 if the device's metric id is unknown.
2135 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002136}
2137
2138/**
2139 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2140 * Each codec's capability is logged separately due to statsd restriction
2141 *
2142 * Logged from:
2143 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2144 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2145 */
2146message BluetoothA2dpCodecCapabilityChanged {
2147 // An identifier that can be used to match events for this device.
2148 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2149 // Salt: Randomly generated 256 bit value
2150 // Hash algorithm: HMAC-SHA256
2151 // Size: 32 byte
2152 // Default: null or empty if the device identifier is not known
2153 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2154 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2155 // Default SOURCE_CODEC_TYPE_INVALID
2156 optional int32 codec_type = 2;
2157 // Codec priroity, the higher the more preferred, -1 for disabled
2158 // Default: CODEC_PRIORITY_DEFAULT
2159 optional int32 codec_priority = 3;
2160 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2161 // in BluetoothCodecConfig
2162 // Default: empty and SAMPLE_RATE_NONE for individual item
2163 optional int32 sample_rate = 4;
2164 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2165 // in BluetoothCodecConfig
2166 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2167 optional int32 bits_per_sample = 5;
2168 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2169 // BluetoothCodecConfig
2170 // Default: empty and CHANNEL_MODE_NONE for individual item
2171 optional int32 channel_mode = 6;
2172 // Codec specific values
2173 // Default 0
2174 optional int64 codec_specific_1 = 7;
2175 optional int64 codec_specific_2 = 8;
2176 optional int64 codec_specific_3 = 9;
2177 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002178 // An identifier that can be used to match events for this device.
2179 // The incremental identifier is locally generated and guaranteed not derived
2180 // from any globally unique hardware id.
2181 // For paired devices, it stays consistent between Bluetooth toggling for the
2182 // same remote device.
2183 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2184 // session for the same remote device.
2185 // Default: 0 if the device's metric id is unknown.
2186 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002187}
2188
2189/**
2190 * Logs when A2DP failed to read from PCM source.
2191 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2192 *
2193 * Logged from:
2194 * system/bt
2195 */
2196message BluetoothA2dpAudioUnderrunReported {
2197 // An identifier that can be used to match events for this device.
2198 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2199 // Salt: Randomly generated 256 bit value
2200 // Hash algorithm: HMAC-SHA256
2201 // Size: 32 byte
2202 // Default: null or empty if the device identifier is not known
2203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2204 // Encoding interval in nanoseconds
2205 // Default: 0
2206 optional int64 encoding_interval_nanos = 2;
2207 // Number of bytes of PCM data that could not be read from the source
2208 // Default: 0
2209 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002210 // An identifier that can be used to match events for this device.
2211 // The incremental identifier is locally generated and guaranteed not derived
2212 // from any globally unique hardware id.
2213 // For paired devices, it stays consistent between Bluetooth toggling for the
2214 // same remote device.
2215 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2216 // session for the same remote device.
2217 // Default: 0 if the device's metric id is unknown.
2218 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002219}
2220
2221/**
2222 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2223 * buffer queue is full and we have to drop data
2224 *
2225 * Logged from:
2226 * system/bt
2227 */
2228message BluetoothA2dpAudioOverrunReported {
2229 // An identifier that can be used to match events for this device.
2230 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2231 // Salt: Randomly generated 256 bit value
2232 // Hash algorithm: HMAC-SHA256
2233 // Size: 32 byte
2234 // Default: null or empty if the device identifier is not known
2235 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2236 // Encoding interval in nanoseconds
2237 // Default: 0
2238 optional int64 encoding_interval_nanos = 2;
2239 // Number of buffers dropped in this event
2240 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2241 // Default: 0
2242 optional int32 num_dropped_buffers = 3;
2243 // Number of encoded buffers dropped in this event
2244 // Default 0
2245 optional int32 num_dropped_encoded_frames = 4;
2246 // Number of encoded bytes dropped in this event
2247 // Default: 0
2248 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002249 // An identifier that can be used to match events for this device.
2250 // The incremental identifier is locally generated and guaranteed not derived
2251 // from any globally unique hardware id.
2252 // For paired devices, it stays consistent between Bluetooth toggling for the
2253 // same remote device.
2254 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2255 // session for the same remote device.
2256 // Default: 0 if the device's metric id is unknown.
2257 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002258}
2259
2260/**
2261 * Logs when we receive reports regarding a device's RSSI value
2262 *
2263 * Logged from:
2264 * system/bt
2265 */
2266message BluetoothDeviceRssiReported {
2267 // An identifier that can be used to match events for this device.
2268 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2269 // Salt: Randomly generated 256 bit value
2270 // Hash algorithm: HMAC-SHA256
2271 // Size: 32 byte
2272 // Default: null or empty if the device identifier is not known
2273 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2274 // Connection handle of this connection if available
2275 // Range: 0x0000 - 0x0EFF (12 bits)
2276 // Default: 0xFFFF if the handle is unknown
2277 optional int32 connection_handle = 2;
2278 // HCI command status code if this is triggerred by hci_cmd
2279 // Default: STATUS_UNKNOWN
2280 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2281 // BR/EDR
2282 // Range: -128 ≤ N ≤ 127 (signed integer)
2283 // Units: dB
2284 // LE:
2285 // Range: -127 to 20, 127 (signed integer)
2286 // Units: dBm
2287 // Invalid when an out of range value is reported
2288 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002289 // An identifier that can be used to match events for this device.
2290 // The incremental identifier is locally generated and guaranteed not derived
2291 // from any globally unique hardware id.
2292 // For paired devices, it stays consistent between Bluetooth toggling for the
2293 // same remote device.
2294 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2295 // session for the same remote device.
2296 // Default: 0 if the device's metric id is unknown.
2297 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002298}
2299
2300/**
2301 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2302 *
2303 * Logged from:
2304 * system/bt
2305 */
2306message BluetoothDeviceFailedContactCounterReported {
2307 // An identifier that can be used to match events for this device.
2308 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2309 // Salt: Randomly generated 256 bit value
2310 // Hash algorithm: HMAC-SHA256
2311 // Size: 32 byte
2312 // Default: null or empty if the device identifier is not known
2313 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2314 // Connection handle of this connection if available
2315 // Range: 0x0000 - 0x0EFF (12 bits)
2316 // Default: 0xFFFF if the handle is unknown
2317 optional int32 connection_handle = 2;
2318 // HCI command status code if this is triggerred by hci_cmd
2319 // Default: STATUS_UNKNOWN
2320 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2321 // Number of consecutive failed contacts for a connection corresponding to the Handle
2322 // Range: uint16_t, 0-0xFFFF
2323 // Default: 0xFFFFF
2324 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002325 // An identifier that can be used to match events for this device.
2326 // The incremental identifier is locally generated and guaranteed not derived
2327 // from any globally unique hardware id.
2328 // For paired devices, it stays consistent between Bluetooth toggling for the
2329 // same remote device.
2330 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2331 // session for the same remote device.
2332 // Default: 0 if the device's metric id is unknown.
2333 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002334}
2335
2336/**
2337 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2338 *
2339 * Logged from:
2340 * system/bt
2341 */
2342message BluetoothDeviceTxPowerLevelReported {
2343 // An identifier that can be used to match events for this device.
2344 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2345 // Salt: Randomly generated 256 bit value
2346 // Hash algorithm: HMAC-SHA256
2347 // Size: 32 byte
2348 // Default: null or empty if the device identifier is not known
2349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2350 // Connection handle of this connection if available
2351 // Range: 0x0000 - 0x0EFF (12 bits)
2352 // Default: 0xFFFF if the handle is unknown
2353 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002354 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002355 // Default: STATUS_UNKNOWN
2356 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2357 // Range: -30 ≤ N ≤ 20
2358 // Units: dBm
2359 // Invalid when an out of range value is reported
2360 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002361 // An identifier that can be used to match events for this device.
2362 // The incremental identifier is locally generated and guaranteed not derived
2363 // from any globally unique hardware id.
2364 // For paired devices, it stays consistent between Bluetooth toggling for the
2365 // same remote device.
2366 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2367 // session for the same remote device.
2368 // Default: 0 if the device's metric id is unknown.
2369 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002370}
Jack Heab86dbd22018-12-18 15:43:27 -08002371
Tej Singh5d991e12018-03-09 19:48:11 -08002372/**
Jack He1021a612019-01-20 21:22:46 -08002373 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2374 * receiving an HCI command from the host
2375 *
2376 * Logged from: system/bt
2377 */
2378message BluetoothHciTimeoutReported {
2379 // HCI command associated with this event
2380 // Default: CMD_UNKNOWN
2381 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2382}
2383
2384/**
2385 * Logs when we receive Bluetooth Link Quality Report event from the controller
2386 * See Android Bluetooth HCI specification for more details
2387 *
2388 * Note: all count and bytes field are counted since last event
2389 *
2390 * Logged from: system/bt
2391 */
2392message BluetoothQualityReportReported {
2393 // Quality report ID
2394 // Original type: uint8_t
2395 // Default: BQR_ID_UNKNOWN
2396 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2397 // Packet type of the connection
2398 // Original type: uint8_t
2399 // Default: BQR_PACKET_TYPE_UNKNOWN
2400 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2401 // Connection handle of the connection
2402 // Original type: uint16_t
2403 optional int32 connection_handle = 3;
2404 // Performing Role for the connection
2405 // Original type: uint8_t
2406 optional int32 connection_role = 4;
2407 // Current Transmit Power Level for the connection. This value is the same as the controller's
2408 // response to the HCI_Read_Transmit_Power_Level HCI command
2409 // Original type: uint8_t
2410 optional int32 tx_power_level = 5;
2411 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2412 // absolute receiver signal strength value
2413 // Original type: int8_t
2414 optional int32 rssi = 6;
2415 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2416 // channels used by the link currently
2417 // Original type: uint8_t
2418 optional int32 snr = 7;
2419 // Indicates the number of unused channels in AFH_channel_map
2420 // Original type: uint8_t
2421 optional int32 unused_afh_channel_count = 8;
2422 // Indicates the number of the channels which are interfered and quality is bad but are still
2423 // selected for AFH
2424 // Original type: uint8_t
2425 optional int32 afh_select_unideal_channel_count = 9;
2426 // Current Link Supervision Timeout Setting
2427 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2428 // Original type: uint16_t
2429 optional int32 lsto = 10;
2430 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2431 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2432 // 0x01 (Piconet Clock)
2433 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2434 // Original type: uint32_t
2435 optional int64 connection_piconet_clock = 11;
2436 // The count of retransmission
2437 // Original type: uint32_t
2438 optional int64 retransmission_count = 12;
2439 // The count of no RX
2440 // Original type: uint32_t
2441 optional int64 no_rx_count = 13;
2442 // The count of NAK (Negative Acknowledge)
2443 // Original type: uint32_t
2444 optional int64 nak_count = 14;
2445 // Controller timestamp of last TX ACK
2446 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2447 // Original type: uint32_t
2448 optional int64 last_tx_ack_timestamp = 15;
2449 // The count of Flow-off (STOP)
2450 // Original type: uint32_t
2451 optional int64 flow_off_count = 16;
2452 // Controller timestamp of last Flow-on (GO)
2453 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2454 // Original type: uint32_t
2455 optional int64 last_flow_on_timestamp = 17;
2456 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2457 // Original type: uint32_t
2458 optional int64 buffer_overflow_bytes = 18;
2459 // Buffer underflow count (in byte) since last event
2460 // Original type: uint32_t
2461 optional int64 buffer_underflow_bytes = 19;
2462}
2463
2464/**
2465 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2466 *
2467 * Notes:
2468 * - Each event can be partially filled as we might learn different pieces of device
2469 * information at different time
2470 * - Multiple device info events can be combined to give more complete picture
2471 * - When multiple device info events tries to describe the same information, the
2472 * later one wins
2473 *
2474 * Logged from:
2475 * packages/apps/Bluetooth
2476 */
Jack Heaea26982019-04-04 11:19:48 -07002477message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002478 // An identifier that can be used to match events for this device.
2479 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2480 // Salt: Randomly generated 256 bit value
2481 // Hash algorithm: HMAC-SHA256
2482 // Size: 32 byte
2483 // Default: null or empty if the device identifier is not known
2484 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2485 // Where is this device info obtained from
2486 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2487 // Name of the data source
2488 // For EXTERNAL: package name of the data source
2489 // For INTERNAL: null for general case, component name otherwise
2490 optional string source_name = 3;
2491 // Name of the manufacturer of this device
2492 optional string manufacturer = 4;
2493 // Model of this device
2494 optional string model = 5;
2495 // Hardware version of this device
2496 optional string hardware_version = 6;
2497 // Software version of this device
2498 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002499 // An identifier that can be used to match events for this device.
2500 // The incremental identifier is locally generated and guaranteed not derived
2501 // from any globally unique hardware id.
2502 // For paired devices, it stays consistent between Bluetooth toggling for the
2503 // same remote device.
2504 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2505 // session for the same remote device.
2506 // Default: 0 if the device's metric id is unknown.
2507 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002508}
2509
2510/**
2511 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2512 * device, as documented by the Bluetooth Core HCI specification
2513 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2514 * Vol 2, Part E, Page 1118
2515 *
2516 * Logged from:
2517 * system/bt
2518 */
2519message BluetoothRemoteVersionInfoReported {
2520 // Connection handle of the connection
2521 // Original type: uint16_t
2522 optional int32 connection_handle = 1;
2523 // HCI command status code
2524 // Default: STATUS_UNKNOWN
2525 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2526 // 1 byte Version of current LMP in the remote controller
2527 optional int32 lmp_version = 3;
2528 // 2 bytes LMP manufacturer code of the remote controller
2529 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2530 optional int32 lmp_manufacturer_code = 4;
2531 // 4 bytes subversion of the LMP in the remote controller
2532 optional int32 lmp_subversion = 5;
2533}
2534
2535/**
2536 * Logs when certain Bluetooth SDP attributes are discovered
2537 * Constant definitions are from:
2538 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2539 *
2540 * Current logged attributes:
2541 * - BluetoothProfileDescriptorList
2542 * - Supported Features Bitmask
2543 *
2544 * Logged from:
2545 * system/bt
2546 */
2547message BluetoothSdpAttributeReported {
2548 // An identifier that can be used to match events for this device.
2549 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2550 // Salt: Randomly generated 256 bit value
2551 // Hash algorithm: HMAC-SHA256
2552 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2553 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2554 // Original type: uint16_t
2555 optional int32 protocol_uuid = 2;
2556 // Short form UUIDs used to identify Bluetooth SDP attribute types
2557 // Original type: uint16_t
2558 optional int32 attribute_id = 3;
2559 // Attribute value for the particular attribute
2560 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002561 // An identifier that can be used to match events for this device.
2562 // The incremental identifier is locally generated and guaranteed not derived
2563 // from any globally unique hardware id.
2564 // For paired devices, it stays consistent between Bluetooth toggling for the
2565 // same remote device.
2566 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2567 // session for the same remote device.
2568 // Default: 0 if the device's metric id is unknown.
2569 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002570}
2571
2572/**
2573 * Logs when bond state of a Bluetooth device changes
2574 *
2575 * Logged from:
2576 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2577 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2578 */
2579message BluetoothBondStateChanged {
2580 // An identifier that can be used to match events for this device.
2581 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2582 // Salt: Randomly generated 256 bit value
2583 // Hash algorithm: HMAC-SHA256
2584 // Size: 32 byte
2585 // Default: null or empty if the device identifier is not known
2586 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2587 // Preferred transport type to remote dual mode device
2588 // Default: TRANSPORT_AUTO means no preference
2589 optional android.bluetooth.TransportTypeEnum transport = 2;
2590 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2591 // Default: UNKNOWN
2592 optional android.bluetooth.DeviceTypeEnum type = 3;
2593 // Current bond state (NONE, BONDING, BONDED)
2594 // Default: BOND_STATE_UNKNOWN
2595 optional android.bluetooth.BondStateEnum bond_state = 4;
2596 // Bonding sub state
2597 // Default: BOND_SUB_STATE_UNKNOWN
2598 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2599 // Unbond Reason
2600 // Default: UNBOND_REASON_UNKNOWN
2601 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002602 // An identifier that can be used to match events for this device.
2603 // The incremental identifier is locally generated and guaranteed not derived
2604 // from any globally unique hardware id.
2605 // For paired devices, it stays consistent between Bluetooth toggling for the
2606 // same remote device.
2607 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2608 // session for the same remote device.
2609 // Default: 0 if the device's metric id is unknown.
2610 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002611}
2612
2613/**
2614 * Logs there is an event related Bluetooth classic pairing
2615 *
2616 * Logged from:
2617 * system/bt
2618 */
2619message BluetoothClassicPairingEventReported {
2620 // An identifier that can be used to match events for this device.
2621 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2622 // Salt: Randomly generated 256 bit value
2623 // Hash algorithm: HMAC-SHA256
2624 // Size: 32 byte
2625 // Default: null or empty if the device identifier is not known
2626 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2627 // Connection handle of this connection if available
2628 // Range: 0x0000 - 0x0EFF (12 bits)
2629 // Default: 0xFFFF if the handle is unknown
2630 optional int32 connection_handle = 2;
2631 // HCI command associated with this event
2632 // Default: CMD_UNKNOWN
2633 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2634 // HCI event associated with this event
2635 // Default: EVT_UNKNOWN
2636 optional android.bluetooth.hci.EventEnum hci_event = 4;
2637 // HCI command status code if this is triggerred by hci_cmd
2638 // Default: STATUS_UNKNOWN
2639 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2640 // HCI reason code associated with this event
2641 // Default: STATUS_UNKNOWN
2642 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002643 // A status value related to this specific event
2644 // Default: 0
2645 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002646 // An identifier that can be used to match events for this device.
2647 // The incremental identifier is locally generated and guaranteed not derived
2648 // from any globally unique hardware id.
2649 // For paired devices, it stays consistent between Bluetooth toggling for the
2650 // same remote device.
2651 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2652 // session for the same remote device.
2653 // Default: 0 if the device's metric id is unknown.
2654 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002655}
2656
2657/**
2658 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2659 *
2660 * Logged from:
2661 * system/bt
2662 */
2663message BluetoothSmpPairingEventReported {
2664 // An identifier that can be used to match events for this device.
2665 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2666 // Salt: Randomly generated 256 bit value
2667 // Hash algorithm: HMAC-SHA256
2668 // Size: 32 byte
2669 // Default: null or empty if the device identifier is not known
2670 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2671 // SMP command sent or received over L2CAP
2672 // Default: CMD_UNKNOWN
2673 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2674 // Whether this command is sent or received
2675 // Default: DIRECTION_UNKNOWN
2676 optional android.bluetooth.DirectionEnum direction = 3;
2677 // SMP failure reason code
2678 // Default: PAIRING_FAIL_REASON_DEFAULT
2679 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002680 // An identifier that can be used to match events for this device.
2681 // The incremental identifier is locally generated and guaranteed not derived
2682 // from any globally unique hardware id.
2683 // For paired devices, it stays consistent between Bluetooth toggling for the
2684 // same remote device.
2685 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2686 // session for the same remote device.
2687 // Default: 0 if the device's metric id is unknown.
2688 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002689}
2690
2691/**
Jack He815cdba2019-01-30 17:24:55 -08002692 * Logs when a Bluetooth socket’s connection state changed
2693 *
2694 * Logged from:
2695 * system/bt
2696 */
2697message BluetoothSocketConnectionStateChanged {
2698 // An identifier that can be used to match events for this device.
2699 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2700 // Salt: Randomly generated 256 bit value
2701 // Hash algorithm: HMAC-SHA256
2702 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002703 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002704 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002705 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002706 // Default 0 when unknown or don't care
2707 optional int32 port = 2;
2708 // Socket type as mentioned in
2709 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2710 // Default: SOCKET_TYPE_UNKNOWN
2711 optional android.bluetooth.SocketTypeEnum type = 3;
2712 // Socket connection state
2713 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2714 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2715 // Number of bytes sent to remote device during this connection
2716 optional int64 tx_bytes = 5;
2717 // Number of bytes received from remote device during this connection
2718 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002719 // Socket owner's UID
2720 optional int32 uid = 7 [(is_uid) = true];
2721 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2722 // |port| must be spawned by |server_port|
2723 // Default 0 when unknown or don't care
2724 optional int32 server_port = 8;
2725 // Whether this is a server listener socket
2726 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002727 // An identifier that can be used to match events for this device.
2728 // The incremental identifier is locally generated and guaranteed not derived
2729 // from any globally unique hardware id.
2730 // For paired devices, it stays consistent between Bluetooth toggling for the
2731 // same remote device.
2732 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2733 // session for the same remote device.
2734 // Default: 0 if the device's metric id is unknown.
2735 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002736}
2737
2738/**
Jack He71426802019-04-02 13:32:52 -07002739 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2740 *
2741 * Logged from:
2742 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2743 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2744 *
2745 */
2746message BluetoothClassOfDeviceReported {
2747 // An identifier that can be used to match events for this device.
2748 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2749 // Salt: Randomly generated 256 bit value
2750 // Hash algorithm: HMAC-SHA256
2751 // Size: 32 byte
2752 // Default: null or empty if this is a server listener socket
2753 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2754 // Class of Device (CoD) value including both Major, Minor device class and service class
2755 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2756 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2757 // Default: 0
2758 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002759 // An identifier that can be used to match events for this device.
2760 // The incremental identifier is locally generated and guaranteed not derived
2761 // from any globally unique hardware id.
2762 // For paired devices, it stays consistent between Bluetooth toggling for the
2763 // same remote device.
2764 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2765 // session for the same remote device.
2766 // Default: 0 if the device's metric id is unknown.
2767 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002768}
2769
2770/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002771 * Logs when something is plugged into or removed from the USB-C connector.
2772 *
2773 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002774 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002775 */
2776message UsbConnectorStateChanged {
2777 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002778 STATE_DISCONNECTED = 0;
2779 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002780 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002781 optional State state = 1
2782 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2783 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002784 // Last active session in ms.
2785 // 0 when the port is in connected state.
2786 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002787}
2788
2789/**
2790 * Logs the reported speaker impedance.
2791 *
2792 * Logged from:
2793 * Vendor audio implementation.
2794 */
2795message SpeakerImpedanceReported {
2796 optional int32 speaker_location = 1;
2797 optional int32 impedance = 2;
2798}
2799
2800/**
2801 * Logs the report of a failed hardware.
2802 *
2803 * Logged from:
2804 * Vendor HALs.
2805 *
2806 */
2807message HardwareFailed {
2808 enum HardwareType {
2809 HARDWARE_FAILED_UNKNOWN = 0;
2810 HARDWARE_FAILED_MICROPHONE = 1;
2811 HARDWARE_FAILED_CODEC = 2;
2812 HARDWARE_FAILED_SPEAKER = 3;
2813 HARDWARE_FAILED_FINGERPRINT = 4;
2814 }
2815 optional HardwareType hardware_type = 1;
2816
Maggie White6dcd8572019-01-31 14:11:50 -08002817 /**
2818 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002819 * the same hardware_type. The specific locations are vendor defined integers,
2820 * referring to board-specific numbering schemes.
2821 */
2822 optional int32 hardware_location = 2;
2823
Maggie White6dcd8572019-01-31 14:11:50 -08002824 /**
2825 * failure_code is specific to the HardwareType of the failed hardware.
2826 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002827 */
Maggie White6dcd8572019-01-31 14:11:50 -08002828 enum HardwareErrorCode {
2829 UNKNOWN = 0;
2830 COMPLETE = 1;
2831 SPEAKER_HIGH_Z = 2;
2832 SPEAKER_SHORT = 3;
2833 FINGERPRINT_SENSOR_BROKEN = 4;
2834 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002835 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002836 }
2837 optional int32 failure_code = 3;
2838}
2839
2840/**
2841 * Log an event when the device has been physically dropped.
2842 * Reported from the /vendor partition.
2843 */
2844message PhysicalDropDetected {
2845 // Confidence that the event was actually a drop, 0 -> 100
2846 optional int32 confidence_pctg = 1;
2847 // Peak acceleration of the drop, in 1/1000s of a g.
2848 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002849 // Duration of freefall in ms
2850 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002851}
2852
2853/**
2854 * Log bucketed battery charge cycles.
2855 *
2856 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002857 * a given charge point. For example, if 10 cycle buckets are
2858 * initialized, bucket 1 is the lowest 1/10th of the battery,
2859 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002860 *
2861 * Logged from:
2862 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2863 */
2864message ChargeCyclesReported {
2865 optional int32 cycle_bucket_1 = 1;
2866 optional int32 cycle_bucket_2 = 2;
2867 optional int32 cycle_bucket_3 = 3;
2868 optional int32 cycle_bucket_4 = 4;
2869 optional int32 cycle_bucket_5 = 5;
2870 optional int32 cycle_bucket_6 = 6;
2871 optional int32 cycle_bucket_7 = 7;
2872 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002873 optional int32 cycle_bucket_9 = 9;
2874 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002875}
2876
2877/**
Howard Roa46b6582018-09-18 16:45:02 -07002878 * Log battery health snapshot.
2879 *
2880 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2881 * are snapshotted periodically over 24hrs.
2882 */
2883message BatteryHealthSnapshot {
2884 enum BatterySnapshotType {
2885 UNKNOWN = 0;
2886 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2887 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2888 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2889 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2890 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2891 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2892 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2893 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2894 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2895 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2896 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2897 }
2898 optional BatterySnapshotType type = 1;
2899 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002900 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002901 // Voltage Battery Voltage, in microVolts.
2902 optional int32 voltage_micro_volt = 3;
2903 // Current Battery current, in microAmps.
2904 optional int32 current_micro_amps = 4;
2905 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2906 optional int32 open_circuit_micro_volt = 5;
2907 // Resistance Battery Resistance, in microOhms.
2908 optional int32 resistance_micro_ohm = 6;
2909 // Level Battery Level, as % of full.
2910 optional int32 level_percent = 7;
2911}
2912
2913/**
2914 * Log slow I/O operations on the primary storage.
2915 */
2916message SlowIo {
2917 // Classifications of IO Operations.
2918 enum IoOperation {
2919 UNKNOWN = 0;
2920 READ = 1;
2921 WRITE = 2;
2922 UNMAP = 3;
2923 SYNC = 4;
2924 }
2925 optional IoOperation operation = 1;
2926
2927 // The number of slow IO operations of this type over 24 hours.
2928 optional int32 count = 2;
2929}
2930
2931/**
2932 * Log battery caused shutdown with the last recorded voltage.
2933 */
2934message BatteryCausedShutdown {
2935 // The last recorded battery voltage prior to shutdown.
2936 optional int32 last_recorded_micro_volt = 1;
2937}
2938
2939/**
Tej Singha72344992019-04-17 18:55:08 -07002940 * Logs when ThermalService receives throttling events.
2941 *
2942 * Logged from:
2943 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2944 */
2945message ThermalThrottlingSeverityStateChanged {
2946 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2947 optional android.os.TemperatureTypeEnum sensor_type = 1;
2948
2949 // The name of the temperature source. Eg. CPU0
2950 optional string sensor_name = 2;
2951
2952 // Temperature in tenths of a degree C.
2953 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2954 optional int32 temperature_deci_celsius = 3;
2955
2956 // Relative severity of the throttling, see enum definition.
2957 optional android.os.ThrottlingSeverityEnum severity = 4;
2958}
2959
2960/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002961 * Logs the duration of a davey (jank of >=700ms) when it occurs
2962 *
2963 * Logged from:
2964 * frameworks/base/libs/hwui/JankTracker.cpp
2965 */
2966message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002967 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002968 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002969
Tej Singhbb8554a2018-01-26 11:59:14 -08002970 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002971 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002972}
2973
2974/**
Bookatze5885242017-10-24 20:10:31 -07002975 * Logs phone signal strength changes.
2976 *
2977 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002978 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002979 */
2980message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002981 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2982 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002983}
2984
Yangster4ccebea2018-10-09 17:09:02 -07002985
2986/**
2987 * Logs when the phone state, sim state or signal strength changes
2988 *
2989 * Logged from:
2990 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2991 */
2992message PhoneServiceStateChanged {
2993 optional android.telephony.ServiceStateEnum state = 1;
2994 optional android.telephony.SimStateEnum sim_state = 2;
2995 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2996}
2997
2998/**
2999 * Logs when the phone becomes on or off.
3000 *
3001 * Logged from:
3002 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
3003 */
3004message PhoneStateChanged {
3005 enum State {
3006 OFF = 0;
3007 ON = 1;
3008 }
3009 optional State state = 1;
3010}
3011
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003012message BackGesture {
3013 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003014 DEFAULT_BACK_TYPE = 0;
3015 COMPLETED = 1;
3016 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3017 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3018 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3019 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3020 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3021 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3022 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003023 }
3024 optional BackType type = 1;
3025
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003026 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3027 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3028 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3029 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3030 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3031 optional int32 left_boundary = 8; // left edge width + left inset
3032 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3033
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003034 enum WindowHorizontalLocation {
3035 DEFAULT_LOCATION = 0;
3036 LEFT = 1;
3037 RIGHT = 2;
3038 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003039 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003040}
3041
3042message ExclusionRectStateChanged {
3043 optional string component_name = 1; // if not available, simply packageName
3044 optional int32 requested_height = 2; // px
3045 optional int32 rejected_height = 3; // px
3046
3047 enum WindowHorizontalLocation {
3048 DEFAULT_LOCATION = 0;
3049 LEFT = 1;
3050 RIGHT = 2;
3051 }
3052 optional WindowHorizontalLocation x_location = 4;
3053 optional bool landscape = 5;
3054 optional bool splitscreen = 6;
3055 optional int32 duration_millis = 7;
3056}
3057
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003058/**
3059 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3060 *
3061 * Logged from:
3062 * packages/apps/Launcher3
3063 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003064message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003065 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003066 optional android.stats.launcher.LauncherState src_state = 2;
3067 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003068 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3069 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3070
3071 // The event id (e.g., app launch, drag and drop, long press)
3072 optional int32 event_id = 6;
3073 // The event's source or target id (e.g., icon, task, button)
3074 optional int32 target_id = 7;
3075 // If the target needs to be tracked, use this id field
3076 optional int32 instance_id = 8;
3077 optional int32 uid = 9 [(is_uid) = true];
3078 optional string package_name = 10;
3079 optional string component_name = 11;
3080
3081 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003082 optional int32 grid_x = 12 [default = -1];
3083 optional int32 grid_y = 13 [default = -1];
3084 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003085
3086 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003087 optional int32 grid_x_parent = 15 [default = -1];
3088 optional int32 grid_y_parent = 16 [default = -1];
3089 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003090
3091 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3092 optional int32 hierarchy = 18;
3093
3094 optional bool is_work_profile = 19;
3095
3096 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003097 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003098
3099 // e.g., folderLabelState can be captured in the following two fields
3100 optional int32 from_state = 21;
3101 optional int32 to_state = 22;
3102
3103 // e.g., autofilled or suggested texts that are not user entered
3104 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003105
3106 // e.g., number of contents inside a container (e.g., icons inside a folder)
3107 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003108}
3109
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003110/**
3111 * Used for snapshot of the HomeScreen UI elements
3112 *
3113 * Logged from:
3114 * packages/apps/Launcher3
3115 */
3116message LauncherStaticLayout {
3117 // The event id (e.g., snapshot, drag and drop)
3118 optional int32 event_id = 1;
3119 // The event's source or target id (e.g., icon, shortcut, widget)
3120 optional int32 target_id = 2;
3121 // If the target needs to be tracked, use this id field
3122 optional int32 instance_id = 3;
3123 optional int32 uid = 4 [(is_uid) = true];
3124 optional string package_name = 5;
3125 optional string component_name = 6;
3126
3127 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003128 optional int32 grid_x = 7 [default = -1];
3129 optional int32 grid_y = 8 [default = -1];
3130 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003131
3132 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003133 // e.g., when used with widgets target, use these values for (span_x, span_y)
3134 optional int32 grid_x_parent = 10 [default = -1];
3135 optional int32 grid_y_parent = 11 [default = -1];
3136 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003137
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003138 // UNKNOWN = 0
3139 // HOTSEAT = 1
3140 // WORKSPACE = 2
3141 // FOLDER_HOTSEAT = 3
3142 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003143 optional int32 hierarchy = 13;
3144
3145 optional bool is_work_profile = 14;
3146
3147 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3148 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003149
3150 // e.g., number of icons inside a folder
3151 optional int32 cardinality = 16;
3152
3153 // e.g., (x, y) span of the widget inside homescreen grid system
3154 optional int32 span_x = 17 [default = 1];
3155 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003156}
3157
3158/**
3159 * Logs when Wallpaper or ThemePicker UI has changed.
3160 *
3161 * Logged from:
3162 * packages/apps/ThemePicker
3163 * packages/apps/WallpaperPicker2
3164 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003165message StyleUIChanged {
3166 optional android.stats.style.Action action = 1;
3167 optional int32 color_package_hash = 2;
3168 optional int32 font_package_hash = 3;
3169 optional int32 shape_package_hash = 4;
3170 optional int32 clock_package_hash = 5;
3171 optional int32 launcher_grid = 6;
3172 optional int32 wallpaper_category_hash = 7;
3173 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003174 optional int32 color_preference = 9;
3175 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003176}
3177
David Chenc28b2bb2017-10-24 12:52:52 -07003178/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003179 * Logs when Settings UI has changed.
3180 *
3181 * Logged from:
3182 * packages/apps/Settings
3183 */
3184message SettingsUIChanged {
3185 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003186 * Where this SettingsUIChange event comes from. For example, if
3187 * it's a PAGE_VISIBLE event, where the page is opened from.
3188 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003189 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003190
3191 /**
3192 * What the UI action is.
3193 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003194 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003195
3196 /**
3197 * Where the action is happening
3198 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003199 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003200
3201 /**
3202 * What preference changed in this event.
3203 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003204 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003205
3206 /**
3207 * The new value of the changed preference.
3208 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003209 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003210}
3211
3212/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003213 * Logs basic timing information about touch events.
3214 * Reported at most every 5 minutes while device is being interacted with.
3215 *
3216 * Logged from:
3217 * frameworks/native/services/inputflinger
3218 */
3219message TouchEventReported {
3220 /**
3221 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003222 * and the standard deviation of the time spent processing touchscreen events
3223 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003224 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003225 * On supported devices, the starting point is taken during the hard interrupt inside the
3226 * kernel touch driver. On all other devices, the starting point is taken inside
3227 * the kernel's input event subsystem upon receipt of the input event.
3228 * The ending point is taken inside InputDispatcher, just after the input event
3229 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003230 */
3231 // Minimum value
3232 optional float latency_min_micros = 1;
3233 // Maximum value
3234 optional float latency_max_micros = 2;
3235 // Average value
3236 optional float latency_mean_micros = 3;
3237 // Standard deviation
3238 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003239 // Number of touch events (input_event) in this report
3240 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003241}
3242
3243/**
Philip Quinn0eded622019-01-29 12:46:28 -08003244 * Logs gesture classification and timing information for touch events.
3245 *
3246 * Logged from:
3247 * frameworks/base/core/java/android/view/GestureDetector.java
3248 * frameworks/base/core/java/android/view/View.java
3249 */
3250message TouchGestureClassified {
3251 // The source of the classification (e.g. Java class name).
3252 optional string source = 1;
3253
3254 enum Classification {
3255 UNKNOWN_CLASSIFICATION = 0;
3256 SINGLE_TAP = 1;
3257 DOUBLE_TAP = 2;
3258 LONG_PRESS = 3;
3259 DEEP_PRESS = 4;
3260 SCROLL = 5;
3261 }
3262 // The classification of the gesture.
3263 optional Classification classification = 2;
3264
3265 // The interval from the start of a touch event stream until the
3266 // classification was made.
3267 optional int32 latency_millis = 3;
3268
3269 // The distance from the location of the first touch event to the
3270 // location of the touch event when the classification was made.
3271 optional float displacement_px = 4;
3272}
3273
3274/**
David Chenc28b2bb2017-10-24 12:52:52 -07003275 * Logs that a setting was updated.
3276 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003277 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003278 * The tag and is_default allow resetting of settings to default values based on the specified
3279 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3280 */
3281message SettingChanged {
3282 // The name of the setting.
3283 optional string setting = 1;
3284
3285 // The change being imposed on this setting. May represent a number, eg "3".
3286 optional string value = 2;
3287
3288 // The new value of this setting. For most settings, this is same as value. For some settings,
3289 // value is +X or -X where X represents an element in a set. For example, if the previous value
3290 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3291 // The +/- feature is currently only used for location_providers_allowed.
3292 optional string new_value = 3;
3293
3294 // The previous value of this setting.
3295 optional string prev_value = 4;
3296
3297 // The tag used with the is_default for resetting sets of settings. This is generally null.
3298 optional string tag = 5;
3299
Bookatz90867622018-01-31 15:05:57 -08003300 // True if this setting with tag should be resettable.
3301 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003302
David Chenbd789912018-03-16 17:19:55 -07003303 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003304 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003305
3306 enum ChangeReason {
3307 UPDATED = 1; // Updated can be an insertion or an update.
3308 DELETED = 2;
3309 }
3310 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003311}
Chenjie Yub3dda412017-10-24 13:41:59 -07003312
Chenjie Yu05013b32017-11-21 10:21:41 -08003313/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003314 * Logs activity going to foreground or background
3315 *
3316 * Logged from:
3317 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3318 */
3319message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003320 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003321 optional string pkg_name = 2;
3322 optional string class_name = 3;
3323
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003324 enum State {
3325 BACKGROUND = 0;
3326 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003327 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003328 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003329}
David Chenc8a43242017-10-17 16:23:28 -07003330
3331/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003332 * Logs when a volume entered low Storage state.
3333 * Logged from:
3334 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3335 */
3336message LowStorageStateChanged {
3337 // Volume that ran out of storage.
3338 optional string volume_description = 1;
3339
3340 enum State {
3341 UNKNOWN = 0;
3342 OFF = 1;
3343 ON = 2;
3344 }
3345 optional State state = 2;
3346}
3347
3348/**
3349 * Logs when an app is downgraded.
3350 * Logged from:
3351 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3352 */
3353message AppDowngraded {
3354 optional string package_name = 1;
3355 // Size of the package (all data) before being downgraded.
3356 optional int64 size_in_bytes_before = 2;
3357 // Size of the package (all data) after being downgraded.
3358 optional int64 size_in_bytes_after = 3;
3359
3360 optional bool aggressive = 4;
3361}
3362
3363/**
3364 * Logs when an app is optimized after being downgraded.
3365 * Logged from:
3366 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3367 */
3368message AppOptimizedAfterDowngraded {
3369 optional string package_name = 1;
3370}
3371
3372/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003373 * Logs whenever an app is installed on external storage.
3374 * Logged from:
3375 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3376 */
3377message AppInstallOnExternalStorageReported {
3378 // The type of external storage.
3379 optional android.stats.storage.ExternalStorageType storage_type = 1;
3380 // The name of the package that is installed on the sd card.
3381 optional string package_name = 2;
3382}
3383
3384/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003385 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003386 * Logged from:
3387 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3388 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003389message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003390 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003391
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003392 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003393
3394 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003395 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003396 optional string process_name = 3;
3397
3398 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003399 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003400
3401 optional string package_name = 5;
3402
3403 enum InstantApp {
3404 UNAVAILABLE = 0;
3405 FALSE = 1;
3406 TRUE = 2;
3407 }
3408 optional InstantApp is_instant_app = 6;
3409
3410 enum ForegroundState {
3411 UNKNOWN = 0;
3412 BACKGROUND = 1;
3413 FOREGROUND = 2;
3414 }
3415 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003416
3417 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003418}
David Chen9e3808c2017-11-20 17:25:34 -08003419
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003420/**
3421 * Logs when a WTF (What a Terrible Failure) happened.
3422 * Logged from:
3423 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3424 */
3425message WTFOccurred {
3426 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003427
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003428 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003429
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003430 // The name of the process.
3431 // system_server if it is not by an app
3432 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003433
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003434 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003435 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003436
3437 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003438}
3439
3440/**
3441 * Logs when system server reports low memory.
3442 * Logged from:
3443 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3444 */
3445message LowMemReported {
3446}
3447
3448/**
3449 * Logs when an app ANR (App Not Responding) occurs.
3450 * Logged from:
3451 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3452 */
3453message ANROccurred {
3454 optional int32 uid = 1 [(is_uid) = true];
3455
3456 optional string process_name = 2;
3457
3458 optional string short_component_name = 3;
3459
3460 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003461
3462 enum InstantApp {
3463 UNAVAILABLE = 0;
3464 FALSE = 1;
3465 TRUE = 2;
3466 }
3467 optional InstantApp is_instant_app = 5;
3468
3469 enum ForegroundState {
3470 UNKNOWN = 0;
3471 BACKGROUND = 1;
3472 FOREGROUND = 2;
3473 }
3474 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003475
3476 optional android.server.ErrorSource error_source = 7;
3477
3478 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003479}
3480
Bookatza7020bd2018-08-28 16:29:35 -07003481/**
3482 * Logs when the vibrator state changes.
3483 * Logged from:
3484 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3485 */
3486message VibratorStateChanged {
3487 repeated AttributionNode attribution_node = 1;
3488
3489 enum State {
3490 OFF = 0;
3491 ON = 1;
3492 }
3493 optional State state = 2;
3494
3495 // Duration (in milliseconds) requested to keep the vibrator on.
3496 // Only applicable for State == ON.
3497 optional int64 duration_millis = 3;
3498}
3499
David Chen0a368b22017-12-06 16:28:16 -08003500/*
3501 * Allows other apps to push events into statsd.
3502 * Logged from:
3503 * frameworks/base/core/java/android/util/StatsLog.java
3504 */
David Chen0b5c90c2018-01-25 16:51:49 -08003505message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003506 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003507 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003508
3509 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3510 optional int32 label = 2;
3511
3512 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3513 // predicates for the metrics).
3514 enum State {
3515 UNKNOWN = 0;
3516 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3517 STOP = 2;
3518 START = 3;
3519 }
3520 optional State state = 3;
3521}
3522
David Chen9e3808c2017-11-20 17:25:34 -08003523/**
Bookatz7948c872018-09-04 12:58:33 -07003524 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3525 * For example, this could be due to the user manually changing the time.
3526 *
3527 * Logged from:
3528 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3529 */
3530message WallClockTimeShifted {
3531 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3532 optional int64 wall_clock_timestamp_millis = 1;
3533}
3534
3535/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003536 * Logs when statsd detects an anomaly.
3537 *
3538 * Logged from:
3539 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3540 */
3541message AnomalyDetected {
3542 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003543 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003544
Yangster-mac94e197c2018-01-02 16:03:03 -08003545 // Id of the config whose anomaly detection alert fired.
3546 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003547
Yangster-mac94e197c2018-01-02 16:03:03 -08003548 // Id of the alert (i.e. name of the anomaly that was detected).
3549 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003550}
3551
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003552message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003553 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003554 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003555
3556 // The app package name.
3557 optional string pkg_name = 2;
3558
3559 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003560 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003561 WARM = 1;
3562 HOT = 2;
3563 COLD = 3;
3564 }
3565 // The transition type.
3566 optional TransitionType type = 3;
3567
3568 // The activity name.
3569 optional string activity_name = 4;
3570
3571 // The name of the calling app. Empty if not set.
3572 optional string calling_pkg_name = 5;
3573
3574 // Whether the app is an instant app.
3575 optional bool is_instant_app = 6;
3576
3577 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003578 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003579
Bookatz80d11a02018-01-16 10:46:35 -08003580 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003581
David Chen0b5c90c2018-01-25 16:51:49 -08003582 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003583 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003584 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003585 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003586 optional int32 bind_application_delay_millis = 11;
3587 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003588
3589 // Empty if not set.
3590 optional string launch_token = 13;
3591
Calin Juravle759fbda2018-02-20 19:52:30 +00003592 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003593 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003594
3595 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003596 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003597}
3598
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003599message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003600 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003601 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003602
3603 // The app package name.
3604 optional string pkg_name = 2;
3605
3606 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003607 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003608 WARM = 1;
3609 HOT = 2;
3610 COLD = 3;
3611 }
3612 // The transition type.
3613 optional TransitionType type = 3;
3614
3615 // The activity name.
3616 optional string activity_name = 4;
3617}
3618
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003619message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003620 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003621 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003622
3623 // The app package name.
3624 optional string pkg_name = 2;
3625
3626 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003627 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003628 WITH_BUNDLE = 1;
3629 WITHOUT_BUNDLE = 2;
3630 }
3631 // The transition type.
3632 optional TransitionType type = 3;
3633
3634 // The activity name.
3635 optional string activity_name = 4;
3636
3637 optional bool transition_process_running = 5;
3638
3639 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003640 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003641}
3642
Bookatz8fcd09a2017-12-18 13:01:10 -08003643/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003644 * Logs a picture-in-picture action
3645 * Logged from:
3646 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3647 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3648 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3649 */
3650message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003651 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003652 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003653
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003654 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003655
Chenjie Yu52cacc62017-12-08 18:11:45 -08003656 enum State {
3657 ENTERED = 1;
3658 EXPANDED_TO_FULL_SCREEN = 2;
3659 MINIMIZED = 3;
3660 DISMISSED = 4;
3661 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003662 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003663}
3664
3665/**
Chenjie Yue8904192017-12-08 19:12:57 -08003666 * Logs overlay action
3667 * Logged from:
3668 * services/core/java/com/android/server/wm/Session.java
3669 */
3670message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003671 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003672
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003673 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003674
3675 optional bool using_alert_window = 3;
3676
3677 enum State {
3678 ENTERED = 1;
3679 EXITED = 2;
3680 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003681 optional State state = 4
3682 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003683}
3684
Adam Bookatz38767932020-02-05 12:13:40 -08003685/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003686 * Logs foreground service starts and stops.
3687 * Note that this is not when a service starts or stops, but when it is
3688 * considered foreground.
3689 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003690 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003691 */
3692message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003693 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003694 // package_name + "/" + class_name
3695 optional string short_name = 2;
3696
3697 enum State {
3698 ENTER = 1;
3699 EXIT = 2;
3700 }
3701 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003702
3703 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3704 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3705 optional bool allow_while_in_use_permission = 4;
3706}
3707
3708/**
3709 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3710 * A foreground service session is any continuous period during which the uid holds at least one
3711 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3712 * Accesses initiated while the uid is in the TOP state are ignored.
3713 * Sessions with no attempted accesses are not logged.
3714 * Logged from
3715 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3716 */
3717message ForegroundServiceAppOpSessionEnded {
3718 optional int32 uid = 1 [(is_uid) = true];
3719
3720 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003721 // Only following four ops are logged
3722 // COARSE_LOCATION = 0
3723 // FINE_LOCATION = 1
3724 // CAMERA = 26
3725 // RECORD_AUDIO = 27
3726 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003727
3728 // The uid's permission mode for accessing the AppOp during this fgs session.
3729 enum Mode {
3730 MODE_UNKNOWN = 0;
3731 MODE_ALLOWED = 1; // Always allowed
3732 MODE_IGNORED = 2; // Denied
3733 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3734 }
3735 optional Mode app_op_mode = 3;
3736
3737 // Number of times this AppOp was requested and allowed.
3738 optional int32 count_ops_accepted = 4;
3739 // Number of times this AppOp was requested but denied.
3740 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003741}
3742
Chenjie Yue8904192017-12-08 19:12:57 -08003743/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003744 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3745 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3746 * attributed back to the parent (host) uid. One example is Chrome.
3747 *
3748 * Logged from:
3749 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3750 */
3751message IsolatedUidChanged {
3752 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003753 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003754 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003755 optional int32 parent_uid = 1;
3756
3757 optional int32 isolated_uid = 2;
3758
3759 // We expect an isolated uid to be removed before if it's used for another parent uid.
3760 enum Event {
3761 REMOVED = 0;
3762 CREATED = 1;
3763 }
3764 optional Event event = 3;
3765}
3766
3767/*
3768 * Logs the reception of an incoming network packet causing the main system to wake up for
3769 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3770 * and processed by WakeupController.cpp.
3771 */
3772message PacketWakeupOccurred {
3773 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3774 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003776 // The interface name on which the packet was received.
3777 optional string iface = 2;
3778 // The ethertype value of the packet.
3779 optional int32 ethertype = 3;
3780 // String representation of the destination MAC address of the packet.
3781 optional string destination_hardware_address = 4;
3782 // String representation of the source address of the packet if this was an IP packet.
3783 optional string source_ip = 5;
3784 // String representation of the destination address of the packet if this was an IP packet.
3785 optional string destination_ip = 6;
3786 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3787 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3788 // families.
3789 optional int32 ip_next_header = 7;
3790 // The source port if this was a TCP or UDP packet.
3791 optional int32 source_port = 8;
3792 // The destination port if this was a TCP or UDP packet.
3793 optional int32 destination_port = 9;
3794}
3795
3796/*
3797 * Logs the memory stats for an app on startup.
3798 * Logged from:
3799 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3800 */
3801message AppStartMemoryStateCaptured {
3802 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003803 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003804
3805 // The process name.
3806 optional string process_name = 2;
3807
3808 // The activity name.
3809 optional string activity_name = 3;
3810
3811 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003812 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003813
3814 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003815 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003816
3817 // RSS
3818 optional int64 rss_in_bytes = 6;
3819
3820 // CACHE
3821 optional int64 cache_in_bytes = 7;
3822
3823 // SWAP
3824 optional int64 swap_in_bytes = 8;
3825}
3826
3827/*
3828 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3829 * for LMK event.
3830 * Logged from:
3831 * system/core/lmkd/lmkd.c
3832 */
3833message LmkStateChanged {
3834 enum State {
3835 UNKNOWN = 0;
3836 START = 1;
3837 STOP = 2;
3838 }
3839 optional State state = 1;
3840}
3841
3842/*
3843 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3844 * Logged from:
3845 * system/core/lmkd/lmkd.c
3846 */
3847message LmkKillOccurred {
3848 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003849 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003850
3851 // The process name.
3852 optional string process_name = 2;
3853
3854 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003855 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003856
3857 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003858 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003859
3860 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003861 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003862
3863 // RSS
3864 optional int64 rss_in_bytes = 6;
3865
3866 // CACHE
3867 optional int64 cache_in_bytes = 7;
3868
3869 // SWAP
3870 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003871
3872 // The elapsed real time of start of the process.
3873 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003874
3875 // Min oom adj score considered by lmkd.
3876 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003877}
3878
Rajeev Kumar51b54602018-03-01 12:18:26 -08003879/*
3880 * Logs when the ActivityManagerService detects that an app died.
3881 *
3882 * Logged from:
3883 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3884 */
3885message AppDied {
3886 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003887 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003888}
3889
Howard Ro21a039c2018-08-06 14:55:47 -07003890/**
3891 * An atom for generic metrics logging. Available from Android Q.
3892 */
3893message GenericAtom {
3894 // The uid of the application that sent this custom atom.
3895 optional int32 uid = 1 [(is_uid) = true];
3896
3897 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003898 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003899}
3900
Tej Singhd6d6d772018-09-05 17:41:25 -07003901/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003902 * Atom for simple logging of user interaction and impression events, such as "the user touched
3903 * this button" or "this dialog was displayed".
3904 * Keep the UI event stream clean: don't use for system or background events.
3905 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003906 *
3907 * Logged from:
3908 * frameworks/base/services/core/java/com/android/server/
3909 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003910 */
3911message UiEventReported {
3912 // The event_id.
3913 optional int32 event_id = 1;
3914 // The event's source or target uid and package, if applicable.
3915 // For example, the package posting a notification, or the destination package of a share.
3916 optional int32 uid = 2 [(is_uid) = true];
3917 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003918 // An identifier used to disambiguate which logs refer to a particular instance of some
3919 // UI element. Useful when there might be multiple instances simultaneously active.
3920 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003921}
3922
3923/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003924 * Reports a notification was created or updated.
3925 *
3926 * Logged from:
3927 * frameworks/base/services/core/java/com/android/server/notification/
3928 */
3929message NotificationReported {
3930 // The event_id (as for UiEventReported).
3931 optional int32 event_id = 1;
3932 // The notifying app's uid and package.
3933 optional int32 uid = 2 [(is_uid) = true];
3934 optional string package_name = 3;
3935 // A small system-assigned identifier for the notification.
3936 // Locally probably-unique, but expect collisions across users and/or days.
3937 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003938 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3939 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003940
3941 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003942 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3943 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3944 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003945
3946 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003947 optional string category = 10; // App-assigned notification category (API-defined strings)
3948 optional int32 style = 11; // App-assigned notification style
3949 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003950
3951 // Ordering, importance and interruptiveness
3952
Will Brockman7614f6962020-02-10 19:43:03 -05003953 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003954
Will Brockman7614f6962020-02-10 19:43:03 -05003955 optional android.stats.sysui.NotificationImportance importance = 14;
3956 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003957
3958 enum NotificationImportanceExplanation {
3959 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3960 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3961 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3962 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3963 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3964 // Like _APP, but based on pre-channels priority signal.
3965 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3966 }
3967
Will Brockman7614f6962020-02-10 19:43:03 -05003968 optional NotificationImportanceExplanation importance_source = 16;
3969 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3970 optional NotificationImportanceExplanation importance_initial_source = 18;
3971 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3972 optional int32 assistant_hash = 20;
3973 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003974}
3975
3976message Notification {
3977 // The notifying app's uid and package.
3978 optional int32 uid = 1 [(is_uid) = true];
3979 optional string package_name = 2;
3980 // A small system-assigned identifier for the notification.
3981 optional int32 instance_id = 3;
3982
3983 // Grouping information.
3984 optional int32 group_instance_id = 4;
3985 optional bool is_group_summary = 5;
3986
3987 // The section of the shade that the notification is in.
3988 // See NotificationSectionsManager.PriorityBucket.
3989 enum NotificationSection {
3990 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003991 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003992 SECTION_MEDIA_CONTROLS = 2;
3993 SECTION_PEOPLE = 3;
3994 SECTION_ALERTING = 4;
3995 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05003996 }
3997 optional NotificationSection section = 6;
3998}
3999
4000message NotificationList {
4001 repeated Notification notifications = 1; // An ordered sequence of notifications.
4002}
4003
4004/**
4005 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
4006 *
4007 * Logged from:
4008 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
4009 */
4010message NotificationPanelReported {
4011 // The event_id (as for UiEventReported).
4012 optional int32 event_id = 1;
4013 optional int32 num_notifications = 2;
4014 // The notifications in the panel, in the order that they appear there.
4015 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4016}
4017
4018/**
4019 * Reports a notification channel, or channel group, was created, updated, or deleted.
4020 *
4021 * Logged from:
4022 * frameworks/base/services/core/java/com/android/server/notification/
4023 */
4024message NotificationChannelModified {
4025 // The event_id (as for UiEventReported).
4026 optional int32 event_id = 1;
4027 // The notifying app's uid and package.
4028 optional int32 uid = 2 [(is_uid) = true];
4029 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004030 // Hash of app-assigned notification channel ID or channel-group ID
4031 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004032 // Previous importance setting, if applicable
4033 optional android.stats.sysui.NotificationImportance old_importance = 5;
4034 // New importance setting
4035 optional android.stats.sysui.NotificationImportance importance = 6;
4036}
4037
4038
4039/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004040 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004041 *
4042 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004043 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004044 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004045message BiometricAcquired {
4046 // Biometric modality that was acquired.
4047 optional android.hardware.biometrics.ModalityEnum modality = 1;
4048 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4049 optional int32 user = 2;
4050 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4051 optional bool is_crypto = 3;
4052 // Action that the device is performing. Acquired messages are only expected for enroll and
4053 // authenticate. Other actions may indicate an error.
4054 optional android.hardware.biometrics.ActionEnum action = 4;
4055 // The client that this acquisition was received for.
4056 optional android.hardware.biometrics.ClientEnum client = 5;
4057 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4058 optional int32 acquire_info = 6;
4059 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4060 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004061 // Dictates if this message should trigger additional debugging.
4062 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004063}
4064
4065/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004066 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004067 *
4068 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004069 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004070 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004071message BiometricAuthenticated {
4072 // Biometric modality that was used.
4073 optional android.hardware.biometrics.ModalityEnum modality = 1;
4074 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4075 optional int32 user = 2;
4076 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4077 // storage.
4078 optional bool is_crypto = 3;
4079 // The client that this acquisition was received for.
4080 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004081 // If authentication requires user confirmation. See BiometricPrompt's
4082 // setRequireConfirmation(bool) method.
4083 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004084
Kevin Chyn1741a072019-01-17 11:54:40 -08004085 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004086 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004087 REJECTED = 1;
4088 PENDING_CONFIRMATION = 2;
4089 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004090 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004091
4092 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004093 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004094 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4095 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4096 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4097 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004098 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004099 // Dictates if this message should trigger additional debugging.
4100 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004101}
4102
4103/**
4104 * Logs when a biometric error occurs.
4105 *
4106 * Logged from:
4107 * frameworks/base/services/core/java/com/android/server/biometrics
4108 */
4109message BiometricErrorOccurred {
4110 // Biometric modality that was used.
4111 optional android.hardware.biometrics.ModalityEnum modality = 1;
4112 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4113 optional int32 user = 2;
4114 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4115 optional bool is_crypto = 3;
4116 // Action that the device is performing.
4117 optional android.hardware.biometrics.ActionEnum action = 4;
4118 // The client that this acquisition was received for.
4119 optional android.hardware.biometrics.ClientEnum client = 5;
4120 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4121 // are unique to modality.
4122 optional int32 error_info = 6;
4123 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4124 // by the vendor and not specified by the HIDL interface.
4125 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004126 // Dictates if this message should trigger additional debugging.
4127 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004128 // Time spent during the authentication attempt.
4129 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004130}
4131
4132/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004133 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004134 * Logged from:
4135 * frameworks/base/services/core/java/com/android/server/biometrics
4136 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004137message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004138 // Biometric modality.
4139 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004140 // Type of issue detected.
4141 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004142 // Dictates if this message should trigger additional debugging.
4143 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004144}
Howard Ro688ae182018-09-25 00:09:36 -07004145
joshmccloskey6f952b22019-03-25 20:59:35 -07004146/**
4147 * Logs when a biometric enrollment occurs.
4148 *
4149 * Logged from:
4150 * frameworks/base/services/core/java/com/android/server/biometrics
4151 */
4152message BiometricEnrolled {
4153 // Biometric modality that was used.
4154 optional android.hardware.biometrics.ModalityEnum modality = 1;
4155 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4156 optional int32 user = 2;
4157 // The amount of time the enrollment took in milliseconds.
4158 optional int64 latency_millis = 3;
4159 // Whether or not the enrollment was successful.
4160 optional bool success = 4;
4161}
4162
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004163/*
Tej Singh0d176952019-01-16 19:10:54 -08004164 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004165 */
Tej Singh0d176952019-01-16 19:10:54 -08004166message FlagFlipUpdateOccurred {
4167 // If the event is from a flag config package, specify the package name.
4168 optional string flag_flip_package_name = 1;
4169
4170 // The order id of the package
4171 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004172}
4173
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004174/**
4175 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004176 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004177 */
4178message TrainExperimentIds {
4179 repeated int64 experiment_id = 1;
4180}
4181
Yangster-macb89807e2018-11-15 21:10:57 -08004182/*
4183 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004184 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004185 */
4186message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004187 // Name of the train.
4188 optional string train_name = 1;
4189 // Version code for a "train" of packages that need to be installed atomically
4190 optional int64 train_version_code = 2;
4191 // After installation of this package, device requires a restart.
4192 optional bool requires_staging = 3;
4193 // Rollback should be enabled for this install.
4194 optional bool rollback_enabled = 4;
4195 // Requires low latency monitoring if possible.
4196 optional bool requires_low_latency_monitor = 5;
4197
Yangster-macb89807e2018-11-15 21:10:57 -08004198 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004199 UNKNOWN = 0;
4200 INSTALL_REQUESTED = 1;
4201 INSTALL_STARTED = 2;
4202 INSTALL_STAGED_NOT_READY = 3;
4203 INSTALL_STAGED_READY = 4;
4204 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004205 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4206 // and INSTALL_FAILURE_COMMIT.
4207 INSTALL_FAILURE = 6 [deprecated = true];
4208 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004209 INSTALL_CANCELLED = 7;
4210 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004211 INSTALLER_ROLLBACK_INITIATED = 9;
4212 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4213 INSTALLER_ROLLBACK_STAGED = 11;
4214 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4215 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4216 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4217 INSTALLER_ROLLBACK_SUCCESS = 15;
4218 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004219 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4220 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4221 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4222 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4223 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4224 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004225 INSTALL_FAILURE_DOWNLOAD = 23;
4226 INSTALL_FAILURE_STATE_MISMATCH = 24;
4227 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004228 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004229 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004230 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004231 // Possible experiment ids for monitoring this push.
4232 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4233 // user id
4234 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004235 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004236 // Whether or not this is a rollback event
4237 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004238}
4239
Tej Singhc9203082019-05-03 13:42:23 -07004240/* Test atom, is not logged anywhere */
4241message TestAtomReported {
4242 repeated AttributionNode attribution_node = 1;
4243 optional int32 int_field = 2;
4244 optional int64 long_field = 3;
4245 optional float float_field = 4;
4246 optional string string_field = 5;
4247 optional bool boolean_field = 6;
4248 enum State {
4249 UNKNOWN = 0;
4250 OFF = 1;
4251 ON = 2;
4252 }
4253 optional State state = 7;
4254 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4255}
4256
Maggie Whitefc1aa592018-11-28 21:55:23 -08004257/** Represents USB port overheat event. */
4258message UsbPortOverheatEvent {
4259 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4260 optional int32 plug_temperature_deci_c = 1;
4261
4262 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4263 optional int32 max_temperature_deci_c = 2;
4264
4265 /* Time between USB plug event and overheat threshold trip, in seconds. */
4266 optional int32 time_to_overheat_secs = 3;
4267
4268 /* Time between overheat threshold trip and hysteresis, in seconds. */
4269 optional int32 time_to_hysteresis_secs = 4;
4270
4271 /* Time between hysteresis and active mitigation ending, in seconds. */
4272 optional int32 time_to_inactive_secs = 5;
4273};
4274
Maggie White8735b852019-01-18 11:40:49 -08004275/**
4276 * Logs total effective full charge and discharge cycles on a battery.
4277 * Here are some examples of one effective cycle:
4278 * 1) the battery charges from 0% to 100% and drains back to 0%,
4279 * 2) charging from 50% to 100% and draining back to 50% twice.
4280 * Pulled from:
4281 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4282 */
4283message BatteryCycleCount {
4284 /* Number of total charge and discharge cycles on the system battery. */
4285 optional int32 cycle_count = 1;
4286}
4287
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004288/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004289 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4290 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004291 * Pulled from:
4292 * StatsCompanionService
4293 */
4294
Carmen Agimof12dec122019-03-06 16:14:38 +00004295message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004296
Carmen Agimof12dec122019-03-06 16:14:38 +00004297 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004298 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004299 PUBLIC = 1;
4300 PRIVATE = 2;
4301 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004302 }
4303
Carmen Agimof12dec122019-03-06 16:14:38 +00004304 // The type of external storage.
4305 optional android.stats.storage.ExternalStorageType storage_type = 1;
4306 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4307 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004308 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004309 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004310}
4311
Yangster-macb89807e2018-11-15 21:10:57 -08004312/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004313 * Logs when a connection becomes available and lost.
4314 * Logged in StatsCompanionService.java
4315 */
4316message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004317 // Id of the network.
4318 optional int32 net_id = 1;
4319
4320 enum State {
4321 UNKNOWN = 0;
4322 CONNECTED = 1;
4323 DISCONNECTED = 2;
4324 }
4325 // Connected state of a network.
4326 optional State state = 2;
4327}
4328
4329/**
4330 * Logs when a service starts and stops.
4331 * Logged from:
4332 * services/core/java/com/android/server/am/ActiveServices.java
4333 */
4334message ServiceStateChanged {
4335
4336 optional int32 uid = 1 [(is_uid) = true];
4337
4338 optional string package_name = 2;
4339
4340 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004341
4342 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004343 START = 1;
4344 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004345 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004346
4347 optional State state = 4;
4348}
4349
4350/**
4351 * Logs when a service is launched.
4352 * Logged from:
4353 * services/core/java/com/android/server/am/ActiveServices.java
4354 */
4355message ServiceLaunchReported {
4356
4357 optional int32 uid = 1 [(is_uid) = true];
4358
4359 optional string package_name = 2;
4360
4361 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004362}
Howard Ro688ae182018-09-25 00:09:36 -07004363
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004364/**
4365 * Logs when a hidden API is used.
4366 *
4367 * Logged from:
4368 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4369 */
4370message HiddenApiUsed {
4371 // The uid of the app making the hidden access.
4372 optional int32 uid = 1 [(is_uid) = true];
4373
4374 // Signature of the method or field accessed.
4375 optional string signature = 2;
4376
4377 enum AccessMethod {
4378 NONE = 0;
4379 REFLECTION = 1;
4380 JNI = 2;
4381 LINKING = 3;
4382 }
4383
4384 // Type of access.
4385 optional AccessMethod access_method = 3;
4386
4387 // Whether the access was prevented or not.
4388 optional bool access_denied = 4;
4389}
4390
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004391/**
4392 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4393 * - When user sees privacy chip
4394 * - When user clicks privacy chip
4395 * - How does the user exit the Privacy Dialog
4396 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004397 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4398 */
4399message PrivacyIndicatorsInteracted {
4400
4401 enum Type {
4402 UNKNOWN = 0;
4403 CHIP_VIEWED = 1;
4404 CHIP_CLICKED = 2;
4405 DIALOG_PRIVACY_SETTINGS = 3;
4406 DIALOG_DISMISS = 4;
4407 DIALOG_LINE_ITEM = 5;
4408 }
4409
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004410 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004411
4412 // Used if the type is LINE_ITEM
4413 optional string package_name = 2;
4414}
4415
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004416/**
4417 * Logs information about a package that is moved from the internal to external storage and vice
4418 * versa.
4419 * It logs the package name, the type of the external storage where the package is installed
4420 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4421 * and the move type: if it's from internal to external or the other way around.
4422 *
4423 * Logged from:
4424 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4425 */
4426message AppMovedStorageReported {
4427 enum MoveType {
4428 UNKNOWN = 0;
4429 TO_EXTERNAL = 1;
4430 TO_INTERNAL = 2;
4431 }
4432 // The type of the external storage.
4433 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4434 // The type of move.
4435 optional MoveType move_type = 2;
4436 // The name of the package that was moved.
4437 optional string package_name = 3;
4438}
4439
jianjin8f2dee02019-03-29 14:03:08 -07004440/**
4441 * Logs when system server watchdog occurs.
4442 * Logged from:
4443 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4444 */
4445message SystemServerWatchdogOccurred {
4446 optional string subject = 1;
4447}
4448
4449/**
4450 * Logs when new file added to tombstones.
4451 * Logged from:
4452 * frameworks/base/core/java/com/android/server/BootReceiver.java
4453 */
4454message TombStoneOccurred {
4455}
4456
Hai Zhang5d3328d2019-04-13 21:25:06 +08004457/*
4458 * Information about a role request
4459 *
4460 * Logged from:
4461 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4462 */
4463message RoleRequestResultReported {
4464 // UID of application requesting the role
4465 optional int32 requesting_uid = 1;
4466
4467 // Package name of application requesting the role
4468 optional string requesting_package_name = 2;
4469
4470 // The role to be granted
4471 optional string role_name = 3;
4472
4473 // The count of applications qualifying for the role
4474 optional int32 qualifying_count = 4;
4475
4476 // UID of application current granted the role
4477 optional int32 current_uid = 5;
4478
4479 // Package name of application current granted the role
4480 optional string current_package_name = 6;
4481
4482 // UID of another application that user chose to grant the role to, instead of the requesting
4483 // application
4484 optional int32 granted_another_uid = 7;
4485
4486 // Package name of another application that user chose to grant the role to, instead of the
4487 // requesting application
4488 optional string granted_another_package_name = 8;
4489
4490 enum Result {
4491 UNDEFINED = 0;
4492 // role request was ignored
4493 IGNORED = 1;
4494 // role request was ignored because it's already granted
4495 IGNORED_ALREADY_GRANTED = 2;
4496 // role request was ignored because the application isn't qualified
4497 IGNORED_NOT_QUALIFIED = 3;
4498 // role request was ignored because user said it should be always denied
4499 IGNORED_USER_ALWAYS_DENIED = 4;
4500 // role was granted by user action
4501 USER_GRANTED = 5;
4502 // role was denied by user action
4503 USER_DENIED = 6;
4504 // role was denied by user granting another application the role
4505 USER_DENIED_GRANTED_ANOTHER = 7;
4506 // role was denied and set to be always denied by the user
4507 USER_DENIED_WITH_ALWAYS = 8;
4508 }
4509 // The result of the role request
4510 optional Result result = 9;
4511}
4512
Mark Tabrya824a642019-11-05 12:26:12 -08004513/**
4514 * Logs when a Vehicle Maps Service client's connection state has changed
4515 *
4516 * Logged from:
4517 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4518 */
4519message VmsClientConnectionStateChanged {
4520 // The UID of the VMS client app
4521 optional int32 uid = 1 [(is_uid) = true];
4522
4523 enum State {
4524 UNKNOWN = 0;
4525 // Attempting to connect to the client
4526 CONNECTING = 1;
4527 // Client connection established
4528 CONNECTED = 2;
4529 // Client connection closed unexpectedly
4530 DISCONNECTED = 3;
4531 // Client connection closed by VMS
4532 TERMINATED = 4;
4533 // Error establishing the client connection
4534 CONNECTION_ERROR = 5;
4535 }
4536
4537 optional State state = 2;
4538}
4539
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004540/**
4541 * Logs when MediaProvider has successfully finished scanning a storage volume.
4542 *
4543 * Logged from:
4544 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4545 */
shafik43825842020-04-02 17:30:24 +01004546message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004547 enum Reason {
4548 // Scan triggered due to unknown reason
4549 UNKNOWN = 0;
4550 // Scan triggered due to storage volume being mounted
4551 MOUNTED = 1;
4552 // Scan triggered due to explicit user action or app request
4553 DEMAND = 2;
4554 // Scan triggered due to idle maintenance
4555 IDLE = 3;
4556 }
4557
4558 // Volume type that this event pertains to
4559 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4560 // Reason why this scan was triggered
4561 optional Reason reason = 2;
4562 // Total number of files scanned
4563 optional int64 item_count = 3;
4564 // Duration of scan, normalized per file
4565 optional float normalized_duration_millis = 4;
4566 // Number of database inserts, normalized per file
4567 optional float normalized_insert_count = 5;
4568 // Number of database updates, normalized per file
4569 optional float normalized_update_count = 6;
4570 // Number of database deletes, normalized per file
4571 optional float normalized_delete_count = 7;
4572}
4573
4574/**
4575 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4576 *
4577 * Logged from:
4578 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4579 */
shafik43825842020-04-02 17:30:24 +01004580message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004581 // Volume type that this event pertains to
4582 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004583 // UID of app that requested deletion
4584 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004585 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004586 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004587}
4588
4589/**
4590 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4591 *
4592 * Logged from:
4593 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4594 */
shafik43825842020-04-02 17:30:24 +01004595message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004596 enum Result {
4597 UNKNOWN = 0;
4598 USER_GRANTED = 1;
4599 AUTO_GRANTED = 2;
4600 USER_DENIED = 3;
4601 USER_DENIED_WITH_PREJUDICE = 4;
4602 AUTO_DENIED = 5;
4603 }
4604
4605 // Volume type that this event pertains to
4606 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004607 // UID of app that requested permission
4608 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004609 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004610 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004611 // Result of this request
shafik43825842020-04-02 17:30:24 +01004612 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004613}
4614
4615/**
4616 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4617 *
4618 * Logged from:
4619 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4620 */
shafik43825842020-04-02 17:30:24 +01004621message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004622 // Volume type that this event pertains to
4623 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4624 // Old database version code
4625 optional int32 version_from = 2;
4626 // New database version code
4627 optional int32 version_to = 3;
4628 // Total number of files in database
4629 optional int64 item_count = 4;
4630 // Duration of schema change, normalized per file
4631 optional float normalized_duration_millis = 5;
4632}
4633
4634/**
4635 * Logs when MediaProvider has finished an idle maintenance job.
4636 *
4637 * Logged from:
4638 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4639 */
shafik43825842020-04-02 17:30:24 +01004640message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004641 // Volume type that this event pertains to
4642 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4643
4644 // Total number of files in database
4645 optional int64 item_count = 2;
4646 // Duration of idle maintenance, normalized per file
4647 optional float normalized_duration_millis = 3;
4648 // Number of thumbnails found to be stale, normalized per file
4649 optional float normalized_stale_thumbnails = 4;
4650 // Number of items found to be expired, normalized per file
4651 optional float normalized_expired_media = 5;
4652}
4653
Keun young Park3e033cb2019-12-18 11:27:35 -08004654/**
4655 * Represents boot time event with duration in ms.
4656 *
4657 * Logged from: bootstat and various system server components. Check each enums for details.
4658 */
4659message BootTimeEventDuration {
4660 enum DurationEvent {
4661 UNKNOWN = 0;
4662 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4663 ABSOLUTE_BOOT_TIME = 1;
4664 // Bootloader's 1st stage execution time.
4665 // Logged from bootstat.
4666 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4667 // Bootloader's 1st stage loading time.
4668 // Logged from bootstat.
4669 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4670 // Bootloader's kernel loading time.
4671 // Logged from bootstat.
4672 BOOTLOADER_KERNEL_LOAD = 4;
4673 // Bootloader's 2nd stage execution time.
4674 // Logged from bootstat.
4675 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4676 // Bootloader's 2nd stage loading time.
4677 // Logged from bootstat.
4678 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4679 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4680 // for locked device.
4681 // Logged from bootstat.
4682 BOOTLOADER_UI_WAIT = 7;
4683 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4684 // Logged from bootstat.
4685 BOOTLOADER_TOTAL = 8;
4686 // Shutdown duration inside init for the reboot before the current boot up.
4687 // Logged from f/b/services/.../BootReceiver.java.
4688 SHUTDOWN_DURATION = 9;
4689 // Total time for mounting of disk devices during bootup.
4690 // Logged from f/b/services/.../BootReceiver.java.
4691 MOUNT_DEFAULT_DURATION = 10;
4692 // Total time for early stage mounting of disk devices during bootup.
4693 // Logged from f/b/services/.../BootReceiver.java.
4694 MOUNT_EARLY_DURATION = 11;
4695 // Total time for late stage mounting of disk devices during bootup.
4696 // Logged from f/b/services/.../BootReceiver.java.
4697 MOUNT_LATE_DURATION = 12;
4698 // Average time to scan non-system app after OTA
4699 // Logged from f/b/services/.../PackageManagerService.java
4700 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4701 // Time to initialize Package manager after OTA
4702 // Logged from f/b/services/.../PackageManagerService.java
4703 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4704 // Time to scan all system app from Package manager after OTA
4705 // Logged from f/b/services/.../PackageManagerService.java
4706 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4707 // Init's total time for cold boot stage.
4708 // Logged from bootstat.
4709 COLDBOOT_WAIT = 16;
4710 // Init's total time for initializing selinux.
4711 // Logged from bootstat.
4712 SELINUX_INIT = 17;
4713 // Time since last factory reset.
4714 // Logged from bootstat.
4715 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004716 // Init's total time spent for completing the 1st stage.
4717 // Logged from bootstat.
4718 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004719 }
4720
4721 // Type of the event.
4722 optional DurationEvent event = 1;
4723 // Duration of the event in ms.
4724 optional int64 duration_millis = 2;
4725}
4726
4727/**
4728 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4729 * since boot-up.
4730 *
4731 * Logged from: bootstat and various system server components. Check each enums for details.
4732 */
4733message BootTimeEventElapsedTime {
4734 enum ElapsedTimeEvent {
4735 UNKNOWN = 0;
4736 // Time when init starts 1st stage. Logged from bootstat.
4737 ANDROID_INIT_STAGE_1 = 1;
4738 // Time when sys.boot_completed prop is set.
4739 // Logged from bootstat.
4740 BOOT_COMPLETE = 2;
4741 // BOOT_COMPLETE for encrypted device.
4742 BOOT_COMPLETE_ENCRYPTION = 3;
4743 // BOOT_COMPLETE for device with no encryption.
4744 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4745 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004746 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004747 // BOOT_COMPLETE after factory reset.
4748 FACTORY_RESET_BOOT_COMPLETE = 6;
4749 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4750 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004751 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4752 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004753 // BOOT_COMPLETE after OTA.
4754 OTA_BOOT_COMPLETE = 9;
4755 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4756 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004757 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4758 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004759 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4760 // Logged from f/b/services/.../UserController.java
4761 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4762 // Time when the system starts sending BOOT_COMPLETED broadcast.
4763 // Logged from f/b/services/.../UserController.java
4764 FRAMEWORK_BOOT_COMPLETED = 13;
4765 // Time when the package manager starts init.
4766 // Logged from f/b/services/.../SystemServer.java
4767 PACKAGE_MANAGER_INIT_START = 14;
4768 // Time when package manager is ready
4769 // Logged from f/b/services/.../SystemServer.java
4770 PACKAGE_MANAGER_INIT_READY = 15;
4771 // Represents the time when user has entered unlock credential for system with user pin.
4772 // Logged from bootstat.
4773 POST_DECRYPT = 16;
4774 // Represents the start of zygote's init.
4775 // Logged from zygote itself.
4776 ZYGOTE_INIT_START = 17;
4777 // Represents the start of secondary zygote's init.
4778 // TODO: add logging to zygote
4779 SECONDARY_ZYGOTE_INIT_START = 18;
4780 // Represents the start of system server's init.
4781 // Logged from f/b/services/.../SystemServer.java
4782 SYSTEM_SERVER_INIT_START = 19;
4783 // Represents the completion of system server's init.
4784 // Logged from f/b/services/.../SystemServer.java
4785 SYSTEM_SERVER_READY = 20;
4786 // Represents the start of launcher during boot-up.
4787 // TODO: add logging
4788 LAUNCHER_START = 21;
4789 // Represents the completion of launcher's initial rendering. User can use other apps from
4790 // launcher from this point.
4791 // TODO: add logging
4792 LAUNCHER_SHOWN = 22;
4793 }
4794
4795 // Type of the event.
4796 optional ElapsedTimeEvent event = 1;
4797 // Time since bootup for the event.
4798 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4799 optional int64 time_millis = 2;
4800}
4801
4802/**
4803 * Boot time events with UTC time.
4804 *
4805 * Logged from: bootstat and various system server components. Check each enums for details.
4806 */
4807message BootTimeEventUtcTime {
4808 enum UtcTimeEvent {
4809 UNKNOWN = 0;
4810 // Time of the bootstat's marking of 1st boot after the last factory reset.
4811 // Logged from bootstat.
4812 FACTORY_RESET_RESET_TIME = 1;
4813 // The time when bootstat records FACTORY_RESET_* events. This is close to
4814 // BOOT_COMPLETE time for the current bootup.
4815 // Logged from bootstat.
4816 FACTORY_RESET_CURRENT_TIME = 2;
4817 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4818 // Logged from bootstat.
4819 FACTORY_RESET_RECORD_VALUE = 3;
4820 }
4821
4822 // Type of the event.
4823 optional UtcTimeEvent event = 1;
4824 // UTC time for the event.
4825 optional int64 utc_time_secs = 2;
4826}
4827
4828/**
4829 * Boot time events representing specific error code during bootup.
4830 * Meaning of error code can be different per each event type.
4831 *
4832 * Logged from: bootstat and various system server components. Check each enums for details.
4833 */
4834message BootTimeEventErrorCode {
4835 enum ErrorCodeEvent {
4836 UNKNOWN = 0;
4837 // Linux error code for time() call to get the current UTC time.
4838 // Logged from bootstat.
4839 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4840 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4841 // as UMOUNT_STAT_* from init/reboot.cpp.
4842 // Logged from f/b/services/.../BootReceiver.java.
4843 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004844 // Reprepsents fie system mounting error code of /data partition for the current boot.
4845 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004846 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004847 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004848 }
4849
4850 // Type of the event.
4851 optional ErrorCodeEvent event = 1;
4852 // error code defined per each event type.
4853 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4854 // FS_MGR_FS_STAT.
4855 optional int32 error_code = 2;
4856}
4857
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004858/**
4859 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4860 * after an OTA.
4861 *
4862 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004863 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004864 */
4865message SnapshotMergeReported {
4866 // Keep in sync with
4867 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4868 enum UpdateState {
4869 // No update or merge is in progress.
4870 NONE = 0;
4871 // An update is applying; snapshots may already exist.
4872 INITIATED = 1;
4873 // An update is pending, but has not been successfully booted yet.
4874 UNVERIFIED = 2;
4875 // The kernel is merging in the background.
4876 MERGING = 3;
4877 // Post-merge cleanup steps could not be completed due to a transient
4878 // error, but the next reboot will finish any pending operations.
4879 MERGE_NEEDS_REBOOT = 4;
4880 // Merging is complete, and needs to be acknowledged.
4881 MERGE_COMPLETED = 5;
4882 // Merging failed due to an unrecoverable error.
4883 MERGE_FAILED = 6;
4884 // The update was implicitly cancelled, either by a rollback or a flash
4885 // operation via fastboot. This state can only be returned by WaitForMerge.
4886 CANCELLED = 7;
4887 };
4888
4889 // Status of the update after the merge attempts.
4890 optional UpdateState final_state = 1;
4891
4892 // Time to complete a merge operation in milliseconds.
4893 // A negative value corresponds to the case in which the merge operation
4894 // was interrupted and resumed (e.g. in case of a system reboot during the
4895 // merge).
4896 optional int64 duration_millis = 2;
4897
4898 // Number of reboots that occurred after issuing and before completing the
4899 // merge of all the snapshot devices.
4900 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004901
4902 // The device has been upgraded to Virtual A/B.
4903 optional bool is_vab_retrofit = 4;
4904
4905 // Space that has been temporarily allocated in the /data partition
4906 // containing the dm-snapshot's copy-on-write data generated during a
4907 // Virtual A/B update.
4908 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004909}
4910
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -07004911/**
4912 * Event representing when BlobStoreManager.Session#commit() is called
4913 *
4914 * Logged from:
4915 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4916 */
4917message BlobCommitted {
4918 // Uid of the Blob committer
4919 optional int32 uid = 1 [(is_uid) = true];
4920
4921 // Id of the Blob committed
4922 optional int64 blob_id = 2;
4923
4924 // Size of the Blob
4925 optional int64 size = 3;
4926
4927 enum Result {
4928 UNKNOWN = 0;
4929 // Commit Succeeded
4930 SUCCESS = 1;
4931 // Commit Failed: Error occurred during commit
4932 ERROR_DURING_COMMIT = 2;
4933 // Commit Failed: Digest of the data did not match Blob digest
4934 DIGEST_MISMATCH = 3;
4935 }
4936 optional Result result = 4;
4937}
4938
4939/**
4940 * Event representing when BlobStoreManager#acquireLease() is called
4941 *
4942 * Logged from:
4943 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4944 */
4945message BlobLeased{
4946 // Uid of the Blob leasee
4947 optional int32 uid = 1 [(is_uid) = true];
4948
4949 // Id of the Blob leased or 0 if the Blob does not exist
4950 optional int64 blob_id = 2;
4951
4952 // Size of the Blob or 0 if the Blob does not exist
4953 optional int64 size = 3;
4954
4955 enum Result {
4956 UNKNOWN = 0;
4957 // Lease Succeeded
4958 SUCCESS = 1;
4959 // Lease Failed: Blob does not exist
4960 BLOB_DNE = 2;
4961 // Lease Failed: Leasee does not have access to the Blob
4962 ACCESS_NOT_ALLOWED = 3;
4963 // Lease Failed: Leasee requested an invalid expiry duration
4964 LEASE_EXPIRY_INVALID = 4;
4965 // Lease Failed: Leasee has exceeded the total data lease limit
4966 DATA_SIZE_LIMIT_EXCEEDED = 5;
4967 }
4968 optional Result result = 4;
4969}
4970
4971/**
4972 * Event representing when BlobStoreManager#openBlob() is called
4973 *
4974 * Logged from:
4975 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4976 */
4977message BlobOpened{
4978 // Uid of the Blob opener
4979 optional int32 uid = 1 [(is_uid) = true];
4980
4981 // Id of the Blob opened or 0 if the Blob does not exist
4982 optional int64 blob_id = 2;
4983
4984 // Size of the Blob or 0 if the Blob does not exist
4985 optional int64 size = 3;
4986
4987 enum Result {
4988 UNKNOWN = 0;
4989 // Open Succeeded
4990 SUCCESS = 1;
4991 // Open Failed: Blob does not exist
4992 BLOB_DNE = 2;
4993 // Open Failed: Opener does not have access to the Blob
4994 ACCESS_NOT_ALLOWED = 3;
4995 }
4996 optional Result result = 4;
4997}
4998
Chenjie Yubbcbc602018-02-05 16:51:52 -08004999//////////////////////////////////////////////////////////////////////
5000// Pulled atoms below this line //
5001//////////////////////////////////////////////////////////////////////
5002
5003/**
David Chenc8a43242017-10-17 16:23:28 -07005004 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
5005 *
5006 * Pulled from:
5007 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
5008 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005009message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005010 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005011
5012 optional int64 rx_bytes = 2;
5013
5014 optional int64 rx_packets = 3;
5015
5016 optional int64 tx_bytes = 4;
5017
5018 optional int64 tx_packets = 5;
5019}
5020
5021/**
5022 * Pulls bytes transferred via wifi (separated by foreground and background usage).
5023 *
5024 * Pulled from:
5025 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
5026 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005027message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005028 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005029
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005030 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
5031 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005032
5033 optional int64 rx_bytes = 3;
5034
5035 optional int64 rx_packets = 4;
5036
5037 optional int64 tx_bytes = 5;
5038
5039 optional int64 tx_packets = 6;
5040}
5041
5042/**
5043 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
5044 *
5045 * Pulled from:
5046 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
5047 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005048message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005049 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005050
5051 optional int64 rx_bytes = 2;
5052
5053 optional int64 rx_packets = 3;
5054
5055 optional int64 tx_bytes = 4;
5056
5057 optional int64 tx_packets = 5;
5058}
5059
5060/**
5061 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
5062 *
5063 * Pulled from:
5064 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
5065 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005066message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005067 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005068
Yao Chenc40a19d2018-03-15 16:48:25 -07005069 // 1 denotes foreground and 0 denotes background. This is called Set in
5070 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005071 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005072
5073 optional int64 rx_bytes = 3;
5074
5075 optional int64 rx_packets = 4;
5076
5077 optional int64 tx_bytes = 5;
5078
5079 optional int64 tx_packets = 6;
5080}
5081
5082/**
junyulai8d1a6092020-05-07 13:38:15 +08005083 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08005084 * Note that the data is expected to be sliced into more dimensions in future. In other words,
5085 * the caller must not assume any row of data is one full report when filtering with a set of
5086 * matching conditions, because future data may represent with multiple rows what is currently
5087 * represented by one.
5088 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
5089 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08005090 *
5091 * Pulled from:
5092 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
5093 */
5094message DataUsageBytesTransfer {
5095 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
5096 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
5097 // states combined, not including debug states. See NetworkStats#SET_*.
5098 optional int32 state = 1;
5099
5100 optional int64 rx_bytes = 2;
5101
5102 optional int64 rx_packets = 3;
5103
5104 optional int64 tx_bytes = 4;
5105
5106 optional int64 tx_packets = 5;
5107
5108 // Radio Access Technology (RAT) type of this record, should be one of
5109 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5110 // the record is for all rat types combined.
5111 optional int32 rat_type = 6;
5112
5113 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005114 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005115 optional string sim_mcc = 7;
5116 optional string sim_mnc = 8;
5117
junyulai8b794b72020-05-19 17:36:13 +08005118 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5119 // See TelephonyManager#getSimCarrierId.
5120 optional int32 carrier_id = 9;
5121
junyulai8d1a6092020-05-07 13:38:15 +08005122 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5123 // combined regardless of the boolean value in its field.
5124 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005125 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005126 ALL = 1;
5127 OPPORTUNISTIC = 2;
5128 NOT_OPPORTUNISTIC = 3;
5129 }
5130 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005131 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005132 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005133 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005134}
5135
5136/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005137 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5138 *
5139 * Pulled from:
5140 * StatsCompanionService
5141 */
5142message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005143 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005144
5145 optional int64 rx_bytes = 2;
5146
5147 optional int64 tx_bytes = 3;
5148}
5149
5150/**
David Chenc8a43242017-10-17 16:23:28 -07005151 * Pulls the kernel wakelock durations. This atom is adapted from
5152 * android/internal/os/KernelWakelockStats.java
5153 *
5154 * Pulled from:
5155 * StatsCompanionService using KernelWakelockReader.
5156 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005157message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005158 optional string name = 1;
5159
5160 optional int32 count = 2;
5161
5162 optional int32 version = 3;
5163
Yangster-maca8a30442018-10-13 23:46:34 -07005164 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005165}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005166
Chenjie Yu05013b32017-11-21 10:21:41 -08005167/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005168 * Pulls low power state information. If power.stats HAL is not available, this
5169 * includes platform and subsystem sleep state information,
5170 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5171 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005172 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005173 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005174 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5175 * as defined in:
5176 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005177 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005178message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005179 // Subsystem name
5180 optional string subsystem_name = 1;
5181 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5182 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005183 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5184 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005185 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005186 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005187 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005188 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005189 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005190}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005191
Chenjie Yu05013b32017-11-21 10:21:41 -08005192/**
Bookatz92da2832018-11-01 18:10:03 -07005193 * Pulls on-device power measurement information.
5194 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5195 * Pulled from:
5196 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5197 */
5198message OnDevicePowerMeasurement {
5199 // Name of the subsystem (to which the rail belongs).
5200 optional string subsystem_name = 1;
5201
5202 // Rail name. The rail lies within the subsystem.
5203 optional string rail_name = 2;
5204
5205 // Time (in ms since boot) at which the rail energy value was measured.
5206 // This may differ slightly from the time that statsd logs this information.
5207 optional uint64 measurement_timestamp_millis = 3;
5208
5209 // Accumulated energy used via the rail since device boot in uWs.
5210 optional uint64 energy_microwatt_secs = 4;
5211}
5212
5213/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005214 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005215 * Pulls the time the cpu spend on the frequency index. Frequency index
5216 * starts from highest to lowest. The value should be monotonically
5217 * increasing since boot. However, if there is a cpu
5218 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005219 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005220message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005221 optional uint32 cluster = 1;
5222 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005223 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005224}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005225
Chenjie Yu05013b32017-11-21 10:21:41 -08005226/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005227 * Pulls Cpu Time Per Uid.
5228 * Note that isolated process uid time should be attributed to host uids.
5229 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005230message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005231 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005232 optional uint64 user_time_micros = 2;
5233 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005234}
5235
5236/**
5237 * Pulls Cpu Time Per Uid per frequency.
5238 * Note that isolated process uid time should be attributed to host uids.
5239 * For each uid, we order the time by descending frequencies.
5240 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005241message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005242 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005243 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005244 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005245}
Hugo Benichi884970e2017-11-14 22:42:46 +09005246
Chenjie Yu05013b32017-11-21 10:21:41 -08005247/**
5248 * Pulls Wifi Controller Activity Energy Info
5249 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005250message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005251 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005252 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005253 // stack reported state
5254 // TODO: replace this with proto enum
5255 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005256 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005257 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005258 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005259 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005260 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005261 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005262 // product of current(mA), voltage(V) and time(ms)
5263 optional uint64 controller_energy_used = 6;
5264}
5265
5266/**
5267 * Pulls Modem Activity Energy Info
5268 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005269message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005270 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005271 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005272 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005273 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005274 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005275 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005276 /**
5277 * Tx power index
5278 * index 0 = tx_power < 0dBm
5279 * index 1 = 0dBm < tx_power < 5dBm
5280 * index 2 = 5dBm < tx_power < 15dBm
5281 * index 3 = 15dBm < tx_power < 20dBm
5282 * index 4 = tx_power > 20dBm
5283 */
5284 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005285 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005286 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005287 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005288 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005289 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005290 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005291 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005292 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005293 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005294 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005295 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005296 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005297 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005298}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005299
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005300/**
5301 * Pulls Bluetooth Activity Energy Info
5302 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5303 */
5304message BluetoothActivityInfo {
5305 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005306 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005307 // bluetooth stack state
5308 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005309 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005310 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005311 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005312 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005313 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005314 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005315 // product of current(mA), voltage(V) and time(ms)
5316 optional uint64 energy_used = 6;
5317}
5318
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005319/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005320 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005321 *
5322 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005323 */
5324message ProcessMemoryState {
5325 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005326 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005327
5328 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005329 // Usually package name, "system" for system server.
5330 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005331 optional string process_name = 2;
5332
Rafal Slawikda51b932018-12-13 16:31:33 +00005333 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005334 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005335
5336 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005337 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005338
5339 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005340 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005341
Rajeev Kumar90235992018-01-29 11:06:48 -08005342 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005343 // Value is read from memory.stat, field total_rss if per-app memory
5344 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005345 optional int64 rss_in_bytes = 6;
5346
5347 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005348 // Value is read from memory.stat, field total_cache if per-app memory
5349 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005350 optional int64 cache_in_bytes = 7;
5351
5352 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005353 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005354 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005355 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005356
Rafal Slawik203c3db2019-09-25 19:53:01 +01005357 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005358 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005359
Rafal Slawik203c3db2019-09-25 19:53:01 +01005360 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5361 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005362
Rafal Slawik203c3db2019-09-25 19:53:01 +01005363 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5364 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005365}
5366
5367/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005368 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005369 *
5370 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5371 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005372 *
5373 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005374 */
5375message ProcessMemoryHighWaterMark {
5376 // The uid if available. -1 means not available.
5377 optional int32 uid = 1 [(is_uid) = true];
5378
Rafal Slawikda51b932018-12-13 16:31:33 +00005379 // The process name.
5380 // Usually package name or process cmdline.
5381 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005382 optional string process_name = 2;
5383
Rafal Slawik239b6802019-09-09 18:46:01 +01005384 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5385 // computed by converting kilobytes to bytes.
5386 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5387
Rafal Slawik3bea8952018-11-15 12:39:33 +00005388 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5389 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005390 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005391}
5392
5393/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005394 * Logs the memory stats for a process.
5395 *
5396 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5397 * and for selected native processes.
5398 */
5399message ProcessMemorySnapshot {
5400 // The uid if available. -1 means not available.
5401 optional int32 uid = 1 [(is_uid) = true];
5402
5403 // The process name.
5404 // Usually package name or process cmdline.
5405 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5406 optional string process_name = 2;
5407
5408 // The pid of the process.
5409 // Allows to disambiguate instances of the process.
5410 optional int32 pid = 3;
5411
5412 // The current OOM score adjustment value.
5413 // Read from ProcessRecord for managed processes.
5414 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5415 optional int32 oom_score_adj = 4;
5416
5417 // The current RSS of the process.
5418 // VmRSS from /proc/pid/status.
5419 optional int32 rss_in_kilobytes = 5;
5420
5421 // The current anon RSS of the process.
5422 // RssAnon from /proc/pid/status.
5423 optional int32 anon_rss_in_kilobytes = 6;
5424
5425 // The current swap size of the process.
5426 // VmSwap from /proc/pid/status.
5427 optional int32 swap_in_kilobytes = 7;
5428
5429 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5430 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5431}
5432
5433/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005434 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005435 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005436message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005437 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005438}
5439
5440/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005441 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005442 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005443message SystemUptime {
5444 // Milliseconds since the system was booted.
5445 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5446 // for external input).
5447 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005448 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005449}
5450
5451/*
5452 * Reads from /proc/uid_concurrent_active_time which has the format:
5453 * active: X (X is # cores)
5454 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5455 * [uid1]: [time-0] [time-1] [time-2] ... ...
5456 * ...
5457 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5458 * The file contains a monotonically increasing count of time for a single boot.
5459 */
5460message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005461 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005462 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005463}
5464
5465/**
5466 * Reads from /proc/uid_concurrent_policy_time which has the format:
5467 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5468 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5469 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5470 * ...
5471 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5472 * The file contains a monotonically increasing count of time for a single boot.
5473 */
5474message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005475 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005476 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005477 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005478}
5479
5480/*
5481 * Pulls free disk space, for data, system partition and temporary directory.
5482 */
5483message DiskSpace {
5484 // available bytes in data partition
5485 optional uint64 data_available_bytes = 1;
5486 // available bytes in system partition
5487 optional uint64 system_available_bytes = 2;
5488 // available bytes in download cache or temp directories
5489 optional uint64 temp_available_bytes = 3;
5490}
Tej Singhbf972d92018-01-10 20:51:13 -08005491
5492/**
5493 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005494 *
5495 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005496 */
5497message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005498 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005499}
5500
5501/**
5502 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005503 * Pulled from:
5504 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005505 */
5506message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005507 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005508}
5509
5510/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005511 * Pulls battery voltage.
5512 * Pulled from:
5513 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5514 */
5515message BatteryVoltage {
5516 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005517 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005518}
5519
5520/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005521 * Pulls battery level (percent full, from 0 to 100).
5522 *
5523 * Pulled from:
5524 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5525 */
5526message BatteryLevel {
5527 // Battery level. Should be in [0, 100].
5528 optional int32 battery_level = 1;
5529}
5530
5531/**
Tej Singhd89137e2018-03-26 14:51:40 -07005532 * Pulls the temperature of various parts of the device.
5533 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005534 *
Maggie White442b6312019-04-05 16:26:44 -07005535 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005536 */
5537message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005538 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005539 optional android.os.TemperatureTypeEnum sensor_location = 1;
5540
5541 // The name of the temperature source. Eg. CPU0
5542 optional string sensor_name = 2;
5543
Tej Singhd89137e2018-03-26 14:51:40 -07005544 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005545 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005546 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005547
5548 // Relative severity of the throttling, see enum definition.
5549 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005550}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005551
5552/**
5553 * Pulls the statistics of calls to Binder.
5554 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005555 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5556 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005557 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005558 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005559 */
5560message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005561 // UID of the process responsible for the binder transaction. It will be set if the process
5562 // executing the binder transaction attribute the transaction to another uid using
5563 // Binder.setThreadWorkSource().
5564 //
5565 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005566 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005567 // UID of the process executing the binder transaction.
5568 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005569 // Fully qualified class name of the API call.
5570 //
5571 // This is a system server class name.
5572 //
5573 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5574 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5575 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5576 // commonly used APIs.
5577 optional string service_class_name = 2;
5578 // Method name of the API call. It can also be a transaction code if we cannot
5579 // resolve it to a name. See Binder#getTransactionName.
5580 //
5581 // This is a system server method name.
5582 optional string service_method_name = 3;
5583 // Total number of API calls.
5584 optional int64 call_count = 4;
5585 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5586 optional bool screen_interactive = 13;
5587 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5588 // call_count will be equal to recorded_call_count.
5589 //
5590 // If recorded_call_count is different than call_count, it means data collection has been
5591 // sampled. All the fields below will be sampled in this case.
5592 optional int64 recorded_call_count = 12;
5593 // Number of exceptions thrown by the API.
5594 optional int64 recorded_exception_count = 5;
5595 // Total latency of all API calls.
5596 // Average can be computed using total_latency_micros / recorded_call_count.
5597 optional int64 recorded_total_latency_micros = 6;
5598 // Maximum latency of one API call.
5599 optional int64 recorded_max_latency_micros = 7;
5600 // Total CPU usage of all API calls.
5601 // Average can be computed using total_cpu_micros / recorded_call_count.
5602 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5603 optional int64 recorded_total_cpu_micros = 8;
5604 // Maximum CPU usage of one API call.
5605 optional int64 recorded_max_cpu_micros = 9;
5606 // Maximum parcel reply size of one API call.
5607 optional int64 recorded_max_reply_size_bytes = 10;
5608 // Maximum parcel request size of one API call.
5609 optional int64 recorded_max_request_size_bytes = 11;
5610}
5611
5612/**
5613 * Pulls the statistics of exceptions during calls to Binder.
5614 *
5615 * Binder stats are cumulative from boot unless somebody reset the data using
5616 * > adb shell dumpsys binder_calls_stats --reset
5617 */
5618message BinderCallsExceptions {
5619 // Exception class name, e.g. java.lang.IllegalArgumentException.
5620 //
5621 // This is an exception class name thrown by the system server.
5622 optional string exception_class_name = 1;
5623 // Total number of exceptions.
5624 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005625}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005626
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005627/**
5628 * Pulls the statistics of message dispatching on HandlerThreads.
5629 *
5630 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5631 * config on the device.
5632 *
5633 * Next tag: 11
5634 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005635message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005636 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005637 optional int32 uid = 1 [(is_uid) = true];
5638
5639 // Fully qualified class name of the handler target class.
5640 //
5641 // This field does not contain PII. This is a system server class name.
5642 optional string handler_class_name = 2;
5643
5644 // The name of the thread that runs the Looper.
5645 //
5646 // This field does not contain PII. This is a system server thread name.
5647 optional string looper_thread_name = 3;
5648
5649 // The name of the dispatched message.
5650 //
5651 // This field does not contain PII. This is a system server constant or class
5652 // name.
5653 optional string message_name = 4;
5654
5655 // Total number of successfully dispatched messages.
5656 optional int64 message_count = 5;
5657
5658 // Total number of messages that failed dispatching.
5659 optional int64 exception_count = 6;
5660
5661 // Total number of processed messages we have data recorded for. If we
5662 // collected data for all the messages, message_count will be equal to
5663 // recorded_message_count.
5664 //
5665 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005666 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005667 optional int64 recorded_message_count = 7;
5668
5669 // Total latency of all processed messages.
5670 // Average can be computed using recorded_total_latency_micros /
5671 // recorded_message_count.
5672 optional int64 recorded_total_latency_micros = 8;
5673
5674 // Total CPU usage of all processed message.
5675 // Average can be computed using recorded_total_cpu_micros /
5676 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005677 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005678 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005679
5680 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5681 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005682
5683 // Max recorded CPU usage of all processed messages.
5684 optional int64 recorded_max_cpu_micros = 11;
5685
5686 // Max recorded latency of all processed messages.
5687 optional int64 recorded_max_latency_micros = 12;
5688
5689 // Total number of messages we tracked the dispatching delay for. If we
5690 // collected data for all the messages, message_count will be equal to
5691 // recorded_delay_message_count.
5692 //
5693 // If recorded_delay_message_count is different than message_count, it means data
5694 // collection has been sampled or/and not all messages specified the target dispatch time.
5695 // The fields below will be sampled in this case.
5696 optional int64 recorded_delay_message_count = 13;
5697
5698 // Total dispatching delay of all processed messages.
5699 // Calculated as a difference between the target dispatching time (Message.when)
5700 // and the actual dispatching time.
5701 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5702 optional int64 recorded_total_delay_millis = 14;
5703
5704 // Max dispatching delay of all processed messages.
5705 // Calculated as a difference between the target dispatching time (Message.when)
5706 // and the actual dispatching time.
5707 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005708}
Tej Singh86dc9db2018-09-06 00:39:57 +00005709
5710/**
5711 * Pulls disk information, such as write speed and latency.
5712 */
5713message DiskStats {
5714 // Time taken to open, write 512B to, and close a file.
5715 // -1 if error performing the check.
5716 optional int64 data_write_latency_millis = 1;
5717
5718 optional bool file_based_encryption = 2;
5719
5720 // Recent disk write speed in kB/s.
5721 // -1 if error querying storageed.
5722 // 0 if data is unavailable.
5723 optional int32 recent_disk_write_speed = 3;
5724}
5725
5726
5727/**
5728 * Free and total bytes of the Data, Cache, and System partition.
5729 */
5730message DirectoryUsage {
5731 enum Directory {
5732 UNKNOWN = 0;
5733 DATA = 1;
5734 CACHE = 2;
5735 SYSTEM = 3;
5736 }
5737 optional Directory directory = 1;
5738 optional int64 free_bytes = 2;
5739 optional int64 total_bytes = 3;
5740}
5741
5742
5743/**
5744 * Size of an application: apk size, data size, and cache size.
5745 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5746 * Information is only reported for apps with the primary user (user 0).
5747 * Sizes are aggregated by package name.
5748 */
5749message AppSize {
5750 // Including uids will involve modifying diskstats logic.
5751 optional string package_name = 1;
5752 // App size in bytes. -1 if unavailable.
5753 optional int64 app_size_bytes = 2;
5754 // App data size in bytes. -1 if unavailable.
5755 optional int64 app_data_size_bytes = 3;
5756 // App cache size in bytes. -1 if unavailable.
5757 optional int64 app_cache_size_bytes = 4;
5758 // Time that the cache file was produced.
5759 // Uses System.currentTimeMillis(), which is wall clock time.
5760 optional int64 cache_time_millis = 5;
5761}
5762
5763
5764/**
5765 * Size of a particular category. Eg: photos, videos.
5766 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5767 */
5768message CategorySize {
5769 enum Category {
5770 UNKNOWN = 0;
5771 APP_SIZE = 1;
5772 APP_DATA_SIZE = 2;
5773 APP_CACHE_SIZE = 3;
5774 PHOTOS = 4;
5775 VIDEOS = 5;
5776 AUDIO = 6;
5777 DOWNLOADS = 7;
5778 SYSTEM = 8;
5779 OTHER = 9;
5780 }
5781 optional Category category = 1;
5782 // Category size in bytes.
5783 optional int64 size_bytes = 2;
5784 // Time that the cache file was produced.
5785 // Uses System.currentTimeMillis(), which is wall clock time.
5786 optional int64 cache_time_millis = 3;
5787}
Tej Singhd6d6d772018-09-05 17:41:25 -07005788
5789/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005790 * Pulls per uid I/O stats. The stats are cumulative since boot.
5791 *
5792 * Read/write bytes are I/O events from a storage device
5793 * Read/write chars are data requested by read/write syscalls, and can be
5794 * satisfied by caching.
5795 *
5796 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5797 */
5798message DiskIo {
5799 optional int32 uid = 1 [(is_uid) = true];
5800 optional int64 fg_chars_read = 2;
5801 optional int64 fg_chars_write = 3;
5802 optional int64 fg_bytes_read = 4;
5803 optional int64 fg_bytes_write = 5;
5804 optional int64 bg_chars_read = 6;
5805 optional int64 bg_chars_write = 7;
5806 optional int64 bg_bytes_read = 8;
5807 optional int64 bg_bytes_write = 9;
5808 optional int64 fg_fsync = 10;
5809 optional int64 bg_fsync= 11;
5810}
5811
5812
5813/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005814 * Pulls the number of fingerprints for each user.
5815 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005816 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005817 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005818message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005819 // The associated user. Eg: 0 for owners, 10+ for others.
5820 // Defined in android/os/UserHandle.java
5821 optional int32 user = 1;
5822 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005823 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005824}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005825
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005826/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005827 * Pulls the number of faces for each user.
5828 *
5829 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5830 */
5831message NumFacesEnrolled {
5832 // The associated user. Eg: 0 for owners, 10+ for others.
5833 // Defined in android/os/UserHandle.java
5834 optional int32 user = 1;
5835 // Number of faces registered to that user.
5836 optional int32 num_faces_enrolled = 2;
5837}
5838/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005839 * A mapping of role holder -> role
5840 */
5841message RoleHolder {
5842 // uid of the role holder
5843 optional int32 uid = 1 [(is_uid) = true];
5844
5845 // package name of the role holder
5846 optional string package_name = 2;
5847
5848 // the role held
5849 optional string role = 3;
5850}
5851
Yangsteraf9aee72018-10-12 09:26:16 -07005852message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005853 // These are all in byte resolution.
5854 optional int64 min = 1 [deprecated = true];
5855 optional int64 average = 2 [deprecated = true];
5856 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005857
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005858 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5859 // int64 fields.
5860 optional int32 mean_kb = 4;
5861 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005862}
5863
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005864// A reduced subset of process states; reducing the number of possible states allows more
5865// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5866enum ProcessStateAggregated {
5867 PROCESS_STATE_UNKNOWN = 0;
5868 // Persistent system process.
5869 PROCESS_STATE_PERSISTENT = 1;
5870 // Top activity; actually any visible activity.
5871 PROCESS_STATE_TOP = 2;
5872 // Process binding to top or a foreground service.
5873 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5874 // Processing running a foreground service.
5875 PROCESS_STATE_FGS = 4;
5876 // Important foreground process (ime, wallpaper, etc).
5877 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5878 // Important background process.
5879 PROCESS_STATE_BACKGROUND = 6;
5880 // Process running a receiver.
5881 PROCESS_STATE_RECEIVER = 7;
5882 // All kinds of cached processes.
5883 PROCESS_STATE_CACHED = 8;
5884}
5885
5886// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005887message ProcessStatsStateProto {
5888 optional android.service.procstats.ScreenState screen_state = 1;
5889
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005890 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005891
5892 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5893 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005894 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5895
5896 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005897
5898 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005899 optional int64 duration_millis = 4 [deprecated = true];
5900 // Same as above, but with minute resolution so it fits into an int32.
5901 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005902
5903 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005904 optional int64 realtime_duration_millis = 9 [deprecated = true];
5905 // Same as above, but with minute resolution so it fits into an int32.
5906 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005907
5908 // # of samples taken
5909 optional int32 sample_size = 5;
5910
5911 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005912 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005913
5914 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005915 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005916
5917 // RSS is memory resident for this process
5918 optional AggStats rss = 8;
5919}
5920
Jing Ji060d6862020-04-13 19:36:31 -07005921// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005922message ProcessStatsProto {
5923 // Name of process.
5924 optional string process = 1;
5925
5926 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005927 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005928
5929 // Information about how often kills occurred
5930 message Kill {
5931 // Count of excessive CPU kills
5932 optional int32 cpu = 1;
5933
5934 // Count of kills when cached
5935 optional int32 cached = 2;
5936
5937 // PSS stats during cached kill
5938 optional AggStats cached_pss = 3;
5939 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005940 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005941
5942 // Time and memory spent in various states.
5943 repeated ProcessStatsStateProto states = 5;
5944
5945 // Total time process has been running... screen_state, memory_state, and process_state
5946 // will not be set.
5947 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005948
5949 // Association data for this process in this state;
5950 // each entry here is one association.
5951 repeated ProcessStatsAssociationProto assocs = 7;
5952}
5953
Jing Ji1cd1f602020-06-03 13:45:36 -07005954// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005955message ProcessStatsAssociationProto {
5956 // Procss Name of the associated process (client process of service binding)
5957 optional string assoc_process_name = 1;
5958
5959 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005960 optional string assoc_package_name = 2 [deprecated = true];
5961
5962 // UID of the associated process/package (client package of service binding)
5963 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005964
5965 // Total count of the times this association (service binding) appeared.
5966 optional int32 total_count = 3;
5967
5968 // Uptime total duration in seconds this association (service binding) was around.
5969 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005970}
5971
5972message PackageServiceOperationStatsProto {
5973 // Operate enum: Started, Foreground, Bound, Executing
5974 optional android.service.procstats.ServiceOperationState operation = 1;
5975
5976 // Number of times the service was in this operation.
5977 optional int32 count = 2;
5978
5979 // Information about a state the service can be in.
5980 message StateStats {
5981 // Screen state enum.
5982 optional android.service.procstats.ScreenState screen_state = 1;
5983 // Memory state enum.
5984 optional android.service.procstats.MemoryState memory_state = 2;
5985
5986 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005987 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005988 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005989 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005990 }
5991 repeated StateStats state_stats = 3;
5992}
5993
5994message PackageServiceStatsProto {
5995 // Name of service component.
5996 optional string service_name = 1;
5997
5998 // The operation stats.
5999 // The package_name, package_uid, package_version, service_name will not be set to save space.
6000 repeated PackageServiceOperationStatsProto operation_stats = 2;
6001}
6002
6003message PackageAssociationSourceProcessStatsProto {
6004 // Uid of the process.
6005 optional int32 process_uid = 1;
6006 // Process name.
6007 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08006008 // Package name.
6009 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07006010 // Total count of the times this association appeared.
6011 optional int32 total_count = 3;
6012
6013 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07006014 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006015
6016 // Total count of the times this association became actively impacting its target process.
6017 optional int32 active_count = 5;
6018
6019 // Information on one source in this association.
6020 message StateStats {
6021 // Process state enum.
6022 optional android.service.procstats.ProcessState process_state = 1;
6023 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006024 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006025 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006026 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006027 }
6028 repeated StateStats active_state_stats = 6;
6029}
6030
6031message PackageAssociationProcessStatsProto {
6032 // Name of the target component.
6033 optional string component_name = 1;
6034 // Information on one source in this association.
6035 repeated PackageAssociationSourceProcessStatsProto sources = 2;
6036}
6037
6038
6039message ProcessStatsPackageProto {
6040 // Name of package.
6041 optional string package = 1;
6042
6043 // Uid of the package.
6044 optional int32 uid = 2;
6045
6046 // Version of the package.
6047 optional int64 version = 3;
6048
6049 // Stats for each process running with the package loaded in to it.
6050 repeated ProcessStatsProto process_stats = 4;
6051
6052 // Stats for each of the package's services.
6053 repeated PackageServiceStatsProto service_stats = 5;
6054
6055 // Stats for each association with the package.
6056 repeated PackageAssociationProcessStatsProto association_stats = 6;
6057}
6058
6059message ProcessStatsSectionProto {
6060 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006061 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07006062
6063 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006064 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006065
6066 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006067 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006068
6069 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006070 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006071
6072 // System runtime library. e.g. "libdvm.so", "libart.so".
6073 optional string runtime = 5;
6074
6075 // whether kernel reports swapped pss.
6076 optional bool has_swapped_pss = 6;
6077
6078 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
6079 enum Status {
6080 STATUS_UNKNOWN = 0;
6081 STATUS_COMPLETE = 1;
6082 STATUS_PARTIAL = 2;
6083 STATUS_SHUTDOWN = 3;
6084 STATUS_SYSPROPS = 4;
6085 }
6086 repeated Status status = 7;
6087
Chenjie Yub2ecc792019-01-17 10:27:26 -08006088 // Number of pages available of various types and sizes, representation fragmentation.
6089 repeated ProcessStatsAvailablePagesProto available_pages = 10;
6090
Yangsteraf9aee72018-10-12 09:26:16 -07006091 // Stats for each process.
6092 repeated ProcessStatsProto process_stats = 8;
6093
6094 // Stats for each package.
6095 repeated ProcessStatsPackageProto package_stats = 9;
6096}
6097
Chenjie Yub2ecc792019-01-17 10:27:26 -08006098message ProcessStatsAvailablePagesProto {
6099 // Node these pages are in (as per /proc/pagetypeinfo)
6100 optional int32 node = 1;
6101
6102 // Zone these pages are in (as per /proc/pagetypeinfo)
6103 optional string zone = 2;
6104
6105 // Label for the type of these pages (as per /proc/pagetypeinfo)
6106 optional string label = 3;
6107
6108 // Distribution of number of pages available by order size. First entry in array is
6109 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6110 repeated int32 pages_per_order = 4;
6111}
6112
Chenjie Yu12e5e672018-09-14 15:54:59 -07006113/**
6114 * Pulled from ProcessStatsService.java
6115 */
6116message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006117 optional ProcessStatsSectionProto proc_stats_section = 1;
6118}
6119
Chenjie Yuf910b7802019-01-11 16:08:20 -08006120/**
6121 * Pulled from ProcessStatsService.java
6122 */
6123message ProcStatsPkgProc {
6124 optional ProcessStatsSectionProto proc_stats_section = 1;
6125}
6126
Chris Wrencdea3b72019-11-22 16:58:17 -05006127// Next Tag: 2
6128message PackageRemoteViewInfoProto {
6129 optional string package_name = 1;
6130 // add per-package additional info here (like channels)
6131}
6132
6133// Next Tag: 2
6134message NotificationRemoteViewsProto {
6135 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6136}
6137
6138/**
6139 * Pulled from NotificationManagerService.java
6140 */
6141message NotificationRemoteViews {
6142 optional NotificationRemoteViewsProto notification_remote_views = 1;
6143}
6144
Yotam Aron74299972020-01-16 16:20:58 +02006145/**
6146 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6147 */
6148message PackageNotificationPreferences {
6149 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006150 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006151 // Notification importance, which specifies when and how a notification is displayed.
6152 // Specified under core/java/android/app/NotificationManager.java.
6153 optional int32 importance = 2;
6154 // Lockscreen visibility as set by the user.
6155 optional int32 visibility = 3;
6156 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6157 // PreferencesHelper.java)
6158 optional int32 user_locked_fields = 4;
6159}
6160
6161/**
6162 * Atom that contains a list of a package's channel preferences, pulled from
6163 * NotificationManagerService.java.
6164 */
6165message PackageNotificationChannelPreferences {
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's ID. Should always be available.
6169 optional string channel_id = 2;
6170 // Channel's name. Should always be available.
6171 optional string channel_name = 3;
6172 // Channel's description. Optionally set by the channel creator.
6173 optional string description = 4;
6174 // Notification importance, which specifies when and how a notification is displayed. Specified
6175 // under core/java/android/app/NotificationManager.java.
6176 optional int32 importance = 5;
6177 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6178 // at core/java/android/app/NotificationChannel.java
6179 optional int32 user_locked_fields = 6;
6180 // Indicates if the channel was deleted by the app.
6181 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006182 // Indicates if the channel was marked as a conversation by the app.
6183 optional bool is_conversation = 8;
6184 // Indicates if the channel is a conversation that was demoted by the user.
6185 optional bool is_demoted_conversation = 9;
6186 // Indicates if the channel is a conversation that was marked as important by the user.
6187 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006188}
6189
6190/**
Chris Wren93165692020-05-15 16:12:41 -04006191 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
6192 * NotificationManagerService.java.
6193 */
6194message DNDModeProto {
6195 enum Mode {
6196 ROOT_CONFIG = -1; // Used to distinguish the config (one per user) from the rules.
6197 ZEN_MODE_OFF = 0;
6198 ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6199 ZEN_MODE_NO_INTERRUPTIONS = 2;
6200 ZEN_MODE_ALARMS = 3;
6201 }
6202 optional int32 user = 1; // Android user ID (0, 1, 10, ...)
6203 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled
6204 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
6205 optional Mode zen_mode = 4;
6206 // id is one of the system default rule IDs, or empty
6207 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
6208 optional string id = 5;
6209 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
6210 optional DNDPolicyProto policy = 7;
6211}
6212
6213/**
6214 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
6215 */
6216message DNDPolicyProto {
6217 enum State {
6218 STATE_UNSET = 0;
6219 STATE_ALLOW = 1;
6220 STATE_DISALLOW = 2;
6221 }
6222 optional State calls = 1;
6223 optional State repeat_callers = 2;
6224 optional State messages = 3;
6225 optional State conversations = 4;
6226 optional State reminders = 5;
6227 optional State events = 6;
6228 optional State alarms = 7;
6229 optional State media = 8;
6230 optional State system = 9;
6231 optional State fullscreen = 10;
6232 optional State lights = 11;
6233 optional State peek = 12;
6234 optional State status_bar = 13;
6235 optional State badge = 14;
6236 optional State ambient = 15;
6237 optional State notification_list = 16;
6238
6239 enum PeopleType {
6240 PEOPLE_UNSET = 0;
6241 PEOPLE_ANYONE = 1;
6242 PEOPLE_CONTACTS = 2;
6243 PEOPLE_STARRED = 3;
6244 PEOPLE_NONE = 4;
6245 }
6246
6247 optional PeopleType allow_calls_from = 17;
6248 optional PeopleType allow_messages_from = 18;
6249
6250 enum ConversationType {
6251 CONV_UNSET = 0;
6252 CONV_ANYONE = 1;
6253 CONV_IMPORTANT = 2;
6254 CONV_NONE = 3;
6255 }
6256
6257 optional ConversationType allow_conversations_from = 19;
6258}
6259
6260/**
Yotam Aron74299972020-01-16 16:20:58 +02006261 * Atom that contains a list of a package's channel group preferences, pulled from
6262 * NotificationManagerService.java.
6263 */
6264message PackageNotificationChannelGroupPreferences {
6265 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006266 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006267 // Channel Group's ID. Should always be available.
6268 optional string group_id = 2;
6269 // Channel Group's name. Should always be available.
6270 optional string group_name = 3;
6271 // Channel Group's description. Optionally set by group creator.
6272 optional string description = 4;
6273 // Indicates if notifications from this channel group are blocked.
6274 optional bool is_blocked = 5;
6275 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6276 // at core/java/android/app/NotificationChannelGroup.java
6277 optional int32 user_locked_fields = 6;
6278}
6279
Yangsteraf9aee72018-10-12 09:26:16 -07006280message PowerProfileProto {
6281 optional double cpu_suspend = 1;
6282
6283 optional double cpu_idle = 2;
6284
6285 optional double cpu_active = 3;
6286
6287 message CpuCluster {
6288 optional int32 id = 1;
6289 optional double cluster_power = 2;
6290 optional int32 cores = 3;
6291 repeated int64 speed = 4;
6292 repeated double core_power = 5;
6293 }
6294
6295 repeated CpuCluster cpu_cluster = 40;
6296
6297 optional double wifi_scan = 4;
6298
6299 optional double wifi_on = 5;
6300
6301 optional double wifi_active = 6;
6302
6303 optional double wifi_controller_idle = 7;
6304
6305 optional double wifi_controller_rx = 8;
6306
6307 optional double wifi_controller_tx = 9;
6308
6309 repeated double wifi_controller_tx_levels = 10;
6310
6311 optional double wifi_controller_operating_voltage = 11;
6312
6313 optional double bluetooth_controller_idle = 12;
6314
6315 optional double bluetooth_controller_rx = 13;
6316
6317 optional double bluetooth_controller_tx = 14;
6318
6319 optional double bluetooth_controller_operating_voltage = 15;
6320
6321 optional double modem_controller_sleep = 16;
6322
6323 optional double modem_controller_idle = 17;
6324
6325 optional double modem_controller_rx = 18;
6326
6327 repeated double modem_controller_tx = 19;
6328
6329 optional double modem_controller_operating_voltage = 20;
6330
6331 optional double gps_on = 21;
6332
6333 repeated double gps_signal_quality_based = 22;
6334
6335 optional double gps_operating_voltage = 23;
6336
6337 optional double bluetooth_on = 24;
6338
6339 optional double bluetooth_active = 25;
6340
6341 optional double bluetooth_at_cmd = 26;
6342
6343 optional double ambient_display = 27;
6344
6345 optional double screen_on = 28;
6346
6347 optional double radio_on = 29;
6348
6349 optional double radio_scanning = 30;
6350
6351 optional double radio_active = 31;
6352
6353 optional double screen_full = 32;
6354
6355 optional double audio = 33;
6356
6357 optional double video = 34;
6358
6359 optional double flashlight = 35;
6360
6361 optional double memory = 36;
6362
6363 optional double camera = 37;
6364
6365 optional double wifi_batched_scan = 38;
6366
6367 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006368}
Chenjie Yuab530202018-09-26 12:39:20 -07006369
6370/**
6371 * power_profile.xml and other constants for power model calculations.
6372 * Pulled from PowerProfile.java
6373 */
6374message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006375 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006376}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006377
6378/**
arangelovd5db50e2018-10-12 20:24:39 +01006379 * Logs when a user restriction was added or removed.
6380 *
6381 * Logged from:
6382 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6383 */
6384message UserRestrictionChanged {
6385 // The raw string of the user restriction as defined in UserManager.
6386 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6387 optional string restriction = 1;
6388 // Whether the restriction is enabled or disabled.
6389 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006390}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006391
6392/**
6393 * Pulls process user time and system time. Puller takes a snapshot of all pids
6394 * in the system and returns cpu stats for those that are working at the time.
6395 * Dead pids will be dropped. Kernel processes are excluded.
6396 * Min cool-down is 5 sec.
6397 */
6398message ProcessCpuTime {
6399 optional int32 uid = 1 [(is_uid) = true];
6400
6401 optional string process_name = 2;
6402 // Process cpu time in user space, cumulative from boot/process start
6403 optional int64 user_time_millis = 3;
6404 // Process cpu time in system space, cumulative from boot/process start
6405 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006406}
Misha Wagner5a51e002018-10-03 15:04:09 +01006407
6408/**
6409 * Pulls the CPU usage for each thread.
6410 *
6411 * Read from /proc/$PID/task/$TID/time_in_state files.
6412 *
6413 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6414 * time_in_state files not being present on some phones, have not been addressed. These should be
6415 * considered before a public release.
6416 */
6417message CpuTimePerThreadFreq {
6418 // UID that owns the process.
6419 optional int32 uid = 1 [(is_uid) = true];
6420 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006421 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006422 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006423 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006424 // Name of the process taken from `/proc/$PID/cmdline`.
6425 optional string process_name = 4;
6426 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6427 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006428
6429 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6430 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6431 // frequencies are given here as the alternative is sending eight separate atoms. This method
6432 // significantly reduces the amount of data created
6433 optional int32 frequency1_khz = 6;
6434 optional int32 time1_millis = 7;
6435 optional int32 frequency2_khz = 8;
6436 optional int32 time2_millis = 9;
6437 optional int32 frequency3_khz = 10;
6438 optional int32 time3_millis = 11;
6439 optional int32 frequency4_khz = 12;
6440 optional int32 time4_millis = 13;
6441 optional int32 frequency5_khz = 14;
6442 optional int32 time5_millis = 15;
6443 optional int32 frequency6_khz = 16;
6444 optional int32 time6_millis = 17;
6445 optional int32 frequency7_khz = 18;
6446 optional int32 time7_millis = 19;
6447 optional int32 frequency8_khz = 20;
6448 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006449}
Bookatz75ee60422018-11-09 12:27:37 -08006450
6451/**
Bookatz366a4432018-11-20 09:42:33 -08006452 * Pulls information about the device's build.
6453 */
6454message BuildInformation {
6455 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6456 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6457 optional string fingerprint = 1;
6458
6459 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6460 optional string brand = 2;
6461
6462 // Build.PRODUCT. The name of the overall product.
6463 optional string product = 3;
6464
6465 // Build.DEVICE. The name of the industrial design.
6466 optional string device = 4;
6467
6468 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6469 optional string version_release = 5;
6470
6471 // Build.ID. E.g. a label like "M4-rc20".
6472 optional string id = 6;
6473
6474 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6475 // represent this build.
6476 optional string version_incremental = 7;
6477
6478 // Build.TYPE. The type of build, like "user" or "eng".
6479 optional string type = 8;
6480
6481 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6482 optional string tags = 9;
6483}
6484
6485/**
Adam He420947c2019-01-23 15:59:09 -08006486 * Logs information about mismatched caller for content capture.
6487 *
6488 * Logged from:
6489 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6490 */
6491message ContentCaptureCallerMismatchReported {
6492 optional string intended_package = 1;
6493 optional string calling_package = 2;
6494}
6495
6496/**
6497 * Logs information about content capture service events.
6498 *
6499 * Logged from:
6500 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6501 */
6502message ContentCaptureServiceEvents {
6503 // The type of event.
6504 enum Event {
6505 UNKNOWN = 0;
6506 ON_CONNECTED = 1;
6507 ON_DISCONNECTED = 2;
6508 SET_WHITELIST = 3;
6509 SET_DISABLED = 4;
6510 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006511 ON_DATA_SHARE_REQUEST = 6;
6512 ACCEPT_DATA_SHARE_REQUEST = 7;
6513 REJECT_DATA_SHARE_REQUEST = 8;
6514 DATA_SHARE_WRITE_FINISHED = 9;
6515 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6516 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6517 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6518 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6519 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6520 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006521 }
6522 optional Event event = 1;
6523 // component/package of content capture service.
6524 optional string service_info = 2;
6525 // component/package of target.
6526 // it's a concatenated list of component/package for SET_WHITELIST event
6527 // separated by " ".
6528 optional string target_info = 3;
6529}
6530
6531/**
6532 * Logs information about content capture session events.
6533 *
6534 * Logged from:
6535 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6536 */
6537message ContentCaptureSessionEvents {
6538 // The type of event.
6539 enum Event {
6540 UNKNOWN = 0;
6541 ON_SESSION_STARTED = 1;
6542 ON_SESSION_FINISHED = 2;
6543 SESSION_NOT_CREATED = 3;
6544 }
6545 optional int32 session_id = 1;
6546 optional Event event = 2;
6547 // (n/a on session finished)
6548 optional int32 state_flags = 3;
6549 // component/package of content capture service.
6550 optional string service_info = 4;
6551 // component/package of app.
6552 // (n/a on session finished)
6553 optional string app_info = 5;
6554 optional bool is_child_session = 6;
6555}
6556
6557/**
6558 * Logs information about session being flushed.
6559 *
6560 * Logged from:
6561 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6562 */
6563message ContentCaptureFlushed {
6564 optional int32 session_id = 1;
6565 // component/package of content capture service.
6566 optional string service_info = 2;
6567 // component/package of app.
6568 optional string app_info = 3;
6569 // session start/finish events
6570 optional int32 child_session_started = 4;
6571 optional int32 child_session_finished = 5;
6572 // count of view events.
6573 optional int32 view_appeared_count = 6;
6574 optional int32 view_disappeared_count = 7;
6575 optional int32 view_text_changed_count = 8;
6576
6577 // Flush stats.
6578 optional int32 max_events = 9;
6579 optional int32 idle_flush_freq = 10;
6580 optional int32 text_flush_freq = 11;
6581 optional int32 flush_reason = 12;
6582}
6583
6584/**
Bookatz75ee60422018-11-09 12:27:37 -08006585 * Pulls on-device BatteryStats power use calculations for the overall device.
6586 */
6587message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006588 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6589 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6590 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6591 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006592}
6593
6594/**
6595 * Pulls on-device BatteryStats power use calculations broken down by uid.
6596 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6597 * that is attributed to non-uid items. They must all be included to get the total power use.
6598 */
6599message DeviceCalculatedPowerBlameUid {
6600 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6601 optional int32 uid = 1 [(is_uid) = true];
6602
Bookatz3dbc13a2018-12-21 12:16:51 -08006603 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6604 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6605 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006606}
6607
6608/**
6609 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6610 * drain type.
6611 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6612 * is attributed uids. They must all be included to get the total power use.
6613 */
6614message DeviceCalculatedPowerBlameOther {
6615 // The type of item whose power use is being reported.
6616 enum DrainType {
6617 AMBIENT_DISPLAY = 0;
6618 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6619 BLUETOOTH = 2;
6620 CAMERA = 3;
6621 // Cell-standby
6622 CELL = 4;
6623 FLASHLIGHT = 5;
6624 IDLE = 6;
6625 MEMORY = 7;
6626 // Amount that total computed drain exceeded the drain estimated using the
6627 // battery level changes and capacity.
6628 OVERCOUNTED = 8;
6629 PHONE = 9;
6630 SCREEN = 10;
6631 // Amount that total computed drain was below the drain estimated using the
6632 // battery level changes and capacity.
6633 UNACCOUNTED = 11;
6634 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6635 WIFI = 13;
6636 }
6637 optional DrainType drain_type = 1;
6638
Bookatz3dbc13a2018-12-21 12:16:51 -08006639 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6640 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6641 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006642}
arangelov4e994062018-11-13 16:12:38 +00006643
6644/**
6645 * Logs device policy features.
6646 *
6647 * Logged from:
6648 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6649 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6650 */
6651message DevicePolicyEvent {
6652 // The event id - unique for each event.
6653 optional android.stats.devicepolicy.EventId event_id = 1;
6654 // The admin package name.
6655 optional string admin_package_name = 2;
6656 // A generic integer parameter.
6657 optional int32 integer_value = 3;
6658 // A generic boolean parameter.
6659 optional bool boolean_value = 4;
6660 // A parameter specifying a time period in milliseconds.
6661 optional uint64 time_period_millis = 5;
6662 // A parameter specifying a list of package names, bundle extras or string parameters.
6663 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6664}
shawnlinea5b66b2018-11-13 15:05:29 +08006665
6666/**
6667 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6668 *
6669 * Logged from:
6670 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6671 */
6672message DocsUILaunchReported {
6673 optional android.stats.docsui.LaunchAction launch_action = 1;
6674 optional bool has_initial_uri = 2;
6675 optional android.stats.docsui.MimeType mime_type = 3;
6676 optional android.stats.docsui.Root initial_root = 4;
6677}
6678
6679/**
6680 * Logs root/app visited event in file managers/picker. Call this when the user
6681 * taps on root/app in hamburger menu.
6682 *
6683 * Logged from:
6684 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6685 */
6686message DocsUIRootVisitedReported {
6687 optional android.stats.docsui.ContextScope scope = 1;
6688 optional android.stats.docsui.Root root = 2;
6689}
6690
6691/**
6692 * Logs file operation stats. Call this when a file operation has completed.
6693 *
6694 * Logged from:
6695 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6696 */
6697message DocsUIFileOperationReported {
6698 optional android.stats.docsui.Provider provider = 1;
6699 optional android.stats.docsui.FileOperation file_op = 2;
6700}
6701
6702/**
6703 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6704 * mode.
6705 *
6706 * Logged from:
6707 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6708 */
6709message DocsUIFileOperationCopyMoveModeReported {
6710 optional android.stats.docsui.FileOperation file_op = 1;
6711 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6712}
6713
6714
6715/**
6716 * Logs file sub operation stats. Call this when a file operation has failed.
6717 *
6718 * Logged from:
6719 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6720 */
6721message DocsUIFileOperationFailureReported {
6722 optional android.stats.docsui.Authority authority = 1;
6723 optional android.stats.docsui.SubFileOperation sub_op = 2;
6724}
6725
6726/**
6727* Logs the cancellation of a file operation. Call this when a job is canceled
6728*
6729* Logged from:
6730* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6731*/
6732message DocsUIFileOperationCanceledReported {
6733 optional android.stats.docsui.FileOperation file_op = 1;
6734}
6735
6736/**
6737 * Logs startup time in milliseconds.
6738 *
6739 * Logged from:
6740 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6741 */
6742message DocsUIStartupMsReported {
6743 optional int32 startup_millis = 1;
6744}
6745
6746/**
6747 * Logs the action that was started by user.
6748 *
6749 * Logged from:
6750 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6751 */
6752message DocsUIUserActionReported {
6753 optional android.stats.docsui.UserAction action = 1;
6754}
6755
6756/**
6757 * Logs the invalid type when invalid scoped access is requested.
6758 *
6759 * Logged from:
6760 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6761 */
6762message DocsUIInvalidScopedAccessRequestReported {
6763 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006764}
Ben Murdochbab399f2018-12-06 11:01:38 +00006765
6766/**
shawnlina75e82d2019-01-07 10:31:12 +08006767 * Logs the package name that launches docsui picker mode.
6768 *
6769 * Logged from:
6770 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6771 */
6772message DocsUIPickerLaunchedFromReported {
6773 optional string package_name = 1;
6774}
6775
6776/**
6777 * Logs the search type.
6778 *
6779 * Logged from:
6780 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6781 */
6782message DocsUISearchTypeReported {
6783 optional android.stats.docsui.SearchType search_type = 1;
6784}
6785
6786/**
6787 * Logs the search mode.
6788 *
6789 * Logged from:
6790 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6791 */
6792message DocsUISearchModeReported {
6793 optional android.stats.docsui.SearchMode search_mode = 1;
6794}
6795
6796/**
6797 * Logs the pick result information.
6798 *
6799 * Logged from:
6800 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6801 */
6802message DocsUIPickResultReported {
6803 optional int32 total_action_count = 1;
6804 optional int64 duration_millis = 2;
6805 optional int32 file_count= 3;
6806 optional bool is_searching = 4;
6807 optional android.stats.docsui.Root picked_from = 5;
6808 optional android.stats.docsui.MimeType mime_type = 6;
6809 optional int32 repeatedly_pick_times = 7;
6810}
6811
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006812/** Logs the drag and drop of files.
6813
6814 * Logged from:
6815 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6816 */
6817message DocsUIDragAndDropReported {
6818 optional bool drag_initiated_from_docsui = 1;
6819}
6820
shawnlina75e82d2019-01-07 10:31:12 +08006821/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006822 * Logs when an app's memory is compacted.
6823 *
6824 * Logged from:
6825 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6826 */
6827message AppCompacted {
6828 // The pid of the process being compacted.
6829 optional int32 pid = 1;
6830
6831 // The name of the process being compacted.
6832 optional string process_name = 2;
6833
6834 // The type of compaction.
6835 enum Action {
6836 UNKNOWN = 0;
6837 SOME = 1;
6838 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006839 PERSISTENT = 3;
6840 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006841 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006842 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006843
6844 // Total RSS in kilobytes consumed by the process prior to compaction.
6845 optional int64 before_rss_total_kilobytes = 4;
6846
6847 // File RSS in kilobytes consumed by the process prior to compaction.
6848 optional int64 before_rss_file_kilobytes = 5;
6849
6850 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6851 optional int64 before_rss_anon_kilobytes = 6;
6852
6853 // Swap in kilobytes consumed by the process prior to compaction.
6854 optional int64 before_swap_kilobytes = 7;
6855
6856 // Total RSS in kilobytes consumed by the process after compaction.
6857 optional int64 after_rss_total_kilobytes = 8;
6858
6859 // File RSS in kilobytes consumed by the process after compaction.
6860 optional int64 after_rss_file_kilobytes = 9;
6861
6862 // Anonymous RSS in kilobytes consumed by the process after compaction.
6863 optional int64 after_rss_anon_kilobytes = 10;
6864
6865 // Swap in kilobytes consumed by the process after compaction.
6866 optional int64 after_swap_kilobytes = 11;
6867
6868 // The time taken to perform compaction in milliseconds.
6869 optional int64 time_to_compact_millis = 12;
6870
6871 // The last compaction action performed for this app.
6872 optional Action last_action = 13;
6873
Ben Murdoch01720b82018-12-19 18:03:44 +00006874 // The last time that compaction was attempted on this process in milliseconds
6875 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6876 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006877
Ben Murdoch885c21b2019-03-15 18:02:04 +00006878 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006879 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006880
6881 // The process state at the time of compaction.
6882 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006883
6884 // Free ZRAM in kilobytes before compaction.
6885 optional int64 before_zram_free_kilobytes = 17;
6886
6887 // Free ZRAM in kilobytes after compaction.
6888 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006889}
lifr157fc552018-12-12 16:38:04 +08006890
6891/**
lifrb6b90b62019-03-29 00:40:17 +08006892 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6893 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6894 *
lifr1f74b052019-04-16 22:16:30 +08006895 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6896 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6897 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6898 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006899 */
6900message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006901 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006902
lifr1f74b052019-04-16 22:16:30 +08006903 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006904
6905 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006906 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006907
lifr1f74b052019-04-16 22:16:30 +08006908 // Only valid for event_type = EVENT_GETADDRINFO.
6909 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006910
lifr1f74b052019-04-16 22:16:30 +08006911 // Flags passed to android_res_nsend() defined in multinetwork.h
6912 // Only valid for event_type = EVENT_RESNSEND.
6913 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006914
lifrad9becc2019-05-20 11:04:41 +08006915 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006916
6917 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006918 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006919
6920 // Additional pass-through fields opaque to statsd.
6921 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006922 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006923
6924 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6925 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006926}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006927
6928/**
lifr1cc318d2020-03-19 21:58:30 +08006929 * logs the CapportApiData info
6930 * Logged from:
6931 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6932 */
6933message CapportApiData {
6934 // The TTL of the network connection provided by captive portal
6935 optional int32 remaining_ttl_secs = 1;
6936
6937 // The limit traffic data of the network connection provided by captive portal
6938 optional int32 remaining_bytes = 2;
6939
6940 // Is portal url option included in the DHCP packet (Yes, No)
6941 optional bool has_portal_url = 3;
6942
6943 // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
6944 optional bool has_venue_info = 4;
6945}
6946
6947/**
6948 * logs a network Probe Event
6949 * Logged from:
6950 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6951 */
6952message ProbeEvent {
6953 // The probe type (http or https, or captive portal API...)
6954 optional android.stats.connectivity.ProbeType probe_type = 1;
6955
6956 // The latency in microseconds of the probe event
6957 optional int32 latency_micros = 2;
6958
6959 // The result of the probe event
6960 optional android.stats.connectivity.ProbeResult probe_result = 3;
6961
6962 // The CaptivePortal API info
6963 optional CapportApiData capport_api_data = 4;
6964}
6965
6966/**
6967 * log each ProbeEvent in ProbeEvents
6968 * Logged from:
6969 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6970 */
6971message ProbeEvents {
6972 // Record probe event during the validation
6973 repeated ProbeEvent probe_event = 1;
6974}
6975
6976/**
6977 * The DHCP (Dynamic Host Configuration Protocol) session info
6978 * Logged from:
6979 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
6980 */
6981message DhcpSession {
6982 // The DHCP Feature(s) enabled in this session
6983 repeated android.stats.connectivity.DhcpFeature used_features = 1;
6984
6985 // The discover packet (re)transmit count
6986 optional int32 discover_count = 2;
6987
6988 // The request packet (re)transmit count
6989 optional int32 request_count = 3;
6990
6991 // The IPv4 address conflict count
6992 // (only be meaningful when duplicate address detection is enabled)
6993 optional int32 conflict_count = 4;
6994
6995 // The DHCP packet parsing error code in this session
6996 // (defined in android.net.metrics.DhcpErrorEvent)
6997 repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
6998
6999 // The result of DHCP hostname transliteration
7000 optional android.stats.connectivity.HostnameTransResult ht_result = 6;
7001}
7002
7003/**
7004 * Logs Network IP provisioning event
7005 * Logged from:
7006 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
7007 */
7008message NetworkIpProvisioningReported {
7009 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7010 optional android.stats.connectivity.TransportType transport_type = 1;
7011
7012 // The latency in microseconds of IP Provisioning over IPV4
7013 optional int32 ipv4_latency_micros = 2;
7014
7015 // The latency in microseconds of IP Provisioning over IPV6
7016 optional int32 ipv6_latency_micros = 3;
7017
7018 // The time duration between provisioning start and end (success or failure)
7019 optional int64 provisioning_duration_micros = 4;
7020
7021 // The specific disconnect reason for this IP provisioning
7022 optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
7023
7024 // Log DHCP session info (Only valid for IPv4)
7025 optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
7026
7027 // The random number between 0 ~ 999 for sampling
7028 optional int32 random_number = 7;
7029}
7030
7031/**
7032 * Logs Network DHCP Renew event
7033 * Logged from:
7034 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
7035 */
7036message NetworkDhcpRenewReported {
7037 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7038 optional android.stats.connectivity.TransportType transport_type = 1;
7039
7040 // The request packet (re)transmit count
7041 optional int32 request_count = 2;
7042
7043 // The latency in microseconds of DHCP Renew
7044 optional int32 latency_micros = 3;
7045
7046 // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
7047 optional android.stats.connectivity.DhcpErrorCode error_code = 4;
7048
7049 // The result of DHCP renew
7050 optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
7051
7052 // The random number between 0 ~ 999 for sampling
7053 optional int32 random_number = 6;
7054}
7055
7056/**
7057 * Logs Network Validation event
7058 * Logged from:
7059 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
7060 */
7061message NetworkValidationReported {
7062 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7063 optional android.stats.connectivity.TransportType transport_type = 1;
7064
7065 // Record each probe event
7066 optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
7067
7068 // The result of the network validation
7069 optional android.stats.connectivity.ValidationResult validation_result = 3;
7070
7071 // The latency in microseconds of network validation
7072 optional int32 latency_micros = 4;
7073
7074 // The validation index (the first validation attempt or second, third...)
7075 optional int32 validation_index = 5;
7076
7077 // The random number between 0 ~ 999 for sampling
7078 optional int32 random_number = 6;
7079}
7080
7081/**
7082 * Logs NetworkStack Quirk event
7083 * Logged from:
7084 * packages/modules/NetworkStack/src/com/android/networkstack/
7085 */
7086message NetworkStackQuirkReported {
7087 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7088 optional android.stats.connectivity.TransportType transport_type = 1;
7089
7090 // Record each Quirk event
7091 optional android.stats.connectivity.NetworkQuirkEvent event = 2;
7092}
7093
7094/**
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007095 * Logs when a data stall event occurs.
7096 *
7097 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007098 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007099 */
7100message DataStallEvent {
7101 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007102 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007103 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
7104 optional int32 evaluation_type = 1;
7105 // See definition in data_stall_event.proto.
7106 optional com.android.server.connectivity.ProbeResult validation_result = 2;
7107 // See definition in data_stall_event.proto.
7108 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
7109 // See definition in data_stall_event.proto.
7110 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
7111 // See definition in data_stall_event.proto.
7112 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
7113 // See definition in data_stall_event.proto.
7114 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007115 // The tcp packets fail rate from the latest tcp polling.
7116 optional int32 tcp_fail_rate = 7;
7117 // Number of packets sent since the last received packet.
7118 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007119}
Christian Brunschenf86039e2018-12-21 12:26:14 +00007120
7121/*
7122 * Logs when RescueParty resets some set of experiment flags.
7123 *
7124 * Logged from:
7125 * frameworks/base/services/core/java/com/android/server/RescueParty.java
7126 */
7127message RescuePartyResetReported {
7128 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
7129 optional int32 rescue_level = 1;
7130}
Mathew Inwoodb375be52019-01-04 11:36:25 +00007131
7132/**
7133 * Logs when signed config is received from an APK, and if that config was applied successfully.
7134 * Logged from:
7135 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
7136 */
7137message SignedConfigReported {
7138 enum Type {
7139 UNKNOWN_TYPE = 0;
7140 GLOBAL_SETTINGS = 1;
7141 }
7142 optional Type type = 1;
7143
7144 // The final status of the signed config received.
7145 enum Status {
7146 UNKNOWN_STATUS = 0;
7147 APPLIED = 1;
7148 BASE64_FAILURE_CONFIG = 2;
7149 BASE64_FAILURE_SIGNATURE = 3;
7150 SECURITY_EXCEPTION = 4;
7151 INVALID_CONFIG = 5;
7152 OLD_CONFIG = 6;
7153 SIGNATURE_CHECK_FAILED = 7;
7154 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00007155 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00007156 }
7157 optional Status status = 2;
7158
7159 // The version of the signed config processed.
7160 optional int32 version = 3;
7161
7162 // The package name that the config was extracted from.
7163 optional string from_package = 4;
7164
7165 enum Key {
7166 NO_KEY = 0;
7167 DEBUG = 1;
7168 PRODUCTION = 2;
7169 }
7170 // Which key was used to verify the config.
7171 optional Key verified_with = 5;
7172}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007173
7174/*
7175 * Logs GNSS Network-Initiated (NI) location events.
7176 *
7177 * Logged from:
7178 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7179 */
7180message GnssNiEventReported {
7181 // The type of GnssNiEvent.
7182 enum EventType {
7183 UNKNOWN = 0;
7184 NI_REQUEST = 1;
7185 NI_RESPONSE = 2;
7186 }
7187 optional EventType event_type = 1;
7188
7189 // An ID generated by HAL to associate NI notifications and UI responses.
7190 optional int32 notification_id = 2;
7191
7192 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007193 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007194
7195 // NI requires notification.
7196 optional bool need_notify = 4;
7197
7198 // NI requires verification.
7199 optional bool need_verify = 5;
7200
7201 // NI requires privacy override, no notification/minimal trace.
7202 optional bool privacy_override = 6;
7203
7204 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
7205 // seconds.
7206 optional int32 timeout = 7;
7207
7208 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007209 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007210
7211 // String representing the requester of the network inititated location request.
7212 optional string requestor_id = 9;
7213
7214 // Notification message text string representing the service(for eg. SUPL-service) who sent the
7215 // network initiated location request.
7216 optional string text = 10;
7217
7218 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007219 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007220
7221 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007222 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007223
7224 // True if SUPL ES is enabled.
7225 optional bool is_supl_es_enabled = 13;
7226
7227 // True if GNSS location is enabled.
7228 optional bool is_location_enabled = 14;
7229
7230 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007231 optional android.server.location.GnssUserResponseType user_response = 15;
7232}
7233
7234/**
7235 * Logs GNSS non-framework (NFW) location notification.
7236 *
7237 * Logged from:
7238 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7239 */
7240message GnssNfwNotificationReported {
7241 // Package name of the Android proxy application representing the non-framework entity that
7242 // requested location. Set to empty string if unknown.
7243 optional string proxy_app_package_name = 1;
7244
7245 // Protocol stack that initiated the non-framework location request.
7246 optional android.server.location.NfwProtocolStack protocol_stack = 2;
7247
7248 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
7249 // set to empty string. This field is opaque to the framework and used for logging purposes.
7250 optional string other_protocol_stack_name = 3;
7251
7252 // Source initiating/receiving the location information.
7253 optional android.server.location.NfwRequestor requestor = 4;
7254
7255 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
7256 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
7257 // and used for logging purposes.
7258 optional string requestor_id = 5;
7259
7260 // Indicates whether location information was provided for this request.
7261 optional android.server.location.NfwResponseType response_type = 6;
7262
7263 // True if the device is in user initiated emergency session.
7264 optional bool in_emergency_mode = 7;
7265
7266 // True if cached location is provided.
7267 optional bool is_cached_location = 8;
7268
7269 // True if proxy app permission mismatch between framework and GNSS HAL.
7270 optional bool is_permission_mismatched = 9;
7271}
7272
7273/**
7274 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7275 *
7276 * Logged from:
7277 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7278 */
7279message GnssConfigurationReported {
7280 // SUPL host name.
7281 optional string supl_host = 1;
7282
7283 // SUPL port number.
7284 optional int32 supl_port = 2;
7285
7286 // C2K host name.
7287 optional string c2k_host = 3;
7288
7289 // C2K port number.
7290 optional int32 c2k_port = 4;
7291
7292 // The SUPL version requested by Carrier.
7293 optional int32 supl_ver = 5;
7294
7295 // The SUPL mode.
7296 optional android.server.location.SuplMode supl_mode = 6;
7297
7298 // True if NI emergency SUPL restrictions is enabled.
7299 optional bool supl_es = 7;
7300
7301 // LTE Positioning Profile settings
7302 optional android.server.location.LppProfile lpp_profile = 8;
7303
7304 // Positioning protocol on A-Glonass system.
7305 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7306
7307 // True if emergency PDN is used. Otherwise, regular PDN is used.
7308 optional bool use_emergency_pdn_for_emergency_supl= 10;
7309
7310 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7311 optional android.server.location.GpsLock gps_lock = 11;
7312
7313 // Number of seconds to extend the emergency session duration post emergency call.
7314 optional int32 es_extension_sec = 12;
7315
7316 // The full list of package names of proxy Android applications representing the non-framework
7317 // location access entities (on/off the device) for which the framework user has granted
7318 // non-framework location access permission. The package names are concatenated in one string
7319 // with spaces as separators.
7320 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007321}
Jack Yu95b64f32018-12-13 18:26:11 +08007322
7323/**
7324 * Logs when a NFC device's error occurred.
7325 * Logged from:
7326 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7327 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7328 */
7329message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007330 enum Type {
7331 UNKNOWN = 0;
7332 CMD_TIMEOUT = 1;
7333 ERROR_NOTIFICATION = 2;
7334 AID_OVERFLOW = 3;
7335 }
7336 optional Type type = 1;
7337 // If it's nci cmd timeout, log the timeout command.
7338 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007339
Alex Salod7c3eef2019-01-25 14:43:27 -08007340 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007341}
7342
7343/**
7344 * Logs when a NFC device's state changed event
7345 * Logged from:
7346 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7347 */
7348message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007349 enum State {
7350 UNKNOWN = 0;
7351 OFF = 1;
7352 ON = 2;
7353 ON_LOCKED = 3; // Secure Nfc enabled.
7354 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7355 }
7356 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007357}
7358
7359/**
7360 * Logs when a NFC Beam Transaction occurred.
7361 * Logged from:
7362 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7363 */
7364message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007365 enum Operation {
7366 UNKNOWN = 0;
7367 SEND = 1;
7368 RECEIVE = 2;
7369 }
7370 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007371}
7372
7373/**
7374 * Logs when a NFC Card Emulation Transaction occurred.
7375 * Logged from:
7376 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7377 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7378 */
7379message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007380 enum Category {
7381 UNKNOWN = 0;
7382 HCE_PAYMENT = 1;
7383 HCE_OTHER = 2;
7384 OFFHOST = 3;
7385 }
7386 // Transaction belongs to HCE payment or HCE other category, or offhost.
7387 optional Category category = 1;
7388 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7389 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007390}
7391
7392/**
7393 * Logs when a NFC Tag event occurred.
7394 * Logged from:
7395 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7396 */
7397message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007398 enum Type {
7399 UNKNOWN = 0;
7400 URL = 1;
7401 BT_PAIRING = 2;
7402 PROVISION = 3;
7403 WIFI_CONNECT = 4;
7404 APP_LAUNCH = 5;
7405 OTHERS = 6;
7406 }
7407 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007408}
7409
7410/**
7411 * Logs when Hce transaction triggered
7412 * Logged from:
7413 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7414 */
7415message NfcHceTransactionOccurred {
7416 // The latency period(in microseconds) it took for the first HCE data
7417 // exchange.
7418 optional uint32 latency_micros = 1;
7419}
7420
7421/**
7422 * Logs when SecureElement state event changed
7423 * Logged from:
7424 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7425 */
7426message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007427 enum State {
7428 UNKNOWN = 0;
7429 INITIALIZED = 1;
7430 DISCONNECTED = 2;
7431 CONNECTED = 3;
7432 HALCRASH = 4;
7433 }
7434 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007435
Alex Salod7c3eef2019-01-25 14:43:27 -08007436 optional string state_change_reason = 2;
7437 // SIMx or eSEx.
7438 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007439}
7440
7441/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007442 * Information about a permission grant request
7443 */
7444message PermissionGrantRequestResultReported {
7445 // unique value identifying an API call. A API call might result in multiple of these atoms
7446 optional int64 request_id = 1;
7447
7448 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007449 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007450
7451 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007452 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007453
7454 // The permission to be granted
7455 optional string permission_name = 4;
7456
7457 // If the permission was explicitly requested via the API or added by the system
7458 optional bool is_implicit = 5;
7459
7460 enum Result {
7461 UNDEFINED = 0;
7462 // permission request was ignored
7463 IGNORED = 1;
7464 // permission request was ignored because it was user fixed
7465 IGNORED_USER_FIXED = 2;
7466 // permission request was ignored because it was policy fixed
7467 IGNORED_POLICY_FIXED = 3;
7468 // permission was granted by user action
7469 USER_GRANTED = 4;
7470 // permission was automatically granted
7471 AUTO_GRANTED = 5;
7472 // permission was denied by user action
7473 USER_DENIED = 6;
7474 // permission was denied with prejudice by the user
7475 USER_DENIED_WITH_PREJUDICE = 7;
7476 // permission was automatically denied
7477 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007478 // permission request was ignored because permission is restricted
7479 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007480 // one time permission was granted by user action
7481 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007482 // user ignored request by leaving the request screen without choosing any option
7483 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007484 // user granted the permission after being linked to settings
7485 USER_GRANTED_IN_SETTINGS = 12;
7486 // user denied the permission after being linked to settings
7487 USER_DENIED_IN_SETTINGS = 13;
7488 // user denied the permission with prejudice after being linked to settings
7489 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7490 // permission was automatically revoked after one-time permission expired
7491 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007492 // permission was automatically revoked for unused app
7493 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007494 }
7495 // The result of the permission grant
7496 optional Result result = 6;
7497}
7498
7499/**
Jack Yu95b64f32018-12-13 18:26:11 +08007500 * Logs when Omapi API used
7501 * Logged from:
7502 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7503 */
7504message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007505 enum Operation {
7506 UNKNOWN = 0;
7507 OPEN_CHANNEL = 1;
7508 }
7509 optional Operation operation = 1;
7510 // SIMx or eSEx.
7511 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007512
Alex Salod7c3eef2019-01-25 14:43:27 -08007513 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007514}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007515
7516/**
Alex Saloa060aee2019-01-21 14:36:41 -08007517 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7518 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007519 * Logged from:
7520 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7521 */
7522message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007523 optional int64 dispatch_latency_millis = 1;
7524}
7525
7526/**
7527 * Logs AttentionManagerService attention check result.
7528 *
7529 * Logged from:
7530 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7531 */
7532message AttentionManagerServiceResultReported {
7533 // See core/java/android/service/attention/AttentionService.java
7534 enum AttentionCheckResult {
7535 UNKNOWN = 20;
7536 ATTENTION_SUCCESS_ABSENT = 0;
7537 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007538 ATTENTION_FAILURE_UNKNOWN = 2;
7539 ATTENTION_FAILURE_CANCELLED = 3;
7540 ATTENTION_FAILURE_PREEMPTED = 4;
7541 ATTENTION_FAILURE_TIMED_OUT = 5;
7542 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007543 }
7544 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007545}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007546
7547/**
7548 * Logs when an adb connection changes state.
7549 *
7550 * Logged from:
7551 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7552 */
7553message AdbConnectionChanged {
7554 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7555 // previously selected for this system.
7556 optional int64 last_connection_time_millis = 1;
7557
7558 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7559 // to reconnect via adb without user interaction.
7560 optional int64 auth_window_millis = 2;
7561
7562 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7563 optional android.debug.AdbConnectionStateEnum state = 3;
7564
7565 // True if the 'always allow' option was selected for this system.
7566 optional bool always_allow = 4;
7567}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007568
7569/*
7570 * Logs the reported speech DSP status.
7571 *
7572 * Logged from:
7573 * Vendor audio implementation.
7574 */
7575message SpeechDspStatReported {
7576 // The total Speech DSP uptime in milliseconds.
7577 optional int32 total_uptime_millis = 1;
7578 // The total Speech DSP downtime in milliseconds.
7579 optional int32 total_downtime_millis = 2;
7580 optional int32 total_crash_count = 3;
7581 optional int32 total_recover_count = 4;
7582}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007583
7584/**
7585 * Logs USB connector contaminant status.
7586 *
7587 * Logged from: USB Service.
7588 */
7589message UsbContaminantReported {
7590 optional string id = 1;
7591 optional android.service.usb.ContaminantPresenceStatus status = 2;
7592}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007593
7594/**
7595 * This atom is for debugging purpose.
7596 */
7597message DebugElapsedClock {
7598 // Monotically increasing value for each pull.
7599 optional int64 pull_count = 1;
7600 // Time from System.elapsedRealtime.
7601 optional int64 elapsed_clock_millis = 2;
7602 // Time from System.elapsedRealtime.
7603 optional int64 same_elapsed_clock_millis = 3;
7604 // Diff between current elapsed time and elapsed time from previous pull.
7605 optional int64 elapsed_clock_diff_millis = 4;
7606
7607 enum Type {
7608 TYPE_UNKNOWN = 0;
7609 ALWAYS_PRESENT = 1;
7610 PRESENT_ON_ODD_PULLS = 2;
7611 }
7612 // Type of behavior for the pulled data.
7613 optional Type type = 5;
7614}
7615
7616/**
7617 * This atom is for debugging purpose.
7618 */
7619message DebugFailingElapsedClock {
7620 // Monotically increasing value for each pull.
7621 optional int64 pull_count = 1;
7622 // Time from System.elapsedRealtime.
7623 optional int64 elapsed_clock_millis = 2;
7624 // Time from System.elapsedRealtime.
7625 optional int64 same_elapsed_clock_millis = 3;
7626 // Diff between current elapsed time and elapsed time from previous pull.
7627 optional int64 elapsed_clock_diff_millis = 4;
7628}
Steven Wuacef6bb2019-01-23 14:21:17 -05007629
7630/** Logs System UI bubbles event changed.
7631 *
7632 * Logged from:
7633 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7634 */
7635message BubbleUIChanged {
7636
7637 // The app package that is posting the bubble.
7638 optional string package_name = 1;
7639
7640 // The notification channel that is posting the bubble.
7641 optional string notification_channel = 2;
7642
7643 // The notification id associated with the posted bubble.
7644 optional int32 notification_id = 3;
7645
7646 // The position of the bubble within the bubble stack.
7647 optional int32 position = 4;
7648
7649 // The total number of bubbles within the bubble stack.
7650 optional int32 total_number = 5;
7651
7652 // User interactions with the bubble.
7653 enum Action {
7654 UNKNOWN = 0;
7655 POSTED = 1;
7656 UPDATED = 2;
7657 EXPANDED = 3;
7658 COLLAPSED = 4;
7659 DISMISSED = 5;
7660 STACK_DISMISSED = 6;
7661 STACK_MOVED = 7;
7662 HEADER_GO_TO_APP = 8;
7663 HEADER_GO_TO_SETTINGS = 9;
7664 PERMISSION_OPT_IN = 10;
7665 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007666 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007667 SWIPE_LEFT = 13;
7668 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007669 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007670 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007671 }
7672 optional Action action = 6;
7673
7674 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7675 optional float normalized_x_position = 7;
7676 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007677
7678 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7679 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007680
7681 // Whether the bubble is an on-going one.
7682 optional bool is_ongoing = 10;
7683
7684 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007685 // This is deprecated and the value should be ignored.
7686 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007687}
Kweku Adams8845d012018-12-11 20:06:45 -08007688
7689/**
Steven Wu552f63f2019-02-05 13:41:36 -05007690 * Logs System UI bubbles developer errors.
7691 *
7692 * Logged from:
7693 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7694 */
7695message BubbleDeveloperErrorReported {
7696
7697 // The app package that is posting the bubble.
7698 optional string package_name = 1;
7699
7700 // Bubble developer error type enums.
7701 enum Error {
7702 UNKNOWN = 0;
7703 ACTIVITY_INFO_MISSING = 1;
7704 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7705 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7706 }
7707 optional Error error = 2 [default = UNKNOWN];
7708}
7709
7710/**
Kweku Adams8845d012018-12-11 20:06:45 -08007711 * Logs that a constraint for a scheduled job has changed.
7712 *
7713 * Logged from:
7714 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7715 */
7716message ScheduledJobConstraintChanged {
7717 repeated AttributionNode attribution_node = 1;
7718
7719 // Name of the job.
7720 optional string job_name = 2;
7721
7722 optional com.android.server.job.ConstraintEnum constraint = 3;
7723
7724 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007725 UNKNOWN = 0;
7726 UNSATISFIED = 1;
7727 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007728 }
7729 optional State state = 4;
7730}
Alex Salod7c3eef2019-01-25 14:43:27 -08007731
7732/**
7733 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7734 * returns true.
7735 *
7736 * Logged from:
7737 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7738 */
7739message ScreenTimeoutExtensionReported {
7740 // Describes how many times in a row did the power manager reset the screen off timeout.
7741 optional uint32 consecutive_timeout_extended_count = 1;
7742}
Hui Yu885aca12019-01-10 17:11:34 -08007743
7744/*
7745* Logs number of milliseconds it takes to start a process.
7746* The definition of app process start time is from the app launch time to
7747* the time that Zygote finished forking the app process and loaded the
7748* application package's java classes.
7749
7750* This metric is different from AppStartOccurred which is for foreground
7751* activity only.
7752
7753* ProcessStartTime can report all processes (both foreground and background)
7754* start time.
7755*
7756* Logged from:
7757* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7758*/
7759message ProcessStartTime {
7760 // The uid of the ProcessRecord.
7761 optional int32 uid = 1 [(is_uid) = true];
7762
7763 // The process pid.
7764 optional int32 pid = 2;
7765
7766 // The process name.
7767 // Usually package name, "system" for system server.
7768 // Provided by ActivityManagerService.
7769 optional string process_name = 3;
7770
7771 enum StartType {
7772 UNKNOWN = 0;
7773 WARM = 1;
7774 HOT = 2;
7775 COLD = 3;
7776 }
7777
7778 // The start type.
7779 optional StartType type = 4;
7780
7781 // The elapsed realtime at the start of the process.
7782 optional int64 process_start_time_millis = 5;
7783
7784 // Number of milliseconds it takes to reach bind application.
7785 optional int32 bind_application_delay_millis = 6;
7786
7787 // Number of milliseconds it takes to finish start of the process.
7788 optional int32 process_start_delay_millis = 7;
7789
7790 // hostingType field in ProcessRecord, the component type such as "activity",
7791 // "service", "content provider", "broadcast" or other strings.
7792 optional string hosting_type = 8;
7793
7794 // hostingNameStr field in ProcessRecord. The component class name that runs
7795 // in this process.
7796 optional string hosting_name = 9;
7797}
7798
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007799/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007800 * Track Media Codec usage
7801 * Logged from:
7802 * frameworks/av/media/libstagefright/MediaCodec.cpp
7803 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7804 */
7805message MediametricsCodecReported {
7806 optional int64 timestamp_nanos = 1;
7807 optional string package_name = 2;
7808 optional int64 package_version_code = 3;
7809 optional int64 media_apex_version = 4;
7810
7811 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7812}
7813
7814/**
7815 * Track Media Extractor (pulling video/audio streams out of containers) usage
7816 * Logged from:
7817 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7818 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7819 */
7820message MediametricsExtractorReported {
7821 optional int64 timestamp_nanos = 1;
7822 optional string package_name = 2;
7823 optional int64 package_version_code = 3;
7824 optional int64 media_apex_version = 4;
7825
7826 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7827}
7828
7829/**
7830 * Track how we arbitrate between microphone/input requests.
7831 * Logged from
7832 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7833 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7834 */
7835message MediametricsAudiopolicyReported {
7836 optional int64 timestamp_nanos = 1;
7837 optional string package_name = 2;
7838 optional int64 package_version_code = 3;
7839 optional int64 media_apex_version = 4;
7840
7841 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7842}
7843
7844/**
7845 * Track how we arbitrate between microphone requests.
7846 * Logged from
7847 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7848 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7849 */
7850message MediametricsAudiorecordReported {
7851 optional int64 timestamp_nanos = 1;
7852 optional string package_name = 2;
7853 optional int64 package_version_code = 3;
7854 optional int64 media_apex_version = 4;
7855
7856 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7857}
7858
7859/**
7860 * Track how we arbitrate between microphone/input requests.
7861 * Logged from
7862 * frameworks/av/media/libnblog/ReportPerformance.cpp
7863 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7864 */
7865message MediametricsAudiothreadReported {
7866 optional int64 timestamp_nanos = 1;
7867 optional string package_name = 2;
7868 optional int64 package_version_code = 3;
7869 optional int64 media_apex_version = 4;
7870
7871 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7872}
7873
7874/**
7875 * Track how we arbitrate between microphone/input requests.
7876 * Logged from
7877 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7878 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7879 */
7880message MediametricsAudiotrackReported {
7881 optional int64 timestamp_nanos = 1;
7882 optional string package_name = 2;
7883 optional int64 package_version_code = 3;
7884 optional int64 media_apex_version = 4;
7885
7886 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7887}
7888
7889/**
7890 * Track information about DRM framework performance
7891 * Logged from
7892 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7893 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7894 */
7895message MediametricsMediadrmReported {
7896 optional int64 timestamp_nanos = 1;
7897 optional string package_name = 2;
7898 optional int64 package_version_code = 3;
7899 optional int64 media_apex_version = 4;
7900
7901 // vendor+description tell about which DRM plugin is in use on this device
7902 optional string vendor = 5;
7903 optional string description = 6;
7904 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7905 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7906}
7907
7908/**
7909 * Track information about the widevine DRM plugin performance
7910 * Logged from
7911 * vendor/widevine/libwvdrmengine/cdm/metrics
7912 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7913 */
7914message MediametricsDrmWidevineReported {
7915 optional int64 timestamp_nanos = 1;
7916 optional string package_name = 2;
7917 optional int64 package_version_code = 3;
7918 optional int64 media_apex_version = 4;
7919
7920 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7921}
7922
7923/**
7924 * Track information about recordings (e.g. camcorder)
7925 * Logged from
7926 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7927 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7928 */
7929message MediametricsRecorderReported {
7930 optional int64 timestamp_nanos = 1;
7931 optional string package_name = 2;
7932 optional int64 package_version_code = 3;
7933 optional int64 media_apex_version = 4;
7934
7935 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7936}
7937
7938/**
7939 * Track Media Player usage
7940 * Logged from:
7941 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7942 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7943 */
7944message MediametricsNuPlayerReported {
7945 optional int64 timestamp_nanos = 1;
7946 optional string package_name = 2;
7947 optional int64 package_version_code = 3;
7948 optional int64 media_apex_version = 4;
7949
7950 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7951}
7952
7953/**
Robert Shiha4beed32019-08-19 14:15:23 -07007954 * Track Legacy DRM usage
7955 * Logged from
7956 * frameworks/av/drm/drmserver/DrmManager.cpp
7957 */
7958message MediametricsDrmManagerReported {
7959 optional int64 timestamp_nanos = 1;
7960 optional string package_name = 2;
7961 optional int64 package_version_code = 3;
7962 optional int64 media_apex_version = 4;
7963
7964 enum Method {
7965 METHOD_NOT_FOUND = -1;
7966 GET_CONSTRAINTS = 0;
7967 GET_METADATA = 1;
7968 CAN_HANDLE = 2;
7969 PROCESS_DRM_INFO = 3;
7970 ACQUIRE_DRM_INFO = 4;
7971 SAVE_RIGHTS = 5;
7972 GET_ORIGINAL_MIME_TYPE = 6;
7973 GET_DRM_OBJECT_TYPE = 7;
7974 CHECK_RIGHTS_STATUS = 8;
7975 REMOVE_RIGHTS = 9;
7976 REMOVE_ALL_RIGHTS = 10;
7977 OPEN_CONVERT_SESSION = 11;
7978 OPEN_DECRYPT_SESSION = 12;
7979 }
7980
7981 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7982 optional string plugin_id = 5;
7983 optional string description = 6;
7984 optional Method method = 7;
7985 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007986
7987 optional int64 get_constraints_count = 9;
7988 optional int64 get_metadata_count = 10;
7989 optional int64 can_handle_count = 11;
7990 optional int64 process_drm_info_count = 12;
7991 optional int64 acquire_drm_info_count = 13;
7992 optional int64 save_rights_count = 14;
7993 optional int64 get_original_mime_type_count = 15;
7994 optional int64 get_drm_object_type_count = 16;
7995 optional int64 check_rights_status_count = 17;
7996 optional int64 remove_rights_count = 18;
7997 optional int64 remove_all_rights_count = 19;
7998 optional int64 open_convert_session_count = 20;
7999 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07008000}
8001
8002/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008003 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008004 * Pulled from: StatsCompanionService
8005*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008006message DangerousPermissionState {
8007 // Name of the permission
8008 optional string permission_name = 1;
8009
8010 // Uid of the package
8011 optional int32 uid = 2 [(is_uid) = true];
8012
8013 // Package requesting the permission
8014 optional string package_name = 3;
8015
8016 // If the permission is granted to the uid
8017 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01008018
8019 // Permission flags as per android.content.pm.PermissionFlags
8020 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008021}
8022
Michael Groover4a0ca942019-01-24 17:41:25 -08008023/**
8024 * Logs when a package is denied access to a device identifier based on the new access requirements.
8025 *
8026 * Logged from:
8027 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
8028 */
8029message DeviceIdentifierAccessDenied {
8030 // The name of the package denied access to the requested device identifier.
8031 optional string package_name = 1;
8032
8033 // The name of the device identifier method the package attempted to invoke.
8034 optional string method_name = 2;
8035
8036 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08008037 // Starting from Android 11, this boolean is not set and will always be false.
8038 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008039
8040 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08008041 // Starting from Android 11, this boolean is not set and will always be false.
8042 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008043}
Chenjie Yue13f44a2019-02-07 17:51:38 -08008044
8045/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08008046 * Pulls the ongoing mainline install train version code.
8047 * Pulled from StatsCompanionService
8048 */
8049message TrainInfo {
8050 optional int64 train_version_code = 1;
8051
8052 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008053
8054 optional string train_name = 3;
8055
8056 enum Status {
8057 UNKNOWN = 0;
8058 INSTALL_REQUESTED = 1;
8059 INSTALL_STARTED = 2;
8060 INSTALL_STAGED_NOT_READY = 3;
8061 INSTALL_STAGED_READY = 4;
8062 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07008063 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
8064 // and INSTALL_FAILURE_COMMIT.
8065 INSTALL_FAILURE = 6 [deprecated = true];
8066 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008067 INSTALL_CANCELLED = 7;
8068 INSTALLER_ROLLBACK_REQUESTED = 8;
8069 INSTALLER_ROLLBACK_INITIATED = 9;
8070 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
8071 INSTALLER_ROLLBACK_STAGED = 11;
8072 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
8073 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
8074 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
8075 INSTALLER_ROLLBACK_SUCCESS = 15;
8076 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07008077 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
8078 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
8079 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
8080 INSTALL_STAGED_CANCEL_REQUESTED = 20;
8081 INSTALL_STAGED_CANCEL_SUCCESS = 21;
8082 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07008083 INSTALL_FAILURE_DOWNLOAD = 23;
8084 INSTALL_FAILURE_STATE_MISMATCH = 24;
8085 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08008086 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008087 }
8088 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08008089}
joshmccloskey8c3322e2019-01-09 18:25:57 -08008090
8091/**
8092 * Logs the gesture stage changed event.
8093 *
8094 * Logged from:
8095 * frameworks/base/packages/SystemUI/
8096 */
8097message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008098 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008099}
8100
8101/**
8102 * Logs the feedback type.
8103 *
8104 * Logged from:
8105 * frameworks/base/packages/SystemUI/
8106 */
8107message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008108 // Whether or not the gesture was used.
8109 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008110}
8111
8112/**
8113 * Logs the progress.
8114 *
8115 * Logged from:
8116 * frameworks/base/packages/SystemUI/
8117 */
8118message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008119 // [0,100] progress for the assist gesture.
8120 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008121}
Neil Fullerdb14b482019-02-05 19:44:44 +00008122
8123/*
8124 * Information about the time zone data on a device.
8125 */
8126message TimeZoneDataInfo {
8127 // A version identifier for the data set on device. e.g. "2018i"
8128 optional string tzdb_version = 1;
8129}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008130
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008131/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008132 * Logs the GPU stats global health information.
8133 *
8134 * Logged from:
8135 * frameworks/native/services/gpuservice/gpustats/
8136 */
8137message GpuStatsGlobalInfo {
8138 // Package name of the gpu driver.
8139 optional string driver_package_name = 1;
8140
8141 // Version name of the gpu driver.
8142 optional string driver_version_name = 2;
8143
8144 // Version code of the gpu driver.
8145 optional int64 driver_version_code = 3;
8146
8147 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
8148 optional int64 driver_build_time = 4;
8149
8150 // Total count of the gl driver gets loaded.
8151 optional int64 gl_loading_count = 5;
8152
8153 // Total count of the gl driver fails to be loaded.
8154 optional int64 gl_loading_failure_count = 6;
8155
8156 // Total count of the Vulkan driver gets loaded.
8157 optional int64 vk_loading_count = 7;
8158
8159 // Total count of the Vulkan driver fails to be loaded.
8160 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07008161
8162 // Api version of the system Vulkan driver.
8163 optional int32 vulkan_version = 9;
8164
8165 // Api version of the system CPU Vulkan driver.
8166 optional int32 cpu_vulkan_version = 10;
8167
8168 // Api version of the system GLES driver.
8169 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008170
8171 // Total count of the angle driver gets loaded.
8172 optional int64 angle_loading_count = 12;
8173
8174 // Total count of the angle driver fails to be loaded.
8175 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008176}
8177
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008178/**
8179 * GPU driver loading time info.
8180 */
8181message GpuDriverLoadingTime {
8182 // List of all the driver loading times for this app. The list size is
8183 // capped at 50.
8184 repeated int64 driver_loading_time = 1;
8185}
8186
8187/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008188 * Logs the GPU stats per app health information.
8189 *
8190 * Logged from:
8191 * frameworks/native/services/gpuservice/gpustats/
8192 */
8193message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008194 // Package name of the application that loads the gpu driver. Total number
8195 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008196 optional string app_package_name = 1;
8197
8198 // Version code of the gpu driver this app loads.
8199 optional int64 driver_version_code = 2;
8200
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008201 // gl driver loading time info.
8202 optional GpuDriverLoadingTime gl_driver_loading_time = 3
8203 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008204
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008205 // Vulkan driver loading time info.
8206 optional GpuDriverLoadingTime vk_driver_loading_time = 4
8207 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008208
8209 // Angle driver loading time info.
8210 optional GpuDriverLoadingTime angle_driver_loading_time = 5
8211 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07008212
8213 // CPU Vulkan implementation is in use.
8214 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07008215
8216 // App is not doing pre-rotation correctly.
8217 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08008218
8219 // App creates GLESv1 context.
8220 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008221}
Rafal Slawikd4e87572019-03-12 13:08:38 +00008222
8223/*
8224 * Logs the size of the system ion heap.
8225 *
8226 * Pulled from StatsCompanionService.
8227 */
8228message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008229 // Deprecated due to limited support of ion stats in debugfs.
8230 // Use `IonHeapSize` instead.
8231 option deprecated = true;
8232
Rafal Slawikd4e87572019-03-12 13:08:38 +00008233 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008234 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00008235 optional int64 size_in_bytes = 1;
8236}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008237
Rafal Slawik77987ed2019-06-17 12:28:23 +01008238/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008239 * Logs the total size of the ion heap.
8240 *
8241 * Pulled from StatsCompanionService.
8242 */
8243message IonHeapSize {
8244 // Total size of all ion heaps in kilobytes.
8245 // Read from: /sys/kernel/ion/total_heaps_kb.
8246 optional int32 total_size_kb = 1;
8247}
8248
8249/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01008250 * Logs the per-process size of the system ion heap.
8251 *
8252 * Pulled from StatsCompanionService.
8253 */
8254message ProcessSystemIonHeapSize {
8255 // The uid if available. -1 means not available.
8256 optional int32 uid = 1 [(is_uid) = true];
8257
8258 // The process name (from /proc/PID/cmdline).
8259 optional string process_name = 2;
8260
8261 // Sum of sizes of all allocations.
8262 optional int32 total_size_in_kilobytes = 3;
8263
8264 // Number of allocations.
8265 optional int32 allocation_count = 4;
8266
8267 // Size of the largest allocation.
8268 optional int32 max_size_in_kilobytes = 5;
8269}
8270
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008271/**
8272 * Push network stack events.
8273 *
8274 * Log from:
8275 * frameworks/base/packages/NetworkStack/
8276 */
8277message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008278 // The id that indicates the event reported from NetworkStack.
8279 optional int32 event_id = 1;
8280 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008281 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8282}
Carmen Agimofa769c152019-03-04 14:39:14 +00008283
8284/**
8285 * Logs the apps that are installed on the external storage.
8286 * Pulled from:
8287 * StatsCompanionService
8288 */
8289message AppsOnExternalStorageInfo {
8290 // The type of the external storage.
8291 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8292 // The name of the package that is installed on the external storage.
8293 optional string package_name = 2;
8294}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008295
8296/**
8297 * Logs the settings related to Face.
8298 * Logged from:
8299 * frameworks/base/services/core/java/com/android/server/stats
8300 */
8301message FaceSettings {
8302 // Whether or not face unlock is allowed on Keyguard.
8303 optional bool unlock_keyguard_enabled = 1;
8304 // Whether or not face unlock dismisses the Keyguard.
8305 optional bool unlock_dismisses_keyguard = 2;
8306 // Whether or not face unlock requires attention.
8307 optional bool unlock_attention_required = 3;
8308 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8309 optional bool unlock_app_enabled = 4;
8310 // Whether or not face unlock always requires user confirmation.
8311 optional bool unlock_always_require_confirmation = 5;
8312 // Whether or not a diverse set of poses are required during enrollment.
8313 optional bool unlock_diversity_required = 6;
8314}
Maggie White442b6312019-04-05 16:26:44 -07008315
8316/**
8317 * Logs cooling devices maintained by the kernel.
8318 *
8319 * Pulled from StatsCompanionService.java
8320 */
8321message CoolingDevice {
8322 // The type of cooling device being reported. Eg. CPU, GPU...
8323 optional android.os.CoolingTypeEnum device_location = 1;
8324 // The name of the cooling device source. Eg. CPU0
8325 optional string device_name = 2;
8326 // Current throttle state of the cooling device. The value can any unsigned
8327 // integer between 0 and max_state defined in its driver. 0 means device is
8328 // not in throttling, higher value means deeper throttling.
8329 optional int32 state = 3;
8330}
Ben Blount763a5d52019-04-10 11:48:58 -07008331
8332/**
8333 * Intelligence has several counter-type events that don't warrant a
8334 * full separate atom. These are primarily API call counters but also include
8335 * counters for feature usage and specific failure modes.
8336 *
8337 * Logged from the Intelligence mainline module.
8338 */
8339message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008340 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008341 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008342 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008343 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008344 // How many times the event occured (to report a batch of high frequency events).
8345 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008346 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008347 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008348}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008349
8350/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008351 * Logs when Car Power state changed.
8352 *
8353 * Logged from:
8354 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8355 */
8356message CarPowerStateChanged {
8357 // States come from CpmsState in CarPowerManagementService.java.
8358 enum State {
8359 WAIT_FOR_VHAL = 0;
8360 ON = 1;
8361 SHUTDOWN_PREPARE = 2;
8362 WAIT_FOR_FINISH = 3;
8363 SUSPEND = 4;
8364 SIMULATE_SLEEP = 5;
8365 }
8366 optional State state = 1;
8367}
8368
8369/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008370 * Logs when Car User Hal is requested to switch/create/remove user.
8371 *
8372 * Logged from:
8373 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8374 */
8375message CarUserHalModifyUserRequestReported {
8376 // Request id for the request.
8377 optional int32 request_id = 1;
8378 // Request type.
8379 enum RequestType {
8380 UNKNOWN = 0;
8381 // Car user manager requested user switch.
8382 SWITCH_REQUEST_ANDROID = 1;
8383 // OEM requested User switch.
8384 SWITCH_REQUEST_OEM = 2;
8385 // Hal switch requested after android switch using activity manager.
8386 SWITCH_REQUEST_LEGACY = 3;
8387 // Create User
8388 CREATE_REQUEST = 4;
8389 // Remove User
8390 REMOVE_REQUEST = 5;
8391 }
8392 optional RequestType request_type = 2;
8393 // Android User id of the current user which can only be 0, 10, 11 and so on.
8394 // -1 if not available.
8395 optional int32 user_id = 3;
8396 // VHAL flags of the current user. (-1 if not available)
8397 optional int32 user_flags = 4;
8398 // Android User id of the target user for switch/create/remove. It can only
8399 // be 0, 10, 11 and so on. -1 if not available.
8400 optional int32 target_user_id = 5;
8401 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8402 optional int32 target_user_flags = 6;
8403 // Request timeout Milliseconds (-1 if not available)
8404 optional int32 timeout_millis = 7;
8405}
8406
8407/**
8408 * Logs when Car User Hal responds to switch/create user request.
8409 *
8410 * Logged from:
8411 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8412 */
8413message CarUserHalModifyUserResponseReported {
8414 // Request id of the request associated with the response.
8415 optional int32 request_id = 1;
8416 // Car user hal callback status.
8417 enum CallbackStatus {
8418 UNKNOWN = 0;
8419 // Hal response was invalid.
8420 INVALID = 1;
8421 // Hal response was ok.
8422 OK = 2;
8423 // Hal timeout during set call.
8424 HAL_SET_TIMEOUT = 3;
8425 // Hal response timeout.
8426 HAL_RESPONSE_TIMEOUT = 4;
8427 // Hal responded with wrong info.
8428 WRONG_HAL_RESPONSE = 5;
8429 // Hal is processing multiple requests simultaneously.
8430 CONCURRENT_OPERATION = 6;
8431 }
8432 optional CallbackStatus callback_status = 2;
8433
8434 // Hal request status for user switch/create/remove.
8435 enum HalRequestStatus {
8436 UNSPECIFIED = 0;
8437 // Hal request for user switch/create is successful.
8438 SUCCESS = 1;
8439 // Hal request for user switch/create failed.
8440 FAILURE = 2;
8441 }
8442 optional HalRequestStatus request_status = 3;
8443}
8444
8445/**
8446 * Logs when post switch response is posted to Car User Hal.
8447 *
8448 * Logged from:
8449 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8450 */
8451message CarUserHalPostSwitchResponseReported {
8452 // Request id.
8453 optional int32 request_id = 1;
8454
8455 // Android user switch status.
8456 enum UserSwitchStatus {
8457 UNKNOWN = 0;
8458 // Android user switch is successful.
8459 SUCCESS = 1;
8460 // Android user switch failed.
8461 FAILURE = 2;
8462 }
8463 optional UserSwitchStatus switch_status = 2;
8464}
8465
8466/**
8467 * Logs when initial user information is requested from Car User Hal.
8468 *
8469 * Logged from:
8470 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8471 */
8472message CarUserHalInitialUserInfoRequestReported {
8473 // Request id for the request.
8474 optional int32 request_id = 1;
8475
8476 // Request type for initial user information.
8477 enum InitialUserInfoRequestType {
8478 UNKNOWN = 0;
8479 // At the first time Android was booted (or after a factory reset).
8480 FIRST_BOOT = 1;
8481 // At the first time Android was booted after the system was updated.
8482 FIRST_BOOT_AFTER_OTA = 2;
8483 // When Android was booted "from scratch".
8484 COLD_BOOT = 3;
8485 // When Android was resumed after the system was suspended to memory.
8486 RESUME = 4;
8487 }
8488 optional InitialUserInfoRequestType request_type = 2;
8489 // Request timeout Milliseconds (-1 if not available)
8490 optional int32 timeout_millis = 3;
8491}
8492
8493/**
8494 * Logs when Car User Hal responds to initial user information requests.
8495 *
8496 * Logged from:
8497 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8498 */
8499message CarUserHalInitialUserInfoResponseReported {
8500 // Request id of the request associated with the response.
8501 optional int32 request_id = 1;
8502 // Car user hal callback status.
8503 enum CallbackStatus {
8504 UNKNOWN = 0;
8505 // Hal response was invalid.
8506 INVALID = 1;
8507 // Hal response was ok.
8508 OK = 2;
8509 // Hal timeout during set call.
8510 HAL_SET_TIMEOUT = 3;
8511 // Hal response timeout.
8512 HAL_RESPONSE_TIMEOUT = 4;
8513 // Hal responded with wrong info.
8514 WRONG_HAL_RESPONSE = 5;
8515 // Hal is processing multiple requests simultaneously.
8516 CONCURRENT_OPERATION = 6;
8517 }
8518 optional CallbackStatus callback_status = 2;
8519 // Response for initial user information request.
8520 enum InitialUserInfoResponseAction {
8521 UNSPECIFIED = 0;
8522 // Let the Android System decide what to do.
8523 DEFAULT = 1;
8524 // Switch to an existing Android user.
8525 SWITCH = 2;
8526 // Create a new Android user (and switch to it).
8527 CREATE = 3;
8528 }
8529 optional InitialUserInfoResponseAction response_action = 3;
8530 // Android User id of the target user which can only be 0, 10, 11 and so on.
8531 // -1 if not available.
8532 optional int32 target_user = 4;
8533 // VHAL flags of the current user. (-1 if not available)
8534 optional int32 target_user_flags = 5;
8535 // User locales
8536 optional string user_locales = 6;
8537}
8538
8539/**
8540 * Logs when set user association is requested from Car User Hal.
8541 *
8542 * Logged from:
8543 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8544 */
8545message CarUserHalUserAssociationRequestReported {
8546 // Request id for the request.
8547 optional int32 request_id = 1;
8548 // Request type.
8549 enum RequestType {
8550 UNKNOWN = 0;
8551 // For setting user association information.
8552 SET = 1;
8553 // For getting user association information.
8554 GET = 2;
8555 }
8556 optional RequestType request_type = 2;
8557 // Android User id of the current user which can only be 0, 10, 11 and so on.
8558 // -1 if not available.
8559 optional int32 current_user_id = 3;
8560 // VHAL flags of the current user. (-1 if not available)
8561 optional int32 current_user_flags = 4;
8562 // Number of the set associations requested.
8563 optional int32 number_associations = 5;
8564 // Concatenated string for the types from set associations request.
8565 // This is a string converted from an array of integers.
8566 optional string user_identification_association_types = 6;
8567 // Concatenated string for the values from set associations request.
8568 // This is a string converted from an array of integers.
8569 optional string user_identification_association_values = 7;
8570}
8571
8572/**
8573 * Logs when Car User Hal responds to set user association requests.
8574 *
8575 * Logged from:
8576 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8577 */
8578message CarUserHalSetUserAssociationResponseReported {
8579 // Request id of the request associated with the response.
8580 optional int32 request_id = 1;
8581 // Car user hal callback status.
8582 enum CallbackStatus {
8583 UNKNOWN = 0;
8584 // Hal response was invalid.
8585 INVALID = 1;
8586 // Hal response was ok.
8587 OK = 2;
8588 // Hal timeout during set call.
8589 HAL_SET_TIMEOUT = 3;
8590 // Hal response timeout.
8591 HAL_RESPONSE_TIMEOUT = 4;
8592 // Hal responded with wrong info.
8593 WRONG_HAL_RESPONSE = 5;
8594 // Hal is processing multiple requests simultaneously.
8595 CONCURRENT_OPERATION = 6;
8596 }
8597 optional CallbackStatus callback_status = 2;
8598 // Number of the set associations in the response.
8599 optional int32 number_associations = 3;
8600 // Concatenated string for the types from set associations request.
8601 // This is a string converted from an array of integers.
8602 optional string user_identification_association_types = 4;
8603 // Concatenated string for the values from set associations request.
8604 // This is a string converted from an array of integers.
8605 optional string user_identification_association_values = 5;
8606}
8607
8608/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008609 * Logs whether GarageMode is entered.
8610 *
8611 * Logged from:
8612 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8613 */
8614message GarageModeInfo {
8615 // Whether GarageMode is entered.
8616 optional bool is_garage_mode = 1;
8617}
Martijn Coenencd95d462019-04-25 17:09:45 +02008618
8619/**
8620 * Historical app ops data per package.
8621 */
8622message AppOps {
8623 // Uid of the package requesting the op
8624 optional int32 uid = 1 [(is_uid) = true];
8625
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008626 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008627 optional string package_name = 2;
8628
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008629 // operation id
8630 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008631
8632 // The number of times the op was granted while the app was in the
8633 // foreground (only for trusted requests)
8634 optional int64 trusted_foreground_granted_count = 4;
8635
8636 // The number of times the op was granted while the app was in the
8637 // background (only for trusted requests)
8638 optional int64 trusted_background_granted_count = 5;
8639
8640 // The number of times the op was rejected while the app was in the
8641 // foreground (only for trusted requests)
8642 optional int64 trusted_foreground_rejected_count = 6;
8643
8644 // The number of times the op was rejected while the app was in the
8645 // background (only for trusted requests)
8646 optional int64 trusted_background_rejected_count = 7;
8647
8648 // For long-running operations, total duration of the operation
8649 // while the app was in the foreground (only for trusted requests)
8650 optional int64 trusted_foreground_duration_millis = 8;
8651
8652 // For long-running operations, total duration of the operation
8653 // while the app was in the background (only for trusted requests)
8654 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008655
8656 // Whether AppOps is guarded by Runtime permission
8657 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008658}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008659
8660/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008661 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008662 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008663message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008664 // Uid of the package requesting the op
8665 optional int32 uid = 1 [(is_uid) = true];
8666
8667 // Name of the package performing the op
8668 optional string package_name = 2;
8669
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008670 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8671 // Attributions must be provided through manifest using <attribution> tag available in R and
8672 // above.
8673 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008674
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008675 // operation id
8676 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008677
8678 // The number of times the op was granted while the app was in the
8679 // foreground (only for trusted requests)
8680 optional int64 trusted_foreground_granted_count = 5;
8681
8682 // The number of times the op was granted while the app was in the
8683 // background (only for trusted requests)
8684 optional int64 trusted_background_granted_count = 6;
8685
8686 // The number of times the op was rejected while the app was in the
8687 // foreground (only for trusted requests)
8688 optional int64 trusted_foreground_rejected_count = 7;
8689
8690 // The number of times the op was rejected while the app was in the
8691 // background (only for trusted requests)
8692 optional int64 trusted_background_rejected_count = 8;
8693
8694 // For long-running operations, total duration of the operation
8695 // while the app was in the foreground (only for trusted requests)
8696 optional int64 trusted_foreground_duration_millis = 9;
8697
8698 // For long-running operations, total duration of the operation
8699 // while the app was in the background (only for trusted requests)
8700 optional int64 trusted_background_duration_millis = 10;
8701
8702 // Whether AppOps is guarded by Runtime permission
8703 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008704
8705 // Sampling rate used on device, from 0 to 100
8706 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008707}
8708
8709/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008710 * Location Manager API Usage information(e.g. API under usage,
8711 * API call's parameters).
8712 * Logged from:
8713 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8714 */
8715message LocationManagerApiUsageReported {
8716
8717 // Indicating if usage starts or usage ends.
8718 optional android.stats.location.UsageState state = 1;
8719
8720 // LocationManagerService's API in use.
8721 // We can identify which API from LocationManager is
8722 // invoking current LMS API by the combination of
8723 // API parameter(e.g. is_listener_null, is_intent_null,
8724 // is_location_request_null)
8725 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8726
8727 // Name of the package calling the API.
8728 optional string calling_package_name = 3;
8729
8730 // Type of the location provider.
8731 optional android.stats.location.ProviderType provider = 4;
8732
8733 // Quality of the location request
8734 optional android.stats.location.LocationRequestQuality quality = 5;
8735
8736 // The desired interval for active location updates, in milliseconds.
8737 // Bucketized to reduce cardinality.
8738 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8739
8740 // Minimum distance between location updates, in meters.
8741 // Bucketized to reduce cardinality.
8742 optional android.stats.location.SmallestDisplacementBucket
8743 bucketized_smallest_displacement = 7;
8744
8745 // The number of location updates.
8746 optional int64 num_updates = 8;
8747
8748 // The request expiration time, in millisecond since boot.
8749 // Bucketized to reduce cardinality.
8750 optional android.stats.location.ExpirationBucket
8751 bucketized_expire_in = 9;
8752
8753 // Type of Callback passed in for this API.
8754 optional android.stats.location.CallbackType callback_type = 10;
8755
8756 // The radius of the central point of the alert
8757 // region, in meters. Only for API REQUEST_GEOFENCE.
8758 // Bucketized to reduce cardinality.
8759 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8760
8761 // Activity Importance of API caller.
8762 // Categorized to 3 types that are interesting from location's perspective.
8763 optional android.stats.location.ActivityImportance activiy_importance = 12;
8764}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008765
8766/**
8767 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8768 */
8769message ReviewPermissionsFragmentResultReported {
8770 // unique value identifying a permission group change. A permission group change might result
8771 // in multiple of these atoms
8772 optional int64 change_id = 1;
8773
8774 // UID of package the permission belongs to
8775 optional int32 uid = 2 [(is_uid) = true];
8776
8777 // Name of package the permission belongs to
8778 optional string package_name = 3;
8779
8780 // The permission to be granted
8781 optional string permission_name = 4;
8782
8783 // The result of the permission grant
8784 optional bool permission_granted = 5;
8785}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008786
8787/**
8788* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8789* Logged from: RuntimePermissionUpdgradeController
8790*/
8791message RuntimePermissionsUpgradeResult {
8792 // Permission granted as result of upgrade
8793 optional string permission_name = 1;
8794
8795 // UID of package granted permission
8796 optional int32 uid = 2 [(is_uid) = true];
8797
8798 // Name of package granted permission
8799 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008800}
8801
8802/**
8803* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8804*/
8805message GrantPermissionsActivityButtonActions {
8806 // Permission granted as result of upgrade
8807 optional string permission_group_name = 1;
8808
8809 // UID of package granted permission
8810 optional int32 uid = 2 [(is_uid) = true];
8811
8812 // Name of package requesting permission
8813 optional string package_name = 3;
8814
8815 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8816 // LABEL_ constants in GrantPermissionActivity.java
8817 optional int32 buttons_presented = 4;
8818
8819 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8820 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008821
8822 // id which identifies single session of user interacting with permission controller
8823 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008824}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008825
8826/**
8827 * Information about LocationAccessCheck notification presented to user
8828 */
8829message LocationAccessCheckNotificationAction {
8830
8831 // id which identifies single session of user interacting with permission controller
8832 optional int64 session_id = 1;
8833
8834 // Uid of package for which location access check is presented
8835 optional int32 package_uid = 2;
8836
8837 // Name of package for which location access check is presented
8838 optional string package_name = 3;
8839
8840 enum Result {
8841 UNDEFINED = 0;
8842 // notification was presented to the user
8843 NOTIFICATION_PRESENTED = 1;
8844 // notification was declined by the user
8845 NOTIFICATION_DECLINED = 2;
8846 // notification was clicked by the user
8847 NOTIFICATION_CLICKED = 3;
8848 }
8849
8850 // View / interaction recorded
8851 optional Result result = 4;
8852}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008853
8854/**
8855 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8856 */
8857message AppPermissionFragmentActionReported {
8858 // id which identifies single session of user interacting with permission controller
8859 optional int64 session_id = 1;
8860
8861 // unique value identifying a permission group change. A permission group change might result
8862 // in multiple of these atoms
8863 optional int64 change_id = 2;
8864
8865 // UID of package the permission belongs to
8866 optional int32 uid = 3 [(is_uid) = true];
8867
8868 // Name of package the permission belongs to
8869 optional string package_name = 4;
8870
8871 // The permission to be granted
8872 optional string permission_name = 5;
8873
8874 // The result of the permission grant
8875 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008876
8877 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8878 optional int32 permission_flags = 7;
8879
8880 enum Button {
8881 UNDEFINED = 0;
8882 // Allow button
8883 ALLOW = 1;
8884 // Deny button
8885 DENY = 2;
8886 // Ask every time button
8887 ASK_EVERY_TIME = 3;
8888 // Allow all the time button
8889 ALLOW_ALWAYS = 4;
8890 // Allow only while using the app button
8891 ALLOW_FOREGROUND = 5;
8892 // Same is Deny button but shown in while in use dialog
8893 DENY_FOREGROUND = 6;
8894 }
8895
8896 // Button pressed in the dialog
8897 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008898}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008899
8900/**
8901* Information about a AppPermissionFragment viewed by user
8902*/
8903message AppPermissionFragmentViewed {
8904 // id which identifies single session of user interacting with permission controller
8905 optional int64 session_id = 1;
8906
8907 // UID of package for which permissions are viewed
8908 optional int32 uid = 2 [(is_uid) = true];
8909
8910 // Name of package for which permissions are viewed
8911 optional string package_name = 3;
8912
8913 // Permission group viewed
8914 optional string permission_group_name = 4;
8915}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008916
8917/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008918* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8919* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008920*/
8921message AppPermissionsFragmentViewed {
8922 // id which identifies single session of user interacting with permission controller
8923 optional int64 session_id = 1;
8924
8925 // id which identifies single view as every view might have several logging records
8926 // with different package information attached
8927 optional int64 view_id = 2;
8928
8929 // Permission group viewed
8930 optional string permission_group_name = 3;
8931
8932 // UID of package for which permissions are viewed
8933 optional int32 uid = 4 [(is_uid) = true];
8934
8935 // Name of package for which permissions are viewed
8936 optional string package_name = 5;
8937
8938 // Category in which permission is included
8939 enum Category {
8940 UNDEFINED = 0;
8941 ALLOWED = 1;
8942 ALLOWED_FOREGROUND = 2;
8943 DENIED = 3;
8944 }
8945 optional Category category = 6;
8946}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008947/**
8948* Information about a PermissionAppsFragment viewed by user.
8949* Logged from ui/handheld/PermissionAppsFragment.java
8950*/
8951message PermissionAppsFragmentViewed {
8952 // id which identifies single session of user interacting with permission controller
8953 optional int64 session_id = 1;
8954
8955 // id which identifies single view as every view might have several logging records
8956 // with different package information attached
8957 optional int64 view_id = 2;
8958
8959 // Permission group viewed
8960 optional string permission_group_name = 3;
8961
8962 // UID of package for which permissions are viewed
8963 optional int32 uid = 4 [(is_uid) = true];
8964
8965 // Name of package for which permissions are viewed
8966 optional string package_name = 5;
8967
8968 // Category in which app is included
8969 enum Category {
8970 UNDEFINED = 0;
8971 ALLOWED = 1;
8972 ALLOWED_FOREGROUND = 2;
8973 DENIED = 3;
8974 }
8975 optional Category category = 6;
8976}
Tony Make2b1b672019-07-29 16:59:47 +01008977
8978/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008979* Log that the Auto Revoke notification has been clicked
8980* Logged from ui/ManagePermissionsActivity
8981*/
8982message AutoRevokeNotificationClicked {
8983 // id which identifies single session of user interacting with permission controller
8984 optional int64 session_id = 1;
8985}
8986
8987/**
8988* Log that an app has been displayed on the auto revoke page, and lists one permission that was
8989* auto revoked for it.
8990* Logged from ui/handheld/AutoRevokeFragment
8991*/
8992message AutoRevokeFragmentAppViewed {
8993 // id which identifies single session of user interacting with permission controller
8994 optional int64 session_id = 1;
8995
8996 // UID of package for which permissions are viewed
8997 optional int32 uid = 2 [(is_uid) = true];
8998
8999 // Name of package for which permissions are viewed
9000 optional string package_name = 3;
9001
9002 // The name of a permission group that has been revoked
9003 optional string permission_group_name = 4;
9004
9005 // The age of the app- more than three months old, or more than six months
9006 enum Age {
9007 UNDEFINED = 0;
9008 NEWER_BUCKET = 1;
9009 OLDER_BUCKET = 2;
9010 }
9011
9012 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
9013 optional Age age = 5;
9014}
9015
9016/**
9017* Log that the user has interacted with an app on the auto revoke fragment
9018* Logged from ui/handheld/AutoRevokeFragment
9019*/
9020message AutoRevokedAppInteraction {
9021 // id which identifies single session of user interacting with permission controller
9022 optional int64 session_id = 1;
9023
9024 // UID of package for which permissions are viewed
9025 optional int32 uid = 2 [(is_uid) = true];
9026
9027 // Name of package for which permissions are viewed
9028 optional string package_name = 3;
9029
9030 enum Action {
9031 UNDEFINED = 0;
9032 REMOVE = 1;
9033 OPEN = 2;
9034 APP_INFO = 3;
9035 PERMISSIONS = 4;
9036 REMOVE_IN_SETTINGS = 5;
9037 OPEN_IN_SETTINGS = 6;
9038 }
9039
9040 // The action the user took to interact with the app
9041 optional Action action = 4;
9042}
9043
9044/**
9045* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
9046* auto revoke, or that the auto revoke switch has been changed
9047* Logged from ui/handheld/AppPermissionGroupsFragment
9048 */
9049message AppPermissionGroupsFragmentAutoRevokeAction {
9050 // id which identifies single session of user interacting with permission controller
9051 optional int64 session_id = 1;
9052
9053 // UID of package for which permissions are viewed
9054 optional int32 uid = 2 [(is_uid) = true];
9055
9056 // Name of package for which permissions are viewed
9057 optional string package_name = 3;
9058
9059 enum Action {
9060 UNDEFINED = 0;
9061 OPENED_FOR_AUTO_REVOKE = 1;
9062 OPENED_FROM_INTENT = 2;
9063 SWITCH_ENABLED = 3;
9064 SWITCH_DISABLED = 4;
9065 }
9066
9067 // The action the user took to interact with the fragment
9068 optional Action action = 4;
9069}
9070
9071/**
Tony Make2b1b672019-07-29 16:59:47 +01009072 * Logs when there is a smart selection related event.
9073 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9074 * Logged from: TextClassifierEventLogger.java
9075 */
9076message TextSelectionEvent {
9077 // A session ID.
9078 optional string session_id = 1;
9079
9080 // Event type of this event.
9081 optional android.stats.textclassifier.EventType event_type = 2;
9082
Tony Mak9c84bd22019-12-09 07:27:25 +00009083 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009084 optional string model_name = 3;
9085
9086 // Type of widget that was involved in triggering this event.
9087 optional android.stats.textclassifier.WidgetType widget_type = 4;
9088
9089 // Index of this event in a session.
9090 optional int32 event_index = 5;
9091
9092 // Entity type that is involved.
9093 optional string entity_type = 6;
9094
9095 // Relative word index of the start of the selection.
9096 optional int32 relative_word_start_index = 7;
9097
9098 // Relative word (exclusive) index of the end of the selection.
9099 optional int32 relative_word_end_index = 8;
9100
9101 // Relative word index of the start of the smart selection.
9102 optional int32 relative_suggested_word_start_index = 9;
9103
9104 // Relative word (exclusive) index of the end of the smart selection.
9105 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009106
9107 // Name of source package.
9108 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009109
9110 // Name of the LangID model that is involved in this event.
9111 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009112}
9113
9114/**
9115 * Logs when there is a smart linkify related event.
9116 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9117 * Logged from: TextClassifierEventLogger.java
9118 */
9119message TextLinkifyEvent {
9120 // A session ID.
9121 optional string session_id = 1;
9122
9123 // Event type of this event.
9124 optional android.stats.textclassifier.EventType event_type = 2;
9125
Tony Mak9c84bd22019-12-09 07:27:25 +00009126 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009127 optional string model_name = 3;
9128
9129 // Type of widget that was involved in triggering this event.
9130 optional android.stats.textclassifier.WidgetType widget_type = 4;
9131
9132 // Index of this event in a session.
9133 optional int32 event_index = 5;
9134
9135 // Entity type that is involved.
9136 optional string entity_type = 6;
9137
9138 // Number of links detected.
9139 optional int32 num_links = 7;
9140
9141 // The total length of all links.
9142 optional int32 linked_text_length = 8;
9143
9144 // Length of input text.
9145 optional int32 text_length = 9;
9146
9147 // Time spent on generating links in ms.
9148 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009149
9150 // Name of source package.
9151 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009152
9153 // Name of the LangID model that is involved in this event.
9154 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009155}
9156
9157/**
9158 * Logs when there is a conversation actions related event.
9159 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9160 * Logged from: TextClassifierEventLogger.java
9161 */
9162message ConversationActionsEvent {
9163 // A session ID.
9164 optional string session_id = 1;
9165
9166 // Event type of this event.
9167 optional android.stats.textclassifier.EventType event_type = 2;
9168
Tony Mak9c84bd22019-12-09 07:27:25 +00009169 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009170 optional string model_name = 3;
9171
9172 // Type of widget that was involved in triggering this event.
9173 optional android.stats.textclassifier.WidgetType widget_type = 4;
9174
9175 // The first entity type that is involved.
9176 optional string first_entity_type = 5;
9177
9178 // The second entity type that is involved.
9179 optional string second_entity_type = 6;
9180
9181 // The third entity type that is involved.
9182 optional string third_entity_type = 7;
9183
9184 // The score of the first entity type.
9185 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01009186
9187 // Name of source package.
9188 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00009189
9190 // Name of the annotator model that is involved in this event.
9191 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00009192
9193 // Name of the LangID model that is involved in this event.
9194 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01009195}
9196
9197/**
9198 * Logs when there is a language detection related event.
9199 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9200 * Logged from: TextClassifierEventLogger.java
9201 */
9202message LanguageDetectionEvent {
9203 // A session ID.
9204 optional string session_id = 1;
9205
9206 // Event type of this event.
9207 optional android.stats.textclassifier.EventType event_type = 2;
9208
Tony Mak9c84bd22019-12-09 07:27:25 +00009209 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009210 optional string model_name = 3;
9211
9212 // Type of widget that was involved in triggering this event.
9213 optional android.stats.textclassifier.WidgetType widget_type = 4;
9214
9215 // Detected language.
9216 optional string language_tag = 5;
9217
9218 // Score of the detected language.
9219 optional float score = 6;
9220
9221 // Position of this action.
9222 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01009223
9224 // Name of source package.
9225 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01009226}
Tianjie Xu167c3db2019-07-22 14:25:14 -07009227
9228/**
9229 * Information about an OTA update attempt by update_engine.
9230 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9231 */
9232message UpdateEngineUpdateAttemptReported {
9233 // The number of attempts for the update engine to apply a given payload.
9234 optional int32 attempt_number = 1;
9235
9236 optional android.stats.otaupdate.PayloadType payload_type = 2;
9237
9238 // The total time in minutes for the update engine to apply a given payload.
9239 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
9240 // it's increased when the system is sleeping.
9241 optional int32 duration_boottime_in_minutes = 3;
9242
9243 // The total time in minutes for the update engine to apply a given payload.
9244 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
9245 // and it's not increased when the system is sleeping.
9246 optional int32 duration_monotonic_in_minutes = 4;
9247
9248 // The size of the payload in MiBs.
9249 optional int32 payload_size_mib = 5;
9250
9251 // The attempt result reported by the update engine for an OTA update.
9252 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
9253
9254 // The error code reported by the update engine after an OTA update attempt
9255 // on A/B devices.
9256 optional android.stats.otaupdate.ErrorCode error_code = 7;
9257
9258 // The build fingerprint of the source system. The value is read from a
9259 // system property when the device takes the update. e.g.
9260 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
9261 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01009262
9263 // Size of super partition.
9264 optional int64 super_partition_size_bytes = 9;
9265
9266 // Size of current slot within the super partition.
9267 optional int64 slot_size_bytes = 10;
9268
9269 // Free space available in the super partition.
9270 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009271}
9272
9273/**
9274 * Information about all the attempts the device make before finishing the
9275 * successful update.
9276 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9277 */
9278message UpdateEngineSuccessfulUpdateReported {
9279 // The number of attempts for the update engine to apply the payload for a
9280 // successful update.
9281 optional int32 attempt_count = 1;
9282
9283 optional android.stats.otaupdate.PayloadType payload_type = 2;
9284
9285 optional int32 payload_size_mib = 3;
9286
9287 // The total number of bytes downloaded by update_engine since the last
9288 // successful update.
9289 optional int32 total_bytes_downloaded_mib = 4;
9290
9291 // The ratio in percentage of the over-downloaded bytes compared to the
9292 // total bytes needed to successfully install the update. e.g. 200 if we
9293 // download 200MiB in total for a 100MiB package.
9294 optional int32 download_overhead_percentage = 5;
9295
9296 // The total time in minutes for the update engine to apply the payload for a
9297 // successful update.
9298 optional int32 total_duration_minutes = 6;
9299
9300 // The number of reboot of the device during a successful update.
9301 optional int32 reboot_count = 7;
9302}
Alec Mourie088e762019-07-02 13:10:55 -07009303
9304/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009305 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9306 * key to indicate whether it was successful or not.
9307 *
9308 * Logged from:
9309 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9310 */
9311message RebootEscrowRecoveryReported {
9312 optional bool successful = 1;
9313}
9314
9315/**
Alec Mourie088e762019-07-02 13:10:55 -07009316 * Global display pipeline metrics reported by SurfaceFlinger.
9317 * Pulled from:
9318 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9319 */
9320message SurfaceflingerStatsGlobalInfo {
9321 // Total number of frames presented during the tracing period
9322 optional int64 total_frames = 1;
9323 // Total number of frames missed
9324 optional int64 missed_frames = 2;
9325 // Total number of frames that fell back to client composition
9326 optional int64 client_composition_frames = 3;
9327 // Total time the display was turned on
9328 optional int64 display_on_millis = 4;
9329 // Total time that was spent performing animations.
9330 // This is derived from the present-to-present layer histogram
9331 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009332 // Total number of event connections tracked by SurfaceFlinger at the time
9333 // of this pull. If this number grows prohibitively large, then this can
9334 // cause jank due to resource contention.
9335 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009336 // Set of timings measured from when SurfaceFlinger began compositing a
9337 // frame, until the frame was requested to be presented to the display. This
9338 // measures SurfaceFlinger's total CPU walltime on the critical path per
9339 // frame.
9340 optional FrameTimingHistogram frame_duration = 7
9341 [(android.os.statsd.log_mode) = MODE_BYTES];
9342 // Set of timings measured from when SurfaceFlinger first began using the
9343 // GPU to composite a frame, until the GPU has finished compositing that
9344 // frame. This measures the total additional time SurfaceFlinger needed to
9345 // perform due to falling back into GPU composition.
9346 optional FrameTimingHistogram render_engine_timing = 8
9347 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009348}
9349
9350/**
9351 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9352 * The number of layers uploaded will be restricted due to size limitations.
9353 * Pulled from:
9354 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9355 */
9356message SurfaceflingerStatsLayerInfo {
9357 // The layer for this set of metrics
9358 // For now we can infer that the package name is included in the layer
9359 // name.
9360 optional string layer_name = 1;
9361 // Total number of frames presented
9362 optional int64 total_frames = 2;
9363 // Total number of dropped frames while latching a buffer for this layer.
9364 optional int64 dropped_frames = 3;
9365 // Set of timings measured between successive presentation timestamps.
9366 optional FrameTimingHistogram present_to_present = 4
9367 [(android.os.statsd.log_mode) = MODE_BYTES];
9368 // Set of timings measured from when an app queued a buffer for
9369 // presentation, until the buffer was actually presented to the
9370 // display.
9371 optional FrameTimingHistogram post_to_present = 5
9372 [(android.os.statsd.log_mode) = MODE_BYTES];
9373 // Set of timings measured from when a buffer is ready to be presented,
9374 // until the buffer was actually presented to the display.
9375 optional FrameTimingHistogram acquire_to_present = 6
9376 [(android.os.statsd.log_mode) = MODE_BYTES];
9377 // Set of timings measured from when a buffer was latched by
9378 // SurfaceFlinger, until the buffer was presented to the display
9379 optional FrameTimingHistogram latch_to_present = 7
9380 [(android.os.statsd.log_mode) = MODE_BYTES];
9381 // Set of timings measured from the desired presentation to the actual
9382 // presentation time
9383 optional FrameTimingHistogram desired_to_present = 8
9384 [(android.os.statsd.log_mode) = MODE_BYTES];
9385 // Set of timings measured from when an app queued a buffer for
9386 // presentation, until the buffer was ready to be presented.
9387 optional FrameTimingHistogram post_to_acquire = 9
9388 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009389 // Frames missed latch because the acquire fence didn't fire
9390 optional int64 late_acquire_frames = 10;
9391 // Frames latched early because the desired present time was bad
9392 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009393}
9394
9395/**
9396 * Histogram of frame counts bucketed by time in milliseconds.
9397 * Because of size limitations, we hard-cap the number of buckets, with
9398 * buckets for corresponding to larger milliseconds being less precise.
9399 */
9400message FrameTimingHistogram {
9401 // Timings in milliseconds that describes a set of histogram buckets
9402 repeated int32 time_millis_buckets = 1;
9403 // Number of frames that match to each time_millis, i.e. the bucket
9404 // contents
9405 // It's required that len(time_millis) == len(frame_count)
9406 repeated int64 frame_counts = 2;
9407}
Emilian Peev6729f372019-08-29 09:14:09 -07009408
Emilian Peev6729f372019-08-29 09:14:09 -07009409/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009410 * Janky event as reported by SurfaceFlinger.
9411 * This event is intended to be consumed by a Perfetto subscriber for
9412 * automated trace collection.
9413 *
9414 * Logged from:
9415 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9416 */
9417message DisplayJankReported {
9418 // Informational field for how long the janky event lasted in milliseconds
9419 optional int64 event_duration_millis = 1;
9420 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9421 // the display on time.
9422 optional int32 present_deadlines_missed = 2;
9423}
9424
9425/**
Emilian Peev6729f372019-08-29 09:14:09 -07009426 * Information about camera facing and API level usage.
9427 * Logged from:
9428 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9429 */
9430message CameraActionEvent {
9431 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009432 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009433
9434 // Camera API level used
9435 optional int32 api_level = 2;
9436
9437 // Name of client package
9438 optional string package_name = 3;
9439
9440 // Camera facing
9441 enum Facing {
9442 UNKNOWN = 0;
9443 BACK = 1;
9444 FRONT = 2;
9445 EXTERNAL = 3;
9446 }
9447 optional Facing facing = 4;
9448}
atrost01a20932019-08-28 15:40:37 +01009449
9450/**
9451 * Logs when a compatibility change is affecting an app.
9452 *
9453 * Logged from:
9454 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9455 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9456 */
9457message AppCompatibilityChangeReported {
9458 // The UID of the app being affected by the compatibilty change.
9459 optional int32 uid = 1 [(is_uid) = true];
9460
9461 // The ID of the change affecting the app.
9462 optional int64 change_id = 2;
9463
9464 enum State {
9465 UNKNOWN_STATE = 0;
9466 ENABLED = 1;
9467 DISABLED = 2;
9468 LOGGED = 3;
9469 }
9470
9471 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9472 // logged otherwise.
9473 optional State state = 3;
9474
9475 enum Source {
9476 UNKNOWN_SOURCE = 0;
9477 APP_PROCESS = 1;
9478 SYSTEM_SERVER = 2;
9479 }
9480
9481 // Where it was logged from.
9482 optional Source source = 4;
9483
9484}
Hector Dearman40579f62019-11-01 13:19:30 +00009485
9486/**
9487 * Logged from
9488 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9489 */
9490message PerfettoUploaded {
9491 enum Event {
9492 PERFETTO_UNDEFINED = 0;
9493 PERFETTO_TRACE_BEGIN = 1;
9494 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9495 PERFETTO_ON_CONNECT = 3;
9496 PERFETTO_ON_TRACING_DISABLED = 4;
9497 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9498 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9499 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9500 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9501 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9502 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9503 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9504 PERFETTO_TRIGGER_BEGIN = 12;
9505 PERFETTO_TRIGGER_SUCCESS = 13;
9506 PERFETTO_TRIGGER_FAILURE = 14;
9507 PERFETTO_HIT_GUARDRAILS = 15;
9508 PERFETTO_ON_TIMEOUT = 16;
9509 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9510 }
9511
9512 // Which stage of the pipeline we are reporting from.
9513 optional Event event = 1;
9514
9515 // UUID matching the one set inside the SystemInfo trace packet.
9516 optional int64 trace_uuid_lsb = 2;
9517 optional int64 trace_uuid_msb = 3;
9518}
Mark Tabrya824a642019-11-05 12:26:12 -08009519
9520/**
9521 * Pulls client metrics on data transferred via Vehicle Maps Service.
9522 * Metrics are keyed by uid + layer.
9523 *
9524 * Pulled from:
9525 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9526 */
9527message VmsClientStats {
9528 // UID of the VMS client app
9529 optional int32 uid = 1 [(is_uid) = true];
9530
9531 // VMS layer definition
9532 optional int32 layer_type = 2;
9533 optional int32 layer_channel = 3;
9534 optional int32 layer_version = 4;
9535
9536 // Bytes and packets sent by the client for the layer
9537 optional int64 tx_bytes = 5;
9538 optional int64 tx_packets = 6;
9539
9540 // Bytes and packets received by the client for the layer
9541 optional int64 rx_bytes = 7;
9542 optional int64 rx_packets = 8;
9543
9544 // Bytes and packets dropped due to client error
9545 optional int64 dropped_bytes = 9;
9546 optional int64 dropped_packets = 10;
9547}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009548
9549/**
9550 * State of a dangerous permission requested by a package - sampled
9551 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9552*/
9553message DangerousPermissionStateSampled {
9554 // Name of the permission
9555 optional string permission_name = 1;
9556
9557 // Uid of the package
9558 optional int32 uid = 2 [(is_uid) = true];
9559
9560 // If the permission is granted to the uid
9561 optional bool is_granted = 3;
9562
9563 // Permission flags as per android.content.pm.PermissionFlags
9564 optional int32 permission_flags = 4;
9565}
9566
Stan Iliev637ba5e2019-08-16 13:43:08 -04009567/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009568 * HWUI stats for a given app.
9569 */
9570message GraphicsStats {
9571 // The package name of the app
9572 optional string package_name = 1;
9573
9574 // The version code of the app
9575 optional int64 version_code = 2;
9576
9577 // The start & end timestamps in UTC as
9578 // milliseconds since January 1, 1970
9579 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009580 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009581
Stan Ilievb6517192020-02-18 10:12:42 -05009582 optional int64 end_millis = 4;
9583
9584 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9585 enum PipelineType {
9586 UNKNOWN = 0;
9587 GL = 1;
9588 VULKAN = 2;
9589 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009590
9591 // HWUI renders pipeline type: GL or Vulkan.
9592 optional PipelineType pipeline = 5;
9593
9594 // Distinct frame count.
9595 optional int32 total_frames = 6;
9596
9597 // Number of "missed vsync" events.
9598 optional int32 missed_vsync_count = 7;
9599
9600 // Number of frames in triple-buffering scenario (high input latency)
9601 optional int32 high_input_latency_count = 8;
9602
9603 // Number of "slow UI thread" events.
9604 optional int32 slow_ui_thread_count = 9;
9605
9606 // Number of "slow bitmap upload" events.
9607 optional int32 slow_bitmap_upload_count = 10;
9608
9609 // Number of "slow draw" events.
9610 optional int32 slow_draw_count = 11;
9611
9612 // Number of frames that missed their deadline (aka, visibly janked)
9613 optional int32 missed_deadline_count = 12;
9614
9615 // The frame time histogram for the package
9616 optional FrameTimingHistogram cpu_histogram = 13
9617 [(android.os.statsd.log_mode) = MODE_BYTES];
9618
9619 // The gpu frame time histogram for the package
9620 optional FrameTimingHistogram gpu_histogram = 14
9621 [(android.os.statsd.log_mode) = MODE_BYTES];
9622
9623 // UI mainline module version.
9624 optional int64 version_ui_module = 15;
9625
9626 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9627 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9628 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9629 // more apps are running / rendering.
9630 optional bool is_today = 16;
9631}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009632
9633/**
9634 * Message related to dangerous (runtime) app ops access
9635 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009636message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009637 // Uid of the package accessing app op
9638 optional int32 uid = 1 [(is_uid) = true];
9639
9640 // Name of the package accessing app op
9641 optional string package_name = 2;
9642
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009643 // deprecated - set to empty string
9644 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009645
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009646 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009647 // API. Attributions must be provided through manifest using <attribution> tag available in R
9648 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009649 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009650
9651 // message related to app op access, limited to 600 chars by API
9652 optional string message = 5;
9653
9654 enum SamplingStrategy {
9655 DEFAULT = 0;
9656 UNIFORM = 1;
9657 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009658 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009659 }
9660
9661 // sampling strategy used to collect this message
9662 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009663
9664 // operation id
9665 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009666}
9667
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009668/*
9669 * Logs userspace reboot outcome and duration.
9670 *
9671 * Logged from:
9672 * frameworks/base/core/java/com/android/server/BootReceiver.java
9673 */
9674message UserspaceRebootReported {
9675 // Possible outcomes of userspace reboot.
9676 enum Outcome {
9677 // Default value in case platform failed to determine the outcome.
9678 OUTCOME_UNKNOWN = 0;
9679 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9680 SUCCESS = 1;
9681 // Userspace reboot shutdown sequence was aborted.
9682 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9683 // Remounting userdata into checkpointing mode failed.
9684 FAILED_USERDATA_REMOUNT = 3;
9685 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9686 // reboot.
9687 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9688 }
9689 // Outcome of userspace reboot. Always set.
9690 optional Outcome outcome = 1;
9691 // Duration of userspace reboot in case it has a successful outcome.
9692 // Duration is measured as time between userspace reboot was initiated and until boot completed
9693 // (e.g. sys.boot_completed=1).
9694 optional int64 duration_millis = 2;
9695 // State of primary user's (user0) credential encryption storage.
9696 enum UserEncryptionState {
9697 // Default value.
9698 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9699 // Credential encrypted storage is unlocked.
9700 UNLOCKED = 1;
9701 // Credential encrypted storage is locked.
9702 LOCKED = 2;
9703 }
9704 // State of primary user's encryption storage at the moment boot completed. Always set.
9705 optional UserEncryptionState user_encryption_state = 3;
9706}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009707
9708/*
9709 * Logs integrity check information during each install.
9710 *
9711 * Logged from:
9712 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9713 */
9714message IntegrityCheckResultReported {
9715 optional string package_name = 1;
9716 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009717 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009718 optional string installer_package_name = 4;
9719 enum Response {
9720 UNKNOWN = 0;
9721 ALLOWED = 1;
9722 REJECTED = 2;
9723 FORCE_ALLOWED = 3;
9724 }
9725 optional Response response = 5;
9726 // An estimate on the cause of the response. This will only be populated for
9727 // REJECTED and FORCE_ALLOWED
9728 optional bool caused_by_app_cert_rule = 6;
9729 optional bool caused_by_installer_rule = 7;
9730}
9731
9732/**
9733 * Logs the information about the rules and the provider whenever rules are
9734 * pushed into AppIntegrityManager.
9735 *
9736 * Logged from:
9737 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9738 */
9739message IntegrityRulesPushed {
9740 optional bool success = 1;
9741 // Package name of the app that pushed the rules.
9742 optional string rule_provider = 2;
9743 // Version string of arbitrary format provided by the rule provider to
9744 // identify the rules.
9745 optional string rule_version = 3;
9746}
Jordan Liubedfa702019-12-20 15:08:45 -08009747
9748/**
9749 * Logs when a cell broadcast message is received on the device.
9750 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009751 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009752 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009753 * packages/apps/CellBroadcastReceiver/
9754 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009755 */
9756message CellBroadcastMessageReported {
9757 // The type of Cell Broadcast message
9758 enum CbType {
9759 UNKNOWN_TYPE = 0;
9760 GSM = 1;
9761 CDMA = 2;
9762 CDMA_SPC = 3;
9763 }
9764
Jordan Liu900e5cb2020-05-29 09:44:59 -07009765 // The parts of the cell broadcast message pipeline
9766 enum ReportSource {
9767 UNKNOWN_SOURCE = 0;
9768 FRAMEWORK = 1;
9769 CB_SERVICE = 2;
9770 CB_RECEIVER_APP = 3;
9771 }
9772
Jordan Liubedfa702019-12-20 15:08:45 -08009773 // GSM, CDMA, CDMA-SCP
9774 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009775
9776 // The source of the report
9777 optional ReportSource source = 2;
9778}
9779
9780/**
9781 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9782 *
9783 * Logged from CellBroadcastService module:
9784 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9785 */
9786message CellBroadcastMessageFiltered {
9787 enum FilterReason {
9788 NOT_FILTERED = 0;
9789 DUPLICATE_MESSAGE = 1;
9790 GEOFENCED_MESSAGE = 2;
9791 AREA_INFO_MESSAGE = 3;
9792 }
9793
9794 // GSM, CDMA, CDMA-SCP
9795 optional CellBroadcastMessageReported.CbType type = 1;
9796
9797 // The source of the report
9798 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009799}
9800
9801/**
9802 * Logs when an error occurs while handling a cell broadcast message;
9803 *
9804 * Logged from CellBroadcastService module:
9805 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9806 */
9807message CellBroadcastMessageError {
9808 // The type of error raised when trying to handle a cell broadcast message
9809 enum ErrorType {
9810 UNKNOWN_TYPE = 0;
9811 CDMA_DECODING_ERROR = 1;
9812 CDMA_SCP_EMPTY = 2;
9813 CDMA_SCP_HANDLING_ERROR = 3;
9814 GSM_INVALID_HEADER_LENGTH = 4;
9815 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9816 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9817 GSM_INVALID_PDU = 7;
9818 GSM_INVALID_GEO_FENCING_DATA = 8;
9819 GSM_UMTS_INVALID_WAC = 9;
9820 FAILED_TO_INSERT_TO_DB = 10;
9821 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9822 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9823 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9824 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009825 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009826 }
9827
9828 // What kind of error occurred
9829 optional ErrorType type = 1;
9830
9831 // Exception message (or log message) associated with the error (max 1000 chars)
9832 optional string exception_message = 2;
9833}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009834
9835/**
Henry Fange316ab62020-04-21 18:43:14 -07009836 * Logs when a tune occurs through device's Frontend.
9837 * This is atom ID 276.
9838 *
9839 * Logged from:
9840 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9841 */
9842message TvTunerStateChanged {
9843 enum State {
9844 UNKNOWN = 0;
9845 TUNING = 1; // Signal is tuned
9846 LOCKED = 2; // the signal is locked
9847 NOT_LOCKED = 3; // the signal isn’t locked.
9848 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9849 SCANNING = 5; // the signal is scanned
9850 SCAN_STOPPED = 6; // the scan is stopped.
9851 }
9852 // The uid of the application that sent this custom atom.
9853 optional int32 uid = 1 [(is_uid) = true];
9854 // new state
9855 optional State state = 2;
9856}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009857
9858/**
9859 * Logs the status of a dvr playback or record.
9860 * This is atom ID 279.
9861 *
9862 * Logged from:
9863 * frameworks/base/media/java/android/media/tv/tuner/dvr
9864 */
9865message TvTunerDvrStatus {
9866 enum Type {
9867 UNKNOWN_TYPE = 0;
9868 PLAYBACK = 1; // is a playback
9869 RECORD = 2; // is a record
9870 }
9871 enum State {
9872 UNKNOWN_STATE = 0;
9873 STARTED = 1; // DVR is started
9874 STOPPED = 2; // DVR is stopped
9875 }
9876 // The uid of the application that sent this custom atom.
9877 optional int32 uid = 1 [(is_uid) = true];
9878 // DVR type
9879 optional Type type = 2;
9880 // DVR state
9881 optional State state = 3;
9882 // Identify the segment of a record or playback
9883 optional int32 segment_id = 4;
9884 // indicate how many overflow or underflow happened between started to stopped
9885 optional int32 overflow_underflow_count = 5;
9886}
Henry Fangfd40c072020-06-01 14:59:17 -07009887
9888/**
9889 * Logs when a cas session opened through MediaCas.
9890 * This is atom ID 280.
9891 *
9892 * Logged from:
9893 * frameworks/base/media/java/android/media/MediaCas.java
9894 */
9895message TvCasSessionOpenStatus {
9896 enum State {
9897 UNKNOWN = 0;
9898 SUCCEEDED = 1; // indicate that the session is opened successfully.
9899 FAILED = 2; // indicate that the session isn’t opened successfully.
9900 }
9901 // The uid of the application that sent this custom atom.
9902 optional int32 uid = 1 [(is_uid) = true];
9903 // Cas system Id
9904 optional int32 cas_system_id = 2;
9905 // State of the session
9906 optional State state = 3;
9907}
9908
Henry Fange316ab62020-04-21 18:43:14 -07009909/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009910 * Logs when an app is frozen or unfrozen.
9911 *
9912 * Logged from:
9913 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9914 */
9915message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009916 // The type of event.
9917 enum Action {
9918 UNKNOWN = 0;
9919 FREEZE_APP = 1;
9920 UNFREEZE_APP = 2;
9921 }
9922 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009923
Blake Kragten6ce382a2020-01-16 20:20:46 -08009924 // Pid of the process being frozen.
9925 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009926
Blake Kragten6ce382a2020-01-16 20:20:46 -08009927 // Name of the process being frozen.
9928 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009929
Blake Kragten6ce382a2020-01-16 20:20:46 -08009930 // Time since last unfrozen.
9931 optional int64 time_unfrozen_millis = 4;
9932}
9933
9934/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07009935 * Pulls information for a single voice call.
9936 *
9937 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
9938 *
9939 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -07009940 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -07009941 */
9942message VoiceCallSession {
9943 // Bearer (IMS or CS) when the call started.
9944 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9945
9946 // Bearer (IMS or CS) when the call ended.
9947 // The bearer may change during the call, e.g. due to SRVCC.
9948 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9949
9950 // Direction of the call (incoming or outgoing).
9951 optional android.telephony.CallDirectionEnum direction = 3;
9952
9953 // Time spent setting up the call.
9954 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9955
9956 // Whether the call ended before the setup was completed.
9957 optional bool setup_failed = 5;
9958
9959 // IMS reason code or CS disconnect cause.
9960 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9961 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9962 optional int32 disconnect_reason_code = 6;
9963
9964 // IMS extra code or CS precise disconnect cause.
9965 // For IMS, this code is vendor-specific
9966 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9967 optional int32 disconnect_extra_code = 7;
9968
9969 // IMS extra message or CS vendor cause.
9970 optional string disconnect_extra_message = 8;
9971
9972 // Radio access technology (RAT) used when call started.
9973 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9974
9975 // Radio access technology (RAT) used when call terminated.
9976 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9977
9978 // Number of times RAT changed during the call.
9979 optional int64 rat_switch_count = 11;
9980
9981 // A bitmask of all codecs used during the call.
9982 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9983 optional int64 codec_bitmask = 12;
9984
9985 // Number of other calls going on during call setup, for the same SIM slot.
9986 optional int32 concurrent_call_count_at_start = 13;
9987
9988 // Number of other calls going on during call termination, for the same SIM slot.
9989 optional int32 concurrent_call_count_at_end = 14;
9990
9991 // Index of the SIM is used, 0 for single-SIM devices.
9992 optional int32 sim_slot_index = 15;
9993
9994 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9995 optional bool is_multi_sim = 16;
9996
9997 // Whether the call was made with an eSIM profile.
9998 optional bool is_esim = 17;
9999
10000 // Carrier ID of the SIM card.
10001 // See https://source.android.com/devices/tech/config/carrierid.
10002 optional int32 carrier_id = 18;
10003
Chi Zhangba1b03a2020-04-21 17:17:56 -070010004 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -070010005 optional bool srvcc_completed = 19;
10006
10007 // Number of SRVCC failures.
10008 optional int64 srvcc_failure_count = 20;
10009
10010 // Number of SRVCC cancellations.
10011 optional int64 srvcc_cancellation_count = 21;
10012
Chi Zhangba1b03a2020-04-21 17:17:56 -070010013 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
10014 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -070010015 optional bool rtt_enabled = 22;
10016
10017 // Whether this was an emergency call.
10018 optional bool is_emergency = 23;
10019
10020 // Whether the call was performed while roaming.
10021 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -070010022
10023 // A random number used as the dimension field to pull multiple atoms.
10024 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -070010025}
10026
10027/**
10028 * Pulls voice call radio access technology (RAT) usage.
10029 *
10030 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
10031 * time. The atom will be skipped if not enough data is available.
10032 *
10033 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010034 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010035 */
10036message VoiceCallRatUsage {
10037 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
10038 optional int32 carrier_id = 1;
10039
10040 // Radio access technology.
10041 optional android.telephony.NetworkTypeEnum rat = 2;
10042
10043 // Total duration that voice calls spent on this carrier and RAT.
10044 optional int64 total_duration_seconds = 3;
10045
10046 // Total number of calls using this carrier and RAT.
10047 // A call is counted once even if it used the RAT multiple times.
10048 optional int64 call_count = 4;
10049}
10050
10051/**
10052 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
10053 *
10054 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010055 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010056 */
10057message SimSlotState {
10058 // Number of active SIM slots (both physical and eSIM profiles) in the device.
10059 optional int32 active_slot_count = 1;
10060
10061 // Number of SIM cards (both physical and active eSIM profiles).
10062 // This number is always equal to or less than the number of active SIM slots.
10063 optional int32 sim_count = 2;
10064
10065 // Number of active eSIM profiles.
10066 // This number is always equal to or less than the number of SIMs.
10067 optional int32 esim_count = 3;
10068}
10069
10070/**
10071 * Pulls supported cellular radio access technologies.
10072 *
10073 * This atom reports the capabilities of the device, rather than the network it has access to.
10074 *
10075 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010076 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010077 */
10078message SupportedRadioAccessFamily {
10079 // A bitmask of supported radio technologies.
10080 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
10081 optional int64 network_type_bitmask = 1;
10082}
10083
10084/**
Blake Kragten6ce382a2020-01-16 20:20:46 -080010085 * Logs gnss stats from location service provider
10086 *
10087 * Pulled from:
10088 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
10089 */
10090
10091message GnssStats {
10092 // Number of location reports since boot
10093 optional int64 location_reports = 1;
10094
10095 // Total pulled reports of Location failures since boot
10096 optional int64 location_failure_reports = 2;
10097
10098 // Number of time to first fix reports since boot
10099 optional int64 time_to_first_fix_reports = 3;
10100
10101 // Total pulled reported time to first fix (in milli-seconds) since boot
Blake Kragten850a9d432020-06-11 09:05:39 -070010102 optional int64 time_to_first_fix_millis = 4;
Blake Kragten6ce382a2020-01-16 20:20:46 -080010103
10104 // Number of position accuracy reports since boot
10105 optional int64 position_accuracy_reports = 5;
10106
10107 // Total pulled reported position accuracy (in meters) since boot
10108 optional int64 position_accuracy_meters = 6;
10109
10110 // Number of top 4 average CN0 reports since boot
10111 optional int64 top_four_average_cn0_reports = 7;
10112
10113 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
10114 optional int64 top_four_average_cn0_db_mhz = 8;
10115
10116 // Number of l5 top 4 average CN0 reports since boot
10117 optional int64 l5_top_four_average_cn0_reports = 9;
10118
10119 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
10120 optional int64 l5_top_four_average_cn0_db_mhz = 10;
10121
10122 // Total number of sv status messages reports since boot
10123 optional int64 sv_status_reports = 11;
10124
10125 // Total number of sv status messages reports, where sv is used in fix since boot
10126 optional int64 sv_status_reports_used_in_fix = 12;
10127
10128 // Total number of L5 sv status messages reports since boot
10129 optional int64 l5_sv_status_reports = 13;
10130
10131 // Total number of L5 sv status messages reports, where sv is used in fix since boot
10132 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -080010133}
Kweku Adams12752132020-02-18 15:36:48 -080010134
10135/**
10136 * Logs when an app is moved to a different standby bucket.
10137 *
10138 * Logged from:
10139 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
10140 */
10141message AppStandbyBucketChanged {
10142 optional string package_name = 1;
10143
10144 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
10145 optional int32 user_id = 2;
10146
10147 // These enum values match the constants defined in UsageStatsManager.java.
10148 enum Bucket {
10149 BUCKET_UNKNOWN = 0;
10150 BUCKET_EXEMPTED = 5;
10151 BUCKET_ACTIVE = 10;
10152 BUCKET_WORKING_SET = 20;
10153 BUCKET_FREQUENT = 30;
10154 BUCKET_RARE = 40;
10155 BUCKET_RESTRICTED = 45;
10156 BUCKET_NEVER = 50;
10157 }
10158 optional Bucket bucket = 3;
10159
10160 enum MainReason {
10161 MAIN_UNKNOWN = 0;
10162 MAIN_DEFAULT = 0x0100;
10163 MAIN_TIMEOUT = 0x0200;
10164 MAIN_USAGE = 0x0300;
10165 MAIN_FORCED_BY_USER = 0x0400;
10166 MAIN_PREDICTED = 0x0500;
10167 MAIN_FORCED_BY_SYSTEM = 0x0600;
10168 }
10169 optional MainReason main_reason = 4;
10170
10171 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
10172 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
10173 // UsageStatsManager.java.
10174 optional int32 sub_reason = 5;
10175}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010176
10177/**
10178* Reports a started sharesheet transaction.
10179*
10180* Logged from:
10181* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
10182*/
10183message SharesheetStarted {
10184 // The event_id (as for UiEventReported).
10185 optional int32 event_id = 1;
10186 // The calling app's package name.
10187 optional string package_name = 2;
10188 // An identifier to tie together multiple logs relating to the same share event
10189 optional int32 instance_id = 3;
10190 // The mime type of the share
10191 optional string mime_type = 4;
10192 // The number of direct targets the calling app is providing that will be shown.
10193 optional int32 num_app_provided_direct_targets = 5;
10194 // The number of app targets the calling app is providing that will be shown.
10195 optional int32 num_app_provided_app_targets = 6;
10196 // True if the share originates from the workprofile
10197 optional bool is_workprofile = 7;
10198
10199 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010200 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010201 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
10202 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
10203 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
10204 }
10205 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010206 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010207
10208 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
10209 INTENT_DEFAULT = 0;
10210 INTENT_ACTION_VIEW = 1;
10211 INTENT_ACTION_EDIT = 2;
10212 INTENT_ACTION_SEND = 3;
10213 INTENT_ACTION_SENDTO = 4;
10214 INTENT_ACTION_SEND_MULTIPLE = 5;
10215 INTENT_ACTION_IMAGE_CAPTURE = 6;
10216 INTENT_ACTION_MAIN = 7;
10217 }
10218 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010219 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010220}
10221
10222/**
10223 * Reports a ranking selection event.
10224 *
10225 * Logged from:
10226 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
10227 */
10228message RankingSelected {
10229 // The event_id (as for UiEventReported).
10230 optional int32 event_id = 1;
10231 // The relevant app's package name (can be source or picked package).
10232 optional string package_name = 2;
10233 // An identifier to tie together multiple logs relating to the same share event.
10234 optional int32 instance_id = 3;
10235 // Which of the ranked targets got picked, default starting position 0.
10236 optional int32 position_picked = 4;
10237}
Raff Tsaiea4db182020-03-06 07:45:43 +080010238
10239/**
Zhen Sun0bec8d42020-03-25 17:17:29 -070010240 * Logs when TvSettings UI is interacted at.
10241 *
10242 * Logged from: packages/apps/TvSettings
10243 */
10244message TvSettingsUIInteracted {
10245
10246 /** The UI action category */
10247 optional android.app.tvsettings.Action action = 1;
10248
10249 /** The ID of the entry that the users actioned on */
10250 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -070010251}
10252
10253/**
Songchun Fanc296cf72020-03-31 18:38:52 -070010254 * Logs information about a package installation using package installer V2 APIs.
10255 *
10256 * Logged from:
10257 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
10258 */
10259message PackageInstallerV2Reported {
10260 // Whether this installation uses Incremental File System
10261 optional bool is_incremental = 1;
10262 // Name of the package that is intended to be installed
10263 optional string package_name = 2;
10264 // The duration between when the install was requested to when the install has completed
10265 optional int64 duration_millis = 3;
10266 // Installation result in final integer, which are SystemApi's.
10267 // Return_code 1 indicates success.
10268 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
10269 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010270 // Total size of the APKs installed for this package
10271 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010272}
10273
10274/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010275 * Logs settings provider values.
10276 *
10277 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10278 * then write the value to proto.
10279 *
10280 */
10281message SettingSnapshot {
10282
10283 // Setting key
10284 optional string name = 1;
10285
10286 enum SettingsValueType {
10287 NOTASSIGNED = 0;
10288 ASSIGNED_BOOL_TYPE = 1;
10289 ASSIGNED_INT_TYPE = 2;
10290 ASSIGNED_FLOAT_TYPE = 3;
10291 ASSIGNED_STRING_TYPE = 4;
10292 };
10293 // Setting value type
10294 optional SettingsValueType type = 2;
10295
10296 optional bool bool_value = 3;
10297
10298 optional int32 int_value = 4;
10299
10300 optional float float_value = 5;
10301
10302 optional string str_value = 6;
10303
10304 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10305 optional int32 user_id = 7;
10306}
Varun Shahacb56342019-12-18 11:45:38 -080010307
10308/**
10309 * An event logged to indicate that a user journey is about to be performed. This atom includes
10310 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10311 * will immediately follow this atom which will describe the event(s) and its state.
10312 *
10313 * Logged from:
10314 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10315 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10316 */
10317message UserLifecycleJourneyReported {
10318 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10319 // UserLifecycleEventOccurred atom)
10320 optional int64 session_id = 1;
10321
10322 // Indicates what type of user journey this session is related to
10323 enum Journey {
10324 UNKNOWN = 0; // Undefined user lifecycle journey
10325 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10326 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10327 USER_START = 3; // A user start journey
10328 USER_CREATE = 4; // A user creation journey
10329 }
10330 optional Journey journey = 2;
10331 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10332 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10333 optional int32 origin_user = 3;
10334 // Which user the journey is targeting
10335 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10336 optional int32 target_user = 4;
10337
10338 // What is the user type of the target user
10339 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10340 enum UserType {
10341 TYPE_UNKNOWN = 0;
10342 FULL_SYSTEM = 1;
10343 FULL_SECONDARY = 2;
10344 FULL_GUEST = 3;
10345 FULL_DEMO = 4;
10346 FULL_RESTRICTED = 5;
10347 PROFILE_MANAGED = 6;
10348 SYSTEM_HEADLESS = 7;
10349 }
10350 optional UserType user_type = 5;
10351 // What are the flags attached to the target user
10352 optional int32 user_flags = 6;
10353}
10354
10355/**
10356 * An event logged when a specific user lifecycle event is performed. These events should be
10357 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10358 * Note: journeys can span over multiple events, hence some events may share a single session id.
10359 *
10360 * Logged from:
10361 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10362 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10363 */
10364message UserLifecycleEventOccurred {
10365 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10366 optional int64 session_id = 1;
10367 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10368 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10369 optional int32 user_id = 2;
10370
10371 enum Event {
10372 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10373 SWITCH_USER = 1; // Indicates that this is a user switch event
10374 START_USER = 2; // Indicates that this is a user start event
10375 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010376 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10377 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10378 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010379 }
10380 optional Event event = 3;
10381
10382 enum State {
10383 NONE = 0; // Indicates the associated event has no start/end defined
10384 BEGIN = 1;
10385 FINISH = 2;
10386 }
10387 optional State state = 4; // Represents the state of an event (beginning/ending)
10388}
jasonwshsu81173e32020-03-27 15:22:03 +080010389
10390/**
10391 * Logs when accessibility shortcut clicked.
10392 *
10393 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010394 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010395 */
10396message AccessibilityShortcutReported {
10397 // The accessibility feature(including installed a11y service, framework a11y feature,
10398 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10399 optional string package_name = 1;
10400
10401 // The definition of the accessibility shortcut.
10402 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10403 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10404
10405 // The definition of the service status.
10406 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10407 optional android.stats.accessibility.ServiceStatus service_status = 3;
10408}
10409
10410/**
10411 * Logs when accessibility service status changed.
10412 *
10413 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010414 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010415 */
10416message AccessibilityServiceReported {
10417 // The accessibility service package name.
10418 optional string package_name = 1;
10419
10420 // The definition of the service status.
10421 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10422 optional android.stats.accessibility.ServiceStatus service_status = 2;
10423}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010424
Denny cy Leeca62fc42020-05-28 18:13:07 +080010425/**
10426 * Logs when display wake up.
10427 *
10428 * Logged from:
10429 * services/core/java/com/android/server/power/Notifier.java
10430 */
10431
10432message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010433 // Wake_up_reason code
10434 // If LOWORD(wake_up_reason) = 0
10435 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10436 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010437 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010438 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010439}
10440
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010441/**
10442 * Logs app usage events.
10443 */
10444message AppUsageEventOccurred {
10445 optional int32 uid = 1 [(is_uid) = true];
10446 optional string package_name = 2;
10447 optional string class_name = 3;
10448
10449 enum EventType {
10450 NONE = 0;
10451 MOVE_TO_FOREGROUND = 1;
10452 MOVE_TO_BACKGROUND = 2;
10453 }
10454 optional EventType event_type = 4;
10455}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010456
10457/*
10458 * Quality metrics logged when EVS cameras are active.
10459 *
10460 * Logged from:
10461 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10462 */
10463message EvsUsageStatsReported {
10464
10465 // Camera identifier to distinguish the source camera device. This is not
10466 // globally unique and therefore cannot be used to identify the user and/or
10467 // the device.
10468 optional int32 device_id = 1;
10469
10470 // Peak number of clients during the service
10471 optional int32 peak_num_clients = 2;
10472
10473 // Number of erroneous events during the service
10474 optional int32 num_errors = 3;
10475
10476 // Round trip latency of the very first frame
10477 optional int64 first_latency_millis = 4;
10478
10479 // Average frame round trip latency
10480 optional float avg_latency_millis = 5;
10481
10482 // Peak frame round trip latency
10483 optional int64 peak_latency_millis = 6;
10484
10485 // Total number of frames received
10486 optional int64 total_frames = 7;
10487
10488 // Number of frames ignored
10489 optional int64 ignored_frames = 8;
10490
10491 // Number of dropped frames to synchronize camera devices
10492 optional int64 dropped_frames_to_sync = 9;
10493
10494 // The duration of the service
10495 optional int64 duration_millis = 10;
10496}
Robert Leecccdc152020-04-23 13:22:46 +080010497
10498/**
10499 * Logs audio power usage stats.
10500 *
10501 * Pushed from:
10502 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10503 */
10504message AudioPowerUsageDataReported {
10505 /**
10506 * Device used for input/output
10507 *
10508 * All audio devices please refer to below file:
10509 * system/media/audio/include/system/audio-base.h
10510 *
10511 * Define our own enum values because we don't report all audio devices.
10512 * Currently, we only report built-in audio devices such as handset, speaker,
10513 * built-in mics, common audio devices such as wired headset, usb headset
10514 * and bluetooth devices.
10515 */
10516 enum AudioDevice {
10517 OUTPUT_EARPIECE = 0x1; // handset
10518 OUTPUT_SPEAKER = 0x2; // dual speaker
10519 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10520 OUTPUT_USB_HEADSET = 0x8; // usb headset
10521 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10522 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10523 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10524
10525 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10526 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10527 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10528 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10529 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10530 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10531 }
10532 optional AudioDevice audio_device = 1;
10533
10534 // Duration of the audio in seconds
10535 optional int32 duration_secs = 2;
10536
10537 // Average volume (0 ... 1.0)
10538 optional float average_volume = 3;
10539
10540 enum AudioType {
10541 UNKNOWN_TYPE = 0;
10542 VOICE_CALL_TYPE = 1; // voice call
10543 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10544 MEDIA_TYPE = 3; // music and system sound
10545 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10546 ALARM_TYPE = 5; // alarm type
10547 // record type
10548 CAMCORDER_TYPE = 6; // camcorder
10549 RECORD_TYPE = 7; // other recording
10550 }
10551 optional AudioType type = 4;
10552}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010553
10554/**
10555 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10556 *
10557 * Pulled from:
10558 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10559 */
10560message BytesTransferByTagAndMetered {
10561 optional int32 uid = 1 [(is_uid) = true];
10562
10563 optional bool is_metered = 2;
10564
10565 optional int32 tag = 3;
10566
10567 optional int64 rx_bytes = 4;
10568
10569 optional int64 rx_packets = 5;
10570
10571 optional int64 tx_bytes = 6;
10572
10573 optional int64 tx_packets = 7;
10574}
Robert Luo2f52f042020-05-11 16:39:24 +080010575
10576/*
10577 * Logs when the Media Output Switcher finishes a media switch operation.
10578 *
10579 * Logged from:
10580 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10581 */
10582message MediaOutputOpSwitchReported {
10583 // Source medium type before switching.
10584 optional android.app.settings.mediaoutput.MediumType source = 1;
10585
10586 // Target medium type after switching.
10587 optional android.app.settings.mediaoutput.MediumType target = 2;
10588
10589 // The result of switching.
10590 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10591
10592 // The detail code of a switching result.
10593 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10594
10595 /*
10596 * The package name of a pre-installed app, whose media session is being switched.
10597 */
10598 optional string media_session_package_name = 5;
10599
10600 // The amount of available wired devices when a switching is being performed.
10601 optional int32 available_wired_device_count = 6;
10602
10603 // The amount of available Bluetooth devices a switching is being performed.
10604 optional int32 available_bt_device_count = 7;
10605
10606 // The amount of available remote devices when a switching is being performed.
10607 optional int32 available_remote_device_count = 8;
10608
10609 // The amount of applied devices within a remote dynamic group after a switching is done.
10610 optional int32 applied_device_count_within_remote_group = 9;
10611}
Govinda Wassermane4640282020-04-30 09:30:56 -040010612
10613/**
10614 * Logs when the Assistant is invoked.
10615 *
10616 * Logged from:
10617 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10618 */
10619message AssistantInvocationReported {
10620
10621 // The event_id (as for UiEventReported).
10622 optional int32 event_id = 1;
10623
10624 // The registered Assistant's uid and package (as for UiEventReported).
10625 optional int32 uid = 2 [(is_uid) = true];
10626 optional string package_name = 3;
10627
10628 // An identifier used to disambiguate which logs refer to a particular invocation of the
10629 // Assistant (as for UiEventReported).
10630 optional int32 instance_id = 4;
10631
10632 // The state of the device at the time of invocation.
10633 enum DeviceState {
10634 UNKNOWN_DEVICE_STATE = 0;
10635 AOD1 = 1;
10636 AOD2 = 2;
10637 BOUNCER = 3;
10638 UNLOCKED_LOCKSCREEN = 4;
10639 LAUNCHER_HOME = 5;
10640 LAUNCHER_OVERVIEW = 6;
10641 LAUNCHER_ALL_APPS = 7;
10642 APP_DEFAULT = 8;
10643 APP_IMMERSIVE = 9;
10644 APP_FULLSCREEN = 10;
10645 }
10646 optional DeviceState device_state = 5;
10647
10648 // Whether the Assistant handles were showing at the time of invocation.
10649 optional bool assistant_handles_showing = 6;
10650}
Andy Hung48cffa32020-05-01 09:54:02 -070010651
10652/**
10653 * Logs when an AudioRecord finishes running on an audio device
10654 *
10655 * Logged from:
10656 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10657 */
10658message MediametricsAudioRecordDeviceUsageReported {
10659 // The devices connected to this AudioRecord.
10660 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10661 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10662 // See audio_device_t in system/media/audio/include/system/audio-base.h
10663 optional string devices = 1;
10664
10665 // The name of the remote device attached to the device, typically available for USB or BT.
10666 // This may be empty for a fixed device, or separated by "|" if more than one.
10667 optional string device_names = 2;
10668
10669 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10670 optional int64 device_time_nanos = 3;
10671
10672 // The audio data format used for encoding.
10673 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10674 optional string encoding = 4;
10675
10676 // The client-server buffer framecount.
10677 // The framecount is generally between 960 - 48000 for PCM encoding.
10678 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10679 optional int32 frame_count = 5;
10680
10681 // The number of audio intervals (contiguous, continuous playbacks).
10682 optional int32 interval_count = 6;
10683
10684 // The sample rate of the AudioRecord.
10685 // A number generally between 8000-96000 (frames per second).
10686 optional int32 sample_rate = 7;
10687
10688 // The audio input flags used to construct the AudioRecord.
10689 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10690 optional string flags = 8;
10691
10692 // The santized package name of the audio client associated with the AudioRecord.
10693 // See getSanitizedPackageNameAndVersionCode() in
10694 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10695 optional string package_name = 9;
10696
10697 // The selected device id (nonzero if a non-default device is selected)
10698 optional int32 selected_device_id = 10;
10699
10700 // The caller of the AudioRecord.
10701 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10702 optional string caller = 11;
10703
10704 // The audio source for AudioRecord.
10705 // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
10706 optional string source = 12;
10707}
10708
10709/**
10710 * Logs when an AudioThread finishes running on an audio device
10711 *
10712 * Logged from:
10713 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10714 */
10715message MediametricsAudioThreadDeviceUsageReported {
10716 // The devices connected to this audio thread.
10717 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10718 // (for record threads):
10719 // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
10720 // (for playback threads):
10721 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10722 // See audio_device_t in system/media/audio/include/system/audio-base.h
10723 optional string devices = 1;
10724
10725 // The name of the remote device attached to the device, typically available for USB or BT.
10726 // This may be empty for a fixed device, or separated by "|" if more than one.
10727 optional string device_names = 2;
10728
10729 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10730 optional int64 device_time_nanos = 3;
10731
10732 // The audio data format used for encoding.
10733 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10734 optional string encoding = 4;
10735
10736 // The framecount of the buffer delivered to (or from) the HAL.
10737 // The framecount is generally ~960 for PCM encoding.
10738 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10739 optional int32 frame_count = 5;
10740
10741 // The number of audio intervals (contiguous, continuous playbacks).
10742 optional int32 interval_count = 6;
10743
10744 // The sample rate of the audio thread.
10745 // A number generally between 8000-96000 (frames per second).
10746 optional int32 sample_rate = 7;
10747
10748 // The audio flags used to construct the thread
10749 // (for record threads):
10750 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10751 // (for playback threads):
10752 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10753 optional string flags = 8;
10754
10755 // The number of underruns encountered for a playback thread or the
10756 // number of overruns encountered for a capture thread.
10757 optional int32 xruns = 9;
10758
10759 // The type of thread
10760 // A thread type enumeration from
10761 // frameworks/av/mediametrics/services/Translate.h
10762 optional string type = 10;
10763}
10764
10765/**
10766 * Logs when an AudioTrack finishes running on an audio device
10767 *
10768 * Logged from:
10769 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10770 */
10771message MediametricsAudioTrackDeviceUsageReported {
10772 // The output devices connected to this AudioTrack.
10773 // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
10774 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10775 // See audio_device_t in system/media/audio/include/system/audio-base.h
10776 optional string devices = 1;
10777
10778 // The name of the remote device attached to the device, typically available for USB or BT.
10779 // This may be empty for a fixed device, or separated by "|" if more than one.
10780 optional string device_names = 2;
10781
10782 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10783 optional int64 device_time_nanos = 3;
10784
10785 // The audio data format used for encoding.
10786 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10787 optional string encoding = 4;
10788
10789 // The client-server buffer framecount.
10790 // The framecount is generally between 960 - 48000 for PCM encoding.
10791 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10792 // A static track (see traits) may have a very large framecount.
10793 optional int32 frame_count = 5;
10794
10795 // The number of audio intervals (contiguous, continuous playbacks).
10796 optional int32 interval_count = 6;
10797
10798 // The sample rate of the AudioTrack.
10799 // A number generally between 8000-96000 (frames per second).
10800 optional int32 sample_rate = 7;
10801
10802 // The audio flags used to construct the AudioTrack.
10803 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10804 optional string flags = 8;
10805
10806 // The number of underruns encountered.
10807 optional int32 xruns = 9;
10808
10809 // The santized package name of the audio client associated with the AudioTrack.
10810 // See getSanitizedPackageNameAndVersionCode() in
10811 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10812 optional string package_name = 10;
10813
10814 // The latency of the last sample in the buffer in milliseconds.
10815 optional float device_latency_millis = 11;
10816
10817 // The startup time in milliseconds from start() to sample played.
10818 optional float device_startup_millis = 12;
10819
10820 // The average volume of the track on the device [ 0.f - 1.f ]
10821 optional float device_volume = 13;
10822
10823 // The selected device id (nonzero if a non-default device is selected)
10824 optional int32 selected_device_id = 14;
10825
10826 // The stream_type category for the AudioTrack.
10827 // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
10828 optional string stream_type = 15;
10829
10830 // The usage for the AudioTrack.
10831 // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
10832 optional string usage = 16;
10833
10834 // The content type of the AudioTrack.
10835 // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
10836 optional string content_type = 17;
10837
10838 // The caller of the AudioTrack.
10839 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10840 optional string caller = 18;
10841
10842 // The traits of the AudioTrack.
10843 // A string OR of different traits, may be empty string.
10844 // Only "static" is supported for R.
10845 // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10846 optional string traits = 19;
10847}
10848
10849/**
10850 * Logs the status of an audio device connection attempt.
10851 *
10852 * Logged from:
10853 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10854 */
10855message MediametricsAudioDeviceConnectionReported {
10856 // The input devices represented by this report.
10857 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10858 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10859 // See audio_device_t in system/media/audio/include/system/audio-base.h
10860 optional string input_devices = 1;
10861
10862 // The output devices represented by this report.
10863 // A string OR of various output device categories.
10864 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10865 // See audio_device_t in system/media/audio/include/system/audio-base.h
10866 optional string output_devices = 2;
10867
10868 // The name of the remote device attached to the device, typically available for USB or BT.
10869 // This may be empty for a fixed device, or separated by "|" if more than one.
10870 optional string device_names = 3;
10871
10872 // The result of the audio device connection.
10873 // 0 indicates success: connection verified.
10874 // 1 indicates unknown: connection not verified or not known if diverted properly.
10875 // Other values indicate specific status.
10876 // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
10877 optional int32 result = 4;
10878
10879 // Average milliseconds of time to connect
10880 optional float time_to_connect_millis = 5;
10881
10882 // Number of connections if aggregated statistics, otherwise 1.
10883 optional int32 connection_count = 6;
10884}
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -070010885
10886// Blob Committer stats
10887// Keep in sync between:
10888// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
10889// frameworks/base/cmds/statsd/src/atoms.proto
10890message BlobCommitterProto {
10891 // Committer app's uid
10892 optional int32 uid = 1 [(is_uid) = true];
10893
10894 // Unix epoch timestamp of the commit in milliseconds
10895 optional int64 commit_timestamp_millis = 2;
10896
10897 // Flags of what access types the committer has set for the Blob
10898 optional int32 access_mode = 3;
10899
10900 // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
10901 optional int32 num_whitelisted_package = 4;
10902}
10903
10904// Blob Leasee stats
10905// Keep in sync between:
10906// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
10907// frameworks/base/cmds/statsd/src/atoms.proto
10908message BlobLeaseeProto {
10909 // Leasee app's uid
10910 optional int32 uid = 1 [(is_uid) = true];
10911
10912 // Unix epoch timestamp for lease expiration in milliseconds
10913 optional int64 lease_expiry_timestamp_millis = 2;
10914}
10915
10916// List of Blob Committers
10917// Keep in sync between:
10918// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
10919// frameworks/base/cmds/statsd/src/atoms.proto
10920message BlobCommitterListProto {
10921 repeated BlobCommitterProto committer = 1;
10922}
10923
10924// List of Blob Leasees
10925// Keep in sync between:
10926// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
10927// frameworks/base/cmds/statsd/src/atoms.proto
10928message BlobLeaseeListProto {
10929 repeated BlobLeaseeProto leasee = 1;
10930}
10931
10932/**
10933 * Logs the current state of a Blob committed with BlobStoreManager
10934 *
10935 * Pulled from:
10936 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
10937 */
10938message BlobInfo {
10939 // Id of the Blob
10940 optional int64 blob_id = 1;
10941
10942 // Size of the Blob data
10943 optional int64 size = 2;
10944
10945 // Unix epoch timestamp of the Blob's expiration in milliseconds
10946 optional int64 expiry_timestamp_millis = 3;
10947
10948 // List of committers of this Blob
10949 optional BlobCommitterListProto committers = 4;
10950
10951 // List of leasees of this Blob
10952 optional BlobLeaseeListProto leasees = 5;
10953}