blob: 663f91005c3ee03e1671fa1c6d62be126b192cb8 [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";
lifr8abf3a72020-06-13 11:24:34 +080046import "frameworks/base/core/proto/android/stats/connectivity/tethering.proto";
lifr1f74b052019-04-16 22:16:30 +080047import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080048import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
49import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070050import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
jasonwshsu81173e32020-03-27 15:22:03 +080051import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070052import "frameworks/base/core/proto/android/stats/enums.proto";
53import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070054import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070055import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080056import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070057import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000058import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080059import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050060import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080061import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080062import "frameworks/base/core/proto/android/telephony/enums.proto";
63import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080064import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010065import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070066import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080067
Yao Chend54f9dd2017-10-17 17:37:48 +000068/**
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * raw stats log events from the Android system, also known as "atoms."
71 *
72 * This field contains a single oneof with all of the available messages.
73 * The stats-log-api-gen tool runs as part of the Android build and
74 * generates the android.util.StatsLog class, which contains the constants
75 * and methods that Android uses to log.
76 *
Stefan Lafonae2df012017-11-14 09:17:21 -080077 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000078 * Instead, statsd on Android constructs these messages synthetically,
79 * in the format defined here and in stats_log.proto.
80 */
Stefan Lafonae2df012017-11-14 09:17:21 -080081message Atom {
82 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070083 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070084 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070085 BleScanStateChanged ble_scan_state_changed = 2
86 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080087 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080088 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070089 SensorStateChanged sensor_state_changed =
90 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080091 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070092 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
93 ScheduledJobStateChanged scheduled_job_state_changed =
94 8 [(module) = "framework", (module) = "statsdtest"];
95 ScreenBrightnessChanged screen_brightness_changed =
96 9 [(module) = "framework", (module) = "statsdtest"];
97 WakelockStateChanged wakelock_state_changed =
98 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080099 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
100 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700101 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
102 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800103 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
104 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
105 14 [(module) = "framework"];
106 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
107 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
108 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
109 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800110 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700111 BatterySaverModeStateChanged battery_saver_mode_state_changed =
112 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800113 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
114 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700115 AudioStateChanged audio_state_changed =
116 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800117 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
118 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
119 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700120 UidProcessStateChanged uid_process_state_changed =
121 27 [(module) = "framework", (module) = "statsdtest"];
122 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
123 28 [(module) = "framework", (module) = "statsdtest"];
124 ScreenStateChanged screen_state_changed =
125 29 [(module) = "framework", (module) = "statsdtest"];
126 BatteryLevelChanged battery_level_changed =
127 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800129 PluggedStateChanged plugged_state_changed = 32
130 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800132 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800133 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
134 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800135 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
136 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
137 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700138 PhoneSignalStrengthChanged phone_signal_strength_changed =
139 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800140 SettingChanged setting_changed = 41 [(module) = "framework"];
141 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700142 42 [(module) = "framework", (module) = "statsdtest"];
143 IsolatedUidChanged isolated_uid_changed =
144 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800145 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
146 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800147 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800148 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800149 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700150 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800151 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
152 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800153 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800155 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800156 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800157 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
158 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800159 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800160 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700161 OverlayStateChanged overlay_state_changed =
162 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800163 ForegroundServiceStateChanged foreground_service_state_changed
164 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700165 CallStateChanged call_state_changed =
166 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800167 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
168 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
169 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 AppDied app_died = 65 [(module) = "framework"];
171 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
172 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800173 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
174 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800175 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
176 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800177 SpeakerImpedanceReported speaker_impedance_reported = 71;
178 HardwareFailed hardware_failed = 72;
179 PhysicalDropDetected physical_drop_detected = 73;
180 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800181 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
182 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800183 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700184 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800185 ANROccurred anr_occurred = 79 [(module) = "framework"];
186 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
187 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700188 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800190 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800191 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
192 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700193 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800194 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
195 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
196 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
thiruram70b08432020-06-09 18:44:02 -0700197 UiEventReported ui_event_reported = 90 [(module) = "framework", (module) = "sysui"];
Howard Roa46b6582018-09-18 16:45:02 -0700198 BatteryHealthSnapshot battery_health_snapshot = 91;
199 SlowIo slow_io = 92;
200 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800201 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
202 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100203 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800204 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800205 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700206 // TODO: service state change is very noisy shortly after boot, as well
207 // as at other transitions - coming out of doze, device plugged in, etc.
208 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800209 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
210 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
211 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800212 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800213 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800214 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
215 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
216 105 [(module) = "docsui"];
217 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
218 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
219 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
220 108 [(module) = "docsui"];
221 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
222 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
223 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
224 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800225 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800226 WifiRunningStateChanged wifi_running_state_changed = 114
227 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800228 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800229 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800230 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800231 117 [(module) = "docsui"];
232 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
233 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
234 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
235 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800236 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
237 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
238 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800239 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
240 125 [(module) = "bluetooth"];
241 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
242 126 [(module) = "bluetooth"];
243 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
244 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800245 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000246 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800247 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
248 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
249 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800250 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800251 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
252 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
253 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
254 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
255 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
256 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800257 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
258 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800259 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
260 142 [(module) = "framework"];
261 AttentionManagerServiceResultReported attention_manager_service_result_reported =
262 143 [(module) = "framework"];
263 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800264 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800265 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800266 WatchdogRollbackOccurred watchdog_rollback_occurred =
267 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800268 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
269 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800270 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800271 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
272 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800273 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
274 151 [(module) = "bluetooth"];
275 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
276 152 [(module) = "bluetooth"];
277 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
278 153 [(module) = "bluetooth"];
279 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
280 154 [(module) = "bluetooth"];
281 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
282 155 [(module) = "bluetooth"];
283 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
284 156 [(module) = "bluetooth"];
285 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
286 157 [(module) = "bluetooth"];
287 BluetoothDeviceFailedContactCounterReported
288 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
289 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
290 159 [(module) = "bluetooth"];
291 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
292 160 [(module) = "bluetooth"];
293 BluetoothQualityReportReported bluetooth_quality_report_reported =
294 161 [(module) = "bluetooth"];
295 BluetoothDeviceInfoReported bluetooth_device_info_reported =
296 162 [(module) = "bluetooth"];
297 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
298 163 [(module) = "bluetooth"];
299 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
300 164 [(module) = "bluetooth"];
301 BluetoothBondStateChanged bluetooth_bond_state_changed =
302 165 [(module) = "bluetooth"];
303 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
304 166 [(module) = "bluetooth"];
305 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
306 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800307 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
308 168 [(module) = "framework"];
309 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700310 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800311 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800312 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800313 DeviceIdentifierAccessDenied device_identifier_access_denied =
314 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800315 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800316 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
317 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
318 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800319 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
320 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800321 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700322 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800323 180 [(module) = "permissioncontroller"];
324 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
325 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800326 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800327 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
328 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
329 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
330 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800331 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
332 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700333 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800334 188 [(module) = "intelligence"];
335 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
336 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800337 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800338 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800339 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
340 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
341 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
342 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
343 MediametricsCodecReported mediametrics_codec_reported = 195;
344 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
345 MediametricsExtractorReported mediametrics_extractor_reported = 197;
346 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
347 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
348 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700349 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800350 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
351 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800352 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
354 206 [(module) = "framework"];
355 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
356 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
357 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
358 LocationManagerApiUsageReported location_manager_api_usage_reported =
359 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100360 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100362 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100364 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100366 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800367 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100368 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800369 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100370 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800371 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100372 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800373 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100374 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800376 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
377 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
378 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
379 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800380 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800381 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700382 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
383 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800384 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100385 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800386 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800387 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800388 VmsClientConnectionStateChanged vms_client_connection_state_changed =
389 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100390 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
391 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
392 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800393 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100394 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
395 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800396 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800397 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
398 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
399 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
400 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800401 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800402 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000403 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800404 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500405 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
406 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800407 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
408 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800409 CellBroadcastMessageReported cb_message_reported =
410 249 [(module) = "cellbroadcast"];
411 CellBroadcastMessageError cb_message_error =
412 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700413 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
414 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
415 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800416 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000417 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800418 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
419 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800420 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800421 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500422 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
thiruram70b08432020-06-09 18:44:02 -0700423 RankingSelected ranking_selected = 260 [(module) = "framework", (module) = "sysui"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700424 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800425 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700426 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Varun Shahacb56342019-12-18 11:45:38 -0800427 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
428 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
jasonwshsu81173e32020-03-27 15:22:03 +0800429 AccessibilityShortcutReported accessibility_shortcut_reported =
430 266 [(module) = "framework"];
jasonwshsu7b1be3e2020-04-27 15:21:07 +0800431 AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "settings"];
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -0700432 DocsUIDragAndDropReported docs_ui_drag_and_drop_reported = 268 [(module) = "docsui"];
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -0700433 AppUsageEventOccurred app_usage_event_occurred = 269 [(module) = "framework"];
Nate Myrene8f912bb2020-04-30 10:41:38 -0700434 AutoRevokeNotificationClicked auto_revoke_notification_clicked =
435 270 [(module) = "permissioncontroller"];
436 AutoRevokeFragmentAppViewed auto_revoke_fragment_app_viewed =
437 271 [(module) = "permissioncontroller"];
438 AutoRevokedAppInteraction auto_revoked_app_interaction =
439 272 [(module) = "permissioncontroller", (module) = "settings"];
440 AppPermissionGroupsFragmentAutoRevokeAction
441 app_permission_groups_fragment_auto_revoke_action =
442 273 [(module) = "permissioncontroller"];
Changyeon Jo51ae3582020-04-14 09:41:00 -0700443 EvsUsageStatsReported evs_usage_stats_reported = 274 [(module) = "evs"];
Robert Leecccdc152020-04-23 13:22:46 +0800444 AudioPowerUsageDataReported audio_power_usage_data_reported = 275;
Henry Fange316ab62020-04-21 18:43:14 -0700445 TvTunerStateChanged tv_tuner_state_changed = 276 [(module) = "framework"];
Robert Luo2f52f042020-05-11 16:39:24 +0800446 MediaOutputOpSwitchReported mediaoutput_op_switch_reported =
447 277 [(module) = "settings"];
Jordan Liu900e5cb2020-05-29 09:44:59 -0700448 CellBroadcastMessageFiltered cb_message_filtered =
449 278 [(module) = "cellbroadcast"];
Henry Fang1ae85bb2020-05-28 18:07:03 -0700450 TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
Henry Fangfd40c072020-06-01 14:59:17 -0700451 TvCasSessionOpenStatus tv_cas_session_open_status =
452 280 [(module) = "framework"];
Govinda Wassermane4640282020-04-30 09:30:56 -0400453 AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
Denny cy Leeca62fc42020-05-28 18:13:07 +0800454 DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
Mayank Gargda5ca012020-05-14 00:23:53 -0700455 CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
456 283 [(module) = "car"];
457 CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
458 284 [(module) = "car"];
459 CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
460 285 [(module) = "car"];
461 CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
462 286 [(module) = "car"];
463 CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
464 287 [(module) = "car"];
465 CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
466 288 [(module) = "car"];
467 CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
468 289 [(module) = "car"];
lifr1cc318d2020-03-19 21:58:30 +0800469 NetworkIpProvisioningReported network_ip_provisioning_reported =
470 290 [(module) = "network_stack"];
471 NetworkDhcpRenewReported network_dhcp_renew_reported = 291 [(module) = "network_stack"];
472 NetworkValidationReported network_validation_reported = 292 [(module) = "network_stack"];
473 NetworkStackQuirkReported network_stack_quirk_reported = 293 [(module) = "network_stack"];
Andy Hung48cffa32020-05-01 09:54:02 -0700474 MediametricsAudioRecordDeviceUsageReported mediametrics_audiorecorddeviceusage_reported =
475 294;
476 MediametricsAudioThreadDeviceUsageReported mediametrics_audiothreaddeviceusage_reported =
477 295;
478 MediametricsAudioTrackDeviceUsageReported mediametrics_audiotrackdeviceusage_reported =
479 296;
480 MediametricsAudioDeviceConnectionReported mediametrics_audiodeviceconnection_reported =
481 297;
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700482 BlobCommitted blob_committed = 298 [(module) = "framework"];
483 BlobLeased blob_leased = 299 [(module) = "framework"];
484 BlobOpened blob_opened = 300 [(module) = "framework"];
Tingting Wangb4ecadb2020-04-27 15:34:45 +0000485 ContactsProviderStatusReported contacts_provider_status_reported = 301;
Hasini Gunasinghe7c336a62020-05-28 10:23:01 +0000486 KeystoreKeyEventReported keystore_key_event_reported = 302;
lifr8abf3a72020-06-13 11:24:34 +0800487 NetworkTetheringReported network_tethering_reported =
488 303 [(module) = "network_tethering"];
Maryamde784e52020-06-22 11:46:48 -0700489 ImeTouchReported ime_touch_reported = 304 [(module) = "sysui"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700490
491 // StatsdStats tracks platform atoms with ids upto 500.
492 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000493 }
David Chenc8a43242017-10-17 16:23:28 -0700494
David Chen6e3e6cb2018-01-03 16:14:06 -0800495 // Pulled events will start at field 10000.
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700496 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700497 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800498 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
499 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700500 MobileBytesTransfer mobile_bytes_transfer =
501 10002 [(module) = "framework", (truncate_timestamp) = true];
502 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
503 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800504 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
505 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700506 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800507 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700508 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800509 CpuTimePerUidFreq cpu_time_per_uid_freq =
510 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800511 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
512 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
513 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
514 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
515 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700516 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700517 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700518 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700519 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800520 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
521 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700522 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800523 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800524 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800525 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800526 DiskStats disk_stats = 10025 [(module) = "framework"];
527 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
528 AppSize app_size = 10027 [(module) = "framework"];
529 CategorySize category_size = 10028 [(module) = "framework"];
530 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800531 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800532 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
533 DiskIo disk_io = 10032 [(module) = "framework"];
534 PowerProfile power_profile = 10033 [(module) = "framework"];
535 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
536 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
537 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700538 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800539 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
540 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
541 10040 [(module) = "framework"];
542 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
543 10041 [(module) = "framework"];
544 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800545 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800546 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800547 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800548 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
549 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
550 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
551 RoleHolder role_holder = 10049 [(module) = "framework"];
552 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800553 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800554 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
555 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800556 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
557 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800558 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
559 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
560 FaceSettings face_settings = 10058 [(module) = "framework"];
561 CoolingDevice cooling_device = 10059 [(module) = "framework"];
562 AppOps app_ops = 10060 [(module) = "framework"];
563 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700564 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
565 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800566 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800567 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800568 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
569 DangerousPermissionStateSampled dangerous_permission_state_sampled =
570 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400571 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000572 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000573 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200574 PackageNotificationPreferences package_notification_preferences =
575 10071 [(module) = "framework"];
576 PackageNotificationChannelPreferences package_notification_channel_preferences =
577 10072 [(module) = "framework"];
578 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
579 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800580 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800581 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700582 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
583 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
584 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
585 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800586 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700587 BlobInfo blob_info = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800588 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700589 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
590 10083 [(module) = "framework"];
Chris Wren93165692020-05-15 16:12:41 -0400591 DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700592 }
yroa1fe77c2018-02-26 14:22:54 -0800593
Bookatz76aafcf2018-09-17 16:17:10 -0700594 // DO NOT USE field numbers above 100,000 in AOSP.
595 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
596 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100597
598 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700599}
600
Yao Chend54f9dd2017-10-17 17:37:48 +0000601/**
Yangster-mac20877162017-12-22 17:19:39 -0800602 * This proto represents a node of an attribution chain.
603 * Note: All attribution chains are represented as a repeated field of type
604 * AttributionNode. It is understood that in such arrays, the order is that
605 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 */
Yangster-mac20877162017-12-22 17:19:39 -0800607message AttributionNode {
608 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800609 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800610
Yangster-mac20877162017-12-22 17:19:39 -0800611 // The (optional) string tag for an element in the attribution chain. If the
612 // element has no tag, it is encoded as an empty string.
613 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700614}
615
Yangster-mac48b3d622018-08-18 12:38:11 -0700616message KeyValuePair {
617 optional int32 key = 1;
618 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700619 int32 value_int = 2;
620 int64 value_long = 3;
621 string value_str = 4;
622 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700623 }
624}
625
626message KeyValuePairsAtom {
627 optional int32 uid = 1;
628 repeated KeyValuePair pairs = 2;
629}
630
Yao Chend54f9dd2017-10-17 17:37:48 +0000631/*
632 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800633 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000634 *
635 * RULES:
636 * - The field ids for each atom must start at 1, and count upwards by 1.
637 * Skipping field ids is not allowed.
638 * - These form an API, so renaming, renumbering or removing fields is
639 * not allowed between android releases. (This is not currently enforced,
640 * but there will be a tool to enforce this restriction).
641 * - The types must be built-in protocol buffer types, namely, no sub-messages
642 * are allowed (yet). The bytes type is also not allowed.
643 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800644 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000645 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800646 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000647 * - A field that is a uid should be a string field, tagged with the [xxx]
648 * annotation. The generated code on android will be represented by UIDs,
649 * and those UIDs will be translated in xxx to those strings.
650 *
651 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700652 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000653 * - If there is a UID, it goes first. Think in an object-oriented fashion.
654 * *****************************************************************************
655 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700656
Yao Chend54f9dd2017-10-17 17:37:48 +0000657/**
Tej Singha72344992019-04-17 18:55:08 -0700658 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700659 * Logs when the Thermal service HAL notifies the throttling start/stop events.
660 *
661 * Logged from:
662 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
663 */
664message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700665 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700666 optional android.os.TemperatureTypeEnum sensor_type = 1;
667
Maggie White442b6312019-04-05 16:26:44 -0700668 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700669 enum State {
670 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700671 START = 1; // START indicated that throttling was triggered.
672 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700673 }
Yangster-mace16189a2018-08-26 12:20:16 -0700674 optional State state = 2;
675
676 optional float temperature = 3;
677}
678
679/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000680 * Logs when the screen state changes.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
684 */
685message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800686 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800687 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700688 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700689}
Yao Chend54f9dd2017-10-17 17:37:48 +0000690
691/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700692 * Logs that the process state of the uid, as determined by ActivityManager
693 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000694 *
695 * Logged from:
696 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
697 */
Bookatzc1a050a2017-10-10 15:49:28 -0700698message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700699 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000700
Bookatzdb026a22018-01-10 19:01:56 -0800701 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800702 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700703 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000704}
705
706/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700707 * Logs process state change of a process, as per the activity manager.
708 *
709 * Logged from:
710 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
711 */
712message ProcessStateChanged {
713 optional int32 uid = 1;
714 optional string process_name = 2;
715 optional string package_name = 3;
716 // TODO: remove this when validation is done
717 optional int64 version = 5;
718 // The state, from frameworks/base/core/proto/android/app/enums.proto.
719 optional android.app.ProcessStateEnum state = 4;
720}
721
722/**
723 * Logs when ActivityManagerService sleep state is changed.
724 *
725 * Logged from:
726 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
727 */
728message ActivityManagerSleepStateChanged {
729 // TODO: import frameworks proto
730 enum State {
731 UNKNOWN = 0;
732 ASLEEP = 1;
733 AWAKE = 2;
734 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700735 optional State state = 1
736 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700737}
738
739/**
740 * Logs when system memory state changes.
741 *
742 * Logged from:
743 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
744 */
745message MemoryFactorStateChanged {
746 // TODO: import frameworks proto
747 enum State {
748 MEMORY_UNKNOWN = 0;
749 NORMAL = 1; // normal.
750 MODERATE = 2; // moderate memory pressure.
751 LOW = 3; // low memory.
752 CRITICAL = 4; // critical memory.
753
754 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700755 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700756}
757
758/**
759 * Logs when app is using too much cpu, according to ActivityManagerService.
760 *
761 * Logged from:
762 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
763 */
764message ExcessiveCpuUsageReported {
765 optional int32 uid = 1;
766 optional string process_name = 2;
767 optional string package_name = 3;
768 // package version. TODO: remove this when validation is done
769 optional int64 version = 4;
770}
771
772/**
773 * Logs when a cached process is killed, along with its pss.
774 *
775 * Logged from:
776 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
777 */
778message CachedKillReported {
779 optional int32 uid = 1;
780 optional string process_name = 2;
781 optional string package_name = 3;
782 // TODO: remove this when validation is done
783 optional int64 version = 5;
784 optional int64 pss = 4;
785}
786
787/**
xshu2c3d9e42019-09-26 17:54:02 -0700788 * Logs the change in wifi health.
789 *
790 * Logged from:
791 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
792 */
793message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800794 enum Band {
795 UNKNOWN = 0;
796 // All of 2.4GHz band
797 BAND_2G = 1;
798 // Frequencies in the range of [5150, 5250) GHz
799 BAND_5G_LOW = 2;
800 // Frequencies in the range of [5250, 5725) GHz
801 BAND_5G_MIDDLE = 3;
802 // Frequencies in the range of [5725, 5850) GHz
803 BAND_5G_HIGH = 4;
804 // Frequencies in the range of [5925, 6425) GHz
805 BAND_6G_LOW = 5;
806 // Frequencies in the range of [6425, 6875) GHz
807 BAND_6G_MIDDLE = 6;
808 // Frequencies in the range of [6875, 7125) GHz
809 BAND_6G_HIGH = 7;
810 }
xshu2c3d9e42019-09-26 17:54:02 -0700811 // duration this stat is obtained over in milliseconds
812 optional int32 duration_millis = 1;
813 // whether wifi is classified as sufficient for the user's data traffic, determined
814 // by whether the calculated throughput exceeds the average demand within |duration_millis|
815 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700816 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800817 optional bool is_cell_data_available = 3;
818 // the Band bucket the connected network is on
819 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700820}
821
822/**
823 * Logged when wifi detects a significant change in connection failure rate.
824 *
825 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
826 *
827 */
828message WifiFailureStatReported {
829 enum AbnormalityType {
830 UNKNOWN = 0;
831 SIGNIFICANT_INCREASE = 1;
832 SIGNIFICANT_DECREASE = 2;
833 SIMPLY_HIGH = 3;
834 }
835 enum FailureType {
836 FAILURE_UNKNOWN = 0;
837 FAILURE_CONNECTION = 1;
838 FAILURE_ASSOCIATION_REJECTION = 2;
839 FAILURE_ASSOCIATION_TIMEOUT = 3;
840 FAILURE_AUTHENTICATION = 4;
841 FAILURE_NON_LOCAL_DISCONNECTION = 5;
842 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
843 }
844 // Reason for uploading this stat
845 optional AbnormalityType abnormality_type = 1;
846 // The particular type of failure
847 optional FailureType failure_type = 2;
848 // How many times we have encountered this combination of AbnormalityType and FailureType
849 optional int32 failure_count = 3;
850}
851
852/**
853 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
854 *
855 * Logged from:
856 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
857 */
858message WifiConnectionResultReported {
859 enum FailureCode {
860 FAILURE_UNKNOWN = 0;
861 FAILURE_ASSOCIATION_TIMEOUT = 1;
862 FAILURE_ASSOCIATION_REJECTION = 2;
863 FAILURE_AUTHENTICATION_GENERAL = 3;
864 FAILURE_AUTHENTICATION_EAP = 4;
865 FAILURE_DHCP = 5;
866 FAILURE_NETWORK_DISCONNECTION = 6;
867 FAILURE_ROAM_TIMEOUT = 7;
868 }
869 // true represents a successful connection
870 optional bool connection_result = 1;
871 // reason for the connection failure
872 optional FailureCode failure_code = 2;
873 // scan rssi before the connection attempt
874 optional int32 rssi = 3;
875}
876
877/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700878 * Logs when memory stats of a process is reported.
879 *
880 * Logged from:
881 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
882 */
883message ProcessMemoryStatReported {
884 optional int32 uid = 1;
885 optional string process_name = 2;
886 optional string package_name = 3;
887 //TODO: remove this when validation is done
888 optional int64 version = 9;
889 optional int64 pss = 4;
890 optional int64 uss = 5;
891 optional int64 rss = 6;
892 enum Type {
893 ADD_PSS_INTERNAL_SINGLE = 0;
894 ADD_PSS_INTERNAL_ALL_MEM = 1;
895 ADD_PSS_INTERNAL_ALL_POLL = 2;
896 ADD_PSS_EXTERNAL = 3;
897 ADD_PSS_EXTERNAL_SLOW = 4;
898 }
899 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800900 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700901}
902
903/**
Bookatzc1a050a2017-10-10 15:49:28 -0700904 * Logs that a process started, finished, crashed, or ANRed.
905 *
906 * Logged from:
907 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
908 */
909message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700910 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700911
David Chen0b5c90c2018-01-25 16:51:49 -0800912 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800913 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
Bookatzddccf0a2017-11-28 16:48:14 -0800915 // What lifecycle state the process changed to.
916 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800917 enum State {
918 FINISHED = 0;
919 STARTED = 1;
920 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800921 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800922 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700923}
924
Bookatzc1a050a2017-10-10 15:49:28 -0700925/**
926 * Logs when the ble scan state changes.
927 *
928 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700929 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700930 */
931message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800932 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700933 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700934
935 enum State {
936 OFF = 0;
937 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700938 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
939 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700940 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800941 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700942 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800943 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700944 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800945 (state_field_option).nested = true
946 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700947
Bookatze5ec0b42018-03-26 13:34:56 -0700948 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700949 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700950 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700951 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700952 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700953 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700954}
955
956/**
957 * Logs reporting of a ble scan finding results.
958 *
959 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700960 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700961 */
Bookatzae6738e2018-09-13 11:38:56 -0700962// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700963message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800964 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700965
966 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800967 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700968}
969
970/**
971 * Logs when a sensor state changes.
972 *
973 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700974 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700975 */
976message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800977 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700978
Bookatzc1a050a2017-10-10 15:49:28 -0700979 // The id (int) of the sensor.
980 optional int32 sensor_id = 2;
981
982 enum State {
983 OFF = 0;
984 ON = 1;
985 }
986 optional State state = 3;
987}
988
Bookatzc1a050a2017-10-10 15:49:28 -0700989/**
990 * Logs when GPS state changes.
991 *
992 * Logged from:
993 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
994 */
995message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800996 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700997
998 enum State {
999 OFF = 0;
1000 ON = 1;
1001 }
1002 optional State state = 2;
1003}
1004
Bookatz48d362e2018-11-06 15:49:08 -08001005/**
1006 * Logs when GPS signal quality.
1007 *
1008 * Logged from:
1009 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
1010 */
1011message GpsSignalQualityChanged {
1012 optional android.server.location.GpsSignalQualityEnum level = 1;
1013}
1014
Bookatzc1a050a2017-10-10 15:49:28 -07001015
1016/**
1017 * Logs when a sync manager sync state changes.
1018 *
1019 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001020 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001021 */
1022message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001023 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001024
David Chen0b5c90c2018-01-25 16:51:49 -08001025 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001026 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001027
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
1031 }
1032 optional State state = 3;
1033}
1034
Yangster-mac96353002018-09-05 11:18:55 -07001035/*
1036 * Deferred job stats.
1037 *
1038 * Logged from:
1039 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1040*/
1041message DeferredJobStatsReported {
1042 repeated AttributionNode attribution_node = 1;
1043
1044 // Number of jobs deferred.
1045 optional int32 num_jobs_deferred = 2;
1046
1047 // Time since the last job runs.
1048 optional int64 time_since_last_job_millis = 3;
1049}
1050
Bookatzc1a050a2017-10-10 15:49:28 -07001051/**
1052 * Logs when a job scheduler job state changes.
1053 *
1054 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001055 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001056 */
1057message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001058 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001059
1060 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001061 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001062
1063 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001064 FINISHED = 0;
1065 STARTED = 1;
1066 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001067 }
1068 optional State state = 3;
1069
Tej Singh33a412b2018-03-16 18:43:59 -07001070 // The reason a job has stopped.
1071 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001072 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001073 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001074
1075 // The standby bucket of the app that scheduled the job. These match the framework constants
1076 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1077 // already assigned 0.
1078 enum Bucket {
1079 UNKNOWN = -1;
1080 ACTIVE = 0;
1081 WORKING_SET = 1;
1082 FREQUENT = 2;
1083 RARE = 3;
1084 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001085 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001086 }
1087 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1088
1089 // The job id (as assigned by the app).
1090 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001091
1092 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1093 // constraints as they are always assumed to be set.
1094 optional bool has_charging_constraint = 7;
1095 optional bool has_battery_not_low_constraint = 8;
1096 optional bool has_storage_not_low_constraint = 9;
1097 optional bool has_timing_delay_constraint = 10;
1098 optional bool has_deadline_constraint = 11;
1099 optional bool has_idle_constraint = 12;
1100 optional bool has_connectivity_constraint = 13;
1101 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001102}
1103
1104/**
1105 * Logs when the audio state changes.
1106 *
1107 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001108 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001109 */
1110message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001111 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001112
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001116 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1117 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001118 }
1119 optional State state = 2;
1120}
1121
1122/**
1123 * Logs when the video codec state changes.
1124 *
1125 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001126 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001127 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001128message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001129 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001130
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001134 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1135 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001136 }
1137 optional State state = 2;
1138}
1139
1140/**
1141 * Logs when the flashlight state changes.
1142 *
1143 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001144 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001145 */
1146message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001147 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001148
1149 enum State {
1150 OFF = 0;
1151 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001152 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1153 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001154 }
1155 optional State state = 2;
1156}
1157
1158/**
1159 * Logs when the camera state changes.
1160 *
1161 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001162 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001163 */
1164message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001165 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001166
1167 enum State {
1168 OFF = 0;
1169 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001170 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1171 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001172 }
1173 optional State state = 2;
1174}
1175
1176/**
1177 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001178 *
1179 * Logged from:
1180 * TODO
1181 */
Bookatzd6746242017-10-24 18:39:35 -07001182message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001183 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001184 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001185
Bookatz1a1b0462018-01-12 11:47:03 -08001186 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1187 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001188 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001189
1190 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001191 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001192
1193 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001194 RELEASE = 0;
1195 ACQUIRE = 1;
1196 CHANGE_RELEASE = 2;
1197 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001198 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001199 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001200 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001201 (state_field_option).default_state_value = 0,
1202 (state_field_option).nested = true
1203 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001204}
1205
1206/**
Bookatzc1a050a2017-10-10 15:49:28 -07001207 * Logs when a partial wakelock is considered 'long' (over 1 min).
1208 *
1209 * Logged from:
1210 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1211 */
1212message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001213 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001214
Yao Chend54f9dd2017-10-17 17:37:48 +00001215 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1216 optional string tag = 2;
1217
Bookatzc1a050a2017-10-10 15:49:28 -07001218 // TODO: I have no idea what this is.
1219 optional string history_tag = 3;
1220
1221 enum State {
1222 OFF = 0;
1223 ON = 1;
1224 }
1225 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001226}
1227
Bookatzc1a050a2017-10-10 15:49:28 -07001228/**
Bookatza66083f2018-09-20 17:24:00 -07001229 * Logs when the device is interactive, according to the PowerManager Notifier.
1230 *
1231 * Logged from:
1232 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1233 */
1234message InteractiveStateChanged {
1235 enum State {
1236 OFF = 0;
1237 ON = 1;
1238 }
1239 optional State state = 1;
1240}
1241
1242/**
Bookatzc1a050a2017-10-10 15:49:28 -07001243 * Logs Battery Saver state change.
1244 *
1245 * Logged from:
1246 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1247 */
1248message BatterySaverModeStateChanged {
1249 enum State {
1250 OFF = 0;
1251 ON = 1;
1252 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001253 optional State state = 1
1254 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001255}
1256
1257/**
1258 * Logs Doze mode state change.
1259 *
1260 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001261 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001262 */
1263message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001264 optional android.server.DeviceIdleModeEnum state = 1
1265 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001266}
1267
1268
1269/**
1270 * Logs state change of Doze mode including maintenance windows.
1271 *
1272 * Logged from:
1273 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1274 */
1275message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001276 optional android.server.DeviceIdleModeEnum state = 1
1277 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001278}
1279
1280/**
1281 * Logs screen brightness level.
1282 *
1283 * Logged from:
1284 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1285 */
1286message ScreenBrightnessChanged {
1287 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1288 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001289}
1290
1291/**
1292 * Logs battery level (percent full, from 0 to 100).
1293 *
1294 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001295 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001296 */
1297message BatteryLevelChanged {
1298 // Battery level. Should be in [0, 100].
1299 optional int32 battery_level = 1;
1300}
1301
1302/**
1303 * Logs change in charging status of the device.
1304 *
1305 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001306 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001307 */
1308message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001309 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001310 optional android.os.BatteryStatusEnum state = 1
1311 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001312}
1313
1314/**
1315 * Logs whether the device is plugged in, and what power source it is using.
1316 *
1317 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001318 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001319 */
1320message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001321 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001322 optional android.os.BatteryPluggedStateEnum state = 1
1323 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001324}
1325
Bookatz8c6571b2017-10-24 15:04:41 -07001326/**
1327 * Logs when an app's wakeup alarm fires.
1328 *
1329 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001330 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001331 */
1332message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001333 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001334
1335 // Name of the wakeup alarm.
1336 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001337
1338 // Name of source package (for historical reasons, since BatteryStats tracked it).
1339 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001340
Ben Murdoch3389f1522019-05-21 15:05:34 +01001341 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001342 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001343}
1344
1345/**
1346 * Logs when an an app causes the mobile radio to change state.
1347 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1348 *
1349 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001350 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001351 */
1352message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001353 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001354
Bookatz1a1b0462018-01-12 11:47:03 -08001355 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1356 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001357}
1358
1359/**
1360 * Logs when an an app causes the wifi radio to change state.
1361 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1362 *
1363 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001364 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001365 */
1366message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001367 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001368
Bookatz1a1b0462018-01-12 11:47:03 -08001369 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1370 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001371}
1372
1373/**
1374 * Logs kernel wakeup reasons and aborts.
1375 *
1376 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001377 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001378 */
1379message KernelWakeupReported {
1380 // Name of the kernel wakeup reason (or abort).
1381 optional string wakeup_reason_name = 1;
1382
1383 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001384 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001385}
1386
1387/**
Bookatzda1798c2018-12-13 14:16:00 -08001388 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001389 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001390 *
1391 * Logged from:
1392 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1393 */
1394message WifiEnabledStateChanged {
1395 enum State {
1396 OFF = 0;
1397 ON = 1;
1398 }
1399 optional State state = 1;
1400}
1401
1402/**
tsaichristinececebdc2020-02-04 14:05:56 -08001403 * This atom is deprecated starting in R.
1404 *
Bookatzda1798c2018-12-13 14:16:00 -08001405 * 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 -08001406 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1407 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001408 *
1409 * Logged from:
1410 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1411 */
1412message WifiRunningStateChanged {
1413 repeated AttributionNode attribution_node = 1;
1414
1415 enum State {
1416 OFF = 0;
1417 ON = 1;
1418 }
1419 optional State state = 2;
1420}
1421
1422/**
Bookatze5885242017-10-24 20:10:31 -07001423 * Logs wifi locks held by an app.
1424 *
1425 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001426 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001427 */
1428message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001429 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001430
1431 enum State {
1432 OFF = 0;
1433 ON = 1;
1434 }
1435 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001436
1437 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1438 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001439}
1440
1441/**
1442 * Logs wifi signal strength changes.
1443 *
1444 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001445 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001446 */
1447message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001448 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1449 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001450}
1451
1452/**
1453 * Logs wifi scans performed by an app.
1454 *
1455 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001456 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001457 */
1458message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001459 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001460
1461 enum State {
1462 OFF = 0;
1463 ON = 1;
1464 }
1465 optional State state = 2;
1466}
1467
1468/**
Tej Singh4503e102018-01-04 14:35:01 -08001469 * Logs wifi multicast locks held by an app
1470 *
1471 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001472 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001473 */
1474message WifiMulticastLockStateChanged {
1475 repeated AttributionNode attribution_node = 1;
1476
1477 enum State {
1478 OFF = 0;
1479 ON = 1;
1480 }
1481 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001482
1483 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001484}
1485
1486/**
Tej Singh1ea42892018-01-19 09:27:00 -08001487 * Logs shutdown reason and duration on next boot.
1488 *
1489 * Logged from:
1490 * frameworks/base/core/java/com/android/server/BootReceiver.java
1491 */
1492message ShutdownSequenceReported {
1493 // True if shutdown is for a reboot. Default: false if we do not know.
1494 optional bool reboot = 1;
1495
1496 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1497 optional string reason = 2;
1498
1499 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1500 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001501 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001502
1503 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001504 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001505}
1506
Tej Singh6483ea42018-01-25 17:45:49 -08001507
1508/**
1509 * Logs boot reason and duration.
1510 *
1511 * Logged from:
1512 * system/core/bootstat/bootstat.cpp
1513 */
1514message BootSequenceReported {
1515 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1516 // Default: "<EMPTY>" if not available.
1517 optional string bootloader_reason = 1;
1518
1519 // Reason for system boot. Eg. bootloader, reboot,userrequested
1520 // Default: "<EMPTY>" if not available.
1521 optional string system_reason = 2;
1522
1523 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001524 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001525
1526 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001527 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001528
1529 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001530 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001531
1532 // Time since last boot in ms. Default: 0 if not available.
1533 optional int64 time_since_last_boot = 6;
1534}
1535
Tej Singhc477d9c2018-02-05 18:31:39 -08001536
1537/**
1538 * Logs call state and disconnect cause (if applicable).
1539 *
1540 * Logged from:
1541 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1542 */
1543message CallStateChanged {
1544 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1545 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1546 optional android.telecom.CallStateEnum call_state = 1;
1547
1548 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1549 // This value is only applicable when the call_state is DISCONNECTED, and
1550 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1551 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1552 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1553
1554 // True if the call is self-managed, which are apps that use the
1555 // telecom infrastructure to make their own calls.
1556 optional bool self_managed = 3;
1557
1558 // True if call is external. External calls are calls on connected Wear
1559 // devices but show up in Telecom so the user can pull them onto the device.
1560 optional bool external_call = 4;
1561}
1562
Tej Singh1ea42892018-01-19 09:27:00 -08001563/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001564 * Logs keyguard state. The keyguard is the lock screen.
1565 *
1566 * Logged from:
1567 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1568 */
1569message KeyguardStateChanged {
1570 enum State {
1571 UNKNOWN = 0;
1572 // The keyguard is hidden when the phone is unlocked.
1573 HIDDEN = 1;
1574 // The keyguard is shown when the phone is locked (screen turns off).
1575 SHOWN= 2;
1576 // The keyguard is occluded when something is overlaying the keyguard.
1577 // Eg. Opening the camera while on the lock screen.
1578 OCCLUDED = 3;
1579 }
1580 optional State state = 1;
1581}
1582
1583/**
1584 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1585 * prompts the user to enter a password (pattern, pin, etc).
1586 *
1587 * Logged from:
1588 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1589 */
1590
1591message KeyguardBouncerStateChanged {
1592 enum State {
1593 UNKNOWN = 0;
1594 // Bouncer is hidden, either as a result of successfully entering the
1595 // password, screen timing out, or user going back to lock screen.
1596 HIDDEN = 1;
1597 // This is when the user is being prompted to enter the password.
1598 SHOWN = 2;
1599 }
1600 optional State state = 1;
1601}
1602
1603/**
1604 * Logs the result of entering a password into the keyguard bouncer.
1605 *
1606 * Logged from:
1607 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1608 */
1609message KeyguardBouncerPasswordEntered {
1610 enum BouncerResult {
1611 UNKNOWN = 0;
1612 // The password entered was incorrect.
1613 FAILURE = 1;
1614 // The password entered was correct.
1615 SUCCESS = 2;
1616 }
1617 optional BouncerResult result = 1;
1618}
1619
Tej Singha883b372018-02-15 11:30:01 -08001620/*
1621 * Logs changes to the configuration of the device. The configuration is defined
1622 * in frameworks/base/core/java/android/content/res/Configuration.java
1623 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1624 * Please go there to interpret the possible values each field can be.
1625 *
1626 * Logged from:
1627 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1628 */
1629message ResourceConfigurationChanged {
1630 // Bit mask of color capabilities of the screen.
1631 // Contains information about the color gamut and hdr mode of the screen.
1632 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001633 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001634
1635 // The target screen density being rendered to.
1636 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001637 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001638
1639 // Current user preference for the scaling factor for fonts,
1640 // relative to the base density scaling.
1641 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001642 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001643
1644 // Flag indicating whether the hard keyboard is hidden.
1645 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001646 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001647
1648 // The type of keyboard attached to the device.
1649 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1650 optional int32 keyboard = 5;
1651
1652 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1653 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001654 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001655
1656 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1657 // 0 if undefined.
1658 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1659 optional int32 mcc = 7;
1660
1661 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1662 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1663 // MNC_ZERO symbol defined in Configuration.java.
1664 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1665 optional int32 mnc = 8;
1666
1667 // The kind of navigation available on the device.
1668 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1669 optional int32 navigation = 9;
1670
1671 // Flag indicating whether the navigation is available.
1672 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001673 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001674
1675 // Overall orientation of the screen.
1676 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1677 optional int32 orientation = 11;
1678
1679 // The current height of the available screen space, in dp units.
1680 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001681 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001682
1683 // Bit mask of overall layout of the screen.
1684 // Contains information about screen size, whether the screen is wider/taller
1685 // than normal, whether the screen layout is right-tl-left or left-to-right,
1686 // and whether the screen has a rounded shape.
1687 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001688 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001689
1690 // Current width of the available screen space, in dp units.
1691 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001692 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001693
1694 // The smallest screen size an application will see in normal operation.
1695 // This is the smallest value of both screenWidthDp and screenHeightDp
1696 // in portrait and landscape.
1697 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001698 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001699
1700 // The type of touch screen attached to the device.
1701 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1702 optional int32 touchscreen = 16;
1703
1704 // Bit mask of the ui mode.
1705 // Contains information about the overall ui mode of the device.
1706 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1707 // Also contains information about whether the device is in night mode.
1708 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001709 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001710}
1711
Tej Singheee317b2018-03-07 19:28:05 -08001712
1713/**
1714 * Logs changes in the connection state of the mobile radio.
1715 *
1716 * Logged from:
1717 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1718 */
1719message MobileConnectionStateChanged {
1720 // States are from the state machine DataConnection.java.
1721 enum State {
1722 UNKNOWN = 0;
1723 // The connection is inactive, or disconnected.
1724 INACTIVE = 1;
1725 // The connection is being activated, or connecting.
1726 ACTIVATING = 2;
1727 // The connection is active, or connected.
1728 ACTIVE = 3;
1729 // The connection is disconnecting.
1730 DISCONNECTING = 4;
1731 // The connection is disconnecting after creating a connection.
1732 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1733 }
1734 optional State state = 1;
1735 // For multi-sim phones, this distinguishes between the sim cards.
1736 optional int32 sim_slot_index = 2;
1737 // Used to identify the connection. Starts at 0 and increments by 1 for
1738 // every new network created. Resets whenever the device reboots.
1739 optional int32 data_connection_id = 3;
1740 // A bitmask for the capabilities of this connection.
1741 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1742 // Default value (if we have no information): 0
1743 optional int64 capabilities = 4;
1744 // If this connection has internet.
1745 // This just checks if the DEFAULT bit of capabilities is set.
1746 optional bool has_internet = 5;
1747}
1748
1749/**
1750 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1751 *
1752 * Logged from:
1753 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1754 */
1755message MobileRadioTechnologyChanged {
1756 optional android.telephony.NetworkTypeEnum state = 1;
1757 // For multi-sim phones, this distinguishes between the sim cards.
1758 optional int32 sim_slot_index = 2;
1759}
1760
Andrew Chantb56388b2018-03-22 21:07:33 -07001761/**
1762 * Logs the VID and PID of any connected USB devices.
1763 *
1764 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1765 *
1766 * Logged by Vendor.
1767 */
1768message UsbDeviceAttached {
1769 optional int32 vid = 1;
1770 optional int32 pid = 2;
1771 optional bool has_audio = 3;
1772 optional bool has_hid = 4;
1773 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001774 enum State {
1775 STATE_DISCONNECTED = 0;
1776 STATE_CONNECTED = 1;
1777 }
1778 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001779 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001780}
1781
Tej Singheee317b2018-03-07 19:28:05 -08001782
Tej Singhdd7bd352018-02-09 19:33:15 -08001783/**
Tej Singh5d991e12018-03-09 19:48:11 -08001784 * Logs when Bluetooth is enabled and disabled.
1785 *
1786 * Logged from:
1787 * services/core/java/com/android/server/BluetoothManagerService.java
1788 */
1789message BluetoothEnabledStateChanged {
1790 repeated AttributionNode attribution_node = 1;
1791 // Whether or not bluetooth is enabled on the device.
1792 enum State {
1793 UNKNOWN = 0;
1794 ENABLED = 1;
1795 DISABLED = 2;
1796 }
1797 optional State state = 2;
1798 // The reason for being enabled/disabled.
1799 // Eg. Airplane mode, crash, application request.
1800 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1801 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001802 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001803}
1804
1805/**
Jack Hed9837c82019-01-09 01:19:13 -08001806 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001807 *
1808 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001809 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1810 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001811 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001812 */
1813message BluetoothConnectionStateChanged {
1814 // The state of the connection.
1815 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1816 optional android.bluetooth.ConnectionStateEnum state = 1;
1817 // An identifier that can be used to match connect and disconnect events.
1818 // Currently is last two bytes of a hash of a device level ID and
1819 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001820 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001821 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001822 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1823 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001824 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001825 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001826 // An identifier that can be used to match events for this device.
1827 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1828 // Salt: Randomly generated 256 bit value
1829 // Hash algorithm: HMAC-SHA256
1830 // Size: 32 byte
1831 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001832 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001833 // An identifier that can be used to match events for this device.
1834 // The incremental identifier is locally generated and guaranteed not derived
1835 // from any globally unique hardware id.
1836 // For paired devices, it stays consistent between Bluetooth toggling for the
1837 // same remote device.
1838 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1839 // session for the same remote device.
1840 // Default: 0 if the device's metric id is unknown.
1841 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001842}
1843
1844/**
1845 * Logs when a Bluetooth device connects and disconnects over ACL
1846 *
1847 * Logged from:
1848 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1849 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001850 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001851 */
1852message BluetoothAclConnectionStateChanged {
1853 // An identifier that can be used to match events for this device.
1854 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1855 // Salt: Randomly generated 256 bit value
1856 // Hash algorithm: HMAC-SHA256
1857 // Size: 32 byte
1858 // Default: null or empty if the device identifier is not known
1859 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1860 // The state of the connection.
1861 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1862 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001863 // An identifier that can be used to match events for this device.
1864 // The incremental identifier is locally generated and guaranteed not derived
1865 // from any globally unique hardware id.
1866 // For paired devices, it stays consistent between Bluetooth toggling for the
1867 // same remote device.
1868 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1869 // session for the same remote device.
1870 // Default: 0 if the device's metric id is unknown.
1871 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001872}
1873
1874/**
1875 * Logs when a Bluetooth device connects and disconnects over SCO
1876 *
1877 * Logged from:
1878 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1879 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1880 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001881 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001882 */
1883message BluetoothScoConnectionStateChanged {
1884 // An identifier that can be used to match events for this device.
1885 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1886 // Salt: Randomly generated 256 bit value
1887 // Hash algorithm: HMAC-SHA256
1888 // Size: 32 byte
1889 // Default: null or empty if the device identifier is not known
1890 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1891 // The state of the connection.
1892 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1893 optional android.bluetooth.ConnectionStateEnum state = 2;
1894 // Codec used for this SCO connection
1895 // Default: UNKNOWN
1896 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001897 // An identifier that can be used to match events for this device.
1898 // The incremental identifier is locally generated and guaranteed not derived
1899 // from any globally unique hardware id.
1900 // For paired devices, it stays consistent between Bluetooth toggling for the
1901 // same remote device.
1902 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1903 // session for the same remote device.
1904 // Default: 0 if the device's metric id is unknown.
1905 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001906}
1907
Jack Hec27040a2019-01-09 20:54:41 -08001908/**
1909 * Logged when active device of a profile changes
1910 *
1911 * Logged from:
1912 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1913 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1914 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1915 */
1916message BluetoothActiveDeviceChanged {
1917 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1918 // From android.bluetooth.BluetoothProfile
1919 optional int32 bt_profile = 1;
1920 // An identifier that can be used to match events for this new active device.
1921 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1922 // Salt: Randomly generated 256 bit value
1923 // Hash algorithm: HMAC-SHA256
1924 // Size: 32 byte
1925 // Default: null or empty if there is no active device for this profile
1926 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001927 // An identifier that can be used to match events for this device.
1928 // The incremental identifier is locally generated and guaranteed not derived
1929 // from any globally unique hardware id.
1930 // For paired devices, it stays consistent between Bluetooth toggling for the
1931 // same remote device.
1932 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1933 // session for the same remote device.
1934 // Default: 0 if the device's metric id is unknown.
1935 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001936}
1937
Jack Heab86dbd22018-12-18 15:43:27 -08001938// Logs when there is an event affecting Bluetooth device's link layer connection.
1939// - This event is triggered when there is a related HCI command or event
1940// - Users of this metrics can deduce Bluetooth device's connection state from these events
1941// - HCI commands are logged before the command is sent, after receiving command status, and after
1942// receiving command complete
1943// - HCI events are logged when they arrive
1944//
1945// Low level log from system/bt
1946//
1947// Bluetooth classic commands:
1948// - CMD_CREATE_CONNECTION
1949// - CMD_DISCONNECT
1950// - CMD_CREATE_CONNECTION_CANCEL
1951// - CMD_ACCEPT_CONNECTION_REQUEST
1952// - CMD_REJECT_CONNECTION_REQUEST
1953// - CMD_SETUP_ESCO_CONNECTION
1954// - CMD_ACCEPT_ESCO_CONNECTION
1955// - CMD_REJECT_ESCO_CONNECTION
1956// - CMD_ENH_SETUP_ESCO_CONNECTION
1957// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1958//
1959// Bluetooth low energy commands:
1960// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1961// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1962// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1963// - CMD_BLE_CLEAR_WHITE_LIST
1964// - CMD_BLE_ADD_WHITE_LIST
1965// - CMD_BLE_REMOVE_WHITE_LIST
1966//
1967// Bluetooth classic events:
1968// - EVT_CONNECTION_COMP
1969// - EVT_CONNECTION_REQUEST
1970// - EVT_DISCONNECTION_COMP
1971// - EVT_ESCO_CONNECTION_COMP
1972// - EVT_ESCO_CONNECTION_CHANGED
1973//
1974// Bluetooth low energy meta events:
1975// - BLE_EVT_CONN_COMPLETE_EVT
1976// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1977//
1978// Next tag: 10
1979message BluetoothLinkLayerConnectionEvent {
1980 // An identifier that can be used to match events for this device.
1981 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1982 // Salt: Randomly generated 256 bit value
1983 // Hash algorithm: HMAC-SHA256
1984 // Size: 32 byte
1985 // Default: null or empty if the device identifier is not known
1986 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1987 // Connection handle of this connection if available
1988 // Range: 0x0000 - 0x0EFF (12 bits)
1989 // Default: 0xFFFF if the handle is unknown
1990 optional int32 connection_handle = 2;
1991 // Direction of the link
1992 // Default: DIRECTION_UNKNOWN
1993 optional android.bluetooth.DirectionEnum direction = 3;
1994 // Type of this link
1995 // Default: LINK_TYPE_UNKNOWN
1996 optional android.bluetooth.LinkTypeEnum type = 4;
1997
1998 // Reason metadata for this link layer connection event, rules for interpretation:
1999 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
2000 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
2001 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
2002 // set and valid, ignore hci_ble_event
2003
2004 // HCI command associated with this event
2005 // Default: CMD_UNKNOWN
2006 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
2007 // HCI event associated with this event
2008 // Default: EVT_UNKNOWN
2009 optional android.bluetooth.hci.EventEnum hci_event = 6;
2010 // HCI BLE meta event associated with this event
2011 // Default: BLE_EVT_UNKNOWN
2012 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
2013 // HCI command status code if this is triggerred by hci_cmd
2014 // Default: STATUS_UNKNOWN
2015 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
2016 // HCI reason code associated with this event
2017 // Default: STATUS_UNKNOWN
2018 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002019 // An identifier that can be used to match events for this device.
2020 // The incremental identifier is locally generated and guaranteed not derived
2021 // from any globally unique hardware id.
2022 // For paired devices, it stays consistent between Bluetooth toggling for the
2023 // same remote device.
2024 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2025 // session for the same remote device.
2026 // Default: 0 if the device's metric id is unknown.
2027 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002028}
2029
Howard Roe103fe22019-01-17 16:52:16 -08002030/**
2031 * Logs when a module is rolled back by Watchdog.
2032 *
2033 * Logged from: Rollback Manager
2034 */
2035message WatchdogRollbackOccurred {
2036 enum RollbackType {
2037 UNKNOWN = 0;
2038 ROLLBACK_INITIATE = 1;
2039 ROLLBACK_SUCCESS = 2;
2040 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002041 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002042 }
2043 optional RollbackType rollback_type = 1;
2044
2045 optional string package_name = 2;
2046
2047 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002048
2049 enum RollbackReasonType {
2050 REASON_UNKNOWN = 0;
2051 REASON_NATIVE_CRASH = 1;
2052 REASON_EXPLICIT_HEALTH_CHECK = 2;
2053 REASON_APP_CRASH = 3;
2054 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002055 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002056 }
2057 optional RollbackReasonType rollback_reason = 4;
2058
2059 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2060 // is initiated. Empty if the package is unknown.
2061 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002062
2063 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002064}
2065
Jack Hec27040a2019-01-09 20:54:41 -08002066/**
2067 * Logs when there is a change in Bluetooth A2DP playback state
2068 *
2069 * Logged from:
2070 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2071 */
2072message BluetoothA2dpPlaybackStateChanged {
2073 // An identifier that can be used to match events for this device.
2074 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2075 // Salt: Randomly generated 256 bit value
2076 // Hash algorithm: HMAC-SHA256
2077 // Size: 32 byte
2078 // Default: null or empty if the device identifier is not known
2079 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2080 // Current playback state
2081 // Default: PLAYBACK_STATE_UNKNOWN
2082 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2083 // Current audio coding mode
2084 // Default: AUDIO_CODING_MODE_UNKNOWN
2085 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002086 // An identifier that can be used to match events for this device.
2087 // The incremental identifier is locally generated and guaranteed not derived
2088 // from any globally unique hardware id.
2089 // For paired devices, it stays consistent between Bluetooth toggling for the
2090 // same remote device.
2091 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2092 // session for the same remote device.
2093 // Default: 0 if the device's metric id is unknown.
2094 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002095}
2096
2097/**
2098 * Logs when there is a change in A2DP codec config for a particular remote device
2099 *
2100 * Logged from:
2101 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2102 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2103 */
2104message BluetoothA2dpCodecConfigChanged {
2105 // An identifier that can be used to match events for this device.
2106 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2107 // Salt: Randomly generated 256 bit value
2108 // Hash algorithm: HMAC-SHA256
2109 // Size: 32 byte
2110 // Default: null or empty if the device identifier is not known
2111 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2112 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2113 // Default SOURCE_CODEC_TYPE_INVALID
2114 optional int32 codec_type = 2;
2115 // Codec priroity, the higher the more preferred, -1 for disabled
2116 // Default: CODEC_PRIORITY_DEFAULT
2117 optional int32 codec_priority = 3;
2118 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2119 // Default: SAMPLE_RATE_NONE
2120 optional int32 sample_rate = 4;
2121 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2122 // Default: BITS_PER_SAMPLE_NONE
2123 optional int32 bits_per_sample = 5;
2124 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2125 // Default: CHANNEL_MODE_NONE
2126 optional int32 channel_mode = 6;
2127 // Codec specific values
2128 // Default 0
2129 optional int64 codec_specific_1 = 7;
2130 optional int64 codec_specific_2 = 8;
2131 optional int64 codec_specific_3 = 9;
2132 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002133 // An identifier that can be used to match events for this device.
2134 // The incremental identifier is locally generated and guaranteed not derived
2135 // from any globally unique hardware id.
2136 // For paired devices, it stays consistent between Bluetooth toggling for the
2137 // same remote device.
2138 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2139 // session for the same remote device.
2140 // Default: 0 if the device's metric id is unknown.
2141 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002142}
2143
2144/**
2145 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2146 * Each codec's capability is logged separately due to statsd restriction
2147 *
2148 * Logged from:
2149 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2150 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2151 */
2152message BluetoothA2dpCodecCapabilityChanged {
2153 // An identifier that can be used to match events for this device.
2154 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2155 // Salt: Randomly generated 256 bit value
2156 // Hash algorithm: HMAC-SHA256
2157 // Size: 32 byte
2158 // Default: null or empty if the device identifier is not known
2159 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2160 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2161 // Default SOURCE_CODEC_TYPE_INVALID
2162 optional int32 codec_type = 2;
2163 // Codec priroity, the higher the more preferred, -1 for disabled
2164 // Default: CODEC_PRIORITY_DEFAULT
2165 optional int32 codec_priority = 3;
2166 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2167 // in BluetoothCodecConfig
2168 // Default: empty and SAMPLE_RATE_NONE for individual item
2169 optional int32 sample_rate = 4;
2170 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2171 // in BluetoothCodecConfig
2172 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2173 optional int32 bits_per_sample = 5;
2174 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2175 // BluetoothCodecConfig
2176 // Default: empty and CHANNEL_MODE_NONE for individual item
2177 optional int32 channel_mode = 6;
2178 // Codec specific values
2179 // Default 0
2180 optional int64 codec_specific_1 = 7;
2181 optional int64 codec_specific_2 = 8;
2182 optional int64 codec_specific_3 = 9;
2183 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002184 // An identifier that can be used to match events for this device.
2185 // The incremental identifier is locally generated and guaranteed not derived
2186 // from any globally unique hardware id.
2187 // For paired devices, it stays consistent between Bluetooth toggling for the
2188 // same remote device.
2189 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2190 // session for the same remote device.
2191 // Default: 0 if the device's metric id is unknown.
2192 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002193}
2194
2195/**
2196 * Logs when A2DP failed to read from PCM source.
2197 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2198 *
2199 * Logged from:
2200 * system/bt
2201 */
2202message BluetoothA2dpAudioUnderrunReported {
2203 // An identifier that can be used to match events for this device.
2204 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2205 // Salt: Randomly generated 256 bit value
2206 // Hash algorithm: HMAC-SHA256
2207 // Size: 32 byte
2208 // Default: null or empty if the device identifier is not known
2209 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2210 // Encoding interval in nanoseconds
2211 // Default: 0
2212 optional int64 encoding_interval_nanos = 2;
2213 // Number of bytes of PCM data that could not be read from the source
2214 // Default: 0
2215 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002216 // An identifier that can be used to match events for this device.
2217 // The incremental identifier is locally generated and guaranteed not derived
2218 // from any globally unique hardware id.
2219 // For paired devices, it stays consistent between Bluetooth toggling for the
2220 // same remote device.
2221 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2222 // session for the same remote device.
2223 // Default: 0 if the device's metric id is unknown.
2224 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002225}
2226
2227/**
2228 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2229 * buffer queue is full and we have to drop data
2230 *
2231 * Logged from:
2232 * system/bt
2233 */
2234message BluetoothA2dpAudioOverrunReported {
2235 // An identifier that can be used to match events for this device.
2236 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2237 // Salt: Randomly generated 256 bit value
2238 // Hash algorithm: HMAC-SHA256
2239 // Size: 32 byte
2240 // Default: null or empty if the device identifier is not known
2241 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2242 // Encoding interval in nanoseconds
2243 // Default: 0
2244 optional int64 encoding_interval_nanos = 2;
2245 // Number of buffers dropped in this event
2246 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2247 // Default: 0
2248 optional int32 num_dropped_buffers = 3;
2249 // Number of encoded buffers dropped in this event
2250 // Default 0
2251 optional int32 num_dropped_encoded_frames = 4;
2252 // Number of encoded bytes dropped in this event
2253 // Default: 0
2254 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002255 // An identifier that can be used to match events for this device.
2256 // The incremental identifier is locally generated and guaranteed not derived
2257 // from any globally unique hardware id.
2258 // For paired devices, it stays consistent between Bluetooth toggling for the
2259 // same remote device.
2260 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2261 // session for the same remote device.
2262 // Default: 0 if the device's metric id is unknown.
2263 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002264}
2265
2266/**
2267 * Logs when we receive reports regarding a device's RSSI value
2268 *
2269 * Logged from:
2270 * system/bt
2271 */
2272message BluetoothDeviceRssiReported {
2273 // An identifier that can be used to match events for this device.
2274 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2275 // Salt: Randomly generated 256 bit value
2276 // Hash algorithm: HMAC-SHA256
2277 // Size: 32 byte
2278 // Default: null or empty if the device identifier is not known
2279 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2280 // Connection handle of this connection if available
2281 // Range: 0x0000 - 0x0EFF (12 bits)
2282 // Default: 0xFFFF if the handle is unknown
2283 optional int32 connection_handle = 2;
2284 // HCI command status code if this is triggerred by hci_cmd
2285 // Default: STATUS_UNKNOWN
2286 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2287 // BR/EDR
2288 // Range: -128 ≤ N ≤ 127 (signed integer)
2289 // Units: dB
2290 // LE:
2291 // Range: -127 to 20, 127 (signed integer)
2292 // Units: dBm
2293 // Invalid when an out of range value is reported
2294 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002295 // An identifier that can be used to match events for this device.
2296 // The incremental identifier is locally generated and guaranteed not derived
2297 // from any globally unique hardware id.
2298 // For paired devices, it stays consistent between Bluetooth toggling for the
2299 // same remote device.
2300 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2301 // session for the same remote device.
2302 // Default: 0 if the device's metric id is unknown.
2303 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002304}
2305
2306/**
2307 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2308 *
2309 * Logged from:
2310 * system/bt
2311 */
2312message BluetoothDeviceFailedContactCounterReported {
2313 // An identifier that can be used to match events for this device.
2314 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2315 // Salt: Randomly generated 256 bit value
2316 // Hash algorithm: HMAC-SHA256
2317 // Size: 32 byte
2318 // Default: null or empty if the device identifier is not known
2319 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2320 // Connection handle of this connection if available
2321 // Range: 0x0000 - 0x0EFF (12 bits)
2322 // Default: 0xFFFF if the handle is unknown
2323 optional int32 connection_handle = 2;
2324 // HCI command status code if this is triggerred by hci_cmd
2325 // Default: STATUS_UNKNOWN
2326 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2327 // Number of consecutive failed contacts for a connection corresponding to the Handle
2328 // Range: uint16_t, 0-0xFFFF
2329 // Default: 0xFFFFF
2330 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002331 // An identifier that can be used to match events for this device.
2332 // The incremental identifier is locally generated and guaranteed not derived
2333 // from any globally unique hardware id.
2334 // For paired devices, it stays consistent between Bluetooth toggling for the
2335 // same remote device.
2336 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2337 // session for the same remote device.
2338 // Default: 0 if the device's metric id is unknown.
2339 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002340}
2341
2342/**
2343 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2344 *
2345 * Logged from:
2346 * system/bt
2347 */
2348message BluetoothDeviceTxPowerLevelReported {
2349 // An identifier that can be used to match events for this device.
2350 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2351 // Salt: Randomly generated 256 bit value
2352 // Hash algorithm: HMAC-SHA256
2353 // Size: 32 byte
2354 // Default: null or empty if the device identifier is not known
2355 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2356 // Connection handle of this connection if available
2357 // Range: 0x0000 - 0x0EFF (12 bits)
2358 // Default: 0xFFFF if the handle is unknown
2359 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002360 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002361 // Default: STATUS_UNKNOWN
2362 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2363 // Range: -30 ≤ N ≤ 20
2364 // Units: dBm
2365 // Invalid when an out of range value is reported
2366 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002367 // An identifier that can be used to match events for this device.
2368 // The incremental identifier is locally generated and guaranteed not derived
2369 // from any globally unique hardware id.
2370 // For paired devices, it stays consistent between Bluetooth toggling for the
2371 // same remote device.
2372 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2373 // session for the same remote device.
2374 // Default: 0 if the device's metric id is unknown.
2375 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002376}
Jack Heab86dbd22018-12-18 15:43:27 -08002377
Tej Singh5d991e12018-03-09 19:48:11 -08002378/**
Jack He1021a612019-01-20 21:22:46 -08002379 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2380 * receiving an HCI command from the host
2381 *
2382 * Logged from: system/bt
2383 */
2384message BluetoothHciTimeoutReported {
2385 // HCI command associated with this event
2386 // Default: CMD_UNKNOWN
2387 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2388}
2389
2390/**
2391 * Logs when we receive Bluetooth Link Quality Report event from the controller
2392 * See Android Bluetooth HCI specification for more details
2393 *
2394 * Note: all count and bytes field are counted since last event
2395 *
2396 * Logged from: system/bt
2397 */
2398message BluetoothQualityReportReported {
2399 // Quality report ID
2400 // Original type: uint8_t
2401 // Default: BQR_ID_UNKNOWN
2402 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2403 // Packet type of the connection
2404 // Original type: uint8_t
2405 // Default: BQR_PACKET_TYPE_UNKNOWN
2406 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2407 // Connection handle of the connection
2408 // Original type: uint16_t
2409 optional int32 connection_handle = 3;
2410 // Performing Role for the connection
2411 // Original type: uint8_t
2412 optional int32 connection_role = 4;
2413 // Current Transmit Power Level for the connection. This value is the same as the controller's
2414 // response to the HCI_Read_Transmit_Power_Level HCI command
2415 // Original type: uint8_t
2416 optional int32 tx_power_level = 5;
2417 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2418 // absolute receiver signal strength value
2419 // Original type: int8_t
2420 optional int32 rssi = 6;
2421 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2422 // channels used by the link currently
2423 // Original type: uint8_t
2424 optional int32 snr = 7;
2425 // Indicates the number of unused channels in AFH_channel_map
2426 // Original type: uint8_t
2427 optional int32 unused_afh_channel_count = 8;
2428 // Indicates the number of the channels which are interfered and quality is bad but are still
2429 // selected for AFH
2430 // Original type: uint8_t
2431 optional int32 afh_select_unideal_channel_count = 9;
2432 // Current Link Supervision Timeout Setting
2433 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2434 // Original type: uint16_t
2435 optional int32 lsto = 10;
2436 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2437 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2438 // 0x01 (Piconet Clock)
2439 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2440 // Original type: uint32_t
2441 optional int64 connection_piconet_clock = 11;
2442 // The count of retransmission
2443 // Original type: uint32_t
2444 optional int64 retransmission_count = 12;
2445 // The count of no RX
2446 // Original type: uint32_t
2447 optional int64 no_rx_count = 13;
2448 // The count of NAK (Negative Acknowledge)
2449 // Original type: uint32_t
2450 optional int64 nak_count = 14;
2451 // Controller timestamp of last TX ACK
2452 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2453 // Original type: uint32_t
2454 optional int64 last_tx_ack_timestamp = 15;
2455 // The count of Flow-off (STOP)
2456 // Original type: uint32_t
2457 optional int64 flow_off_count = 16;
2458 // Controller timestamp of last Flow-on (GO)
2459 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2460 // Original type: uint32_t
2461 optional int64 last_flow_on_timestamp = 17;
2462 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2463 // Original type: uint32_t
2464 optional int64 buffer_overflow_bytes = 18;
2465 // Buffer underflow count (in byte) since last event
2466 // Original type: uint32_t
2467 optional int64 buffer_underflow_bytes = 19;
2468}
2469
2470/**
2471 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2472 *
2473 * Notes:
2474 * - Each event can be partially filled as we might learn different pieces of device
2475 * information at different time
2476 * - Multiple device info events can be combined to give more complete picture
2477 * - When multiple device info events tries to describe the same information, the
2478 * later one wins
2479 *
2480 * Logged from:
2481 * packages/apps/Bluetooth
2482 */
Jack Heaea26982019-04-04 11:19:48 -07002483message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002484 // An identifier that can be used to match events for this device.
2485 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2486 // Salt: Randomly generated 256 bit value
2487 // Hash algorithm: HMAC-SHA256
2488 // Size: 32 byte
2489 // Default: null or empty if the device identifier is not known
2490 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2491 // Where is this device info obtained from
2492 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2493 // Name of the data source
2494 // For EXTERNAL: package name of the data source
2495 // For INTERNAL: null for general case, component name otherwise
2496 optional string source_name = 3;
2497 // Name of the manufacturer of this device
2498 optional string manufacturer = 4;
2499 // Model of this device
2500 optional string model = 5;
2501 // Hardware version of this device
2502 optional string hardware_version = 6;
2503 // Software version of this device
2504 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002505 // An identifier that can be used to match events for this device.
2506 // The incremental identifier is locally generated and guaranteed not derived
2507 // from any globally unique hardware id.
2508 // For paired devices, it stays consistent between Bluetooth toggling for the
2509 // same remote device.
2510 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2511 // session for the same remote device.
2512 // Default: 0 if the device's metric id is unknown.
2513 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002514}
2515
2516/**
2517 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2518 * device, as documented by the Bluetooth Core HCI specification
2519 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2520 * Vol 2, Part E, Page 1118
2521 *
2522 * Logged from:
2523 * system/bt
2524 */
2525message BluetoothRemoteVersionInfoReported {
2526 // Connection handle of the connection
2527 // Original type: uint16_t
2528 optional int32 connection_handle = 1;
2529 // HCI command status code
2530 // Default: STATUS_UNKNOWN
2531 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2532 // 1 byte Version of current LMP in the remote controller
2533 optional int32 lmp_version = 3;
2534 // 2 bytes LMP manufacturer code of the remote controller
2535 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2536 optional int32 lmp_manufacturer_code = 4;
2537 // 4 bytes subversion of the LMP in the remote controller
2538 optional int32 lmp_subversion = 5;
2539}
2540
2541/**
2542 * Logs when certain Bluetooth SDP attributes are discovered
2543 * Constant definitions are from:
2544 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2545 *
2546 * Current logged attributes:
2547 * - BluetoothProfileDescriptorList
2548 * - Supported Features Bitmask
2549 *
2550 * Logged from:
2551 * system/bt
2552 */
2553message BluetoothSdpAttributeReported {
2554 // An identifier that can be used to match events for this device.
2555 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2556 // Salt: Randomly generated 256 bit value
2557 // Hash algorithm: HMAC-SHA256
2558 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2559 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2560 // Original type: uint16_t
2561 optional int32 protocol_uuid = 2;
2562 // Short form UUIDs used to identify Bluetooth SDP attribute types
2563 // Original type: uint16_t
2564 optional int32 attribute_id = 3;
2565 // Attribute value for the particular attribute
2566 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002567 // An identifier that can be used to match events for this device.
2568 // The incremental identifier is locally generated and guaranteed not derived
2569 // from any globally unique hardware id.
2570 // For paired devices, it stays consistent between Bluetooth toggling for the
2571 // same remote device.
2572 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2573 // session for the same remote device.
2574 // Default: 0 if the device's metric id is unknown.
2575 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002576}
2577
2578/**
2579 * Logs when bond state of a Bluetooth device changes
2580 *
2581 * Logged from:
2582 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2583 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2584 */
2585message BluetoothBondStateChanged {
2586 // An identifier that can be used to match events for this device.
2587 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2588 // Salt: Randomly generated 256 bit value
2589 // Hash algorithm: HMAC-SHA256
2590 // Size: 32 byte
2591 // Default: null or empty if the device identifier is not known
2592 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2593 // Preferred transport type to remote dual mode device
2594 // Default: TRANSPORT_AUTO means no preference
2595 optional android.bluetooth.TransportTypeEnum transport = 2;
2596 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2597 // Default: UNKNOWN
2598 optional android.bluetooth.DeviceTypeEnum type = 3;
2599 // Current bond state (NONE, BONDING, BONDED)
2600 // Default: BOND_STATE_UNKNOWN
2601 optional android.bluetooth.BondStateEnum bond_state = 4;
2602 // Bonding sub state
2603 // Default: BOND_SUB_STATE_UNKNOWN
2604 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2605 // Unbond Reason
2606 // Default: UNBOND_REASON_UNKNOWN
2607 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002608 // An identifier that can be used to match events for this device.
2609 // The incremental identifier is locally generated and guaranteed not derived
2610 // from any globally unique hardware id.
2611 // For paired devices, it stays consistent between Bluetooth toggling for the
2612 // same remote device.
2613 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2614 // session for the same remote device.
2615 // Default: 0 if the device's metric id is unknown.
2616 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002617}
2618
2619/**
2620 * Logs there is an event related Bluetooth classic pairing
2621 *
2622 * Logged from:
2623 * system/bt
2624 */
2625message BluetoothClassicPairingEventReported {
2626 // An identifier that can be used to match events for this device.
2627 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2628 // Salt: Randomly generated 256 bit value
2629 // Hash algorithm: HMAC-SHA256
2630 // Size: 32 byte
2631 // Default: null or empty if the device identifier is not known
2632 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2633 // Connection handle of this connection if available
2634 // Range: 0x0000 - 0x0EFF (12 bits)
2635 // Default: 0xFFFF if the handle is unknown
2636 optional int32 connection_handle = 2;
2637 // HCI command associated with this event
2638 // Default: CMD_UNKNOWN
2639 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2640 // HCI event associated with this event
2641 // Default: EVT_UNKNOWN
2642 optional android.bluetooth.hci.EventEnum hci_event = 4;
2643 // HCI command status code if this is triggerred by hci_cmd
2644 // Default: STATUS_UNKNOWN
2645 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2646 // HCI reason code associated with this event
2647 // Default: STATUS_UNKNOWN
2648 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002649 // A status value related to this specific event
2650 // Default: 0
2651 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002652 // An identifier that can be used to match events for this device.
2653 // The incremental identifier is locally generated and guaranteed not derived
2654 // from any globally unique hardware id.
2655 // For paired devices, it stays consistent between Bluetooth toggling for the
2656 // same remote device.
2657 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2658 // session for the same remote device.
2659 // Default: 0 if the device's metric id is unknown.
2660 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002661}
2662
2663/**
2664 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2665 *
2666 * Logged from:
2667 * system/bt
2668 */
2669message BluetoothSmpPairingEventReported {
2670 // An identifier that can be used to match events for this device.
2671 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2672 // Salt: Randomly generated 256 bit value
2673 // Hash algorithm: HMAC-SHA256
2674 // Size: 32 byte
2675 // Default: null or empty if the device identifier is not known
2676 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2677 // SMP command sent or received over L2CAP
2678 // Default: CMD_UNKNOWN
2679 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2680 // Whether this command is sent or received
2681 // Default: DIRECTION_UNKNOWN
2682 optional android.bluetooth.DirectionEnum direction = 3;
2683 // SMP failure reason code
2684 // Default: PAIRING_FAIL_REASON_DEFAULT
2685 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002686 // An identifier that can be used to match events for this device.
2687 // The incremental identifier is locally generated and guaranteed not derived
2688 // from any globally unique hardware id.
2689 // For paired devices, it stays consistent between Bluetooth toggling for the
2690 // same remote device.
2691 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2692 // session for the same remote device.
2693 // Default: 0 if the device's metric id is unknown.
2694 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002695}
2696
2697/**
Jack He815cdba2019-01-30 17:24:55 -08002698 * Logs when a Bluetooth socket’s connection state changed
2699 *
2700 * Logged from:
2701 * system/bt
2702 */
2703message BluetoothSocketConnectionStateChanged {
2704 // An identifier that can be used to match events for this device.
2705 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2706 // Salt: Randomly generated 256 bit value
2707 // Hash algorithm: HMAC-SHA256
2708 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002709 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002710 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002711 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002712 // Default 0 when unknown or don't care
2713 optional int32 port = 2;
2714 // Socket type as mentioned in
2715 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2716 // Default: SOCKET_TYPE_UNKNOWN
2717 optional android.bluetooth.SocketTypeEnum type = 3;
2718 // Socket connection state
2719 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2720 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2721 // Number of bytes sent to remote device during this connection
2722 optional int64 tx_bytes = 5;
2723 // Number of bytes received from remote device during this connection
2724 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002725 // Socket owner's UID
2726 optional int32 uid = 7 [(is_uid) = true];
2727 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2728 // |port| must be spawned by |server_port|
2729 // Default 0 when unknown or don't care
2730 optional int32 server_port = 8;
2731 // Whether this is a server listener socket
2732 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002733 // An identifier that can be used to match events for this device.
2734 // The incremental identifier is locally generated and guaranteed not derived
2735 // from any globally unique hardware id.
2736 // For paired devices, it stays consistent between Bluetooth toggling for the
2737 // same remote device.
2738 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2739 // session for the same remote device.
2740 // Default: 0 if the device's metric id is unknown.
2741 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002742}
2743
2744/**
Jack He71426802019-04-02 13:32:52 -07002745 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2746 *
2747 * Logged from:
2748 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2749 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2750 *
2751 */
2752message BluetoothClassOfDeviceReported {
2753 // An identifier that can be used to match events for this device.
2754 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2755 // Salt: Randomly generated 256 bit value
2756 // Hash algorithm: HMAC-SHA256
2757 // Size: 32 byte
2758 // Default: null or empty if this is a server listener socket
2759 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2760 // Class of Device (CoD) value including both Major, Minor device class and service class
2761 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2762 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2763 // Default: 0
2764 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002765 // An identifier that can be used to match events for this device.
2766 // The incremental identifier is locally generated and guaranteed not derived
2767 // from any globally unique hardware id.
2768 // For paired devices, it stays consistent between Bluetooth toggling for the
2769 // same remote device.
2770 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2771 // session for the same remote device.
2772 // Default: 0 if the device's metric id is unknown.
2773 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002774}
2775
2776/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002777 * Logs when something is plugged into or removed from the USB-C connector.
2778 *
2779 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002780 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002781 */
2782message UsbConnectorStateChanged {
2783 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002784 STATE_DISCONNECTED = 0;
2785 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002786 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002787 optional State state = 1
2788 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2789 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002790 // Last active session in ms.
2791 // 0 when the port is in connected state.
2792 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002793}
2794
2795/**
2796 * Logs the reported speaker impedance.
2797 *
2798 * Logged from:
2799 * Vendor audio implementation.
2800 */
2801message SpeakerImpedanceReported {
2802 optional int32 speaker_location = 1;
2803 optional int32 impedance = 2;
2804}
2805
2806/**
2807 * Logs the report of a failed hardware.
2808 *
2809 * Logged from:
2810 * Vendor HALs.
2811 *
2812 */
2813message HardwareFailed {
2814 enum HardwareType {
2815 HARDWARE_FAILED_UNKNOWN = 0;
2816 HARDWARE_FAILED_MICROPHONE = 1;
2817 HARDWARE_FAILED_CODEC = 2;
2818 HARDWARE_FAILED_SPEAKER = 3;
2819 HARDWARE_FAILED_FINGERPRINT = 4;
2820 }
2821 optional HardwareType hardware_type = 1;
2822
Maggie White6dcd8572019-01-31 14:11:50 -08002823 /**
2824 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002825 * the same hardware_type. The specific locations are vendor defined integers,
2826 * referring to board-specific numbering schemes.
2827 */
2828 optional int32 hardware_location = 2;
2829
Maggie White6dcd8572019-01-31 14:11:50 -08002830 /**
2831 * failure_code is specific to the HardwareType of the failed hardware.
2832 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002833 */
Maggie White6dcd8572019-01-31 14:11:50 -08002834 enum HardwareErrorCode {
2835 UNKNOWN = 0;
2836 COMPLETE = 1;
2837 SPEAKER_HIGH_Z = 2;
2838 SPEAKER_SHORT = 3;
2839 FINGERPRINT_SENSOR_BROKEN = 4;
2840 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002841 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002842 }
2843 optional int32 failure_code = 3;
2844}
2845
2846/**
2847 * Log an event when the device has been physically dropped.
2848 * Reported from the /vendor partition.
2849 */
2850message PhysicalDropDetected {
2851 // Confidence that the event was actually a drop, 0 -> 100
2852 optional int32 confidence_pctg = 1;
2853 // Peak acceleration of the drop, in 1/1000s of a g.
2854 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002855 // Duration of freefall in ms
2856 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002857}
2858
2859/**
2860 * Log bucketed battery charge cycles.
2861 *
2862 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002863 * a given charge point. For example, if 10 cycle buckets are
2864 * initialized, bucket 1 is the lowest 1/10th of the battery,
2865 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002866 *
2867 * Logged from:
2868 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2869 */
2870message ChargeCyclesReported {
2871 optional int32 cycle_bucket_1 = 1;
2872 optional int32 cycle_bucket_2 = 2;
2873 optional int32 cycle_bucket_3 = 3;
2874 optional int32 cycle_bucket_4 = 4;
2875 optional int32 cycle_bucket_5 = 5;
2876 optional int32 cycle_bucket_6 = 6;
2877 optional int32 cycle_bucket_7 = 7;
2878 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002879 optional int32 cycle_bucket_9 = 9;
2880 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002881}
2882
2883/**
Howard Roa46b6582018-09-18 16:45:02 -07002884 * Log battery health snapshot.
2885 *
2886 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2887 * are snapshotted periodically over 24hrs.
2888 */
2889message BatteryHealthSnapshot {
2890 enum BatterySnapshotType {
2891 UNKNOWN = 0;
2892 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2893 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2894 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2895 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2896 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2897 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2898 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2899 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2900 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2901 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2902 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2903 }
2904 optional BatterySnapshotType type = 1;
2905 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002906 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002907 // Voltage Battery Voltage, in microVolts.
2908 optional int32 voltage_micro_volt = 3;
2909 // Current Battery current, in microAmps.
2910 optional int32 current_micro_amps = 4;
2911 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2912 optional int32 open_circuit_micro_volt = 5;
2913 // Resistance Battery Resistance, in microOhms.
2914 optional int32 resistance_micro_ohm = 6;
2915 // Level Battery Level, as % of full.
2916 optional int32 level_percent = 7;
2917}
2918
2919/**
2920 * Log slow I/O operations on the primary storage.
2921 */
2922message SlowIo {
2923 // Classifications of IO Operations.
2924 enum IoOperation {
2925 UNKNOWN = 0;
2926 READ = 1;
2927 WRITE = 2;
2928 UNMAP = 3;
2929 SYNC = 4;
2930 }
2931 optional IoOperation operation = 1;
2932
2933 // The number of slow IO operations of this type over 24 hours.
2934 optional int32 count = 2;
2935}
2936
2937/**
2938 * Log battery caused shutdown with the last recorded voltage.
2939 */
2940message BatteryCausedShutdown {
2941 // The last recorded battery voltage prior to shutdown.
2942 optional int32 last_recorded_micro_volt = 1;
2943}
2944
2945/**
Tej Singha72344992019-04-17 18:55:08 -07002946 * Logs when ThermalService receives throttling events.
2947 *
2948 * Logged from:
2949 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2950 */
2951message ThermalThrottlingSeverityStateChanged {
2952 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2953 optional android.os.TemperatureTypeEnum sensor_type = 1;
2954
2955 // The name of the temperature source. Eg. CPU0
2956 optional string sensor_name = 2;
2957
2958 // Temperature in tenths of a degree C.
2959 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2960 optional int32 temperature_deci_celsius = 3;
2961
2962 // Relative severity of the throttling, see enum definition.
2963 optional android.os.ThrottlingSeverityEnum severity = 4;
2964}
2965
2966/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002967 * Logs the duration of a davey (jank of >=700ms) when it occurs
2968 *
2969 * Logged from:
2970 * frameworks/base/libs/hwui/JankTracker.cpp
2971 */
2972message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002973 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002974 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002975
Tej Singhbb8554a2018-01-26 11:59:14 -08002976 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002977 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002978}
2979
2980/**
Bookatze5885242017-10-24 20:10:31 -07002981 * Logs phone signal strength changes.
2982 *
2983 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002985 */
2986message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002987 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2988 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002989}
2990
Yangster4ccebea2018-10-09 17:09:02 -07002991
2992/**
2993 * Logs when the phone state, sim state or signal strength changes
2994 *
2995 * Logged from:
2996 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2997 */
2998message PhoneServiceStateChanged {
2999 optional android.telephony.ServiceStateEnum state = 1;
3000 optional android.telephony.SimStateEnum sim_state = 2;
3001 optional android.telephony.SignalStrengthEnum signal_strength = 3;
3002}
3003
3004/**
3005 * Logs when the phone becomes on or off.
3006 *
3007 * Logged from:
3008 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
3009 */
3010message PhoneStateChanged {
3011 enum State {
3012 OFF = 0;
3013 ON = 1;
3014 }
3015 optional State state = 1;
3016}
3017
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003018message BackGesture {
3019 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003020 DEFAULT_BACK_TYPE = 0;
3021 COMPLETED = 1;
3022 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3023 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3024 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3025 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3026 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3027 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3028 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003029 }
3030 optional BackType type = 1;
3031
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003032 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3033 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3034 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3035 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3036 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3037 optional int32 left_boundary = 8; // left edge width + left inset
3038 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3039
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003040 enum WindowHorizontalLocation {
3041 DEFAULT_LOCATION = 0;
3042 LEFT = 1;
3043 RIGHT = 2;
3044 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003045 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003046}
3047
3048message ExclusionRectStateChanged {
3049 optional string component_name = 1; // if not available, simply packageName
3050 optional int32 requested_height = 2; // px
3051 optional int32 rejected_height = 3; // px
3052
3053 enum WindowHorizontalLocation {
3054 DEFAULT_LOCATION = 0;
3055 LEFT = 1;
3056 RIGHT = 2;
3057 }
3058 optional WindowHorizontalLocation x_location = 4;
3059 optional bool landscape = 5;
3060 optional bool splitscreen = 6;
3061 optional int32 duration_millis = 7;
3062}
3063
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003064/**
Maryamde784e52020-06-22 11:46:48 -07003065 * Logs when IME is on.
3066 *
3067 * Logged from: /packages/SystemUI/src/com/android/systemui/
3068 statusbar/phone/NavigationBarView.java
3069 *
3070 */
3071message ImeTouchReported {
3072 optional int32 x_coordinate = 1; // X coordinate for ACTION_DOWN event.
3073 optional int32 y_coordinate = 2; // Y coordinate for ACTION_DOWN event.
3074}
3075
3076/**
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003077 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3078 *
3079 * Logged from:
3080 * packages/apps/Launcher3
3081 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003082message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003083 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003084 optional android.stats.launcher.LauncherState src_state = 2;
3085 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003086 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3087 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3088
3089 // The event id (e.g., app launch, drag and drop, long press)
3090 optional int32 event_id = 6;
3091 // The event's source or target id (e.g., icon, task, button)
3092 optional int32 target_id = 7;
3093 // If the target needs to be tracked, use this id field
3094 optional int32 instance_id = 8;
3095 optional int32 uid = 9 [(is_uid) = true];
3096 optional string package_name = 10;
3097 optional string component_name = 11;
3098
3099 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003100 optional int32 grid_x = 12 [default = -1];
3101 optional int32 grid_y = 13 [default = -1];
3102 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003103
3104 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003105 optional int32 grid_x_parent = 15 [default = -1];
3106 optional int32 grid_y_parent = 16 [default = -1];
3107 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003108
3109 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3110 optional int32 hierarchy = 18;
3111
3112 optional bool is_work_profile = 19;
3113
3114 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003115 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003116
3117 // e.g., folderLabelState can be captured in the following two fields
3118 optional int32 from_state = 21;
3119 optional int32 to_state = 22;
3120
3121 // e.g., autofilled or suggested texts that are not user entered
3122 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003123
3124 // e.g., number of contents inside a container (e.g., icons inside a folder)
3125 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003126}
3127
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003128/**
3129 * Used for snapshot of the HomeScreen UI elements
3130 *
3131 * Logged from:
3132 * packages/apps/Launcher3
3133 */
3134message LauncherStaticLayout {
3135 // The event id (e.g., snapshot, drag and drop)
3136 optional int32 event_id = 1;
3137 // The event's source or target id (e.g., icon, shortcut, widget)
3138 optional int32 target_id = 2;
3139 // If the target needs to be tracked, use this id field
3140 optional int32 instance_id = 3;
3141 optional int32 uid = 4 [(is_uid) = true];
3142 optional string package_name = 5;
3143 optional string component_name = 6;
3144
3145 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003146 optional int32 grid_x = 7 [default = -1];
3147 optional int32 grid_y = 8 [default = -1];
3148 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003149
3150 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003151 // e.g., when used with widgets target, use these values for (span_x, span_y)
3152 optional int32 grid_x_parent = 10 [default = -1];
3153 optional int32 grid_y_parent = 11 [default = -1];
3154 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003155
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003156 // UNKNOWN = 0
3157 // HOTSEAT = 1
3158 // WORKSPACE = 2
3159 // FOLDER_HOTSEAT = 3
3160 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003161 optional int32 hierarchy = 13;
3162
3163 optional bool is_work_profile = 14;
3164
3165 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3166 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003167
3168 // e.g., number of icons inside a folder
3169 optional int32 cardinality = 16;
3170
3171 // e.g., (x, y) span of the widget inside homescreen grid system
3172 optional int32 span_x = 17 [default = 1];
3173 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003174}
3175
3176/**
3177 * Logs when Wallpaper or ThemePicker UI has changed.
3178 *
3179 * Logged from:
3180 * packages/apps/ThemePicker
3181 * packages/apps/WallpaperPicker2
3182 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003183message StyleUIChanged {
3184 optional android.stats.style.Action action = 1;
3185 optional int32 color_package_hash = 2;
3186 optional int32 font_package_hash = 3;
3187 optional int32 shape_package_hash = 4;
3188 optional int32 clock_package_hash = 5;
3189 optional int32 launcher_grid = 6;
3190 optional int32 wallpaper_category_hash = 7;
3191 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003192 optional int32 color_preference = 9;
3193 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003194}
3195
David Chenc28b2bb2017-10-24 12:52:52 -07003196/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003197 * Logs when Settings UI has changed.
3198 *
3199 * Logged from:
3200 * packages/apps/Settings
3201 */
3202message SettingsUIChanged {
3203 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003204 * Where this SettingsUIChange event comes from. For example, if
3205 * it's a PAGE_VISIBLE event, where the page is opened from.
3206 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003207 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003208
3209 /**
3210 * What the UI action is.
3211 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003212 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003213
3214 /**
3215 * Where the action is happening
3216 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003217 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003218
3219 /**
3220 * What preference changed in this event.
3221 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003222 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003223
3224 /**
3225 * The new value of the changed preference.
3226 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003227 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003228}
3229
3230/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003231 * Logs basic timing information about touch events.
3232 * Reported at most every 5 minutes while device is being interacted with.
3233 *
3234 * Logged from:
3235 * frameworks/native/services/inputflinger
3236 */
3237message TouchEventReported {
3238 /**
3239 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003240 * and the standard deviation of the time spent processing touchscreen events
3241 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003242 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003243 * On supported devices, the starting point is taken during the hard interrupt inside the
3244 * kernel touch driver. On all other devices, the starting point is taken inside
3245 * the kernel's input event subsystem upon receipt of the input event.
3246 * The ending point is taken inside InputDispatcher, just after the input event
3247 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003248 */
3249 // Minimum value
3250 optional float latency_min_micros = 1;
3251 // Maximum value
3252 optional float latency_max_micros = 2;
3253 // Average value
3254 optional float latency_mean_micros = 3;
3255 // Standard deviation
3256 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003257 // Number of touch events (input_event) in this report
3258 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003259}
3260
3261/**
Philip Quinn0eded622019-01-29 12:46:28 -08003262 * Logs gesture classification and timing information for touch events.
3263 *
3264 * Logged from:
3265 * frameworks/base/core/java/android/view/GestureDetector.java
3266 * frameworks/base/core/java/android/view/View.java
3267 */
3268message TouchGestureClassified {
3269 // The source of the classification (e.g. Java class name).
3270 optional string source = 1;
3271
3272 enum Classification {
3273 UNKNOWN_CLASSIFICATION = 0;
3274 SINGLE_TAP = 1;
3275 DOUBLE_TAP = 2;
3276 LONG_PRESS = 3;
3277 DEEP_PRESS = 4;
3278 SCROLL = 5;
3279 }
3280 // The classification of the gesture.
3281 optional Classification classification = 2;
3282
3283 // The interval from the start of a touch event stream until the
3284 // classification was made.
3285 optional int32 latency_millis = 3;
3286
3287 // The distance from the location of the first touch event to the
3288 // location of the touch event when the classification was made.
3289 optional float displacement_px = 4;
3290}
3291
3292/**
David Chenc28b2bb2017-10-24 12:52:52 -07003293 * Logs that a setting was updated.
3294 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003295 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003296 * The tag and is_default allow resetting of settings to default values based on the specified
3297 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3298 */
3299message SettingChanged {
3300 // The name of the setting.
3301 optional string setting = 1;
3302
3303 // The change being imposed on this setting. May represent a number, eg "3".
3304 optional string value = 2;
3305
3306 // The new value of this setting. For most settings, this is same as value. For some settings,
3307 // value is +X or -X where X represents an element in a set. For example, if the previous value
3308 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3309 // The +/- feature is currently only used for location_providers_allowed.
3310 optional string new_value = 3;
3311
3312 // The previous value of this setting.
3313 optional string prev_value = 4;
3314
3315 // The tag used with the is_default for resetting sets of settings. This is generally null.
3316 optional string tag = 5;
3317
Bookatz90867622018-01-31 15:05:57 -08003318 // True if this setting with tag should be resettable.
3319 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003320
David Chenbd789912018-03-16 17:19:55 -07003321 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003322 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003323
3324 enum ChangeReason {
3325 UPDATED = 1; // Updated can be an insertion or an update.
3326 DELETED = 2;
3327 }
3328 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003329}
Chenjie Yub3dda412017-10-24 13:41:59 -07003330
Chenjie Yu05013b32017-11-21 10:21:41 -08003331/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003332 * Logs activity going to foreground or background
3333 *
3334 * Logged from:
3335 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3336 */
3337message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003338 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003339 optional string pkg_name = 2;
3340 optional string class_name = 3;
3341
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003342 enum State {
3343 BACKGROUND = 0;
3344 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003345 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003346 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003347}
David Chenc8a43242017-10-17 16:23:28 -07003348
3349/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003350 * Logs when a volume entered low Storage state.
3351 * Logged from:
3352 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3353 */
3354message LowStorageStateChanged {
3355 // Volume that ran out of storage.
3356 optional string volume_description = 1;
3357
3358 enum State {
3359 UNKNOWN = 0;
3360 OFF = 1;
3361 ON = 2;
3362 }
3363 optional State state = 2;
3364}
3365
3366/**
3367 * Logs when an app is downgraded.
3368 * Logged from:
3369 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3370 */
3371message AppDowngraded {
3372 optional string package_name = 1;
3373 // Size of the package (all data) before being downgraded.
3374 optional int64 size_in_bytes_before = 2;
3375 // Size of the package (all data) after being downgraded.
3376 optional int64 size_in_bytes_after = 3;
3377
3378 optional bool aggressive = 4;
3379}
3380
3381/**
3382 * Logs when an app is optimized after being downgraded.
3383 * Logged from:
3384 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3385 */
3386message AppOptimizedAfterDowngraded {
3387 optional string package_name = 1;
3388}
3389
3390/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003391 * Logs whenever an app is installed on external storage.
3392 * Logged from:
3393 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3394 */
3395message AppInstallOnExternalStorageReported {
3396 // The type of external storage.
3397 optional android.stats.storage.ExternalStorageType storage_type = 1;
3398 // The name of the package that is installed on the sd card.
3399 optional string package_name = 2;
3400}
3401
3402/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003403 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003404 * Logged from:
3405 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3406 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003407message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003408 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003409
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003410 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003411
3412 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003413 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003414 optional string process_name = 3;
3415
3416 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003417 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003418
3419 optional string package_name = 5;
3420
3421 enum InstantApp {
3422 UNAVAILABLE = 0;
3423 FALSE = 1;
3424 TRUE = 2;
3425 }
3426 optional InstantApp is_instant_app = 6;
3427
3428 enum ForegroundState {
3429 UNKNOWN = 0;
3430 BACKGROUND = 1;
3431 FOREGROUND = 2;
3432 }
3433 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003434
3435 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003436}
David Chen9e3808c2017-11-20 17:25:34 -08003437
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003438/**
3439 * Logs when a WTF (What a Terrible Failure) happened.
3440 * Logged from:
3441 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3442 */
3443message WTFOccurred {
3444 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003445
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003446 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003447
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003448 // The name of the process.
3449 // system_server if it is not by an app
3450 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003451
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003452 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003453 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003454
3455 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003456}
3457
3458/**
3459 * Logs when system server reports low memory.
3460 * Logged from:
3461 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3462 */
3463message LowMemReported {
3464}
3465
3466/**
3467 * Logs when an app ANR (App Not Responding) occurs.
3468 * Logged from:
3469 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3470 */
3471message ANROccurred {
3472 optional int32 uid = 1 [(is_uid) = true];
3473
3474 optional string process_name = 2;
3475
3476 optional string short_component_name = 3;
3477
3478 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003479
3480 enum InstantApp {
3481 UNAVAILABLE = 0;
3482 FALSE = 1;
3483 TRUE = 2;
3484 }
3485 optional InstantApp is_instant_app = 5;
3486
3487 enum ForegroundState {
3488 UNKNOWN = 0;
3489 BACKGROUND = 1;
3490 FOREGROUND = 2;
3491 }
3492 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003493
3494 optional android.server.ErrorSource error_source = 7;
3495
3496 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003497}
3498
Bookatza7020bd2018-08-28 16:29:35 -07003499/**
3500 * Logs when the vibrator state changes.
3501 * Logged from:
3502 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3503 */
3504message VibratorStateChanged {
3505 repeated AttributionNode attribution_node = 1;
3506
3507 enum State {
3508 OFF = 0;
3509 ON = 1;
3510 }
3511 optional State state = 2;
3512
3513 // Duration (in milliseconds) requested to keep the vibrator on.
3514 // Only applicable for State == ON.
3515 optional int64 duration_millis = 3;
3516}
3517
David Chen0a368b22017-12-06 16:28:16 -08003518/*
3519 * Allows other apps to push events into statsd.
3520 * Logged from:
3521 * frameworks/base/core/java/android/util/StatsLog.java
3522 */
David Chen0b5c90c2018-01-25 16:51:49 -08003523message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003524 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003525 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003526
3527 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3528 optional int32 label = 2;
3529
3530 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3531 // predicates for the metrics).
3532 enum State {
3533 UNKNOWN = 0;
3534 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3535 STOP = 2;
3536 START = 3;
3537 }
3538 optional State state = 3;
3539}
3540
David Chen9e3808c2017-11-20 17:25:34 -08003541/**
Bookatz7948c872018-09-04 12:58:33 -07003542 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3543 * For example, this could be due to the user manually changing the time.
3544 *
3545 * Logged from:
3546 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3547 */
3548message WallClockTimeShifted {
3549 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3550 optional int64 wall_clock_timestamp_millis = 1;
3551}
3552
3553/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003554 * Logs when statsd detects an anomaly.
3555 *
3556 * Logged from:
3557 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3558 */
3559message AnomalyDetected {
3560 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003561 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003562
Yangster-mac94e197c2018-01-02 16:03:03 -08003563 // Id of the config whose anomaly detection alert fired.
3564 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003565
Yangster-mac94e197c2018-01-02 16:03:03 -08003566 // Id of the alert (i.e. name of the anomaly that was detected).
3567 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003568}
3569
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003570message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003571 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003572 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003573
3574 // The app package name.
3575 optional string pkg_name = 2;
3576
3577 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003578 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003579 WARM = 1;
3580 HOT = 2;
3581 COLD = 3;
3582 }
3583 // The transition type.
3584 optional TransitionType type = 3;
3585
3586 // The activity name.
3587 optional string activity_name = 4;
3588
3589 // The name of the calling app. Empty if not set.
3590 optional string calling_pkg_name = 5;
3591
3592 // Whether the app is an instant app.
3593 optional bool is_instant_app = 6;
3594
3595 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003596 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003597
Bookatz80d11a02018-01-16 10:46:35 -08003598 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003599
David Chen0b5c90c2018-01-25 16:51:49 -08003600 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003601 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003602 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003603 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003604 optional int32 bind_application_delay_millis = 11;
3605 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003606
3607 // Empty if not set.
3608 optional string launch_token = 13;
3609
Calin Juravle759fbda2018-02-20 19:52:30 +00003610 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003611 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003612
3613 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003614 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003615}
3616
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003617message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003618 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003619 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003620
3621 // The app package name.
3622 optional string pkg_name = 2;
3623
3624 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003625 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003626 WARM = 1;
3627 HOT = 2;
3628 COLD = 3;
3629 }
3630 // The transition type.
3631 optional TransitionType type = 3;
3632
3633 // The activity name.
3634 optional string activity_name = 4;
3635}
3636
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003637message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003638 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003639 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003640
3641 // The app package name.
3642 optional string pkg_name = 2;
3643
3644 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003645 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003646 WITH_BUNDLE = 1;
3647 WITHOUT_BUNDLE = 2;
3648 }
3649 // The transition type.
3650 optional TransitionType type = 3;
3651
3652 // The activity name.
3653 optional string activity_name = 4;
3654
3655 optional bool transition_process_running = 5;
3656
3657 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003658 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003659}
3660
Bookatz8fcd09a2017-12-18 13:01:10 -08003661/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003662 * Logs a picture-in-picture action
3663 * Logged from:
3664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3665 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3666 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3667 */
3668message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003669 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003670 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003671
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003672 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003673
Chenjie Yu52cacc62017-12-08 18:11:45 -08003674 enum State {
3675 ENTERED = 1;
3676 EXPANDED_TO_FULL_SCREEN = 2;
3677 MINIMIZED = 3;
3678 DISMISSED = 4;
3679 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003680 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003681}
3682
3683/**
Chenjie Yue8904192017-12-08 19:12:57 -08003684 * Logs overlay action
3685 * Logged from:
3686 * services/core/java/com/android/server/wm/Session.java
3687 */
3688message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003689 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003690
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003691 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003692
3693 optional bool using_alert_window = 3;
3694
3695 enum State {
3696 ENTERED = 1;
3697 EXITED = 2;
3698 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003699 optional State state = 4
3700 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003701}
3702
Adam Bookatz38767932020-02-05 12:13:40 -08003703/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003704 * Logs foreground service starts and stops.
3705 * Note that this is not when a service starts or stops, but when it is
3706 * considered foreground.
3707 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003708 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003709 */
3710message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003711 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003712 // package_name + "/" + class_name
3713 optional string short_name = 2;
3714
3715 enum State {
3716 ENTER = 1;
3717 EXIT = 2;
3718 }
3719 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003720
3721 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3722 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3723 optional bool allow_while_in_use_permission = 4;
3724}
3725
3726/**
3727 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3728 * A foreground service session is any continuous period during which the uid holds at least one
3729 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3730 * Accesses initiated while the uid is in the TOP state are ignored.
3731 * Sessions with no attempted accesses are not logged.
3732 * Logged from
3733 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3734 */
3735message ForegroundServiceAppOpSessionEnded {
3736 optional int32 uid = 1 [(is_uid) = true];
3737
3738 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003739 // Only following four ops are logged
3740 // COARSE_LOCATION = 0
3741 // FINE_LOCATION = 1
3742 // CAMERA = 26
3743 // RECORD_AUDIO = 27
3744 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003745
3746 // The uid's permission mode for accessing the AppOp during this fgs session.
3747 enum Mode {
3748 MODE_UNKNOWN = 0;
3749 MODE_ALLOWED = 1; // Always allowed
3750 MODE_IGNORED = 2; // Denied
3751 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3752 }
3753 optional Mode app_op_mode = 3;
3754
3755 // Number of times this AppOp was requested and allowed.
3756 optional int32 count_ops_accepted = 4;
3757 // Number of times this AppOp was requested but denied.
3758 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003759}
3760
Chenjie Yue8904192017-12-08 19:12:57 -08003761/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003762 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3763 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3764 * attributed back to the parent (host) uid. One example is Chrome.
3765 *
3766 * Logged from:
3767 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3768 */
3769message IsolatedUidChanged {
3770 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003771 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003772 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003773 optional int32 parent_uid = 1;
3774
3775 optional int32 isolated_uid = 2;
3776
3777 // We expect an isolated uid to be removed before if it's used for another parent uid.
3778 enum Event {
3779 REMOVED = 0;
3780 CREATED = 1;
3781 }
3782 optional Event event = 3;
3783}
3784
3785/*
3786 * Logs the reception of an incoming network packet causing the main system to wake up for
3787 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3788 * and processed by WakeupController.cpp.
3789 */
3790message PacketWakeupOccurred {
3791 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3792 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003793 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003794 // The interface name on which the packet was received.
3795 optional string iface = 2;
3796 // The ethertype value of the packet.
3797 optional int32 ethertype = 3;
3798 // String representation of the destination MAC address of the packet.
3799 optional string destination_hardware_address = 4;
3800 // String representation of the source address of the packet if this was an IP packet.
3801 optional string source_ip = 5;
3802 // String representation of the destination address of the packet if this was an IP packet.
3803 optional string destination_ip = 6;
3804 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3805 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3806 // families.
3807 optional int32 ip_next_header = 7;
3808 // The source port if this was a TCP or UDP packet.
3809 optional int32 source_port = 8;
3810 // The destination port if this was a TCP or UDP packet.
3811 optional int32 destination_port = 9;
3812}
3813
3814/*
3815 * Logs the memory stats for an app on startup.
3816 * Logged from:
3817 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3818 */
3819message AppStartMemoryStateCaptured {
3820 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003821 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003822
3823 // The process name.
3824 optional string process_name = 2;
3825
3826 // The activity name.
3827 optional string activity_name = 3;
3828
3829 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003830 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003831
3832 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003833 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003834
3835 // RSS
3836 optional int64 rss_in_bytes = 6;
3837
3838 // CACHE
3839 optional int64 cache_in_bytes = 7;
3840
3841 // SWAP
3842 optional int64 swap_in_bytes = 8;
3843}
3844
3845/*
3846 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3847 * for LMK event.
3848 * Logged from:
3849 * system/core/lmkd/lmkd.c
3850 */
3851message LmkStateChanged {
3852 enum State {
3853 UNKNOWN = 0;
3854 START = 1;
3855 STOP = 2;
3856 }
3857 optional State state = 1;
3858}
3859
3860/*
3861 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3862 * Logged from:
3863 * system/core/lmkd/lmkd.c
3864 */
3865message LmkKillOccurred {
3866 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003868
3869 // The process name.
3870 optional string process_name = 2;
3871
3872 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003873 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003874
3875 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003876 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003877
3878 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003879 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003880
3881 // RSS
3882 optional int64 rss_in_bytes = 6;
3883
3884 // CACHE
3885 optional int64 cache_in_bytes = 7;
3886
3887 // SWAP
3888 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003889
3890 // The elapsed real time of start of the process.
3891 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003892
3893 // Min oom adj score considered by lmkd.
3894 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003895}
3896
Rajeev Kumar51b54602018-03-01 12:18:26 -08003897/*
3898 * Logs when the ActivityManagerService detects that an app died.
3899 *
3900 * Logged from:
3901 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3902 */
3903message AppDied {
3904 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003905 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003906}
3907
Howard Ro21a039c2018-08-06 14:55:47 -07003908/**
3909 * An atom for generic metrics logging. Available from Android Q.
3910 */
3911message GenericAtom {
3912 // The uid of the application that sent this custom atom.
3913 optional int32 uid = 1 [(is_uid) = true];
3914
3915 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003916 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003917}
3918
Tej Singhd6d6d772018-09-05 17:41:25 -07003919/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003920 * Atom for simple logging of user interaction and impression events, such as "the user touched
3921 * this button" or "this dialog was displayed".
3922 * Keep the UI event stream clean: don't use for system or background events.
3923 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003924 *
3925 * Logged from:
3926 * frameworks/base/services/core/java/com/android/server/
3927 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003928 */
3929message UiEventReported {
3930 // The event_id.
3931 optional int32 event_id = 1;
3932 // The event's source or target uid and package, if applicable.
3933 // For example, the package posting a notification, or the destination package of a share.
3934 optional int32 uid = 2 [(is_uid) = true];
3935 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003936 // An identifier used to disambiguate which logs refer to a particular instance of some
3937 // UI element. Useful when there might be multiple instances simultaneously active.
3938 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003939}
3940
3941/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003942 * Reports a notification was created or updated.
3943 *
3944 * Logged from:
3945 * frameworks/base/services/core/java/com/android/server/notification/
3946 */
3947message NotificationReported {
3948 // The event_id (as for UiEventReported).
3949 optional int32 event_id = 1;
3950 // The notifying app's uid and package.
3951 optional int32 uid = 2 [(is_uid) = true];
3952 optional string package_name = 3;
3953 // A small system-assigned identifier for the notification.
3954 // Locally probably-unique, but expect collisions across users and/or days.
3955 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003956 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3957 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003958
3959 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003960 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3961 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3962 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003963
3964 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003965 optional string category = 10; // App-assigned notification category (API-defined strings)
3966 optional int32 style = 11; // App-assigned notification style
3967 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003968
3969 // Ordering, importance and interruptiveness
3970
Will Brockman7614f6962020-02-10 19:43:03 -05003971 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003972
Will Brockman7614f6962020-02-10 19:43:03 -05003973 optional android.stats.sysui.NotificationImportance importance = 14;
3974 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003975
3976 enum NotificationImportanceExplanation {
3977 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3978 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3979 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3980 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3981 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3982 // Like _APP, but based on pre-channels priority signal.
3983 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3984 }
3985
Will Brockman7614f6962020-02-10 19:43:03 -05003986 optional NotificationImportanceExplanation importance_source = 16;
3987 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3988 optional NotificationImportanceExplanation importance_initial_source = 18;
3989 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3990 optional int32 assistant_hash = 20;
3991 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003992}
3993
3994message Notification {
3995 // The notifying app's uid and package.
3996 optional int32 uid = 1 [(is_uid) = true];
3997 optional string package_name = 2;
3998 // A small system-assigned identifier for the notification.
3999 optional int32 instance_id = 3;
4000
4001 // Grouping information.
4002 optional int32 group_instance_id = 4;
4003 optional bool is_group_summary = 5;
4004
4005 // The section of the shade that the notification is in.
4006 // See NotificationSectionsManager.PriorityBucket.
4007 enum NotificationSection {
4008 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05004009 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04004010 SECTION_MEDIA_CONTROLS = 2;
4011 SECTION_PEOPLE = 3;
4012 SECTION_ALERTING = 4;
4013 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05004014 }
4015 optional NotificationSection section = 6;
4016}
4017
4018message NotificationList {
4019 repeated Notification notifications = 1; // An ordered sequence of notifications.
4020}
4021
4022/**
4023 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
4024 *
4025 * Logged from:
4026 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
4027 */
4028message NotificationPanelReported {
4029 // The event_id (as for UiEventReported).
4030 optional int32 event_id = 1;
4031 optional int32 num_notifications = 2;
4032 // The notifications in the panel, in the order that they appear there.
4033 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4034}
4035
4036/**
4037 * Reports a notification channel, or channel group, was created, updated, or deleted.
4038 *
4039 * Logged from:
4040 * frameworks/base/services/core/java/com/android/server/notification/
4041 */
4042message NotificationChannelModified {
4043 // The event_id (as for UiEventReported).
4044 optional int32 event_id = 1;
4045 // The notifying app's uid and package.
4046 optional int32 uid = 2 [(is_uid) = true];
4047 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004048 // Hash of app-assigned notification channel ID or channel-group ID
4049 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004050 // Previous importance setting, if applicable
4051 optional android.stats.sysui.NotificationImportance old_importance = 5;
4052 // New importance setting
4053 optional android.stats.sysui.NotificationImportance importance = 6;
4054}
4055
4056
4057/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004058 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004059 *
4060 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004061 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004062 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004063message BiometricAcquired {
4064 // Biometric modality that was acquired.
4065 optional android.hardware.biometrics.ModalityEnum modality = 1;
4066 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4067 optional int32 user = 2;
4068 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4069 optional bool is_crypto = 3;
4070 // Action that the device is performing. Acquired messages are only expected for enroll and
4071 // authenticate. Other actions may indicate an error.
4072 optional android.hardware.biometrics.ActionEnum action = 4;
4073 // The client that this acquisition was received for.
4074 optional android.hardware.biometrics.ClientEnum client = 5;
4075 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4076 optional int32 acquire_info = 6;
4077 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4078 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004079 // Dictates if this message should trigger additional debugging.
4080 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004081}
4082
4083/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004084 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004085 *
4086 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004087 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004088 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004089message BiometricAuthenticated {
4090 // Biometric modality that was used.
4091 optional android.hardware.biometrics.ModalityEnum modality = 1;
4092 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4093 optional int32 user = 2;
4094 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4095 // storage.
4096 optional bool is_crypto = 3;
4097 // The client that this acquisition was received for.
4098 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004099 // If authentication requires user confirmation. See BiometricPrompt's
4100 // setRequireConfirmation(bool) method.
4101 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004102
Kevin Chyn1741a072019-01-17 11:54:40 -08004103 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004104 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004105 REJECTED = 1;
4106 PENDING_CONFIRMATION = 2;
4107 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004108 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004109
4110 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004111 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004112 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4113 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4114 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4115 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004116 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004117 // Dictates if this message should trigger additional debugging.
4118 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004119}
4120
4121/**
4122 * Logs when a biometric error occurs.
4123 *
4124 * Logged from:
4125 * frameworks/base/services/core/java/com/android/server/biometrics
4126 */
4127message BiometricErrorOccurred {
4128 // Biometric modality that was used.
4129 optional android.hardware.biometrics.ModalityEnum modality = 1;
4130 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4131 optional int32 user = 2;
4132 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4133 optional bool is_crypto = 3;
4134 // Action that the device is performing.
4135 optional android.hardware.biometrics.ActionEnum action = 4;
4136 // The client that this acquisition was received for.
4137 optional android.hardware.biometrics.ClientEnum client = 5;
4138 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4139 // are unique to modality.
4140 optional int32 error_info = 6;
4141 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4142 // by the vendor and not specified by the HIDL interface.
4143 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004144 // Dictates if this message should trigger additional debugging.
4145 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004146 // Time spent during the authentication attempt.
4147 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004148}
4149
4150/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004151 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004152 * Logged from:
4153 * frameworks/base/services/core/java/com/android/server/biometrics
4154 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004155message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004156 // Biometric modality.
4157 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004158 // Type of issue detected.
4159 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004160 // Dictates if this message should trigger additional debugging.
4161 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004162}
Howard Ro688ae182018-09-25 00:09:36 -07004163
joshmccloskey6f952b22019-03-25 20:59:35 -07004164/**
4165 * Logs when a biometric enrollment occurs.
4166 *
4167 * Logged from:
4168 * frameworks/base/services/core/java/com/android/server/biometrics
4169 */
4170message BiometricEnrolled {
4171 // Biometric modality that was used.
4172 optional android.hardware.biometrics.ModalityEnum modality = 1;
4173 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4174 optional int32 user = 2;
4175 // The amount of time the enrollment took in milliseconds.
4176 optional int64 latency_millis = 3;
4177 // Whether or not the enrollment was successful.
4178 optional bool success = 4;
4179}
4180
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004181/*
Tej Singh0d176952019-01-16 19:10:54 -08004182 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004183 */
Tej Singh0d176952019-01-16 19:10:54 -08004184message FlagFlipUpdateOccurred {
4185 // If the event is from a flag config package, specify the package name.
4186 optional string flag_flip_package_name = 1;
4187
4188 // The order id of the package
4189 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004190}
4191
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004192/**
4193 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004194 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004195 */
4196message TrainExperimentIds {
4197 repeated int64 experiment_id = 1;
4198}
4199
Yangster-macb89807e2018-11-15 21:10:57 -08004200/*
4201 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004202 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004203 */
4204message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004205 // Name of the train.
4206 optional string train_name = 1;
4207 // Version code for a "train" of packages that need to be installed atomically
4208 optional int64 train_version_code = 2;
4209 // After installation of this package, device requires a restart.
4210 optional bool requires_staging = 3;
4211 // Rollback should be enabled for this install.
4212 optional bool rollback_enabled = 4;
4213 // Requires low latency monitoring if possible.
4214 optional bool requires_low_latency_monitor = 5;
4215
Yangster-macb89807e2018-11-15 21:10:57 -08004216 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004217 UNKNOWN = 0;
4218 INSTALL_REQUESTED = 1;
4219 INSTALL_STARTED = 2;
4220 INSTALL_STAGED_NOT_READY = 3;
4221 INSTALL_STAGED_READY = 4;
4222 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004223 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4224 // and INSTALL_FAILURE_COMMIT.
4225 INSTALL_FAILURE = 6 [deprecated = true];
4226 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004227 INSTALL_CANCELLED = 7;
4228 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004229 INSTALLER_ROLLBACK_INITIATED = 9;
4230 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4231 INSTALLER_ROLLBACK_STAGED = 11;
4232 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4233 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4234 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4235 INSTALLER_ROLLBACK_SUCCESS = 15;
4236 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004237 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4238 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4239 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4240 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4241 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4242 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004243 INSTALL_FAILURE_DOWNLOAD = 23;
4244 INSTALL_FAILURE_STATE_MISMATCH = 24;
4245 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004246 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004247 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004248 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004249 // Possible experiment ids for monitoring this push.
4250 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4251 // user id
4252 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004253 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004254 // Whether or not this is a rollback event
4255 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004256}
4257
Tej Singhc9203082019-05-03 13:42:23 -07004258/* Test atom, is not logged anywhere */
4259message TestAtomReported {
4260 repeated AttributionNode attribution_node = 1;
4261 optional int32 int_field = 2;
4262 optional int64 long_field = 3;
4263 optional float float_field = 4;
4264 optional string string_field = 5;
4265 optional bool boolean_field = 6;
4266 enum State {
4267 UNKNOWN = 0;
4268 OFF = 1;
4269 ON = 2;
4270 }
4271 optional State state = 7;
4272 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4273}
4274
Maggie Whitefc1aa592018-11-28 21:55:23 -08004275/** Represents USB port overheat event. */
4276message UsbPortOverheatEvent {
4277 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4278 optional int32 plug_temperature_deci_c = 1;
4279
4280 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4281 optional int32 max_temperature_deci_c = 2;
4282
4283 /* Time between USB plug event and overheat threshold trip, in seconds. */
4284 optional int32 time_to_overheat_secs = 3;
4285
4286 /* Time between overheat threshold trip and hysteresis, in seconds. */
4287 optional int32 time_to_hysteresis_secs = 4;
4288
4289 /* Time between hysteresis and active mitigation ending, in seconds. */
4290 optional int32 time_to_inactive_secs = 5;
4291};
4292
Maggie White8735b852019-01-18 11:40:49 -08004293/**
4294 * Logs total effective full charge and discharge cycles on a battery.
4295 * Here are some examples of one effective cycle:
4296 * 1) the battery charges from 0% to 100% and drains back to 0%,
4297 * 2) charging from 50% to 100% and draining back to 50% twice.
4298 * Pulled from:
4299 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4300 */
4301message BatteryCycleCount {
4302 /* Number of total charge and discharge cycles on the system battery. */
4303 optional int32 cycle_count = 1;
4304}
4305
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004306/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004307 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4308 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004309 * Pulled from:
4310 * StatsCompanionService
4311 */
4312
Carmen Agimof12dec122019-03-06 16:14:38 +00004313message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004314
Carmen Agimof12dec122019-03-06 16:14:38 +00004315 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004316 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004317 PUBLIC = 1;
4318 PRIVATE = 2;
4319 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004320 }
4321
Carmen Agimof12dec122019-03-06 16:14:38 +00004322 // The type of external storage.
4323 optional android.stats.storage.ExternalStorageType storage_type = 1;
4324 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4325 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004326 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004327 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004328}
4329
Yangster-macb89807e2018-11-15 21:10:57 -08004330/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004331 * Logs when a connection becomes available and lost.
4332 * Logged in StatsCompanionService.java
4333 */
4334message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004335 // Id of the network.
4336 optional int32 net_id = 1;
4337
4338 enum State {
4339 UNKNOWN = 0;
4340 CONNECTED = 1;
4341 DISCONNECTED = 2;
4342 }
4343 // Connected state of a network.
4344 optional State state = 2;
4345}
4346
4347/**
4348 * Logs when a service starts and stops.
4349 * Logged from:
4350 * services/core/java/com/android/server/am/ActiveServices.java
4351 */
4352message ServiceStateChanged {
4353
4354 optional int32 uid = 1 [(is_uid) = true];
4355
4356 optional string package_name = 2;
4357
4358 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004359
4360 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004361 START = 1;
4362 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004363 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004364
4365 optional State state = 4;
4366}
4367
4368/**
4369 * Logs when a service is launched.
4370 * Logged from:
4371 * services/core/java/com/android/server/am/ActiveServices.java
4372 */
4373message ServiceLaunchReported {
4374
4375 optional int32 uid = 1 [(is_uid) = true];
4376
4377 optional string package_name = 2;
4378
4379 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004380}
Howard Ro688ae182018-09-25 00:09:36 -07004381
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004382/**
4383 * Logs when a hidden API is used.
4384 *
4385 * Logged from:
4386 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4387 */
4388message HiddenApiUsed {
4389 // The uid of the app making the hidden access.
4390 optional int32 uid = 1 [(is_uid) = true];
4391
4392 // Signature of the method or field accessed.
4393 optional string signature = 2;
4394
4395 enum AccessMethod {
4396 NONE = 0;
4397 REFLECTION = 1;
4398 JNI = 2;
4399 LINKING = 3;
4400 }
4401
4402 // Type of access.
4403 optional AccessMethod access_method = 3;
4404
4405 // Whether the access was prevented or not.
4406 optional bool access_denied = 4;
4407}
4408
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004409/**
4410 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4411 * - When user sees privacy chip
4412 * - When user clicks privacy chip
4413 * - How does the user exit the Privacy Dialog
4414 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004415 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4416 */
4417message PrivacyIndicatorsInteracted {
4418
4419 enum Type {
4420 UNKNOWN = 0;
4421 CHIP_VIEWED = 1;
4422 CHIP_CLICKED = 2;
4423 DIALOG_PRIVACY_SETTINGS = 3;
4424 DIALOG_DISMISS = 4;
4425 DIALOG_LINE_ITEM = 5;
4426 }
4427
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004428 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004429
4430 // Used if the type is LINE_ITEM
4431 optional string package_name = 2;
4432}
4433
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004434/**
4435 * Logs information about a package that is moved from the internal to external storage and vice
4436 * versa.
4437 * It logs the package name, the type of the external storage where the package is installed
4438 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4439 * and the move type: if it's from internal to external or the other way around.
4440 *
4441 * Logged from:
4442 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4443 */
4444message AppMovedStorageReported {
4445 enum MoveType {
4446 UNKNOWN = 0;
4447 TO_EXTERNAL = 1;
4448 TO_INTERNAL = 2;
4449 }
4450 // The type of the external storage.
4451 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4452 // The type of move.
4453 optional MoveType move_type = 2;
4454 // The name of the package that was moved.
4455 optional string package_name = 3;
4456}
4457
jianjin8f2dee02019-03-29 14:03:08 -07004458/**
4459 * Logs when system server watchdog occurs.
4460 * Logged from:
4461 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4462 */
4463message SystemServerWatchdogOccurred {
4464 optional string subject = 1;
4465}
4466
4467/**
4468 * Logs when new file added to tombstones.
4469 * Logged from:
4470 * frameworks/base/core/java/com/android/server/BootReceiver.java
4471 */
4472message TombStoneOccurred {
4473}
4474
Hai Zhang5d3328d2019-04-13 21:25:06 +08004475/*
4476 * Information about a role request
4477 *
4478 * Logged from:
4479 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4480 */
4481message RoleRequestResultReported {
4482 // UID of application requesting the role
4483 optional int32 requesting_uid = 1;
4484
4485 // Package name of application requesting the role
4486 optional string requesting_package_name = 2;
4487
4488 // The role to be granted
4489 optional string role_name = 3;
4490
4491 // The count of applications qualifying for the role
4492 optional int32 qualifying_count = 4;
4493
4494 // UID of application current granted the role
4495 optional int32 current_uid = 5;
4496
4497 // Package name of application current granted the role
4498 optional string current_package_name = 6;
4499
4500 // UID of another application that user chose to grant the role to, instead of the requesting
4501 // application
4502 optional int32 granted_another_uid = 7;
4503
4504 // Package name of another application that user chose to grant the role to, instead of the
4505 // requesting application
4506 optional string granted_another_package_name = 8;
4507
4508 enum Result {
4509 UNDEFINED = 0;
4510 // role request was ignored
4511 IGNORED = 1;
4512 // role request was ignored because it's already granted
4513 IGNORED_ALREADY_GRANTED = 2;
4514 // role request was ignored because the application isn't qualified
4515 IGNORED_NOT_QUALIFIED = 3;
4516 // role request was ignored because user said it should be always denied
4517 IGNORED_USER_ALWAYS_DENIED = 4;
4518 // role was granted by user action
4519 USER_GRANTED = 5;
4520 // role was denied by user action
4521 USER_DENIED = 6;
4522 // role was denied by user granting another application the role
4523 USER_DENIED_GRANTED_ANOTHER = 7;
4524 // role was denied and set to be always denied by the user
4525 USER_DENIED_WITH_ALWAYS = 8;
4526 }
4527 // The result of the role request
4528 optional Result result = 9;
4529}
4530
Mark Tabrya824a642019-11-05 12:26:12 -08004531/**
4532 * Logs when a Vehicle Maps Service client's connection state has changed
4533 *
4534 * Logged from:
4535 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4536 */
4537message VmsClientConnectionStateChanged {
4538 // The UID of the VMS client app
4539 optional int32 uid = 1 [(is_uid) = true];
4540
4541 enum State {
4542 UNKNOWN = 0;
4543 // Attempting to connect to the client
4544 CONNECTING = 1;
4545 // Client connection established
4546 CONNECTED = 2;
4547 // Client connection closed unexpectedly
4548 DISCONNECTED = 3;
4549 // Client connection closed by VMS
4550 TERMINATED = 4;
4551 // Error establishing the client connection
4552 CONNECTION_ERROR = 5;
4553 }
4554
4555 optional State state = 2;
4556}
4557
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004558/**
4559 * Logs when MediaProvider has successfully finished scanning a storage volume.
4560 *
4561 * Logged from:
4562 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4563 */
shafik43825842020-04-02 17:30:24 +01004564message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004565 enum Reason {
4566 // Scan triggered due to unknown reason
4567 UNKNOWN = 0;
4568 // Scan triggered due to storage volume being mounted
4569 MOUNTED = 1;
4570 // Scan triggered due to explicit user action or app request
4571 DEMAND = 2;
4572 // Scan triggered due to idle maintenance
4573 IDLE = 3;
4574 }
4575
4576 // Volume type that this event pertains to
4577 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4578 // Reason why this scan was triggered
4579 optional Reason reason = 2;
4580 // Total number of files scanned
4581 optional int64 item_count = 3;
4582 // Duration of scan, normalized per file
4583 optional float normalized_duration_millis = 4;
4584 // Number of database inserts, normalized per file
4585 optional float normalized_insert_count = 5;
4586 // Number of database updates, normalized per file
4587 optional float normalized_update_count = 6;
4588 // Number of database deletes, normalized per file
4589 optional float normalized_delete_count = 7;
4590}
4591
4592/**
4593 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4594 *
4595 * Logged from:
4596 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4597 */
shafik43825842020-04-02 17:30:24 +01004598message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004599 // Volume type that this event pertains to
4600 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004601 // UID of app that requested deletion
4602 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004603 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004604 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004605}
4606
4607/**
4608 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4609 *
4610 * Logged from:
4611 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4612 */
shafik43825842020-04-02 17:30:24 +01004613message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004614 enum Result {
4615 UNKNOWN = 0;
4616 USER_GRANTED = 1;
4617 AUTO_GRANTED = 2;
4618 USER_DENIED = 3;
4619 USER_DENIED_WITH_PREJUDICE = 4;
4620 AUTO_DENIED = 5;
4621 }
4622
4623 // Volume type that this event pertains to
4624 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004625 // UID of app that requested permission
4626 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004627 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004628 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004629 // Result of this request
shafik43825842020-04-02 17:30:24 +01004630 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004631}
4632
4633/**
4634 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4635 *
4636 * Logged from:
4637 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4638 */
shafik43825842020-04-02 17:30:24 +01004639message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004640 // Volume type that this event pertains to
4641 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4642 // Old database version code
4643 optional int32 version_from = 2;
4644 // New database version code
4645 optional int32 version_to = 3;
4646 // Total number of files in database
4647 optional int64 item_count = 4;
4648 // Duration of schema change, normalized per file
4649 optional float normalized_duration_millis = 5;
4650}
4651
4652/**
4653 * Logs when MediaProvider has finished an idle maintenance job.
4654 *
4655 * Logged from:
4656 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4657 */
shafik43825842020-04-02 17:30:24 +01004658message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004659 // Volume type that this event pertains to
4660 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4661
4662 // Total number of files in database
4663 optional int64 item_count = 2;
4664 // Duration of idle maintenance, normalized per file
4665 optional float normalized_duration_millis = 3;
4666 // Number of thumbnails found to be stale, normalized per file
4667 optional float normalized_stale_thumbnails = 4;
4668 // Number of items found to be expired, normalized per file
4669 optional float normalized_expired_media = 5;
4670}
4671
Keun young Park3e033cb2019-12-18 11:27:35 -08004672/**
4673 * Represents boot time event with duration in ms.
4674 *
4675 * Logged from: bootstat and various system server components. Check each enums for details.
4676 */
4677message BootTimeEventDuration {
4678 enum DurationEvent {
4679 UNKNOWN = 0;
4680 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4681 ABSOLUTE_BOOT_TIME = 1;
4682 // Bootloader's 1st stage execution time.
4683 // Logged from bootstat.
4684 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4685 // Bootloader's 1st stage loading time.
4686 // Logged from bootstat.
4687 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4688 // Bootloader's kernel loading time.
4689 // Logged from bootstat.
4690 BOOTLOADER_KERNEL_LOAD = 4;
4691 // Bootloader's 2nd stage execution time.
4692 // Logged from bootstat.
4693 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4694 // Bootloader's 2nd stage loading time.
4695 // Logged from bootstat.
4696 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4697 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4698 // for locked device.
4699 // Logged from bootstat.
4700 BOOTLOADER_UI_WAIT = 7;
4701 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4702 // Logged from bootstat.
4703 BOOTLOADER_TOTAL = 8;
4704 // Shutdown duration inside init for the reboot before the current boot up.
4705 // Logged from f/b/services/.../BootReceiver.java.
4706 SHUTDOWN_DURATION = 9;
4707 // Total time for mounting of disk devices during bootup.
4708 // Logged from f/b/services/.../BootReceiver.java.
4709 MOUNT_DEFAULT_DURATION = 10;
4710 // Total time for early stage mounting of disk devices during bootup.
4711 // Logged from f/b/services/.../BootReceiver.java.
4712 MOUNT_EARLY_DURATION = 11;
4713 // Total time for late stage mounting of disk devices during bootup.
4714 // Logged from f/b/services/.../BootReceiver.java.
4715 MOUNT_LATE_DURATION = 12;
4716 // Average time to scan non-system app after OTA
4717 // Logged from f/b/services/.../PackageManagerService.java
4718 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4719 // Time to initialize Package manager after OTA
4720 // Logged from f/b/services/.../PackageManagerService.java
4721 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4722 // Time to scan all system app from Package manager after OTA
4723 // Logged from f/b/services/.../PackageManagerService.java
4724 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4725 // Init's total time for cold boot stage.
4726 // Logged from bootstat.
4727 COLDBOOT_WAIT = 16;
4728 // Init's total time for initializing selinux.
4729 // Logged from bootstat.
4730 SELINUX_INIT = 17;
4731 // Time since last factory reset.
4732 // Logged from bootstat.
4733 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004734 // Init's total time spent for completing the 1st stage.
4735 // Logged from bootstat.
4736 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004737 }
4738
4739 // Type of the event.
4740 optional DurationEvent event = 1;
4741 // Duration of the event in ms.
4742 optional int64 duration_millis = 2;
4743}
4744
4745/**
4746 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4747 * since boot-up.
4748 *
4749 * Logged from: bootstat and various system server components. Check each enums for details.
4750 */
4751message BootTimeEventElapsedTime {
4752 enum ElapsedTimeEvent {
4753 UNKNOWN = 0;
4754 // Time when init starts 1st stage. Logged from bootstat.
4755 ANDROID_INIT_STAGE_1 = 1;
4756 // Time when sys.boot_completed prop is set.
4757 // Logged from bootstat.
4758 BOOT_COMPLETE = 2;
4759 // BOOT_COMPLETE for encrypted device.
4760 BOOT_COMPLETE_ENCRYPTION = 3;
4761 // BOOT_COMPLETE for device with no encryption.
4762 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4763 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004764 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004765 // BOOT_COMPLETE after factory reset.
4766 FACTORY_RESET_BOOT_COMPLETE = 6;
4767 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4768 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004769 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4770 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004771 // BOOT_COMPLETE after OTA.
4772 OTA_BOOT_COMPLETE = 9;
4773 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4774 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004775 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4776 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004777 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4778 // Logged from f/b/services/.../UserController.java
4779 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4780 // Time when the system starts sending BOOT_COMPLETED broadcast.
4781 // Logged from f/b/services/.../UserController.java
4782 FRAMEWORK_BOOT_COMPLETED = 13;
4783 // Time when the package manager starts init.
4784 // Logged from f/b/services/.../SystemServer.java
4785 PACKAGE_MANAGER_INIT_START = 14;
4786 // Time when package manager is ready
4787 // Logged from f/b/services/.../SystemServer.java
4788 PACKAGE_MANAGER_INIT_READY = 15;
4789 // Represents the time when user has entered unlock credential for system with user pin.
4790 // Logged from bootstat.
4791 POST_DECRYPT = 16;
4792 // Represents the start of zygote's init.
4793 // Logged from zygote itself.
4794 ZYGOTE_INIT_START = 17;
4795 // Represents the start of secondary zygote's init.
4796 // TODO: add logging to zygote
4797 SECONDARY_ZYGOTE_INIT_START = 18;
4798 // Represents the start of system server's init.
4799 // Logged from f/b/services/.../SystemServer.java
4800 SYSTEM_SERVER_INIT_START = 19;
4801 // Represents the completion of system server's init.
4802 // Logged from f/b/services/.../SystemServer.java
4803 SYSTEM_SERVER_READY = 20;
4804 // Represents the start of launcher during boot-up.
4805 // TODO: add logging
4806 LAUNCHER_START = 21;
4807 // Represents the completion of launcher's initial rendering. User can use other apps from
4808 // launcher from this point.
4809 // TODO: add logging
4810 LAUNCHER_SHOWN = 22;
4811 }
4812
4813 // Type of the event.
4814 optional ElapsedTimeEvent event = 1;
4815 // Time since bootup for the event.
4816 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4817 optional int64 time_millis = 2;
4818}
4819
4820/**
4821 * Boot time events with UTC time.
4822 *
4823 * Logged from: bootstat and various system server components. Check each enums for details.
4824 */
4825message BootTimeEventUtcTime {
4826 enum UtcTimeEvent {
4827 UNKNOWN = 0;
4828 // Time of the bootstat's marking of 1st boot after the last factory reset.
4829 // Logged from bootstat.
4830 FACTORY_RESET_RESET_TIME = 1;
4831 // The time when bootstat records FACTORY_RESET_* events. This is close to
4832 // BOOT_COMPLETE time for the current bootup.
4833 // Logged from bootstat.
4834 FACTORY_RESET_CURRENT_TIME = 2;
4835 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4836 // Logged from bootstat.
4837 FACTORY_RESET_RECORD_VALUE = 3;
4838 }
4839
4840 // Type of the event.
4841 optional UtcTimeEvent event = 1;
4842 // UTC time for the event.
4843 optional int64 utc_time_secs = 2;
4844}
4845
4846/**
4847 * Boot time events representing specific error code during bootup.
4848 * Meaning of error code can be different per each event type.
4849 *
4850 * Logged from: bootstat and various system server components. Check each enums for details.
4851 */
4852message BootTimeEventErrorCode {
4853 enum ErrorCodeEvent {
4854 UNKNOWN = 0;
4855 // Linux error code for time() call to get the current UTC time.
4856 // Logged from bootstat.
4857 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4858 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4859 // as UMOUNT_STAT_* from init/reboot.cpp.
4860 // Logged from f/b/services/.../BootReceiver.java.
4861 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004862 // Reprepsents fie system mounting error code of /data partition for the current boot.
4863 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004864 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004865 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004866 }
4867
4868 // Type of the event.
4869 optional ErrorCodeEvent event = 1;
4870 // error code defined per each event type.
4871 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4872 // FS_MGR_FS_STAT.
4873 optional int32 error_code = 2;
4874}
4875
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004876/**
4877 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4878 * after an OTA.
4879 *
4880 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004881 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004882 */
4883message SnapshotMergeReported {
4884 // Keep in sync with
4885 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4886 enum UpdateState {
4887 // No update or merge is in progress.
4888 NONE = 0;
4889 // An update is applying; snapshots may already exist.
4890 INITIATED = 1;
4891 // An update is pending, but has not been successfully booted yet.
4892 UNVERIFIED = 2;
4893 // The kernel is merging in the background.
4894 MERGING = 3;
4895 // Post-merge cleanup steps could not be completed due to a transient
4896 // error, but the next reboot will finish any pending operations.
4897 MERGE_NEEDS_REBOOT = 4;
4898 // Merging is complete, and needs to be acknowledged.
4899 MERGE_COMPLETED = 5;
4900 // Merging failed due to an unrecoverable error.
4901 MERGE_FAILED = 6;
4902 // The update was implicitly cancelled, either by a rollback or a flash
4903 // operation via fastboot. This state can only be returned by WaitForMerge.
4904 CANCELLED = 7;
4905 };
4906
4907 // Status of the update after the merge attempts.
4908 optional UpdateState final_state = 1;
4909
4910 // Time to complete a merge operation in milliseconds.
4911 // A negative value corresponds to the case in which the merge operation
4912 // was interrupted and resumed (e.g. in case of a system reboot during the
4913 // merge).
4914 optional int64 duration_millis = 2;
4915
4916 // Number of reboots that occurred after issuing and before completing the
4917 // merge of all the snapshot devices.
4918 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004919
4920 // The device has been upgraded to Virtual A/B.
4921 optional bool is_vab_retrofit = 4;
4922
4923 // Space that has been temporarily allocated in the /data partition
4924 // containing the dm-snapshot's copy-on-write data generated during a
4925 // Virtual A/B update.
4926 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004927}
4928
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -07004929/**
4930 * Event representing when BlobStoreManager.Session#commit() is called
4931 *
4932 * Logged from:
4933 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4934 */
4935message BlobCommitted {
4936 // Uid of the Blob committer
4937 optional int32 uid = 1 [(is_uid) = true];
4938
4939 // Id of the Blob committed
4940 optional int64 blob_id = 2;
4941
4942 // Size of the Blob
4943 optional int64 size = 3;
4944
4945 enum Result {
4946 UNKNOWN = 0;
4947 // Commit Succeeded
4948 SUCCESS = 1;
4949 // Commit Failed: Error occurred during commit
4950 ERROR_DURING_COMMIT = 2;
4951 // Commit Failed: Digest of the data did not match Blob digest
4952 DIGEST_MISMATCH = 3;
4953 }
4954 optional Result result = 4;
4955}
4956
4957/**
4958 * Event representing when BlobStoreManager#acquireLease() is called
4959 *
4960 * Logged from:
4961 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4962 */
4963message BlobLeased{
4964 // Uid of the Blob leasee
4965 optional int32 uid = 1 [(is_uid) = true];
4966
4967 // Id of the Blob leased or 0 if the Blob does not exist
4968 optional int64 blob_id = 2;
4969
4970 // Size of the Blob or 0 if the Blob does not exist
4971 optional int64 size = 3;
4972
4973 enum Result {
4974 UNKNOWN = 0;
4975 // Lease Succeeded
4976 SUCCESS = 1;
4977 // Lease Failed: Blob does not exist
4978 BLOB_DNE = 2;
4979 // Lease Failed: Leasee does not have access to the Blob
4980 ACCESS_NOT_ALLOWED = 3;
4981 // Lease Failed: Leasee requested an invalid expiry duration
4982 LEASE_EXPIRY_INVALID = 4;
4983 // Lease Failed: Leasee has exceeded the total data lease limit
4984 DATA_SIZE_LIMIT_EXCEEDED = 5;
4985 }
4986 optional Result result = 4;
4987}
4988
4989/**
4990 * Event representing when BlobStoreManager#openBlob() is called
4991 *
4992 * Logged from:
4993 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4994 */
4995message BlobOpened{
4996 // Uid of the Blob opener
4997 optional int32 uid = 1 [(is_uid) = true];
4998
4999 // Id of the Blob opened or 0 if the Blob does not exist
5000 optional int64 blob_id = 2;
5001
5002 // Size of the Blob or 0 if the Blob does not exist
5003 optional int64 size = 3;
5004
5005 enum Result {
5006 UNKNOWN = 0;
5007 // Open Succeeded
5008 SUCCESS = 1;
5009 // Open Failed: Blob does not exist
5010 BLOB_DNE = 2;
5011 // Open Failed: Opener does not have access to the Blob
5012 ACCESS_NOT_ALLOWED = 3;
5013 }
5014 optional Result result = 4;
5015}
5016
Chenjie Yubbcbc602018-02-05 16:51:52 -08005017//////////////////////////////////////////////////////////////////////
5018// Pulled atoms below this line //
5019//////////////////////////////////////////////////////////////////////
5020
5021/**
David Chenc8a43242017-10-17 16:23:28 -07005022 * Pulls bytes transferred via wifi (Sum of 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 WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005028 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005029
5030 optional int64 rx_bytes = 2;
5031
5032 optional int64 rx_packets = 3;
5033
5034 optional int64 tx_bytes = 4;
5035
5036 optional int64 tx_packets = 5;
5037}
5038
5039/**
5040 * Pulls bytes transferred via wifi (separated by foreground and background usage).
5041 *
5042 * Pulled from:
5043 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
5044 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005045message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005046 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005047
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005048 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
5049 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005050
5051 optional int64 rx_bytes = 3;
5052
5053 optional int64 rx_packets = 4;
5054
5055 optional int64 tx_bytes = 5;
5056
5057 optional int64 tx_packets = 6;
5058}
5059
5060/**
5061 * Pulls bytes transferred via mobile networks (Sum of 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 MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005067 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005068
5069 optional int64 rx_bytes = 2;
5070
5071 optional int64 rx_packets = 3;
5072
5073 optional int64 tx_bytes = 4;
5074
5075 optional int64 tx_packets = 5;
5076}
5077
5078/**
5079 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
5080 *
5081 * Pulled from:
5082 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
5083 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005084message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005085 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005086
Yao Chenc40a19d2018-03-15 16:48:25 -07005087 // 1 denotes foreground and 0 denotes background. This is called Set in
5088 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005089 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005090
5091 optional int64 rx_bytes = 3;
5092
5093 optional int64 rx_packets = 4;
5094
5095 optional int64 tx_bytes = 5;
5096
5097 optional int64 tx_packets = 6;
5098}
5099
5100/**
junyulai8d1a6092020-05-07 13:38:15 +08005101 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08005102 * Note that the data is expected to be sliced into more dimensions in future. In other words,
5103 * the caller must not assume any row of data is one full report when filtering with a set of
5104 * matching conditions, because future data may represent with multiple rows what is currently
5105 * represented by one.
5106 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
5107 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08005108 *
5109 * Pulled from:
5110 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
5111 */
5112message DataUsageBytesTransfer {
5113 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
5114 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
5115 // states combined, not including debug states. See NetworkStats#SET_*.
5116 optional int32 state = 1;
5117
5118 optional int64 rx_bytes = 2;
5119
5120 optional int64 rx_packets = 3;
5121
5122 optional int64 tx_bytes = 4;
5123
5124 optional int64 tx_packets = 5;
5125
5126 // Radio Access Technology (RAT) type of this record, should be one of
5127 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5128 // the record is for all rat types combined.
5129 optional int32 rat_type = 6;
5130
5131 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005132 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005133 optional string sim_mcc = 7;
5134 optional string sim_mnc = 8;
5135
junyulai8b794b72020-05-19 17:36:13 +08005136 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5137 // See TelephonyManager#getSimCarrierId.
5138 optional int32 carrier_id = 9;
5139
junyulai8d1a6092020-05-07 13:38:15 +08005140 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5141 // combined regardless of the boolean value in its field.
5142 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005143 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005144 ALL = 1;
5145 OPPORTUNISTIC = 2;
5146 NOT_OPPORTUNISTIC = 3;
5147 }
5148 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005149 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005150 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005151 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005152}
5153
5154/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005155 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5156 *
5157 * Pulled from:
5158 * StatsCompanionService
5159 */
5160message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005161 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005162
5163 optional int64 rx_bytes = 2;
5164
5165 optional int64 tx_bytes = 3;
5166}
5167
5168/**
David Chenc8a43242017-10-17 16:23:28 -07005169 * Pulls the kernel wakelock durations. This atom is adapted from
5170 * android/internal/os/KernelWakelockStats.java
5171 *
5172 * Pulled from:
5173 * StatsCompanionService using KernelWakelockReader.
5174 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005175message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005176 optional string name = 1;
5177
5178 optional int32 count = 2;
5179
5180 optional int32 version = 3;
5181
Yangster-maca8a30442018-10-13 23:46:34 -07005182 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005183}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005184
Chenjie Yu05013b32017-11-21 10:21:41 -08005185/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005186 * Pulls low power state information. If power.stats HAL is not available, this
5187 * includes platform and subsystem sleep state information,
5188 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5189 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005190 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005191 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005192 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5193 * as defined in:
5194 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005195 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005196message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005197 // Subsystem name
5198 optional string subsystem_name = 1;
5199 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5200 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005201 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5202 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005203 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005204 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005205 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005206 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005207 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005208}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005209
Chenjie Yu05013b32017-11-21 10:21:41 -08005210/**
Bookatz92da2832018-11-01 18:10:03 -07005211 * Pulls on-device power measurement information.
5212 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5213 * Pulled from:
5214 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5215 */
5216message OnDevicePowerMeasurement {
5217 // Name of the subsystem (to which the rail belongs).
5218 optional string subsystem_name = 1;
5219
5220 // Rail name. The rail lies within the subsystem.
5221 optional string rail_name = 2;
5222
5223 // Time (in ms since boot) at which the rail energy value was measured.
5224 // This may differ slightly from the time that statsd logs this information.
5225 optional uint64 measurement_timestamp_millis = 3;
5226
5227 // Accumulated energy used via the rail since device boot in uWs.
5228 optional uint64 energy_microwatt_secs = 4;
5229}
5230
5231/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005232 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005233 * Pulls the time the cpu spend on the frequency index. Frequency index
5234 * starts from highest to lowest. The value should be monotonically
5235 * increasing since boot. However, if there is a cpu
5236 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005237 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005238message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005239 optional uint32 cluster = 1;
5240 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005241 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005242}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005243
Chenjie Yu05013b32017-11-21 10:21:41 -08005244/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005245 * Pulls Cpu Time Per Uid.
5246 * Note that isolated process uid time should be attributed to host uids.
5247 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005248message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005249 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005250 optional uint64 user_time_micros = 2;
5251 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005252}
5253
5254/**
5255 * Pulls Cpu Time Per Uid per frequency.
5256 * Note that isolated process uid time should be attributed to host uids.
5257 * For each uid, we order the time by descending frequencies.
5258 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005259message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005260 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005261 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005262 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005263}
Hugo Benichi884970e2017-11-14 22:42:46 +09005264
Chenjie Yu05013b32017-11-21 10:21:41 -08005265/**
5266 * Pulls Wifi Controller Activity Energy Info
5267 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005268message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005269 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005270 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005271 // stack reported state
5272 // TODO: replace this with proto enum
5273 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005274 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005275 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005276 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005277 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005278 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005279 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005280 // product of current(mA), voltage(V) and time(ms)
5281 optional uint64 controller_energy_used = 6;
5282}
5283
5284/**
5285 * Pulls Modem Activity Energy Info
5286 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005287message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005288 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005289 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005290 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005291 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005292 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005293 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005294 /**
5295 * Tx power index
5296 * index 0 = tx_power < 0dBm
5297 * index 1 = 0dBm < tx_power < 5dBm
5298 * index 2 = 5dBm < tx_power < 15dBm
5299 * index 3 = 15dBm < tx_power < 20dBm
5300 * index 4 = tx_power > 20dBm
5301 */
5302 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005303 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005304 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005305 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005306 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005307 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005308 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005309 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005310 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005311 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005312 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005313 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005314 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005315 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005316}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005317
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005318/**
5319 * Pulls Bluetooth Activity Energy Info
5320 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5321 */
5322message BluetoothActivityInfo {
5323 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005324 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005325 // bluetooth stack state
5326 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005327 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005328 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005329 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005330 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005331 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005332 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005333 // product of current(mA), voltage(V) and time(ms)
5334 optional uint64 energy_used = 6;
5335}
5336
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005337/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005338 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005339 *
5340 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005341 */
5342message ProcessMemoryState {
5343 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005344 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005345
5346 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005347 // Usually package name, "system" for system server.
5348 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005349 optional string process_name = 2;
5350
Rafal Slawikda51b932018-12-13 16:31:33 +00005351 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005352 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005353
5354 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005355 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005356
5357 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005358 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005359
Rajeev Kumar90235992018-01-29 11:06:48 -08005360 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005361 // Value is read from memory.stat, field total_rss if per-app memory
5362 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005363 optional int64 rss_in_bytes = 6;
5364
5365 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005366 // Value is read from memory.stat, field total_cache if per-app memory
5367 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005368 optional int64 cache_in_bytes = 7;
5369
5370 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005371 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005372 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005373 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005374
Rafal Slawik203c3db2019-09-25 19:53:01 +01005375 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005376 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005377
Rafal Slawik203c3db2019-09-25 19:53:01 +01005378 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5379 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005380
Rafal Slawik203c3db2019-09-25 19:53:01 +01005381 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5382 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005383}
5384
5385/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005386 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005387 *
5388 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5389 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005390 *
5391 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005392 */
5393message ProcessMemoryHighWaterMark {
5394 // The uid if available. -1 means not available.
5395 optional int32 uid = 1 [(is_uid) = true];
5396
Rafal Slawikda51b932018-12-13 16:31:33 +00005397 // The process name.
5398 // Usually package name or process cmdline.
5399 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005400 optional string process_name = 2;
5401
Rafal Slawik239b6802019-09-09 18:46:01 +01005402 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5403 // computed by converting kilobytes to bytes.
5404 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5405
Rafal Slawik3bea8952018-11-15 12:39:33 +00005406 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5407 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005408 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005409}
5410
5411/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005412 * Logs the memory stats for a process.
5413 *
5414 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5415 * and for selected native processes.
5416 */
5417message ProcessMemorySnapshot {
5418 // The uid if available. -1 means not available.
5419 optional int32 uid = 1 [(is_uid) = true];
5420
5421 // The process name.
5422 // Usually package name or process cmdline.
5423 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5424 optional string process_name = 2;
5425
5426 // The pid of the process.
5427 // Allows to disambiguate instances of the process.
5428 optional int32 pid = 3;
5429
5430 // The current OOM score adjustment value.
5431 // Read from ProcessRecord for managed processes.
5432 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5433 optional int32 oom_score_adj = 4;
5434
5435 // The current RSS of the process.
5436 // VmRSS from /proc/pid/status.
5437 optional int32 rss_in_kilobytes = 5;
5438
5439 // The current anon RSS of the process.
5440 // RssAnon from /proc/pid/status.
5441 optional int32 anon_rss_in_kilobytes = 6;
5442
5443 // The current swap size of the process.
5444 // VmSwap from /proc/pid/status.
5445 optional int32 swap_in_kilobytes = 7;
5446
5447 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5448 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5449}
5450
5451/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005452 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005453 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005454message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005455 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005456}
5457
5458/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005459 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005460 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005461message SystemUptime {
5462 // Milliseconds since the system was booted.
5463 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5464 // for external input).
5465 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005466 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005467}
5468
5469/*
5470 * Reads from /proc/uid_concurrent_active_time which has the format:
5471 * active: X (X is # cores)
5472 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5473 * [uid1]: [time-0] [time-1] [time-2] ... ...
5474 * ...
5475 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5476 * The file contains a monotonically increasing count of time for a single boot.
5477 */
5478message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005479 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005480 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005481}
5482
5483/**
5484 * Reads from /proc/uid_concurrent_policy_time which has the format:
5485 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5486 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5487 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5488 * ...
5489 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5490 * The file contains a monotonically increasing count of time for a single boot.
5491 */
5492message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005493 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005494 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005495 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005496}
5497
5498/*
5499 * Pulls free disk space, for data, system partition and temporary directory.
5500 */
5501message DiskSpace {
5502 // available bytes in data partition
5503 optional uint64 data_available_bytes = 1;
5504 // available bytes in system partition
5505 optional uint64 system_available_bytes = 2;
5506 // available bytes in download cache or temp directories
5507 optional uint64 temp_available_bytes = 3;
5508}
Tej Singhbf972d92018-01-10 20:51:13 -08005509
5510/**
5511 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005512 *
5513 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005514 */
5515message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005516 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005517}
5518
5519/**
5520 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005521 * Pulled from:
5522 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005523 */
5524message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005525 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005526}
5527
5528/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005529 * Pulls battery voltage.
5530 * Pulled from:
5531 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5532 */
5533message BatteryVoltage {
5534 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005535 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005536}
5537
5538/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005539 * Pulls battery level (percent full, from 0 to 100).
5540 *
5541 * Pulled from:
5542 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5543 */
5544message BatteryLevel {
5545 // Battery level. Should be in [0, 100].
5546 optional int32 battery_level = 1;
5547}
5548
5549/**
Tej Singhd89137e2018-03-26 14:51:40 -07005550 * Pulls the temperature of various parts of the device.
5551 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005552 *
Maggie White442b6312019-04-05 16:26:44 -07005553 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005554 */
5555message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005556 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005557 optional android.os.TemperatureTypeEnum sensor_location = 1;
5558
5559 // The name of the temperature source. Eg. CPU0
5560 optional string sensor_name = 2;
5561
Tej Singhd89137e2018-03-26 14:51:40 -07005562 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005563 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005564 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005565
5566 // Relative severity of the throttling, see enum definition.
5567 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005568}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005569
5570/**
5571 * Pulls the statistics of calls to Binder.
5572 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005573 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5574 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005575 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005576 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005577 */
5578message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005579 // UID of the process responsible for the binder transaction. It will be set if the process
5580 // executing the binder transaction attribute the transaction to another uid using
5581 // Binder.setThreadWorkSource().
5582 //
5583 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005584 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005585 // UID of the process executing the binder transaction.
5586 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005587 // Fully qualified class name of the API call.
5588 //
5589 // This is a system server class name.
5590 //
5591 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5592 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5593 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5594 // commonly used APIs.
5595 optional string service_class_name = 2;
5596 // Method name of the API call. It can also be a transaction code if we cannot
5597 // resolve it to a name. See Binder#getTransactionName.
5598 //
5599 // This is a system server method name.
5600 optional string service_method_name = 3;
5601 // Total number of API calls.
5602 optional int64 call_count = 4;
5603 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5604 optional bool screen_interactive = 13;
5605 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5606 // call_count will be equal to recorded_call_count.
5607 //
5608 // If recorded_call_count is different than call_count, it means data collection has been
5609 // sampled. All the fields below will be sampled in this case.
5610 optional int64 recorded_call_count = 12;
5611 // Number of exceptions thrown by the API.
5612 optional int64 recorded_exception_count = 5;
5613 // Total latency of all API calls.
5614 // Average can be computed using total_latency_micros / recorded_call_count.
5615 optional int64 recorded_total_latency_micros = 6;
5616 // Maximum latency of one API call.
5617 optional int64 recorded_max_latency_micros = 7;
5618 // Total CPU usage of all API calls.
5619 // Average can be computed using total_cpu_micros / recorded_call_count.
5620 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5621 optional int64 recorded_total_cpu_micros = 8;
5622 // Maximum CPU usage of one API call.
5623 optional int64 recorded_max_cpu_micros = 9;
5624 // Maximum parcel reply size of one API call.
5625 optional int64 recorded_max_reply_size_bytes = 10;
5626 // Maximum parcel request size of one API call.
5627 optional int64 recorded_max_request_size_bytes = 11;
5628}
5629
5630/**
5631 * Pulls the statistics of exceptions during calls to Binder.
5632 *
5633 * Binder stats are cumulative from boot unless somebody reset the data using
5634 * > adb shell dumpsys binder_calls_stats --reset
5635 */
5636message BinderCallsExceptions {
5637 // Exception class name, e.g. java.lang.IllegalArgumentException.
5638 //
5639 // This is an exception class name thrown by the system server.
5640 optional string exception_class_name = 1;
5641 // Total number of exceptions.
5642 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005643}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005644
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005645/**
5646 * Pulls the statistics of message dispatching on HandlerThreads.
5647 *
5648 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5649 * config on the device.
5650 *
5651 * Next tag: 11
5652 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005653message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005654 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005655 optional int32 uid = 1 [(is_uid) = true];
5656
5657 // Fully qualified class name of the handler target class.
5658 //
5659 // This field does not contain PII. This is a system server class name.
5660 optional string handler_class_name = 2;
5661
5662 // The name of the thread that runs the Looper.
5663 //
5664 // This field does not contain PII. This is a system server thread name.
5665 optional string looper_thread_name = 3;
5666
5667 // The name of the dispatched message.
5668 //
5669 // This field does not contain PII. This is a system server constant or class
5670 // name.
5671 optional string message_name = 4;
5672
5673 // Total number of successfully dispatched messages.
5674 optional int64 message_count = 5;
5675
5676 // Total number of messages that failed dispatching.
5677 optional int64 exception_count = 6;
5678
5679 // Total number of processed messages we have data recorded for. If we
5680 // collected data for all the messages, message_count will be equal to
5681 // recorded_message_count.
5682 //
5683 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005684 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005685 optional int64 recorded_message_count = 7;
5686
5687 // Total latency of all processed messages.
5688 // Average can be computed using recorded_total_latency_micros /
5689 // recorded_message_count.
5690 optional int64 recorded_total_latency_micros = 8;
5691
5692 // Total CPU usage of all processed message.
5693 // Average can be computed using recorded_total_cpu_micros /
5694 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005695 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005696 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005697
5698 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5699 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005700
5701 // Max recorded CPU usage of all processed messages.
5702 optional int64 recorded_max_cpu_micros = 11;
5703
5704 // Max recorded latency of all processed messages.
5705 optional int64 recorded_max_latency_micros = 12;
5706
5707 // Total number of messages we tracked the dispatching delay for. If we
5708 // collected data for all the messages, message_count will be equal to
5709 // recorded_delay_message_count.
5710 //
5711 // If recorded_delay_message_count is different than message_count, it means data
5712 // collection has been sampled or/and not all messages specified the target dispatch time.
5713 // The fields below will be sampled in this case.
5714 optional int64 recorded_delay_message_count = 13;
5715
5716 // Total dispatching delay of all processed messages.
5717 // Calculated as a difference between the target dispatching time (Message.when)
5718 // and the actual dispatching time.
5719 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5720 optional int64 recorded_total_delay_millis = 14;
5721
5722 // Max dispatching delay of all processed messages.
5723 // Calculated as a difference between the target dispatching time (Message.when)
5724 // and the actual dispatching time.
5725 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005726}
Tej Singh86dc9db2018-09-06 00:39:57 +00005727
5728/**
5729 * Pulls disk information, such as write speed and latency.
5730 */
5731message DiskStats {
5732 // Time taken to open, write 512B to, and close a file.
5733 // -1 if error performing the check.
5734 optional int64 data_write_latency_millis = 1;
5735
5736 optional bool file_based_encryption = 2;
5737
5738 // Recent disk write speed in kB/s.
5739 // -1 if error querying storageed.
5740 // 0 if data is unavailable.
5741 optional int32 recent_disk_write_speed = 3;
5742}
5743
5744
5745/**
5746 * Free and total bytes of the Data, Cache, and System partition.
5747 */
5748message DirectoryUsage {
5749 enum Directory {
5750 UNKNOWN = 0;
5751 DATA = 1;
5752 CACHE = 2;
5753 SYSTEM = 3;
5754 }
5755 optional Directory directory = 1;
5756 optional int64 free_bytes = 2;
5757 optional int64 total_bytes = 3;
5758}
5759
5760
5761/**
5762 * Size of an application: apk size, data size, and cache size.
5763 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5764 * Information is only reported for apps with the primary user (user 0).
5765 * Sizes are aggregated by package name.
5766 */
5767message AppSize {
5768 // Including uids will involve modifying diskstats logic.
5769 optional string package_name = 1;
5770 // App size in bytes. -1 if unavailable.
5771 optional int64 app_size_bytes = 2;
5772 // App data size in bytes. -1 if unavailable.
5773 optional int64 app_data_size_bytes = 3;
5774 // App cache size in bytes. -1 if unavailable.
5775 optional int64 app_cache_size_bytes = 4;
5776 // Time that the cache file was produced.
5777 // Uses System.currentTimeMillis(), which is wall clock time.
5778 optional int64 cache_time_millis = 5;
5779}
5780
5781
5782/**
5783 * Size of a particular category. Eg: photos, videos.
5784 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5785 */
5786message CategorySize {
5787 enum Category {
5788 UNKNOWN = 0;
5789 APP_SIZE = 1;
5790 APP_DATA_SIZE = 2;
5791 APP_CACHE_SIZE = 3;
5792 PHOTOS = 4;
5793 VIDEOS = 5;
5794 AUDIO = 6;
5795 DOWNLOADS = 7;
5796 SYSTEM = 8;
5797 OTHER = 9;
5798 }
5799 optional Category category = 1;
5800 // Category size in bytes.
5801 optional int64 size_bytes = 2;
5802 // Time that the cache file was produced.
5803 // Uses System.currentTimeMillis(), which is wall clock time.
5804 optional int64 cache_time_millis = 3;
5805}
Tej Singhd6d6d772018-09-05 17:41:25 -07005806
5807/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005808 * Pulls per uid I/O stats. The stats are cumulative since boot.
5809 *
5810 * Read/write bytes are I/O events from a storage device
5811 * Read/write chars are data requested by read/write syscalls, and can be
5812 * satisfied by caching.
5813 *
5814 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5815 */
5816message DiskIo {
5817 optional int32 uid = 1 [(is_uid) = true];
5818 optional int64 fg_chars_read = 2;
5819 optional int64 fg_chars_write = 3;
5820 optional int64 fg_bytes_read = 4;
5821 optional int64 fg_bytes_write = 5;
5822 optional int64 bg_chars_read = 6;
5823 optional int64 bg_chars_write = 7;
5824 optional int64 bg_bytes_read = 8;
5825 optional int64 bg_bytes_write = 9;
5826 optional int64 fg_fsync = 10;
5827 optional int64 bg_fsync= 11;
5828}
5829
5830
5831/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005832 * Pulls the number of fingerprints for each user.
5833 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005834 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005835 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005836message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005837 // The associated user. Eg: 0 for owners, 10+ for others.
5838 // Defined in android/os/UserHandle.java
5839 optional int32 user = 1;
5840 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005841 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005842}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005843
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005844/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005845 * Pulls the number of faces for each user.
5846 *
5847 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5848 */
5849message NumFacesEnrolled {
5850 // The associated user. Eg: 0 for owners, 10+ for others.
5851 // Defined in android/os/UserHandle.java
5852 optional int32 user = 1;
5853 // Number of faces registered to that user.
5854 optional int32 num_faces_enrolled = 2;
5855}
5856/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005857 * A mapping of role holder -> role
5858 */
5859message RoleHolder {
5860 // uid of the role holder
5861 optional int32 uid = 1 [(is_uid) = true];
5862
5863 // package name of the role holder
5864 optional string package_name = 2;
5865
5866 // the role held
5867 optional string role = 3;
5868}
5869
Yangsteraf9aee72018-10-12 09:26:16 -07005870message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005871 // These are all in byte resolution.
5872 optional int64 min = 1 [deprecated = true];
5873 optional int64 average = 2 [deprecated = true];
5874 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005875
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005876 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5877 // int64 fields.
5878 optional int32 mean_kb = 4;
5879 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005880}
5881
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005882// A reduced subset of process states; reducing the number of possible states allows more
5883// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5884enum ProcessStateAggregated {
5885 PROCESS_STATE_UNKNOWN = 0;
5886 // Persistent system process.
5887 PROCESS_STATE_PERSISTENT = 1;
5888 // Top activity; actually any visible activity.
5889 PROCESS_STATE_TOP = 2;
5890 // Process binding to top or a foreground service.
5891 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5892 // Processing running a foreground service.
5893 PROCESS_STATE_FGS = 4;
5894 // Important foreground process (ime, wallpaper, etc).
5895 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5896 // Important background process.
5897 PROCESS_STATE_BACKGROUND = 6;
5898 // Process running a receiver.
5899 PROCESS_STATE_RECEIVER = 7;
5900 // All kinds of cached processes.
5901 PROCESS_STATE_CACHED = 8;
5902}
5903
5904// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005905message ProcessStatsStateProto {
5906 optional android.service.procstats.ScreenState screen_state = 1;
5907
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005908 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005909
5910 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5911 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005912 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5913
5914 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005915
5916 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005917 optional int64 duration_millis = 4 [deprecated = true];
5918 // Same as above, but with minute resolution so it fits into an int32.
5919 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005920
5921 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005922 optional int64 realtime_duration_millis = 9 [deprecated = true];
5923 // Same as above, but with minute resolution so it fits into an int32.
5924 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005925
5926 // # of samples taken
5927 optional int32 sample_size = 5;
5928
5929 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005930 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005931
5932 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005933 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005934
5935 // RSS is memory resident for this process
5936 optional AggStats rss = 8;
5937}
5938
Jing Ji060d6862020-04-13 19:36:31 -07005939// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005940message ProcessStatsProto {
5941 // Name of process.
5942 optional string process = 1;
5943
5944 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005945 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005946
5947 // Information about how often kills occurred
5948 message Kill {
5949 // Count of excessive CPU kills
5950 optional int32 cpu = 1;
5951
5952 // Count of kills when cached
5953 optional int32 cached = 2;
5954
5955 // PSS stats during cached kill
5956 optional AggStats cached_pss = 3;
5957 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005958 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005959
5960 // Time and memory spent in various states.
5961 repeated ProcessStatsStateProto states = 5;
5962
5963 // Total time process has been running... screen_state, memory_state, and process_state
5964 // will not be set.
5965 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005966
5967 // Association data for this process in this state;
5968 // each entry here is one association.
5969 repeated ProcessStatsAssociationProto assocs = 7;
5970}
5971
Jing Ji1cd1f602020-06-03 13:45:36 -07005972// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005973message ProcessStatsAssociationProto {
5974 // Procss Name of the associated process (client process of service binding)
5975 optional string assoc_process_name = 1;
5976
5977 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005978 optional string assoc_package_name = 2 [deprecated = true];
5979
5980 // UID of the associated process/package (client package of service binding)
5981 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005982
5983 // Total count of the times this association (service binding) appeared.
5984 optional int32 total_count = 3;
5985
5986 // Uptime total duration in seconds this association (service binding) was around.
5987 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005988}
5989
5990message PackageServiceOperationStatsProto {
5991 // Operate enum: Started, Foreground, Bound, Executing
5992 optional android.service.procstats.ServiceOperationState operation = 1;
5993
5994 // Number of times the service was in this operation.
5995 optional int32 count = 2;
5996
5997 // Information about a state the service can be in.
5998 message StateStats {
5999 // Screen state enum.
6000 optional android.service.procstats.ScreenState screen_state = 1;
6001 // Memory state enum.
6002 optional android.service.procstats.MemoryState memory_state = 2;
6003
6004 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07006005 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006006 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006007 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006008 }
6009 repeated StateStats state_stats = 3;
6010}
6011
6012message PackageServiceStatsProto {
6013 // Name of service component.
6014 optional string service_name = 1;
6015
6016 // The operation stats.
6017 // The package_name, package_uid, package_version, service_name will not be set to save space.
6018 repeated PackageServiceOperationStatsProto operation_stats = 2;
6019}
6020
6021message PackageAssociationSourceProcessStatsProto {
6022 // Uid of the process.
6023 optional int32 process_uid = 1;
6024 // Process name.
6025 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08006026 // Package name.
6027 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07006028 // Total count of the times this association appeared.
6029 optional int32 total_count = 3;
6030
6031 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07006032 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006033
6034 // Total count of the times this association became actively impacting its target process.
6035 optional int32 active_count = 5;
6036
6037 // Information on one source in this association.
6038 message StateStats {
6039 // Process state enum.
6040 optional android.service.procstats.ProcessState process_state = 1;
6041 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006042 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006043 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006044 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006045 }
6046 repeated StateStats active_state_stats = 6;
6047}
6048
6049message PackageAssociationProcessStatsProto {
6050 // Name of the target component.
6051 optional string component_name = 1;
6052 // Information on one source in this association.
6053 repeated PackageAssociationSourceProcessStatsProto sources = 2;
6054}
6055
6056
6057message ProcessStatsPackageProto {
6058 // Name of package.
6059 optional string package = 1;
6060
6061 // Uid of the package.
6062 optional int32 uid = 2;
6063
6064 // Version of the package.
6065 optional int64 version = 3;
6066
6067 // Stats for each process running with the package loaded in to it.
6068 repeated ProcessStatsProto process_stats = 4;
6069
6070 // Stats for each of the package's services.
6071 repeated PackageServiceStatsProto service_stats = 5;
6072
6073 // Stats for each association with the package.
6074 repeated PackageAssociationProcessStatsProto association_stats = 6;
6075}
6076
6077message ProcessStatsSectionProto {
6078 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006079 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07006080
6081 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006082 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006083
6084 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006085 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006086
6087 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006088 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006089
6090 // System runtime library. e.g. "libdvm.so", "libart.so".
6091 optional string runtime = 5;
6092
6093 // whether kernel reports swapped pss.
6094 optional bool has_swapped_pss = 6;
6095
6096 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
6097 enum Status {
6098 STATUS_UNKNOWN = 0;
6099 STATUS_COMPLETE = 1;
6100 STATUS_PARTIAL = 2;
6101 STATUS_SHUTDOWN = 3;
6102 STATUS_SYSPROPS = 4;
6103 }
6104 repeated Status status = 7;
6105
Chenjie Yub2ecc792019-01-17 10:27:26 -08006106 // Number of pages available of various types and sizes, representation fragmentation.
6107 repeated ProcessStatsAvailablePagesProto available_pages = 10;
6108
Yangsteraf9aee72018-10-12 09:26:16 -07006109 // Stats for each process.
6110 repeated ProcessStatsProto process_stats = 8;
6111
6112 // Stats for each package.
6113 repeated ProcessStatsPackageProto package_stats = 9;
6114}
6115
Chenjie Yub2ecc792019-01-17 10:27:26 -08006116message ProcessStatsAvailablePagesProto {
6117 // Node these pages are in (as per /proc/pagetypeinfo)
6118 optional int32 node = 1;
6119
6120 // Zone these pages are in (as per /proc/pagetypeinfo)
6121 optional string zone = 2;
6122
6123 // Label for the type of these pages (as per /proc/pagetypeinfo)
6124 optional string label = 3;
6125
6126 // Distribution of number of pages available by order size. First entry in array is
6127 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6128 repeated int32 pages_per_order = 4;
6129}
6130
Chenjie Yu12e5e672018-09-14 15:54:59 -07006131/**
6132 * Pulled from ProcessStatsService.java
6133 */
6134message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006135 optional ProcessStatsSectionProto proc_stats_section = 1;
6136}
6137
Chenjie Yuf910b7802019-01-11 16:08:20 -08006138/**
6139 * Pulled from ProcessStatsService.java
6140 */
6141message ProcStatsPkgProc {
6142 optional ProcessStatsSectionProto proc_stats_section = 1;
6143}
6144
Chris Wrencdea3b72019-11-22 16:58:17 -05006145// Next Tag: 2
6146message PackageRemoteViewInfoProto {
6147 optional string package_name = 1;
6148 // add per-package additional info here (like channels)
6149}
6150
6151// Next Tag: 2
6152message NotificationRemoteViewsProto {
6153 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6154}
6155
6156/**
6157 * Pulled from NotificationManagerService.java
6158 */
6159message NotificationRemoteViews {
6160 optional NotificationRemoteViewsProto notification_remote_views = 1;
6161}
6162
Yotam Aron74299972020-01-16 16:20:58 +02006163/**
6164 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6165 */
6166message PackageNotificationPreferences {
6167 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006168 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006169 // Notification importance, which specifies when and how a notification is displayed.
6170 // Specified under core/java/android/app/NotificationManager.java.
6171 optional int32 importance = 2;
6172 // Lockscreen visibility as set by the user.
6173 optional int32 visibility = 3;
6174 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6175 // PreferencesHelper.java)
6176 optional int32 user_locked_fields = 4;
6177}
6178
6179/**
6180 * Atom that contains a list of a package's channel preferences, pulled from
6181 * NotificationManagerService.java.
6182 */
6183message PackageNotificationChannelPreferences {
6184 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006185 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006186 // Channel's ID. Should always be available.
6187 optional string channel_id = 2;
6188 // Channel's name. Should always be available.
6189 optional string channel_name = 3;
6190 // Channel's description. Optionally set by the channel creator.
6191 optional string description = 4;
6192 // Notification importance, which specifies when and how a notification is displayed. Specified
6193 // under core/java/android/app/NotificationManager.java.
6194 optional int32 importance = 5;
6195 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6196 // at core/java/android/app/NotificationChannel.java
6197 optional int32 user_locked_fields = 6;
6198 // Indicates if the channel was deleted by the app.
6199 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006200 // Indicates if the channel was marked as a conversation by the app.
6201 optional bool is_conversation = 8;
6202 // Indicates if the channel is a conversation that was demoted by the user.
6203 optional bool is_demoted_conversation = 9;
6204 // Indicates if the channel is a conversation that was marked as important by the user.
6205 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006206}
6207
6208/**
Chris Wren93165692020-05-15 16:12:41 -04006209 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
6210 * NotificationManagerService.java.
6211 */
6212message DNDModeProto {
6213 enum Mode {
6214 ROOT_CONFIG = -1; // Used to distinguish the config (one per user) from the rules.
6215 ZEN_MODE_OFF = 0;
6216 ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6217 ZEN_MODE_NO_INTERRUPTIONS = 2;
6218 ZEN_MODE_ALARMS = 3;
6219 }
6220 optional int32 user = 1; // Android user ID (0, 1, 10, ...)
6221 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled
6222 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
6223 optional Mode zen_mode = 4;
6224 // id is one of the system default rule IDs, or empty
6225 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
6226 optional string id = 5;
6227 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
6228 optional DNDPolicyProto policy = 7;
6229}
6230
6231/**
6232 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
6233 */
6234message DNDPolicyProto {
6235 enum State {
6236 STATE_UNSET = 0;
6237 STATE_ALLOW = 1;
6238 STATE_DISALLOW = 2;
6239 }
6240 optional State calls = 1;
6241 optional State repeat_callers = 2;
6242 optional State messages = 3;
6243 optional State conversations = 4;
6244 optional State reminders = 5;
6245 optional State events = 6;
6246 optional State alarms = 7;
6247 optional State media = 8;
6248 optional State system = 9;
6249 optional State fullscreen = 10;
6250 optional State lights = 11;
6251 optional State peek = 12;
6252 optional State status_bar = 13;
6253 optional State badge = 14;
6254 optional State ambient = 15;
6255 optional State notification_list = 16;
6256
6257 enum PeopleType {
6258 PEOPLE_UNSET = 0;
6259 PEOPLE_ANYONE = 1;
6260 PEOPLE_CONTACTS = 2;
6261 PEOPLE_STARRED = 3;
6262 PEOPLE_NONE = 4;
6263 }
6264
6265 optional PeopleType allow_calls_from = 17;
6266 optional PeopleType allow_messages_from = 18;
6267
6268 enum ConversationType {
6269 CONV_UNSET = 0;
6270 CONV_ANYONE = 1;
6271 CONV_IMPORTANT = 2;
6272 CONV_NONE = 3;
6273 }
6274
6275 optional ConversationType allow_conversations_from = 19;
6276}
6277
6278/**
Yotam Aron74299972020-01-16 16:20:58 +02006279 * Atom that contains a list of a package's channel group preferences, pulled from
6280 * NotificationManagerService.java.
6281 */
6282message PackageNotificationChannelGroupPreferences {
6283 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006284 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006285 // Channel Group's ID. Should always be available.
6286 optional string group_id = 2;
6287 // Channel Group's name. Should always be available.
6288 optional string group_name = 3;
6289 // Channel Group's description. Optionally set by group creator.
6290 optional string description = 4;
6291 // Indicates if notifications from this channel group are blocked.
6292 optional bool is_blocked = 5;
6293 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6294 // at core/java/android/app/NotificationChannelGroup.java
6295 optional int32 user_locked_fields = 6;
6296}
6297
Yangsteraf9aee72018-10-12 09:26:16 -07006298message PowerProfileProto {
6299 optional double cpu_suspend = 1;
6300
6301 optional double cpu_idle = 2;
6302
6303 optional double cpu_active = 3;
6304
6305 message CpuCluster {
6306 optional int32 id = 1;
6307 optional double cluster_power = 2;
6308 optional int32 cores = 3;
6309 repeated int64 speed = 4;
6310 repeated double core_power = 5;
6311 }
6312
6313 repeated CpuCluster cpu_cluster = 40;
6314
6315 optional double wifi_scan = 4;
6316
6317 optional double wifi_on = 5;
6318
6319 optional double wifi_active = 6;
6320
6321 optional double wifi_controller_idle = 7;
6322
6323 optional double wifi_controller_rx = 8;
6324
6325 optional double wifi_controller_tx = 9;
6326
6327 repeated double wifi_controller_tx_levels = 10;
6328
6329 optional double wifi_controller_operating_voltage = 11;
6330
6331 optional double bluetooth_controller_idle = 12;
6332
6333 optional double bluetooth_controller_rx = 13;
6334
6335 optional double bluetooth_controller_tx = 14;
6336
6337 optional double bluetooth_controller_operating_voltage = 15;
6338
6339 optional double modem_controller_sleep = 16;
6340
6341 optional double modem_controller_idle = 17;
6342
6343 optional double modem_controller_rx = 18;
6344
6345 repeated double modem_controller_tx = 19;
6346
6347 optional double modem_controller_operating_voltage = 20;
6348
6349 optional double gps_on = 21;
6350
6351 repeated double gps_signal_quality_based = 22;
6352
6353 optional double gps_operating_voltage = 23;
6354
6355 optional double bluetooth_on = 24;
6356
6357 optional double bluetooth_active = 25;
6358
6359 optional double bluetooth_at_cmd = 26;
6360
6361 optional double ambient_display = 27;
6362
6363 optional double screen_on = 28;
6364
6365 optional double radio_on = 29;
6366
6367 optional double radio_scanning = 30;
6368
6369 optional double radio_active = 31;
6370
6371 optional double screen_full = 32;
6372
6373 optional double audio = 33;
6374
6375 optional double video = 34;
6376
6377 optional double flashlight = 35;
6378
6379 optional double memory = 36;
6380
6381 optional double camera = 37;
6382
6383 optional double wifi_batched_scan = 38;
6384
6385 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006386}
Chenjie Yuab530202018-09-26 12:39:20 -07006387
6388/**
6389 * power_profile.xml and other constants for power model calculations.
6390 * Pulled from PowerProfile.java
6391 */
6392message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006393 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006394}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006395
6396/**
arangelovd5db50e2018-10-12 20:24:39 +01006397 * Logs when a user restriction was added or removed.
6398 *
6399 * Logged from:
6400 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6401 */
6402message UserRestrictionChanged {
6403 // The raw string of the user restriction as defined in UserManager.
6404 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6405 optional string restriction = 1;
6406 // Whether the restriction is enabled or disabled.
6407 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006408}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006409
6410/**
6411 * Pulls process user time and system time. Puller takes a snapshot of all pids
6412 * in the system and returns cpu stats for those that are working at the time.
6413 * Dead pids will be dropped. Kernel processes are excluded.
6414 * Min cool-down is 5 sec.
6415 */
6416message ProcessCpuTime {
6417 optional int32 uid = 1 [(is_uid) = true];
6418
6419 optional string process_name = 2;
6420 // Process cpu time in user space, cumulative from boot/process start
6421 optional int64 user_time_millis = 3;
6422 // Process cpu time in system space, cumulative from boot/process start
6423 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006424}
Misha Wagner5a51e002018-10-03 15:04:09 +01006425
6426/**
6427 * Pulls the CPU usage for each thread.
6428 *
6429 * Read from /proc/$PID/task/$TID/time_in_state files.
6430 *
6431 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6432 * time_in_state files not being present on some phones, have not been addressed. These should be
6433 * considered before a public release.
6434 */
6435message CpuTimePerThreadFreq {
6436 // UID that owns the process.
6437 optional int32 uid = 1 [(is_uid) = true];
6438 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006439 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006440 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006441 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006442 // Name of the process taken from `/proc/$PID/cmdline`.
6443 optional string process_name = 4;
6444 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6445 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006446
6447 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6448 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6449 // frequencies are given here as the alternative is sending eight separate atoms. This method
6450 // significantly reduces the amount of data created
6451 optional int32 frequency1_khz = 6;
6452 optional int32 time1_millis = 7;
6453 optional int32 frequency2_khz = 8;
6454 optional int32 time2_millis = 9;
6455 optional int32 frequency3_khz = 10;
6456 optional int32 time3_millis = 11;
6457 optional int32 frequency4_khz = 12;
6458 optional int32 time4_millis = 13;
6459 optional int32 frequency5_khz = 14;
6460 optional int32 time5_millis = 15;
6461 optional int32 frequency6_khz = 16;
6462 optional int32 time6_millis = 17;
6463 optional int32 frequency7_khz = 18;
6464 optional int32 time7_millis = 19;
6465 optional int32 frequency8_khz = 20;
6466 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006467}
Bookatz75ee60422018-11-09 12:27:37 -08006468
6469/**
Bookatz366a4432018-11-20 09:42:33 -08006470 * Pulls information about the device's build.
6471 */
6472message BuildInformation {
6473 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6474 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6475 optional string fingerprint = 1;
6476
6477 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6478 optional string brand = 2;
6479
6480 // Build.PRODUCT. The name of the overall product.
6481 optional string product = 3;
6482
6483 // Build.DEVICE. The name of the industrial design.
6484 optional string device = 4;
6485
6486 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6487 optional string version_release = 5;
6488
6489 // Build.ID. E.g. a label like "M4-rc20".
6490 optional string id = 6;
6491
6492 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6493 // represent this build.
6494 optional string version_incremental = 7;
6495
6496 // Build.TYPE. The type of build, like "user" or "eng".
6497 optional string type = 8;
6498
6499 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6500 optional string tags = 9;
6501}
6502
6503/**
Adam He420947c2019-01-23 15:59:09 -08006504 * Logs information about mismatched caller for content capture.
6505 *
6506 * Logged from:
6507 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6508 */
6509message ContentCaptureCallerMismatchReported {
6510 optional string intended_package = 1;
6511 optional string calling_package = 2;
6512}
6513
6514/**
6515 * Logs information about content capture service events.
6516 *
6517 * Logged from:
6518 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6519 */
6520message ContentCaptureServiceEvents {
6521 // The type of event.
6522 enum Event {
6523 UNKNOWN = 0;
6524 ON_CONNECTED = 1;
6525 ON_DISCONNECTED = 2;
6526 SET_WHITELIST = 3;
6527 SET_DISABLED = 4;
6528 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006529 ON_DATA_SHARE_REQUEST = 6;
6530 ACCEPT_DATA_SHARE_REQUEST = 7;
6531 REJECT_DATA_SHARE_REQUEST = 8;
6532 DATA_SHARE_WRITE_FINISHED = 9;
6533 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6534 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6535 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6536 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6537 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6538 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006539 }
6540 optional Event event = 1;
6541 // component/package of content capture service.
6542 optional string service_info = 2;
6543 // component/package of target.
6544 // it's a concatenated list of component/package for SET_WHITELIST event
6545 // separated by " ".
6546 optional string target_info = 3;
6547}
6548
6549/**
6550 * Logs information about content capture session events.
6551 *
6552 * Logged from:
6553 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6554 */
6555message ContentCaptureSessionEvents {
6556 // The type of event.
6557 enum Event {
6558 UNKNOWN = 0;
6559 ON_SESSION_STARTED = 1;
6560 ON_SESSION_FINISHED = 2;
6561 SESSION_NOT_CREATED = 3;
6562 }
6563 optional int32 session_id = 1;
6564 optional Event event = 2;
6565 // (n/a on session finished)
6566 optional int32 state_flags = 3;
6567 // component/package of content capture service.
6568 optional string service_info = 4;
6569 // component/package of app.
6570 // (n/a on session finished)
6571 optional string app_info = 5;
6572 optional bool is_child_session = 6;
6573}
6574
6575/**
6576 * Logs information about session being flushed.
6577 *
6578 * Logged from:
6579 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6580 */
6581message ContentCaptureFlushed {
6582 optional int32 session_id = 1;
6583 // component/package of content capture service.
6584 optional string service_info = 2;
6585 // component/package of app.
6586 optional string app_info = 3;
6587 // session start/finish events
6588 optional int32 child_session_started = 4;
6589 optional int32 child_session_finished = 5;
6590 // count of view events.
6591 optional int32 view_appeared_count = 6;
6592 optional int32 view_disappeared_count = 7;
6593 optional int32 view_text_changed_count = 8;
6594
6595 // Flush stats.
6596 optional int32 max_events = 9;
6597 optional int32 idle_flush_freq = 10;
6598 optional int32 text_flush_freq = 11;
6599 optional int32 flush_reason = 12;
6600}
6601
6602/**
Bookatz75ee60422018-11-09 12:27:37 -08006603 * Pulls on-device BatteryStats power use calculations for the overall device.
6604 */
6605message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006606 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6607 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6608 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6609 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006610}
6611
6612/**
6613 * Pulls on-device BatteryStats power use calculations broken down by uid.
6614 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6615 * that is attributed to non-uid items. They must all be included to get the total power use.
6616 */
6617message DeviceCalculatedPowerBlameUid {
6618 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6619 optional int32 uid = 1 [(is_uid) = true];
6620
Bookatz3dbc13a2018-12-21 12:16:51 -08006621 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6622 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6623 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006624}
6625
6626/**
6627 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6628 * drain type.
6629 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6630 * is attributed uids. They must all be included to get the total power use.
6631 */
6632message DeviceCalculatedPowerBlameOther {
6633 // The type of item whose power use is being reported.
6634 enum DrainType {
6635 AMBIENT_DISPLAY = 0;
6636 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6637 BLUETOOTH = 2;
6638 CAMERA = 3;
6639 // Cell-standby
6640 CELL = 4;
6641 FLASHLIGHT = 5;
6642 IDLE = 6;
6643 MEMORY = 7;
6644 // Amount that total computed drain exceeded the drain estimated using the
6645 // battery level changes and capacity.
6646 OVERCOUNTED = 8;
6647 PHONE = 9;
6648 SCREEN = 10;
6649 // Amount that total computed drain was below the drain estimated using the
6650 // battery level changes and capacity.
6651 UNACCOUNTED = 11;
6652 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6653 WIFI = 13;
6654 }
6655 optional DrainType drain_type = 1;
6656
Bookatz3dbc13a2018-12-21 12:16:51 -08006657 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6658 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6659 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006660}
arangelov4e994062018-11-13 16:12:38 +00006661
6662/**
6663 * Logs device policy features.
6664 *
6665 * Logged from:
6666 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6667 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6668 */
6669message DevicePolicyEvent {
6670 // The event id - unique for each event.
6671 optional android.stats.devicepolicy.EventId event_id = 1;
6672 // The admin package name.
6673 optional string admin_package_name = 2;
6674 // A generic integer parameter.
6675 optional int32 integer_value = 3;
6676 // A generic boolean parameter.
6677 optional bool boolean_value = 4;
6678 // A parameter specifying a time period in milliseconds.
6679 optional uint64 time_period_millis = 5;
6680 // A parameter specifying a list of package names, bundle extras or string parameters.
6681 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6682}
shawnlinea5b66b2018-11-13 15:05:29 +08006683
6684/**
6685 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6686 *
6687 * Logged from:
6688 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6689 */
6690message DocsUILaunchReported {
6691 optional android.stats.docsui.LaunchAction launch_action = 1;
6692 optional bool has_initial_uri = 2;
6693 optional android.stats.docsui.MimeType mime_type = 3;
6694 optional android.stats.docsui.Root initial_root = 4;
6695}
6696
6697/**
6698 * Logs root/app visited event in file managers/picker. Call this when the user
6699 * taps on root/app in hamburger menu.
6700 *
6701 * Logged from:
6702 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6703 */
6704message DocsUIRootVisitedReported {
6705 optional android.stats.docsui.ContextScope scope = 1;
6706 optional android.stats.docsui.Root root = 2;
6707}
6708
6709/**
6710 * Logs file operation stats. Call this when a file operation has completed.
6711 *
6712 * Logged from:
6713 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6714 */
6715message DocsUIFileOperationReported {
6716 optional android.stats.docsui.Provider provider = 1;
6717 optional android.stats.docsui.FileOperation file_op = 2;
6718}
6719
6720/**
6721 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6722 * mode.
6723 *
6724 * Logged from:
6725 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6726 */
6727message DocsUIFileOperationCopyMoveModeReported {
6728 optional android.stats.docsui.FileOperation file_op = 1;
6729 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6730}
6731
6732
6733/**
6734 * Logs file sub operation stats. Call this when a file operation has failed.
6735 *
6736 * Logged from:
6737 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6738 */
6739message DocsUIFileOperationFailureReported {
6740 optional android.stats.docsui.Authority authority = 1;
6741 optional android.stats.docsui.SubFileOperation sub_op = 2;
6742}
6743
6744/**
6745* Logs the cancellation of a file operation. Call this when a job is canceled
6746*
6747* Logged from:
6748* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6749*/
6750message DocsUIFileOperationCanceledReported {
6751 optional android.stats.docsui.FileOperation file_op = 1;
6752}
6753
6754/**
6755 * Logs startup time in milliseconds.
6756 *
6757 * Logged from:
6758 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6759 */
6760message DocsUIStartupMsReported {
6761 optional int32 startup_millis = 1;
6762}
6763
6764/**
6765 * Logs the action that was started by user.
6766 *
6767 * Logged from:
6768 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6769 */
6770message DocsUIUserActionReported {
6771 optional android.stats.docsui.UserAction action = 1;
6772}
6773
6774/**
6775 * Logs the invalid type when invalid scoped access is requested.
6776 *
6777 * Logged from:
6778 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6779 */
6780message DocsUIInvalidScopedAccessRequestReported {
6781 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006782}
Ben Murdochbab399f2018-12-06 11:01:38 +00006783
6784/**
shawnlina75e82d2019-01-07 10:31:12 +08006785 * Logs the package name that launches docsui picker mode.
6786 *
6787 * Logged from:
6788 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6789 */
6790message DocsUIPickerLaunchedFromReported {
6791 optional string package_name = 1;
6792}
6793
6794/**
6795 * Logs the search type.
6796 *
6797 * Logged from:
6798 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6799 */
6800message DocsUISearchTypeReported {
6801 optional android.stats.docsui.SearchType search_type = 1;
6802}
6803
6804/**
6805 * Logs the search mode.
6806 *
6807 * Logged from:
6808 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6809 */
6810message DocsUISearchModeReported {
6811 optional android.stats.docsui.SearchMode search_mode = 1;
6812}
6813
6814/**
6815 * Logs the pick result information.
6816 *
6817 * Logged from:
6818 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6819 */
6820message DocsUIPickResultReported {
6821 optional int32 total_action_count = 1;
6822 optional int64 duration_millis = 2;
6823 optional int32 file_count= 3;
6824 optional bool is_searching = 4;
6825 optional android.stats.docsui.Root picked_from = 5;
6826 optional android.stats.docsui.MimeType mime_type = 6;
6827 optional int32 repeatedly_pick_times = 7;
6828}
6829
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006830/** Logs the drag and drop of files.
6831
6832 * Logged from:
6833 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6834 */
6835message DocsUIDragAndDropReported {
6836 optional bool drag_initiated_from_docsui = 1;
6837}
6838
shawnlina75e82d2019-01-07 10:31:12 +08006839/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006840 * Logs when an app's memory is compacted.
6841 *
6842 * Logged from:
6843 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6844 */
6845message AppCompacted {
6846 // The pid of the process being compacted.
6847 optional int32 pid = 1;
6848
6849 // The name of the process being compacted.
6850 optional string process_name = 2;
6851
6852 // The type of compaction.
6853 enum Action {
6854 UNKNOWN = 0;
6855 SOME = 1;
6856 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006857 PERSISTENT = 3;
6858 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006859 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006860 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006861
6862 // Total RSS in kilobytes consumed by the process prior to compaction.
6863 optional int64 before_rss_total_kilobytes = 4;
6864
6865 // File RSS in kilobytes consumed by the process prior to compaction.
6866 optional int64 before_rss_file_kilobytes = 5;
6867
6868 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6869 optional int64 before_rss_anon_kilobytes = 6;
6870
6871 // Swap in kilobytes consumed by the process prior to compaction.
6872 optional int64 before_swap_kilobytes = 7;
6873
6874 // Total RSS in kilobytes consumed by the process after compaction.
6875 optional int64 after_rss_total_kilobytes = 8;
6876
6877 // File RSS in kilobytes consumed by the process after compaction.
6878 optional int64 after_rss_file_kilobytes = 9;
6879
6880 // Anonymous RSS in kilobytes consumed by the process after compaction.
6881 optional int64 after_rss_anon_kilobytes = 10;
6882
6883 // Swap in kilobytes consumed by the process after compaction.
6884 optional int64 after_swap_kilobytes = 11;
6885
6886 // The time taken to perform compaction in milliseconds.
6887 optional int64 time_to_compact_millis = 12;
6888
6889 // The last compaction action performed for this app.
6890 optional Action last_action = 13;
6891
Ben Murdoch01720b82018-12-19 18:03:44 +00006892 // The last time that compaction was attempted on this process in milliseconds
6893 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6894 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006895
Ben Murdoch885c21b2019-03-15 18:02:04 +00006896 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006897 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006898
6899 // The process state at the time of compaction.
6900 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006901
6902 // Free ZRAM in kilobytes before compaction.
6903 optional int64 before_zram_free_kilobytes = 17;
6904
6905 // Free ZRAM in kilobytes after compaction.
6906 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006907}
lifr157fc552018-12-12 16:38:04 +08006908
6909/**
lifr8abf3a72020-06-13 11:24:34 +08006910 * Logs when a Tethering event occurs.
6911 *
6912 */
6913message NetworkTetheringReported {
6914 // tethering error code
6915 optional android.stats.connectivity.ErrorCode error_code = 1;
6916
6917 // tethering downstream type
6918 optional android.stats.connectivity.DownstreamType downstream_type = 2;
6919
6920 // transport type of upstream network
6921 optional android.stats.connectivity.UpstreamType upstream_type = 3;
6922
6923 // The user type of Tethering
6924 optional android.stats.connectivity.UserType user_type= 4;
6925}
6926
6927/**
lifrb6b90b62019-03-29 00:40:17 +08006928 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6929 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6930 *
lifr1f74b052019-04-16 22:16:30 +08006931 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6932 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6933 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6934 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006935 */
6936message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006937 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006938
lifr1f74b052019-04-16 22:16:30 +08006939 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006940
6941 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006942 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006943
lifr1f74b052019-04-16 22:16:30 +08006944 // Only valid for event_type = EVENT_GETADDRINFO.
6945 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006946
lifr1f74b052019-04-16 22:16:30 +08006947 // Flags passed to android_res_nsend() defined in multinetwork.h
6948 // Only valid for event_type = EVENT_RESNSEND.
6949 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006950
lifrad9becc2019-05-20 11:04:41 +08006951 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006952
6953 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006954 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006955
6956 // Additional pass-through fields opaque to statsd.
6957 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006958 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006959
6960 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6961 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006962}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006963
6964/**
lifr1cc318d2020-03-19 21:58:30 +08006965 * logs the CapportApiData info
6966 * Logged from:
6967 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6968 */
6969message CapportApiData {
6970 // The TTL of the network connection provided by captive portal
6971 optional int32 remaining_ttl_secs = 1;
6972
6973 // The limit traffic data of the network connection provided by captive portal
6974 optional int32 remaining_bytes = 2;
6975
6976 // Is portal url option included in the DHCP packet (Yes, No)
6977 optional bool has_portal_url = 3;
6978
6979 // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
6980 optional bool has_venue_info = 4;
6981}
6982
6983/**
6984 * logs a network Probe Event
6985 * Logged from:
6986 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6987 */
6988message ProbeEvent {
6989 // The probe type (http or https, or captive portal API...)
6990 optional android.stats.connectivity.ProbeType probe_type = 1;
6991
6992 // The latency in microseconds of the probe event
6993 optional int32 latency_micros = 2;
6994
6995 // The result of the probe event
6996 optional android.stats.connectivity.ProbeResult probe_result = 3;
6997
6998 // The CaptivePortal API info
6999 optional CapportApiData capport_api_data = 4;
7000}
7001
7002/**
7003 * log each ProbeEvent in ProbeEvents
7004 * Logged from:
7005 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
7006 */
7007message ProbeEvents {
7008 // Record probe event during the validation
7009 repeated ProbeEvent probe_event = 1;
7010}
7011
7012/**
7013 * The DHCP (Dynamic Host Configuration Protocol) session info
7014 * Logged from:
7015 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
7016 */
7017message DhcpSession {
7018 // The DHCP Feature(s) enabled in this session
7019 repeated android.stats.connectivity.DhcpFeature used_features = 1;
7020
7021 // The discover packet (re)transmit count
7022 optional int32 discover_count = 2;
7023
7024 // The request packet (re)transmit count
7025 optional int32 request_count = 3;
7026
7027 // The IPv4 address conflict count
7028 // (only be meaningful when duplicate address detection is enabled)
7029 optional int32 conflict_count = 4;
7030
7031 // The DHCP packet parsing error code in this session
7032 // (defined in android.net.metrics.DhcpErrorEvent)
7033 repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
7034
7035 // The result of DHCP hostname transliteration
7036 optional android.stats.connectivity.HostnameTransResult ht_result = 6;
7037}
7038
7039/**
7040 * Logs Network IP provisioning event
7041 * Logged from:
7042 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
7043 */
7044message NetworkIpProvisioningReported {
7045 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7046 optional android.stats.connectivity.TransportType transport_type = 1;
7047
7048 // The latency in microseconds of IP Provisioning over IPV4
7049 optional int32 ipv4_latency_micros = 2;
7050
7051 // The latency in microseconds of IP Provisioning over IPV6
7052 optional int32 ipv6_latency_micros = 3;
7053
7054 // The time duration between provisioning start and end (success or failure)
7055 optional int64 provisioning_duration_micros = 4;
7056
7057 // The specific disconnect reason for this IP provisioning
7058 optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
7059
7060 // Log DHCP session info (Only valid for IPv4)
7061 optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
7062
7063 // The random number between 0 ~ 999 for sampling
7064 optional int32 random_number = 7;
7065}
7066
7067/**
7068 * Logs Network DHCP Renew event
7069 * Logged from:
7070 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
7071 */
7072message NetworkDhcpRenewReported {
7073 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7074 optional android.stats.connectivity.TransportType transport_type = 1;
7075
7076 // The request packet (re)transmit count
7077 optional int32 request_count = 2;
7078
7079 // The latency in microseconds of DHCP Renew
7080 optional int32 latency_micros = 3;
7081
7082 // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
7083 optional android.stats.connectivity.DhcpErrorCode error_code = 4;
7084
7085 // The result of DHCP renew
7086 optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
7087
7088 // The random number between 0 ~ 999 for sampling
7089 optional int32 random_number = 6;
7090}
7091
7092/**
7093 * Logs Network Validation event
7094 * Logged from:
7095 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
7096 */
7097message NetworkValidationReported {
7098 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7099 optional android.stats.connectivity.TransportType transport_type = 1;
7100
7101 // Record each probe event
7102 optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
7103
7104 // The result of the network validation
7105 optional android.stats.connectivity.ValidationResult validation_result = 3;
7106
7107 // The latency in microseconds of network validation
7108 optional int32 latency_micros = 4;
7109
7110 // The validation index (the first validation attempt or second, third...)
7111 optional int32 validation_index = 5;
7112
7113 // The random number between 0 ~ 999 for sampling
7114 optional int32 random_number = 6;
7115}
7116
7117/**
7118 * Logs NetworkStack Quirk event
7119 * Logged from:
7120 * packages/modules/NetworkStack/src/com/android/networkstack/
7121 */
7122message NetworkStackQuirkReported {
7123 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7124 optional android.stats.connectivity.TransportType transport_type = 1;
7125
7126 // Record each Quirk event
7127 optional android.stats.connectivity.NetworkQuirkEvent event = 2;
7128}
7129
7130/**
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007131 * Logs when a data stall event occurs.
7132 *
7133 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007134 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007135 */
7136message DataStallEvent {
7137 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007138 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007139 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
7140 optional int32 evaluation_type = 1;
7141 // See definition in data_stall_event.proto.
7142 optional com.android.server.connectivity.ProbeResult validation_result = 2;
7143 // See definition in data_stall_event.proto.
7144 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
7145 // See definition in data_stall_event.proto.
7146 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
7147 // See definition in data_stall_event.proto.
7148 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
7149 // See definition in data_stall_event.proto.
7150 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007151 // The tcp packets fail rate from the latest tcp polling.
7152 optional int32 tcp_fail_rate = 7;
7153 // Number of packets sent since the last received packet.
7154 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007155}
Christian Brunschenf86039e2018-12-21 12:26:14 +00007156
7157/*
7158 * Logs when RescueParty resets some set of experiment flags.
7159 *
7160 * Logged from:
7161 * frameworks/base/services/core/java/com/android/server/RescueParty.java
7162 */
7163message RescuePartyResetReported {
7164 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
7165 optional int32 rescue_level = 1;
7166}
Mathew Inwoodb375be52019-01-04 11:36:25 +00007167
7168/**
7169 * Logs when signed config is received from an APK, and if that config was applied successfully.
7170 * Logged from:
7171 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
7172 */
7173message SignedConfigReported {
7174 enum Type {
7175 UNKNOWN_TYPE = 0;
7176 GLOBAL_SETTINGS = 1;
7177 }
7178 optional Type type = 1;
7179
7180 // The final status of the signed config received.
7181 enum Status {
7182 UNKNOWN_STATUS = 0;
7183 APPLIED = 1;
7184 BASE64_FAILURE_CONFIG = 2;
7185 BASE64_FAILURE_SIGNATURE = 3;
7186 SECURITY_EXCEPTION = 4;
7187 INVALID_CONFIG = 5;
7188 OLD_CONFIG = 6;
7189 SIGNATURE_CHECK_FAILED = 7;
7190 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00007191 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00007192 }
7193 optional Status status = 2;
7194
7195 // The version of the signed config processed.
7196 optional int32 version = 3;
7197
7198 // The package name that the config was extracted from.
7199 optional string from_package = 4;
7200
7201 enum Key {
7202 NO_KEY = 0;
7203 DEBUG = 1;
7204 PRODUCTION = 2;
7205 }
7206 // Which key was used to verify the config.
7207 optional Key verified_with = 5;
7208}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007209
7210/*
7211 * Logs GNSS Network-Initiated (NI) location events.
7212 *
7213 * Logged from:
7214 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7215 */
7216message GnssNiEventReported {
7217 // The type of GnssNiEvent.
7218 enum EventType {
7219 UNKNOWN = 0;
7220 NI_REQUEST = 1;
7221 NI_RESPONSE = 2;
7222 }
7223 optional EventType event_type = 1;
7224
7225 // An ID generated by HAL to associate NI notifications and UI responses.
7226 optional int32 notification_id = 2;
7227
7228 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007229 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007230
7231 // NI requires notification.
7232 optional bool need_notify = 4;
7233
7234 // NI requires verification.
7235 optional bool need_verify = 5;
7236
7237 // NI requires privacy override, no notification/minimal trace.
7238 optional bool privacy_override = 6;
7239
7240 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
7241 // seconds.
7242 optional int32 timeout = 7;
7243
7244 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007245 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007246
7247 // String representing the requester of the network inititated location request.
7248 optional string requestor_id = 9;
7249
7250 // Notification message text string representing the service(for eg. SUPL-service) who sent the
7251 // network initiated location request.
7252 optional string text = 10;
7253
7254 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007255 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007256
7257 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007258 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007259
7260 // True if SUPL ES is enabled.
7261 optional bool is_supl_es_enabled = 13;
7262
7263 // True if GNSS location is enabled.
7264 optional bool is_location_enabled = 14;
7265
7266 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007267 optional android.server.location.GnssUserResponseType user_response = 15;
7268}
7269
7270/**
7271 * Logs GNSS non-framework (NFW) location notification.
7272 *
7273 * Logged from:
7274 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7275 */
7276message GnssNfwNotificationReported {
7277 // Package name of the Android proxy application representing the non-framework entity that
7278 // requested location. Set to empty string if unknown.
7279 optional string proxy_app_package_name = 1;
7280
7281 // Protocol stack that initiated the non-framework location request.
7282 optional android.server.location.NfwProtocolStack protocol_stack = 2;
7283
7284 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
7285 // set to empty string. This field is opaque to the framework and used for logging purposes.
7286 optional string other_protocol_stack_name = 3;
7287
7288 // Source initiating/receiving the location information.
7289 optional android.server.location.NfwRequestor requestor = 4;
7290
7291 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
7292 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
7293 // and used for logging purposes.
7294 optional string requestor_id = 5;
7295
7296 // Indicates whether location information was provided for this request.
7297 optional android.server.location.NfwResponseType response_type = 6;
7298
7299 // True if the device is in user initiated emergency session.
7300 optional bool in_emergency_mode = 7;
7301
7302 // True if cached location is provided.
7303 optional bool is_cached_location = 8;
7304
7305 // True if proxy app permission mismatch between framework and GNSS HAL.
7306 optional bool is_permission_mismatched = 9;
7307}
7308
7309/**
7310 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7311 *
7312 * Logged from:
7313 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7314 */
7315message GnssConfigurationReported {
7316 // SUPL host name.
7317 optional string supl_host = 1;
7318
7319 // SUPL port number.
7320 optional int32 supl_port = 2;
7321
7322 // C2K host name.
7323 optional string c2k_host = 3;
7324
7325 // C2K port number.
7326 optional int32 c2k_port = 4;
7327
7328 // The SUPL version requested by Carrier.
7329 optional int32 supl_ver = 5;
7330
7331 // The SUPL mode.
7332 optional android.server.location.SuplMode supl_mode = 6;
7333
7334 // True if NI emergency SUPL restrictions is enabled.
7335 optional bool supl_es = 7;
7336
7337 // LTE Positioning Profile settings
7338 optional android.server.location.LppProfile lpp_profile = 8;
7339
7340 // Positioning protocol on A-Glonass system.
7341 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7342
7343 // True if emergency PDN is used. Otherwise, regular PDN is used.
7344 optional bool use_emergency_pdn_for_emergency_supl= 10;
7345
7346 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7347 optional android.server.location.GpsLock gps_lock = 11;
7348
7349 // Number of seconds to extend the emergency session duration post emergency call.
7350 optional int32 es_extension_sec = 12;
7351
7352 // The full list of package names of proxy Android applications representing the non-framework
7353 // location access entities (on/off the device) for which the framework user has granted
7354 // non-framework location access permission. The package names are concatenated in one string
7355 // with spaces as separators.
7356 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007357}
Jack Yu95b64f32018-12-13 18:26:11 +08007358
7359/**
7360 * Logs when a NFC device's error occurred.
7361 * Logged from:
7362 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7363 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7364 */
7365message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007366 enum Type {
7367 UNKNOWN = 0;
7368 CMD_TIMEOUT = 1;
7369 ERROR_NOTIFICATION = 2;
7370 AID_OVERFLOW = 3;
7371 }
7372 optional Type type = 1;
7373 // If it's nci cmd timeout, log the timeout command.
7374 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007375
Alex Salod7c3eef2019-01-25 14:43:27 -08007376 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007377}
7378
7379/**
7380 * Logs when a NFC device's state changed event
7381 * Logged from:
7382 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7383 */
7384message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007385 enum State {
7386 UNKNOWN = 0;
7387 OFF = 1;
7388 ON = 2;
7389 ON_LOCKED = 3; // Secure Nfc enabled.
7390 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7391 }
7392 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007393}
7394
7395/**
7396 * Logs when a NFC Beam Transaction occurred.
7397 * Logged from:
7398 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7399 */
7400message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007401 enum Operation {
7402 UNKNOWN = 0;
7403 SEND = 1;
7404 RECEIVE = 2;
7405 }
7406 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007407}
7408
7409/**
7410 * Logs when a NFC Card Emulation Transaction occurred.
7411 * Logged from:
7412 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7413 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7414 */
7415message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007416 enum Category {
7417 UNKNOWN = 0;
7418 HCE_PAYMENT = 1;
7419 HCE_OTHER = 2;
7420 OFFHOST = 3;
7421 }
7422 // Transaction belongs to HCE payment or HCE other category, or offhost.
7423 optional Category category = 1;
7424 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7425 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007426}
7427
7428/**
7429 * Logs when a NFC Tag event occurred.
7430 * Logged from:
7431 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7432 */
7433message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007434 enum Type {
7435 UNKNOWN = 0;
7436 URL = 1;
7437 BT_PAIRING = 2;
7438 PROVISION = 3;
7439 WIFI_CONNECT = 4;
7440 APP_LAUNCH = 5;
7441 OTHERS = 6;
7442 }
7443 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007444}
7445
7446/**
7447 * Logs when Hce transaction triggered
7448 * Logged from:
7449 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7450 */
7451message NfcHceTransactionOccurred {
7452 // The latency period(in microseconds) it took for the first HCE data
7453 // exchange.
7454 optional uint32 latency_micros = 1;
7455}
7456
7457/**
7458 * Logs when SecureElement state event changed
7459 * Logged from:
7460 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7461 */
7462message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007463 enum State {
7464 UNKNOWN = 0;
7465 INITIALIZED = 1;
7466 DISCONNECTED = 2;
7467 CONNECTED = 3;
7468 HALCRASH = 4;
7469 }
7470 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007471
Alex Salod7c3eef2019-01-25 14:43:27 -08007472 optional string state_change_reason = 2;
7473 // SIMx or eSEx.
7474 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007475}
7476
7477/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007478 * Information about a permission grant request
7479 */
7480message PermissionGrantRequestResultReported {
7481 // unique value identifying an API call. A API call might result in multiple of these atoms
7482 optional int64 request_id = 1;
7483
7484 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007485 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007486
7487 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007488 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007489
7490 // The permission to be granted
7491 optional string permission_name = 4;
7492
7493 // If the permission was explicitly requested via the API or added by the system
7494 optional bool is_implicit = 5;
7495
7496 enum Result {
7497 UNDEFINED = 0;
7498 // permission request was ignored
7499 IGNORED = 1;
7500 // permission request was ignored because it was user fixed
7501 IGNORED_USER_FIXED = 2;
7502 // permission request was ignored because it was policy fixed
7503 IGNORED_POLICY_FIXED = 3;
7504 // permission was granted by user action
7505 USER_GRANTED = 4;
7506 // permission was automatically granted
7507 AUTO_GRANTED = 5;
7508 // permission was denied by user action
7509 USER_DENIED = 6;
7510 // permission was denied with prejudice by the user
7511 USER_DENIED_WITH_PREJUDICE = 7;
7512 // permission was automatically denied
7513 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007514 // permission request was ignored because permission is restricted
7515 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007516 // one time permission was granted by user action
7517 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007518 // user ignored request by leaving the request screen without choosing any option
7519 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007520 // user granted the permission after being linked to settings
7521 USER_GRANTED_IN_SETTINGS = 12;
7522 // user denied the permission after being linked to settings
7523 USER_DENIED_IN_SETTINGS = 13;
7524 // user denied the permission with prejudice after being linked to settings
7525 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7526 // permission was automatically revoked after one-time permission expired
7527 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007528 // permission was automatically revoked for unused app
7529 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007530 }
7531 // The result of the permission grant
7532 optional Result result = 6;
7533}
7534
7535/**
Jack Yu95b64f32018-12-13 18:26:11 +08007536 * Logs when Omapi API used
7537 * Logged from:
7538 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7539 */
7540message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007541 enum Operation {
7542 UNKNOWN = 0;
7543 OPEN_CHANNEL = 1;
7544 }
7545 optional Operation operation = 1;
7546 // SIMx or eSEx.
7547 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007548
Alex Salod7c3eef2019-01-25 14:43:27 -08007549 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007550}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007551
7552/**
Alex Saloa060aee2019-01-21 14:36:41 -08007553 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7554 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007555 * Logged from:
7556 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7557 */
7558message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007559 optional int64 dispatch_latency_millis = 1;
7560}
7561
7562/**
7563 * Logs AttentionManagerService attention check result.
7564 *
7565 * Logged from:
7566 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7567 */
7568message AttentionManagerServiceResultReported {
7569 // See core/java/android/service/attention/AttentionService.java
7570 enum AttentionCheckResult {
7571 UNKNOWN = 20;
7572 ATTENTION_SUCCESS_ABSENT = 0;
7573 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007574 ATTENTION_FAILURE_UNKNOWN = 2;
7575 ATTENTION_FAILURE_CANCELLED = 3;
7576 ATTENTION_FAILURE_PREEMPTED = 4;
7577 ATTENTION_FAILURE_TIMED_OUT = 5;
7578 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007579 }
7580 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007581}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007582
7583/**
7584 * Logs when an adb connection changes state.
7585 *
7586 * Logged from:
7587 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7588 */
7589message AdbConnectionChanged {
7590 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7591 // previously selected for this system.
7592 optional int64 last_connection_time_millis = 1;
7593
7594 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7595 // to reconnect via adb without user interaction.
7596 optional int64 auth_window_millis = 2;
7597
7598 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7599 optional android.debug.AdbConnectionStateEnum state = 3;
7600
7601 // True if the 'always allow' option was selected for this system.
7602 optional bool always_allow = 4;
7603}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007604
7605/*
7606 * Logs the reported speech DSP status.
7607 *
7608 * Logged from:
7609 * Vendor audio implementation.
7610 */
7611message SpeechDspStatReported {
7612 // The total Speech DSP uptime in milliseconds.
7613 optional int32 total_uptime_millis = 1;
7614 // The total Speech DSP downtime in milliseconds.
7615 optional int32 total_downtime_millis = 2;
7616 optional int32 total_crash_count = 3;
7617 optional int32 total_recover_count = 4;
7618}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007619
7620/**
7621 * Logs USB connector contaminant status.
7622 *
7623 * Logged from: USB Service.
7624 */
7625message UsbContaminantReported {
7626 optional string id = 1;
7627 optional android.service.usb.ContaminantPresenceStatus status = 2;
7628}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007629
7630/**
7631 * This atom is for debugging purpose.
7632 */
7633message DebugElapsedClock {
7634 // Monotically increasing value for each pull.
7635 optional int64 pull_count = 1;
7636 // Time from System.elapsedRealtime.
7637 optional int64 elapsed_clock_millis = 2;
7638 // Time from System.elapsedRealtime.
7639 optional int64 same_elapsed_clock_millis = 3;
7640 // Diff between current elapsed time and elapsed time from previous pull.
7641 optional int64 elapsed_clock_diff_millis = 4;
7642
7643 enum Type {
7644 TYPE_UNKNOWN = 0;
7645 ALWAYS_PRESENT = 1;
7646 PRESENT_ON_ODD_PULLS = 2;
7647 }
7648 // Type of behavior for the pulled data.
7649 optional Type type = 5;
7650}
7651
7652/**
7653 * This atom is for debugging purpose.
7654 */
7655message DebugFailingElapsedClock {
7656 // Monotically increasing value for each pull.
7657 optional int64 pull_count = 1;
7658 // Time from System.elapsedRealtime.
7659 optional int64 elapsed_clock_millis = 2;
7660 // Time from System.elapsedRealtime.
7661 optional int64 same_elapsed_clock_millis = 3;
7662 // Diff between current elapsed time and elapsed time from previous pull.
7663 optional int64 elapsed_clock_diff_millis = 4;
7664}
Steven Wuacef6bb2019-01-23 14:21:17 -05007665
7666/** Logs System UI bubbles event changed.
7667 *
7668 * Logged from:
7669 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7670 */
7671message BubbleUIChanged {
7672
7673 // The app package that is posting the bubble.
7674 optional string package_name = 1;
7675
7676 // The notification channel that is posting the bubble.
7677 optional string notification_channel = 2;
7678
7679 // The notification id associated with the posted bubble.
7680 optional int32 notification_id = 3;
7681
7682 // The position of the bubble within the bubble stack.
7683 optional int32 position = 4;
7684
7685 // The total number of bubbles within the bubble stack.
7686 optional int32 total_number = 5;
7687
7688 // User interactions with the bubble.
7689 enum Action {
7690 UNKNOWN = 0;
7691 POSTED = 1;
7692 UPDATED = 2;
7693 EXPANDED = 3;
7694 COLLAPSED = 4;
7695 DISMISSED = 5;
7696 STACK_DISMISSED = 6;
7697 STACK_MOVED = 7;
7698 HEADER_GO_TO_APP = 8;
7699 HEADER_GO_TO_SETTINGS = 9;
7700 PERMISSION_OPT_IN = 10;
7701 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007702 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007703 SWIPE_LEFT = 13;
7704 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007705 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007706 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007707 }
7708 optional Action action = 6;
7709
7710 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7711 optional float normalized_x_position = 7;
7712 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007713
7714 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7715 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007716
7717 // Whether the bubble is an on-going one.
7718 optional bool is_ongoing = 10;
7719
7720 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007721 // This is deprecated and the value should be ignored.
7722 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007723}
Kweku Adams8845d012018-12-11 20:06:45 -08007724
7725/**
Steven Wu552f63f2019-02-05 13:41:36 -05007726 * Logs System UI bubbles developer errors.
7727 *
7728 * Logged from:
7729 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7730 */
7731message BubbleDeveloperErrorReported {
7732
7733 // The app package that is posting the bubble.
7734 optional string package_name = 1;
7735
7736 // Bubble developer error type enums.
7737 enum Error {
7738 UNKNOWN = 0;
7739 ACTIVITY_INFO_MISSING = 1;
7740 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7741 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7742 }
7743 optional Error error = 2 [default = UNKNOWN];
7744}
7745
7746/**
Kweku Adams8845d012018-12-11 20:06:45 -08007747 * Logs that a constraint for a scheduled job has changed.
7748 *
7749 * Logged from:
7750 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7751 */
7752message ScheduledJobConstraintChanged {
7753 repeated AttributionNode attribution_node = 1;
7754
7755 // Name of the job.
7756 optional string job_name = 2;
7757
7758 optional com.android.server.job.ConstraintEnum constraint = 3;
7759
7760 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007761 UNKNOWN = 0;
7762 UNSATISFIED = 1;
7763 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007764 }
7765 optional State state = 4;
7766}
Alex Salod7c3eef2019-01-25 14:43:27 -08007767
7768/**
7769 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7770 * returns true.
7771 *
7772 * Logged from:
7773 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7774 */
7775message ScreenTimeoutExtensionReported {
7776 // Describes how many times in a row did the power manager reset the screen off timeout.
7777 optional uint32 consecutive_timeout_extended_count = 1;
7778}
Hui Yu885aca12019-01-10 17:11:34 -08007779
7780/*
7781* Logs number of milliseconds it takes to start a process.
7782* The definition of app process start time is from the app launch time to
7783* the time that Zygote finished forking the app process and loaded the
7784* application package's java classes.
7785
7786* This metric is different from AppStartOccurred which is for foreground
7787* activity only.
7788
7789* ProcessStartTime can report all processes (both foreground and background)
7790* start time.
7791*
7792* Logged from:
7793* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7794*/
7795message ProcessStartTime {
7796 // The uid of the ProcessRecord.
7797 optional int32 uid = 1 [(is_uid) = true];
7798
7799 // The process pid.
7800 optional int32 pid = 2;
7801
7802 // The process name.
7803 // Usually package name, "system" for system server.
7804 // Provided by ActivityManagerService.
7805 optional string process_name = 3;
7806
7807 enum StartType {
7808 UNKNOWN = 0;
7809 WARM = 1;
7810 HOT = 2;
7811 COLD = 3;
7812 }
7813
7814 // The start type.
7815 optional StartType type = 4;
7816
7817 // The elapsed realtime at the start of the process.
7818 optional int64 process_start_time_millis = 5;
7819
7820 // Number of milliseconds it takes to reach bind application.
7821 optional int32 bind_application_delay_millis = 6;
7822
7823 // Number of milliseconds it takes to finish start of the process.
7824 optional int32 process_start_delay_millis = 7;
7825
7826 // hostingType field in ProcessRecord, the component type such as "activity",
7827 // "service", "content provider", "broadcast" or other strings.
7828 optional string hosting_type = 8;
7829
7830 // hostingNameStr field in ProcessRecord. The component class name that runs
7831 // in this process.
7832 optional string hosting_name = 9;
7833}
7834
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007835/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007836 * Track Media Codec usage
7837 * Logged from:
7838 * frameworks/av/media/libstagefright/MediaCodec.cpp
7839 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7840 */
7841message MediametricsCodecReported {
7842 optional int64 timestamp_nanos = 1;
7843 optional string package_name = 2;
7844 optional int64 package_version_code = 3;
7845 optional int64 media_apex_version = 4;
7846
7847 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7848}
7849
7850/**
7851 * Track Media Extractor (pulling video/audio streams out of containers) usage
7852 * Logged from:
7853 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7854 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7855 */
7856message MediametricsExtractorReported {
7857 optional int64 timestamp_nanos = 1;
7858 optional string package_name = 2;
7859 optional int64 package_version_code = 3;
7860 optional int64 media_apex_version = 4;
7861
7862 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7863}
7864
7865/**
7866 * Track how we arbitrate between microphone/input requests.
7867 * Logged from
7868 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7869 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7870 */
7871message MediametricsAudiopolicyReported {
7872 optional int64 timestamp_nanos = 1;
7873 optional string package_name = 2;
7874 optional int64 package_version_code = 3;
7875 optional int64 media_apex_version = 4;
7876
7877 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7878}
7879
7880/**
7881 * Track how we arbitrate between microphone requests.
7882 * Logged from
7883 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7884 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7885 */
7886message MediametricsAudiorecordReported {
7887 optional int64 timestamp_nanos = 1;
7888 optional string package_name = 2;
7889 optional int64 package_version_code = 3;
7890 optional int64 media_apex_version = 4;
7891
7892 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7893}
7894
7895/**
7896 * Track how we arbitrate between microphone/input requests.
7897 * Logged from
7898 * frameworks/av/media/libnblog/ReportPerformance.cpp
7899 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7900 */
7901message MediametricsAudiothreadReported {
7902 optional int64 timestamp_nanos = 1;
7903 optional string package_name = 2;
7904 optional int64 package_version_code = 3;
7905 optional int64 media_apex_version = 4;
7906
7907 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7908}
7909
7910/**
7911 * Track how we arbitrate between microphone/input requests.
7912 * Logged from
7913 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7914 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7915 */
7916message MediametricsAudiotrackReported {
7917 optional int64 timestamp_nanos = 1;
7918 optional string package_name = 2;
7919 optional int64 package_version_code = 3;
7920 optional int64 media_apex_version = 4;
7921
7922 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7923}
7924
7925/**
7926 * Track information about DRM framework performance
7927 * Logged from
7928 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7929 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7930 */
7931message MediametricsMediadrmReported {
7932 optional int64 timestamp_nanos = 1;
7933 optional string package_name = 2;
7934 optional int64 package_version_code = 3;
7935 optional int64 media_apex_version = 4;
7936
7937 // vendor+description tell about which DRM plugin is in use on this device
7938 optional string vendor = 5;
7939 optional string description = 6;
7940 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7941 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7942}
7943
7944/**
7945 * Track information about the widevine DRM plugin performance
7946 * Logged from
7947 * vendor/widevine/libwvdrmengine/cdm/metrics
7948 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7949 */
7950message MediametricsDrmWidevineReported {
7951 optional int64 timestamp_nanos = 1;
7952 optional string package_name = 2;
7953 optional int64 package_version_code = 3;
7954 optional int64 media_apex_version = 4;
7955
7956 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7957}
7958
7959/**
7960 * Track information about recordings (e.g. camcorder)
7961 * Logged from
7962 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7963 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7964 */
7965message MediametricsRecorderReported {
7966 optional int64 timestamp_nanos = 1;
7967 optional string package_name = 2;
7968 optional int64 package_version_code = 3;
7969 optional int64 media_apex_version = 4;
7970
7971 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7972}
7973
7974/**
7975 * Track Media Player usage
7976 * Logged from:
7977 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7978 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7979 */
7980message MediametricsNuPlayerReported {
7981 optional int64 timestamp_nanos = 1;
7982 optional string package_name = 2;
7983 optional int64 package_version_code = 3;
7984 optional int64 media_apex_version = 4;
7985
7986 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7987}
7988
7989/**
Robert Shiha4beed32019-08-19 14:15:23 -07007990 * Track Legacy DRM usage
7991 * Logged from
7992 * frameworks/av/drm/drmserver/DrmManager.cpp
7993 */
7994message MediametricsDrmManagerReported {
7995 optional int64 timestamp_nanos = 1;
7996 optional string package_name = 2;
7997 optional int64 package_version_code = 3;
7998 optional int64 media_apex_version = 4;
7999
8000 enum Method {
8001 METHOD_NOT_FOUND = -1;
8002 GET_CONSTRAINTS = 0;
8003 GET_METADATA = 1;
8004 CAN_HANDLE = 2;
8005 PROCESS_DRM_INFO = 3;
8006 ACQUIRE_DRM_INFO = 4;
8007 SAVE_RIGHTS = 5;
8008 GET_ORIGINAL_MIME_TYPE = 6;
8009 GET_DRM_OBJECT_TYPE = 7;
8010 CHECK_RIGHTS_STATUS = 8;
8011 REMOVE_RIGHTS = 9;
8012 REMOVE_ALL_RIGHTS = 10;
8013 OPEN_CONVERT_SESSION = 11;
8014 OPEN_DECRYPT_SESSION = 12;
8015 }
8016
8017 // plugin_id+description inform which Legacy DRM plugins are still in use on device
8018 optional string plugin_id = 5;
8019 optional string description = 6;
8020 optional Method method = 7;
8021 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08008022
8023 optional int64 get_constraints_count = 9;
8024 optional int64 get_metadata_count = 10;
8025 optional int64 can_handle_count = 11;
8026 optional int64 process_drm_info_count = 12;
8027 optional int64 acquire_drm_info_count = 13;
8028 optional int64 save_rights_count = 14;
8029 optional int64 get_original_mime_type_count = 15;
8030 optional int64 get_drm_object_type_count = 16;
8031 optional int64 check_rights_status_count = 17;
8032 optional int64 remove_rights_count = 18;
8033 optional int64 remove_all_rights_count = 19;
8034 optional int64 open_convert_session_count = 20;
8035 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07008036}
8037
8038/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008039 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008040 * Pulled from: StatsCompanionService
8041*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008042message DangerousPermissionState {
8043 // Name of the permission
8044 optional string permission_name = 1;
8045
8046 // Uid of the package
8047 optional int32 uid = 2 [(is_uid) = true];
8048
8049 // Package requesting the permission
8050 optional string package_name = 3;
8051
8052 // If the permission is granted to the uid
8053 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01008054
8055 // Permission flags as per android.content.pm.PermissionFlags
8056 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008057}
8058
Michael Groover4a0ca942019-01-24 17:41:25 -08008059/**
8060 * Logs when a package is denied access to a device identifier based on the new access requirements.
8061 *
8062 * Logged from:
8063 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
8064 */
8065message DeviceIdentifierAccessDenied {
8066 // The name of the package denied access to the requested device identifier.
8067 optional string package_name = 1;
8068
8069 // The name of the device identifier method the package attempted to invoke.
8070 optional string method_name = 2;
8071
8072 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08008073 // Starting from Android 11, this boolean is not set and will always be false.
8074 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008075
8076 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08008077 // Starting from Android 11, this boolean is not set and will always be false.
8078 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008079}
Chenjie Yue13f44a2019-02-07 17:51:38 -08008080
8081/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08008082 * Pulls the ongoing mainline install train version code.
8083 * Pulled from StatsCompanionService
8084 */
8085message TrainInfo {
8086 optional int64 train_version_code = 1;
8087
8088 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008089
8090 optional string train_name = 3;
8091
8092 enum Status {
8093 UNKNOWN = 0;
8094 INSTALL_REQUESTED = 1;
8095 INSTALL_STARTED = 2;
8096 INSTALL_STAGED_NOT_READY = 3;
8097 INSTALL_STAGED_READY = 4;
8098 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07008099 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
8100 // and INSTALL_FAILURE_COMMIT.
8101 INSTALL_FAILURE = 6 [deprecated = true];
8102 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008103 INSTALL_CANCELLED = 7;
8104 INSTALLER_ROLLBACK_REQUESTED = 8;
8105 INSTALLER_ROLLBACK_INITIATED = 9;
8106 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
8107 INSTALLER_ROLLBACK_STAGED = 11;
8108 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
8109 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
8110 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
8111 INSTALLER_ROLLBACK_SUCCESS = 15;
8112 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07008113 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
8114 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
8115 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
8116 INSTALL_STAGED_CANCEL_REQUESTED = 20;
8117 INSTALL_STAGED_CANCEL_SUCCESS = 21;
8118 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07008119 INSTALL_FAILURE_DOWNLOAD = 23;
8120 INSTALL_FAILURE_STATE_MISMATCH = 24;
8121 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08008122 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008123 }
8124 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08008125}
joshmccloskey8c3322e2019-01-09 18:25:57 -08008126
8127/**
8128 * Logs the gesture stage changed event.
8129 *
8130 * Logged from:
8131 * frameworks/base/packages/SystemUI/
8132 */
8133message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008134 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008135}
8136
8137/**
8138 * Logs the feedback type.
8139 *
8140 * Logged from:
8141 * frameworks/base/packages/SystemUI/
8142 */
8143message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008144 // Whether or not the gesture was used.
8145 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008146}
8147
8148/**
8149 * Logs the progress.
8150 *
8151 * Logged from:
8152 * frameworks/base/packages/SystemUI/
8153 */
8154message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008155 // [0,100] progress for the assist gesture.
8156 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008157}
Neil Fullerdb14b482019-02-05 19:44:44 +00008158
8159/*
8160 * Information about the time zone data on a device.
8161 */
8162message TimeZoneDataInfo {
8163 // A version identifier for the data set on device. e.g. "2018i"
8164 optional string tzdb_version = 1;
8165}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008166
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008167/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008168 * Logs the GPU stats global health information.
8169 *
8170 * Logged from:
8171 * frameworks/native/services/gpuservice/gpustats/
8172 */
8173message GpuStatsGlobalInfo {
8174 // Package name of the gpu driver.
8175 optional string driver_package_name = 1;
8176
8177 // Version name of the gpu driver.
8178 optional string driver_version_name = 2;
8179
8180 // Version code of the gpu driver.
8181 optional int64 driver_version_code = 3;
8182
8183 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
8184 optional int64 driver_build_time = 4;
8185
8186 // Total count of the gl driver gets loaded.
8187 optional int64 gl_loading_count = 5;
8188
8189 // Total count of the gl driver fails to be loaded.
8190 optional int64 gl_loading_failure_count = 6;
8191
8192 // Total count of the Vulkan driver gets loaded.
8193 optional int64 vk_loading_count = 7;
8194
8195 // Total count of the Vulkan driver fails to be loaded.
8196 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07008197
8198 // Api version of the system Vulkan driver.
8199 optional int32 vulkan_version = 9;
8200
8201 // Api version of the system CPU Vulkan driver.
8202 optional int32 cpu_vulkan_version = 10;
8203
8204 // Api version of the system GLES driver.
8205 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008206
8207 // Total count of the angle driver gets loaded.
8208 optional int64 angle_loading_count = 12;
8209
8210 // Total count of the angle driver fails to be loaded.
8211 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008212}
8213
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008214/**
8215 * GPU driver loading time info.
8216 */
8217message GpuDriverLoadingTime {
8218 // List of all the driver loading times for this app. The list size is
8219 // capped at 50.
8220 repeated int64 driver_loading_time = 1;
8221}
8222
8223/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008224 * Logs the GPU stats per app health information.
8225 *
8226 * Logged from:
8227 * frameworks/native/services/gpuservice/gpustats/
8228 */
8229message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008230 // Package name of the application that loads the gpu driver. Total number
8231 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008232 optional string app_package_name = 1;
8233
8234 // Version code of the gpu driver this app loads.
8235 optional int64 driver_version_code = 2;
8236
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008237 // gl driver loading time info.
8238 optional GpuDriverLoadingTime gl_driver_loading_time = 3
8239 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008240
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008241 // Vulkan driver loading time info.
8242 optional GpuDriverLoadingTime vk_driver_loading_time = 4
8243 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008244
8245 // Angle driver loading time info.
8246 optional GpuDriverLoadingTime angle_driver_loading_time = 5
8247 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07008248
8249 // CPU Vulkan implementation is in use.
8250 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07008251
8252 // App is not doing pre-rotation correctly.
8253 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08008254
8255 // App creates GLESv1 context.
8256 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008257}
Rafal Slawikd4e87572019-03-12 13:08:38 +00008258
8259/*
8260 * Logs the size of the system ion heap.
8261 *
8262 * Pulled from StatsCompanionService.
8263 */
8264message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008265 // Deprecated due to limited support of ion stats in debugfs.
8266 // Use `IonHeapSize` instead.
8267 option deprecated = true;
8268
Rafal Slawikd4e87572019-03-12 13:08:38 +00008269 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008270 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00008271 optional int64 size_in_bytes = 1;
8272}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008273
Rafal Slawik77987ed2019-06-17 12:28:23 +01008274/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008275 * Logs the total size of the ion heap.
8276 *
8277 * Pulled from StatsCompanionService.
8278 */
8279message IonHeapSize {
8280 // Total size of all ion heaps in kilobytes.
8281 // Read from: /sys/kernel/ion/total_heaps_kb.
8282 optional int32 total_size_kb = 1;
8283}
8284
8285/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01008286 * Logs the per-process size of the system ion heap.
8287 *
8288 * Pulled from StatsCompanionService.
8289 */
8290message ProcessSystemIonHeapSize {
8291 // The uid if available. -1 means not available.
8292 optional int32 uid = 1 [(is_uid) = true];
8293
8294 // The process name (from /proc/PID/cmdline).
8295 optional string process_name = 2;
8296
8297 // Sum of sizes of all allocations.
8298 optional int32 total_size_in_kilobytes = 3;
8299
8300 // Number of allocations.
8301 optional int32 allocation_count = 4;
8302
8303 // Size of the largest allocation.
8304 optional int32 max_size_in_kilobytes = 5;
8305}
8306
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008307/**
8308 * Push network stack events.
8309 *
8310 * Log from:
8311 * frameworks/base/packages/NetworkStack/
8312 */
8313message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008314 // The id that indicates the event reported from NetworkStack.
8315 optional int32 event_id = 1;
8316 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008317 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8318}
Carmen Agimofa769c152019-03-04 14:39:14 +00008319
8320/**
8321 * Logs the apps that are installed on the external storage.
8322 * Pulled from:
8323 * StatsCompanionService
8324 */
8325message AppsOnExternalStorageInfo {
8326 // The type of the external storage.
8327 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8328 // The name of the package that is installed on the external storage.
8329 optional string package_name = 2;
8330}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008331
8332/**
8333 * Logs the settings related to Face.
8334 * Logged from:
8335 * frameworks/base/services/core/java/com/android/server/stats
8336 */
8337message FaceSettings {
8338 // Whether or not face unlock is allowed on Keyguard.
8339 optional bool unlock_keyguard_enabled = 1;
8340 // Whether or not face unlock dismisses the Keyguard.
8341 optional bool unlock_dismisses_keyguard = 2;
8342 // Whether or not face unlock requires attention.
8343 optional bool unlock_attention_required = 3;
8344 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8345 optional bool unlock_app_enabled = 4;
8346 // Whether or not face unlock always requires user confirmation.
8347 optional bool unlock_always_require_confirmation = 5;
8348 // Whether or not a diverse set of poses are required during enrollment.
8349 optional bool unlock_diversity_required = 6;
8350}
Maggie White442b6312019-04-05 16:26:44 -07008351
8352/**
8353 * Logs cooling devices maintained by the kernel.
8354 *
8355 * Pulled from StatsCompanionService.java
8356 */
8357message CoolingDevice {
8358 // The type of cooling device being reported. Eg. CPU, GPU...
8359 optional android.os.CoolingTypeEnum device_location = 1;
8360 // The name of the cooling device source. Eg. CPU0
8361 optional string device_name = 2;
8362 // Current throttle state of the cooling device. The value can any unsigned
8363 // integer between 0 and max_state defined in its driver. 0 means device is
8364 // not in throttling, higher value means deeper throttling.
8365 optional int32 state = 3;
8366}
Ben Blount763a5d52019-04-10 11:48:58 -07008367
8368/**
8369 * Intelligence has several counter-type events that don't warrant a
8370 * full separate atom. These are primarily API call counters but also include
8371 * counters for feature usage and specific failure modes.
8372 *
8373 * Logged from the Intelligence mainline module.
8374 */
8375message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008376 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008377 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008378 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008379 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008380 // How many times the event occured (to report a batch of high frequency events).
8381 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008382 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008383 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008384}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008385
8386/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008387 * Logs when Car Power state changed.
8388 *
8389 * Logged from:
8390 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8391 */
8392message CarPowerStateChanged {
8393 // States come from CpmsState in CarPowerManagementService.java.
8394 enum State {
8395 WAIT_FOR_VHAL = 0;
8396 ON = 1;
8397 SHUTDOWN_PREPARE = 2;
8398 WAIT_FOR_FINISH = 3;
8399 SUSPEND = 4;
8400 SIMULATE_SLEEP = 5;
8401 }
8402 optional State state = 1;
8403}
8404
8405/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008406 * Logs when Car User Hal is requested to switch/create/remove user.
8407 *
8408 * Logged from:
8409 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8410 */
8411message CarUserHalModifyUserRequestReported {
8412 // Request id for the request.
8413 optional int32 request_id = 1;
8414 // Request type.
8415 enum RequestType {
8416 UNKNOWN = 0;
8417 // Car user manager requested user switch.
8418 SWITCH_REQUEST_ANDROID = 1;
8419 // OEM requested User switch.
8420 SWITCH_REQUEST_OEM = 2;
8421 // Hal switch requested after android switch using activity manager.
8422 SWITCH_REQUEST_LEGACY = 3;
8423 // Create User
8424 CREATE_REQUEST = 4;
8425 // Remove User
8426 REMOVE_REQUEST = 5;
8427 }
8428 optional RequestType request_type = 2;
8429 // Android User id of the current user which can only be 0, 10, 11 and so on.
8430 // -1 if not available.
8431 optional int32 user_id = 3;
8432 // VHAL flags of the current user. (-1 if not available)
8433 optional int32 user_flags = 4;
8434 // Android User id of the target user for switch/create/remove. It can only
8435 // be 0, 10, 11 and so on. -1 if not available.
8436 optional int32 target_user_id = 5;
8437 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8438 optional int32 target_user_flags = 6;
8439 // Request timeout Milliseconds (-1 if not available)
8440 optional int32 timeout_millis = 7;
8441}
8442
8443/**
8444 * Logs when Car User Hal responds to switch/create user request.
8445 *
8446 * Logged from:
8447 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8448 */
8449message CarUserHalModifyUserResponseReported {
8450 // Request id of the request associated with the response.
8451 optional int32 request_id = 1;
8452 // Car user hal callback status.
8453 enum CallbackStatus {
8454 UNKNOWN = 0;
8455 // Hal response was invalid.
8456 INVALID = 1;
8457 // Hal response was ok.
8458 OK = 2;
8459 // Hal timeout during set call.
8460 HAL_SET_TIMEOUT = 3;
8461 // Hal response timeout.
8462 HAL_RESPONSE_TIMEOUT = 4;
8463 // Hal responded with wrong info.
8464 WRONG_HAL_RESPONSE = 5;
8465 // Hal is processing multiple requests simultaneously.
8466 CONCURRENT_OPERATION = 6;
8467 }
8468 optional CallbackStatus callback_status = 2;
8469
8470 // Hal request status for user switch/create/remove.
8471 enum HalRequestStatus {
8472 UNSPECIFIED = 0;
8473 // Hal request for user switch/create is successful.
8474 SUCCESS = 1;
8475 // Hal request for user switch/create failed.
8476 FAILURE = 2;
8477 }
8478 optional HalRequestStatus request_status = 3;
8479}
8480
8481/**
8482 * Logs when post switch response is posted to Car User Hal.
8483 *
8484 * Logged from:
8485 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8486 */
8487message CarUserHalPostSwitchResponseReported {
8488 // Request id.
8489 optional int32 request_id = 1;
8490
8491 // Android user switch status.
8492 enum UserSwitchStatus {
8493 UNKNOWN = 0;
8494 // Android user switch is successful.
8495 SUCCESS = 1;
8496 // Android user switch failed.
8497 FAILURE = 2;
8498 }
8499 optional UserSwitchStatus switch_status = 2;
8500}
8501
8502/**
8503 * Logs when initial user information is requested from Car User Hal.
8504 *
8505 * Logged from:
8506 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8507 */
8508message CarUserHalInitialUserInfoRequestReported {
8509 // Request id for the request.
8510 optional int32 request_id = 1;
8511
8512 // Request type for initial user information.
8513 enum InitialUserInfoRequestType {
8514 UNKNOWN = 0;
8515 // At the first time Android was booted (or after a factory reset).
8516 FIRST_BOOT = 1;
8517 // At the first time Android was booted after the system was updated.
8518 FIRST_BOOT_AFTER_OTA = 2;
8519 // When Android was booted "from scratch".
8520 COLD_BOOT = 3;
8521 // When Android was resumed after the system was suspended to memory.
8522 RESUME = 4;
8523 }
8524 optional InitialUserInfoRequestType request_type = 2;
8525 // Request timeout Milliseconds (-1 if not available)
8526 optional int32 timeout_millis = 3;
8527}
8528
8529/**
8530 * Logs when Car User Hal responds to initial user information requests.
8531 *
8532 * Logged from:
8533 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8534 */
8535message CarUserHalInitialUserInfoResponseReported {
8536 // Request id of the request associated with the response.
8537 optional int32 request_id = 1;
8538 // Car user hal callback status.
8539 enum CallbackStatus {
8540 UNKNOWN = 0;
8541 // Hal response was invalid.
8542 INVALID = 1;
8543 // Hal response was ok.
8544 OK = 2;
8545 // Hal timeout during set call.
8546 HAL_SET_TIMEOUT = 3;
8547 // Hal response timeout.
8548 HAL_RESPONSE_TIMEOUT = 4;
8549 // Hal responded with wrong info.
8550 WRONG_HAL_RESPONSE = 5;
8551 // Hal is processing multiple requests simultaneously.
8552 CONCURRENT_OPERATION = 6;
8553 }
8554 optional CallbackStatus callback_status = 2;
8555 // Response for initial user information request.
8556 enum InitialUserInfoResponseAction {
8557 UNSPECIFIED = 0;
8558 // Let the Android System decide what to do.
8559 DEFAULT = 1;
8560 // Switch to an existing Android user.
8561 SWITCH = 2;
8562 // Create a new Android user (and switch to it).
8563 CREATE = 3;
8564 }
8565 optional InitialUserInfoResponseAction response_action = 3;
8566 // Android User id of the target user which can only be 0, 10, 11 and so on.
8567 // -1 if not available.
8568 optional int32 target_user = 4;
8569 // VHAL flags of the current user. (-1 if not available)
8570 optional int32 target_user_flags = 5;
8571 // User locales
8572 optional string user_locales = 6;
8573}
8574
8575/**
8576 * Logs when set user association is requested from Car User Hal.
8577 *
8578 * Logged from:
8579 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8580 */
8581message CarUserHalUserAssociationRequestReported {
8582 // Request id for the request.
8583 optional int32 request_id = 1;
8584 // Request type.
8585 enum RequestType {
8586 UNKNOWN = 0;
8587 // For setting user association information.
8588 SET = 1;
8589 // For getting user association information.
8590 GET = 2;
8591 }
8592 optional RequestType request_type = 2;
8593 // Android User id of the current user which can only be 0, 10, 11 and so on.
8594 // -1 if not available.
8595 optional int32 current_user_id = 3;
8596 // VHAL flags of the current user. (-1 if not available)
8597 optional int32 current_user_flags = 4;
8598 // Number of the set associations requested.
8599 optional int32 number_associations = 5;
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 = 6;
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 = 7;
8606}
8607
8608/**
8609 * Logs when Car User Hal responds to set user association requests.
8610 *
8611 * Logged from:
8612 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8613 */
8614message CarUserHalSetUserAssociationResponseReported {
8615 // Request id of the request associated with the response.
8616 optional int32 request_id = 1;
8617 // Car user hal callback status.
8618 enum CallbackStatus {
8619 UNKNOWN = 0;
8620 // Hal response was invalid.
8621 INVALID = 1;
8622 // Hal response was ok.
8623 OK = 2;
8624 // Hal timeout during set call.
8625 HAL_SET_TIMEOUT = 3;
8626 // Hal response timeout.
8627 HAL_RESPONSE_TIMEOUT = 4;
8628 // Hal responded with wrong info.
8629 WRONG_HAL_RESPONSE = 5;
8630 // Hal is processing multiple requests simultaneously.
8631 CONCURRENT_OPERATION = 6;
8632 }
8633 optional CallbackStatus callback_status = 2;
8634 // Number of the set associations in the response.
8635 optional int32 number_associations = 3;
8636 // Concatenated string for the types from set associations request.
8637 // This is a string converted from an array of integers.
8638 optional string user_identification_association_types = 4;
8639 // Concatenated string for the values from set associations request.
8640 // This is a string converted from an array of integers.
8641 optional string user_identification_association_values = 5;
8642}
8643
8644/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008645 * Logs whether GarageMode is entered.
8646 *
8647 * Logged from:
8648 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8649 */
8650message GarageModeInfo {
8651 // Whether GarageMode is entered.
8652 optional bool is_garage_mode = 1;
8653}
Martijn Coenencd95d462019-04-25 17:09:45 +02008654
8655/**
8656 * Historical app ops data per package.
8657 */
8658message AppOps {
8659 // Uid of the package requesting the op
8660 optional int32 uid = 1 [(is_uid) = true];
8661
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008662 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008663 optional string package_name = 2;
8664
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008665 // operation id
8666 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008667
8668 // The number of times the op was granted while the app was in the
8669 // foreground (only for trusted requests)
8670 optional int64 trusted_foreground_granted_count = 4;
8671
8672 // The number of times the op was granted while the app was in the
8673 // background (only for trusted requests)
8674 optional int64 trusted_background_granted_count = 5;
8675
8676 // The number of times the op was rejected while the app was in the
8677 // foreground (only for trusted requests)
8678 optional int64 trusted_foreground_rejected_count = 6;
8679
8680 // The number of times the op was rejected while the app was in the
8681 // background (only for trusted requests)
8682 optional int64 trusted_background_rejected_count = 7;
8683
8684 // For long-running operations, total duration of the operation
8685 // while the app was in the foreground (only for trusted requests)
8686 optional int64 trusted_foreground_duration_millis = 8;
8687
8688 // For long-running operations, total duration of the operation
8689 // while the app was in the background (only for trusted requests)
8690 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008691
8692 // Whether AppOps is guarded by Runtime permission
8693 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008694}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008695
8696/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008697 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008698 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008699message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008700 // Uid of the package requesting the op
8701 optional int32 uid = 1 [(is_uid) = true];
8702
8703 // Name of the package performing the op
8704 optional string package_name = 2;
8705
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008706 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8707 // Attributions must be provided through manifest using <attribution> tag available in R and
8708 // above.
8709 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008710
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00008711 // operation id
8712 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008713
8714 // The number of times the op was granted while the app was in the
8715 // foreground (only for trusted requests)
8716 optional int64 trusted_foreground_granted_count = 5;
8717
8718 // The number of times the op was granted while the app was in the
8719 // background (only for trusted requests)
8720 optional int64 trusted_background_granted_count = 6;
8721
8722 // The number of times the op was rejected while the app was in the
8723 // foreground (only for trusted requests)
8724 optional int64 trusted_foreground_rejected_count = 7;
8725
8726 // The number of times the op was rejected while the app was in the
8727 // background (only for trusted requests)
8728 optional int64 trusted_background_rejected_count = 8;
8729
8730 // For long-running operations, total duration of the operation
8731 // while the app was in the foreground (only for trusted requests)
8732 optional int64 trusted_foreground_duration_millis = 9;
8733
8734 // For long-running operations, total duration of the operation
8735 // while the app was in the background (only for trusted requests)
8736 optional int64 trusted_background_duration_millis = 10;
8737
8738 // Whether AppOps is guarded by Runtime permission
8739 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008740
8741 // Sampling rate used on device, from 0 to 100
8742 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008743}
8744
8745/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008746 * Location Manager API Usage information(e.g. API under usage,
8747 * API call's parameters).
8748 * Logged from:
8749 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8750 */
8751message LocationManagerApiUsageReported {
8752
8753 // Indicating if usage starts or usage ends.
8754 optional android.stats.location.UsageState state = 1;
8755
8756 // LocationManagerService's API in use.
8757 // We can identify which API from LocationManager is
8758 // invoking current LMS API by the combination of
8759 // API parameter(e.g. is_listener_null, is_intent_null,
8760 // is_location_request_null)
8761 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8762
8763 // Name of the package calling the API.
8764 optional string calling_package_name = 3;
8765
8766 // Type of the location provider.
8767 optional android.stats.location.ProviderType provider = 4;
8768
8769 // Quality of the location request
8770 optional android.stats.location.LocationRequestQuality quality = 5;
8771
8772 // The desired interval for active location updates, in milliseconds.
8773 // Bucketized to reduce cardinality.
8774 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8775
8776 // Minimum distance between location updates, in meters.
8777 // Bucketized to reduce cardinality.
8778 optional android.stats.location.SmallestDisplacementBucket
8779 bucketized_smallest_displacement = 7;
8780
8781 // The number of location updates.
8782 optional int64 num_updates = 8;
8783
8784 // The request expiration time, in millisecond since boot.
8785 // Bucketized to reduce cardinality.
8786 optional android.stats.location.ExpirationBucket
8787 bucketized_expire_in = 9;
8788
8789 // Type of Callback passed in for this API.
8790 optional android.stats.location.CallbackType callback_type = 10;
8791
8792 // The radius of the central point of the alert
8793 // region, in meters. Only for API REQUEST_GEOFENCE.
8794 // Bucketized to reduce cardinality.
8795 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8796
8797 // Activity Importance of API caller.
8798 // Categorized to 3 types that are interesting from location's perspective.
8799 optional android.stats.location.ActivityImportance activiy_importance = 12;
8800}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008801
8802/**
8803 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8804 */
8805message ReviewPermissionsFragmentResultReported {
8806 // unique value identifying a permission group change. A permission group change might result
8807 // in multiple of these atoms
8808 optional int64 change_id = 1;
8809
8810 // UID of package the permission belongs to
8811 optional int32 uid = 2 [(is_uid) = true];
8812
8813 // Name of package the permission belongs to
8814 optional string package_name = 3;
8815
8816 // The permission to be granted
8817 optional string permission_name = 4;
8818
8819 // The result of the permission grant
8820 optional bool permission_granted = 5;
8821}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008822
8823/**
8824* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8825* Logged from: RuntimePermissionUpdgradeController
8826*/
8827message RuntimePermissionsUpgradeResult {
8828 // Permission granted as result of upgrade
8829 optional string permission_name = 1;
8830
8831 // UID of package granted permission
8832 optional int32 uid = 2 [(is_uid) = true];
8833
8834 // Name of package granted permission
8835 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008836}
8837
8838/**
8839* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8840*/
8841message GrantPermissionsActivityButtonActions {
8842 // Permission granted as result of upgrade
8843 optional string permission_group_name = 1;
8844
8845 // UID of package granted permission
8846 optional int32 uid = 2 [(is_uid) = true];
8847
8848 // Name of package requesting permission
8849 optional string package_name = 3;
8850
8851 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8852 // LABEL_ constants in GrantPermissionActivity.java
8853 optional int32 buttons_presented = 4;
8854
8855 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8856 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008857
8858 // id which identifies single session of user interacting with permission controller
8859 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008860}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008861
8862/**
8863 * Information about LocationAccessCheck notification presented to user
8864 */
8865message LocationAccessCheckNotificationAction {
8866
8867 // id which identifies single session of user interacting with permission controller
8868 optional int64 session_id = 1;
8869
8870 // Uid of package for which location access check is presented
8871 optional int32 package_uid = 2;
8872
8873 // Name of package for which location access check is presented
8874 optional string package_name = 3;
8875
8876 enum Result {
8877 UNDEFINED = 0;
8878 // notification was presented to the user
8879 NOTIFICATION_PRESENTED = 1;
8880 // notification was declined by the user
8881 NOTIFICATION_DECLINED = 2;
8882 // notification was clicked by the user
8883 NOTIFICATION_CLICKED = 3;
8884 }
8885
8886 // View / interaction recorded
8887 optional Result result = 4;
8888}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008889
8890/**
8891 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8892 */
8893message AppPermissionFragmentActionReported {
8894 // id which identifies single session of user interacting with permission controller
8895 optional int64 session_id = 1;
8896
8897 // unique value identifying a permission group change. A permission group change might result
8898 // in multiple of these atoms
8899 optional int64 change_id = 2;
8900
8901 // UID of package the permission belongs to
8902 optional int32 uid = 3 [(is_uid) = true];
8903
8904 // Name of package the permission belongs to
8905 optional string package_name = 4;
8906
8907 // The permission to be granted
8908 optional string permission_name = 5;
8909
8910 // The result of the permission grant
8911 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008912
8913 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8914 optional int32 permission_flags = 7;
8915
8916 enum Button {
8917 UNDEFINED = 0;
8918 // Allow button
8919 ALLOW = 1;
8920 // Deny button
8921 DENY = 2;
8922 // Ask every time button
8923 ASK_EVERY_TIME = 3;
8924 // Allow all the time button
8925 ALLOW_ALWAYS = 4;
8926 // Allow only while using the app button
8927 ALLOW_FOREGROUND = 5;
8928 // Same is Deny button but shown in while in use dialog
8929 DENY_FOREGROUND = 6;
8930 }
8931
8932 // Button pressed in the dialog
8933 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008934}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008935
8936/**
8937* Information about a AppPermissionFragment viewed by user
8938*/
8939message AppPermissionFragmentViewed {
8940 // id which identifies single session of user interacting with permission controller
8941 optional int64 session_id = 1;
8942
8943 // UID of package for which permissions are viewed
8944 optional int32 uid = 2 [(is_uid) = true];
8945
8946 // Name of package for which permissions are viewed
8947 optional string package_name = 3;
8948
8949 // Permission group viewed
8950 optional string permission_group_name = 4;
8951}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008952
8953/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008954* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8955* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008956*/
8957message AppPermissionsFragmentViewed {
8958 // id which identifies single session of user interacting with permission controller
8959 optional int64 session_id = 1;
8960
8961 // id which identifies single view as every view might have several logging records
8962 // with different package information attached
8963 optional int64 view_id = 2;
8964
8965 // Permission group viewed
8966 optional string permission_group_name = 3;
8967
8968 // UID of package for which permissions are viewed
8969 optional int32 uid = 4 [(is_uid) = true];
8970
8971 // Name of package for which permissions are viewed
8972 optional string package_name = 5;
8973
8974 // Category in which permission is included
8975 enum Category {
8976 UNDEFINED = 0;
8977 ALLOWED = 1;
8978 ALLOWED_FOREGROUND = 2;
8979 DENIED = 3;
8980 }
8981 optional Category category = 6;
8982}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008983/**
8984* Information about a PermissionAppsFragment viewed by user.
8985* Logged from ui/handheld/PermissionAppsFragment.java
8986*/
8987message PermissionAppsFragmentViewed {
8988 // id which identifies single session of user interacting with permission controller
8989 optional int64 session_id = 1;
8990
8991 // id which identifies single view as every view might have several logging records
8992 // with different package information attached
8993 optional int64 view_id = 2;
8994
8995 // Permission group viewed
8996 optional string permission_group_name = 3;
8997
8998 // UID of package for which permissions are viewed
8999 optional int32 uid = 4 [(is_uid) = true];
9000
9001 // Name of package for which permissions are viewed
9002 optional string package_name = 5;
9003
9004 // Category in which app is included
9005 enum Category {
9006 UNDEFINED = 0;
9007 ALLOWED = 1;
9008 ALLOWED_FOREGROUND = 2;
9009 DENIED = 3;
9010 }
9011 optional Category category = 6;
9012}
Tony Make2b1b672019-07-29 16:59:47 +01009013
9014/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07009015* Log that the Auto Revoke notification has been clicked
9016* Logged from ui/ManagePermissionsActivity
9017*/
9018message AutoRevokeNotificationClicked {
9019 // id which identifies single session of user interacting with permission controller
9020 optional int64 session_id = 1;
9021}
9022
9023/**
9024* Log that an app has been displayed on the auto revoke page, and lists one permission that was
9025* auto revoked for it.
9026* Logged from ui/handheld/AutoRevokeFragment
9027*/
9028message AutoRevokeFragmentAppViewed {
9029 // id which identifies single session of user interacting with permission controller
9030 optional int64 session_id = 1;
9031
9032 // UID of package for which permissions are viewed
9033 optional int32 uid = 2 [(is_uid) = true];
9034
9035 // Name of package for which permissions are viewed
9036 optional string package_name = 3;
9037
9038 // The name of a permission group that has been revoked
9039 optional string permission_group_name = 4;
9040
9041 // The age of the app- more than three months old, or more than six months
9042 enum Age {
9043 UNDEFINED = 0;
9044 NEWER_BUCKET = 1;
9045 OLDER_BUCKET = 2;
9046 }
9047
9048 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
9049 optional Age age = 5;
9050}
9051
9052/**
9053* Log that the user has interacted with an app on the auto revoke fragment
9054* Logged from ui/handheld/AutoRevokeFragment
9055*/
9056message AutoRevokedAppInteraction {
9057 // id which identifies single session of user interacting with permission controller
9058 optional int64 session_id = 1;
9059
9060 // UID of package for which permissions are viewed
9061 optional int32 uid = 2 [(is_uid) = true];
9062
9063 // Name of package for which permissions are viewed
9064 optional string package_name = 3;
9065
9066 enum Action {
9067 UNDEFINED = 0;
9068 REMOVE = 1;
9069 OPEN = 2;
9070 APP_INFO = 3;
9071 PERMISSIONS = 4;
9072 REMOVE_IN_SETTINGS = 5;
9073 OPEN_IN_SETTINGS = 6;
9074 }
9075
9076 // The action the user took to interact with the app
9077 optional Action action = 4;
9078}
9079
9080/**
9081* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
9082* auto revoke, or that the auto revoke switch has been changed
9083* Logged from ui/handheld/AppPermissionGroupsFragment
9084 */
9085message AppPermissionGroupsFragmentAutoRevokeAction {
9086 // id which identifies single session of user interacting with permission controller
9087 optional int64 session_id = 1;
9088
9089 // UID of package for which permissions are viewed
9090 optional int32 uid = 2 [(is_uid) = true];
9091
9092 // Name of package for which permissions are viewed
9093 optional string package_name = 3;
9094
9095 enum Action {
9096 UNDEFINED = 0;
9097 OPENED_FOR_AUTO_REVOKE = 1;
9098 OPENED_FROM_INTENT = 2;
9099 SWITCH_ENABLED = 3;
9100 SWITCH_DISABLED = 4;
9101 }
9102
9103 // The action the user took to interact with the fragment
9104 optional Action action = 4;
9105}
9106
9107/**
Tony Make2b1b672019-07-29 16:59:47 +01009108 * Logs when there is a smart selection related event.
9109 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9110 * Logged from: TextClassifierEventLogger.java
9111 */
9112message TextSelectionEvent {
9113 // A session ID.
9114 optional string session_id = 1;
9115
9116 // Event type of this event.
9117 optional android.stats.textclassifier.EventType event_type = 2;
9118
Tony Mak9c84bd22019-12-09 07:27:25 +00009119 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009120 optional string model_name = 3;
9121
9122 // Type of widget that was involved in triggering this event.
9123 optional android.stats.textclassifier.WidgetType widget_type = 4;
9124
9125 // Index of this event in a session.
9126 optional int32 event_index = 5;
9127
9128 // Entity type that is involved.
9129 optional string entity_type = 6;
9130
9131 // Relative word index of the start of the selection.
9132 optional int32 relative_word_start_index = 7;
9133
9134 // Relative word (exclusive) index of the end of the selection.
9135 optional int32 relative_word_end_index = 8;
9136
9137 // Relative word index of the start of the smart selection.
9138 optional int32 relative_suggested_word_start_index = 9;
9139
9140 // Relative word (exclusive) index of the end of the smart selection.
9141 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009142
9143 // Name of source package.
9144 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009145
9146 // Name of the LangID model that is involved in this event.
9147 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009148}
9149
9150/**
9151 * Logs when there is a smart linkify related event.
9152 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9153 * Logged from: TextClassifierEventLogger.java
9154 */
9155message TextLinkifyEvent {
9156 // A session ID.
9157 optional string session_id = 1;
9158
9159 // Event type of this event.
9160 optional android.stats.textclassifier.EventType event_type = 2;
9161
Tony Mak9c84bd22019-12-09 07:27:25 +00009162 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009163 optional string model_name = 3;
9164
9165 // Type of widget that was involved in triggering this event.
9166 optional android.stats.textclassifier.WidgetType widget_type = 4;
9167
9168 // Index of this event in a session.
9169 optional int32 event_index = 5;
9170
9171 // Entity type that is involved.
9172 optional string entity_type = 6;
9173
9174 // Number of links detected.
9175 optional int32 num_links = 7;
9176
9177 // The total length of all links.
9178 optional int32 linked_text_length = 8;
9179
9180 // Length of input text.
9181 optional int32 text_length = 9;
9182
9183 // Time spent on generating links in ms.
9184 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009185
9186 // Name of source package.
9187 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009188
9189 // Name of the LangID model that is involved in this event.
9190 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009191}
9192
9193/**
9194 * Logs when there is a conversation actions related event.
9195 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9196 * Logged from: TextClassifierEventLogger.java
9197 */
9198message ConversationActionsEvent {
9199 // A session ID.
9200 optional string session_id = 1;
9201
9202 // Event type of this event.
9203 optional android.stats.textclassifier.EventType event_type = 2;
9204
Tony Mak9c84bd22019-12-09 07:27:25 +00009205 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009206 optional string model_name = 3;
9207
9208 // Type of widget that was involved in triggering this event.
9209 optional android.stats.textclassifier.WidgetType widget_type = 4;
9210
9211 // The first entity type that is involved.
9212 optional string first_entity_type = 5;
9213
9214 // The second entity type that is involved.
9215 optional string second_entity_type = 6;
9216
9217 // The third entity type that is involved.
9218 optional string third_entity_type = 7;
9219
9220 // The score of the first entity type.
9221 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01009222
9223 // Name of source package.
9224 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00009225
9226 // Name of the annotator model that is involved in this event.
9227 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00009228
9229 // Name of the LangID model that is involved in this event.
9230 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01009231}
9232
9233/**
9234 * Logs when there is a language detection related event.
9235 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9236 * Logged from: TextClassifierEventLogger.java
9237 */
9238message LanguageDetectionEvent {
9239 // A session ID.
9240 optional string session_id = 1;
9241
9242 // Event type of this event.
9243 optional android.stats.textclassifier.EventType event_type = 2;
9244
Tony Mak9c84bd22019-12-09 07:27:25 +00009245 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009246 optional string model_name = 3;
9247
9248 // Type of widget that was involved in triggering this event.
9249 optional android.stats.textclassifier.WidgetType widget_type = 4;
9250
9251 // Detected language.
9252 optional string language_tag = 5;
9253
9254 // Score of the detected language.
9255 optional float score = 6;
9256
9257 // Position of this action.
9258 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01009259
9260 // Name of source package.
9261 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01009262}
Tianjie Xu167c3db2019-07-22 14:25:14 -07009263
9264/**
9265 * Information about an OTA update attempt by update_engine.
9266 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9267 */
9268message UpdateEngineUpdateAttemptReported {
9269 // The number of attempts for the update engine to apply a given payload.
9270 optional int32 attempt_number = 1;
9271
9272 optional android.stats.otaupdate.PayloadType payload_type = 2;
9273
9274 // The total time in minutes for the update engine to apply a given payload.
9275 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
9276 // it's increased when the system is sleeping.
9277 optional int32 duration_boottime_in_minutes = 3;
9278
9279 // The total time in minutes for the update engine to apply a given payload.
9280 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
9281 // and it's not increased when the system is sleeping.
9282 optional int32 duration_monotonic_in_minutes = 4;
9283
9284 // The size of the payload in MiBs.
9285 optional int32 payload_size_mib = 5;
9286
9287 // The attempt result reported by the update engine for an OTA update.
9288 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
9289
9290 // The error code reported by the update engine after an OTA update attempt
9291 // on A/B devices.
9292 optional android.stats.otaupdate.ErrorCode error_code = 7;
9293
9294 // The build fingerprint of the source system. The value is read from a
9295 // system property when the device takes the update. e.g.
9296 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
9297 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01009298
9299 // Size of super partition.
9300 optional int64 super_partition_size_bytes = 9;
9301
9302 // Size of current slot within the super partition.
9303 optional int64 slot_size_bytes = 10;
9304
9305 // Free space available in the super partition.
9306 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009307}
9308
9309/**
9310 * Information about all the attempts the device make before finishing the
9311 * successful update.
9312 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9313 */
9314message UpdateEngineSuccessfulUpdateReported {
9315 // The number of attempts for the update engine to apply the payload for a
9316 // successful update.
9317 optional int32 attempt_count = 1;
9318
9319 optional android.stats.otaupdate.PayloadType payload_type = 2;
9320
9321 optional int32 payload_size_mib = 3;
9322
9323 // The total number of bytes downloaded by update_engine since the last
9324 // successful update.
9325 optional int32 total_bytes_downloaded_mib = 4;
9326
9327 // The ratio in percentage of the over-downloaded bytes compared to the
9328 // total bytes needed to successfully install the update. e.g. 200 if we
9329 // download 200MiB in total for a 100MiB package.
9330 optional int32 download_overhead_percentage = 5;
9331
9332 // The total time in minutes for the update engine to apply the payload for a
9333 // successful update.
9334 optional int32 total_duration_minutes = 6;
9335
9336 // The number of reboot of the device during a successful update.
9337 optional int32 reboot_count = 7;
9338}
Alec Mourie088e762019-07-02 13:10:55 -07009339
9340/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009341 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9342 * key to indicate whether it was successful or not.
9343 *
9344 * Logged from:
9345 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9346 */
9347message RebootEscrowRecoveryReported {
9348 optional bool successful = 1;
9349}
9350
9351/**
Alec Mourie088e762019-07-02 13:10:55 -07009352 * Global display pipeline metrics reported by SurfaceFlinger.
9353 * Pulled from:
9354 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9355 */
9356message SurfaceflingerStatsGlobalInfo {
9357 // Total number of frames presented during the tracing period
9358 optional int64 total_frames = 1;
9359 // Total number of frames missed
9360 optional int64 missed_frames = 2;
9361 // Total number of frames that fell back to client composition
9362 optional int64 client_composition_frames = 3;
9363 // Total time the display was turned on
9364 optional int64 display_on_millis = 4;
9365 // Total time that was spent performing animations.
9366 // This is derived from the present-to-present layer histogram
9367 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009368 // Total number of event connections tracked by SurfaceFlinger at the time
9369 // of this pull. If this number grows prohibitively large, then this can
9370 // cause jank due to resource contention.
9371 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009372 // Set of timings measured from when SurfaceFlinger began compositing a
9373 // frame, until the frame was requested to be presented to the display. This
9374 // measures SurfaceFlinger's total CPU walltime on the critical path per
9375 // frame.
9376 optional FrameTimingHistogram frame_duration = 7
9377 [(android.os.statsd.log_mode) = MODE_BYTES];
9378 // Set of timings measured from when SurfaceFlinger first began using the
9379 // GPU to composite a frame, until the GPU has finished compositing that
9380 // frame. This measures the total additional time SurfaceFlinger needed to
9381 // perform due to falling back into GPU composition.
9382 optional FrameTimingHistogram render_engine_timing = 8
9383 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009384}
9385
9386/**
9387 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9388 * The number of layers uploaded will be restricted due to size limitations.
9389 * Pulled from:
9390 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9391 */
9392message SurfaceflingerStatsLayerInfo {
9393 // The layer for this set of metrics
9394 // For now we can infer that the package name is included in the layer
9395 // name.
9396 optional string layer_name = 1;
9397 // Total number of frames presented
9398 optional int64 total_frames = 2;
9399 // Total number of dropped frames while latching a buffer for this layer.
9400 optional int64 dropped_frames = 3;
9401 // Set of timings measured between successive presentation timestamps.
9402 optional FrameTimingHistogram present_to_present = 4
9403 [(android.os.statsd.log_mode) = MODE_BYTES];
9404 // Set of timings measured from when an app queued a buffer for
9405 // presentation, until the buffer was actually presented to the
9406 // display.
9407 optional FrameTimingHistogram post_to_present = 5
9408 [(android.os.statsd.log_mode) = MODE_BYTES];
9409 // Set of timings measured from when a buffer is ready to be presented,
9410 // until the buffer was actually presented to the display.
9411 optional FrameTimingHistogram acquire_to_present = 6
9412 [(android.os.statsd.log_mode) = MODE_BYTES];
9413 // Set of timings measured from when a buffer was latched by
9414 // SurfaceFlinger, until the buffer was presented to the display
9415 optional FrameTimingHistogram latch_to_present = 7
9416 [(android.os.statsd.log_mode) = MODE_BYTES];
9417 // Set of timings measured from the desired presentation to the actual
9418 // presentation time
9419 optional FrameTimingHistogram desired_to_present = 8
9420 [(android.os.statsd.log_mode) = MODE_BYTES];
9421 // Set of timings measured from when an app queued a buffer for
9422 // presentation, until the buffer was ready to be presented.
9423 optional FrameTimingHistogram post_to_acquire = 9
9424 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009425 // Frames missed latch because the acquire fence didn't fire
9426 optional int64 late_acquire_frames = 10;
9427 // Frames latched early because the desired present time was bad
9428 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009429}
9430
9431/**
9432 * Histogram of frame counts bucketed by time in milliseconds.
9433 * Because of size limitations, we hard-cap the number of buckets, with
9434 * buckets for corresponding to larger milliseconds being less precise.
9435 */
9436message FrameTimingHistogram {
9437 // Timings in milliseconds that describes a set of histogram buckets
9438 repeated int32 time_millis_buckets = 1;
9439 // Number of frames that match to each time_millis, i.e. the bucket
9440 // contents
9441 // It's required that len(time_millis) == len(frame_count)
9442 repeated int64 frame_counts = 2;
9443}
Emilian Peev6729f372019-08-29 09:14:09 -07009444
Emilian Peev6729f372019-08-29 09:14:09 -07009445/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009446 * Janky event as reported by SurfaceFlinger.
9447 * This event is intended to be consumed by a Perfetto subscriber for
9448 * automated trace collection.
9449 *
9450 * Logged from:
9451 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9452 */
9453message DisplayJankReported {
9454 // Informational field for how long the janky event lasted in milliseconds
9455 optional int64 event_duration_millis = 1;
9456 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9457 // the display on time.
9458 optional int32 present_deadlines_missed = 2;
9459}
9460
9461/**
Emilian Peev6729f372019-08-29 09:14:09 -07009462 * Information about camera facing and API level usage.
9463 * Logged from:
9464 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9465 */
9466message CameraActionEvent {
9467 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009468 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009469
9470 // Camera API level used
9471 optional int32 api_level = 2;
9472
9473 // Name of client package
9474 optional string package_name = 3;
9475
9476 // Camera facing
9477 enum Facing {
9478 UNKNOWN = 0;
9479 BACK = 1;
9480 FRONT = 2;
9481 EXTERNAL = 3;
9482 }
9483 optional Facing facing = 4;
9484}
atrost01a20932019-08-28 15:40:37 +01009485
9486/**
9487 * Logs when a compatibility change is affecting an app.
9488 *
9489 * Logged from:
9490 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9491 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9492 */
9493message AppCompatibilityChangeReported {
9494 // The UID of the app being affected by the compatibilty change.
9495 optional int32 uid = 1 [(is_uid) = true];
9496
9497 // The ID of the change affecting the app.
9498 optional int64 change_id = 2;
9499
9500 enum State {
9501 UNKNOWN_STATE = 0;
9502 ENABLED = 1;
9503 DISABLED = 2;
9504 LOGGED = 3;
9505 }
9506
9507 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9508 // logged otherwise.
9509 optional State state = 3;
9510
9511 enum Source {
9512 UNKNOWN_SOURCE = 0;
9513 APP_PROCESS = 1;
9514 SYSTEM_SERVER = 2;
9515 }
9516
9517 // Where it was logged from.
9518 optional Source source = 4;
9519
9520}
Hector Dearman40579f62019-11-01 13:19:30 +00009521
9522/**
9523 * Logged from
9524 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9525 */
9526message PerfettoUploaded {
9527 enum Event {
9528 PERFETTO_UNDEFINED = 0;
9529 PERFETTO_TRACE_BEGIN = 1;
9530 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9531 PERFETTO_ON_CONNECT = 3;
9532 PERFETTO_ON_TRACING_DISABLED = 4;
9533 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9534 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9535 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9536 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9537 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9538 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9539 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9540 PERFETTO_TRIGGER_BEGIN = 12;
9541 PERFETTO_TRIGGER_SUCCESS = 13;
9542 PERFETTO_TRIGGER_FAILURE = 14;
9543 PERFETTO_HIT_GUARDRAILS = 15;
9544 PERFETTO_ON_TIMEOUT = 16;
9545 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9546 }
9547
9548 // Which stage of the pipeline we are reporting from.
9549 optional Event event = 1;
9550
9551 // UUID matching the one set inside the SystemInfo trace packet.
9552 optional int64 trace_uuid_lsb = 2;
9553 optional int64 trace_uuid_msb = 3;
9554}
Mark Tabrya824a642019-11-05 12:26:12 -08009555
9556/**
9557 * Pulls client metrics on data transferred via Vehicle Maps Service.
9558 * Metrics are keyed by uid + layer.
9559 *
9560 * Pulled from:
9561 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9562 */
9563message VmsClientStats {
9564 // UID of the VMS client app
9565 optional int32 uid = 1 [(is_uid) = true];
9566
9567 // VMS layer definition
9568 optional int32 layer_type = 2;
9569 optional int32 layer_channel = 3;
9570 optional int32 layer_version = 4;
9571
9572 // Bytes and packets sent by the client for the layer
9573 optional int64 tx_bytes = 5;
9574 optional int64 tx_packets = 6;
9575
9576 // Bytes and packets received by the client for the layer
9577 optional int64 rx_bytes = 7;
9578 optional int64 rx_packets = 8;
9579
9580 // Bytes and packets dropped due to client error
9581 optional int64 dropped_bytes = 9;
9582 optional int64 dropped_packets = 10;
9583}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009584
9585/**
9586 * State of a dangerous permission requested by a package - sampled
9587 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9588*/
9589message DangerousPermissionStateSampled {
9590 // Name of the permission
9591 optional string permission_name = 1;
9592
9593 // Uid of the package
9594 optional int32 uid = 2 [(is_uid) = true];
9595
9596 // If the permission is granted to the uid
9597 optional bool is_granted = 3;
9598
9599 // Permission flags as per android.content.pm.PermissionFlags
9600 optional int32 permission_flags = 4;
9601}
9602
Stan Iliev637ba5e2019-08-16 13:43:08 -04009603/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009604 * HWUI stats for a given app.
9605 */
9606message GraphicsStats {
9607 // The package name of the app
9608 optional string package_name = 1;
9609
9610 // The version code of the app
9611 optional int64 version_code = 2;
9612
9613 // The start & end timestamps in UTC as
9614 // milliseconds since January 1, 1970
9615 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009616 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009617
Stan Ilievb6517192020-02-18 10:12:42 -05009618 optional int64 end_millis = 4;
9619
9620 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9621 enum PipelineType {
9622 UNKNOWN = 0;
9623 GL = 1;
9624 VULKAN = 2;
9625 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009626
9627 // HWUI renders pipeline type: GL or Vulkan.
9628 optional PipelineType pipeline = 5;
9629
9630 // Distinct frame count.
9631 optional int32 total_frames = 6;
9632
9633 // Number of "missed vsync" events.
9634 optional int32 missed_vsync_count = 7;
9635
9636 // Number of frames in triple-buffering scenario (high input latency)
9637 optional int32 high_input_latency_count = 8;
9638
9639 // Number of "slow UI thread" events.
9640 optional int32 slow_ui_thread_count = 9;
9641
9642 // Number of "slow bitmap upload" events.
9643 optional int32 slow_bitmap_upload_count = 10;
9644
9645 // Number of "slow draw" events.
9646 optional int32 slow_draw_count = 11;
9647
9648 // Number of frames that missed their deadline (aka, visibly janked)
9649 optional int32 missed_deadline_count = 12;
9650
9651 // The frame time histogram for the package
9652 optional FrameTimingHistogram cpu_histogram = 13
9653 [(android.os.statsd.log_mode) = MODE_BYTES];
9654
9655 // The gpu frame time histogram for the package
9656 optional FrameTimingHistogram gpu_histogram = 14
9657 [(android.os.statsd.log_mode) = MODE_BYTES];
9658
9659 // UI mainline module version.
9660 optional int64 version_ui_module = 15;
9661
9662 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9663 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9664 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9665 // more apps are running / rendering.
9666 optional bool is_today = 16;
9667}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009668
9669/**
9670 * Message related to dangerous (runtime) app ops access
9671 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009672message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009673 // Uid of the package accessing app op
9674 optional int32 uid = 1 [(is_uid) = true];
9675
9676 // Name of the package accessing app op
9677 optional string package_name = 2;
9678
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009679 // deprecated - set to empty string
9680 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009681
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009682 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009683 // API. Attributions must be provided through manifest using <attribution> tag available in R
9684 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009685 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009686
9687 // message related to app op access, limited to 600 chars by API
9688 optional string message = 5;
9689
9690 enum SamplingStrategy {
9691 DEFAULT = 0;
9692 UNIFORM = 1;
9693 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009694 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009695 }
9696
9697 // sampling strategy used to collect this message
9698 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009699
9700 // operation id
9701 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009702}
9703
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009704/*
9705 * Logs userspace reboot outcome and duration.
9706 *
9707 * Logged from:
9708 * frameworks/base/core/java/com/android/server/BootReceiver.java
9709 */
9710message UserspaceRebootReported {
9711 // Possible outcomes of userspace reboot.
9712 enum Outcome {
9713 // Default value in case platform failed to determine the outcome.
9714 OUTCOME_UNKNOWN = 0;
9715 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9716 SUCCESS = 1;
9717 // Userspace reboot shutdown sequence was aborted.
9718 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9719 // Remounting userdata into checkpointing mode failed.
9720 FAILED_USERDATA_REMOUNT = 3;
9721 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9722 // reboot.
9723 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9724 }
9725 // Outcome of userspace reboot. Always set.
9726 optional Outcome outcome = 1;
9727 // Duration of userspace reboot in case it has a successful outcome.
9728 // Duration is measured as time between userspace reboot was initiated and until boot completed
9729 // (e.g. sys.boot_completed=1).
9730 optional int64 duration_millis = 2;
9731 // State of primary user's (user0) credential encryption storage.
9732 enum UserEncryptionState {
9733 // Default value.
9734 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9735 // Credential encrypted storage is unlocked.
9736 UNLOCKED = 1;
9737 // Credential encrypted storage is locked.
9738 LOCKED = 2;
9739 }
9740 // State of primary user's encryption storage at the moment boot completed. Always set.
9741 optional UserEncryptionState user_encryption_state = 3;
9742}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009743
9744/*
9745 * Logs integrity check information during each install.
9746 *
9747 * Logged from:
9748 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9749 */
9750message IntegrityCheckResultReported {
9751 optional string package_name = 1;
9752 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009753 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009754 optional string installer_package_name = 4;
9755 enum Response {
9756 UNKNOWN = 0;
9757 ALLOWED = 1;
9758 REJECTED = 2;
9759 FORCE_ALLOWED = 3;
9760 }
9761 optional Response response = 5;
9762 // An estimate on the cause of the response. This will only be populated for
9763 // REJECTED and FORCE_ALLOWED
9764 optional bool caused_by_app_cert_rule = 6;
9765 optional bool caused_by_installer_rule = 7;
9766}
9767
9768/**
9769 * Logs the information about the rules and the provider whenever rules are
9770 * pushed into AppIntegrityManager.
9771 *
9772 * Logged from:
9773 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9774 */
9775message IntegrityRulesPushed {
9776 optional bool success = 1;
9777 // Package name of the app that pushed the rules.
9778 optional string rule_provider = 2;
9779 // Version string of arbitrary format provided by the rule provider to
9780 // identify the rules.
9781 optional string rule_version = 3;
9782}
Jordan Liubedfa702019-12-20 15:08:45 -08009783
9784/**
9785 * Logs when a cell broadcast message is received on the device.
9786 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009787 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009788 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009789 * packages/apps/CellBroadcastReceiver/
9790 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009791 */
9792message CellBroadcastMessageReported {
9793 // The type of Cell Broadcast message
9794 enum CbType {
9795 UNKNOWN_TYPE = 0;
9796 GSM = 1;
9797 CDMA = 2;
9798 CDMA_SPC = 3;
9799 }
9800
Jordan Liu900e5cb2020-05-29 09:44:59 -07009801 // The parts of the cell broadcast message pipeline
9802 enum ReportSource {
9803 UNKNOWN_SOURCE = 0;
9804 FRAMEWORK = 1;
9805 CB_SERVICE = 2;
9806 CB_RECEIVER_APP = 3;
9807 }
9808
Jordan Liubedfa702019-12-20 15:08:45 -08009809 // GSM, CDMA, CDMA-SCP
9810 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009811
9812 // The source of the report
9813 optional ReportSource source = 2;
9814}
9815
9816/**
9817 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9818 *
9819 * Logged from CellBroadcastService module:
9820 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9821 */
9822message CellBroadcastMessageFiltered {
9823 enum FilterReason {
9824 NOT_FILTERED = 0;
9825 DUPLICATE_MESSAGE = 1;
9826 GEOFENCED_MESSAGE = 2;
9827 AREA_INFO_MESSAGE = 3;
9828 }
9829
9830 // GSM, CDMA, CDMA-SCP
9831 optional CellBroadcastMessageReported.CbType type = 1;
9832
9833 // The source of the report
9834 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009835}
9836
9837/**
9838 * Logs when an error occurs while handling a cell broadcast message;
9839 *
9840 * Logged from CellBroadcastService module:
9841 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9842 */
9843message CellBroadcastMessageError {
9844 // The type of error raised when trying to handle a cell broadcast message
9845 enum ErrorType {
9846 UNKNOWN_TYPE = 0;
9847 CDMA_DECODING_ERROR = 1;
9848 CDMA_SCP_EMPTY = 2;
9849 CDMA_SCP_HANDLING_ERROR = 3;
9850 GSM_INVALID_HEADER_LENGTH = 4;
9851 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9852 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9853 GSM_INVALID_PDU = 7;
9854 GSM_INVALID_GEO_FENCING_DATA = 8;
9855 GSM_UMTS_INVALID_WAC = 9;
9856 FAILED_TO_INSERT_TO_DB = 10;
9857 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9858 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9859 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9860 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009861 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009862 }
9863
9864 // What kind of error occurred
9865 optional ErrorType type = 1;
9866
9867 // Exception message (or log message) associated with the error (max 1000 chars)
9868 optional string exception_message = 2;
9869}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009870
9871/**
Henry Fange316ab62020-04-21 18:43:14 -07009872 * Logs when a tune occurs through device's Frontend.
9873 * This is atom ID 276.
9874 *
9875 * Logged from:
9876 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9877 */
9878message TvTunerStateChanged {
9879 enum State {
9880 UNKNOWN = 0;
9881 TUNING = 1; // Signal is tuned
9882 LOCKED = 2; // the signal is locked
9883 NOT_LOCKED = 3; // the signal isn’t locked.
9884 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9885 SCANNING = 5; // the signal is scanned
9886 SCAN_STOPPED = 6; // the scan is stopped.
9887 }
9888 // The uid of the application that sent this custom atom.
9889 optional int32 uid = 1 [(is_uid) = true];
9890 // new state
9891 optional State state = 2;
9892}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009893
9894/**
9895 * Logs the status of a dvr playback or record.
9896 * This is atom ID 279.
9897 *
9898 * Logged from:
9899 * frameworks/base/media/java/android/media/tv/tuner/dvr
9900 */
9901message TvTunerDvrStatus {
9902 enum Type {
9903 UNKNOWN_TYPE = 0;
9904 PLAYBACK = 1; // is a playback
9905 RECORD = 2; // is a record
9906 }
9907 enum State {
9908 UNKNOWN_STATE = 0;
9909 STARTED = 1; // DVR is started
9910 STOPPED = 2; // DVR is stopped
9911 }
9912 // The uid of the application that sent this custom atom.
9913 optional int32 uid = 1 [(is_uid) = true];
9914 // DVR type
9915 optional Type type = 2;
9916 // DVR state
9917 optional State state = 3;
9918 // Identify the segment of a record or playback
9919 optional int32 segment_id = 4;
9920 // indicate how many overflow or underflow happened between started to stopped
9921 optional int32 overflow_underflow_count = 5;
9922}
Henry Fangfd40c072020-06-01 14:59:17 -07009923
9924/**
9925 * Logs when a cas session opened through MediaCas.
9926 * This is atom ID 280.
9927 *
9928 * Logged from:
9929 * frameworks/base/media/java/android/media/MediaCas.java
9930 */
9931message TvCasSessionOpenStatus {
9932 enum State {
9933 UNKNOWN = 0;
9934 SUCCEEDED = 1; // indicate that the session is opened successfully.
9935 FAILED = 2; // indicate that the session isn’t opened successfully.
9936 }
9937 // The uid of the application that sent this custom atom.
9938 optional int32 uid = 1 [(is_uid) = true];
9939 // Cas system Id
9940 optional int32 cas_system_id = 2;
9941 // State of the session
9942 optional State state = 3;
9943}
9944
Henry Fange316ab62020-04-21 18:43:14 -07009945/**
Tingting Wangb4ecadb2020-04-27 15:34:45 +00009946 * Logs for ContactsProvider general usage.
9947 * This is atom ID 301.
9948 *
9949 * Logged from:
9950 * packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9951 */
9952message ContactsProviderStatusReported {
9953 enum ApiType {
9954 UNKNOWN_API = 0;
9955 QUERY = 1;
9956 // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
9957 INSERT = 2;
9958 // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
9959 UPDATE = 3;
9960 DELETE = 4;
9961 }
9962
9963 enum ResultType {
9964 UNKNOWN_RESULT = 0;
9965 SUCCESS = 1;
9966 FAIL = 2;
9967 ILLEGAL_ARGUMENT = 3;
9968 UNSUPPORTED_OPERATION = 4;
9969 }
9970
9971 enum CallerType {
9972 UNSPECIFIED_CALLER_TYPE = 0;
9973 CALLER_IS_SYNC_ADAPTER = 1;
9974 CALLER_IS_NOT_SYNC_ADAPTER = 2;
9975 }
9976
9977 optional ApiType api_type = 1;
9978 // Defined in
9979 // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9980 optional int32 uri_type = 2;
9981 optional CallerType caller_type = 3;
9982 optional ResultType result_type = 4;
9983 optional int32 result_count = 5;
9984 optional int64 latency_micros = 6;
9985}
9986
9987/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009988 * Logs when an app is frozen or unfrozen.
9989 *
9990 * Logged from:
9991 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9992 */
9993message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009994 // The type of event.
9995 enum Action {
9996 UNKNOWN = 0;
9997 FREEZE_APP = 1;
9998 UNFREEZE_APP = 2;
9999 }
10000 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -080010001
Blake Kragten6ce382a2020-01-16 20:20:46 -080010002 // Pid of the process being frozen.
10003 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -080010004
Blake Kragten6ce382a2020-01-16 20:20:46 -080010005 // Name of the process being frozen.
10006 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -080010007
Blake Kragten6ce382a2020-01-16 20:20:46 -080010008 // Time since last unfrozen.
10009 optional int64 time_unfrozen_millis = 4;
10010}
10011
10012/**
Chi Zhangbb9ed922020-03-11 10:16:47 -070010013 * Pulls information for a single voice call.
10014 *
10015 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
10016 *
10017 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010018 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010019 */
10020message VoiceCallSession {
10021 // Bearer (IMS or CS) when the call started.
10022 optional android.telephony.CallBearerEnum bearer_at_start = 1;
10023
10024 // Bearer (IMS or CS) when the call ended.
10025 // The bearer may change during the call, e.g. due to SRVCC.
10026 optional android.telephony.CallBearerEnum bearer_at_end = 2;
10027
10028 // Direction of the call (incoming or outgoing).
10029 optional android.telephony.CallDirectionEnum direction = 3;
10030
10031 // Time spent setting up the call.
10032 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
10033
10034 // Whether the call ended before the setup was completed.
10035 optional bool setup_failed = 5;
10036
10037 // IMS reason code or CS disconnect cause.
10038 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
10039 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
10040 optional int32 disconnect_reason_code = 6;
10041
10042 // IMS extra code or CS precise disconnect cause.
10043 // For IMS, this code is vendor-specific
10044 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
10045 optional int32 disconnect_extra_code = 7;
10046
10047 // IMS extra message or CS vendor cause.
10048 optional string disconnect_extra_message = 8;
10049
10050 // Radio access technology (RAT) used when call started.
10051 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
10052
10053 // Radio access technology (RAT) used when call terminated.
10054 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
10055
10056 // Number of times RAT changed during the call.
10057 optional int64 rat_switch_count = 11;
10058
10059 // A bitmask of all codecs used during the call.
10060 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
10061 optional int64 codec_bitmask = 12;
10062
10063 // Number of other calls going on during call setup, for the same SIM slot.
10064 optional int32 concurrent_call_count_at_start = 13;
10065
10066 // Number of other calls going on during call termination, for the same SIM slot.
10067 optional int32 concurrent_call_count_at_end = 14;
10068
10069 // Index of the SIM is used, 0 for single-SIM devices.
10070 optional int32 sim_slot_index = 15;
10071
10072 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
10073 optional bool is_multi_sim = 16;
10074
10075 // Whether the call was made with an eSIM profile.
10076 optional bool is_esim = 17;
10077
10078 // Carrier ID of the SIM card.
10079 // See https://source.android.com/devices/tech/config/carrierid.
10080 optional int32 carrier_id = 18;
10081
Chi Zhangba1b03a2020-04-21 17:17:56 -070010082 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -070010083 optional bool srvcc_completed = 19;
10084
10085 // Number of SRVCC failures.
10086 optional int64 srvcc_failure_count = 20;
10087
10088 // Number of SRVCC cancellations.
10089 optional int64 srvcc_cancellation_count = 21;
10090
Chi Zhangba1b03a2020-04-21 17:17:56 -070010091 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
10092 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -070010093 optional bool rtt_enabled = 22;
10094
10095 // Whether this was an emergency call.
10096 optional bool is_emergency = 23;
10097
10098 // Whether the call was performed while roaming.
10099 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -070010100
10101 // A random number used as the dimension field to pull multiple atoms.
10102 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -070010103}
10104
10105/**
10106 * Pulls voice call radio access technology (RAT) usage.
10107 *
10108 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
10109 * time. The atom will be skipped if not enough data is available.
10110 *
10111 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010112 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010113 */
10114message VoiceCallRatUsage {
10115 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
10116 optional int32 carrier_id = 1;
10117
10118 // Radio access technology.
10119 optional android.telephony.NetworkTypeEnum rat = 2;
10120
10121 // Total duration that voice calls spent on this carrier and RAT.
10122 optional int64 total_duration_seconds = 3;
10123
10124 // Total number of calls using this carrier and RAT.
10125 // A call is counted once even if it used the RAT multiple times.
10126 optional int64 call_count = 4;
10127}
10128
10129/**
10130 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
10131 *
10132 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010133 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010134 */
10135message SimSlotState {
10136 // Number of active SIM slots (both physical and eSIM profiles) in the device.
10137 optional int32 active_slot_count = 1;
10138
10139 // Number of SIM cards (both physical and active eSIM profiles).
10140 // This number is always equal to or less than the number of active SIM slots.
10141 optional int32 sim_count = 2;
10142
10143 // Number of active eSIM profiles.
10144 // This number is always equal to or less than the number of SIMs.
10145 optional int32 esim_count = 3;
10146}
10147
10148/**
10149 * Pulls supported cellular radio access technologies.
10150 *
10151 * This atom reports the capabilities of the device, rather than the network it has access to.
10152 *
10153 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010154 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010155 */
10156message SupportedRadioAccessFamily {
10157 // A bitmask of supported radio technologies.
10158 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
10159 optional int64 network_type_bitmask = 1;
10160}
10161
10162/**
Blake Kragten6ce382a2020-01-16 20:20:46 -080010163 * Logs gnss stats from location service provider
10164 *
10165 * Pulled from:
10166 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
10167 */
10168
10169message GnssStats {
10170 // Number of location reports since boot
10171 optional int64 location_reports = 1;
10172
10173 // Total pulled reports of Location failures since boot
10174 optional int64 location_failure_reports = 2;
10175
10176 // Number of time to first fix reports since boot
10177 optional int64 time_to_first_fix_reports = 3;
10178
10179 // Total pulled reported time to first fix (in milli-seconds) since boot
Blake Kragten850a9d432020-06-11 09:05:39 -070010180 optional int64 time_to_first_fix_millis = 4;
Blake Kragten6ce382a2020-01-16 20:20:46 -080010181
10182 // Number of position accuracy reports since boot
10183 optional int64 position_accuracy_reports = 5;
10184
10185 // Total pulled reported position accuracy (in meters) since boot
10186 optional int64 position_accuracy_meters = 6;
10187
10188 // Number of top 4 average CN0 reports since boot
10189 optional int64 top_four_average_cn0_reports = 7;
10190
10191 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
10192 optional int64 top_four_average_cn0_db_mhz = 8;
10193
10194 // Number of l5 top 4 average CN0 reports since boot
10195 optional int64 l5_top_four_average_cn0_reports = 9;
10196
10197 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
10198 optional int64 l5_top_four_average_cn0_db_mhz = 10;
10199
10200 // Total number of sv status messages reports since boot
10201 optional int64 sv_status_reports = 11;
10202
10203 // Total number of sv status messages reports, where sv is used in fix since boot
10204 optional int64 sv_status_reports_used_in_fix = 12;
10205
10206 // Total number of L5 sv status messages reports since boot
10207 optional int64 l5_sv_status_reports = 13;
10208
10209 // Total number of L5 sv status messages reports, where sv is used in fix since boot
10210 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -080010211}
Kweku Adams12752132020-02-18 15:36:48 -080010212
10213/**
10214 * Logs when an app is moved to a different standby bucket.
10215 *
10216 * Logged from:
10217 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
10218 */
10219message AppStandbyBucketChanged {
10220 optional string package_name = 1;
10221
10222 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
10223 optional int32 user_id = 2;
10224
10225 // These enum values match the constants defined in UsageStatsManager.java.
10226 enum Bucket {
10227 BUCKET_UNKNOWN = 0;
10228 BUCKET_EXEMPTED = 5;
10229 BUCKET_ACTIVE = 10;
10230 BUCKET_WORKING_SET = 20;
10231 BUCKET_FREQUENT = 30;
10232 BUCKET_RARE = 40;
10233 BUCKET_RESTRICTED = 45;
10234 BUCKET_NEVER = 50;
10235 }
10236 optional Bucket bucket = 3;
10237
10238 enum MainReason {
10239 MAIN_UNKNOWN = 0;
10240 MAIN_DEFAULT = 0x0100;
10241 MAIN_TIMEOUT = 0x0200;
10242 MAIN_USAGE = 0x0300;
10243 MAIN_FORCED_BY_USER = 0x0400;
10244 MAIN_PREDICTED = 0x0500;
10245 MAIN_FORCED_BY_SYSTEM = 0x0600;
10246 }
10247 optional MainReason main_reason = 4;
10248
10249 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
10250 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
10251 // UsageStatsManager.java.
10252 optional int32 sub_reason = 5;
10253}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010254
10255/**
10256* Reports a started sharesheet transaction.
10257*
10258* Logged from:
10259* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
10260*/
10261message SharesheetStarted {
10262 // The event_id (as for UiEventReported).
10263 optional int32 event_id = 1;
10264 // The calling app's package name.
10265 optional string package_name = 2;
10266 // An identifier to tie together multiple logs relating to the same share event
10267 optional int32 instance_id = 3;
10268 // The mime type of the share
10269 optional string mime_type = 4;
10270 // The number of direct targets the calling app is providing that will be shown.
10271 optional int32 num_app_provided_direct_targets = 5;
10272 // The number of app targets the calling app is providing that will be shown.
10273 optional int32 num_app_provided_app_targets = 6;
10274 // True if the share originates from the workprofile
10275 optional bool is_workprofile = 7;
10276
10277 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010278 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010279 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
10280 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
10281 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
10282 }
10283 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010284 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010285
10286 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
10287 INTENT_DEFAULT = 0;
10288 INTENT_ACTION_VIEW = 1;
10289 INTENT_ACTION_EDIT = 2;
10290 INTENT_ACTION_SEND = 3;
10291 INTENT_ACTION_SENDTO = 4;
10292 INTENT_ACTION_SEND_MULTIPLE = 5;
10293 INTENT_ACTION_IMAGE_CAPTURE = 6;
10294 INTENT_ACTION_MAIN = 7;
10295 }
10296 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010297 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010298}
10299
10300/**
10301 * Reports a ranking selection event.
10302 *
10303 * Logged from:
10304 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
10305 */
10306message RankingSelected {
10307 // The event_id (as for UiEventReported).
10308 optional int32 event_id = 1;
10309 // The relevant app's package name (can be source or picked package).
10310 optional string package_name = 2;
10311 // An identifier to tie together multiple logs relating to the same share event.
10312 optional int32 instance_id = 3;
10313 // Which of the ranked targets got picked, default starting position 0.
10314 optional int32 position_picked = 4;
10315}
Raff Tsaiea4db182020-03-06 07:45:43 +080010316
10317/**
Zhen Sun0bec8d42020-03-25 17:17:29 -070010318 * Logs when TvSettings UI is interacted at.
10319 *
10320 * Logged from: packages/apps/TvSettings
10321 */
10322message TvSettingsUIInteracted {
10323
10324 /** The UI action category */
10325 optional android.app.tvsettings.Action action = 1;
10326
10327 /** The ID of the entry that the users actioned on */
10328 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -070010329}
10330
10331/**
Songchun Fanc296cf72020-03-31 18:38:52 -070010332 * Logs information about a package installation using package installer V2 APIs.
10333 *
10334 * Logged from:
10335 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
10336 */
10337message PackageInstallerV2Reported {
10338 // Whether this installation uses Incremental File System
10339 optional bool is_incremental = 1;
10340 // Name of the package that is intended to be installed
10341 optional string package_name = 2;
10342 // The duration between when the install was requested to when the install has completed
10343 optional int64 duration_millis = 3;
10344 // Installation result in final integer, which are SystemApi's.
10345 // Return_code 1 indicates success.
10346 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
10347 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010348 // Total size of the APKs installed for this package
10349 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010350}
10351
10352/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010353 * Logs settings provider values.
10354 *
10355 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10356 * then write the value to proto.
10357 *
10358 */
10359message SettingSnapshot {
10360
10361 // Setting key
10362 optional string name = 1;
10363
10364 enum SettingsValueType {
10365 NOTASSIGNED = 0;
10366 ASSIGNED_BOOL_TYPE = 1;
10367 ASSIGNED_INT_TYPE = 2;
10368 ASSIGNED_FLOAT_TYPE = 3;
10369 ASSIGNED_STRING_TYPE = 4;
10370 };
10371 // Setting value type
10372 optional SettingsValueType type = 2;
10373
10374 optional bool bool_value = 3;
10375
10376 optional int32 int_value = 4;
10377
10378 optional float float_value = 5;
10379
10380 optional string str_value = 6;
10381
10382 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10383 optional int32 user_id = 7;
10384}
Varun Shahacb56342019-12-18 11:45:38 -080010385
10386/**
10387 * An event logged to indicate that a user journey is about to be performed. This atom includes
10388 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10389 * will immediately follow this atom which will describe the event(s) and its state.
10390 *
10391 * Logged from:
10392 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10393 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10394 */
10395message UserLifecycleJourneyReported {
10396 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10397 // UserLifecycleEventOccurred atom)
10398 optional int64 session_id = 1;
10399
10400 // Indicates what type of user journey this session is related to
10401 enum Journey {
10402 UNKNOWN = 0; // Undefined user lifecycle journey
10403 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10404 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10405 USER_START = 3; // A user start journey
10406 USER_CREATE = 4; // A user creation journey
10407 }
10408 optional Journey journey = 2;
10409 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10410 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10411 optional int32 origin_user = 3;
10412 // Which user the journey is targeting
10413 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10414 optional int32 target_user = 4;
10415
10416 // What is the user type of the target user
10417 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10418 enum UserType {
10419 TYPE_UNKNOWN = 0;
10420 FULL_SYSTEM = 1;
10421 FULL_SECONDARY = 2;
10422 FULL_GUEST = 3;
10423 FULL_DEMO = 4;
10424 FULL_RESTRICTED = 5;
10425 PROFILE_MANAGED = 6;
10426 SYSTEM_HEADLESS = 7;
10427 }
10428 optional UserType user_type = 5;
10429 // What are the flags attached to the target user
10430 optional int32 user_flags = 6;
10431}
10432
10433/**
10434 * An event logged when a specific user lifecycle event is performed. These events should be
10435 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10436 * Note: journeys can span over multiple events, hence some events may share a single session id.
10437 *
10438 * Logged from:
10439 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10440 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10441 */
10442message UserLifecycleEventOccurred {
10443 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10444 optional int64 session_id = 1;
10445 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10446 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10447 optional int32 user_id = 2;
10448
10449 enum Event {
10450 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10451 SWITCH_USER = 1; // Indicates that this is a user switch event
10452 START_USER = 2; // Indicates that this is a user start event
10453 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010454 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10455 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10456 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010457 }
10458 optional Event event = 3;
10459
10460 enum State {
10461 NONE = 0; // Indicates the associated event has no start/end defined
10462 BEGIN = 1;
10463 FINISH = 2;
10464 }
10465 optional State state = 4; // Represents the state of an event (beginning/ending)
10466}
jasonwshsu81173e32020-03-27 15:22:03 +080010467
10468/**
10469 * Logs when accessibility shortcut clicked.
10470 *
10471 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010472 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010473 */
10474message AccessibilityShortcutReported {
10475 // The accessibility feature(including installed a11y service, framework a11y feature,
10476 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10477 optional string package_name = 1;
10478
10479 // The definition of the accessibility shortcut.
10480 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10481 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10482
10483 // The definition of the service status.
10484 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10485 optional android.stats.accessibility.ServiceStatus service_status = 3;
10486}
10487
10488/**
10489 * Logs when accessibility service status changed.
10490 *
10491 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010492 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010493 */
10494message AccessibilityServiceReported {
10495 // The accessibility service package name.
10496 optional string package_name = 1;
10497
10498 // The definition of the service status.
10499 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10500 optional android.stats.accessibility.ServiceStatus service_status = 2;
10501}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010502
Denny cy Leeca62fc42020-05-28 18:13:07 +080010503/**
10504 * Logs when display wake up.
10505 *
10506 * Logged from:
10507 * services/core/java/com/android/server/power/Notifier.java
10508 */
10509
10510message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010511 // Wake_up_reason code
10512 // If LOWORD(wake_up_reason) = 0
10513 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10514 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010515 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010516 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010517}
10518
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010519/**
10520 * Logs app usage events.
10521 */
10522message AppUsageEventOccurred {
10523 optional int32 uid = 1 [(is_uid) = true];
10524 optional string package_name = 2;
10525 optional string class_name = 3;
10526
10527 enum EventType {
10528 NONE = 0;
10529 MOVE_TO_FOREGROUND = 1;
10530 MOVE_TO_BACKGROUND = 2;
10531 }
10532 optional EventType event_type = 4;
10533}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010534
10535/*
10536 * Quality metrics logged when EVS cameras are active.
10537 *
10538 * Logged from:
10539 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10540 */
10541message EvsUsageStatsReported {
10542
10543 // Camera identifier to distinguish the source camera device. This is not
10544 // globally unique and therefore cannot be used to identify the user and/or
10545 // the device.
10546 optional int32 device_id = 1;
10547
10548 // Peak number of clients during the service
10549 optional int32 peak_num_clients = 2;
10550
10551 // Number of erroneous events during the service
10552 optional int32 num_errors = 3;
10553
10554 // Round trip latency of the very first frame
10555 optional int64 first_latency_millis = 4;
10556
10557 // Average frame round trip latency
10558 optional float avg_latency_millis = 5;
10559
10560 // Peak frame round trip latency
10561 optional int64 peak_latency_millis = 6;
10562
10563 // Total number of frames received
10564 optional int64 total_frames = 7;
10565
10566 // Number of frames ignored
10567 optional int64 ignored_frames = 8;
10568
10569 // Number of dropped frames to synchronize camera devices
10570 optional int64 dropped_frames_to_sync = 9;
10571
10572 // The duration of the service
10573 optional int64 duration_millis = 10;
10574}
Robert Leecccdc152020-04-23 13:22:46 +080010575
10576/**
10577 * Logs audio power usage stats.
10578 *
10579 * Pushed from:
10580 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10581 */
10582message AudioPowerUsageDataReported {
10583 /**
10584 * Device used for input/output
10585 *
10586 * All audio devices please refer to below file:
10587 * system/media/audio/include/system/audio-base.h
10588 *
10589 * Define our own enum values because we don't report all audio devices.
10590 * Currently, we only report built-in audio devices such as handset, speaker,
10591 * built-in mics, common audio devices such as wired headset, usb headset
10592 * and bluetooth devices.
10593 */
10594 enum AudioDevice {
10595 OUTPUT_EARPIECE = 0x1; // handset
10596 OUTPUT_SPEAKER = 0x2; // dual speaker
10597 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10598 OUTPUT_USB_HEADSET = 0x8; // usb headset
10599 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10600 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10601 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10602
10603 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10604 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10605 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10606 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10607 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10608 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10609 }
10610 optional AudioDevice audio_device = 1;
10611
10612 // Duration of the audio in seconds
10613 optional int32 duration_secs = 2;
10614
10615 // Average volume (0 ... 1.0)
10616 optional float average_volume = 3;
10617
10618 enum AudioType {
10619 UNKNOWN_TYPE = 0;
10620 VOICE_CALL_TYPE = 1; // voice call
10621 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10622 MEDIA_TYPE = 3; // music and system sound
10623 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10624 ALARM_TYPE = 5; // alarm type
10625 // record type
10626 CAMCORDER_TYPE = 6; // camcorder
10627 RECORD_TYPE = 7; // other recording
10628 }
10629 optional AudioType type = 4;
10630}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010631
10632/**
10633 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10634 *
10635 * Pulled from:
10636 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10637 */
10638message BytesTransferByTagAndMetered {
10639 optional int32 uid = 1 [(is_uid) = true];
10640
10641 optional bool is_metered = 2;
10642
10643 optional int32 tag = 3;
10644
10645 optional int64 rx_bytes = 4;
10646
10647 optional int64 rx_packets = 5;
10648
10649 optional int64 tx_bytes = 6;
10650
10651 optional int64 tx_packets = 7;
10652}
Robert Luo2f52f042020-05-11 16:39:24 +080010653
10654/*
10655 * Logs when the Media Output Switcher finishes a media switch operation.
10656 *
10657 * Logged from:
10658 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10659 */
10660message MediaOutputOpSwitchReported {
10661 // Source medium type before switching.
10662 optional android.app.settings.mediaoutput.MediumType source = 1;
10663
10664 // Target medium type after switching.
10665 optional android.app.settings.mediaoutput.MediumType target = 2;
10666
10667 // The result of switching.
10668 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10669
10670 // The detail code of a switching result.
10671 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10672
10673 /*
10674 * The package name of a pre-installed app, whose media session is being switched.
10675 */
10676 optional string media_session_package_name = 5;
10677
10678 // The amount of available wired devices when a switching is being performed.
10679 optional int32 available_wired_device_count = 6;
10680
10681 // The amount of available Bluetooth devices a switching is being performed.
10682 optional int32 available_bt_device_count = 7;
10683
10684 // The amount of available remote devices when a switching is being performed.
10685 optional int32 available_remote_device_count = 8;
10686
10687 // The amount of applied devices within a remote dynamic group after a switching is done.
10688 optional int32 applied_device_count_within_remote_group = 9;
10689}
Govinda Wassermane4640282020-04-30 09:30:56 -040010690
10691/**
10692 * Logs when the Assistant is invoked.
10693 *
10694 * Logged from:
10695 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10696 */
10697message AssistantInvocationReported {
10698
10699 // The event_id (as for UiEventReported).
10700 optional int32 event_id = 1;
10701
10702 // The registered Assistant's uid and package (as for UiEventReported).
10703 optional int32 uid = 2 [(is_uid) = true];
10704 optional string package_name = 3;
10705
10706 // An identifier used to disambiguate which logs refer to a particular invocation of the
10707 // Assistant (as for UiEventReported).
10708 optional int32 instance_id = 4;
10709
10710 // The state of the device at the time of invocation.
10711 enum DeviceState {
10712 UNKNOWN_DEVICE_STATE = 0;
10713 AOD1 = 1;
10714 AOD2 = 2;
10715 BOUNCER = 3;
10716 UNLOCKED_LOCKSCREEN = 4;
10717 LAUNCHER_HOME = 5;
10718 LAUNCHER_OVERVIEW = 6;
10719 LAUNCHER_ALL_APPS = 7;
10720 APP_DEFAULT = 8;
10721 APP_IMMERSIVE = 9;
10722 APP_FULLSCREEN = 10;
10723 }
10724 optional DeviceState device_state = 5;
10725
10726 // Whether the Assistant handles were showing at the time of invocation.
10727 optional bool assistant_handles_showing = 6;
10728}
Andy Hung48cffa32020-05-01 09:54:02 -070010729
10730/**
10731 * Logs when an AudioRecord finishes running on an audio device
10732 *
10733 * Logged from:
10734 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10735 */
10736message MediametricsAudioRecordDeviceUsageReported {
10737 // The devices connected to this AudioRecord.
10738 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10739 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10740 // See audio_device_t in system/media/audio/include/system/audio-base.h
10741 optional string devices = 1;
10742
10743 // The name of the remote device attached to the device, typically available for USB or BT.
10744 // This may be empty for a fixed device, or separated by "|" if more than one.
10745 optional string device_names = 2;
10746
10747 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10748 optional int64 device_time_nanos = 3;
10749
10750 // The audio data format used for encoding.
10751 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10752 optional string encoding = 4;
10753
10754 // The client-server buffer framecount.
10755 // The framecount is generally between 960 - 48000 for PCM encoding.
10756 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10757 optional int32 frame_count = 5;
10758
10759 // The number of audio intervals (contiguous, continuous playbacks).
10760 optional int32 interval_count = 6;
10761
10762 // The sample rate of the AudioRecord.
10763 // A number generally between 8000-96000 (frames per second).
10764 optional int32 sample_rate = 7;
10765
10766 // The audio input flags used to construct the AudioRecord.
10767 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10768 optional string flags = 8;
10769
10770 // The santized package name of the audio client associated with the AudioRecord.
10771 // See getSanitizedPackageNameAndVersionCode() in
10772 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10773 optional string package_name = 9;
10774
10775 // The selected device id (nonzero if a non-default device is selected)
10776 optional int32 selected_device_id = 10;
10777
10778 // The caller of the AudioRecord.
10779 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10780 optional string caller = 11;
10781
10782 // The audio source for AudioRecord.
10783 // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
10784 optional string source = 12;
10785}
10786
10787/**
10788 * Logs when an AudioThread finishes running on an audio device
10789 *
10790 * Logged from:
10791 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10792 */
10793message MediametricsAudioThreadDeviceUsageReported {
10794 // The devices connected to this audio thread.
10795 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10796 // (for record threads):
10797 // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
10798 // (for playback threads):
10799 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10800 // See audio_device_t in system/media/audio/include/system/audio-base.h
10801 optional string devices = 1;
10802
10803 // The name of the remote device attached to the device, typically available for USB or BT.
10804 // This may be empty for a fixed device, or separated by "|" if more than one.
10805 optional string device_names = 2;
10806
10807 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10808 optional int64 device_time_nanos = 3;
10809
10810 // The audio data format used for encoding.
10811 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10812 optional string encoding = 4;
10813
10814 // The framecount of the buffer delivered to (or from) the HAL.
10815 // The framecount is generally ~960 for PCM encoding.
10816 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10817 optional int32 frame_count = 5;
10818
10819 // The number of audio intervals (contiguous, continuous playbacks).
10820 optional int32 interval_count = 6;
10821
10822 // The sample rate of the audio thread.
10823 // A number generally between 8000-96000 (frames per second).
10824 optional int32 sample_rate = 7;
10825
10826 // The audio flags used to construct the thread
10827 // (for record threads):
10828 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10829 // (for playback threads):
10830 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10831 optional string flags = 8;
10832
10833 // The number of underruns encountered for a playback thread or the
10834 // number of overruns encountered for a capture thread.
10835 optional int32 xruns = 9;
10836
10837 // The type of thread
10838 // A thread type enumeration from
10839 // frameworks/av/mediametrics/services/Translate.h
10840 optional string type = 10;
10841}
10842
10843/**
10844 * Logs when an AudioTrack finishes running on an audio device
10845 *
10846 * Logged from:
10847 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10848 */
10849message MediametricsAudioTrackDeviceUsageReported {
10850 // The output devices connected to this AudioTrack.
10851 // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
10852 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10853 // See audio_device_t in system/media/audio/include/system/audio-base.h
10854 optional string devices = 1;
10855
10856 // The name of the remote device attached to the device, typically available for USB or BT.
10857 // This may be empty for a fixed device, or separated by "|" if more than one.
10858 optional string device_names = 2;
10859
10860 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10861 optional int64 device_time_nanos = 3;
10862
10863 // The audio data format used for encoding.
10864 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10865 optional string encoding = 4;
10866
10867 // The client-server buffer framecount.
10868 // The framecount is generally between 960 - 48000 for PCM encoding.
10869 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10870 // A static track (see traits) may have a very large framecount.
10871 optional int32 frame_count = 5;
10872
10873 // The number of audio intervals (contiguous, continuous playbacks).
10874 optional int32 interval_count = 6;
10875
10876 // The sample rate of the AudioTrack.
10877 // A number generally between 8000-96000 (frames per second).
10878 optional int32 sample_rate = 7;
10879
10880 // The audio flags used to construct the AudioTrack.
10881 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10882 optional string flags = 8;
10883
10884 // The number of underruns encountered.
10885 optional int32 xruns = 9;
10886
10887 // The santized package name of the audio client associated with the AudioTrack.
10888 // See getSanitizedPackageNameAndVersionCode() in
10889 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10890 optional string package_name = 10;
10891
10892 // The latency of the last sample in the buffer in milliseconds.
10893 optional float device_latency_millis = 11;
10894
10895 // The startup time in milliseconds from start() to sample played.
10896 optional float device_startup_millis = 12;
10897
10898 // The average volume of the track on the device [ 0.f - 1.f ]
10899 optional float device_volume = 13;
10900
10901 // The selected device id (nonzero if a non-default device is selected)
10902 optional int32 selected_device_id = 14;
10903
10904 // The stream_type category for the AudioTrack.
10905 // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
10906 optional string stream_type = 15;
10907
10908 // The usage for the AudioTrack.
10909 // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
10910 optional string usage = 16;
10911
10912 // The content type of the AudioTrack.
10913 // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
10914 optional string content_type = 17;
10915
10916 // The caller of the AudioTrack.
10917 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10918 optional string caller = 18;
10919
10920 // The traits of the AudioTrack.
10921 // A string OR of different traits, may be empty string.
10922 // Only "static" is supported for R.
10923 // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10924 optional string traits = 19;
10925}
10926
10927/**
10928 * Logs the status of an audio device connection attempt.
10929 *
10930 * Logged from:
10931 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10932 */
10933message MediametricsAudioDeviceConnectionReported {
10934 // The input devices represented by this report.
10935 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10936 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10937 // See audio_device_t in system/media/audio/include/system/audio-base.h
10938 optional string input_devices = 1;
10939
10940 // The output devices represented by this report.
10941 // A string OR of various output device categories.
10942 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10943 // See audio_device_t in system/media/audio/include/system/audio-base.h
10944 optional string output_devices = 2;
10945
10946 // The name of the remote device attached to the device, typically available for USB or BT.
10947 // This may be empty for a fixed device, or separated by "|" if more than one.
10948 optional string device_names = 3;
10949
10950 // The result of the audio device connection.
10951 // 0 indicates success: connection verified.
10952 // 1 indicates unknown: connection not verified or not known if diverted properly.
10953 // Other values indicate specific status.
10954 // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
10955 optional int32 result = 4;
10956
10957 // Average milliseconds of time to connect
10958 optional float time_to_connect_millis = 5;
10959
10960 // Number of connections if aggregated statistics, otherwise 1.
10961 optional int32 connection_count = 6;
10962}
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -070010963
Hasini Gunasinghe7c336a62020-05-28 10:23:01 +000010964/**
10965 * Logs: i) creation of different types of cryptographic keys in the keystore,
10966 * ii) operations performed using the keys,
10967 * iii) attestation of the keys
10968 * Logged from: system/security/keystore/key_event_log_handler.cpp
10969 */
10970message KeystoreKeyEventReported {
10971
10972 enum Algorithm {
10973 /** Asymmetric algorithms. */
10974 RSA = 1;
10975 // 2 removed, do not reuse.
10976 EC = 3;
10977 /** Block cipher algorithms */
10978 AES = 32;
10979 TRIPLE_DES = 33;
10980 /** MAC algorithms */
10981 HMAC = 128;
10982 };
10983 /** Algorithm associated with the key */
10984 optional Algorithm algorithm = 1;
10985
10986 /** Size of the key */
10987 optional int32 key_size = 2;
10988
10989 enum KeyOrigin {
10990 /** Generated in keymaster. Should not exist outside the TEE. */
10991 GENERATED = 0;
10992 /** Derived inside keymaster. Likely exists off-device. */
10993 DERIVED = 1;
10994 /** Imported into keymaster. Existed as cleartext in Android. */
10995 IMPORTED = 2;
10996 /** Keymaster did not record origin. */
10997 UNKNOWN = 3;
10998 /** Securely imported into Keymaster. */
10999 SECURELY_IMPORTED = 4;
11000 };
11001 /* Logs whether the key was generated, imported, securely imported, or derived.*/
11002 optional KeyOrigin key_origin = 3;
11003
11004 enum HardwareAuthenticatorType {
11005 NONE = 0;
11006 PASSWORD = 1;
11007 FINGERPRINT = 2;
11008 // Additional entries must be powers of 2.
11009 };
11010 /**
11011 * What auth types does this key require? If none,
11012 * then no auth required.
11013 */
11014 optional HardwareAuthenticatorType user_auth_type = 4;
11015
11016 /**
11017 * If user authentication is required, is the requirement time based? If it
11018 * is not time based then this field will not be used and the key is per
11019 * operation. Per operation keys must be user authenticated on each usage.
11020 */
11021 optional int32 user_auth_key_timeout_secs = 5;
11022
11023 /**
11024 * padding mode, digest, block_mode and purpose should ideally be repeated
11025 * fields. However, since statsd does not support repeated fields in
11026 * pushed atoms, they are represented using bitmaps.
11027 */
11028
11029 /** Track which padding mode is being used.*/
11030 optional int32 padding_mode_bitmap = 6;
11031
11032 /** Track which digest is being used. */
11033 optional int32 digest_bitmap = 7;
11034
11035 /** Track what block mode is being used (for encryption). */
11036 optional int32 block_mode_bitmap = 8;
11037
11038 /** Track what purpose is this key serving. */
11039 optional int32 purpose_bitmap = 9;
11040
11041 enum EcCurve {
11042 P_224 = 0;
11043 P_256 = 1;
11044 P_384 = 2;
11045 P_521 = 3;
11046 };
11047 /** Which ec curve was selected if elliptic curve cryptography is in use **/
11048 optional EcCurve ec_curve = 10;
11049
11050 enum KeyBlobUsageRequirements {
11051 STANDALONE = 0;
11052 REQUIRES_FILE_SYSTEM = 1;
11053 };
11054 /** Standalone or is a file system required */
11055 optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;
11056
11057 enum Type {
11058 key_operation = 0;
11059 key_creation = 1;
11060 key_attestation = 2;
11061 }
11062 /** Key creation event, operation event or attestation event? */
11063 optional Type type = 12;
11064
11065 /** Was the key creation, operation, or attestation successful? */
11066 optional bool was_successful = 13;
11067
11068 /** Response code or error code */
11069 optional int32 error_code = 14;
11070}
11071
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -070011072// Blob Committer stats
11073// Keep in sync between:
11074// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11075// frameworks/base/cmds/statsd/src/atoms.proto
11076message BlobCommitterProto {
11077 // Committer app's uid
11078 optional int32 uid = 1 [(is_uid) = true];
11079
11080 // Unix epoch timestamp of the commit in milliseconds
11081 optional int64 commit_timestamp_millis = 2;
11082
11083 // Flags of what access types the committer has set for the Blob
11084 optional int32 access_mode = 3;
11085
11086 // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
11087 optional int32 num_whitelisted_package = 4;
11088}
11089
11090// Blob Leasee stats
11091// Keep in sync between:
11092// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11093// frameworks/base/cmds/statsd/src/atoms.proto
11094message BlobLeaseeProto {
11095 // Leasee app's uid
11096 optional int32 uid = 1 [(is_uid) = true];
11097
11098 // Unix epoch timestamp for lease expiration in milliseconds
11099 optional int64 lease_expiry_timestamp_millis = 2;
11100}
11101
11102// List of Blob Committers
11103// Keep in sync between:
11104// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11105// frameworks/base/cmds/statsd/src/atoms.proto
11106message BlobCommitterListProto {
11107 repeated BlobCommitterProto committer = 1;
11108}
11109
11110// List of Blob Leasees
11111// Keep in sync between:
11112// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11113// frameworks/base/cmds/statsd/src/atoms.proto
11114message BlobLeaseeListProto {
11115 repeated BlobLeaseeProto leasee = 1;
11116}
11117
11118/**
11119 * Logs the current state of a Blob committed with BlobStoreManager
11120 *
11121 * Pulled from:
11122 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
11123 */
11124message BlobInfo {
11125 // Id of the Blob
11126 optional int64 blob_id = 1;
11127
11128 // Size of the Blob data
11129 optional int64 size = 2;
11130
11131 // Unix epoch timestamp of the Blob's expiration in milliseconds
11132 optional int64 expiry_timestamp_millis = 3;
11133
11134 // List of committers of this Blob
11135 optional BlobCommitterListProto committers = 4;
11136
11137 // List of leasees of this Blob
11138 optional BlobLeaseeListProto leasees = 5;
11139}