blob: dc20a02156cbf5b1b501cd87aa8ea809affd527b [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"];
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700489
490 // StatsdStats tracks platform atoms with ids upto 500.
491 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000492 }
David Chenc8a43242017-10-17 16:23:28 -0700493
David Chen6e3e6cb2018-01-03 16:14:06 -0800494 // Pulled events will start at field 10000.
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700495 // Next: 10084
David Chenc8a43242017-10-17 16:23:28 -0700496 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800497 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
498 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700499 MobileBytesTransfer mobile_bytes_transfer =
500 10002 [(module) = "framework", (truncate_timestamp) = true];
501 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
502 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800503 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
504 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700505 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800506 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700507 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800508 CpuTimePerUidFreq cpu_time_per_uid_freq =
509 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800510 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
511 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
512 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
513 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
514 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700515 SystemUptime system_uptime = 10015 [(module) = "framework"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700516 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshib635b3a2020-04-22 20:57:41 -0700517 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700518 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800519 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
520 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700521 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800522 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800523 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800524 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800525 DiskStats disk_stats = 10025 [(module) = "framework"];
526 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
527 AppSize app_size = 10027 [(module) = "framework"];
528 CategorySize category_size = 10028 [(module) = "framework"];
529 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800530 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800531 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
532 DiskIo disk_io = 10032 [(module) = "framework"];
533 PowerProfile power_profile = 10033 [(module) = "framework"];
534 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
535 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
536 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700537 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800538 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
539 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
540 10040 [(module) = "framework"];
541 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
542 10041 [(module) = "framework"];
543 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800544 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800545 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800546 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800547 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
548 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
549 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
550 RoleHolder role_holder = 10049 [(module) = "framework"];
551 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800552 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800553 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
554 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800555 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
556 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800557 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
558 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
559 FaceSettings face_settings = 10058 [(module) = "framework"];
560 CoolingDevice cooling_device = 10059 [(module) = "framework"];
561 AppOps app_ops = 10060 [(module) = "framework"];
562 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700563 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
564 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800565 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800566 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800567 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
568 DangerousPermissionStateSampled dangerous_permission_state_sampled =
569 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400570 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000571 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000572 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200573 PackageNotificationPreferences package_notification_preferences =
574 10071 [(module) = "framework"];
575 PackageNotificationChannelPreferences package_notification_channel_preferences =
576 10072 [(module) = "framework"];
577 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
578 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800579 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800580 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700581 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
582 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
583 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
584 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800585 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -0700586 BlobInfo blob_info = 10081 [(module) = "framework"];
junyulai8d1a6092020-05-07 13:38:15 +0800587 DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
Ruchir Rastogi56579cb2020-05-14 10:44:19 -0700588 BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
589 10083 [(module) = "framework"];
Chris Wren93165692020-05-15 16:12:41 -0400590 DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700591 }
yroa1fe77c2018-02-26 14:22:54 -0800592
Bookatz76aafcf2018-09-17 16:17:10 -0700593 // DO NOT USE field numbers above 100,000 in AOSP.
594 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
595 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100596
597 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700598}
599
Yao Chend54f9dd2017-10-17 17:37:48 +0000600/**
Yangster-mac20877162017-12-22 17:19:39 -0800601 * This proto represents a node of an attribution chain.
602 * Note: All attribution chains are represented as a repeated field of type
603 * AttributionNode. It is understood that in such arrays, the order is that
604 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000605 */
Yangster-mac20877162017-12-22 17:19:39 -0800606message AttributionNode {
607 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800608 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800609
Yangster-mac20877162017-12-22 17:19:39 -0800610 // The (optional) string tag for an element in the attribution chain. If the
611 // element has no tag, it is encoded as an empty string.
612 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700613}
614
Yangster-mac48b3d622018-08-18 12:38:11 -0700615message KeyValuePair {
616 optional int32 key = 1;
617 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700618 int32 value_int = 2;
619 int64 value_long = 3;
620 string value_str = 4;
621 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700622 }
623}
624
625message KeyValuePairsAtom {
626 optional int32 uid = 1;
627 repeated KeyValuePair pairs = 2;
628}
629
Yao Chend54f9dd2017-10-17 17:37:48 +0000630/*
631 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800632 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000633 *
634 * RULES:
635 * - The field ids for each atom must start at 1, and count upwards by 1.
636 * Skipping field ids is not allowed.
637 * - These form an API, so renaming, renumbering or removing fields is
638 * not allowed between android releases. (This is not currently enforced,
639 * but there will be a tool to enforce this restriction).
640 * - The types must be built-in protocol buffer types, namely, no sub-messages
641 * are allowed (yet). The bytes type is also not allowed.
642 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800643 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000644 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800645 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000646 * - A field that is a uid should be a string field, tagged with the [xxx]
647 * annotation. The generated code on android will be represented by UIDs,
648 * and those UIDs will be translated in xxx to those strings.
649 *
650 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700651 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000652 * - If there is a UID, it goes first. Think in an object-oriented fashion.
653 * *****************************************************************************
654 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700655
Yao Chend54f9dd2017-10-17 17:37:48 +0000656/**
Tej Singha72344992019-04-17 18:55:08 -0700657 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700658 * Logs when the Thermal service HAL notifies the throttling start/stop events.
659 *
660 * Logged from:
661 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
662 */
663message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700664 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700665 optional android.os.TemperatureTypeEnum sensor_type = 1;
666
Maggie White442b6312019-04-05 16:26:44 -0700667 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700668 enum State {
669 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700670 START = 1; // START indicated that throttling was triggered.
671 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700672 }
Yangster-mace16189a2018-08-26 12:20:16 -0700673 optional State state = 2;
674
675 optional float temperature = 3;
676}
677
678/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000679 * Logs when the screen state changes.
680 *
681 * Logged from:
682 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
683 */
684message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800685 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800686 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700687 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700688}
Yao Chend54f9dd2017-10-17 17:37:48 +0000689
690/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700691 * Logs that the process state of the uid, as determined by ActivityManager
692 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000693 *
694 * Logged from:
695 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
696 */
Bookatzc1a050a2017-10-10 15:49:28 -0700697message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700698 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000699
Bookatzdb026a22018-01-10 19:01:56 -0800700 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800701 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700702 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000703}
704
705/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700706 * Logs process state change of a process, as per the activity manager.
707 *
708 * Logged from:
709 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
710 */
711message ProcessStateChanged {
712 optional int32 uid = 1;
713 optional string process_name = 2;
714 optional string package_name = 3;
715 // TODO: remove this when validation is done
716 optional int64 version = 5;
717 // The state, from frameworks/base/core/proto/android/app/enums.proto.
718 optional android.app.ProcessStateEnum state = 4;
719}
720
721/**
722 * Logs when ActivityManagerService sleep state is changed.
723 *
724 * Logged from:
725 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
726 */
727message ActivityManagerSleepStateChanged {
728 // TODO: import frameworks proto
729 enum State {
730 UNKNOWN = 0;
731 ASLEEP = 1;
732 AWAKE = 2;
733 }
tsaichristine961d2fd2020-04-23 10:39:34 -0700734 optional State state = 1
735 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700736}
737
738/**
739 * Logs when system memory state changes.
740 *
741 * Logged from:
742 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
743 */
744message MemoryFactorStateChanged {
745 // TODO: import frameworks proto
746 enum State {
747 MEMORY_UNKNOWN = 0;
748 NORMAL = 1; // normal.
749 MODERATE = 2; // moderate memory pressure.
750 LOW = 3; // low memory.
751 CRITICAL = 4; // critical memory.
752
753 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700754 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700755}
756
757/**
758 * Logs when app is using too much cpu, according to ActivityManagerService.
759 *
760 * Logged from:
761 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
762 */
763message ExcessiveCpuUsageReported {
764 optional int32 uid = 1;
765 optional string process_name = 2;
766 optional string package_name = 3;
767 // package version. TODO: remove this when validation is done
768 optional int64 version = 4;
769}
770
771/**
772 * Logs when a cached process is killed, along with its pss.
773 *
774 * Logged from:
775 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
776 */
777message CachedKillReported {
778 optional int32 uid = 1;
779 optional string process_name = 2;
780 optional string package_name = 3;
781 // TODO: remove this when validation is done
782 optional int64 version = 5;
783 optional int64 pss = 4;
784}
785
786/**
xshu2c3d9e42019-09-26 17:54:02 -0700787 * Logs the change in wifi health.
788 *
789 * Logged from:
790 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
791 */
792message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800793 enum Band {
794 UNKNOWN = 0;
795 // All of 2.4GHz band
796 BAND_2G = 1;
797 // Frequencies in the range of [5150, 5250) GHz
798 BAND_5G_LOW = 2;
799 // Frequencies in the range of [5250, 5725) GHz
800 BAND_5G_MIDDLE = 3;
801 // Frequencies in the range of [5725, 5850) GHz
802 BAND_5G_HIGH = 4;
803 // Frequencies in the range of [5925, 6425) GHz
804 BAND_6G_LOW = 5;
805 // Frequencies in the range of [6425, 6875) GHz
806 BAND_6G_MIDDLE = 6;
807 // Frequencies in the range of [6875, 7125) GHz
808 BAND_6G_HIGH = 7;
809 }
xshu2c3d9e42019-09-26 17:54:02 -0700810 // duration this stat is obtained over in milliseconds
811 optional int32 duration_millis = 1;
812 // whether wifi is classified as sufficient for the user's data traffic, determined
813 // by whether the calculated throughput exceeds the average demand within |duration_millis|
814 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700815 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800816 optional bool is_cell_data_available = 3;
817 // the Band bucket the connected network is on
818 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700819}
820
821/**
822 * Logged when wifi detects a significant change in connection failure rate.
823 *
824 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
825 *
826 */
827message WifiFailureStatReported {
828 enum AbnormalityType {
829 UNKNOWN = 0;
830 SIGNIFICANT_INCREASE = 1;
831 SIGNIFICANT_DECREASE = 2;
832 SIMPLY_HIGH = 3;
833 }
834 enum FailureType {
835 FAILURE_UNKNOWN = 0;
836 FAILURE_CONNECTION = 1;
837 FAILURE_ASSOCIATION_REJECTION = 2;
838 FAILURE_ASSOCIATION_TIMEOUT = 3;
839 FAILURE_AUTHENTICATION = 4;
840 FAILURE_NON_LOCAL_DISCONNECTION = 5;
841 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
842 }
843 // Reason for uploading this stat
844 optional AbnormalityType abnormality_type = 1;
845 // The particular type of failure
846 optional FailureType failure_type = 2;
847 // How many times we have encountered this combination of AbnormalityType and FailureType
848 optional int32 failure_count = 3;
849}
850
851/**
852 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
853 *
854 * Logged from:
855 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
856 */
857message WifiConnectionResultReported {
858 enum FailureCode {
859 FAILURE_UNKNOWN = 0;
860 FAILURE_ASSOCIATION_TIMEOUT = 1;
861 FAILURE_ASSOCIATION_REJECTION = 2;
862 FAILURE_AUTHENTICATION_GENERAL = 3;
863 FAILURE_AUTHENTICATION_EAP = 4;
864 FAILURE_DHCP = 5;
865 FAILURE_NETWORK_DISCONNECTION = 6;
866 FAILURE_ROAM_TIMEOUT = 7;
867 }
868 // true represents a successful connection
869 optional bool connection_result = 1;
870 // reason for the connection failure
871 optional FailureCode failure_code = 2;
872 // scan rssi before the connection attempt
873 optional int32 rssi = 3;
874}
875
876/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700877 * Logs when memory stats of a process is reported.
878 *
879 * Logged from:
880 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
881 */
882message ProcessMemoryStatReported {
883 optional int32 uid = 1;
884 optional string process_name = 2;
885 optional string package_name = 3;
886 //TODO: remove this when validation is done
887 optional int64 version = 9;
888 optional int64 pss = 4;
889 optional int64 uss = 5;
890 optional int64 rss = 6;
891 enum Type {
892 ADD_PSS_INTERNAL_SINGLE = 0;
893 ADD_PSS_INTERNAL_ALL_MEM = 1;
894 ADD_PSS_INTERNAL_ALL_POLL = 2;
895 ADD_PSS_EXTERNAL = 3;
896 ADD_PSS_EXTERNAL_SLOW = 4;
897 }
898 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800899 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700900}
901
902/**
Bookatzc1a050a2017-10-10 15:49:28 -0700903 * Logs that a process started, finished, crashed, or ANRed.
904 *
905 * Logged from:
906 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
907 */
908message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700909 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700910
David Chen0b5c90c2018-01-25 16:51:49 -0800911 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800912 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
Bookatzddccf0a2017-11-28 16:48:14 -0800914 // What lifecycle state the process changed to.
915 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 enum State {
917 FINISHED = 0;
918 STARTED = 1;
919 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800920 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800921 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700922}
923
Bookatzc1a050a2017-10-10 15:49:28 -0700924/**
925 * Logs when the ble scan state changes.
926 *
927 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700928 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700929 */
930message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800931 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700932 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700933
934 enum State {
935 OFF = 0;
936 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700937 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
938 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700939 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800940 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700941 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800942 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700943 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800944 (state_field_option).nested = true
945 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700946
Bookatze5ec0b42018-03-26 13:34:56 -0700947 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700948 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700949 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700950 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700951 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700952 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700953}
954
955/**
956 * Logs reporting of a ble scan finding results.
957 *
958 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700959 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700960 */
Bookatzae6738e2018-09-13 11:38:56 -0700961// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700962message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800963 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700964
965 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800966 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700967}
968
969/**
970 * Logs when a sensor state changes.
971 *
972 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700973 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700974 */
975message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800976 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700977
Bookatzc1a050a2017-10-10 15:49:28 -0700978 // The id (int) of the sensor.
979 optional int32 sensor_id = 2;
980
981 enum State {
982 OFF = 0;
983 ON = 1;
984 }
985 optional State state = 3;
986}
987
Bookatzc1a050a2017-10-10 15:49:28 -0700988/**
989 * Logs when GPS state changes.
990 *
991 * Logged from:
992 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
993 */
994message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800995 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700996
997 enum State {
998 OFF = 0;
999 ON = 1;
1000 }
1001 optional State state = 2;
1002}
1003
Bookatz48d362e2018-11-06 15:49:08 -08001004/**
1005 * Logs when GPS signal quality.
1006 *
1007 * Logged from:
1008 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
1009 */
1010message GpsSignalQualityChanged {
1011 optional android.server.location.GpsSignalQualityEnum level = 1;
1012}
1013
Bookatzc1a050a2017-10-10 15:49:28 -07001014
1015/**
1016 * Logs when a sync manager sync state changes.
1017 *
1018 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001019 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001020 */
1021message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001022 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001023
David Chen0b5c90c2018-01-25 16:51:49 -08001024 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001025 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001026
1027 enum State {
1028 OFF = 0;
1029 ON = 1;
1030 }
1031 optional State state = 3;
1032}
1033
Yangster-mac96353002018-09-05 11:18:55 -07001034/*
1035 * Deferred job stats.
1036 *
1037 * Logged from:
1038 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
1039*/
1040message DeferredJobStatsReported {
1041 repeated AttributionNode attribution_node = 1;
1042
1043 // Number of jobs deferred.
1044 optional int32 num_jobs_deferred = 2;
1045
1046 // Time since the last job runs.
1047 optional int64 time_since_last_job_millis = 3;
1048}
1049
Bookatzc1a050a2017-10-10 15:49:28 -07001050/**
1051 * Logs when a job scheduler job state changes.
1052 *
1053 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001054 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001055 */
1056message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001057 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001058
1059 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001060 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001061
1062 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -08001063 FINISHED = 0;
1064 STARTED = 1;
1065 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001066 }
1067 optional State state = 3;
1068
Tej Singh33a412b2018-03-16 18:43:59 -07001069 // The reason a job has stopped.
1070 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001071 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001072 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001073
1074 // The standby bucket of the app that scheduled the job. These match the framework constants
1075 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1076 // already assigned 0.
1077 enum Bucket {
1078 UNKNOWN = -1;
1079 ACTIVE = 0;
1080 WORKING_SET = 1;
1081 FREQUENT = 2;
1082 RARE = 3;
1083 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001084 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001085 }
1086 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1087
1088 // The job id (as assigned by the app).
1089 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001090
1091 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1092 // constraints as they are always assumed to be set.
1093 optional bool has_charging_constraint = 7;
1094 optional bool has_battery_not_low_constraint = 8;
1095 optional bool has_storage_not_low_constraint = 9;
1096 optional bool has_timing_delay_constraint = 10;
1097 optional bool has_deadline_constraint = 11;
1098 optional bool has_idle_constraint = 12;
1099 optional bool has_connectivity_constraint = 13;
1100 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001101}
1102
1103/**
1104 * Logs when the audio state changes.
1105 *
1106 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001107 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001108 */
1109message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001110 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001111
1112 enum State {
1113 OFF = 0;
1114 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001115 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1116 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001117 }
1118 optional State state = 2;
1119}
1120
1121/**
1122 * Logs when the video codec state changes.
1123 *
1124 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001125 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001126 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001127message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001128 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001129
1130 enum State {
1131 OFF = 0;
1132 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001133 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1134 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001135 }
1136 optional State state = 2;
1137}
1138
1139/**
1140 * Logs when the flashlight state changes.
1141 *
1142 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001143 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001144 */
1145message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001146 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001147
1148 enum State {
1149 OFF = 0;
1150 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001151 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1152 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001153 }
1154 optional State state = 2;
1155}
1156
1157/**
1158 * Logs when the camera state changes.
1159 *
1160 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001161 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001162 */
1163message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001164 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001165
1166 enum State {
1167 OFF = 0;
1168 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001169 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1170 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001171 }
1172 optional State state = 2;
1173}
1174
1175/**
1176 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001177 *
1178 * Logged from:
1179 * TODO
1180 */
Bookatzd6746242017-10-24 18:39:35 -07001181message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001182 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001183 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001184
Bookatz1a1b0462018-01-12 11:47:03 -08001185 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1186 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001187 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001188
1189 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001190 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001191
1192 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001193 RELEASE = 0;
1194 ACQUIRE = 1;
1195 CHANGE_RELEASE = 2;
1196 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001197 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001198 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001199 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001200 (state_field_option).default_state_value = 0,
1201 (state_field_option).nested = true
1202 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001203}
1204
1205/**
Bookatzc1a050a2017-10-10 15:49:28 -07001206 * Logs when a partial wakelock is considered 'long' (over 1 min).
1207 *
1208 * Logged from:
1209 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1210 */
1211message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001212 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001213
Yao Chend54f9dd2017-10-17 17:37:48 +00001214 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1215 optional string tag = 2;
1216
Bookatzc1a050a2017-10-10 15:49:28 -07001217 // TODO: I have no idea what this is.
1218 optional string history_tag = 3;
1219
1220 enum State {
1221 OFF = 0;
1222 ON = 1;
1223 }
1224 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001225}
1226
Bookatzc1a050a2017-10-10 15:49:28 -07001227/**
Bookatza66083f2018-09-20 17:24:00 -07001228 * Logs when the device is interactive, according to the PowerManager Notifier.
1229 *
1230 * Logged from:
1231 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1232 */
1233message InteractiveStateChanged {
1234 enum State {
1235 OFF = 0;
1236 ON = 1;
1237 }
1238 optional State state = 1;
1239}
1240
1241/**
Bookatzc1a050a2017-10-10 15:49:28 -07001242 * Logs Battery Saver state change.
1243 *
1244 * Logged from:
1245 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1246 */
1247message BatterySaverModeStateChanged {
1248 enum State {
1249 OFF = 0;
1250 ON = 1;
1251 }
tsaichristine961d2fd2020-04-23 10:39:34 -07001252 optional State state = 1
1253 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001254}
1255
1256/**
1257 * Logs Doze mode state change.
1258 *
1259 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001260 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001261 */
1262message DeviceIdleModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001263 optional android.server.DeviceIdleModeEnum state = 1
1264 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzddccf0a2017-11-28 16:48:14 -08001265}
1266
1267
1268/**
1269 * Logs state change of Doze mode including maintenance windows.
1270 *
1271 * Logged from:
1272 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1273 */
1274message DeviceIdlingModeStateChanged {
tsaichristine961d2fd2020-04-23 10:39:34 -07001275 optional android.server.DeviceIdleModeEnum state = 1
1276 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatzc1a050a2017-10-10 15:49:28 -07001277}
1278
1279/**
1280 * Logs screen brightness level.
1281 *
1282 * Logged from:
1283 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1284 */
1285message ScreenBrightnessChanged {
1286 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1287 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001288}
1289
1290/**
1291 * Logs battery level (percent full, from 0 to 100).
1292 *
1293 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001295 */
1296message BatteryLevelChanged {
1297 // Battery level. Should be in [0, 100].
1298 optional int32 battery_level = 1;
1299}
1300
1301/**
1302 * Logs change in charging status of the device.
1303 *
1304 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001305 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001306 */
1307message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001308 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
Kweku Adams301f7542020-05-13 13:10:34 -07001309 optional android.os.BatteryStatusEnum state = 1
1310 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001311}
1312
1313/**
1314 * Logs whether the device is plugged in, and what power source it is using.
1315 *
1316 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001317 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001318 */
1319message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001320 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
tsaichristine961d2fd2020-04-23 10:39:34 -07001321 optional android.os.BatteryPluggedStateEnum state = 1
1322 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Bookatz8c6571b2017-10-24 15:04:41 -07001323}
1324
Bookatz8c6571b2017-10-24 15:04:41 -07001325/**
1326 * Logs when an app's wakeup alarm fires.
1327 *
1328 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001329 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001330 */
1331message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001332 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001333
1334 // Name of the wakeup alarm.
1335 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001336
1337 // Name of source package (for historical reasons, since BatteryStats tracked it).
1338 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001339
Ben Murdoch3389f1522019-05-21 15:05:34 +01001340 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001341 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001342}
1343
1344/**
1345 * Logs when an an app causes the mobile radio to change state.
1346 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1347 *
1348 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001349 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001350 */
1351message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001352 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001353
Bookatz1a1b0462018-01-12 11:47:03 -08001354 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1355 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001356}
1357
1358/**
1359 * Logs when an an app causes the wifi radio to change state.
1360 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1361 *
1362 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001363 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001364 */
1365message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001366 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001367
Bookatz1a1b0462018-01-12 11:47:03 -08001368 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1369 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001370}
1371
1372/**
1373 * Logs kernel wakeup reasons and aborts.
1374 *
1375 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001376 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001377 */
1378message KernelWakeupReported {
1379 // Name of the kernel wakeup reason (or abort).
1380 optional string wakeup_reason_name = 1;
1381
1382 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001383 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001384}
1385
1386/**
Bookatzda1798c2018-12-13 14:16:00 -08001387 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001388 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001389 *
1390 * Logged from:
1391 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1392 */
1393message WifiEnabledStateChanged {
1394 enum State {
1395 OFF = 0;
1396 ON = 1;
1397 }
1398 optional State state = 1;
1399}
1400
1401/**
tsaichristinececebdc2020-02-04 14:05:56 -08001402 * This atom is deprecated starting in R.
1403 *
Bookatzda1798c2018-12-13 14:16:00 -08001404 * 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 -08001405 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1406 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001407 *
1408 * Logged from:
1409 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1410 */
1411message WifiRunningStateChanged {
1412 repeated AttributionNode attribution_node = 1;
1413
1414 enum State {
1415 OFF = 0;
1416 ON = 1;
1417 }
1418 optional State state = 2;
1419}
1420
1421/**
Bookatze5885242017-10-24 20:10:31 -07001422 * Logs wifi locks held by an app.
1423 *
1424 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001425 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001426 */
1427message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001428 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001429
1430 enum State {
1431 OFF = 0;
1432 ON = 1;
1433 }
1434 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001435
1436 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1437 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001438}
1439
1440/**
1441 * Logs wifi signal strength changes.
1442 *
1443 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001444 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001445 */
1446message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001447 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1448 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001449}
1450
1451/**
1452 * Logs wifi scans performed by an app.
1453 *
1454 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001455 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001456 */
1457message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001458 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001459
1460 enum State {
1461 OFF = 0;
1462 ON = 1;
1463 }
1464 optional State state = 2;
1465}
1466
1467/**
Tej Singh4503e102018-01-04 14:35:01 -08001468 * Logs wifi multicast locks held by an app
1469 *
1470 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001471 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001472 */
1473message WifiMulticastLockStateChanged {
1474 repeated AttributionNode attribution_node = 1;
1475
1476 enum State {
1477 OFF = 0;
1478 ON = 1;
1479 }
1480 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001481
1482 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001483}
1484
1485/**
Tej Singh1ea42892018-01-19 09:27:00 -08001486 * Logs shutdown reason and duration on next boot.
1487 *
1488 * Logged from:
1489 * frameworks/base/core/java/com/android/server/BootReceiver.java
1490 */
1491message ShutdownSequenceReported {
1492 // True if shutdown is for a reboot. Default: false if we do not know.
1493 optional bool reboot = 1;
1494
1495 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1496 optional string reason = 2;
1497
1498 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1499 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001500 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001501
1502 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001503 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001504}
1505
Tej Singh6483ea42018-01-25 17:45:49 -08001506
1507/**
1508 * Logs boot reason and duration.
1509 *
1510 * Logged from:
1511 * system/core/bootstat/bootstat.cpp
1512 */
1513message BootSequenceReported {
1514 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1515 // Default: "<EMPTY>" if not available.
1516 optional string bootloader_reason = 1;
1517
1518 // Reason for system boot. Eg. bootloader, reboot,userrequested
1519 // Default: "<EMPTY>" if not available.
1520 optional string system_reason = 2;
1521
1522 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001523 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001524
1525 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001526 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001527
1528 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001529 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001530
1531 // Time since last boot in ms. Default: 0 if not available.
1532 optional int64 time_since_last_boot = 6;
1533}
1534
Tej Singhc477d9c2018-02-05 18:31:39 -08001535
1536/**
1537 * Logs call state and disconnect cause (if applicable).
1538 *
1539 * Logged from:
1540 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1541 */
1542message CallStateChanged {
1543 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1544 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1545 optional android.telecom.CallStateEnum call_state = 1;
1546
1547 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1548 // This value is only applicable when the call_state is DISCONNECTED, and
1549 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1550 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1551 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1552
1553 // True if the call is self-managed, which are apps that use the
1554 // telecom infrastructure to make their own calls.
1555 optional bool self_managed = 3;
1556
1557 // True if call is external. External calls are calls on connected Wear
1558 // devices but show up in Telecom so the user can pull them onto the device.
1559 optional bool external_call = 4;
1560}
1561
Tej Singh1ea42892018-01-19 09:27:00 -08001562/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001563 * Logs keyguard state. The keyguard is the lock screen.
1564 *
1565 * Logged from:
1566 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1567 */
1568message KeyguardStateChanged {
1569 enum State {
1570 UNKNOWN = 0;
1571 // The keyguard is hidden when the phone is unlocked.
1572 HIDDEN = 1;
1573 // The keyguard is shown when the phone is locked (screen turns off).
1574 SHOWN= 2;
1575 // The keyguard is occluded when something is overlaying the keyguard.
1576 // Eg. Opening the camera while on the lock screen.
1577 OCCLUDED = 3;
1578 }
1579 optional State state = 1;
1580}
1581
1582/**
1583 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1584 * prompts the user to enter a password (pattern, pin, etc).
1585 *
1586 * Logged from:
1587 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1588 */
1589
1590message KeyguardBouncerStateChanged {
1591 enum State {
1592 UNKNOWN = 0;
1593 // Bouncer is hidden, either as a result of successfully entering the
1594 // password, screen timing out, or user going back to lock screen.
1595 HIDDEN = 1;
1596 // This is when the user is being prompted to enter the password.
1597 SHOWN = 2;
1598 }
1599 optional State state = 1;
1600}
1601
1602/**
1603 * Logs the result of entering a password into the keyguard bouncer.
1604 *
1605 * Logged from:
1606 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1607 */
1608message KeyguardBouncerPasswordEntered {
1609 enum BouncerResult {
1610 UNKNOWN = 0;
1611 // The password entered was incorrect.
1612 FAILURE = 1;
1613 // The password entered was correct.
1614 SUCCESS = 2;
1615 }
1616 optional BouncerResult result = 1;
1617}
1618
Tej Singha883b372018-02-15 11:30:01 -08001619/*
1620 * Logs changes to the configuration of the device. The configuration is defined
1621 * in frameworks/base/core/java/android/content/res/Configuration.java
1622 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1623 * Please go there to interpret the possible values each field can be.
1624 *
1625 * Logged from:
1626 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1627 */
1628message ResourceConfigurationChanged {
1629 // Bit mask of color capabilities of the screen.
1630 // Contains information about the color gamut and hdr mode of the screen.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001632 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001633
1634 // The target screen density being rendered to.
1635 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001636 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001637
1638 // Current user preference for the scaling factor for fonts,
1639 // relative to the base density scaling.
1640 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001641 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001642
1643 // Flag indicating whether the hard keyboard is hidden.
1644 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001645 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001646
1647 // The type of keyboard attached to the device.
1648 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1649 optional int32 keyboard = 5;
1650
1651 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1652 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001653 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001654
1655 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1656 // 0 if undefined.
1657 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1658 optional int32 mcc = 7;
1659
1660 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1661 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1662 // MNC_ZERO symbol defined in Configuration.java.
1663 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1664 optional int32 mnc = 8;
1665
1666 // The kind of navigation available on the device.
1667 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1668 optional int32 navigation = 9;
1669
1670 // Flag indicating whether the navigation is available.
1671 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001672 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001673
1674 // Overall orientation of the screen.
1675 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1676 optional int32 orientation = 11;
1677
1678 // The current height of the available screen space, in dp units.
1679 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001680 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001681
1682 // Bit mask of overall layout of the screen.
1683 // Contains information about screen size, whether the screen is wider/taller
1684 // than normal, whether the screen layout is right-tl-left or left-to-right,
1685 // and whether the screen has a rounded shape.
1686 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001687 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001688
1689 // Current width of the available screen space, in dp units.
1690 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001691 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001692
1693 // The smallest screen size an application will see in normal operation.
1694 // This is the smallest value of both screenWidthDp and screenHeightDp
1695 // in portrait and landscape.
1696 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001697 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001698
1699 // The type of touch screen attached to the device.
1700 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1701 optional int32 touchscreen = 16;
1702
1703 // Bit mask of the ui mode.
1704 // Contains information about the overall ui mode of the device.
1705 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1706 // Also contains information about whether the device is in night mode.
1707 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001708 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001709}
1710
Tej Singheee317b2018-03-07 19:28:05 -08001711
1712/**
1713 * Logs changes in the connection state of the mobile radio.
1714 *
1715 * Logged from:
1716 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1717 */
1718message MobileConnectionStateChanged {
1719 // States are from the state machine DataConnection.java.
1720 enum State {
1721 UNKNOWN = 0;
1722 // The connection is inactive, or disconnected.
1723 INACTIVE = 1;
1724 // The connection is being activated, or connecting.
1725 ACTIVATING = 2;
1726 // The connection is active, or connected.
1727 ACTIVE = 3;
1728 // The connection is disconnecting.
1729 DISCONNECTING = 4;
1730 // The connection is disconnecting after creating a connection.
1731 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1732 }
1733 optional State state = 1;
1734 // For multi-sim phones, this distinguishes between the sim cards.
1735 optional int32 sim_slot_index = 2;
1736 // Used to identify the connection. Starts at 0 and increments by 1 for
1737 // every new network created. Resets whenever the device reboots.
1738 optional int32 data_connection_id = 3;
1739 // A bitmask for the capabilities of this connection.
1740 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1741 // Default value (if we have no information): 0
1742 optional int64 capabilities = 4;
1743 // If this connection has internet.
1744 // This just checks if the DEFAULT bit of capabilities is set.
1745 optional bool has_internet = 5;
1746}
1747
1748/**
1749 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1750 *
1751 * Logged from:
1752 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1753 */
1754message MobileRadioTechnologyChanged {
1755 optional android.telephony.NetworkTypeEnum state = 1;
1756 // For multi-sim phones, this distinguishes between the sim cards.
1757 optional int32 sim_slot_index = 2;
1758}
1759
Andrew Chantb56388b2018-03-22 21:07:33 -07001760/**
1761 * Logs the VID and PID of any connected USB devices.
1762 *
1763 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1764 *
1765 * Logged by Vendor.
1766 */
1767message UsbDeviceAttached {
1768 optional int32 vid = 1;
1769 optional int32 pid = 2;
1770 optional bool has_audio = 3;
1771 optional bool has_hid = 4;
1772 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001773 enum State {
1774 STATE_DISCONNECTED = 0;
1775 STATE_CONNECTED = 1;
1776 }
1777 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001778 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001779}
1780
Tej Singheee317b2018-03-07 19:28:05 -08001781
Tej Singhdd7bd352018-02-09 19:33:15 -08001782/**
Tej Singh5d991e12018-03-09 19:48:11 -08001783 * Logs when Bluetooth is enabled and disabled.
1784 *
1785 * Logged from:
1786 * services/core/java/com/android/server/BluetoothManagerService.java
1787 */
1788message BluetoothEnabledStateChanged {
1789 repeated AttributionNode attribution_node = 1;
1790 // Whether or not bluetooth is enabled on the device.
1791 enum State {
1792 UNKNOWN = 0;
1793 ENABLED = 1;
1794 DISABLED = 2;
1795 }
1796 optional State state = 2;
1797 // The reason for being enabled/disabled.
1798 // Eg. Airplane mode, crash, application request.
1799 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1800 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001801 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001802}
1803
1804/**
Jack Hed9837c82019-01-09 01:19:13 -08001805 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001806 *
1807 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001808 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1809 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001810 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001811 */
1812message BluetoothConnectionStateChanged {
1813 // The state of the connection.
1814 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1815 optional android.bluetooth.ConnectionStateEnum state = 1;
1816 // An identifier that can be used to match connect and disconnect events.
1817 // Currently is last two bytes of a hash of a device level ID and
1818 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001819 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001820 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001821 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1822 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001823 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001824 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001825 // An identifier that can be used to match events for this device.
1826 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1827 // Salt: Randomly generated 256 bit value
1828 // Hash algorithm: HMAC-SHA256
1829 // Size: 32 byte
1830 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001831 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001832 // An identifier that can be used to match events for this device.
1833 // The incremental identifier is locally generated and guaranteed not derived
1834 // from any globally unique hardware id.
1835 // For paired devices, it stays consistent between Bluetooth toggling for the
1836 // same remote device.
1837 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1838 // session for the same remote device.
1839 // Default: 0 if the device's metric id is unknown.
1840 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001841}
1842
1843/**
1844 * Logs when a Bluetooth device connects and disconnects over ACL
1845 *
1846 * Logged from:
1847 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1848 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001849 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001850 */
1851message BluetoothAclConnectionStateChanged {
1852 // An identifier that can be used to match events for this device.
1853 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1854 // Salt: Randomly generated 256 bit value
1855 // Hash algorithm: HMAC-SHA256
1856 // Size: 32 byte
1857 // Default: null or empty if the device identifier is not known
1858 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1859 // The state of the connection.
1860 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1861 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001862 // An identifier that can be used to match events for this device.
1863 // The incremental identifier is locally generated and guaranteed not derived
1864 // from any globally unique hardware id.
1865 // For paired devices, it stays consistent between Bluetooth toggling for the
1866 // same remote device.
1867 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1868 // session for the same remote device.
1869 // Default: 0 if the device's metric id is unknown.
1870 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001871}
1872
1873/**
1874 * Logs when a Bluetooth device connects and disconnects over SCO
1875 *
1876 * Logged from:
1877 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1878 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1879 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001880 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001881 */
1882message BluetoothScoConnectionStateChanged {
1883 // An identifier that can be used to match events for this device.
1884 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1885 // Salt: Randomly generated 256 bit value
1886 // Hash algorithm: HMAC-SHA256
1887 // Size: 32 byte
1888 // Default: null or empty if the device identifier is not known
1889 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1890 // The state of the connection.
1891 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1892 optional android.bluetooth.ConnectionStateEnum state = 2;
1893 // Codec used for this SCO connection
1894 // Default: UNKNOWN
1895 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001896 // An identifier that can be used to match events for this device.
1897 // The incremental identifier is locally generated and guaranteed not derived
1898 // from any globally unique hardware id.
1899 // For paired devices, it stays consistent between Bluetooth toggling for the
1900 // same remote device.
1901 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1902 // session for the same remote device.
1903 // Default: 0 if the device's metric id is unknown.
1904 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001905}
1906
Jack Hec27040a2019-01-09 20:54:41 -08001907/**
1908 * Logged when active device of a profile changes
1909 *
1910 * Logged from:
1911 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1912 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1913 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1914 */
1915message BluetoothActiveDeviceChanged {
1916 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1917 // From android.bluetooth.BluetoothProfile
1918 optional int32 bt_profile = 1;
1919 // An identifier that can be used to match events for this new active device.
1920 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1921 // Salt: Randomly generated 256 bit value
1922 // Hash algorithm: HMAC-SHA256
1923 // Size: 32 byte
1924 // Default: null or empty if there is no active device for this profile
1925 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001926 // An identifier that can be used to match events for this device.
1927 // The incremental identifier is locally generated and guaranteed not derived
1928 // from any globally unique hardware id.
1929 // For paired devices, it stays consistent between Bluetooth toggling for the
1930 // same remote device.
1931 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1932 // session for the same remote device.
1933 // Default: 0 if the device's metric id is unknown.
1934 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001935}
1936
Jack Heab86dbd22018-12-18 15:43:27 -08001937// Logs when there is an event affecting Bluetooth device's link layer connection.
1938// - This event is triggered when there is a related HCI command or event
1939// - Users of this metrics can deduce Bluetooth device's connection state from these events
1940// - HCI commands are logged before the command is sent, after receiving command status, and after
1941// receiving command complete
1942// - HCI events are logged when they arrive
1943//
1944// Low level log from system/bt
1945//
1946// Bluetooth classic commands:
1947// - CMD_CREATE_CONNECTION
1948// - CMD_DISCONNECT
1949// - CMD_CREATE_CONNECTION_CANCEL
1950// - CMD_ACCEPT_CONNECTION_REQUEST
1951// - CMD_REJECT_CONNECTION_REQUEST
1952// - CMD_SETUP_ESCO_CONNECTION
1953// - CMD_ACCEPT_ESCO_CONNECTION
1954// - CMD_REJECT_ESCO_CONNECTION
1955// - CMD_ENH_SETUP_ESCO_CONNECTION
1956// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1957//
1958// Bluetooth low energy commands:
1959// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1960// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1961// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1962// - CMD_BLE_CLEAR_WHITE_LIST
1963// - CMD_BLE_ADD_WHITE_LIST
1964// - CMD_BLE_REMOVE_WHITE_LIST
1965//
1966// Bluetooth classic events:
1967// - EVT_CONNECTION_COMP
1968// - EVT_CONNECTION_REQUEST
1969// - EVT_DISCONNECTION_COMP
1970// - EVT_ESCO_CONNECTION_COMP
1971// - EVT_ESCO_CONNECTION_CHANGED
1972//
1973// Bluetooth low energy meta events:
1974// - BLE_EVT_CONN_COMPLETE_EVT
1975// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1976//
1977// Next tag: 10
1978message BluetoothLinkLayerConnectionEvent {
1979 // An identifier that can be used to match events for this device.
1980 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1981 // Salt: Randomly generated 256 bit value
1982 // Hash algorithm: HMAC-SHA256
1983 // Size: 32 byte
1984 // Default: null or empty if the device identifier is not known
1985 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1986 // Connection handle of this connection if available
1987 // Range: 0x0000 - 0x0EFF (12 bits)
1988 // Default: 0xFFFF if the handle is unknown
1989 optional int32 connection_handle = 2;
1990 // Direction of the link
1991 // Default: DIRECTION_UNKNOWN
1992 optional android.bluetooth.DirectionEnum direction = 3;
1993 // Type of this link
1994 // Default: LINK_TYPE_UNKNOWN
1995 optional android.bluetooth.LinkTypeEnum type = 4;
1996
1997 // Reason metadata for this link layer connection event, rules for interpretation:
1998 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1999 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
2000 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
2001 // set and valid, ignore hci_ble_event
2002
2003 // HCI command associated with this event
2004 // Default: CMD_UNKNOWN
2005 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
2006 // HCI event associated with this event
2007 // Default: EVT_UNKNOWN
2008 optional android.bluetooth.hci.EventEnum hci_event = 6;
2009 // HCI BLE meta event associated with this event
2010 // Default: BLE_EVT_UNKNOWN
2011 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
2012 // HCI command status code if this is triggerred by hci_cmd
2013 // Default: STATUS_UNKNOWN
2014 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
2015 // HCI reason code associated with this event
2016 // Default: STATUS_UNKNOWN
2017 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002018 // An identifier that can be used to match events for this device.
2019 // The incremental identifier is locally generated and guaranteed not derived
2020 // from any globally unique hardware id.
2021 // For paired devices, it stays consistent between Bluetooth toggling for the
2022 // same remote device.
2023 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2024 // session for the same remote device.
2025 // Default: 0 if the device's metric id is unknown.
2026 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08002027}
2028
Howard Roe103fe22019-01-17 16:52:16 -08002029/**
2030 * Logs when a module is rolled back by Watchdog.
2031 *
2032 * Logged from: Rollback Manager
2033 */
2034message WatchdogRollbackOccurred {
2035 enum RollbackType {
2036 UNKNOWN = 0;
2037 ROLLBACK_INITIATE = 1;
2038 ROLLBACK_SUCCESS = 2;
2039 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08002040 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08002041 }
2042 optional RollbackType rollback_type = 1;
2043
2044 optional string package_name = 2;
2045
2046 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002047
2048 enum RollbackReasonType {
2049 REASON_UNKNOWN = 0;
2050 REASON_NATIVE_CRASH = 1;
2051 REASON_EXPLICIT_HEALTH_CHECK = 2;
2052 REASON_APP_CRASH = 3;
2053 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00002054 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00002055 }
2056 optional RollbackReasonType rollback_reason = 4;
2057
2058 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
2059 // is initiated. Empty if the package is unknown.
2060 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08002061
2062 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08002063}
2064
Jack Hec27040a2019-01-09 20:54:41 -08002065/**
2066 * Logs when there is a change in Bluetooth A2DP playback state
2067 *
2068 * Logged from:
2069 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2070 */
2071message BluetoothA2dpPlaybackStateChanged {
2072 // An identifier that can be used to match events for this device.
2073 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2074 // Salt: Randomly generated 256 bit value
2075 // Hash algorithm: HMAC-SHA256
2076 // Size: 32 byte
2077 // Default: null or empty if the device identifier is not known
2078 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2079 // Current playback state
2080 // Default: PLAYBACK_STATE_UNKNOWN
2081 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2082 // Current audio coding mode
2083 // Default: AUDIO_CODING_MODE_UNKNOWN
2084 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002085 // An identifier that can be used to match events for this device.
2086 // The incremental identifier is locally generated and guaranteed not derived
2087 // from any globally unique hardware id.
2088 // For paired devices, it stays consistent between Bluetooth toggling for the
2089 // same remote device.
2090 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2091 // session for the same remote device.
2092 // Default: 0 if the device's metric id is unknown.
2093 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002094}
2095
2096/**
2097 * Logs when there is a change in A2DP codec config for a particular remote device
2098 *
2099 * Logged from:
2100 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2101 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2102 */
2103message BluetoothA2dpCodecConfigChanged {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 // Size: 32 byte
2109 // Default: null or empty if the device identifier is not known
2110 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2111 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2112 // Default SOURCE_CODEC_TYPE_INVALID
2113 optional int32 codec_type = 2;
2114 // Codec priroity, the higher the more preferred, -1 for disabled
2115 // Default: CODEC_PRIORITY_DEFAULT
2116 optional int32 codec_priority = 3;
2117 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2118 // Default: SAMPLE_RATE_NONE
2119 optional int32 sample_rate = 4;
2120 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2121 // Default: BITS_PER_SAMPLE_NONE
2122 optional int32 bits_per_sample = 5;
2123 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2124 // Default: CHANNEL_MODE_NONE
2125 optional int32 channel_mode = 6;
2126 // Codec specific values
2127 // Default 0
2128 optional int64 codec_specific_1 = 7;
2129 optional int64 codec_specific_2 = 8;
2130 optional int64 codec_specific_3 = 9;
2131 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002132 // An identifier that can be used to match events for this device.
2133 // The incremental identifier is locally generated and guaranteed not derived
2134 // from any globally unique hardware id.
2135 // For paired devices, it stays consistent between Bluetooth toggling for the
2136 // same remote device.
2137 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2138 // session for the same remote device.
2139 // Default: 0 if the device's metric id is unknown.
2140 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002141}
2142
2143/**
2144 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2145 * Each codec's capability is logged separately due to statsd restriction
2146 *
2147 * Logged from:
2148 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2149 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2150 */
2151message BluetoothA2dpCodecCapabilityChanged {
2152 // An identifier that can be used to match events for this device.
2153 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2154 // Salt: Randomly generated 256 bit value
2155 // Hash algorithm: HMAC-SHA256
2156 // Size: 32 byte
2157 // Default: null or empty if the device identifier is not known
2158 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2159 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2160 // Default SOURCE_CODEC_TYPE_INVALID
2161 optional int32 codec_type = 2;
2162 // Codec priroity, the higher the more preferred, -1 for disabled
2163 // Default: CODEC_PRIORITY_DEFAULT
2164 optional int32 codec_priority = 3;
2165 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2166 // in BluetoothCodecConfig
2167 // Default: empty and SAMPLE_RATE_NONE for individual item
2168 optional int32 sample_rate = 4;
2169 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2170 // in BluetoothCodecConfig
2171 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2172 optional int32 bits_per_sample = 5;
2173 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2174 // BluetoothCodecConfig
2175 // Default: empty and CHANNEL_MODE_NONE for individual item
2176 optional int32 channel_mode = 6;
2177 // Codec specific values
2178 // Default 0
2179 optional int64 codec_specific_1 = 7;
2180 optional int64 codec_specific_2 = 8;
2181 optional int64 codec_specific_3 = 9;
2182 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002183 // An identifier that can be used to match events for this device.
2184 // The incremental identifier is locally generated and guaranteed not derived
2185 // from any globally unique hardware id.
2186 // For paired devices, it stays consistent between Bluetooth toggling for the
2187 // same remote device.
2188 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2189 // session for the same remote device.
2190 // Default: 0 if the device's metric id is unknown.
2191 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002192}
2193
2194/**
2195 * Logs when A2DP failed to read from PCM source.
2196 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2197 *
2198 * Logged from:
2199 * system/bt
2200 */
2201message BluetoothA2dpAudioUnderrunReported {
2202 // An identifier that can be used to match events for this device.
2203 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2204 // Salt: Randomly generated 256 bit value
2205 // Hash algorithm: HMAC-SHA256
2206 // Size: 32 byte
2207 // Default: null or empty if the device identifier is not known
2208 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2209 // Encoding interval in nanoseconds
2210 // Default: 0
2211 optional int64 encoding_interval_nanos = 2;
2212 // Number of bytes of PCM data that could not be read from the source
2213 // Default: 0
2214 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002215 // An identifier that can be used to match events for this device.
2216 // The incremental identifier is locally generated and guaranteed not derived
2217 // from any globally unique hardware id.
2218 // For paired devices, it stays consistent between Bluetooth toggling for the
2219 // same remote device.
2220 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2221 // session for the same remote device.
2222 // Default: 0 if the device's metric id is unknown.
2223 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002224}
2225
2226/**
2227 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2228 * buffer queue is full and we have to drop data
2229 *
2230 * Logged from:
2231 * system/bt
2232 */
2233message BluetoothA2dpAudioOverrunReported {
2234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
2239 // Default: null or empty if the device identifier is not known
2240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2241 // Encoding interval in nanoseconds
2242 // Default: 0
2243 optional int64 encoding_interval_nanos = 2;
2244 // Number of buffers dropped in this event
2245 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2246 // Default: 0
2247 optional int32 num_dropped_buffers = 3;
2248 // Number of encoded buffers dropped in this event
2249 // Default 0
2250 optional int32 num_dropped_encoded_frames = 4;
2251 // Number of encoded bytes dropped in this event
2252 // Default: 0
2253 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002254 // An identifier that can be used to match events for this device.
2255 // The incremental identifier is locally generated and guaranteed not derived
2256 // from any globally unique hardware id.
2257 // For paired devices, it stays consistent between Bluetooth toggling for the
2258 // same remote device.
2259 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2260 // session for the same remote device.
2261 // Default: 0 if the device's metric id is unknown.
2262 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002263}
2264
2265/**
2266 * Logs when we receive reports regarding a device's RSSI value
2267 *
2268 * Logged from:
2269 * system/bt
2270 */
2271message BluetoothDeviceRssiReported {
2272 // An identifier that can be used to match events for this device.
2273 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2274 // Salt: Randomly generated 256 bit value
2275 // Hash algorithm: HMAC-SHA256
2276 // Size: 32 byte
2277 // Default: null or empty if the device identifier is not known
2278 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2279 // Connection handle of this connection if available
2280 // Range: 0x0000 - 0x0EFF (12 bits)
2281 // Default: 0xFFFF if the handle is unknown
2282 optional int32 connection_handle = 2;
2283 // HCI command status code if this is triggerred by hci_cmd
2284 // Default: STATUS_UNKNOWN
2285 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2286 // BR/EDR
2287 // Range: -128 ≤ N ≤ 127 (signed integer)
2288 // Units: dB
2289 // LE:
2290 // Range: -127 to 20, 127 (signed integer)
2291 // Units: dBm
2292 // Invalid when an out of range value is reported
2293 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002294 // An identifier that can be used to match events for this device.
2295 // The incremental identifier is locally generated and guaranteed not derived
2296 // from any globally unique hardware id.
2297 // For paired devices, it stays consistent between Bluetooth toggling for the
2298 // same remote device.
2299 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2300 // session for the same remote device.
2301 // Default: 0 if the device's metric id is unknown.
2302 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002303}
2304
2305/**
2306 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2307 *
2308 * Logged from:
2309 * system/bt
2310 */
2311message BluetoothDeviceFailedContactCounterReported {
2312 // An identifier that can be used to match events for this device.
2313 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2314 // Salt: Randomly generated 256 bit value
2315 // Hash algorithm: HMAC-SHA256
2316 // Size: 32 byte
2317 // Default: null or empty if the device identifier is not known
2318 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2319 // Connection handle of this connection if available
2320 // Range: 0x0000 - 0x0EFF (12 bits)
2321 // Default: 0xFFFF if the handle is unknown
2322 optional int32 connection_handle = 2;
2323 // HCI command status code if this is triggerred by hci_cmd
2324 // Default: STATUS_UNKNOWN
2325 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2326 // Number of consecutive failed contacts for a connection corresponding to the Handle
2327 // Range: uint16_t, 0-0xFFFF
2328 // Default: 0xFFFFF
2329 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002330 // An identifier that can be used to match events for this device.
2331 // The incremental identifier is locally generated and guaranteed not derived
2332 // from any globally unique hardware id.
2333 // For paired devices, it stays consistent between Bluetooth toggling for the
2334 // same remote device.
2335 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2336 // session for the same remote device.
2337 // Default: 0 if the device's metric id is unknown.
2338 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002339}
2340
2341/**
2342 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2343 *
2344 * Logged from:
2345 * system/bt
2346 */
2347message BluetoothDeviceTxPowerLevelReported {
2348 // An identifier that can be used to match events for this device.
2349 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2350 // Salt: Randomly generated 256 bit value
2351 // Hash algorithm: HMAC-SHA256
2352 // Size: 32 byte
2353 // Default: null or empty if the device identifier is not known
2354 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2355 // Connection handle of this connection if available
2356 // Range: 0x0000 - 0x0EFF (12 bits)
2357 // Default: 0xFFFF if the handle is unknown
2358 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002359 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002360 // Default: STATUS_UNKNOWN
2361 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2362 // Range: -30 ≤ N ≤ 20
2363 // Units: dBm
2364 // Invalid when an out of range value is reported
2365 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002366 // An identifier that can be used to match events for this device.
2367 // The incremental identifier is locally generated and guaranteed not derived
2368 // from any globally unique hardware id.
2369 // For paired devices, it stays consistent between Bluetooth toggling for the
2370 // same remote device.
2371 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2372 // session for the same remote device.
2373 // Default: 0 if the device's metric id is unknown.
2374 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002375}
Jack Heab86dbd22018-12-18 15:43:27 -08002376
Tej Singh5d991e12018-03-09 19:48:11 -08002377/**
Jack He1021a612019-01-20 21:22:46 -08002378 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2379 * receiving an HCI command from the host
2380 *
2381 * Logged from: system/bt
2382 */
2383message BluetoothHciTimeoutReported {
2384 // HCI command associated with this event
2385 // Default: CMD_UNKNOWN
2386 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2387}
2388
2389/**
2390 * Logs when we receive Bluetooth Link Quality Report event from the controller
2391 * See Android Bluetooth HCI specification for more details
2392 *
2393 * Note: all count and bytes field are counted since last event
2394 *
2395 * Logged from: system/bt
2396 */
2397message BluetoothQualityReportReported {
2398 // Quality report ID
2399 // Original type: uint8_t
2400 // Default: BQR_ID_UNKNOWN
2401 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2402 // Packet type of the connection
2403 // Original type: uint8_t
2404 // Default: BQR_PACKET_TYPE_UNKNOWN
2405 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2406 // Connection handle of the connection
2407 // Original type: uint16_t
2408 optional int32 connection_handle = 3;
2409 // Performing Role for the connection
2410 // Original type: uint8_t
2411 optional int32 connection_role = 4;
2412 // Current Transmit Power Level for the connection. This value is the same as the controller's
2413 // response to the HCI_Read_Transmit_Power_Level HCI command
2414 // Original type: uint8_t
2415 optional int32 tx_power_level = 5;
2416 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2417 // absolute receiver signal strength value
2418 // Original type: int8_t
2419 optional int32 rssi = 6;
2420 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2421 // channels used by the link currently
2422 // Original type: uint8_t
2423 optional int32 snr = 7;
2424 // Indicates the number of unused channels in AFH_channel_map
2425 // Original type: uint8_t
2426 optional int32 unused_afh_channel_count = 8;
2427 // Indicates the number of the channels which are interfered and quality is bad but are still
2428 // selected for AFH
2429 // Original type: uint8_t
2430 optional int32 afh_select_unideal_channel_count = 9;
2431 // Current Link Supervision Timeout Setting
2432 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2433 // Original type: uint16_t
2434 optional int32 lsto = 10;
2435 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2436 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2437 // 0x01 (Piconet Clock)
2438 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2439 // Original type: uint32_t
2440 optional int64 connection_piconet_clock = 11;
2441 // The count of retransmission
2442 // Original type: uint32_t
2443 optional int64 retransmission_count = 12;
2444 // The count of no RX
2445 // Original type: uint32_t
2446 optional int64 no_rx_count = 13;
2447 // The count of NAK (Negative Acknowledge)
2448 // Original type: uint32_t
2449 optional int64 nak_count = 14;
2450 // Controller timestamp of last TX ACK
2451 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2452 // Original type: uint32_t
2453 optional int64 last_tx_ack_timestamp = 15;
2454 // The count of Flow-off (STOP)
2455 // Original type: uint32_t
2456 optional int64 flow_off_count = 16;
2457 // Controller timestamp of last Flow-on (GO)
2458 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2459 // Original type: uint32_t
2460 optional int64 last_flow_on_timestamp = 17;
2461 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2462 // Original type: uint32_t
2463 optional int64 buffer_overflow_bytes = 18;
2464 // Buffer underflow count (in byte) since last event
2465 // Original type: uint32_t
2466 optional int64 buffer_underflow_bytes = 19;
2467}
2468
2469/**
2470 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2471 *
2472 * Notes:
2473 * - Each event can be partially filled as we might learn different pieces of device
2474 * information at different time
2475 * - Multiple device info events can be combined to give more complete picture
2476 * - When multiple device info events tries to describe the same information, the
2477 * later one wins
2478 *
2479 * Logged from:
2480 * packages/apps/Bluetooth
2481 */
Jack Heaea26982019-04-04 11:19:48 -07002482message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002483 // An identifier that can be used to match events for this device.
2484 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2485 // Salt: Randomly generated 256 bit value
2486 // Hash algorithm: HMAC-SHA256
2487 // Size: 32 byte
2488 // Default: null or empty if the device identifier is not known
2489 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2490 // Where is this device info obtained from
2491 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2492 // Name of the data source
2493 // For EXTERNAL: package name of the data source
2494 // For INTERNAL: null for general case, component name otherwise
2495 optional string source_name = 3;
2496 // Name of the manufacturer of this device
2497 optional string manufacturer = 4;
2498 // Model of this device
2499 optional string model = 5;
2500 // Hardware version of this device
2501 optional string hardware_version = 6;
2502 // Software version of this device
2503 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002504 // An identifier that can be used to match events for this device.
2505 // The incremental identifier is locally generated and guaranteed not derived
2506 // from any globally unique hardware id.
2507 // For paired devices, it stays consistent between Bluetooth toggling for the
2508 // same remote device.
2509 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2510 // session for the same remote device.
2511 // Default: 0 if the device's metric id is unknown.
2512 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002513}
2514
2515/**
2516 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2517 * device, as documented by the Bluetooth Core HCI specification
2518 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2519 * Vol 2, Part E, Page 1118
2520 *
2521 * Logged from:
2522 * system/bt
2523 */
2524message BluetoothRemoteVersionInfoReported {
2525 // Connection handle of the connection
2526 // Original type: uint16_t
2527 optional int32 connection_handle = 1;
2528 // HCI command status code
2529 // Default: STATUS_UNKNOWN
2530 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2531 // 1 byte Version of current LMP in the remote controller
2532 optional int32 lmp_version = 3;
2533 // 2 bytes LMP manufacturer code of the remote controller
2534 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2535 optional int32 lmp_manufacturer_code = 4;
2536 // 4 bytes subversion of the LMP in the remote controller
2537 optional int32 lmp_subversion = 5;
2538}
2539
2540/**
2541 * Logs when certain Bluetooth SDP attributes are discovered
2542 * Constant definitions are from:
2543 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2544 *
2545 * Current logged attributes:
2546 * - BluetoothProfileDescriptorList
2547 * - Supported Features Bitmask
2548 *
2549 * Logged from:
2550 * system/bt
2551 */
2552message BluetoothSdpAttributeReported {
2553 // An identifier that can be used to match events for this device.
2554 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2555 // Salt: Randomly generated 256 bit value
2556 // Hash algorithm: HMAC-SHA256
2557 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2558 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2559 // Original type: uint16_t
2560 optional int32 protocol_uuid = 2;
2561 // Short form UUIDs used to identify Bluetooth SDP attribute types
2562 // Original type: uint16_t
2563 optional int32 attribute_id = 3;
2564 // Attribute value for the particular attribute
2565 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002566 // An identifier that can be used to match events for this device.
2567 // The incremental identifier is locally generated and guaranteed not derived
2568 // from any globally unique hardware id.
2569 // For paired devices, it stays consistent between Bluetooth toggling for the
2570 // same remote device.
2571 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2572 // session for the same remote device.
2573 // Default: 0 if the device's metric id is unknown.
2574 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002575}
2576
2577/**
2578 * Logs when bond state of a Bluetooth device changes
2579 *
2580 * Logged from:
2581 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2582 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2583 */
2584message BluetoothBondStateChanged {
2585 // An identifier that can be used to match events for this device.
2586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2587 // Salt: Randomly generated 256 bit value
2588 // Hash algorithm: HMAC-SHA256
2589 // Size: 32 byte
2590 // Default: null or empty if the device identifier is not known
2591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2592 // Preferred transport type to remote dual mode device
2593 // Default: TRANSPORT_AUTO means no preference
2594 optional android.bluetooth.TransportTypeEnum transport = 2;
2595 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2596 // Default: UNKNOWN
2597 optional android.bluetooth.DeviceTypeEnum type = 3;
2598 // Current bond state (NONE, BONDING, BONDED)
2599 // Default: BOND_STATE_UNKNOWN
2600 optional android.bluetooth.BondStateEnum bond_state = 4;
2601 // Bonding sub state
2602 // Default: BOND_SUB_STATE_UNKNOWN
2603 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2604 // Unbond Reason
2605 // Default: UNBOND_REASON_UNKNOWN
2606 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002607 // An identifier that can be used to match events for this device.
2608 // The incremental identifier is locally generated and guaranteed not derived
2609 // from any globally unique hardware id.
2610 // For paired devices, it stays consistent between Bluetooth toggling for the
2611 // same remote device.
2612 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2613 // session for the same remote device.
2614 // Default: 0 if the device's metric id is unknown.
2615 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002616}
2617
2618/**
2619 * Logs there is an event related Bluetooth classic pairing
2620 *
2621 * Logged from:
2622 * system/bt
2623 */
2624message BluetoothClassicPairingEventReported {
2625 // An identifier that can be used to match events for this device.
2626 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2627 // Salt: Randomly generated 256 bit value
2628 // Hash algorithm: HMAC-SHA256
2629 // Size: 32 byte
2630 // Default: null or empty if the device identifier is not known
2631 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2632 // Connection handle of this connection if available
2633 // Range: 0x0000 - 0x0EFF (12 bits)
2634 // Default: 0xFFFF if the handle is unknown
2635 optional int32 connection_handle = 2;
2636 // HCI command associated with this event
2637 // Default: CMD_UNKNOWN
2638 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2639 // HCI event associated with this event
2640 // Default: EVT_UNKNOWN
2641 optional android.bluetooth.hci.EventEnum hci_event = 4;
2642 // HCI command status code if this is triggerred by hci_cmd
2643 // Default: STATUS_UNKNOWN
2644 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2645 // HCI reason code associated with this event
2646 // Default: STATUS_UNKNOWN
2647 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002648 // A status value related to this specific event
2649 // Default: 0
2650 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002651 // An identifier that can be used to match events for this device.
2652 // The incremental identifier is locally generated and guaranteed not derived
2653 // from any globally unique hardware id.
2654 // For paired devices, it stays consistent between Bluetooth toggling for the
2655 // same remote device.
2656 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2657 // session for the same remote device.
2658 // Default: 0 if the device's metric id is unknown.
2659 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002660}
2661
2662/**
2663 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2664 *
2665 * Logged from:
2666 * system/bt
2667 */
2668message BluetoothSmpPairingEventReported {
2669 // An identifier that can be used to match events for this device.
2670 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2671 // Salt: Randomly generated 256 bit value
2672 // Hash algorithm: HMAC-SHA256
2673 // Size: 32 byte
2674 // Default: null or empty if the device identifier is not known
2675 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2676 // SMP command sent or received over L2CAP
2677 // Default: CMD_UNKNOWN
2678 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2679 // Whether this command is sent or received
2680 // Default: DIRECTION_UNKNOWN
2681 optional android.bluetooth.DirectionEnum direction = 3;
2682 // SMP failure reason code
2683 // Default: PAIRING_FAIL_REASON_DEFAULT
2684 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002685 // An identifier that can be used to match events for this device.
2686 // The incremental identifier is locally generated and guaranteed not derived
2687 // from any globally unique hardware id.
2688 // For paired devices, it stays consistent between Bluetooth toggling for the
2689 // same remote device.
2690 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2691 // session for the same remote device.
2692 // Default: 0 if the device's metric id is unknown.
2693 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002694}
2695
2696/**
Jack He815cdba2019-01-30 17:24:55 -08002697 * Logs when a Bluetooth socket’s connection state changed
2698 *
2699 * Logged from:
2700 * system/bt
2701 */
2702message BluetoothSocketConnectionStateChanged {
2703 // An identifier that can be used to match events for this device.
2704 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2705 // Salt: Randomly generated 256 bit value
2706 // Hash algorithm: HMAC-SHA256
2707 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002708 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002709 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002710 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002711 // Default 0 when unknown or don't care
2712 optional int32 port = 2;
2713 // Socket type as mentioned in
2714 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2715 // Default: SOCKET_TYPE_UNKNOWN
2716 optional android.bluetooth.SocketTypeEnum type = 3;
2717 // Socket connection state
2718 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2719 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2720 // Number of bytes sent to remote device during this connection
2721 optional int64 tx_bytes = 5;
2722 // Number of bytes received from remote device during this connection
2723 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002724 // Socket owner's UID
2725 optional int32 uid = 7 [(is_uid) = true];
2726 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2727 // |port| must be spawned by |server_port|
2728 // Default 0 when unknown or don't care
2729 optional int32 server_port = 8;
2730 // Whether this is a server listener socket
2731 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002732 // An identifier that can be used to match events for this device.
2733 // The incremental identifier is locally generated and guaranteed not derived
2734 // from any globally unique hardware id.
2735 // For paired devices, it stays consistent between Bluetooth toggling for the
2736 // same remote device.
2737 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2738 // session for the same remote device.
2739 // Default: 0 if the device's metric id is unknown.
2740 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002741}
2742
2743/**
Jack He71426802019-04-02 13:32:52 -07002744 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2745 *
2746 * Logged from:
2747 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2748 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2749 *
2750 */
2751message BluetoothClassOfDeviceReported {
2752 // An identifier that can be used to match events for this device.
2753 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2754 // Salt: Randomly generated 256 bit value
2755 // Hash algorithm: HMAC-SHA256
2756 // Size: 32 byte
2757 // Default: null or empty if this is a server listener socket
2758 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2759 // Class of Device (CoD) value including both Major, Minor device class and service class
2760 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2761 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2762 // Default: 0
2763 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002764 // An identifier that can be used to match events for this device.
2765 // The incremental identifier is locally generated and guaranteed not derived
2766 // from any globally unique hardware id.
2767 // For paired devices, it stays consistent between Bluetooth toggling for the
2768 // same remote device.
2769 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2770 // session for the same remote device.
2771 // Default: 0 if the device's metric id is unknown.
2772 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002773}
2774
2775/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002776 * Logs when something is plugged into or removed from the USB-C connector.
2777 *
2778 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002779 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002780 */
2781message UsbConnectorStateChanged {
2782 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002783 STATE_DISCONNECTED = 0;
2784 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002785 }
tsaichristine961d2fd2020-04-23 10:39:34 -07002786 optional State state = 1
2787 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
2788 optional string id = 2 [(state_field_option).primary_field = true];
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002789 // Last active session in ms.
2790 // 0 when the port is in connected state.
2791 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002792}
2793
2794/**
2795 * Logs the reported speaker impedance.
2796 *
2797 * Logged from:
2798 * Vendor audio implementation.
2799 */
2800message SpeakerImpedanceReported {
2801 optional int32 speaker_location = 1;
2802 optional int32 impedance = 2;
2803}
2804
2805/**
2806 * Logs the report of a failed hardware.
2807 *
2808 * Logged from:
2809 * Vendor HALs.
2810 *
2811 */
2812message HardwareFailed {
2813 enum HardwareType {
2814 HARDWARE_FAILED_UNKNOWN = 0;
2815 HARDWARE_FAILED_MICROPHONE = 1;
2816 HARDWARE_FAILED_CODEC = 2;
2817 HARDWARE_FAILED_SPEAKER = 3;
2818 HARDWARE_FAILED_FINGERPRINT = 4;
2819 }
2820 optional HardwareType hardware_type = 1;
2821
Maggie White6dcd8572019-01-31 14:11:50 -08002822 /**
2823 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002824 * the same hardware_type. The specific locations are vendor defined integers,
2825 * referring to board-specific numbering schemes.
2826 */
2827 optional int32 hardware_location = 2;
2828
Maggie White6dcd8572019-01-31 14:11:50 -08002829 /**
2830 * failure_code is specific to the HardwareType of the failed hardware.
2831 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002832 */
Maggie White6dcd8572019-01-31 14:11:50 -08002833 enum HardwareErrorCode {
2834 UNKNOWN = 0;
2835 COMPLETE = 1;
2836 SPEAKER_HIGH_Z = 2;
2837 SPEAKER_SHORT = 3;
2838 FINGERPRINT_SENSOR_BROKEN = 4;
2839 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002840 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002841 }
2842 optional int32 failure_code = 3;
2843}
2844
2845/**
2846 * Log an event when the device has been physically dropped.
2847 * Reported from the /vendor partition.
2848 */
2849message PhysicalDropDetected {
2850 // Confidence that the event was actually a drop, 0 -> 100
2851 optional int32 confidence_pctg = 1;
2852 // Peak acceleration of the drop, in 1/1000s of a g.
2853 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002854 // Duration of freefall in ms
2855 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002856}
2857
2858/**
2859 * Log bucketed battery charge cycles.
2860 *
2861 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002862 * a given charge point. For example, if 10 cycle buckets are
2863 * initialized, bucket 1 is the lowest 1/10th of the battery,
2864 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002865 *
2866 * Logged from:
2867 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2868 */
2869message ChargeCyclesReported {
2870 optional int32 cycle_bucket_1 = 1;
2871 optional int32 cycle_bucket_2 = 2;
2872 optional int32 cycle_bucket_3 = 3;
2873 optional int32 cycle_bucket_4 = 4;
2874 optional int32 cycle_bucket_5 = 5;
2875 optional int32 cycle_bucket_6 = 6;
2876 optional int32 cycle_bucket_7 = 7;
2877 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002878 optional int32 cycle_bucket_9 = 9;
2879 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002880}
2881
2882/**
Howard Roa46b6582018-09-18 16:45:02 -07002883 * Log battery health snapshot.
2884 *
2885 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2886 * are snapshotted periodically over 24hrs.
2887 */
2888message BatteryHealthSnapshot {
2889 enum BatterySnapshotType {
2890 UNKNOWN = 0;
2891 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2892 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2893 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2894 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2895 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2896 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2897 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2898 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2899 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2900 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2901 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2902 }
2903 optional BatterySnapshotType type = 1;
2904 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002905 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002906 // Voltage Battery Voltage, in microVolts.
2907 optional int32 voltage_micro_volt = 3;
2908 // Current Battery current, in microAmps.
2909 optional int32 current_micro_amps = 4;
2910 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2911 optional int32 open_circuit_micro_volt = 5;
2912 // Resistance Battery Resistance, in microOhms.
2913 optional int32 resistance_micro_ohm = 6;
2914 // Level Battery Level, as % of full.
2915 optional int32 level_percent = 7;
2916}
2917
2918/**
2919 * Log slow I/O operations on the primary storage.
2920 */
2921message SlowIo {
2922 // Classifications of IO Operations.
2923 enum IoOperation {
2924 UNKNOWN = 0;
2925 READ = 1;
2926 WRITE = 2;
2927 UNMAP = 3;
2928 SYNC = 4;
2929 }
2930 optional IoOperation operation = 1;
2931
2932 // The number of slow IO operations of this type over 24 hours.
2933 optional int32 count = 2;
2934}
2935
2936/**
2937 * Log battery caused shutdown with the last recorded voltage.
2938 */
2939message BatteryCausedShutdown {
2940 // The last recorded battery voltage prior to shutdown.
2941 optional int32 last_recorded_micro_volt = 1;
2942}
2943
2944/**
Tej Singha72344992019-04-17 18:55:08 -07002945 * Logs when ThermalService receives throttling events.
2946 *
2947 * Logged from:
2948 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2949 */
2950message ThermalThrottlingSeverityStateChanged {
2951 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2952 optional android.os.TemperatureTypeEnum sensor_type = 1;
2953
2954 // The name of the temperature source. Eg. CPU0
2955 optional string sensor_name = 2;
2956
2957 // Temperature in tenths of a degree C.
2958 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2959 optional int32 temperature_deci_celsius = 3;
2960
2961 // Relative severity of the throttling, see enum definition.
2962 optional android.os.ThrottlingSeverityEnum severity = 4;
2963}
2964
2965/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002966 * Logs the duration of a davey (jank of >=700ms) when it occurs
2967 *
2968 * Logged from:
2969 * frameworks/base/libs/hwui/JankTracker.cpp
2970 */
2971message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002972 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002973 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002974
Tej Singhbb8554a2018-01-26 11:59:14 -08002975 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002976 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002977}
2978
2979/**
Bookatze5885242017-10-24 20:10:31 -07002980 * Logs phone signal strength changes.
2981 *
2982 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002983 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002984 */
2985message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002986 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2987 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002988}
2989
Yangster4ccebea2018-10-09 17:09:02 -07002990
2991/**
2992 * Logs when the phone state, sim state or signal strength changes
2993 *
2994 * Logged from:
2995 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2996 */
2997message PhoneServiceStateChanged {
2998 optional android.telephony.ServiceStateEnum state = 1;
2999 optional android.telephony.SimStateEnum sim_state = 2;
3000 optional android.telephony.SignalStrengthEnum signal_strength = 3;
3001}
3002
3003/**
3004 * Logs when the phone becomes on or off.
3005 *
3006 * Logged from:
3007 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
3008 */
3009message PhoneStateChanged {
3010 enum State {
3011 OFF = 0;
3012 ON = 1;
3013 }
3014 optional State state = 1;
3015}
3016
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003017message BackGesture {
3018 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003019 DEFAULT_BACK_TYPE = 0;
3020 COMPLETED = 1;
3021 COMPLETED_REJECTED = 2; // successful because coming from rejected area
3022 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
3023 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
3024 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
3025 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
3026 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
3027 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003028 }
3029 optional BackType type = 1;
3030
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003031 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
3032 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
3033 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
3034 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
3035 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
3036 optional int32 left_boundary = 8; // left edge width + left inset
3037 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
3038
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003039 enum WindowHorizontalLocation {
3040 DEFAULT_LOCATION = 0;
3041 LEFT = 1;
3042 RIGHT = 2;
3043 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07003044 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07003045}
3046
3047message ExclusionRectStateChanged {
3048 optional string component_name = 1; // if not available, simply packageName
3049 optional int32 requested_height = 2; // px
3050 optional int32 rejected_height = 3; // px
3051
3052 enum WindowHorizontalLocation {
3053 DEFAULT_LOCATION = 0;
3054 LEFT = 1;
3055 RIGHT = 2;
3056 }
3057 optional WindowHorizontalLocation x_location = 4;
3058 optional bool landscape = 5;
3059 optional bool splitscreen = 6;
3060 optional int32 duration_millis = 7;
3061}
3062
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003063/**
3064 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
3065 *
3066 * Logged from:
3067 * packages/apps/Launcher3
3068 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003069message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003070 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07003071 optional android.stats.launcher.LauncherState src_state = 2;
3072 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003073 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3074 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3075
3076 // The event id (e.g., app launch, drag and drop, long press)
3077 optional int32 event_id = 6;
3078 // The event's source or target id (e.g., icon, task, button)
3079 optional int32 target_id = 7;
3080 // If the target needs to be tracked, use this id field
3081 optional int32 instance_id = 8;
3082 optional int32 uid = 9 [(is_uid) = true];
3083 optional string package_name = 10;
3084 optional string component_name = 11;
3085
3086 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003087 optional int32 grid_x = 12 [default = -1];
3088 optional int32 grid_y = 13 [default = -1];
3089 optional int32 page_id = 14 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003090
3091 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003092 optional int32 grid_x_parent = 15 [default = -1];
3093 optional int32 grid_y_parent = 16 [default = -1];
3094 optional int32 page_id_parent = 17 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003095
3096 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3097 optional int32 hierarchy = 18;
3098
3099 optional bool is_work_profile = 19;
3100
3101 // Used to store the predicted rank of the target
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003102 optional int32 rank = 20 [default = -1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003103
3104 // e.g., folderLabelState can be captured in the following two fields
3105 optional int32 from_state = 21;
3106 optional int32 to_state = 22;
3107
3108 // e.g., autofilled or suggested texts that are not user entered
3109 optional string edittext = 23;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003110
3111 // e.g., number of contents inside a container (e.g., icons inside a folder)
3112 optional int32 cardinality = 24;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003113}
3114
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003115/**
3116 * Used for snapshot of the HomeScreen UI elements
3117 *
3118 * Logged from:
3119 * packages/apps/Launcher3
3120 */
3121message LauncherStaticLayout {
3122 // The event id (e.g., snapshot, drag and drop)
3123 optional int32 event_id = 1;
3124 // The event's source or target id (e.g., icon, shortcut, widget)
3125 optional int32 target_id = 2;
3126 // If the target needs to be tracked, use this id field
3127 optional int32 instance_id = 3;
3128 optional int32 uid = 4 [(is_uid) = true];
3129 optional string package_name = 5;
3130 optional string component_name = 6;
3131
3132 // (x, y) coordinate and the index information of the target on the container
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003133 optional int32 grid_x = 7 [default = -1];
3134 optional int32 grid_y = 8 [default = -1];
3135 optional int32 page_id = 9 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003136
3137 // e.g., folder icon's (x, y) location and index information on the workspace
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003138 // e.g., when used with widgets target, use these values for (span_x, span_y)
3139 optional int32 grid_x_parent = 10 [default = -1];
3140 optional int32 grid_y_parent = 11 [default = -1];
3141 optional int32 page_id_parent = 12 [default = -2];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003142
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003143 // UNKNOWN = 0
3144 // HOTSEAT = 1
3145 // WORKSPACE = 2
3146 // FOLDER_HOTSEAT = 3
3147 // FOLDER_WORKSPACE = 4
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003148 optional int32 hierarchy = 13;
3149
3150 optional bool is_work_profile = 14;
3151
3152 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3153 optional int32 origin = 15;
Hyunyoung Songe742ae72020-05-04 23:47:11 -07003154
3155 // e.g., number of icons inside a folder
3156 optional int32 cardinality = 16;
3157
3158 // e.g., (x, y) span of the widget inside homescreen grid system
3159 optional int32 span_x = 17 [default = 1];
3160 optional int32 span_y = 18 [default = 1];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003161}
3162
3163/**
3164 * Logs when Wallpaper or ThemePicker UI has changed.
3165 *
3166 * Logged from:
3167 * packages/apps/ThemePicker
3168 * packages/apps/WallpaperPicker2
3169 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003170message StyleUIChanged {
3171 optional android.stats.style.Action action = 1;
3172 optional int32 color_package_hash = 2;
3173 optional int32 font_package_hash = 3;
3174 optional int32 shape_package_hash = 4;
3175 optional int32 clock_package_hash = 5;
3176 optional int32 launcher_grid = 6;
3177 optional int32 wallpaper_category_hash = 7;
3178 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003179 optional int32 color_preference = 9;
3180 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003181}
3182
David Chenc28b2bb2017-10-24 12:52:52 -07003183/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003184 * Logs when Settings UI has changed.
3185 *
3186 * Logged from:
3187 * packages/apps/Settings
3188 */
3189message SettingsUIChanged {
3190 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003191 * Where this SettingsUIChange event comes from. For example, if
3192 * it's a PAGE_VISIBLE event, where the page is opened from.
3193 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003194 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003195
3196 /**
3197 * What the UI action is.
3198 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003199 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003200
3201 /**
3202 * Where the action is happening
3203 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003204 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003205
3206 /**
3207 * What preference changed in this event.
3208 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003209 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003210
3211 /**
3212 * The new value of the changed preference.
3213 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003214 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003215}
3216
3217/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003218 * Logs basic timing information about touch events.
3219 * Reported at most every 5 minutes while device is being interacted with.
3220 *
3221 * Logged from:
3222 * frameworks/native/services/inputflinger
3223 */
3224message TouchEventReported {
3225 /**
3226 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003227 * and the standard deviation of the time spent processing touchscreen events
3228 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003229 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003230 * On supported devices, the starting point is taken during the hard interrupt inside the
3231 * kernel touch driver. On all other devices, the starting point is taken inside
3232 * the kernel's input event subsystem upon receipt of the input event.
3233 * The ending point is taken inside InputDispatcher, just after the input event
3234 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003235 */
3236 // Minimum value
3237 optional float latency_min_micros = 1;
3238 // Maximum value
3239 optional float latency_max_micros = 2;
3240 // Average value
3241 optional float latency_mean_micros = 3;
3242 // Standard deviation
3243 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003244 // Number of touch events (input_event) in this report
3245 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003246}
3247
3248/**
Philip Quinn0eded622019-01-29 12:46:28 -08003249 * Logs gesture classification and timing information for touch events.
3250 *
3251 * Logged from:
3252 * frameworks/base/core/java/android/view/GestureDetector.java
3253 * frameworks/base/core/java/android/view/View.java
3254 */
3255message TouchGestureClassified {
3256 // The source of the classification (e.g. Java class name).
3257 optional string source = 1;
3258
3259 enum Classification {
3260 UNKNOWN_CLASSIFICATION = 0;
3261 SINGLE_TAP = 1;
3262 DOUBLE_TAP = 2;
3263 LONG_PRESS = 3;
3264 DEEP_PRESS = 4;
3265 SCROLL = 5;
3266 }
3267 // The classification of the gesture.
3268 optional Classification classification = 2;
3269
3270 // The interval from the start of a touch event stream until the
3271 // classification was made.
3272 optional int32 latency_millis = 3;
3273
3274 // The distance from the location of the first touch event to the
3275 // location of the touch event when the classification was made.
3276 optional float displacement_px = 4;
3277}
3278
3279/**
David Chenc28b2bb2017-10-24 12:52:52 -07003280 * Logs that a setting was updated.
3281 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003282 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003283 * The tag and is_default allow resetting of settings to default values based on the specified
3284 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3285 */
3286message SettingChanged {
3287 // The name of the setting.
3288 optional string setting = 1;
3289
3290 // The change being imposed on this setting. May represent a number, eg "3".
3291 optional string value = 2;
3292
3293 // The new value of this setting. For most settings, this is same as value. For some settings,
3294 // value is +X or -X where X represents an element in a set. For example, if the previous value
3295 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3296 // The +/- feature is currently only used for location_providers_allowed.
3297 optional string new_value = 3;
3298
3299 // The previous value of this setting.
3300 optional string prev_value = 4;
3301
3302 // The tag used with the is_default for resetting sets of settings. This is generally null.
3303 optional string tag = 5;
3304
Bookatz90867622018-01-31 15:05:57 -08003305 // True if this setting with tag should be resettable.
3306 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003307
David Chenbd789912018-03-16 17:19:55 -07003308 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003309 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003310
3311 enum ChangeReason {
3312 UPDATED = 1; // Updated can be an insertion or an update.
3313 DELETED = 2;
3314 }
3315 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003316}
Chenjie Yub3dda412017-10-24 13:41:59 -07003317
Chenjie Yu05013b32017-11-21 10:21:41 -08003318/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003319 * Logs activity going to foreground or background
3320 *
3321 * Logged from:
3322 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3323 */
3324message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003325 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003326 optional string pkg_name = 2;
3327 optional string class_name = 3;
3328
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003329 enum State {
3330 BACKGROUND = 0;
3331 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003332 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003333 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003334}
David Chenc8a43242017-10-17 16:23:28 -07003335
3336/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003337 * Logs when a volume entered low Storage state.
3338 * Logged from:
3339 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3340 */
3341message LowStorageStateChanged {
3342 // Volume that ran out of storage.
3343 optional string volume_description = 1;
3344
3345 enum State {
3346 UNKNOWN = 0;
3347 OFF = 1;
3348 ON = 2;
3349 }
3350 optional State state = 2;
3351}
3352
3353/**
3354 * Logs when an app is downgraded.
3355 * Logged from:
3356 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3357 */
3358message AppDowngraded {
3359 optional string package_name = 1;
3360 // Size of the package (all data) before being downgraded.
3361 optional int64 size_in_bytes_before = 2;
3362 // Size of the package (all data) after being downgraded.
3363 optional int64 size_in_bytes_after = 3;
3364
3365 optional bool aggressive = 4;
3366}
3367
3368/**
3369 * Logs when an app is optimized after being downgraded.
3370 * Logged from:
3371 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3372 */
3373message AppOptimizedAfterDowngraded {
3374 optional string package_name = 1;
3375}
3376
3377/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003378 * Logs whenever an app is installed on external storage.
3379 * Logged from:
3380 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3381 */
3382message AppInstallOnExternalStorageReported {
3383 // The type of external storage.
3384 optional android.stats.storage.ExternalStorageType storage_type = 1;
3385 // The name of the package that is installed on the sd card.
3386 optional string package_name = 2;
3387}
3388
3389/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003390 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003391 * Logged from:
3392 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3393 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003394message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003395 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003396
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003397 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003398
3399 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003400 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003401 optional string process_name = 3;
3402
3403 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003404 optional int32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003405
3406 optional string package_name = 5;
3407
3408 enum InstantApp {
3409 UNAVAILABLE = 0;
3410 FALSE = 1;
3411 TRUE = 2;
3412 }
3413 optional InstantApp is_instant_app = 6;
3414
3415 enum ForegroundState {
3416 UNKNOWN = 0;
3417 BACKGROUND = 1;
3418 FOREGROUND = 2;
3419 }
3420 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003421
3422 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003423}
David Chen9e3808c2017-11-20 17:25:34 -08003424
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003425/**
3426 * Logs when a WTF (What a Terrible Failure) happened.
3427 * Logged from:
3428 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3429 */
3430message WTFOccurred {
3431 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003432
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003433 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003434
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003435 // The name of the process.
3436 // system_server if it is not by an app
3437 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003438
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003439 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003440 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003441
3442 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003443}
3444
3445/**
3446 * Logs when system server reports low memory.
3447 * Logged from:
3448 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3449 */
3450message LowMemReported {
3451}
3452
3453/**
3454 * Logs when an app ANR (App Not Responding) occurs.
3455 * Logged from:
3456 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3457 */
3458message ANROccurred {
3459 optional int32 uid = 1 [(is_uid) = true];
3460
3461 optional string process_name = 2;
3462
3463 optional string short_component_name = 3;
3464
3465 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003466
3467 enum InstantApp {
3468 UNAVAILABLE = 0;
3469 FALSE = 1;
3470 TRUE = 2;
3471 }
3472 optional InstantApp is_instant_app = 5;
3473
3474 enum ForegroundState {
3475 UNKNOWN = 0;
3476 BACKGROUND = 1;
3477 FOREGROUND = 2;
3478 }
3479 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003480
3481 optional android.server.ErrorSource error_source = 7;
3482
3483 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003484}
3485
Bookatza7020bd2018-08-28 16:29:35 -07003486/**
3487 * Logs when the vibrator state changes.
3488 * Logged from:
3489 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3490 */
3491message VibratorStateChanged {
3492 repeated AttributionNode attribution_node = 1;
3493
3494 enum State {
3495 OFF = 0;
3496 ON = 1;
3497 }
3498 optional State state = 2;
3499
3500 // Duration (in milliseconds) requested to keep the vibrator on.
3501 // Only applicable for State == ON.
3502 optional int64 duration_millis = 3;
3503}
3504
David Chen0a368b22017-12-06 16:28:16 -08003505/*
3506 * Allows other apps to push events into statsd.
3507 * Logged from:
3508 * frameworks/base/core/java/android/util/StatsLog.java
3509 */
David Chen0b5c90c2018-01-25 16:51:49 -08003510message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003511 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003512 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003513
3514 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3515 optional int32 label = 2;
3516
3517 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3518 // predicates for the metrics).
3519 enum State {
3520 UNKNOWN = 0;
3521 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3522 STOP = 2;
3523 START = 3;
3524 }
3525 optional State state = 3;
3526}
3527
David Chen9e3808c2017-11-20 17:25:34 -08003528/**
Bookatz7948c872018-09-04 12:58:33 -07003529 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3530 * For example, this could be due to the user manually changing the time.
3531 *
3532 * Logged from:
3533 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3534 */
3535message WallClockTimeShifted {
3536 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3537 optional int64 wall_clock_timestamp_millis = 1;
3538}
3539
3540/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003541 * Logs when statsd detects an anomaly.
3542 *
3543 * Logged from:
3544 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3545 */
3546message AnomalyDetected {
3547 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003548 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003549
Yangster-mac94e197c2018-01-02 16:03:03 -08003550 // Id of the config whose anomaly detection alert fired.
3551 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003552
Yangster-mac94e197c2018-01-02 16:03:03 -08003553 // Id of the alert (i.e. name of the anomaly that was detected).
3554 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003555}
3556
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003557message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003558 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003559 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003560
3561 // The app package name.
3562 optional string pkg_name = 2;
3563
3564 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003565 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003566 WARM = 1;
3567 HOT = 2;
3568 COLD = 3;
3569 }
3570 // The transition type.
3571 optional TransitionType type = 3;
3572
3573 // The activity name.
3574 optional string activity_name = 4;
3575
3576 // The name of the calling app. Empty if not set.
3577 optional string calling_pkg_name = 5;
3578
3579 // Whether the app is an instant app.
3580 optional bool is_instant_app = 6;
3581
3582 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003583 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003584
Bookatz80d11a02018-01-16 10:46:35 -08003585 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003586
David Chen0b5c90c2018-01-25 16:51:49 -08003587 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003588 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003589 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003590 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003591 optional int32 bind_application_delay_millis = 11;
3592 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003593
3594 // Empty if not set.
3595 optional string launch_token = 13;
3596
Calin Juravle759fbda2018-02-20 19:52:30 +00003597 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003598 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003599
3600 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003601 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003602}
3603
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003604message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003605 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003606 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003607
3608 // The app package name.
3609 optional string pkg_name = 2;
3610
3611 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003612 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003613 WARM = 1;
3614 HOT = 2;
3615 COLD = 3;
3616 }
3617 // The transition type.
3618 optional TransitionType type = 3;
3619
3620 // The activity name.
3621 optional string activity_name = 4;
3622}
3623
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003624message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003625 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003626 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003627
3628 // The app package name.
3629 optional string pkg_name = 2;
3630
3631 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003632 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003633 WITH_BUNDLE = 1;
3634 WITHOUT_BUNDLE = 2;
3635 }
3636 // The transition type.
3637 optional TransitionType type = 3;
3638
3639 // The activity name.
3640 optional string activity_name = 4;
3641
3642 optional bool transition_process_running = 5;
3643
3644 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003645 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003646}
3647
Bookatz8fcd09a2017-12-18 13:01:10 -08003648/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003649 * Logs a picture-in-picture action
3650 * Logged from:
3651 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3652 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3653 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3654 */
3655message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003656 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003657 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003658
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003659 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003660
Chenjie Yu52cacc62017-12-08 18:11:45 -08003661 enum State {
3662 ENTERED = 1;
3663 EXPANDED_TO_FULL_SCREEN = 2;
3664 MINIMIZED = 3;
3665 DISMISSED = 4;
3666 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003667 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003668}
3669
3670/**
Chenjie Yue8904192017-12-08 19:12:57 -08003671 * Logs overlay action
3672 * Logged from:
3673 * services/core/java/com/android/server/wm/Session.java
3674 */
3675message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003676 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003677
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003678 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003679
3680 optional bool using_alert_window = 3;
3681
3682 enum State {
3683 ENTERED = 1;
3684 EXITED = 2;
3685 }
tsaichristine961d2fd2020-04-23 10:39:34 -07003686 optional State state = 4
3687 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Chenjie Yue8904192017-12-08 19:12:57 -08003688}
3689
Adam Bookatz38767932020-02-05 12:13:40 -08003690/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003691 * Logs foreground service starts and stops.
3692 * Note that this is not when a service starts or stops, but when it is
3693 * considered foreground.
3694 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003695 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003696 */
3697message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003698 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003699 // package_name + "/" + class_name
3700 optional string short_name = 2;
3701
3702 enum State {
3703 ENTER = 1;
3704 EXIT = 2;
3705 }
3706 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003707
3708 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3709 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3710 optional bool allow_while_in_use_permission = 4;
3711}
3712
3713/**
3714 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3715 * A foreground service session is any continuous period during which the uid holds at least one
3716 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3717 * Accesses initiated while the uid is in the TOP state are ignored.
3718 * Sessions with no attempted accesses are not logged.
3719 * Logged from
3720 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3721 */
3722message ForegroundServiceAppOpSessionEnded {
3723 optional int32 uid = 1 [(is_uid) = true];
3724
3725 // The operation's name.
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00003726 // Only following four ops are logged
3727 // COARSE_LOCATION = 0
3728 // FINE_LOCATION = 1
3729 // CAMERA = 26
3730 // RECORD_AUDIO = 27
3731 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003732
3733 // The uid's permission mode for accessing the AppOp during this fgs session.
3734 enum Mode {
3735 MODE_UNKNOWN = 0;
3736 MODE_ALLOWED = 1; // Always allowed
3737 MODE_IGNORED = 2; // Denied
3738 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3739 }
3740 optional Mode app_op_mode = 3;
3741
3742 // Number of times this AppOp was requested and allowed.
3743 optional int32 count_ops_accepted = 4;
3744 // Number of times this AppOp was requested but denied.
3745 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003746}
3747
Chenjie Yue8904192017-12-08 19:12:57 -08003748/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003749 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3750 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3751 * attributed back to the parent (host) uid. One example is Chrome.
3752 *
3753 * Logged from:
3754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3755 */
3756message IsolatedUidChanged {
3757 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003758 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003759 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003760 optional int32 parent_uid = 1;
3761
3762 optional int32 isolated_uid = 2;
3763
3764 // We expect an isolated uid to be removed before if it's used for another parent uid.
3765 enum Event {
3766 REMOVED = 0;
3767 CREATED = 1;
3768 }
3769 optional Event event = 3;
3770}
3771
3772/*
3773 * Logs the reception of an incoming network packet causing the main system to wake up for
3774 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3775 * and processed by WakeupController.cpp.
3776 */
3777message PacketWakeupOccurred {
3778 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3779 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003780 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003781 // The interface name on which the packet was received.
3782 optional string iface = 2;
3783 // The ethertype value of the packet.
3784 optional int32 ethertype = 3;
3785 // String representation of the destination MAC address of the packet.
3786 optional string destination_hardware_address = 4;
3787 // String representation of the source address of the packet if this was an IP packet.
3788 optional string source_ip = 5;
3789 // String representation of the destination address of the packet if this was an IP packet.
3790 optional string destination_ip = 6;
3791 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3792 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3793 // families.
3794 optional int32 ip_next_header = 7;
3795 // The source port if this was a TCP or UDP packet.
3796 optional int32 source_port = 8;
3797 // The destination port if this was a TCP or UDP packet.
3798 optional int32 destination_port = 9;
3799}
3800
3801/*
3802 * Logs the memory stats for an app on startup.
3803 * Logged from:
3804 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3805 */
3806message AppStartMemoryStateCaptured {
3807 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003808 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003809
3810 // The process name.
3811 optional string process_name = 2;
3812
3813 // The activity name.
3814 optional string activity_name = 3;
3815
3816 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003817 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818
3819 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003820 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003821
3822 // RSS
3823 optional int64 rss_in_bytes = 6;
3824
3825 // CACHE
3826 optional int64 cache_in_bytes = 7;
3827
3828 // SWAP
3829 optional int64 swap_in_bytes = 8;
3830}
3831
3832/*
3833 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3834 * for LMK event.
3835 * Logged from:
3836 * system/core/lmkd/lmkd.c
3837 */
3838message LmkStateChanged {
3839 enum State {
3840 UNKNOWN = 0;
3841 START = 1;
3842 STOP = 2;
3843 }
3844 optional State state = 1;
3845}
3846
3847/*
3848 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3849 * Logged from:
3850 * system/core/lmkd/lmkd.c
3851 */
3852message LmkKillOccurred {
3853 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003854 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003855
3856 // The process name.
3857 optional string process_name = 2;
3858
3859 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003860 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003861
3862 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003863 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003864
3865 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003866 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003867
3868 // RSS
3869 optional int64 rss_in_bytes = 6;
3870
3871 // CACHE
3872 optional int64 cache_in_bytes = 7;
3873
3874 // SWAP
3875 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003876
3877 // The elapsed real time of start of the process.
3878 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003879
3880 // Min oom adj score considered by lmkd.
3881 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003882}
3883
Rajeev Kumar51b54602018-03-01 12:18:26 -08003884/*
3885 * Logs when the ActivityManagerService detects that an app died.
3886 *
3887 * Logged from:
3888 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3889 */
3890message AppDied {
3891 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003892 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003893}
3894
Howard Ro21a039c2018-08-06 14:55:47 -07003895/**
3896 * An atom for generic metrics logging. Available from Android Q.
3897 */
3898message GenericAtom {
3899 // The uid of the application that sent this custom atom.
3900 optional int32 uid = 1 [(is_uid) = true];
3901
3902 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003903 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003904}
3905
Tej Singhd6d6d772018-09-05 17:41:25 -07003906/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003907 * Atom for simple logging of user interaction and impression events, such as "the user touched
3908 * this button" or "this dialog was displayed".
3909 * Keep the UI event stream clean: don't use for system or background events.
3910 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003911 *
3912 * Logged from:
3913 * frameworks/base/services/core/java/com/android/server/
3914 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003915 */
3916message UiEventReported {
3917 // The event_id.
3918 optional int32 event_id = 1;
3919 // The event's source or target uid and package, if applicable.
3920 // For example, the package posting a notification, or the destination package of a share.
3921 optional int32 uid = 2 [(is_uid) = true];
3922 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003923 // An identifier used to disambiguate which logs refer to a particular instance of some
3924 // UI element. Useful when there might be multiple instances simultaneously active.
3925 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003926}
3927
3928/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003929 * Reports a notification was created or updated.
3930 *
3931 * Logged from:
3932 * frameworks/base/services/core/java/com/android/server/notification/
3933 */
3934message NotificationReported {
3935 // The event_id (as for UiEventReported).
3936 optional int32 event_id = 1;
3937 // The notifying app's uid and package.
3938 optional int32 uid = 2 [(is_uid) = true];
3939 optional string package_name = 3;
3940 // A small system-assigned identifier for the notification.
3941 // Locally probably-unique, but expect collisions across users and/or days.
3942 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003943 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3944 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003945
3946 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003947 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3948 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3949 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003950
3951 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003952 optional string category = 10; // App-assigned notification category (API-defined strings)
3953 optional int32 style = 11; // App-assigned notification style
3954 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003955
3956 // Ordering, importance and interruptiveness
3957
Will Brockman7614f6962020-02-10 19:43:03 -05003958 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003959
Will Brockman7614f6962020-02-10 19:43:03 -05003960 optional android.stats.sysui.NotificationImportance importance = 14;
3961 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003962
3963 enum NotificationImportanceExplanation {
3964 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3965 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3966 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3967 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3968 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3969 // Like _APP, but based on pre-channels priority signal.
3970 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3971 }
3972
Will Brockman7614f6962020-02-10 19:43:03 -05003973 optional NotificationImportanceExplanation importance_source = 16;
3974 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3975 optional NotificationImportanceExplanation importance_initial_source = 18;
3976 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3977 optional int32 assistant_hash = 20;
3978 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003979}
3980
3981message Notification {
3982 // The notifying app's uid and package.
3983 optional int32 uid = 1 [(is_uid) = true];
3984 optional string package_name = 2;
3985 // A small system-assigned identifier for the notification.
3986 optional int32 instance_id = 3;
3987
3988 // Grouping information.
3989 optional int32 group_instance_id = 4;
3990 optional bool is_group_summary = 5;
3991
3992 // The section of the shade that the notification is in.
3993 // See NotificationSectionsManager.PriorityBucket.
3994 enum NotificationSection {
3995 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003996 SECTION_HEADS_UP = 1;
Will Brockmancec88ed2020-04-27 13:11:02 -04003997 SECTION_MEDIA_CONTROLS = 2;
3998 SECTION_PEOPLE = 3;
3999 SECTION_ALERTING = 4;
4000 SECTION_SILENT = 5;
Will Brockman079fdaa2020-01-12 16:45:03 -05004001 }
4002 optional NotificationSection section = 6;
4003}
4004
4005message NotificationList {
4006 repeated Notification notifications = 1; // An ordered sequence of notifications.
4007}
4008
4009/**
4010 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
4011 *
4012 * Logged from:
4013 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
4014 */
4015message NotificationPanelReported {
4016 // The event_id (as for UiEventReported).
4017 optional int32 event_id = 1;
4018 optional int32 num_notifications = 2;
4019 // The notifications in the panel, in the order that they appear there.
4020 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
4021}
4022
4023/**
4024 * Reports a notification channel, or channel group, was created, updated, or deleted.
4025 *
4026 * Logged from:
4027 * frameworks/base/services/core/java/com/android/server/notification/
4028 */
4029message NotificationChannelModified {
4030 // The event_id (as for UiEventReported).
4031 optional int32 event_id = 1;
4032 // The notifying app's uid and package.
4033 optional int32 uid = 2 [(is_uid) = true];
4034 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05004035 // Hash of app-assigned notification channel ID or channel-group ID
4036 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05004037 // Previous importance setting, if applicable
4038 optional android.stats.sysui.NotificationImportance old_importance = 5;
4039 // New importance setting
4040 optional android.stats.sysui.NotificationImportance importance = 6;
4041}
4042
4043
4044/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004045 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004046 *
4047 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004048 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004049 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004050message BiometricAcquired {
4051 // Biometric modality that was acquired.
4052 optional android.hardware.biometrics.ModalityEnum modality = 1;
4053 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
4054 optional int32 user = 2;
4055 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
4056 optional bool is_crypto = 3;
4057 // Action that the device is performing. Acquired messages are only expected for enroll and
4058 // authenticate. Other actions may indicate an error.
4059 optional android.hardware.biometrics.ActionEnum action = 4;
4060 // The client that this acquisition was received for.
4061 optional android.hardware.biometrics.ClientEnum client = 5;
4062 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
4063 optional int32 acquire_info = 6;
4064 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
4065 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004066 // Dictates if this message should trigger additional debugging.
4067 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07004068}
4069
4070/**
Kevin Chyn1741a072019-01-17 11:54:40 -08004071 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07004072 *
4073 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08004074 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07004075 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004076message BiometricAuthenticated {
4077 // Biometric modality that was used.
4078 optional android.hardware.biometrics.ModalityEnum modality = 1;
4079 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4080 optional int32 user = 2;
4081 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
4082 // storage.
4083 optional bool is_crypto = 3;
4084 // The client that this acquisition was received for.
4085 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08004086 // If authentication requires user confirmation. See BiometricPrompt's
4087 // setRequireConfirmation(bool) method.
4088 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004089
Kevin Chyn1741a072019-01-17 11:54:40 -08004090 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004091 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004092 REJECTED = 1;
4093 PENDING_CONFIRMATION = 2;
4094 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004095 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004096
4097 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004098 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004099 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4100 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4101 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4102 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004103 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004104 // Dictates if this message should trigger additional debugging.
4105 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004106}
4107
4108/**
4109 * Logs when a biometric error occurs.
4110 *
4111 * Logged from:
4112 * frameworks/base/services/core/java/com/android/server/biometrics
4113 */
4114message BiometricErrorOccurred {
4115 // Biometric modality that was used.
4116 optional android.hardware.biometrics.ModalityEnum modality = 1;
4117 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4118 optional int32 user = 2;
4119 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4120 optional bool is_crypto = 3;
4121 // Action that the device is performing.
4122 optional android.hardware.biometrics.ActionEnum action = 4;
4123 // The client that this acquisition was received for.
4124 optional android.hardware.biometrics.ClientEnum client = 5;
4125 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4126 // are unique to modality.
4127 optional int32 error_info = 6;
4128 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4129 // by the vendor and not specified by the HIDL interface.
4130 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004131 // Dictates if this message should trigger additional debugging.
4132 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004133 // Time spent during the authentication attempt.
4134 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004135}
4136
4137/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004138 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004139 * Logged from:
4140 * frameworks/base/services/core/java/com/android/server/biometrics
4141 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004142message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004143 // Biometric modality.
4144 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004145 // Type of issue detected.
4146 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004147 // Dictates if this message should trigger additional debugging.
4148 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004149}
Howard Ro688ae182018-09-25 00:09:36 -07004150
joshmccloskey6f952b22019-03-25 20:59:35 -07004151/**
4152 * Logs when a biometric enrollment occurs.
4153 *
4154 * Logged from:
4155 * frameworks/base/services/core/java/com/android/server/biometrics
4156 */
4157message BiometricEnrolled {
4158 // Biometric modality that was used.
4159 optional android.hardware.biometrics.ModalityEnum modality = 1;
4160 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4161 optional int32 user = 2;
4162 // The amount of time the enrollment took in milliseconds.
4163 optional int64 latency_millis = 3;
4164 // Whether or not the enrollment was successful.
4165 optional bool success = 4;
4166}
4167
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004168/*
Tej Singh0d176952019-01-16 19:10:54 -08004169 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004170 */
Tej Singh0d176952019-01-16 19:10:54 -08004171message FlagFlipUpdateOccurred {
4172 // If the event is from a flag config package, specify the package name.
4173 optional string flag_flip_package_name = 1;
4174
4175 // The order id of the package
4176 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004177}
4178
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004179/**
4180 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004181 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004182 */
4183message TrainExperimentIds {
4184 repeated int64 experiment_id = 1;
4185}
4186
Yangster-macb89807e2018-11-15 21:10:57 -08004187/*
4188 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004189 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004190 */
4191message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004192 // Name of the train.
4193 optional string train_name = 1;
4194 // Version code for a "train" of packages that need to be installed atomically
4195 optional int64 train_version_code = 2;
4196 // After installation of this package, device requires a restart.
4197 optional bool requires_staging = 3;
4198 // Rollback should be enabled for this install.
4199 optional bool rollback_enabled = 4;
4200 // Requires low latency monitoring if possible.
4201 optional bool requires_low_latency_monitor = 5;
4202
Yangster-macb89807e2018-11-15 21:10:57 -08004203 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004204 UNKNOWN = 0;
4205 INSTALL_REQUESTED = 1;
4206 INSTALL_STARTED = 2;
4207 INSTALL_STAGED_NOT_READY = 3;
4208 INSTALL_STAGED_READY = 4;
4209 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004210 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4211 // and INSTALL_FAILURE_COMMIT.
4212 INSTALL_FAILURE = 6 [deprecated = true];
4213 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004214 INSTALL_CANCELLED = 7;
4215 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004216 INSTALLER_ROLLBACK_INITIATED = 9;
4217 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4218 INSTALLER_ROLLBACK_STAGED = 11;
4219 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4220 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4221 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4222 INSTALLER_ROLLBACK_SUCCESS = 15;
4223 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004224 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4225 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4226 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4227 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4228 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4229 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004230 INSTALL_FAILURE_DOWNLOAD = 23;
4231 INSTALL_FAILURE_STATE_MISMATCH = 24;
4232 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004233 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004234 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004235 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004236 // Possible experiment ids for monitoring this push.
4237 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4238 // user id
4239 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004240 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004241 // Whether or not this is a rollback event
4242 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004243}
4244
Tej Singhc9203082019-05-03 13:42:23 -07004245/* Test atom, is not logged anywhere */
4246message TestAtomReported {
4247 repeated AttributionNode attribution_node = 1;
4248 optional int32 int_field = 2;
4249 optional int64 long_field = 3;
4250 optional float float_field = 4;
4251 optional string string_field = 5;
4252 optional bool boolean_field = 6;
4253 enum State {
4254 UNKNOWN = 0;
4255 OFF = 1;
4256 ON = 2;
4257 }
4258 optional State state = 7;
4259 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4260}
4261
Maggie Whitefc1aa592018-11-28 21:55:23 -08004262/** Represents USB port overheat event. */
4263message UsbPortOverheatEvent {
4264 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4265 optional int32 plug_temperature_deci_c = 1;
4266
4267 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4268 optional int32 max_temperature_deci_c = 2;
4269
4270 /* Time between USB plug event and overheat threshold trip, in seconds. */
4271 optional int32 time_to_overheat_secs = 3;
4272
4273 /* Time between overheat threshold trip and hysteresis, in seconds. */
4274 optional int32 time_to_hysteresis_secs = 4;
4275
4276 /* Time between hysteresis and active mitigation ending, in seconds. */
4277 optional int32 time_to_inactive_secs = 5;
4278};
4279
Maggie White8735b852019-01-18 11:40:49 -08004280/**
4281 * Logs total effective full charge and discharge cycles on a battery.
4282 * Here are some examples of one effective cycle:
4283 * 1) the battery charges from 0% to 100% and drains back to 0%,
4284 * 2) charging from 50% to 100% and draining back to 50% twice.
4285 * Pulled from:
4286 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4287 */
4288message BatteryCycleCount {
4289 /* Number of total charge and discharge cycles on the system battery. */
4290 optional int32 cycle_count = 1;
4291}
4292
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004293/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004294 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4295 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004296 * Pulled from:
4297 * StatsCompanionService
4298 */
4299
Carmen Agimof12dec122019-03-06 16:14:38 +00004300message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004301
Carmen Agimof12dec122019-03-06 16:14:38 +00004302 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004303 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004304 PUBLIC = 1;
4305 PRIVATE = 2;
4306 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004307 }
4308
Carmen Agimof12dec122019-03-06 16:14:38 +00004309 // The type of external storage.
4310 optional android.stats.storage.ExternalStorageType storage_type = 1;
4311 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4312 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004313 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004314 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004315}
4316
Yangster-macb89807e2018-11-15 21:10:57 -08004317/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004318 * Logs when a connection becomes available and lost.
4319 * Logged in StatsCompanionService.java
4320 */
4321message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004322 // Id of the network.
4323 optional int32 net_id = 1;
4324
4325 enum State {
4326 UNKNOWN = 0;
4327 CONNECTED = 1;
4328 DISCONNECTED = 2;
4329 }
4330 // Connected state of a network.
4331 optional State state = 2;
4332}
4333
4334/**
4335 * Logs when a service starts and stops.
4336 * Logged from:
4337 * services/core/java/com/android/server/am/ActiveServices.java
4338 */
4339message ServiceStateChanged {
4340
4341 optional int32 uid = 1 [(is_uid) = true];
4342
4343 optional string package_name = 2;
4344
4345 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004346
4347 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004348 START = 1;
4349 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004350 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004351
4352 optional State state = 4;
4353}
4354
4355/**
4356 * Logs when a service is launched.
4357 * Logged from:
4358 * services/core/java/com/android/server/am/ActiveServices.java
4359 */
4360message ServiceLaunchReported {
4361
4362 optional int32 uid = 1 [(is_uid) = true];
4363
4364 optional string package_name = 2;
4365
4366 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004367}
Howard Ro688ae182018-09-25 00:09:36 -07004368
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004369/**
4370 * Logs when a hidden API is used.
4371 *
4372 * Logged from:
4373 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4374 */
4375message HiddenApiUsed {
4376 // The uid of the app making the hidden access.
4377 optional int32 uid = 1 [(is_uid) = true];
4378
4379 // Signature of the method or field accessed.
4380 optional string signature = 2;
4381
4382 enum AccessMethod {
4383 NONE = 0;
4384 REFLECTION = 1;
4385 JNI = 2;
4386 LINKING = 3;
4387 }
4388
4389 // Type of access.
4390 optional AccessMethod access_method = 3;
4391
4392 // Whether the access was prevented or not.
4393 optional bool access_denied = 4;
4394}
4395
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004396/**
4397 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4398 * - When user sees privacy chip
4399 * - When user clicks privacy chip
4400 * - How does the user exit the Privacy Dialog
4401 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004402 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4403 */
4404message PrivacyIndicatorsInteracted {
4405
4406 enum Type {
4407 UNKNOWN = 0;
4408 CHIP_VIEWED = 1;
4409 CHIP_CLICKED = 2;
4410 DIALOG_PRIVACY_SETTINGS = 3;
4411 DIALOG_DISMISS = 4;
4412 DIALOG_LINE_ITEM = 5;
4413 }
4414
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004415 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004416
4417 // Used if the type is LINE_ITEM
4418 optional string package_name = 2;
4419}
4420
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004421/**
4422 * Logs information about a package that is moved from the internal to external storage and vice
4423 * versa.
4424 * It logs the package name, the type of the external storage where the package is installed
4425 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4426 * and the move type: if it's from internal to external or the other way around.
4427 *
4428 * Logged from:
4429 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4430 */
4431message AppMovedStorageReported {
4432 enum MoveType {
4433 UNKNOWN = 0;
4434 TO_EXTERNAL = 1;
4435 TO_INTERNAL = 2;
4436 }
4437 // The type of the external storage.
4438 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4439 // The type of move.
4440 optional MoveType move_type = 2;
4441 // The name of the package that was moved.
4442 optional string package_name = 3;
4443}
4444
jianjin8f2dee02019-03-29 14:03:08 -07004445/**
4446 * Logs when system server watchdog occurs.
4447 * Logged from:
4448 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4449 */
4450message SystemServerWatchdogOccurred {
4451 optional string subject = 1;
4452}
4453
4454/**
4455 * Logs when new file added to tombstones.
4456 * Logged from:
4457 * frameworks/base/core/java/com/android/server/BootReceiver.java
4458 */
4459message TombStoneOccurred {
4460}
4461
Hai Zhang5d3328d2019-04-13 21:25:06 +08004462/*
4463 * Information about a role request
4464 *
4465 * Logged from:
4466 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4467 */
4468message RoleRequestResultReported {
4469 // UID of application requesting the role
4470 optional int32 requesting_uid = 1;
4471
4472 // Package name of application requesting the role
4473 optional string requesting_package_name = 2;
4474
4475 // The role to be granted
4476 optional string role_name = 3;
4477
4478 // The count of applications qualifying for the role
4479 optional int32 qualifying_count = 4;
4480
4481 // UID of application current granted the role
4482 optional int32 current_uid = 5;
4483
4484 // Package name of application current granted the role
4485 optional string current_package_name = 6;
4486
4487 // UID of another application that user chose to grant the role to, instead of the requesting
4488 // application
4489 optional int32 granted_another_uid = 7;
4490
4491 // Package name of another application that user chose to grant the role to, instead of the
4492 // requesting application
4493 optional string granted_another_package_name = 8;
4494
4495 enum Result {
4496 UNDEFINED = 0;
4497 // role request was ignored
4498 IGNORED = 1;
4499 // role request was ignored because it's already granted
4500 IGNORED_ALREADY_GRANTED = 2;
4501 // role request was ignored because the application isn't qualified
4502 IGNORED_NOT_QUALIFIED = 3;
4503 // role request was ignored because user said it should be always denied
4504 IGNORED_USER_ALWAYS_DENIED = 4;
4505 // role was granted by user action
4506 USER_GRANTED = 5;
4507 // role was denied by user action
4508 USER_DENIED = 6;
4509 // role was denied by user granting another application the role
4510 USER_DENIED_GRANTED_ANOTHER = 7;
4511 // role was denied and set to be always denied by the user
4512 USER_DENIED_WITH_ALWAYS = 8;
4513 }
4514 // The result of the role request
4515 optional Result result = 9;
4516}
4517
Mark Tabrya824a642019-11-05 12:26:12 -08004518/**
4519 * Logs when a Vehicle Maps Service client's connection state has changed
4520 *
4521 * Logged from:
4522 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4523 */
4524message VmsClientConnectionStateChanged {
4525 // The UID of the VMS client app
4526 optional int32 uid = 1 [(is_uid) = true];
4527
4528 enum State {
4529 UNKNOWN = 0;
4530 // Attempting to connect to the client
4531 CONNECTING = 1;
4532 // Client connection established
4533 CONNECTED = 2;
4534 // Client connection closed unexpectedly
4535 DISCONNECTED = 3;
4536 // Client connection closed by VMS
4537 TERMINATED = 4;
4538 // Error establishing the client connection
4539 CONNECTION_ERROR = 5;
4540 }
4541
4542 optional State state = 2;
4543}
4544
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004545/**
4546 * Logs when MediaProvider has successfully finished scanning a storage volume.
4547 *
4548 * Logged from:
4549 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4550 */
shafik43825842020-04-02 17:30:24 +01004551message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004552 enum Reason {
4553 // Scan triggered due to unknown reason
4554 UNKNOWN = 0;
4555 // Scan triggered due to storage volume being mounted
4556 MOUNTED = 1;
4557 // Scan triggered due to explicit user action or app request
4558 DEMAND = 2;
4559 // Scan triggered due to idle maintenance
4560 IDLE = 3;
4561 }
4562
4563 // Volume type that this event pertains to
4564 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4565 // Reason why this scan was triggered
4566 optional Reason reason = 2;
4567 // Total number of files scanned
4568 optional int64 item_count = 3;
4569 // Duration of scan, normalized per file
4570 optional float normalized_duration_millis = 4;
4571 // Number of database inserts, normalized per file
4572 optional float normalized_insert_count = 5;
4573 // Number of database updates, normalized per file
4574 optional float normalized_update_count = 6;
4575 // Number of database deletes, normalized per file
4576 optional float normalized_delete_count = 7;
4577}
4578
4579/**
4580 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4581 *
4582 * Logged from:
4583 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4584 */
shafik43825842020-04-02 17:30:24 +01004585message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004586 // Volume type that this event pertains to
4587 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004588 // UID of app that requested deletion
4589 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004590 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004591 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004592}
4593
4594/**
4595 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4596 *
4597 * Logged from:
4598 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4599 */
shafik43825842020-04-02 17:30:24 +01004600message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004601 enum Result {
4602 UNKNOWN = 0;
4603 USER_GRANTED = 1;
4604 AUTO_GRANTED = 2;
4605 USER_DENIED = 3;
4606 USER_DENIED_WITH_PREJUDICE = 4;
4607 AUTO_DENIED = 5;
4608 }
4609
4610 // Volume type that this event pertains to
4611 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004612 // UID of app that requested permission
4613 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004614 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004615 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004616 // Result of this request
shafik43825842020-04-02 17:30:24 +01004617 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004618}
4619
4620/**
4621 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4622 *
4623 * Logged from:
4624 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4625 */
shafik43825842020-04-02 17:30:24 +01004626message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004627 // Volume type that this event pertains to
4628 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4629 // Old database version code
4630 optional int32 version_from = 2;
4631 // New database version code
4632 optional int32 version_to = 3;
4633 // Total number of files in database
4634 optional int64 item_count = 4;
4635 // Duration of schema change, normalized per file
4636 optional float normalized_duration_millis = 5;
4637}
4638
4639/**
4640 * Logs when MediaProvider has finished an idle maintenance job.
4641 *
4642 * Logged from:
4643 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4644 */
shafik43825842020-04-02 17:30:24 +01004645message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004646 // Volume type that this event pertains to
4647 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4648
4649 // Total number of files in database
4650 optional int64 item_count = 2;
4651 // Duration of idle maintenance, normalized per file
4652 optional float normalized_duration_millis = 3;
4653 // Number of thumbnails found to be stale, normalized per file
4654 optional float normalized_stale_thumbnails = 4;
4655 // Number of items found to be expired, normalized per file
4656 optional float normalized_expired_media = 5;
4657}
4658
Keun young Park3e033cb2019-12-18 11:27:35 -08004659/**
4660 * Represents boot time event with duration in ms.
4661 *
4662 * Logged from: bootstat and various system server components. Check each enums for details.
4663 */
4664message BootTimeEventDuration {
4665 enum DurationEvent {
4666 UNKNOWN = 0;
4667 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4668 ABSOLUTE_BOOT_TIME = 1;
4669 // Bootloader's 1st stage execution time.
4670 // Logged from bootstat.
4671 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4672 // Bootloader's 1st stage loading time.
4673 // Logged from bootstat.
4674 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4675 // Bootloader's kernel loading time.
4676 // Logged from bootstat.
4677 BOOTLOADER_KERNEL_LOAD = 4;
4678 // Bootloader's 2nd stage execution time.
4679 // Logged from bootstat.
4680 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4681 // Bootloader's 2nd stage loading time.
4682 // Logged from bootstat.
4683 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4684 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4685 // for locked device.
4686 // Logged from bootstat.
4687 BOOTLOADER_UI_WAIT = 7;
4688 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4689 // Logged from bootstat.
4690 BOOTLOADER_TOTAL = 8;
4691 // Shutdown duration inside init for the reboot before the current boot up.
4692 // Logged from f/b/services/.../BootReceiver.java.
4693 SHUTDOWN_DURATION = 9;
4694 // Total time for mounting of disk devices during bootup.
4695 // Logged from f/b/services/.../BootReceiver.java.
4696 MOUNT_DEFAULT_DURATION = 10;
4697 // Total time for early stage mounting of disk devices during bootup.
4698 // Logged from f/b/services/.../BootReceiver.java.
4699 MOUNT_EARLY_DURATION = 11;
4700 // Total time for late stage mounting of disk devices during bootup.
4701 // Logged from f/b/services/.../BootReceiver.java.
4702 MOUNT_LATE_DURATION = 12;
4703 // Average time to scan non-system app after OTA
4704 // Logged from f/b/services/.../PackageManagerService.java
4705 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4706 // Time to initialize Package manager after OTA
4707 // Logged from f/b/services/.../PackageManagerService.java
4708 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4709 // Time to scan all system app from Package manager after OTA
4710 // Logged from f/b/services/.../PackageManagerService.java
4711 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4712 // Init's total time for cold boot stage.
4713 // Logged from bootstat.
4714 COLDBOOT_WAIT = 16;
4715 // Init's total time for initializing selinux.
4716 // Logged from bootstat.
4717 SELINUX_INIT = 17;
4718 // Time since last factory reset.
4719 // Logged from bootstat.
4720 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004721 // Init's total time spent for completing the 1st stage.
4722 // Logged from bootstat.
4723 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004724 }
4725
4726 // Type of the event.
4727 optional DurationEvent event = 1;
4728 // Duration of the event in ms.
4729 optional int64 duration_millis = 2;
4730}
4731
4732/**
4733 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4734 * since boot-up.
4735 *
4736 * Logged from: bootstat and various system server components. Check each enums for details.
4737 */
4738message BootTimeEventElapsedTime {
4739 enum ElapsedTimeEvent {
4740 UNKNOWN = 0;
4741 // Time when init starts 1st stage. Logged from bootstat.
4742 ANDROID_INIT_STAGE_1 = 1;
4743 // Time when sys.boot_completed prop is set.
4744 // Logged from bootstat.
4745 BOOT_COMPLETE = 2;
4746 // BOOT_COMPLETE for encrypted device.
4747 BOOT_COMPLETE_ENCRYPTION = 3;
4748 // BOOT_COMPLETE for device with no encryption.
4749 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4750 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004751 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004752 // BOOT_COMPLETE after factory reset.
4753 FACTORY_RESET_BOOT_COMPLETE = 6;
4754 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4755 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004756 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4757 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004758 // BOOT_COMPLETE after OTA.
4759 OTA_BOOT_COMPLETE = 9;
4760 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4761 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004762 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4763 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004764 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4765 // Logged from f/b/services/.../UserController.java
4766 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4767 // Time when the system starts sending BOOT_COMPLETED broadcast.
4768 // Logged from f/b/services/.../UserController.java
4769 FRAMEWORK_BOOT_COMPLETED = 13;
4770 // Time when the package manager starts init.
4771 // Logged from f/b/services/.../SystemServer.java
4772 PACKAGE_MANAGER_INIT_START = 14;
4773 // Time when package manager is ready
4774 // Logged from f/b/services/.../SystemServer.java
4775 PACKAGE_MANAGER_INIT_READY = 15;
4776 // Represents the time when user has entered unlock credential for system with user pin.
4777 // Logged from bootstat.
4778 POST_DECRYPT = 16;
4779 // Represents the start of zygote's init.
4780 // Logged from zygote itself.
4781 ZYGOTE_INIT_START = 17;
4782 // Represents the start of secondary zygote's init.
4783 // TODO: add logging to zygote
4784 SECONDARY_ZYGOTE_INIT_START = 18;
4785 // Represents the start of system server's init.
4786 // Logged from f/b/services/.../SystemServer.java
4787 SYSTEM_SERVER_INIT_START = 19;
4788 // Represents the completion of system server's init.
4789 // Logged from f/b/services/.../SystemServer.java
4790 SYSTEM_SERVER_READY = 20;
4791 // Represents the start of launcher during boot-up.
4792 // TODO: add logging
4793 LAUNCHER_START = 21;
4794 // Represents the completion of launcher's initial rendering. User can use other apps from
4795 // launcher from this point.
4796 // TODO: add logging
4797 LAUNCHER_SHOWN = 22;
4798 }
4799
4800 // Type of the event.
4801 optional ElapsedTimeEvent event = 1;
4802 // Time since bootup for the event.
4803 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4804 optional int64 time_millis = 2;
4805}
4806
4807/**
4808 * Boot time events with UTC time.
4809 *
4810 * Logged from: bootstat and various system server components. Check each enums for details.
4811 */
4812message BootTimeEventUtcTime {
4813 enum UtcTimeEvent {
4814 UNKNOWN = 0;
4815 // Time of the bootstat's marking of 1st boot after the last factory reset.
4816 // Logged from bootstat.
4817 FACTORY_RESET_RESET_TIME = 1;
4818 // The time when bootstat records FACTORY_RESET_* events. This is close to
4819 // BOOT_COMPLETE time for the current bootup.
4820 // Logged from bootstat.
4821 FACTORY_RESET_CURRENT_TIME = 2;
4822 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4823 // Logged from bootstat.
4824 FACTORY_RESET_RECORD_VALUE = 3;
4825 }
4826
4827 // Type of the event.
4828 optional UtcTimeEvent event = 1;
4829 // UTC time for the event.
4830 optional int64 utc_time_secs = 2;
4831}
4832
4833/**
4834 * Boot time events representing specific error code during bootup.
4835 * Meaning of error code can be different per each event type.
4836 *
4837 * Logged from: bootstat and various system server components. Check each enums for details.
4838 */
4839message BootTimeEventErrorCode {
4840 enum ErrorCodeEvent {
4841 UNKNOWN = 0;
4842 // Linux error code for time() call to get the current UTC time.
4843 // Logged from bootstat.
4844 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4845 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4846 // as UMOUNT_STAT_* from init/reboot.cpp.
4847 // Logged from f/b/services/.../BootReceiver.java.
4848 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004849 // Reprepsents fie system mounting error code of /data partition for the current boot.
4850 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004851 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004852 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004853 }
4854
4855 // Type of the event.
4856 optional ErrorCodeEvent event = 1;
4857 // error code defined per each event type.
4858 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4859 // FS_MGR_FS_STAT.
4860 optional int32 error_code = 2;
4861}
4862
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004863/**
4864 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4865 * after an OTA.
4866 *
4867 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004868 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004869 */
4870message SnapshotMergeReported {
4871 // Keep in sync with
4872 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4873 enum UpdateState {
4874 // No update or merge is in progress.
4875 NONE = 0;
4876 // An update is applying; snapshots may already exist.
4877 INITIATED = 1;
4878 // An update is pending, but has not been successfully booted yet.
4879 UNVERIFIED = 2;
4880 // The kernel is merging in the background.
4881 MERGING = 3;
4882 // Post-merge cleanup steps could not be completed due to a transient
4883 // error, but the next reboot will finish any pending operations.
4884 MERGE_NEEDS_REBOOT = 4;
4885 // Merging is complete, and needs to be acknowledged.
4886 MERGE_COMPLETED = 5;
4887 // Merging failed due to an unrecoverable error.
4888 MERGE_FAILED = 6;
4889 // The update was implicitly cancelled, either by a rollback or a flash
4890 // operation via fastboot. This state can only be returned by WaitForMerge.
4891 CANCELLED = 7;
4892 };
4893
4894 // Status of the update after the merge attempts.
4895 optional UpdateState final_state = 1;
4896
4897 // Time to complete a merge operation in milliseconds.
4898 // A negative value corresponds to the case in which the merge operation
4899 // was interrupted and resumed (e.g. in case of a system reboot during the
4900 // merge).
4901 optional int64 duration_millis = 2;
4902
4903 // Number of reboots that occurred after issuing and before completing the
4904 // merge of all the snapshot devices.
4905 optional int32 intermediate_reboots = 3;
Alessio Balsini2294f392020-05-26 11:11:20 +01004906
4907 // The device has been upgraded to Virtual A/B.
4908 optional bool is_vab_retrofit = 4;
4909
4910 // Space that has been temporarily allocated in the /data partition
4911 // containing the dm-snapshot's copy-on-write data generated during a
4912 // Virtual A/B update.
4913 optional int64 cow_file_size_bytes = 5;
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004914}
4915
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -07004916/**
4917 * Event representing when BlobStoreManager.Session#commit() is called
4918 *
4919 * Logged from:
4920 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4921 */
4922message BlobCommitted {
4923 // Uid of the Blob committer
4924 optional int32 uid = 1 [(is_uid) = true];
4925
4926 // Id of the Blob committed
4927 optional int64 blob_id = 2;
4928
4929 // Size of the Blob
4930 optional int64 size = 3;
4931
4932 enum Result {
4933 UNKNOWN = 0;
4934 // Commit Succeeded
4935 SUCCESS = 1;
4936 // Commit Failed: Error occurred during commit
4937 ERROR_DURING_COMMIT = 2;
4938 // Commit Failed: Digest of the data did not match Blob digest
4939 DIGEST_MISMATCH = 3;
4940 }
4941 optional Result result = 4;
4942}
4943
4944/**
4945 * Event representing when BlobStoreManager#acquireLease() is called
4946 *
4947 * Logged from:
4948 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4949 */
4950message BlobLeased{
4951 // Uid of the Blob leasee
4952 optional int32 uid = 1 [(is_uid) = true];
4953
4954 // Id of the Blob leased or 0 if the Blob does not exist
4955 optional int64 blob_id = 2;
4956
4957 // Size of the Blob or 0 if the Blob does not exist
4958 optional int64 size = 3;
4959
4960 enum Result {
4961 UNKNOWN = 0;
4962 // Lease Succeeded
4963 SUCCESS = 1;
4964 // Lease Failed: Blob does not exist
4965 BLOB_DNE = 2;
4966 // Lease Failed: Leasee does not have access to the Blob
4967 ACCESS_NOT_ALLOWED = 3;
4968 // Lease Failed: Leasee requested an invalid expiry duration
4969 LEASE_EXPIRY_INVALID = 4;
4970 // Lease Failed: Leasee has exceeded the total data lease limit
4971 DATA_SIZE_LIMIT_EXCEEDED = 5;
4972 }
4973 optional Result result = 4;
4974}
4975
4976/**
4977 * Event representing when BlobStoreManager#openBlob() is called
4978 *
4979 * Logged from:
4980 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
4981 */
4982message BlobOpened{
4983 // Uid of the Blob opener
4984 optional int32 uid = 1 [(is_uid) = true];
4985
4986 // Id of the Blob opened or 0 if the Blob does not exist
4987 optional int64 blob_id = 2;
4988
4989 // Size of the Blob or 0 if the Blob does not exist
4990 optional int64 size = 3;
4991
4992 enum Result {
4993 UNKNOWN = 0;
4994 // Open Succeeded
4995 SUCCESS = 1;
4996 // Open Failed: Blob does not exist
4997 BLOB_DNE = 2;
4998 // Open Failed: Opener does not have access to the Blob
4999 ACCESS_NOT_ALLOWED = 3;
5000 }
5001 optional Result result = 4;
5002}
5003
Chenjie Yubbcbc602018-02-05 16:51:52 -08005004//////////////////////////////////////////////////////////////////////
5005// Pulled atoms below this line //
5006//////////////////////////////////////////////////////////////////////
5007
5008/**
David Chenc8a43242017-10-17 16:23:28 -07005009 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
5010 *
5011 * Pulled from:
5012 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
5013 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005014message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005015 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005016
5017 optional int64 rx_bytes = 2;
5018
5019 optional int64 rx_packets = 3;
5020
5021 optional int64 tx_bytes = 4;
5022
5023 optional int64 tx_packets = 5;
5024}
5025
5026/**
5027 * Pulls bytes transferred via wifi (separated by foreground and background usage).
5028 *
5029 * Pulled from:
5030 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
5031 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005032message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005033 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005035 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
5036 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005037
5038 optional int64 rx_bytes = 3;
5039
5040 optional int64 rx_packets = 4;
5041
5042 optional int64 tx_bytes = 5;
5043
5044 optional int64 tx_packets = 6;
5045}
5046
5047/**
5048 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
5049 *
5050 * Pulled from:
5051 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
5052 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005053message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005054 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005055
5056 optional int64 rx_bytes = 2;
5057
5058 optional int64 rx_packets = 3;
5059
5060 optional int64 tx_bytes = 4;
5061
5062 optional int64 tx_packets = 5;
5063}
5064
5065/**
5066 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
5067 *
5068 * Pulled from:
5069 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
5070 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005071message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07005072 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07005073
Yao Chenc40a19d2018-03-15 16:48:25 -07005074 // 1 denotes foreground and 0 denotes background. This is called Set in
5075 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005076 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07005077
5078 optional int64 rx_bytes = 3;
5079
5080 optional int64 rx_packets = 4;
5081
5082 optional int64 tx_bytes = 5;
5083
5084 optional int64 tx_packets = 6;
5085}
5086
5087/**
junyulai8d1a6092020-05-07 13:38:15 +08005088 * Used for pull network statistics via mobile|wifi networks, and sliced by interesting dimensions.
junyulai8b794b72020-05-19 17:36:13 +08005089 * Note that the data is expected to be sliced into more dimensions in future. In other words,
5090 * the caller must not assume any row of data is one full report when filtering with a set of
5091 * matching conditions, because future data may represent with multiple rows what is currently
5092 * represented by one.
5093 * To avoid being broken by future slicing, callers must take care to aggregate rows even if they
5094 * query all the existing columns.
junyulai8d1a6092020-05-07 13:38:15 +08005095 *
5096 * Pulled from:
5097 * StatsPullAtomService (using NetworkStatsService to get NetworkStats)
5098 */
5099message DataUsageBytesTransfer {
5100 // State of this record. Should be NetworkStats#SET_DEFAULT or NetworkStats#SET_FOREGROUND to
5101 // indicate the foreground state, or NetworkStats#SET_ALL to indicate the record is for all
5102 // states combined, not including debug states. See NetworkStats#SET_*.
5103 optional int32 state = 1;
5104
5105 optional int64 rx_bytes = 2;
5106
5107 optional int64 rx_packets = 3;
5108
5109 optional int64 tx_bytes = 4;
5110
5111 optional int64 tx_packets = 5;
5112
5113 // Radio Access Technology (RAT) type of this record, should be one of
5114 // TelephonyManager#NETWORK_TYPE_* constants, or NetworkTemplate#NETWORK_TYPE_ALL to indicate
5115 // the record is for all rat types combined.
5116 optional int32 rat_type = 6;
5117
5118 // Mcc/Mnc read from sim if the record is for a specific subscription, null indicates the
junyulai8b794b72020-05-19 17:36:13 +08005119 // record is combined across subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005120 optional string sim_mcc = 7;
5121 optional string sim_mnc = 8;
5122
junyulai8b794b72020-05-19 17:36:13 +08005123 // Allows mobile virtual network operators (MVNOs) to be identified with individual IDs.
5124 // See TelephonyManager#getSimCarrierId.
5125 optional int32 carrier_id = 9;
5126
junyulai8d1a6092020-05-07 13:38:15 +08005127 // Enumeration of opportunistic states with an additional ALL state indicates the record is
5128 // combined regardless of the boolean value in its field.
5129 enum DataSubscriptionState {
junyulai8b794b72020-05-19 17:36:13 +08005130 UNKNOWN = 0; // For server side backward compatibility.
junyulai8d1a6092020-05-07 13:38:15 +08005131 ALL = 1;
5132 OPPORTUNISTIC = 2;
5133 NOT_OPPORTUNISTIC = 3;
5134 }
5135 // Mark whether the subscription is an opportunistic data subscription, and ALL indicates the
junyulai8b794b72020-05-19 17:36:13 +08005136 // record is combined across opportunistic data subscriptions.
junyulai8d1a6092020-05-07 13:38:15 +08005137 // See {@link SubscriptionManager#setOpportunistic}.
junyulai8b794b72020-05-19 17:36:13 +08005138 optional DataSubscriptionState opportunistic_data_sub = 10;
junyulai8d1a6092020-05-07 13:38:15 +08005139}
5140
5141/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005142 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
5143 *
5144 * Pulled from:
5145 * StatsCompanionService
5146 */
5147message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07005148 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005149
5150 optional int64 rx_bytes = 2;
5151
5152 optional int64 tx_bytes = 3;
5153}
5154
5155/**
David Chenc8a43242017-10-17 16:23:28 -07005156 * Pulls the kernel wakelock durations. This atom is adapted from
5157 * android/internal/os/KernelWakelockStats.java
5158 *
5159 * Pulled from:
5160 * StatsCompanionService using KernelWakelockReader.
5161 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005162message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07005163 optional string name = 1;
5164
5165 optional int32 count = 2;
5166
5167 optional int32 version = 3;
5168
Yangster-maca8a30442018-10-13 23:46:34 -07005169 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07005170}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005171
Chenjie Yu05013b32017-11-21 10:21:41 -08005172/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005173 * Pulls low power state information. If power.stats HAL is not available, this
5174 * includes platform and subsystem sleep state information,
5175 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
5176 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005177 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005178 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005179 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
5180 * as defined in:
5181 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07005182 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005183message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08005184 // Subsystem name
5185 optional string subsystem_name = 1;
5186 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
5187 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08005188 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
5189 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08005190 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005191 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08005192 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08005193 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08005194 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07005195}
Chenjie Yu7f8def92017-11-03 09:33:15 -07005196
Chenjie Yu05013b32017-11-21 10:21:41 -08005197/**
Bookatz92da2832018-11-01 18:10:03 -07005198 * Pulls on-device power measurement information.
5199 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
5200 * Pulled from:
5201 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
5202 */
5203message OnDevicePowerMeasurement {
5204 // Name of the subsystem (to which the rail belongs).
5205 optional string subsystem_name = 1;
5206
5207 // Rail name. The rail lies within the subsystem.
5208 optional string rail_name = 2;
5209
5210 // Time (in ms since boot) at which the rail energy value was measured.
5211 // This may differ slightly from the time that statsd logs this information.
5212 optional uint64 measurement_timestamp_millis = 3;
5213
5214 // Accumulated energy used via the rail since device boot in uWs.
5215 optional uint64 energy_microwatt_secs = 4;
5216}
5217
5218/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07005219 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08005220 * Pulls the time the cpu spend on the frequency index. Frequency index
5221 * starts from highest to lowest. The value should be monotonically
5222 * increasing since boot. However, if there is a cpu
5223 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07005224 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005225message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07005226 optional uint32 cluster = 1;
5227 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005228 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07005229}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005230
Chenjie Yu05013b32017-11-21 10:21:41 -08005231/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005232 * Pulls Cpu Time Per Uid.
5233 * Note that isolated process uid time should be attributed to host uids.
5234 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005235message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005236 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005237 optional uint64 user_time_micros = 2;
5238 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005239}
5240
5241/**
5242 * Pulls Cpu Time Per Uid per frequency.
5243 * Note that isolated process uid time should be attributed to host uids.
5244 * For each uid, we order the time by descending frequencies.
5245 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005246message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005247 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005248 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005249 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005250}
Hugo Benichi884970e2017-11-14 22:42:46 +09005251
Chenjie Yu05013b32017-11-21 10:21:41 -08005252/**
5253 * Pulls Wifi Controller Activity Energy Info
5254 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005255message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005256 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005257 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005258 // stack reported state
5259 // TODO: replace this with proto enum
5260 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005261 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005262 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005263 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005264 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005265 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005266 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005267 // product of current(mA), voltage(V) and time(ms)
5268 optional uint64 controller_energy_used = 6;
5269}
5270
5271/**
5272 * Pulls Modem Activity Energy Info
5273 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005274message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005275 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005276 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005277 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005278 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005279 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005280 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005281 /**
5282 * Tx power index
5283 * index 0 = tx_power < 0dBm
5284 * index 1 = 0dBm < tx_power < 5dBm
5285 * index 2 = 5dBm < tx_power < 15dBm
5286 * index 3 = 15dBm < tx_power < 20dBm
5287 * index 4 = tx_power > 20dBm
5288 */
5289 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005290 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005291 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005292 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005293 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005294 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005295 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005296 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005297 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005298 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005299 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005300 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005301 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005302 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005303}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005304
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005305/**
5306 * Pulls Bluetooth Activity Energy Info
5307 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5308 */
5309message BluetoothActivityInfo {
5310 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005311 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005312 // bluetooth stack state
5313 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005314 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005315 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005316 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005317 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005318 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005319 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005320 // product of current(mA), voltage(V) and time(ms)
5321 optional uint64 energy_used = 6;
5322}
5323
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005324/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005325 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005326 *
5327 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005328 */
5329message ProcessMemoryState {
5330 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005331 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005332
5333 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005334 // Usually package name, "system" for system server.
5335 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005336 optional string process_name = 2;
5337
Rafal Slawikda51b932018-12-13 16:31:33 +00005338 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005339 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005340
5341 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005342 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005343
5344 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005345 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005346
Rajeev Kumar90235992018-01-29 11:06:48 -08005347 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005348 // Value is read from memory.stat, field total_rss if per-app memory
5349 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005350 optional int64 rss_in_bytes = 6;
5351
5352 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005353 // Value is read from memory.stat, field total_cache if per-app memory
5354 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005355 optional int64 cache_in_bytes = 7;
5356
5357 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005358 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005359 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005360 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005361
Rafal Slawik203c3db2019-09-25 19:53:01 +01005362 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005363 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005364
Rafal Slawik203c3db2019-09-25 19:53:01 +01005365 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5366 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005367
Rafal Slawik203c3db2019-09-25 19:53:01 +01005368 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5369 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005370}
5371
5372/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005373 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005374 *
5375 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5376 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005377 *
5378 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005379 */
5380message ProcessMemoryHighWaterMark {
5381 // The uid if available. -1 means not available.
5382 optional int32 uid = 1 [(is_uid) = true];
5383
Rafal Slawikda51b932018-12-13 16:31:33 +00005384 // The process name.
5385 // Usually package name or process cmdline.
5386 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005387 optional string process_name = 2;
5388
Rafal Slawik239b6802019-09-09 18:46:01 +01005389 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5390 // computed by converting kilobytes to bytes.
5391 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5392
Rafal Slawik3bea8952018-11-15 12:39:33 +00005393 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5394 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005395 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005396}
5397
5398/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005399 * Logs the memory stats for a process.
5400 *
5401 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5402 * and for selected native processes.
5403 */
5404message ProcessMemorySnapshot {
5405 // The uid if available. -1 means not available.
5406 optional int32 uid = 1 [(is_uid) = true];
5407
5408 // The process name.
5409 // Usually package name or process cmdline.
5410 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5411 optional string process_name = 2;
5412
5413 // The pid of the process.
5414 // Allows to disambiguate instances of the process.
5415 optional int32 pid = 3;
5416
5417 // The current OOM score adjustment value.
5418 // Read from ProcessRecord for managed processes.
5419 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5420 optional int32 oom_score_adj = 4;
5421
5422 // The current RSS of the process.
5423 // VmRSS from /proc/pid/status.
5424 optional int32 rss_in_kilobytes = 5;
5425
5426 // The current anon RSS of the process.
5427 // RssAnon from /proc/pid/status.
5428 optional int32 anon_rss_in_kilobytes = 6;
5429
5430 // The current swap size of the process.
5431 // VmSwap from /proc/pid/status.
5432 optional int32 swap_in_kilobytes = 7;
5433
5434 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5435 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5436}
5437
5438/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005439 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005440 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005441message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005442 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005443}
5444
5445/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005446 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005447 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005448message SystemUptime {
5449 // Milliseconds since the system was booted.
5450 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5451 // for external input).
5452 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005453 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005454}
5455
5456/*
5457 * Reads from /proc/uid_concurrent_active_time which has the format:
5458 * active: X (X is # cores)
5459 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5460 * [uid1]: [time-0] [time-1] [time-2] ... ...
5461 * ...
5462 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5463 * The file contains a monotonically increasing count of time for a single boot.
5464 */
5465message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005466 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005467 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005468}
5469
5470/**
5471 * Reads from /proc/uid_concurrent_policy_time which has the format:
5472 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5473 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5474 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5475 * ...
5476 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5477 * The file contains a monotonically increasing count of time for a single boot.
5478 */
5479message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005480 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005481 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005482 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005483}
5484
5485/*
5486 * Pulls free disk space, for data, system partition and temporary directory.
5487 */
5488message DiskSpace {
5489 // available bytes in data partition
5490 optional uint64 data_available_bytes = 1;
5491 // available bytes in system partition
5492 optional uint64 system_available_bytes = 2;
5493 // available bytes in download cache or temp directories
5494 optional uint64 temp_available_bytes = 3;
5495}
Tej Singhbf972d92018-01-10 20:51:13 -08005496
5497/**
5498 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005499 *
5500 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005501 */
5502message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005503 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005504}
5505
5506/**
5507 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005508 * Pulled from:
5509 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005510 */
5511message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005512 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005513}
5514
5515/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005516 * Pulls battery voltage.
5517 * Pulled from:
5518 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5519 */
5520message BatteryVoltage {
5521 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005522 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005523}
5524
5525/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005526 * Pulls battery level (percent full, from 0 to 100).
5527 *
5528 * Pulled from:
5529 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5530 */
5531message BatteryLevel {
5532 // Battery level. Should be in [0, 100].
5533 optional int32 battery_level = 1;
5534}
5535
5536/**
Tej Singhd89137e2018-03-26 14:51:40 -07005537 * Pulls the temperature of various parts of the device.
5538 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005539 *
Maggie White442b6312019-04-05 16:26:44 -07005540 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005541 */
5542message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005543 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005544 optional android.os.TemperatureTypeEnum sensor_location = 1;
5545
5546 // The name of the temperature source. Eg. CPU0
5547 optional string sensor_name = 2;
5548
Tej Singhd89137e2018-03-26 14:51:40 -07005549 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005550 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005551 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005552
5553 // Relative severity of the throttling, see enum definition.
5554 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005555}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005556
5557/**
5558 * Pulls the statistics of calls to Binder.
5559 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005560 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5561 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005562 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005563 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005564 */
5565message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005566 // UID of the process responsible for the binder transaction. It will be set if the process
5567 // executing the binder transaction attribute the transaction to another uid using
5568 // Binder.setThreadWorkSource().
5569 //
5570 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005571 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005572 // UID of the process executing the binder transaction.
5573 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005574 // Fully qualified class name of the API call.
5575 //
5576 // This is a system server class name.
5577 //
5578 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5579 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5580 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5581 // commonly used APIs.
5582 optional string service_class_name = 2;
5583 // Method name of the API call. It can also be a transaction code if we cannot
5584 // resolve it to a name. See Binder#getTransactionName.
5585 //
5586 // This is a system server method name.
5587 optional string service_method_name = 3;
5588 // Total number of API calls.
5589 optional int64 call_count = 4;
5590 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5591 optional bool screen_interactive = 13;
5592 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5593 // call_count will be equal to recorded_call_count.
5594 //
5595 // If recorded_call_count is different than call_count, it means data collection has been
5596 // sampled. All the fields below will be sampled in this case.
5597 optional int64 recorded_call_count = 12;
5598 // Number of exceptions thrown by the API.
5599 optional int64 recorded_exception_count = 5;
5600 // Total latency of all API calls.
5601 // Average can be computed using total_latency_micros / recorded_call_count.
5602 optional int64 recorded_total_latency_micros = 6;
5603 // Maximum latency of one API call.
5604 optional int64 recorded_max_latency_micros = 7;
5605 // Total CPU usage of all API calls.
5606 // Average can be computed using total_cpu_micros / recorded_call_count.
5607 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5608 optional int64 recorded_total_cpu_micros = 8;
5609 // Maximum CPU usage of one API call.
5610 optional int64 recorded_max_cpu_micros = 9;
5611 // Maximum parcel reply size of one API call.
5612 optional int64 recorded_max_reply_size_bytes = 10;
5613 // Maximum parcel request size of one API call.
5614 optional int64 recorded_max_request_size_bytes = 11;
5615}
5616
5617/**
5618 * Pulls the statistics of exceptions during calls to Binder.
5619 *
5620 * Binder stats are cumulative from boot unless somebody reset the data using
5621 * > adb shell dumpsys binder_calls_stats --reset
5622 */
5623message BinderCallsExceptions {
5624 // Exception class name, e.g. java.lang.IllegalArgumentException.
5625 //
5626 // This is an exception class name thrown by the system server.
5627 optional string exception_class_name = 1;
5628 // Total number of exceptions.
5629 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005630}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005631
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005632/**
5633 * Pulls the statistics of message dispatching on HandlerThreads.
5634 *
5635 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5636 * config on the device.
5637 *
5638 * Next tag: 11
5639 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005640message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005641 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005642 optional int32 uid = 1 [(is_uid) = true];
5643
5644 // Fully qualified class name of the handler target class.
5645 //
5646 // This field does not contain PII. This is a system server class name.
5647 optional string handler_class_name = 2;
5648
5649 // The name of the thread that runs the Looper.
5650 //
5651 // This field does not contain PII. This is a system server thread name.
5652 optional string looper_thread_name = 3;
5653
5654 // The name of the dispatched message.
5655 //
5656 // This field does not contain PII. This is a system server constant or class
5657 // name.
5658 optional string message_name = 4;
5659
5660 // Total number of successfully dispatched messages.
5661 optional int64 message_count = 5;
5662
5663 // Total number of messages that failed dispatching.
5664 optional int64 exception_count = 6;
5665
5666 // Total number of processed messages we have data recorded for. If we
5667 // collected data for all the messages, message_count will be equal to
5668 // recorded_message_count.
5669 //
5670 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005671 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005672 optional int64 recorded_message_count = 7;
5673
5674 // Total latency of all processed messages.
5675 // Average can be computed using recorded_total_latency_micros /
5676 // recorded_message_count.
5677 optional int64 recorded_total_latency_micros = 8;
5678
5679 // Total CPU usage of all processed message.
5680 // Average can be computed using recorded_total_cpu_micros /
5681 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005682 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005683 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005684
5685 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5686 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005687
5688 // Max recorded CPU usage of all processed messages.
5689 optional int64 recorded_max_cpu_micros = 11;
5690
5691 // Max recorded latency of all processed messages.
5692 optional int64 recorded_max_latency_micros = 12;
5693
5694 // Total number of messages we tracked the dispatching delay for. If we
5695 // collected data for all the messages, message_count will be equal to
5696 // recorded_delay_message_count.
5697 //
5698 // If recorded_delay_message_count is different than message_count, it means data
5699 // collection has been sampled or/and not all messages specified the target dispatch time.
5700 // The fields below will be sampled in this case.
5701 optional int64 recorded_delay_message_count = 13;
5702
5703 // Total dispatching delay of all processed messages.
5704 // Calculated as a difference between the target dispatching time (Message.when)
5705 // and the actual dispatching time.
5706 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5707 optional int64 recorded_total_delay_millis = 14;
5708
5709 // Max dispatching delay of all processed messages.
5710 // Calculated as a difference between the target dispatching time (Message.when)
5711 // and the actual dispatching time.
5712 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005713}
Tej Singh86dc9db2018-09-06 00:39:57 +00005714
5715/**
5716 * Pulls disk information, such as write speed and latency.
5717 */
5718message DiskStats {
5719 // Time taken to open, write 512B to, and close a file.
5720 // -1 if error performing the check.
5721 optional int64 data_write_latency_millis = 1;
5722
5723 optional bool file_based_encryption = 2;
5724
5725 // Recent disk write speed in kB/s.
5726 // -1 if error querying storageed.
5727 // 0 if data is unavailable.
5728 optional int32 recent_disk_write_speed = 3;
5729}
5730
5731
5732/**
5733 * Free and total bytes of the Data, Cache, and System partition.
5734 */
5735message DirectoryUsage {
5736 enum Directory {
5737 UNKNOWN = 0;
5738 DATA = 1;
5739 CACHE = 2;
5740 SYSTEM = 3;
5741 }
5742 optional Directory directory = 1;
5743 optional int64 free_bytes = 2;
5744 optional int64 total_bytes = 3;
5745}
5746
5747
5748/**
5749 * Size of an application: apk size, data size, and cache size.
5750 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5751 * Information is only reported for apps with the primary user (user 0).
5752 * Sizes are aggregated by package name.
5753 */
5754message AppSize {
5755 // Including uids will involve modifying diskstats logic.
5756 optional string package_name = 1;
5757 // App size in bytes. -1 if unavailable.
5758 optional int64 app_size_bytes = 2;
5759 // App data size in bytes. -1 if unavailable.
5760 optional int64 app_data_size_bytes = 3;
5761 // App cache size in bytes. -1 if unavailable.
5762 optional int64 app_cache_size_bytes = 4;
5763 // Time that the cache file was produced.
5764 // Uses System.currentTimeMillis(), which is wall clock time.
5765 optional int64 cache_time_millis = 5;
5766}
5767
5768
5769/**
5770 * Size of a particular category. Eg: photos, videos.
5771 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5772 */
5773message CategorySize {
5774 enum Category {
5775 UNKNOWN = 0;
5776 APP_SIZE = 1;
5777 APP_DATA_SIZE = 2;
5778 APP_CACHE_SIZE = 3;
5779 PHOTOS = 4;
5780 VIDEOS = 5;
5781 AUDIO = 6;
5782 DOWNLOADS = 7;
5783 SYSTEM = 8;
5784 OTHER = 9;
5785 }
5786 optional Category category = 1;
5787 // Category size in bytes.
5788 optional int64 size_bytes = 2;
5789 // Time that the cache file was produced.
5790 // Uses System.currentTimeMillis(), which is wall clock time.
5791 optional int64 cache_time_millis = 3;
5792}
Tej Singhd6d6d772018-09-05 17:41:25 -07005793
5794/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005795 * Pulls per uid I/O stats. The stats are cumulative since boot.
5796 *
5797 * Read/write bytes are I/O events from a storage device
5798 * Read/write chars are data requested by read/write syscalls, and can be
5799 * satisfied by caching.
5800 *
5801 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5802 */
5803message DiskIo {
5804 optional int32 uid = 1 [(is_uid) = true];
5805 optional int64 fg_chars_read = 2;
5806 optional int64 fg_chars_write = 3;
5807 optional int64 fg_bytes_read = 4;
5808 optional int64 fg_bytes_write = 5;
5809 optional int64 bg_chars_read = 6;
5810 optional int64 bg_chars_write = 7;
5811 optional int64 bg_bytes_read = 8;
5812 optional int64 bg_bytes_write = 9;
5813 optional int64 fg_fsync = 10;
5814 optional int64 bg_fsync= 11;
5815}
5816
5817
5818/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005819 * Pulls the number of fingerprints for each user.
5820 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005821 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005822 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005823message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005824 // The associated user. Eg: 0 for owners, 10+ for others.
5825 // Defined in android/os/UserHandle.java
5826 optional int32 user = 1;
5827 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005828 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005829}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005830
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005831/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005832 * Pulls the number of faces for each user.
5833 *
5834 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5835 */
5836message NumFacesEnrolled {
5837 // 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 faces registered to that user.
5841 optional int32 num_faces_enrolled = 2;
5842}
5843/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005844 * A mapping of role holder -> role
5845 */
5846message RoleHolder {
5847 // uid of the role holder
5848 optional int32 uid = 1 [(is_uid) = true];
5849
5850 // package name of the role holder
5851 optional string package_name = 2;
5852
5853 // the role held
5854 optional string role = 3;
5855}
5856
Yangsteraf9aee72018-10-12 09:26:16 -07005857message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005858 // These are all in byte resolution.
5859 optional int64 min = 1 [deprecated = true];
5860 optional int64 average = 2 [deprecated = true];
5861 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005862
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005863 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5864 // int64 fields.
5865 optional int32 mean_kb = 4;
5866 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005867}
5868
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005869// A reduced subset of process states; reducing the number of possible states allows more
5870// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5871enum ProcessStateAggregated {
5872 PROCESS_STATE_UNKNOWN = 0;
5873 // Persistent system process.
5874 PROCESS_STATE_PERSISTENT = 1;
5875 // Top activity; actually any visible activity.
5876 PROCESS_STATE_TOP = 2;
5877 // Process binding to top or a foreground service.
5878 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5879 // Processing running a foreground service.
5880 PROCESS_STATE_FGS = 4;
5881 // Important foreground process (ime, wallpaper, etc).
5882 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5883 // Important background process.
5884 PROCESS_STATE_BACKGROUND = 6;
5885 // Process running a receiver.
5886 PROCESS_STATE_RECEIVER = 7;
5887 // All kinds of cached processes.
5888 PROCESS_STATE_CACHED = 8;
5889}
5890
5891// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005892message ProcessStatsStateProto {
5893 optional android.service.procstats.ScreenState screen_state = 1;
5894
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005895 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005896
5897 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5898 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005899 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5900
5901 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005902
5903 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005904 optional int64 duration_millis = 4 [deprecated = true];
5905 // Same as above, but with minute resolution so it fits into an int32.
5906 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005907
5908 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005909 optional int64 realtime_duration_millis = 9 [deprecated = true];
5910 // Same as above, but with minute resolution so it fits into an int32.
5911 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005912
5913 // # of samples taken
5914 optional int32 sample_size = 5;
5915
5916 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005917 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005918
5919 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005920 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005921
5922 // RSS is memory resident for this process
5923 optional AggStats rss = 8;
5924}
5925
Jing Ji060d6862020-04-13 19:36:31 -07005926// Next Tag: 8
Yangsteraf9aee72018-10-12 09:26:16 -07005927message ProcessStatsProto {
5928 // Name of process.
5929 optional string process = 1;
5930
5931 // Uid of the process.
Jing Ji1cd1f602020-06-03 13:45:36 -07005932 optional int32 uid = 2 [(is_uid) = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005933
5934 // Information about how often kills occurred
5935 message Kill {
5936 // Count of excessive CPU kills
5937 optional int32 cpu = 1;
5938
5939 // Count of kills when cached
5940 optional int32 cached = 2;
5941
5942 // PSS stats during cached kill
5943 optional AggStats cached_pss = 3;
5944 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005945 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005946
5947 // Time and memory spent in various states.
5948 repeated ProcessStatsStateProto states = 5;
5949
5950 // Total time process has been running... screen_state, memory_state, and process_state
5951 // will not be set.
5952 optional ProcessStatsStateProto total_running_state = 6;
Jing Ji060d6862020-04-13 19:36:31 -07005953
5954 // Association data for this process in this state;
5955 // each entry here is one association.
5956 repeated ProcessStatsAssociationProto assocs = 7;
5957}
5958
Jing Ji1cd1f602020-06-03 13:45:36 -07005959// Next Tag: 6
Jing Ji060d6862020-04-13 19:36:31 -07005960message ProcessStatsAssociationProto {
5961 // Procss Name of the associated process (client process of service binding)
5962 optional string assoc_process_name = 1;
5963
5964 // Package Name of the associated package (client package of service binding)
Jing Ji1cd1f602020-06-03 13:45:36 -07005965 optional string assoc_package_name = 2 [deprecated = true];
5966
5967 // UID of the associated process/package (client package of service binding)
5968 optional int32 assoc_uid = 5 [(is_uid) = true];
Jing Ji060d6862020-04-13 19:36:31 -07005969
5970 // Total count of the times this association (service binding) appeared.
5971 optional int32 total_count = 3;
5972
5973 // Uptime total duration in seconds this association (service binding) was around.
5974 optional int32 total_duration_secs = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005975}
5976
5977message PackageServiceOperationStatsProto {
5978 // Operate enum: Started, Foreground, Bound, Executing
5979 optional android.service.procstats.ServiceOperationState operation = 1;
5980
5981 // Number of times the service was in this operation.
5982 optional int32 count = 2;
5983
5984 // Information about a state the service can be in.
5985 message StateStats {
5986 // Screen state enum.
5987 optional android.service.procstats.ScreenState screen_state = 1;
5988 // Memory state enum.
5989 optional android.service.procstats.MemoryState memory_state = 2;
5990
5991 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005992 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005993 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005994 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005995 }
5996 repeated StateStats state_stats = 3;
5997}
5998
5999message PackageServiceStatsProto {
6000 // Name of service component.
6001 optional string service_name = 1;
6002
6003 // The operation stats.
6004 // The package_name, package_uid, package_version, service_name will not be set to save space.
6005 repeated PackageServiceOperationStatsProto operation_stats = 2;
6006}
6007
6008message PackageAssociationSourceProcessStatsProto {
6009 // Uid of the process.
6010 optional int32 process_uid = 1;
6011 // Process name.
6012 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08006013 // Package name.
6014 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07006015 // Total count of the times this association appeared.
6016 optional int32 total_count = 3;
6017
6018 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07006019 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006020
6021 // Total count of the times this association became actively impacting its target process.
6022 optional int32 active_count = 5;
6023
6024 // Information on one source in this association.
6025 message StateStats {
6026 // Process state enum.
6027 optional android.service.procstats.ProcessState process_state = 1;
6028 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006029 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006030 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07006031 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006032 }
6033 repeated StateStats active_state_stats = 6;
6034}
6035
6036message PackageAssociationProcessStatsProto {
6037 // Name of the target component.
6038 optional string component_name = 1;
6039 // Information on one source in this association.
6040 repeated PackageAssociationSourceProcessStatsProto sources = 2;
6041}
6042
6043
6044message ProcessStatsPackageProto {
6045 // Name of package.
6046 optional string package = 1;
6047
6048 // Uid of the package.
6049 optional int32 uid = 2;
6050
6051 // Version of the package.
6052 optional int64 version = 3;
6053
6054 // Stats for each process running with the package loaded in to it.
6055 repeated ProcessStatsProto process_stats = 4;
6056
6057 // Stats for each of the package's services.
6058 repeated PackageServiceStatsProto service_stats = 5;
6059
6060 // Stats for each association with the package.
6061 repeated PackageAssociationProcessStatsProto association_stats = 6;
6062}
6063
6064message ProcessStatsSectionProto {
6065 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006066 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07006067
6068 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006069 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07006070
6071 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006072 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07006073
6074 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07006075 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07006076
6077 // System runtime library. e.g. "libdvm.so", "libart.so".
6078 optional string runtime = 5;
6079
6080 // whether kernel reports swapped pss.
6081 optional bool has_swapped_pss = 6;
6082
6083 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
6084 enum Status {
6085 STATUS_UNKNOWN = 0;
6086 STATUS_COMPLETE = 1;
6087 STATUS_PARTIAL = 2;
6088 STATUS_SHUTDOWN = 3;
6089 STATUS_SYSPROPS = 4;
6090 }
6091 repeated Status status = 7;
6092
Chenjie Yub2ecc792019-01-17 10:27:26 -08006093 // Number of pages available of various types and sizes, representation fragmentation.
6094 repeated ProcessStatsAvailablePagesProto available_pages = 10;
6095
Yangsteraf9aee72018-10-12 09:26:16 -07006096 // Stats for each process.
6097 repeated ProcessStatsProto process_stats = 8;
6098
6099 // Stats for each package.
6100 repeated ProcessStatsPackageProto package_stats = 9;
6101}
6102
Chenjie Yub2ecc792019-01-17 10:27:26 -08006103message ProcessStatsAvailablePagesProto {
6104 // Node these pages are in (as per /proc/pagetypeinfo)
6105 optional int32 node = 1;
6106
6107 // Zone these pages are in (as per /proc/pagetypeinfo)
6108 optional string zone = 2;
6109
6110 // Label for the type of these pages (as per /proc/pagetypeinfo)
6111 optional string label = 3;
6112
6113 // Distribution of number of pages available by order size. First entry in array is
6114 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
6115 repeated int32 pages_per_order = 4;
6116}
6117
Chenjie Yu12e5e672018-09-14 15:54:59 -07006118/**
6119 * Pulled from ProcessStatsService.java
6120 */
6121message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07006122 optional ProcessStatsSectionProto proc_stats_section = 1;
6123}
6124
Chenjie Yuf910b7802019-01-11 16:08:20 -08006125/**
6126 * Pulled from ProcessStatsService.java
6127 */
6128message ProcStatsPkgProc {
6129 optional ProcessStatsSectionProto proc_stats_section = 1;
6130}
6131
Chris Wrencdea3b72019-11-22 16:58:17 -05006132// Next Tag: 2
6133message PackageRemoteViewInfoProto {
6134 optional string package_name = 1;
6135 // add per-package additional info here (like channels)
6136}
6137
6138// Next Tag: 2
6139message NotificationRemoteViewsProto {
6140 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
6141}
6142
6143/**
6144 * Pulled from NotificationManagerService.java
6145 */
6146message NotificationRemoteViews {
6147 optional NotificationRemoteViewsProto notification_remote_views = 1;
6148}
6149
Yotam Aron74299972020-01-16 16:20:58 +02006150/**
6151 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
6152 */
6153message PackageNotificationPreferences {
6154 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006155 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006156 // Notification importance, which specifies when and how a notification is displayed.
6157 // Specified under core/java/android/app/NotificationManager.java.
6158 optional int32 importance = 2;
6159 // Lockscreen visibility as set by the user.
6160 optional int32 visibility = 3;
6161 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
6162 // PreferencesHelper.java)
6163 optional int32 user_locked_fields = 4;
6164}
6165
6166/**
6167 * Atom that contains a list of a package's channel preferences, pulled from
6168 * NotificationManagerService.java.
6169 */
6170message PackageNotificationChannelPreferences {
6171 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006172 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006173 // Channel's ID. Should always be available.
6174 optional string channel_id = 2;
6175 // Channel's name. Should always be available.
6176 optional string channel_name = 3;
6177 // Channel's description. Optionally set by the channel creator.
6178 optional string description = 4;
6179 // Notification importance, which specifies when and how a notification is displayed. Specified
6180 // under core/java/android/app/NotificationManager.java.
6181 optional int32 importance = 5;
6182 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6183 // at core/java/android/app/NotificationChannel.java
6184 optional int32 user_locked_fields = 6;
6185 // Indicates if the channel was deleted by the app.
6186 optional bool is_deleted = 7;
Chris Wren07cb6a42020-05-14 17:35:30 -04006187 // Indicates if the channel was marked as a conversation by the app.
6188 optional bool is_conversation = 8;
6189 // Indicates if the channel is a conversation that was demoted by the user.
6190 optional bool is_demoted_conversation = 9;
6191 // Indicates if the channel is a conversation that was marked as important by the user.
6192 optional bool is_important_conversation = 10;
Yotam Aron74299972020-01-16 16:20:58 +02006193}
6194
6195/**
Chris Wren93165692020-05-15 16:12:41 -04006196 * Atom that represents an item in the list of Do Not Disturb rules, pulled from
6197 * NotificationManagerService.java.
6198 */
6199message DNDModeProto {
6200 enum Mode {
6201 ROOT_CONFIG = -1; // Used to distinguish the config (one per user) from the rules.
6202 ZEN_MODE_OFF = 0;
6203 ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
6204 ZEN_MODE_NO_INTERRUPTIONS = 2;
6205 ZEN_MODE_ALARMS = 3;
6206 }
6207 optional int32 user = 1; // Android user ID (0, 1, 10, ...)
6208 optional bool enabled = 2; // true for ROOT_CONFIG if a manualRule is enabled
6209 optional bool channels_bypassing = 3; // only valid for ROOT_CONFIG
6210 optional Mode zen_mode = 4;
6211 // id is one of the system default rule IDs, or empty
6212 // May also be "MANUAL_RULE" to indicate app-activation of the manual rule.
6213 optional string id = 5;
6214 optional int32 uid = 6 [(is_uid) = true]; // currently only SYSTEM_UID or 0 for other
6215 optional DNDPolicyProto policy = 7;
6216}
6217
6218/**
6219 * Atom that represents a Do Not Disturb policy, an optional detail proto for DNDModeProto.
6220 */
6221message DNDPolicyProto {
6222 enum State {
6223 STATE_UNSET = 0;
6224 STATE_ALLOW = 1;
6225 STATE_DISALLOW = 2;
6226 }
6227 optional State calls = 1;
6228 optional State repeat_callers = 2;
6229 optional State messages = 3;
6230 optional State conversations = 4;
6231 optional State reminders = 5;
6232 optional State events = 6;
6233 optional State alarms = 7;
6234 optional State media = 8;
6235 optional State system = 9;
6236 optional State fullscreen = 10;
6237 optional State lights = 11;
6238 optional State peek = 12;
6239 optional State status_bar = 13;
6240 optional State badge = 14;
6241 optional State ambient = 15;
6242 optional State notification_list = 16;
6243
6244 enum PeopleType {
6245 PEOPLE_UNSET = 0;
6246 PEOPLE_ANYONE = 1;
6247 PEOPLE_CONTACTS = 2;
6248 PEOPLE_STARRED = 3;
6249 PEOPLE_NONE = 4;
6250 }
6251
6252 optional PeopleType allow_calls_from = 17;
6253 optional PeopleType allow_messages_from = 18;
6254
6255 enum ConversationType {
6256 CONV_UNSET = 0;
6257 CONV_ANYONE = 1;
6258 CONV_IMPORTANT = 2;
6259 CONV_NONE = 3;
6260 }
6261
6262 optional ConversationType allow_conversations_from = 19;
6263}
6264
6265/**
Yotam Aron74299972020-01-16 16:20:58 +02006266 * Atom that contains a list of a package's channel group preferences, pulled from
6267 * NotificationManagerService.java.
6268 */
6269message PackageNotificationChannelGroupPreferences {
6270 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07006271 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02006272 // Channel Group's ID. Should always be available.
6273 optional string group_id = 2;
6274 // Channel Group's name. Should always be available.
6275 optional string group_name = 3;
6276 // Channel Group's description. Optionally set by group creator.
6277 optional string description = 4;
6278 // Indicates if notifications from this channel group are blocked.
6279 optional bool is_blocked = 5;
6280 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
6281 // at core/java/android/app/NotificationChannelGroup.java
6282 optional int32 user_locked_fields = 6;
6283}
6284
Yangsteraf9aee72018-10-12 09:26:16 -07006285message PowerProfileProto {
6286 optional double cpu_suspend = 1;
6287
6288 optional double cpu_idle = 2;
6289
6290 optional double cpu_active = 3;
6291
6292 message CpuCluster {
6293 optional int32 id = 1;
6294 optional double cluster_power = 2;
6295 optional int32 cores = 3;
6296 repeated int64 speed = 4;
6297 repeated double core_power = 5;
6298 }
6299
6300 repeated CpuCluster cpu_cluster = 40;
6301
6302 optional double wifi_scan = 4;
6303
6304 optional double wifi_on = 5;
6305
6306 optional double wifi_active = 6;
6307
6308 optional double wifi_controller_idle = 7;
6309
6310 optional double wifi_controller_rx = 8;
6311
6312 optional double wifi_controller_tx = 9;
6313
6314 repeated double wifi_controller_tx_levels = 10;
6315
6316 optional double wifi_controller_operating_voltage = 11;
6317
6318 optional double bluetooth_controller_idle = 12;
6319
6320 optional double bluetooth_controller_rx = 13;
6321
6322 optional double bluetooth_controller_tx = 14;
6323
6324 optional double bluetooth_controller_operating_voltage = 15;
6325
6326 optional double modem_controller_sleep = 16;
6327
6328 optional double modem_controller_idle = 17;
6329
6330 optional double modem_controller_rx = 18;
6331
6332 repeated double modem_controller_tx = 19;
6333
6334 optional double modem_controller_operating_voltage = 20;
6335
6336 optional double gps_on = 21;
6337
6338 repeated double gps_signal_quality_based = 22;
6339
6340 optional double gps_operating_voltage = 23;
6341
6342 optional double bluetooth_on = 24;
6343
6344 optional double bluetooth_active = 25;
6345
6346 optional double bluetooth_at_cmd = 26;
6347
6348 optional double ambient_display = 27;
6349
6350 optional double screen_on = 28;
6351
6352 optional double radio_on = 29;
6353
6354 optional double radio_scanning = 30;
6355
6356 optional double radio_active = 31;
6357
6358 optional double screen_full = 32;
6359
6360 optional double audio = 33;
6361
6362 optional double video = 34;
6363
6364 optional double flashlight = 35;
6365
6366 optional double memory = 36;
6367
6368 optional double camera = 37;
6369
6370 optional double wifi_batched_scan = 38;
6371
6372 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006373}
Chenjie Yuab530202018-09-26 12:39:20 -07006374
6375/**
6376 * power_profile.xml and other constants for power model calculations.
6377 * Pulled from PowerProfile.java
6378 */
6379message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006380 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006381}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006382
6383/**
arangelovd5db50e2018-10-12 20:24:39 +01006384 * Logs when a user restriction was added or removed.
6385 *
6386 * Logged from:
6387 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6388 */
6389message UserRestrictionChanged {
6390 // The raw string of the user restriction as defined in UserManager.
6391 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6392 optional string restriction = 1;
6393 // Whether the restriction is enabled or disabled.
6394 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006395}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006396
6397/**
6398 * Pulls process user time and system time. Puller takes a snapshot of all pids
6399 * in the system and returns cpu stats for those that are working at the time.
6400 * Dead pids will be dropped. Kernel processes are excluded.
6401 * Min cool-down is 5 sec.
6402 */
6403message ProcessCpuTime {
6404 optional int32 uid = 1 [(is_uid) = true];
6405
6406 optional string process_name = 2;
6407 // Process cpu time in user space, cumulative from boot/process start
6408 optional int64 user_time_millis = 3;
6409 // Process cpu time in system space, cumulative from boot/process start
6410 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006411}
Misha Wagner5a51e002018-10-03 15:04:09 +01006412
6413/**
6414 * Pulls the CPU usage for each thread.
6415 *
6416 * Read from /proc/$PID/task/$TID/time_in_state files.
6417 *
6418 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6419 * time_in_state files not being present on some phones, have not been addressed. These should be
6420 * considered before a public release.
6421 */
6422message CpuTimePerThreadFreq {
6423 // UID that owns the process.
6424 optional int32 uid = 1 [(is_uid) = true];
6425 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006426 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006427 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006428 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006429 // Name of the process taken from `/proc/$PID/cmdline`.
6430 optional string process_name = 4;
6431 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6432 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006433
6434 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6435 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6436 // frequencies are given here as the alternative is sending eight separate atoms. This method
6437 // significantly reduces the amount of data created
6438 optional int32 frequency1_khz = 6;
6439 optional int32 time1_millis = 7;
6440 optional int32 frequency2_khz = 8;
6441 optional int32 time2_millis = 9;
6442 optional int32 frequency3_khz = 10;
6443 optional int32 time3_millis = 11;
6444 optional int32 frequency4_khz = 12;
6445 optional int32 time4_millis = 13;
6446 optional int32 frequency5_khz = 14;
6447 optional int32 time5_millis = 15;
6448 optional int32 frequency6_khz = 16;
6449 optional int32 time6_millis = 17;
6450 optional int32 frequency7_khz = 18;
6451 optional int32 time7_millis = 19;
6452 optional int32 frequency8_khz = 20;
6453 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006454}
Bookatz75ee6042018-11-09 12:27:37 -08006455
6456/**
Bookatz366a4432018-11-20 09:42:33 -08006457 * Pulls information about the device's build.
6458 */
6459message BuildInformation {
6460 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6461 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6462 optional string fingerprint = 1;
6463
6464 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6465 optional string brand = 2;
6466
6467 // Build.PRODUCT. The name of the overall product.
6468 optional string product = 3;
6469
6470 // Build.DEVICE. The name of the industrial design.
6471 optional string device = 4;
6472
6473 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6474 optional string version_release = 5;
6475
6476 // Build.ID. E.g. a label like "M4-rc20".
6477 optional string id = 6;
6478
6479 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6480 // represent this build.
6481 optional string version_incremental = 7;
6482
6483 // Build.TYPE. The type of build, like "user" or "eng".
6484 optional string type = 8;
6485
6486 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6487 optional string tags = 9;
6488}
6489
6490/**
Adam He420947c2019-01-23 15:59:09 -08006491 * Logs information about mismatched caller for content capture.
6492 *
6493 * Logged from:
6494 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6495 */
6496message ContentCaptureCallerMismatchReported {
6497 optional string intended_package = 1;
6498 optional string calling_package = 2;
6499}
6500
6501/**
6502 * Logs information about content capture service events.
6503 *
6504 * Logged from:
6505 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6506 */
6507message ContentCaptureServiceEvents {
6508 // The type of event.
6509 enum Event {
6510 UNKNOWN = 0;
6511 ON_CONNECTED = 1;
6512 ON_DISCONNECTED = 2;
6513 SET_WHITELIST = 3;
6514 SET_DISABLED = 4;
6515 ON_USER_DATA_REMOVED = 5;
Yara Hassan1e4256e2020-06-05 16:26:30 +01006516 ON_DATA_SHARE_REQUEST = 6;
6517 ACCEPT_DATA_SHARE_REQUEST = 7;
6518 REJECT_DATA_SHARE_REQUEST = 8;
6519 DATA_SHARE_WRITE_FINISHED = 9;
6520 DATA_SHARE_ERROR_IOEXCEPTION = 10;
6521 DATA_SHARE_ERROR_EMPTY_DATA = 11;
6522 DATA_SHARE_ERROR_CLIENT_PIPE_FAIL = 12;
6523 DATA_SHARE_ERROR_SERVICE_PIPE_FAIL = 13;
6524 DATA_SHARE_ERROR_CONCURRENT_REQUEST = 14;
6525 DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 15;
Adam He420947c2019-01-23 15:59:09 -08006526 }
6527 optional Event event = 1;
6528 // component/package of content capture service.
6529 optional string service_info = 2;
6530 // component/package of target.
6531 // it's a concatenated list of component/package for SET_WHITELIST event
6532 // separated by " ".
6533 optional string target_info = 3;
6534}
6535
6536/**
6537 * Logs information about content capture session events.
6538 *
6539 * Logged from:
6540 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6541 */
6542message ContentCaptureSessionEvents {
6543 // The type of event.
6544 enum Event {
6545 UNKNOWN = 0;
6546 ON_SESSION_STARTED = 1;
6547 ON_SESSION_FINISHED = 2;
6548 SESSION_NOT_CREATED = 3;
6549 }
6550 optional int32 session_id = 1;
6551 optional Event event = 2;
6552 // (n/a on session finished)
6553 optional int32 state_flags = 3;
6554 // component/package of content capture service.
6555 optional string service_info = 4;
6556 // component/package of app.
6557 // (n/a on session finished)
6558 optional string app_info = 5;
6559 optional bool is_child_session = 6;
6560}
6561
6562/**
6563 * Logs information about session being flushed.
6564 *
6565 * Logged from:
6566 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6567 */
6568message ContentCaptureFlushed {
6569 optional int32 session_id = 1;
6570 // component/package of content capture service.
6571 optional string service_info = 2;
6572 // component/package of app.
6573 optional string app_info = 3;
6574 // session start/finish events
6575 optional int32 child_session_started = 4;
6576 optional int32 child_session_finished = 5;
6577 // count of view events.
6578 optional int32 view_appeared_count = 6;
6579 optional int32 view_disappeared_count = 7;
6580 optional int32 view_text_changed_count = 8;
6581
6582 // Flush stats.
6583 optional int32 max_events = 9;
6584 optional int32 idle_flush_freq = 10;
6585 optional int32 text_flush_freq = 11;
6586 optional int32 flush_reason = 12;
6587}
6588
6589/**
Bookatz75ee6042018-11-09 12:27:37 -08006590 * Pulls on-device BatteryStats power use calculations for the overall device.
6591 */
6592message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006593 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6594 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6595 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6596 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08006597}
6598
6599/**
6600 * Pulls on-device BatteryStats power use calculations broken down by uid.
6601 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6602 * that is attributed to non-uid items. They must all be included to get the total power use.
6603 */
6604message DeviceCalculatedPowerBlameUid {
6605 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6606 optional int32 uid = 1 [(is_uid) = true];
6607
Bookatz3dbc13a2018-12-21 12:16:51 -08006608 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6609 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6610 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08006611}
6612
6613/**
6614 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6615 * drain type.
6616 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6617 * is attributed uids. They must all be included to get the total power use.
6618 */
6619message DeviceCalculatedPowerBlameOther {
6620 // The type of item whose power use is being reported.
6621 enum DrainType {
6622 AMBIENT_DISPLAY = 0;
6623 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6624 BLUETOOTH = 2;
6625 CAMERA = 3;
6626 // Cell-standby
6627 CELL = 4;
6628 FLASHLIGHT = 5;
6629 IDLE = 6;
6630 MEMORY = 7;
6631 // Amount that total computed drain exceeded the drain estimated using the
6632 // battery level changes and capacity.
6633 OVERCOUNTED = 8;
6634 PHONE = 9;
6635 SCREEN = 10;
6636 // Amount that total computed drain was below the drain estimated using the
6637 // battery level changes and capacity.
6638 UNACCOUNTED = 11;
6639 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6640 WIFI = 13;
6641 }
6642 optional DrainType drain_type = 1;
6643
Bookatz3dbc13a2018-12-21 12:16:51 -08006644 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6645 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6646 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006647}
arangelov4e994062018-11-13 16:12:38 +00006648
6649/**
6650 * Logs device policy features.
6651 *
6652 * Logged from:
6653 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6654 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6655 */
6656message DevicePolicyEvent {
6657 // The event id - unique for each event.
6658 optional android.stats.devicepolicy.EventId event_id = 1;
6659 // The admin package name.
6660 optional string admin_package_name = 2;
6661 // A generic integer parameter.
6662 optional int32 integer_value = 3;
6663 // A generic boolean parameter.
6664 optional bool boolean_value = 4;
6665 // A parameter specifying a time period in milliseconds.
6666 optional uint64 time_period_millis = 5;
6667 // A parameter specifying a list of package names, bundle extras or string parameters.
6668 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6669}
shawnlinea5b66b2018-11-13 15:05:29 +08006670
6671/**
6672 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6673 *
6674 * Logged from:
6675 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6676 */
6677message DocsUILaunchReported {
6678 optional android.stats.docsui.LaunchAction launch_action = 1;
6679 optional bool has_initial_uri = 2;
6680 optional android.stats.docsui.MimeType mime_type = 3;
6681 optional android.stats.docsui.Root initial_root = 4;
6682}
6683
6684/**
6685 * Logs root/app visited event in file managers/picker. Call this when the user
6686 * taps on root/app in hamburger menu.
6687 *
6688 * Logged from:
6689 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6690 */
6691message DocsUIRootVisitedReported {
6692 optional android.stats.docsui.ContextScope scope = 1;
6693 optional android.stats.docsui.Root root = 2;
6694}
6695
6696/**
6697 * Logs file operation stats. Call this when a file operation has completed.
6698 *
6699 * Logged from:
6700 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6701 */
6702message DocsUIFileOperationReported {
6703 optional android.stats.docsui.Provider provider = 1;
6704 optional android.stats.docsui.FileOperation file_op = 2;
6705}
6706
6707/**
6708 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6709 * mode.
6710 *
6711 * Logged from:
6712 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6713 */
6714message DocsUIFileOperationCopyMoveModeReported {
6715 optional android.stats.docsui.FileOperation file_op = 1;
6716 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6717}
6718
6719
6720/**
6721 * Logs file sub operation stats. Call this when a file operation has failed.
6722 *
6723 * Logged from:
6724 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6725 */
6726message DocsUIFileOperationFailureReported {
6727 optional android.stats.docsui.Authority authority = 1;
6728 optional android.stats.docsui.SubFileOperation sub_op = 2;
6729}
6730
6731/**
6732* Logs the cancellation of a file operation. Call this when a job is canceled
6733*
6734* Logged from:
6735* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6736*/
6737message DocsUIFileOperationCanceledReported {
6738 optional android.stats.docsui.FileOperation file_op = 1;
6739}
6740
6741/**
6742 * Logs startup time in milliseconds.
6743 *
6744 * Logged from:
6745 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6746 */
6747message DocsUIStartupMsReported {
6748 optional int32 startup_millis = 1;
6749}
6750
6751/**
6752 * Logs the action that was started by user.
6753 *
6754 * Logged from:
6755 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6756 */
6757message DocsUIUserActionReported {
6758 optional android.stats.docsui.UserAction action = 1;
6759}
6760
6761/**
6762 * Logs the invalid type when invalid scoped access is requested.
6763 *
6764 * Logged from:
6765 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6766 */
6767message DocsUIInvalidScopedAccessRequestReported {
6768 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006769}
Ben Murdochbab399f2018-12-06 11:01:38 +00006770
6771/**
shawnlina75e82d2019-01-07 10:31:12 +08006772 * Logs the package name that launches docsui picker mode.
6773 *
6774 * Logged from:
6775 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6776 */
6777message DocsUIPickerLaunchedFromReported {
6778 optional string package_name = 1;
6779}
6780
6781/**
6782 * Logs the search type.
6783 *
6784 * Logged from:
6785 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6786 */
6787message DocsUISearchTypeReported {
6788 optional android.stats.docsui.SearchType search_type = 1;
6789}
6790
6791/**
6792 * Logs the search mode.
6793 *
6794 * Logged from:
6795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6796 */
6797message DocsUISearchModeReported {
6798 optional android.stats.docsui.SearchMode search_mode = 1;
6799}
6800
6801/**
6802 * Logs the pick result information.
6803 *
6804 * Logged from:
6805 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6806 */
6807message DocsUIPickResultReported {
6808 optional int32 total_action_count = 1;
6809 optional int64 duration_millis = 2;
6810 optional int32 file_count= 3;
6811 optional bool is_searching = 4;
6812 optional android.stats.docsui.Root picked_from = 5;
6813 optional android.stats.docsui.MimeType mime_type = 6;
6814 optional int32 repeatedly_pick_times = 7;
6815}
6816
Diksha Gohlyanb96b2f42020-04-30 09:20:42 -07006817/** Logs the drag and drop of files.
6818
6819 * Logged from:
6820 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6821 */
6822message DocsUIDragAndDropReported {
6823 optional bool drag_initiated_from_docsui = 1;
6824}
6825
shawnlina75e82d2019-01-07 10:31:12 +08006826/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006827 * Logs when an app's memory is compacted.
6828 *
6829 * Logged from:
6830 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6831 */
6832message AppCompacted {
6833 // The pid of the process being compacted.
6834 optional int32 pid = 1;
6835
6836 // The name of the process being compacted.
6837 optional string process_name = 2;
6838
6839 // The type of compaction.
6840 enum Action {
6841 UNKNOWN = 0;
6842 SOME = 1;
6843 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006844 PERSISTENT = 3;
6845 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006846 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006847 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006848
6849 // Total RSS in kilobytes consumed by the process prior to compaction.
6850 optional int64 before_rss_total_kilobytes = 4;
6851
6852 // File RSS in kilobytes consumed by the process prior to compaction.
6853 optional int64 before_rss_file_kilobytes = 5;
6854
6855 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6856 optional int64 before_rss_anon_kilobytes = 6;
6857
6858 // Swap in kilobytes consumed by the process prior to compaction.
6859 optional int64 before_swap_kilobytes = 7;
6860
6861 // Total RSS in kilobytes consumed by the process after compaction.
6862 optional int64 after_rss_total_kilobytes = 8;
6863
6864 // File RSS in kilobytes consumed by the process after compaction.
6865 optional int64 after_rss_file_kilobytes = 9;
6866
6867 // Anonymous RSS in kilobytes consumed by the process after compaction.
6868 optional int64 after_rss_anon_kilobytes = 10;
6869
6870 // Swap in kilobytes consumed by the process after compaction.
6871 optional int64 after_swap_kilobytes = 11;
6872
6873 // The time taken to perform compaction in milliseconds.
6874 optional int64 time_to_compact_millis = 12;
6875
6876 // The last compaction action performed for this app.
6877 optional Action last_action = 13;
6878
Ben Murdoch01720b82018-12-19 18:03:44 +00006879 // The last time that compaction was attempted on this process in milliseconds
6880 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6881 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006882
Ben Murdoch885c21b2019-03-15 18:02:04 +00006883 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006884 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006885
6886 // The process state at the time of compaction.
6887 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006888
6889 // Free ZRAM in kilobytes before compaction.
6890 optional int64 before_zram_free_kilobytes = 17;
6891
6892 // Free ZRAM in kilobytes after compaction.
6893 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006894}
lifr157fc552018-12-12 16:38:04 +08006895
6896/**
lifr8abf3a72020-06-13 11:24:34 +08006897 * Logs when a Tethering event occurs.
6898 *
6899 */
6900message NetworkTetheringReported {
6901 // tethering error code
6902 optional android.stats.connectivity.ErrorCode error_code = 1;
6903
6904 // tethering downstream type
6905 optional android.stats.connectivity.DownstreamType downstream_type = 2;
6906
6907 // transport type of upstream network
6908 optional android.stats.connectivity.UpstreamType upstream_type = 3;
6909
6910 // The user type of Tethering
6911 optional android.stats.connectivity.UserType user_type= 4;
6912}
6913
6914/**
lifrb6b90b62019-03-29 00:40:17 +08006915 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6916 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6917 *
lifr1f74b052019-04-16 22:16:30 +08006918 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6919 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6920 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6921 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006922 */
6923message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006924 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006925
lifr1f74b052019-04-16 22:16:30 +08006926 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006927
6928 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006929 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006930
lifr1f74b052019-04-16 22:16:30 +08006931 // Only valid for event_type = EVENT_GETADDRINFO.
6932 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006933
lifr1f74b052019-04-16 22:16:30 +08006934 // Flags passed to android_res_nsend() defined in multinetwork.h
6935 // Only valid for event_type = EVENT_RESNSEND.
6936 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006937
lifrad9becc2019-05-20 11:04:41 +08006938 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006939
6940 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006941 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006942
6943 // Additional pass-through fields opaque to statsd.
6944 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006945 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006946
6947 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6948 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006949}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006950
6951/**
lifr1cc318d2020-03-19 21:58:30 +08006952 * logs the CapportApiData info
6953 * Logged from:
6954 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6955 */
6956message CapportApiData {
6957 // The TTL of the network connection provided by captive portal
6958 optional int32 remaining_ttl_secs = 1;
6959
6960 // The limit traffic data of the network connection provided by captive portal
6961 optional int32 remaining_bytes = 2;
6962
6963 // Is portal url option included in the DHCP packet (Yes, No)
6964 optional bool has_portal_url = 3;
6965
6966 // Is venue info (e.g. store info, maps, flight status) included (Yes, No)
6967 optional bool has_venue_info = 4;
6968}
6969
6970/**
6971 * logs a network Probe Event
6972 * Logged from:
6973 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6974 */
6975message ProbeEvent {
6976 // The probe type (http or https, or captive portal API...)
6977 optional android.stats.connectivity.ProbeType probe_type = 1;
6978
6979 // The latency in microseconds of the probe event
6980 optional int32 latency_micros = 2;
6981
6982 // The result of the probe event
6983 optional android.stats.connectivity.ProbeResult probe_result = 3;
6984
6985 // The CaptivePortal API info
6986 optional CapportApiData capport_api_data = 4;
6987}
6988
6989/**
6990 * log each ProbeEvent in ProbeEvents
6991 * Logged from:
6992 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
6993 */
6994message ProbeEvents {
6995 // Record probe event during the validation
6996 repeated ProbeEvent probe_event = 1;
6997}
6998
6999/**
7000 * The DHCP (Dynamic Host Configuration Protocol) session info
7001 * Logged from:
7002 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
7003 */
7004message DhcpSession {
7005 // The DHCP Feature(s) enabled in this session
7006 repeated android.stats.connectivity.DhcpFeature used_features = 1;
7007
7008 // The discover packet (re)transmit count
7009 optional int32 discover_count = 2;
7010
7011 // The request packet (re)transmit count
7012 optional int32 request_count = 3;
7013
7014 // The IPv4 address conflict count
7015 // (only be meaningful when duplicate address detection is enabled)
7016 optional int32 conflict_count = 4;
7017
7018 // The DHCP packet parsing error code in this session
7019 // (defined in android.net.metrics.DhcpErrorEvent)
7020 repeated android.stats.connectivity.DhcpErrorCode error_code = 5;
7021
7022 // The result of DHCP hostname transliteration
7023 optional android.stats.connectivity.HostnameTransResult ht_result = 6;
7024}
7025
7026/**
7027 * Logs Network IP provisioning event
7028 * Logged from:
7029 * packages/modules/NetworkStack/src/com/android/networkstack/metrics/NetworkIpProvisioningMetrics.java
7030 */
7031message NetworkIpProvisioningReported {
7032 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7033 optional android.stats.connectivity.TransportType transport_type = 1;
7034
7035 // The latency in microseconds of IP Provisioning over IPV4
7036 optional int32 ipv4_latency_micros = 2;
7037
7038 // The latency in microseconds of IP Provisioning over IPV6
7039 optional int32 ipv6_latency_micros = 3;
7040
7041 // The time duration between provisioning start and end (success or failure)
7042 optional int64 provisioning_duration_micros = 4;
7043
7044 // The specific disconnect reason for this IP provisioning
7045 optional android.stats.connectivity.DisconnectCode disconnect_code = 5;
7046
7047 // Log DHCP session info (Only valid for IPv4)
7048 optional DhcpSession dhcp_session = 6 [(log_mode) = MODE_BYTES];
7049
7050 // The random number between 0 ~ 999 for sampling
7051 optional int32 random_number = 7;
7052}
7053
7054/**
7055 * Logs Network DHCP Renew event
7056 * Logged from:
7057 * packages/modules/NetworkStack/src/android/net/dhcp/DhcpClient.java
7058 */
7059message NetworkDhcpRenewReported {
7060 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7061 optional android.stats.connectivity.TransportType transport_type = 1;
7062
7063 // The request packet (re)transmit count
7064 optional int32 request_count = 2;
7065
7066 // The latency in microseconds of DHCP Renew
7067 optional int32 latency_micros = 3;
7068
7069 // The DHCP error code is defined in android.net.metrics.DhcpErrorEvent
7070 optional android.stats.connectivity.DhcpErrorCode error_code = 4;
7071
7072 // The result of DHCP renew
7073 optional android.stats.connectivity.DhcpRenewResult renew_result = 5;
7074
7075 // The random number between 0 ~ 999 for sampling
7076 optional int32 random_number = 6;
7077}
7078
7079/**
7080 * Logs Network Validation event
7081 * Logged from:
7082 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
7083 */
7084message NetworkValidationReported {
7085 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7086 optional android.stats.connectivity.TransportType transport_type = 1;
7087
7088 // Record each probe event
7089 optional ProbeEvents probe_events = 2 [(log_mode) = MODE_BYTES];
7090
7091 // The result of the network validation
7092 optional android.stats.connectivity.ValidationResult validation_result = 3;
7093
7094 // The latency in microseconds of network validation
7095 optional int32 latency_micros = 4;
7096
7097 // The validation index (the first validation attempt or second, third...)
7098 optional int32 validation_index = 5;
7099
7100 // The random number between 0 ~ 999 for sampling
7101 optional int32 random_number = 6;
7102}
7103
7104/**
7105 * Logs NetworkStack Quirk event
7106 * Logged from:
7107 * packages/modules/NetworkStack/src/com/android/networkstack/
7108 */
7109message NetworkStackQuirkReported {
7110 // Transport type (WIFI, CELLULAR, BLUETOOTH, ..)
7111 optional android.stats.connectivity.TransportType transport_type = 1;
7112
7113 // Record each Quirk event
7114 optional android.stats.connectivity.NetworkQuirkEvent event = 2;
7115}
7116
7117/**
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007118 * Logs when a data stall event occurs.
7119 *
7120 * Log from:
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007121 * packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007122 */
7123message DataStallEvent {
7124 // Data stall evaluation type.
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007125 // See packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007126 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
7127 optional int32 evaluation_type = 1;
7128 // See definition in data_stall_event.proto.
7129 optional com.android.server.connectivity.ProbeResult validation_result = 2;
7130 // See definition in data_stall_event.proto.
7131 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
7132 // See definition in data_stall_event.proto.
7133 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
7134 // See definition in data_stall_event.proto.
7135 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
7136 // See definition in data_stall_event.proto.
7137 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
Chiachang Wang0aa2cd62020-05-21 07:03:23 +00007138 // The tcp packets fail rate from the latest tcp polling.
7139 optional int32 tcp_fail_rate = 7;
7140 // Number of packets sent since the last received packet.
7141 optional int32 tcp_sent_since_last_recv = 8;
Chiachang Wangf6bedc22019-01-14 11:54:32 +08007142}
Christian Brunschenf86039e2018-12-21 12:26:14 +00007143
7144/*
7145 * Logs when RescueParty resets some set of experiment flags.
7146 *
7147 * Logged from:
7148 * frameworks/base/services/core/java/com/android/server/RescueParty.java
7149 */
7150message RescuePartyResetReported {
7151 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
7152 optional int32 rescue_level = 1;
7153}
Mathew Inwoodb375be52019-01-04 11:36:25 +00007154
7155/**
7156 * Logs when signed config is received from an APK, and if that config was applied successfully.
7157 * Logged from:
7158 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
7159 */
7160message SignedConfigReported {
7161 enum Type {
7162 UNKNOWN_TYPE = 0;
7163 GLOBAL_SETTINGS = 1;
7164 }
7165 optional Type type = 1;
7166
7167 // The final status of the signed config received.
7168 enum Status {
7169 UNKNOWN_STATUS = 0;
7170 APPLIED = 1;
7171 BASE64_FAILURE_CONFIG = 2;
7172 BASE64_FAILURE_SIGNATURE = 3;
7173 SECURITY_EXCEPTION = 4;
7174 INVALID_CONFIG = 5;
7175 OLD_CONFIG = 6;
7176 SIGNATURE_CHECK_FAILED = 7;
7177 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00007178 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00007179 }
7180 optional Status status = 2;
7181
7182 // The version of the signed config processed.
7183 optional int32 version = 3;
7184
7185 // The package name that the config was extracted from.
7186 optional string from_package = 4;
7187
7188 enum Key {
7189 NO_KEY = 0;
7190 DEBUG = 1;
7191 PRODUCTION = 2;
7192 }
7193 // Which key was used to verify the config.
7194 optional Key verified_with = 5;
7195}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007196
7197/*
7198 * Logs GNSS Network-Initiated (NI) location events.
7199 *
7200 * Logged from:
7201 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7202 */
7203message GnssNiEventReported {
7204 // The type of GnssNiEvent.
7205 enum EventType {
7206 UNKNOWN = 0;
7207 NI_REQUEST = 1;
7208 NI_RESPONSE = 2;
7209 }
7210 optional EventType event_type = 1;
7211
7212 // An ID generated by HAL to associate NI notifications and UI responses.
7213 optional int32 notification_id = 2;
7214
7215 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007216 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007217
7218 // NI requires notification.
7219 optional bool need_notify = 4;
7220
7221 // NI requires verification.
7222 optional bool need_verify = 5;
7223
7224 // NI requires privacy override, no notification/minimal trace.
7225 optional bool privacy_override = 6;
7226
7227 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
7228 // seconds.
7229 optional int32 timeout = 7;
7230
7231 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007232 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007233
7234 // String representing the requester of the network inititated location request.
7235 optional string requestor_id = 9;
7236
7237 // Notification message text string representing the service(for eg. SUPL-service) who sent the
7238 // network initiated location request.
7239 optional string text = 10;
7240
7241 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007242 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007243
7244 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007245 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007246
7247 // True if SUPL ES is enabled.
7248 optional bool is_supl_es_enabled = 13;
7249
7250 // True if GNSS location is enabled.
7251 optional bool is_location_enabled = 14;
7252
7253 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08007254 optional android.server.location.GnssUserResponseType user_response = 15;
7255}
7256
7257/**
7258 * Logs GNSS non-framework (NFW) location notification.
7259 *
7260 * Logged from:
7261 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
7262 */
7263message GnssNfwNotificationReported {
7264 // Package name of the Android proxy application representing the non-framework entity that
7265 // requested location. Set to empty string if unknown.
7266 optional string proxy_app_package_name = 1;
7267
7268 // Protocol stack that initiated the non-framework location request.
7269 optional android.server.location.NfwProtocolStack protocol_stack = 2;
7270
7271 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
7272 // set to empty string. This field is opaque to the framework and used for logging purposes.
7273 optional string other_protocol_stack_name = 3;
7274
7275 // Source initiating/receiving the location information.
7276 optional android.server.location.NfwRequestor requestor = 4;
7277
7278 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
7279 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
7280 // and used for logging purposes.
7281 optional string requestor_id = 5;
7282
7283 // Indicates whether location information was provided for this request.
7284 optional android.server.location.NfwResponseType response_type = 6;
7285
7286 // True if the device is in user initiated emergency session.
7287 optional bool in_emergency_mode = 7;
7288
7289 // True if cached location is provided.
7290 optional bool is_cached_location = 8;
7291
7292 // True if proxy app permission mismatch between framework and GNSS HAL.
7293 optional bool is_permission_mismatched = 9;
7294}
7295
7296/**
7297 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
7298 *
7299 * Logged from:
7300 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
7301 */
7302message GnssConfigurationReported {
7303 // SUPL host name.
7304 optional string supl_host = 1;
7305
7306 // SUPL port number.
7307 optional int32 supl_port = 2;
7308
7309 // C2K host name.
7310 optional string c2k_host = 3;
7311
7312 // C2K port number.
7313 optional int32 c2k_port = 4;
7314
7315 // The SUPL version requested by Carrier.
7316 optional int32 supl_ver = 5;
7317
7318 // The SUPL mode.
7319 optional android.server.location.SuplMode supl_mode = 6;
7320
7321 // True if NI emergency SUPL restrictions is enabled.
7322 optional bool supl_es = 7;
7323
7324 // LTE Positioning Profile settings
7325 optional android.server.location.LppProfile lpp_profile = 8;
7326
7327 // Positioning protocol on A-Glonass system.
7328 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
7329
7330 // True if emergency PDN is used. Otherwise, regular PDN is used.
7331 optional bool use_emergency_pdn_for_emergency_supl= 10;
7332
7333 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
7334 optional android.server.location.GpsLock gps_lock = 11;
7335
7336 // Number of seconds to extend the emergency session duration post emergency call.
7337 optional int32 es_extension_sec = 12;
7338
7339 // The full list of package names of proxy Android applications representing the non-framework
7340 // location access entities (on/off the device) for which the framework user has granted
7341 // non-framework location access permission. The package names are concatenated in one string
7342 // with spaces as separators.
7343 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08007344}
Jack Yu95b64f32018-12-13 18:26:11 +08007345
7346/**
7347 * Logs when a NFC device's error occurred.
7348 * Logged from:
7349 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7350 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
7351 */
7352message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007353 enum Type {
7354 UNKNOWN = 0;
7355 CMD_TIMEOUT = 1;
7356 ERROR_NOTIFICATION = 2;
7357 AID_OVERFLOW = 3;
7358 }
7359 optional Type type = 1;
7360 // If it's nci cmd timeout, log the timeout command.
7361 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007362
Alex Salod7c3eef2019-01-25 14:43:27 -08007363 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007364}
7365
7366/**
7367 * Logs when a NFC device's state changed event
7368 * Logged from:
7369 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
7370 */
7371message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007372 enum State {
7373 UNKNOWN = 0;
7374 OFF = 1;
7375 ON = 2;
7376 ON_LOCKED = 3; // Secure Nfc enabled.
7377 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
7378 }
7379 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007380}
7381
7382/**
7383 * Logs when a NFC Beam Transaction occurred.
7384 * Logged from:
7385 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
7386 */
7387message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007388 enum Operation {
7389 UNKNOWN = 0;
7390 SEND = 1;
7391 RECEIVE = 2;
7392 }
7393 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007394}
7395
7396/**
7397 * Logs when a NFC Card Emulation Transaction occurred.
7398 * Logged from:
7399 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
7400 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
7401 */
7402message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007403 enum Category {
7404 UNKNOWN = 0;
7405 HCE_PAYMENT = 1;
7406 HCE_OTHER = 2;
7407 OFFHOST = 3;
7408 }
7409 // Transaction belongs to HCE payment or HCE other category, or offhost.
7410 optional Category category = 1;
7411 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
7412 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007413}
7414
7415/**
7416 * Logs when a NFC Tag event occurred.
7417 * Logged from:
7418 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
7419 */
7420message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08007421 enum Type {
7422 UNKNOWN = 0;
7423 URL = 1;
7424 BT_PAIRING = 2;
7425 PROVISION = 3;
7426 WIFI_CONNECT = 4;
7427 APP_LAUNCH = 5;
7428 OTHERS = 6;
7429 }
7430 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007431}
7432
7433/**
7434 * Logs when Hce transaction triggered
7435 * Logged from:
7436 * system/nfc/src/nfc/nfc/nfc_ncif.cc
7437 */
7438message NfcHceTransactionOccurred {
7439 // The latency period(in microseconds) it took for the first HCE data
7440 // exchange.
7441 optional uint32 latency_micros = 1;
7442}
7443
7444/**
7445 * Logs when SecureElement state event changed
7446 * Logged from:
7447 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7448 */
7449message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08007450 enum State {
7451 UNKNOWN = 0;
7452 INITIALIZED = 1;
7453 DISCONNECTED = 2;
7454 CONNECTED = 3;
7455 HALCRASH = 4;
7456 }
7457 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08007458
Alex Salod7c3eef2019-01-25 14:43:27 -08007459 optional string state_change_reason = 2;
7460 // SIMx or eSEx.
7461 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007462}
7463
7464/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007465 * Information about a permission grant request
7466 */
7467message PermissionGrantRequestResultReported {
7468 // unique value identifying an API call. A API call might result in multiple of these atoms
7469 optional int64 request_id = 1;
7470
7471 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007472 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007473
7474 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00007475 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007476
7477 // The permission to be granted
7478 optional string permission_name = 4;
7479
7480 // If the permission was explicitly requested via the API or added by the system
7481 optional bool is_implicit = 5;
7482
7483 enum Result {
7484 UNDEFINED = 0;
7485 // permission request was ignored
7486 IGNORED = 1;
7487 // permission request was ignored because it was user fixed
7488 IGNORED_USER_FIXED = 2;
7489 // permission request was ignored because it was policy fixed
7490 IGNORED_POLICY_FIXED = 3;
7491 // permission was granted by user action
7492 USER_GRANTED = 4;
7493 // permission was automatically granted
7494 AUTO_GRANTED = 5;
7495 // permission was denied by user action
7496 USER_DENIED = 6;
7497 // permission was denied with prejudice by the user
7498 USER_DENIED_WITH_PREJUDICE = 7;
7499 // permission was automatically denied
7500 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07007501 // permission request was ignored because permission is restricted
7502 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01007503 // one time permission was granted by user action
7504 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00007505 // user ignored request by leaving the request screen without choosing any option
7506 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08007507 // user granted the permission after being linked to settings
7508 USER_GRANTED_IN_SETTINGS = 12;
7509 // user denied the permission after being linked to settings
7510 USER_DENIED_IN_SETTINGS = 13;
7511 // user denied the permission with prejudice after being linked to settings
7512 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
7513 // permission was automatically revoked after one-time permission expired
7514 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08007515 // permission was automatically revoked for unused app
7516 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08007517 }
7518 // The result of the permission grant
7519 optional Result result = 6;
7520}
7521
7522/**
Jack Yu95b64f32018-12-13 18:26:11 +08007523 * Logs when Omapi API used
7524 * Logged from:
7525 * packages/apps/SecureElement/src/com/android/se/Terminal.java
7526 */
7527message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08007528 enum Operation {
7529 UNKNOWN = 0;
7530 OPEN_CHANNEL = 1;
7531 }
7532 optional Operation operation = 1;
7533 // SIMx or eSEx.
7534 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08007535
Alex Salod7c3eef2019-01-25 14:43:27 -08007536 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08007537}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007538
7539/**
Alex Saloa060aee2019-01-21 14:36:41 -08007540 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7541 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007542 * Logged from:
7543 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7544 */
7545message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007546 optional int64 dispatch_latency_millis = 1;
7547}
7548
7549/**
7550 * Logs AttentionManagerService attention check result.
7551 *
7552 * Logged from:
7553 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7554 */
7555message AttentionManagerServiceResultReported {
7556 // See core/java/android/service/attention/AttentionService.java
7557 enum AttentionCheckResult {
7558 UNKNOWN = 20;
7559 ATTENTION_SUCCESS_ABSENT = 0;
7560 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007561 ATTENTION_FAILURE_UNKNOWN = 2;
7562 ATTENTION_FAILURE_CANCELLED = 3;
7563 ATTENTION_FAILURE_PREEMPTED = 4;
7564 ATTENTION_FAILURE_TIMED_OUT = 5;
7565 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007566 }
7567 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007568}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007569
7570/**
7571 * Logs when an adb connection changes state.
7572 *
7573 * Logged from:
7574 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7575 */
7576message AdbConnectionChanged {
7577 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7578 // previously selected for this system.
7579 optional int64 last_connection_time_millis = 1;
7580
7581 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7582 // to reconnect via adb without user interaction.
7583 optional int64 auth_window_millis = 2;
7584
7585 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7586 optional android.debug.AdbConnectionStateEnum state = 3;
7587
7588 // True if the 'always allow' option was selected for this system.
7589 optional bool always_allow = 4;
7590}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007591
7592/*
7593 * Logs the reported speech DSP status.
7594 *
7595 * Logged from:
7596 * Vendor audio implementation.
7597 */
7598message SpeechDspStatReported {
7599 // The total Speech DSP uptime in milliseconds.
7600 optional int32 total_uptime_millis = 1;
7601 // The total Speech DSP downtime in milliseconds.
7602 optional int32 total_downtime_millis = 2;
7603 optional int32 total_crash_count = 3;
7604 optional int32 total_recover_count = 4;
7605}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007606
7607/**
7608 * Logs USB connector contaminant status.
7609 *
7610 * Logged from: USB Service.
7611 */
7612message UsbContaminantReported {
7613 optional string id = 1;
7614 optional android.service.usb.ContaminantPresenceStatus status = 2;
7615}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007616
7617/**
7618 * This atom is for debugging purpose.
7619 */
7620message DebugElapsedClock {
7621 // Monotically increasing value for each pull.
7622 optional int64 pull_count = 1;
7623 // Time from System.elapsedRealtime.
7624 optional int64 elapsed_clock_millis = 2;
7625 // Time from System.elapsedRealtime.
7626 optional int64 same_elapsed_clock_millis = 3;
7627 // Diff between current elapsed time and elapsed time from previous pull.
7628 optional int64 elapsed_clock_diff_millis = 4;
7629
7630 enum Type {
7631 TYPE_UNKNOWN = 0;
7632 ALWAYS_PRESENT = 1;
7633 PRESENT_ON_ODD_PULLS = 2;
7634 }
7635 // Type of behavior for the pulled data.
7636 optional Type type = 5;
7637}
7638
7639/**
7640 * This atom is for debugging purpose.
7641 */
7642message DebugFailingElapsedClock {
7643 // Monotically increasing value for each pull.
7644 optional int64 pull_count = 1;
7645 // Time from System.elapsedRealtime.
7646 optional int64 elapsed_clock_millis = 2;
7647 // Time from System.elapsedRealtime.
7648 optional int64 same_elapsed_clock_millis = 3;
7649 // Diff between current elapsed time and elapsed time from previous pull.
7650 optional int64 elapsed_clock_diff_millis = 4;
7651}
Steven Wuacef6bb2019-01-23 14:21:17 -05007652
7653/** Logs System UI bubbles event changed.
7654 *
7655 * Logged from:
7656 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7657 */
7658message BubbleUIChanged {
7659
7660 // The app package that is posting the bubble.
7661 optional string package_name = 1;
7662
7663 // The notification channel that is posting the bubble.
7664 optional string notification_channel = 2;
7665
7666 // The notification id associated with the posted bubble.
7667 optional int32 notification_id = 3;
7668
7669 // The position of the bubble within the bubble stack.
7670 optional int32 position = 4;
7671
7672 // The total number of bubbles within the bubble stack.
7673 optional int32 total_number = 5;
7674
7675 // User interactions with the bubble.
7676 enum Action {
7677 UNKNOWN = 0;
7678 POSTED = 1;
7679 UPDATED = 2;
7680 EXPANDED = 3;
7681 COLLAPSED = 4;
7682 DISMISSED = 5;
7683 STACK_DISMISSED = 6;
7684 STACK_MOVED = 7;
7685 HEADER_GO_TO_APP = 8;
7686 HEADER_GO_TO_SETTINGS = 9;
7687 PERMISSION_OPT_IN = 10;
7688 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007689 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007690 SWIPE_LEFT = 13;
7691 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007692 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04007693 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007694 }
7695 optional Action action = 6;
7696
7697 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7698 optional float normalized_x_position = 7;
7699 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007700
7701 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7702 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007703
7704 // Whether the bubble is an on-going one.
7705 optional bool is_ongoing = 10;
7706
7707 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007708 // This is deprecated and the value should be ignored.
7709 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007710}
Kweku Adams8845d012018-12-11 20:06:45 -08007711
7712/**
Steven Wu552f63f2019-02-05 13:41:36 -05007713 * Logs System UI bubbles developer errors.
7714 *
7715 * Logged from:
7716 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7717 */
7718message BubbleDeveloperErrorReported {
7719
7720 // The app package that is posting the bubble.
7721 optional string package_name = 1;
7722
7723 // Bubble developer error type enums.
7724 enum Error {
7725 UNKNOWN = 0;
7726 ACTIVITY_INFO_MISSING = 1;
7727 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7728 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7729 }
7730 optional Error error = 2 [default = UNKNOWN];
7731}
7732
7733/**
Kweku Adams8845d012018-12-11 20:06:45 -08007734 * Logs that a constraint for a scheduled job has changed.
7735 *
7736 * Logged from:
7737 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7738 */
7739message ScheduledJobConstraintChanged {
7740 repeated AttributionNode attribution_node = 1;
7741
7742 // Name of the job.
7743 optional string job_name = 2;
7744
7745 optional com.android.server.job.ConstraintEnum constraint = 3;
7746
7747 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007748 UNKNOWN = 0;
7749 UNSATISFIED = 1;
7750 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007751 }
7752 optional State state = 4;
7753}
Alex Salod7c3eef2019-01-25 14:43:27 -08007754
7755/**
7756 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7757 * returns true.
7758 *
7759 * Logged from:
7760 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7761 */
7762message ScreenTimeoutExtensionReported {
7763 // Describes how many times in a row did the power manager reset the screen off timeout.
7764 optional uint32 consecutive_timeout_extended_count = 1;
7765}
Hui Yu885aca12019-01-10 17:11:34 -08007766
7767/*
7768* Logs number of milliseconds it takes to start a process.
7769* The definition of app process start time is from the app launch time to
7770* the time that Zygote finished forking the app process and loaded the
7771* application package's java classes.
7772
7773* This metric is different from AppStartOccurred which is for foreground
7774* activity only.
7775
7776* ProcessStartTime can report all processes (both foreground and background)
7777* start time.
7778*
7779* Logged from:
7780* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7781*/
7782message ProcessStartTime {
7783 // The uid of the ProcessRecord.
7784 optional int32 uid = 1 [(is_uid) = true];
7785
7786 // The process pid.
7787 optional int32 pid = 2;
7788
7789 // The process name.
7790 // Usually package name, "system" for system server.
7791 // Provided by ActivityManagerService.
7792 optional string process_name = 3;
7793
7794 enum StartType {
7795 UNKNOWN = 0;
7796 WARM = 1;
7797 HOT = 2;
7798 COLD = 3;
7799 }
7800
7801 // The start type.
7802 optional StartType type = 4;
7803
7804 // The elapsed realtime at the start of the process.
7805 optional int64 process_start_time_millis = 5;
7806
7807 // Number of milliseconds it takes to reach bind application.
7808 optional int32 bind_application_delay_millis = 6;
7809
7810 // Number of milliseconds it takes to finish start of the process.
7811 optional int32 process_start_delay_millis = 7;
7812
7813 // hostingType field in ProcessRecord, the component type such as "activity",
7814 // "service", "content provider", "broadcast" or other strings.
7815 optional string hosting_type = 8;
7816
7817 // hostingNameStr field in ProcessRecord. The component class name that runs
7818 // in this process.
7819 optional string hosting_name = 9;
7820}
7821
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007822/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007823 * Track Media Codec usage
7824 * Logged from:
7825 * frameworks/av/media/libstagefright/MediaCodec.cpp
7826 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7827 */
7828message MediametricsCodecReported {
7829 optional int64 timestamp_nanos = 1;
7830 optional string package_name = 2;
7831 optional int64 package_version_code = 3;
7832 optional int64 media_apex_version = 4;
7833
7834 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7835}
7836
7837/**
7838 * Track Media Extractor (pulling video/audio streams out of containers) usage
7839 * Logged from:
7840 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7841 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7842 */
7843message MediametricsExtractorReported {
7844 optional int64 timestamp_nanos = 1;
7845 optional string package_name = 2;
7846 optional int64 package_version_code = 3;
7847 optional int64 media_apex_version = 4;
7848
7849 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7850}
7851
7852/**
7853 * Track how we arbitrate between microphone/input requests.
7854 * Logged from
7855 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7856 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7857 */
7858message MediametricsAudiopolicyReported {
7859 optional int64 timestamp_nanos = 1;
7860 optional string package_name = 2;
7861 optional int64 package_version_code = 3;
7862 optional int64 media_apex_version = 4;
7863
7864 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7865}
7866
7867/**
7868 * Track how we arbitrate between microphone requests.
7869 * Logged from
7870 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7871 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7872 */
7873message MediametricsAudiorecordReported {
7874 optional int64 timestamp_nanos = 1;
7875 optional string package_name = 2;
7876 optional int64 package_version_code = 3;
7877 optional int64 media_apex_version = 4;
7878
7879 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7880}
7881
7882/**
7883 * Track how we arbitrate between microphone/input requests.
7884 * Logged from
7885 * frameworks/av/media/libnblog/ReportPerformance.cpp
7886 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7887 */
7888message MediametricsAudiothreadReported {
7889 optional int64 timestamp_nanos = 1;
7890 optional string package_name = 2;
7891 optional int64 package_version_code = 3;
7892 optional int64 media_apex_version = 4;
7893
7894 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7895}
7896
7897/**
7898 * Track how we arbitrate between microphone/input requests.
7899 * Logged from
7900 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7901 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7902 */
7903message MediametricsAudiotrackReported {
7904 optional int64 timestamp_nanos = 1;
7905 optional string package_name = 2;
7906 optional int64 package_version_code = 3;
7907 optional int64 media_apex_version = 4;
7908
7909 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7910}
7911
7912/**
7913 * Track information about DRM framework performance
7914 * Logged from
7915 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7916 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7917 */
7918message MediametricsMediadrmReported {
7919 optional int64 timestamp_nanos = 1;
7920 optional string package_name = 2;
7921 optional int64 package_version_code = 3;
7922 optional int64 media_apex_version = 4;
7923
7924 // vendor+description tell about which DRM plugin is in use on this device
7925 optional string vendor = 5;
7926 optional string description = 6;
7927 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7928 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7929}
7930
7931/**
7932 * Track information about the widevine DRM plugin performance
7933 * Logged from
7934 * vendor/widevine/libwvdrmengine/cdm/metrics
7935 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7936 */
7937message MediametricsDrmWidevineReported {
7938 optional int64 timestamp_nanos = 1;
7939 optional string package_name = 2;
7940 optional int64 package_version_code = 3;
7941 optional int64 media_apex_version = 4;
7942
7943 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7944}
7945
7946/**
7947 * Track information about recordings (e.g. camcorder)
7948 * Logged from
7949 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7950 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7951 */
7952message MediametricsRecorderReported {
7953 optional int64 timestamp_nanos = 1;
7954 optional string package_name = 2;
7955 optional int64 package_version_code = 3;
7956 optional int64 media_apex_version = 4;
7957
7958 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7959}
7960
7961/**
7962 * Track Media Player usage
7963 * Logged from:
7964 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7965 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7966 */
7967message MediametricsNuPlayerReported {
7968 optional int64 timestamp_nanos = 1;
7969 optional string package_name = 2;
7970 optional int64 package_version_code = 3;
7971 optional int64 media_apex_version = 4;
7972
7973 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7974}
7975
7976/**
Robert Shiha4beed32019-08-19 14:15:23 -07007977 * Track Legacy DRM usage
7978 * Logged from
7979 * frameworks/av/drm/drmserver/DrmManager.cpp
7980 */
7981message MediametricsDrmManagerReported {
7982 optional int64 timestamp_nanos = 1;
7983 optional string package_name = 2;
7984 optional int64 package_version_code = 3;
7985 optional int64 media_apex_version = 4;
7986
7987 enum Method {
7988 METHOD_NOT_FOUND = -1;
7989 GET_CONSTRAINTS = 0;
7990 GET_METADATA = 1;
7991 CAN_HANDLE = 2;
7992 PROCESS_DRM_INFO = 3;
7993 ACQUIRE_DRM_INFO = 4;
7994 SAVE_RIGHTS = 5;
7995 GET_ORIGINAL_MIME_TYPE = 6;
7996 GET_DRM_OBJECT_TYPE = 7;
7997 CHECK_RIGHTS_STATUS = 8;
7998 REMOVE_RIGHTS = 9;
7999 REMOVE_ALL_RIGHTS = 10;
8000 OPEN_CONVERT_SESSION = 11;
8001 OPEN_DECRYPT_SESSION = 12;
8002 }
8003
8004 // plugin_id+description inform which Legacy DRM plugins are still in use on device
8005 optional string plugin_id = 5;
8006 optional string description = 6;
8007 optional Method method = 7;
8008 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08008009
8010 optional int64 get_constraints_count = 9;
8011 optional int64 get_metadata_count = 10;
8012 optional int64 can_handle_count = 11;
8013 optional int64 process_drm_info_count = 12;
8014 optional int64 acquire_drm_info_count = 13;
8015 optional int64 save_rights_count = 14;
8016 optional int64 get_original_mime_type_count = 15;
8017 optional int64 get_drm_object_type_count = 16;
8018 optional int64 check_rights_status_count = 17;
8019 optional int64 remove_rights_count = 18;
8020 optional int64 remove_all_rights_count = 19;
8021 optional int64 open_convert_session_count = 20;
8022 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07008023}
8024
8025/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008026 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008027 * Pulled from: StatsCompanionService
8028*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008029message DangerousPermissionState {
8030 // Name of the permission
8031 optional string permission_name = 1;
8032
8033 // Uid of the package
8034 optional int32 uid = 2 [(is_uid) = true];
8035
8036 // Package requesting the permission
8037 optional string package_name = 3;
8038
8039 // If the permission is granted to the uid
8040 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01008041
8042 // Permission flags as per android.content.pm.PermissionFlags
8043 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08008044}
8045
Michael Groover4a0ca942019-01-24 17:41:25 -08008046/**
8047 * Logs when a package is denied access to a device identifier based on the new access requirements.
8048 *
8049 * Logged from:
8050 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
8051 */
8052message DeviceIdentifierAccessDenied {
8053 // The name of the package denied access to the requested device identifier.
8054 optional string package_name = 1;
8055
8056 // The name of the device identifier method the package attempted to invoke.
8057 optional string method_name = 2;
8058
8059 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08008060 // Starting from Android 11, this boolean is not set and will always be false.
8061 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008062
8063 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08008064 // Starting from Android 11, this boolean is not set and will always be false.
8065 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08008066}
Chenjie Yue13f44a2019-02-07 17:51:38 -08008067
8068/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08008069 * Pulls the ongoing mainline install train version code.
8070 * Pulled from StatsCompanionService
8071 */
8072message TrainInfo {
8073 optional int64 train_version_code = 1;
8074
8075 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008076
8077 optional string train_name = 3;
8078
8079 enum Status {
8080 UNKNOWN = 0;
8081 INSTALL_REQUESTED = 1;
8082 INSTALL_STARTED = 2;
8083 INSTALL_STAGED_NOT_READY = 3;
8084 INSTALL_STAGED_READY = 4;
8085 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07008086 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
8087 // and INSTALL_FAILURE_COMMIT.
8088 INSTALL_FAILURE = 6 [deprecated = true];
8089 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008090 INSTALL_CANCELLED = 7;
8091 INSTALLER_ROLLBACK_REQUESTED = 8;
8092 INSTALLER_ROLLBACK_INITIATED = 9;
8093 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
8094 INSTALLER_ROLLBACK_STAGED = 11;
8095 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
8096 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
8097 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
8098 INSTALLER_ROLLBACK_SUCCESS = 15;
8099 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07008100 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
8101 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
8102 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
8103 INSTALL_STAGED_CANCEL_REQUESTED = 20;
8104 INSTALL_STAGED_CANCEL_SUCCESS = 21;
8105 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07008106 INSTALL_FAILURE_DOWNLOAD = 23;
8107 INSTALL_FAILURE_STATE_MISMATCH = 24;
8108 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08008109 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08008110 }
8111 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08008112}
joshmccloskey8c3322e2019-01-09 18:25:57 -08008113
8114/**
8115 * Logs the gesture stage changed event.
8116 *
8117 * Logged from:
8118 * frameworks/base/packages/SystemUI/
8119 */
8120message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008121 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008122}
8123
8124/**
8125 * Logs the feedback type.
8126 *
8127 * Logged from:
8128 * frameworks/base/packages/SystemUI/
8129 */
8130message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008131 // Whether or not the gesture was used.
8132 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008133}
8134
8135/**
8136 * Logs the progress.
8137 *
8138 * Logged from:
8139 * frameworks/base/packages/SystemUI/
8140 */
8141message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08008142 // [0,100] progress for the assist gesture.
8143 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08008144}
Neil Fullerdb14b482019-02-05 19:44:44 +00008145
8146/*
8147 * Information about the time zone data on a device.
8148 */
8149message TimeZoneDataInfo {
8150 // A version identifier for the data set on device. e.g. "2018i"
8151 optional string tzdb_version = 1;
8152}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008153
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008154/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008155 * Logs the GPU stats global health information.
8156 *
8157 * Logged from:
8158 * frameworks/native/services/gpuservice/gpustats/
8159 */
8160message GpuStatsGlobalInfo {
8161 // Package name of the gpu driver.
8162 optional string driver_package_name = 1;
8163
8164 // Version name of the gpu driver.
8165 optional string driver_version_name = 2;
8166
8167 // Version code of the gpu driver.
8168 optional int64 driver_version_code = 3;
8169
8170 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
8171 optional int64 driver_build_time = 4;
8172
8173 // Total count of the gl driver gets loaded.
8174 optional int64 gl_loading_count = 5;
8175
8176 // Total count of the gl driver fails to be loaded.
8177 optional int64 gl_loading_failure_count = 6;
8178
8179 // Total count of the Vulkan driver gets loaded.
8180 optional int64 vk_loading_count = 7;
8181
8182 // Total count of the Vulkan driver fails to be loaded.
8183 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07008184
8185 // Api version of the system Vulkan driver.
8186 optional int32 vulkan_version = 9;
8187
8188 // Api version of the system CPU Vulkan driver.
8189 optional int32 cpu_vulkan_version = 10;
8190
8191 // Api version of the system GLES driver.
8192 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008193
8194 // Total count of the angle driver gets loaded.
8195 optional int64 angle_loading_count = 12;
8196
8197 // Total count of the angle driver fails to be loaded.
8198 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008199}
8200
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008201/**
8202 * GPU driver loading time info.
8203 */
8204message GpuDriverLoadingTime {
8205 // List of all the driver loading times for this app. The list size is
8206 // capped at 50.
8207 repeated int64 driver_loading_time = 1;
8208}
8209
8210/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008211 * Logs the GPU stats per app health information.
8212 *
8213 * Logged from:
8214 * frameworks/native/services/gpuservice/gpustats/
8215 */
8216message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008217 // Package name of the application that loads the gpu driver. Total number
8218 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008219 optional string app_package_name = 1;
8220
8221 // Version code of the gpu driver this app loads.
8222 optional int64 driver_version_code = 2;
8223
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008224 // gl driver loading time info.
8225 optional GpuDriverLoadingTime gl_driver_loading_time = 3
8226 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008227
Yiwei Zhang4fb92892019-03-04 14:29:25 -08008228 // Vulkan driver loading time info.
8229 optional GpuDriverLoadingTime vk_driver_loading_time = 4
8230 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07008231
8232 // Angle driver loading time info.
8233 optional GpuDriverLoadingTime angle_driver_loading_time = 5
8234 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07008235
8236 // CPU Vulkan implementation is in use.
8237 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07008238
8239 // App is not doing pre-rotation correctly.
8240 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08008241
8242 // App creates GLESv1 context.
8243 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08008244}
Rafal Slawikd4e87572019-03-12 13:08:38 +00008245
8246/*
8247 * Logs the size of the system ion heap.
8248 *
8249 * Pulled from StatsCompanionService.
8250 */
8251message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008252 // Deprecated due to limited support of ion stats in debugfs.
8253 // Use `IonHeapSize` instead.
8254 option deprecated = true;
8255
Rafal Slawikd4e87572019-03-12 13:08:38 +00008256 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008257 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00008258 optional int64 size_in_bytes = 1;
8259}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008260
Rafal Slawik77987ed2019-06-17 12:28:23 +01008261/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00008262 * Logs the total size of the ion heap.
8263 *
8264 * Pulled from StatsCompanionService.
8265 */
8266message IonHeapSize {
8267 // Total size of all ion heaps in kilobytes.
8268 // Read from: /sys/kernel/ion/total_heaps_kb.
8269 optional int32 total_size_kb = 1;
8270}
8271
8272/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01008273 * Logs the per-process size of the system ion heap.
8274 *
8275 * Pulled from StatsCompanionService.
8276 */
8277message ProcessSystemIonHeapSize {
8278 // The uid if available. -1 means not available.
8279 optional int32 uid = 1 [(is_uid) = true];
8280
8281 // The process name (from /proc/PID/cmdline).
8282 optional string process_name = 2;
8283
8284 // Sum of sizes of all allocations.
8285 optional int32 total_size_in_kilobytes = 3;
8286
8287 // Number of allocations.
8288 optional int32 allocation_count = 4;
8289
8290 // Size of the largest allocation.
8291 optional int32 max_size_in_kilobytes = 5;
8292}
8293
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008294/**
8295 * Push network stack events.
8296 *
8297 * Log from:
8298 * frameworks/base/packages/NetworkStack/
8299 */
8300message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08008301 // The id that indicates the event reported from NetworkStack.
8302 optional int32 event_id = 1;
8303 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08008304 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
8305}
Carmen Agimofa769c152019-03-04 14:39:14 +00008306
8307/**
8308 * Logs the apps that are installed on the external storage.
8309 * Pulled from:
8310 * StatsCompanionService
8311 */
8312message AppsOnExternalStorageInfo {
8313 // The type of the external storage.
8314 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
8315 // The name of the package that is installed on the external storage.
8316 optional string package_name = 2;
8317}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07008318
8319/**
8320 * Logs the settings related to Face.
8321 * Logged from:
8322 * frameworks/base/services/core/java/com/android/server/stats
8323 */
8324message FaceSettings {
8325 // Whether or not face unlock is allowed on Keyguard.
8326 optional bool unlock_keyguard_enabled = 1;
8327 // Whether or not face unlock dismisses the Keyguard.
8328 optional bool unlock_dismisses_keyguard = 2;
8329 // Whether or not face unlock requires attention.
8330 optional bool unlock_attention_required = 3;
8331 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
8332 optional bool unlock_app_enabled = 4;
8333 // Whether or not face unlock always requires user confirmation.
8334 optional bool unlock_always_require_confirmation = 5;
8335 // Whether or not a diverse set of poses are required during enrollment.
8336 optional bool unlock_diversity_required = 6;
8337}
Maggie White442b6312019-04-05 16:26:44 -07008338
8339/**
8340 * Logs cooling devices maintained by the kernel.
8341 *
8342 * Pulled from StatsCompanionService.java
8343 */
8344message CoolingDevice {
8345 // The type of cooling device being reported. Eg. CPU, GPU...
8346 optional android.os.CoolingTypeEnum device_location = 1;
8347 // The name of the cooling device source. Eg. CPU0
8348 optional string device_name = 2;
8349 // Current throttle state of the cooling device. The value can any unsigned
8350 // integer between 0 and max_state defined in its driver. 0 means device is
8351 // not in throttling, higher value means deeper throttling.
8352 optional int32 state = 3;
8353}
Ben Blount763a5d52019-04-10 11:48:58 -07008354
8355/**
8356 * Intelligence has several counter-type events that don't warrant a
8357 * full separate atom. These are primarily API call counters but also include
8358 * counters for feature usage and specific failure modes.
8359 *
8360 * Logged from the Intelligence mainline module.
8361 */
8362message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07008363 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07008364 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07008365 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07008366 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07008367 // How many times the event occured (to report a batch of high frequency events).
8368 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07008369 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07008370 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07008371}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07008372
8373/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008374 * Logs when Car Power state changed.
8375 *
8376 * Logged from:
8377 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8378 */
8379message CarPowerStateChanged {
8380 // States come from CpmsState in CarPowerManagementService.java.
8381 enum State {
8382 WAIT_FOR_VHAL = 0;
8383 ON = 1;
8384 SHUTDOWN_PREPARE = 2;
8385 WAIT_FOR_FINISH = 3;
8386 SUSPEND = 4;
8387 SIMULATE_SLEEP = 5;
8388 }
8389 optional State state = 1;
8390}
8391
8392/**
Mayank Gargda5ca012020-05-14 00:23:53 -07008393 * Logs when Car User Hal is requested to switch/create/remove user.
8394 *
8395 * Logged from:
8396 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8397 */
8398message CarUserHalModifyUserRequestReported {
8399 // Request id for the request.
8400 optional int32 request_id = 1;
8401 // Request type.
8402 enum RequestType {
8403 UNKNOWN = 0;
8404 // Car user manager requested user switch.
8405 SWITCH_REQUEST_ANDROID = 1;
8406 // OEM requested User switch.
8407 SWITCH_REQUEST_OEM = 2;
8408 // Hal switch requested after android switch using activity manager.
8409 SWITCH_REQUEST_LEGACY = 3;
8410 // Create User
8411 CREATE_REQUEST = 4;
8412 // Remove User
8413 REMOVE_REQUEST = 5;
8414 }
8415 optional RequestType request_type = 2;
8416 // Android User id of the current user which can only be 0, 10, 11 and so on.
8417 // -1 if not available.
8418 optional int32 user_id = 3;
8419 // VHAL flags of the current user. (-1 if not available)
8420 optional int32 user_flags = 4;
8421 // Android User id of the target user for switch/create/remove. It can only
8422 // be 0, 10, 11 and so on. -1 if not available.
8423 optional int32 target_user_id = 5;
8424 // VHAL flags of the target user for switch/create/remove. (-1 if not available)
8425 optional int32 target_user_flags = 6;
8426 // Request timeout Milliseconds (-1 if not available)
8427 optional int32 timeout_millis = 7;
8428}
8429
8430/**
8431 * Logs when Car User Hal responds to switch/create user request.
8432 *
8433 * Logged from:
8434 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8435 */
8436message CarUserHalModifyUserResponseReported {
8437 // Request id of the request associated with the response.
8438 optional int32 request_id = 1;
8439 // Car user hal callback status.
8440 enum CallbackStatus {
8441 UNKNOWN = 0;
8442 // Hal response was invalid.
8443 INVALID = 1;
8444 // Hal response was ok.
8445 OK = 2;
8446 // Hal timeout during set call.
8447 HAL_SET_TIMEOUT = 3;
8448 // Hal response timeout.
8449 HAL_RESPONSE_TIMEOUT = 4;
8450 // Hal responded with wrong info.
8451 WRONG_HAL_RESPONSE = 5;
8452 // Hal is processing multiple requests simultaneously.
8453 CONCURRENT_OPERATION = 6;
8454 }
8455 optional CallbackStatus callback_status = 2;
8456
8457 // Hal request status for user switch/create/remove.
8458 enum HalRequestStatus {
8459 UNSPECIFIED = 0;
8460 // Hal request for user switch/create is successful.
8461 SUCCESS = 1;
8462 // Hal request for user switch/create failed.
8463 FAILURE = 2;
8464 }
8465 optional HalRequestStatus request_status = 3;
8466}
8467
8468/**
8469 * Logs when post switch response is posted to Car User Hal.
8470 *
8471 * Logged from:
8472 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8473 */
8474message CarUserHalPostSwitchResponseReported {
8475 // Request id.
8476 optional int32 request_id = 1;
8477
8478 // Android user switch status.
8479 enum UserSwitchStatus {
8480 UNKNOWN = 0;
8481 // Android user switch is successful.
8482 SUCCESS = 1;
8483 // Android user switch failed.
8484 FAILURE = 2;
8485 }
8486 optional UserSwitchStatus switch_status = 2;
8487}
8488
8489/**
8490 * Logs when initial user information is requested from Car User Hal.
8491 *
8492 * Logged from:
8493 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8494 */
8495message CarUserHalInitialUserInfoRequestReported {
8496 // Request id for the request.
8497 optional int32 request_id = 1;
8498
8499 // Request type for initial user information.
8500 enum InitialUserInfoRequestType {
8501 UNKNOWN = 0;
8502 // At the first time Android was booted (or after a factory reset).
8503 FIRST_BOOT = 1;
8504 // At the first time Android was booted after the system was updated.
8505 FIRST_BOOT_AFTER_OTA = 2;
8506 // When Android was booted "from scratch".
8507 COLD_BOOT = 3;
8508 // When Android was resumed after the system was suspended to memory.
8509 RESUME = 4;
8510 }
8511 optional InitialUserInfoRequestType request_type = 2;
8512 // Request timeout Milliseconds (-1 if not available)
8513 optional int32 timeout_millis = 3;
8514}
8515
8516/**
8517 * Logs when Car User Hal responds to initial user information requests.
8518 *
8519 * Logged from:
8520 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8521 */
8522message CarUserHalInitialUserInfoResponseReported {
8523 // Request id of the request associated with the response.
8524 optional int32 request_id = 1;
8525 // Car user hal callback status.
8526 enum CallbackStatus {
8527 UNKNOWN = 0;
8528 // Hal response was invalid.
8529 INVALID = 1;
8530 // Hal response was ok.
8531 OK = 2;
8532 // Hal timeout during set call.
8533 HAL_SET_TIMEOUT = 3;
8534 // Hal response timeout.
8535 HAL_RESPONSE_TIMEOUT = 4;
8536 // Hal responded with wrong info.
8537 WRONG_HAL_RESPONSE = 5;
8538 // Hal is processing multiple requests simultaneously.
8539 CONCURRENT_OPERATION = 6;
8540 }
8541 optional CallbackStatus callback_status = 2;
8542 // Response for initial user information request.
8543 enum InitialUserInfoResponseAction {
8544 UNSPECIFIED = 0;
8545 // Let the Android System decide what to do.
8546 DEFAULT = 1;
8547 // Switch to an existing Android user.
8548 SWITCH = 2;
8549 // Create a new Android user (and switch to it).
8550 CREATE = 3;
8551 }
8552 optional InitialUserInfoResponseAction response_action = 3;
8553 // Android User id of the target user which can only be 0, 10, 11 and so on.
8554 // -1 if not available.
8555 optional int32 target_user = 4;
8556 // VHAL flags of the current user. (-1 if not available)
8557 optional int32 target_user_flags = 5;
8558 // User locales
8559 optional string user_locales = 6;
8560}
8561
8562/**
8563 * Logs when set user association is requested from Car User Hal.
8564 *
8565 * Logged from:
8566 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8567 */
8568message CarUserHalUserAssociationRequestReported {
8569 // Request id for the request.
8570 optional int32 request_id = 1;
8571 // Request type.
8572 enum RequestType {
8573 UNKNOWN = 0;
8574 // For setting user association information.
8575 SET = 1;
8576 // For getting user association information.
8577 GET = 2;
8578 }
8579 optional RequestType request_type = 2;
8580 // Android User id of the current user which can only be 0, 10, 11 and so on.
8581 // -1 if not available.
8582 optional int32 current_user_id = 3;
8583 // VHAL flags of the current user. (-1 if not available)
8584 optional int32 current_user_flags = 4;
8585 // Number of the set associations requested.
8586 optional int32 number_associations = 5;
8587 // Concatenated string for the types from set associations request.
8588 // This is a string converted from an array of integers.
8589 optional string user_identification_association_types = 6;
8590 // Concatenated string for the values from set associations request.
8591 // This is a string converted from an array of integers.
8592 optional string user_identification_association_values = 7;
8593}
8594
8595/**
8596 * Logs when Car User Hal responds to set user association requests.
8597 *
8598 * Logged from:
8599 * packages/services/Car/service/src/com/android/car/hal/UserHalService.java
8600 */
8601message CarUserHalSetUserAssociationResponseReported {
8602 // Request id of the request associated with the response.
8603 optional int32 request_id = 1;
8604 // Car user hal callback status.
8605 enum CallbackStatus {
8606 UNKNOWN = 0;
8607 // Hal response was invalid.
8608 INVALID = 1;
8609 // Hal response was ok.
8610 OK = 2;
8611 // Hal timeout during set call.
8612 HAL_SET_TIMEOUT = 3;
8613 // Hal response timeout.
8614 HAL_RESPONSE_TIMEOUT = 4;
8615 // Hal responded with wrong info.
8616 WRONG_HAL_RESPONSE = 5;
8617 // Hal is processing multiple requests simultaneously.
8618 CONCURRENT_OPERATION = 6;
8619 }
8620 optional CallbackStatus callback_status = 2;
8621 // Number of the set associations in the response.
8622 optional int32 number_associations = 3;
8623 // Concatenated string for the types from set associations request.
8624 // This is a string converted from an array of integers.
8625 optional string user_identification_association_types = 4;
8626 // Concatenated string for the values from set associations request.
8627 // This is a string converted from an array of integers.
8628 optional string user_identification_association_values = 5;
8629}
8630
8631/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07008632 * Logs whether GarageMode is entered.
8633 *
8634 * Logged from:
8635 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
8636 */
8637message GarageModeInfo {
8638 // Whether GarageMode is entered.
8639 optional bool is_garage_mode = 1;
8640}
Martijn Coenencd95d462019-04-25 17:09:45 +02008641
8642/**
8643 * Historical app ops data per package.
8644 */
8645message AppOps {
8646 // Uid of the package requesting the op
8647 optional int32 uid = 1 [(is_uid) = true];
8648
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008649 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02008650 optional string package_name = 2;
8651
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00008652 // operation id
8653 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02008654
8655 // The number of times the op was granted while the app was in the
8656 // foreground (only for trusted requests)
8657 optional int64 trusted_foreground_granted_count = 4;
8658
8659 // The number of times the op was granted while the app was in the
8660 // background (only for trusted requests)
8661 optional int64 trusted_background_granted_count = 5;
8662
8663 // The number of times the op was rejected while the app was in the
8664 // foreground (only for trusted requests)
8665 optional int64 trusted_foreground_rejected_count = 6;
8666
8667 // The number of times the op was rejected while the app was in the
8668 // background (only for trusted requests)
8669 optional int64 trusted_background_rejected_count = 7;
8670
8671 // For long-running operations, total duration of the operation
8672 // while the app was in the foreground (only for trusted requests)
8673 optional int64 trusted_foreground_duration_millis = 8;
8674
8675 // For long-running operations, total duration of the operation
8676 // while the app was in the background (only for trusted requests)
8677 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00008678
8679 // Whether AppOps is guarded by Runtime permission
8680 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02008681}
Hongyi Zhang700137e2019-05-23 21:19:36 -07008682
8683/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008684 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008685 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008686message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008687 // Uid of the package requesting the op
8688 optional int32 uid = 1 [(is_uid) = true];
8689
8690 // Name of the package performing the op
8691 optional string package_name = 2;
8692
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008693 // tag; provided by developer when accessing related API, limited at 50 chars by API.
8694 // Attributions must be provided through manifest using <attribution> tag available in R and
8695 // above.
8696 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008697
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00008698 // operation id
8699 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008700
8701 // The number of times the op was granted while the app was in the
8702 // foreground (only for trusted requests)
8703 optional int64 trusted_foreground_granted_count = 5;
8704
8705 // The number of times the op was granted while the app was in the
8706 // background (only for trusted requests)
8707 optional int64 trusted_background_granted_count = 6;
8708
8709 // The number of times the op was rejected while the app was in the
8710 // foreground (only for trusted requests)
8711 optional int64 trusted_foreground_rejected_count = 7;
8712
8713 // The number of times the op was rejected while the app was in the
8714 // background (only for trusted requests)
8715 optional int64 trusted_background_rejected_count = 8;
8716
8717 // For long-running operations, total duration of the operation
8718 // while the app was in the foreground (only for trusted requests)
8719 optional int64 trusted_foreground_duration_millis = 9;
8720
8721 // For long-running operations, total duration of the operation
8722 // while the app was in the background (only for trusted requests)
8723 optional int64 trusted_background_duration_millis = 10;
8724
8725 // Whether AppOps is guarded by Runtime permission
8726 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00008727
8728 // Sampling rate used on device, from 0 to 100
8729 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00008730}
8731
8732/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07008733 * Location Manager API Usage information(e.g. API under usage,
8734 * API call's parameters).
8735 * Logged from:
8736 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
8737 */
8738message LocationManagerApiUsageReported {
8739
8740 // Indicating if usage starts or usage ends.
8741 optional android.stats.location.UsageState state = 1;
8742
8743 // LocationManagerService's API in use.
8744 // We can identify which API from LocationManager is
8745 // invoking current LMS API by the combination of
8746 // API parameter(e.g. is_listener_null, is_intent_null,
8747 // is_location_request_null)
8748 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
8749
8750 // Name of the package calling the API.
8751 optional string calling_package_name = 3;
8752
8753 // Type of the location provider.
8754 optional android.stats.location.ProviderType provider = 4;
8755
8756 // Quality of the location request
8757 optional android.stats.location.LocationRequestQuality quality = 5;
8758
8759 // The desired interval for active location updates, in milliseconds.
8760 // Bucketized to reduce cardinality.
8761 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
8762
8763 // Minimum distance between location updates, in meters.
8764 // Bucketized to reduce cardinality.
8765 optional android.stats.location.SmallestDisplacementBucket
8766 bucketized_smallest_displacement = 7;
8767
8768 // The number of location updates.
8769 optional int64 num_updates = 8;
8770
8771 // The request expiration time, in millisecond since boot.
8772 // Bucketized to reduce cardinality.
8773 optional android.stats.location.ExpirationBucket
8774 bucketized_expire_in = 9;
8775
8776 // Type of Callback passed in for this API.
8777 optional android.stats.location.CallbackType callback_type = 10;
8778
8779 // The radius of the central point of the alert
8780 // region, in meters. Only for API REQUEST_GEOFENCE.
8781 // Bucketized to reduce cardinality.
8782 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8783
8784 // Activity Importance of API caller.
8785 // Categorized to 3 types that are interesting from location's perspective.
8786 optional android.stats.location.ActivityImportance activiy_importance = 12;
8787}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008788
8789/**
8790 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8791 */
8792message ReviewPermissionsFragmentResultReported {
8793 // unique value identifying a permission group change. A permission group change might result
8794 // in multiple of these atoms
8795 optional int64 change_id = 1;
8796
8797 // UID of package the permission belongs to
8798 optional int32 uid = 2 [(is_uid) = true];
8799
8800 // Name of package the permission belongs to
8801 optional string package_name = 3;
8802
8803 // The permission to be granted
8804 optional string permission_name = 4;
8805
8806 // The result of the permission grant
8807 optional bool permission_granted = 5;
8808}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008809
8810/**
8811* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8812* Logged from: RuntimePermissionUpdgradeController
8813*/
8814message RuntimePermissionsUpgradeResult {
8815 // Permission granted as result of upgrade
8816 optional string permission_name = 1;
8817
8818 // UID of package granted permission
8819 optional int32 uid = 2 [(is_uid) = true];
8820
8821 // Name of package granted permission
8822 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008823}
8824
8825/**
8826* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8827*/
8828message GrantPermissionsActivityButtonActions {
8829 // Permission granted as result of upgrade
8830 optional string permission_group_name = 1;
8831
8832 // UID of package granted permission
8833 optional int32 uid = 2 [(is_uid) = true];
8834
8835 // Name of package requesting permission
8836 optional string package_name = 3;
8837
8838 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8839 // LABEL_ constants in GrantPermissionActivity.java
8840 optional int32 buttons_presented = 4;
8841
8842 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8843 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008844
8845 // id which identifies single session of user interacting with permission controller
8846 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008847}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008848
8849/**
8850 * Information about LocationAccessCheck notification presented to user
8851 */
8852message LocationAccessCheckNotificationAction {
8853
8854 // id which identifies single session of user interacting with permission controller
8855 optional int64 session_id = 1;
8856
8857 // Uid of package for which location access check is presented
8858 optional int32 package_uid = 2;
8859
8860 // Name of package for which location access check is presented
8861 optional string package_name = 3;
8862
8863 enum Result {
8864 UNDEFINED = 0;
8865 // notification was presented to the user
8866 NOTIFICATION_PRESENTED = 1;
8867 // notification was declined by the user
8868 NOTIFICATION_DECLINED = 2;
8869 // notification was clicked by the user
8870 NOTIFICATION_CLICKED = 3;
8871 }
8872
8873 // View / interaction recorded
8874 optional Result result = 4;
8875}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008876
8877/**
8878 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8879 */
8880message AppPermissionFragmentActionReported {
8881 // id which identifies single session of user interacting with permission controller
8882 optional int64 session_id = 1;
8883
8884 // unique value identifying a permission group change. A permission group change might result
8885 // in multiple of these atoms
8886 optional int64 change_id = 2;
8887
8888 // UID of package the permission belongs to
8889 optional int32 uid = 3 [(is_uid) = true];
8890
8891 // Name of package the permission belongs to
8892 optional string package_name = 4;
8893
8894 // The permission to be granted
8895 optional string permission_name = 5;
8896
8897 // The result of the permission grant
8898 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008899
8900 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8901 optional int32 permission_flags = 7;
8902
8903 enum Button {
8904 UNDEFINED = 0;
8905 // Allow button
8906 ALLOW = 1;
8907 // Deny button
8908 DENY = 2;
8909 // Ask every time button
8910 ASK_EVERY_TIME = 3;
8911 // Allow all the time button
8912 ALLOW_ALWAYS = 4;
8913 // Allow only while using the app button
8914 ALLOW_FOREGROUND = 5;
8915 // Same is Deny button but shown in while in use dialog
8916 DENY_FOREGROUND = 6;
8917 }
8918
8919 // Button pressed in the dialog
8920 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008921}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008922
8923/**
8924* Information about a AppPermissionFragment viewed by user
8925*/
8926message AppPermissionFragmentViewed {
8927 // id which identifies single session of user interacting with permission controller
8928 optional int64 session_id = 1;
8929
8930 // UID of package for which permissions are viewed
8931 optional int32 uid = 2 [(is_uid) = true];
8932
8933 // Name of package for which permissions are viewed
8934 optional string package_name = 3;
8935
8936 // Permission group viewed
8937 optional string permission_group_name = 4;
8938}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008939
8940/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07008941* Information about a AppPermissionGroupsFragment viewed by user. Fragment has been renamed, but
8942* the log retains the old fragment name.
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008943*/
8944message AppPermissionsFragmentViewed {
8945 // id which identifies single session of user interacting with permission controller
8946 optional int64 session_id = 1;
8947
8948 // id which identifies single view as every view might have several logging records
8949 // with different package information attached
8950 optional int64 view_id = 2;
8951
8952 // Permission group viewed
8953 optional string permission_group_name = 3;
8954
8955 // UID of package for which permissions are viewed
8956 optional int32 uid = 4 [(is_uid) = true];
8957
8958 // Name of package for which permissions are viewed
8959 optional string package_name = 5;
8960
8961 // Category in which permission is included
8962 enum Category {
8963 UNDEFINED = 0;
8964 ALLOWED = 1;
8965 ALLOWED_FOREGROUND = 2;
8966 DENIED = 3;
8967 }
8968 optional Category category = 6;
8969}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008970/**
8971* Information about a PermissionAppsFragment viewed by user.
8972* Logged from ui/handheld/PermissionAppsFragment.java
8973*/
8974message PermissionAppsFragmentViewed {
8975 // id which identifies single session of user interacting with permission controller
8976 optional int64 session_id = 1;
8977
8978 // id which identifies single view as every view might have several logging records
8979 // with different package information attached
8980 optional int64 view_id = 2;
8981
8982 // Permission group viewed
8983 optional string permission_group_name = 3;
8984
8985 // UID of package for which permissions are viewed
8986 optional int32 uid = 4 [(is_uid) = true];
8987
8988 // Name of package for which permissions are viewed
8989 optional string package_name = 5;
8990
8991 // Category in which app is included
8992 enum Category {
8993 UNDEFINED = 0;
8994 ALLOWED = 1;
8995 ALLOWED_FOREGROUND = 2;
8996 DENIED = 3;
8997 }
8998 optional Category category = 6;
8999}
Tony Make2b1b672019-07-29 16:59:47 +01009000
9001/**
Nate Myrene8f912bb2020-04-30 10:41:38 -07009002* Log that the Auto Revoke notification has been clicked
9003* Logged from ui/ManagePermissionsActivity
9004*/
9005message AutoRevokeNotificationClicked {
9006 // id which identifies single session of user interacting with permission controller
9007 optional int64 session_id = 1;
9008}
9009
9010/**
9011* Log that an app has been displayed on the auto revoke page, and lists one permission that was
9012* auto revoked for it.
9013* Logged from ui/handheld/AutoRevokeFragment
9014*/
9015message AutoRevokeFragmentAppViewed {
9016 // id which identifies single session of user interacting with permission controller
9017 optional int64 session_id = 1;
9018
9019 // UID of package for which permissions are viewed
9020 optional int32 uid = 2 [(is_uid) = true];
9021
9022 // Name of package for which permissions are viewed
9023 optional string package_name = 3;
9024
9025 // The name of a permission group that has been revoked
9026 optional string permission_group_name = 4;
9027
9028 // The age of the app- more than three months old, or more than six months
9029 enum Age {
9030 UNDEFINED = 0;
9031 NEWER_BUCKET = 1;
9032 OLDER_BUCKET = 2;
9033 }
9034
9035 // How long the app has been unused. Currently, newer bucket is 3 months, older is 6 months
9036 optional Age age = 5;
9037}
9038
9039/**
9040* Log that the user has interacted with an app on the auto revoke fragment
9041* Logged from ui/handheld/AutoRevokeFragment
9042*/
9043message AutoRevokedAppInteraction {
9044 // id which identifies single session of user interacting with permission controller
9045 optional int64 session_id = 1;
9046
9047 // UID of package for which permissions are viewed
9048 optional int32 uid = 2 [(is_uid) = true];
9049
9050 // Name of package for which permissions are viewed
9051 optional string package_name = 3;
9052
9053 enum Action {
9054 UNDEFINED = 0;
9055 REMOVE = 1;
9056 OPEN = 2;
9057 APP_INFO = 3;
9058 PERMISSIONS = 4;
9059 REMOVE_IN_SETTINGS = 5;
9060 OPEN_IN_SETTINGS = 6;
9061 }
9062
9063 // The action the user took to interact with the app
9064 optional Action action = 4;
9065}
9066
9067/**
9068* Log that the AppPermissionGroupsFragment has been interacted with for the possible purposes of
9069* auto revoke, or that the auto revoke switch has been changed
9070* Logged from ui/handheld/AppPermissionGroupsFragment
9071 */
9072message AppPermissionGroupsFragmentAutoRevokeAction {
9073 // id which identifies single session of user interacting with permission controller
9074 optional int64 session_id = 1;
9075
9076 // UID of package for which permissions are viewed
9077 optional int32 uid = 2 [(is_uid) = true];
9078
9079 // Name of package for which permissions are viewed
9080 optional string package_name = 3;
9081
9082 enum Action {
9083 UNDEFINED = 0;
9084 OPENED_FOR_AUTO_REVOKE = 1;
9085 OPENED_FROM_INTENT = 2;
9086 SWITCH_ENABLED = 3;
9087 SWITCH_DISABLED = 4;
9088 }
9089
9090 // The action the user took to interact with the fragment
9091 optional Action action = 4;
9092}
9093
9094/**
Tony Make2b1b672019-07-29 16:59:47 +01009095 * Logs when there is a smart selection related event.
9096 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9097 * Logged from: TextClassifierEventLogger.java
9098 */
9099message TextSelectionEvent {
9100 // A session ID.
9101 optional string session_id = 1;
9102
9103 // Event type of this event.
9104 optional android.stats.textclassifier.EventType event_type = 2;
9105
Tony Mak9c84bd22019-12-09 07:27:25 +00009106 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009107 optional string model_name = 3;
9108
9109 // Type of widget that was involved in triggering this event.
9110 optional android.stats.textclassifier.WidgetType widget_type = 4;
9111
9112 // Index of this event in a session.
9113 optional int32 event_index = 5;
9114
9115 // Entity type that is involved.
9116 optional string entity_type = 6;
9117
9118 // Relative word index of the start of the selection.
9119 optional int32 relative_word_start_index = 7;
9120
9121 // Relative word (exclusive) index of the end of the selection.
9122 optional int32 relative_word_end_index = 8;
9123
9124 // Relative word index of the start of the smart selection.
9125 optional int32 relative_suggested_word_start_index = 9;
9126
9127 // Relative word (exclusive) index of the end of the smart selection.
9128 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009129
9130 // Name of source package.
9131 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009132
9133 // Name of the LangID model that is involved in this event.
9134 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009135}
9136
9137/**
9138 * Logs when there is a smart linkify related event.
9139 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9140 * Logged from: TextClassifierEventLogger.java
9141 */
9142message TextLinkifyEvent {
9143 // A session ID.
9144 optional string session_id = 1;
9145
9146 // Event type of this event.
9147 optional android.stats.textclassifier.EventType event_type = 2;
9148
Tony Mak9c84bd22019-12-09 07:27:25 +00009149 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009150 optional string model_name = 3;
9151
9152 // Type of widget that was involved in triggering this event.
9153 optional android.stats.textclassifier.WidgetType widget_type = 4;
9154
9155 // Index of this event in a session.
9156 optional int32 event_index = 5;
9157
9158 // Entity type that is involved.
9159 optional string entity_type = 6;
9160
9161 // Number of links detected.
9162 optional int32 num_links = 7;
9163
9164 // The total length of all links.
9165 optional int32 linked_text_length = 8;
9166
9167 // Length of input text.
9168 optional int32 text_length = 9;
9169
9170 // Time spent on generating links in ms.
9171 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01009172
9173 // Name of source package.
9174 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00009175
9176 // Name of the LangID model that is involved in this event.
9177 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01009178}
9179
9180/**
9181 * Logs when there is a conversation actions related event.
9182 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9183 * Logged from: TextClassifierEventLogger.java
9184 */
9185message ConversationActionsEvent {
9186 // A session ID.
9187 optional string session_id = 1;
9188
9189 // Event type of this event.
9190 optional android.stats.textclassifier.EventType event_type = 2;
9191
Tony Mak9c84bd22019-12-09 07:27:25 +00009192 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009193 optional string model_name = 3;
9194
9195 // Type of widget that was involved in triggering this event.
9196 optional android.stats.textclassifier.WidgetType widget_type = 4;
9197
9198 // The first entity type that is involved.
9199 optional string first_entity_type = 5;
9200
9201 // The second entity type that is involved.
9202 optional string second_entity_type = 6;
9203
9204 // The third entity type that is involved.
9205 optional string third_entity_type = 7;
9206
9207 // The score of the first entity type.
9208 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01009209
9210 // Name of source package.
9211 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00009212
9213 // Name of the annotator model that is involved in this event.
9214 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00009215
9216 // Name of the LangID model that is involved in this event.
9217 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01009218}
9219
9220/**
9221 * Logs when there is a language detection related event.
9222 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
9223 * Logged from: TextClassifierEventLogger.java
9224 */
9225message LanguageDetectionEvent {
9226 // A session ID.
9227 optional string session_id = 1;
9228
9229 // Event type of this event.
9230 optional android.stats.textclassifier.EventType event_type = 2;
9231
Tony Mak9c84bd22019-12-09 07:27:25 +00009232 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01009233 optional string model_name = 3;
9234
9235 // Type of widget that was involved in triggering this event.
9236 optional android.stats.textclassifier.WidgetType widget_type = 4;
9237
9238 // Detected language.
9239 optional string language_tag = 5;
9240
9241 // Score of the detected language.
9242 optional float score = 6;
9243
9244 // Position of this action.
9245 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01009246
9247 // Name of source package.
9248 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01009249}
Tianjie Xu167c3db2019-07-22 14:25:14 -07009250
9251/**
9252 * Information about an OTA update attempt by update_engine.
9253 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9254 */
9255message UpdateEngineUpdateAttemptReported {
9256 // The number of attempts for the update engine to apply a given payload.
9257 optional int32 attempt_number = 1;
9258
9259 optional android.stats.otaupdate.PayloadType payload_type = 2;
9260
9261 // The total time in minutes for the update engine to apply a given payload.
9262 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
9263 // it's increased when the system is sleeping.
9264 optional int32 duration_boottime_in_minutes = 3;
9265
9266 // The total time in minutes for the update engine to apply a given payload.
9267 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
9268 // and it's not increased when the system is sleeping.
9269 optional int32 duration_monotonic_in_minutes = 4;
9270
9271 // The size of the payload in MiBs.
9272 optional int32 payload_size_mib = 5;
9273
9274 // The attempt result reported by the update engine for an OTA update.
9275 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
9276
9277 // The error code reported by the update engine after an OTA update attempt
9278 // on A/B devices.
9279 optional android.stats.otaupdate.ErrorCode error_code = 7;
9280
9281 // The build fingerprint of the source system. The value is read from a
9282 // system property when the device takes the update. e.g.
9283 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
9284 optional string source_fingerprint = 8;
Alessio Balsinid8698fa2020-05-26 22:26:56 +01009285
9286 // Size of super partition.
9287 optional int64 super_partition_size_bytes = 9;
9288
9289 // Size of current slot within the super partition.
9290 optional int64 slot_size_bytes = 10;
9291
9292 // Free space available in the super partition.
9293 optional int64 super_free_space_bytes = 11;
Tianjie Xu167c3db2019-07-22 14:25:14 -07009294}
9295
9296/**
9297 * Information about all the attempts the device make before finishing the
9298 * successful update.
9299 * Logged from platform/system/update_engine/metrics_reporter_android.cc
9300 */
9301message UpdateEngineSuccessfulUpdateReported {
9302 // The number of attempts for the update engine to apply the payload for a
9303 // successful update.
9304 optional int32 attempt_count = 1;
9305
9306 optional android.stats.otaupdate.PayloadType payload_type = 2;
9307
9308 optional int32 payload_size_mib = 3;
9309
9310 // The total number of bytes downloaded by update_engine since the last
9311 // successful update.
9312 optional int32 total_bytes_downloaded_mib = 4;
9313
9314 // The ratio in percentage of the over-downloaded bytes compared to the
9315 // total bytes needed to successfully install the update. e.g. 200 if we
9316 // download 200MiB in total for a 100MiB package.
9317 optional int32 download_overhead_percentage = 5;
9318
9319 // The total time in minutes for the update engine to apply the payload for a
9320 // successful update.
9321 optional int32 total_duration_minutes = 6;
9322
9323 // The number of reboot of the device during a successful update.
9324 optional int32 reboot_count = 7;
9325}
Alec Mourie088e762019-07-02 13:10:55 -07009326
9327/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08009328 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
9329 * key to indicate whether it was successful or not.
9330 *
9331 * Logged from:
9332 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
9333 */
9334message RebootEscrowRecoveryReported {
9335 optional bool successful = 1;
9336}
9337
9338/**
Alec Mourie088e762019-07-02 13:10:55 -07009339 * Global display pipeline metrics reported by SurfaceFlinger.
9340 * Pulled from:
9341 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9342 */
9343message SurfaceflingerStatsGlobalInfo {
9344 // Total number of frames presented during the tracing period
9345 optional int64 total_frames = 1;
9346 // Total number of frames missed
9347 optional int64 missed_frames = 2;
9348 // Total number of frames that fell back to client composition
9349 optional int64 client_composition_frames = 3;
9350 // Total time the display was turned on
9351 optional int64 display_on_millis = 4;
9352 // Total time that was spent performing animations.
9353 // This is derived from the present-to-present layer histogram
9354 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08009355 // Total number of event connections tracked by SurfaceFlinger at the time
9356 // of this pull. If this number grows prohibitively large, then this can
9357 // cause jank due to resource contention.
9358 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08009359 // Set of timings measured from when SurfaceFlinger began compositing a
9360 // frame, until the frame was requested to be presented to the display. This
9361 // measures SurfaceFlinger's total CPU walltime on the critical path per
9362 // frame.
9363 optional FrameTimingHistogram frame_duration = 7
9364 [(android.os.statsd.log_mode) = MODE_BYTES];
9365 // Set of timings measured from when SurfaceFlinger first began using the
9366 // GPU to composite a frame, until the GPU has finished compositing that
9367 // frame. This measures the total additional time SurfaceFlinger needed to
9368 // perform due to falling back into GPU composition.
9369 optional FrameTimingHistogram render_engine_timing = 8
9370 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07009371}
9372
9373/**
9374 * Per-layer display pipeline metrics reported by SurfaceFlinger.
9375 * The number of layers uploaded will be restricted due to size limitations.
9376 * Pulled from:
9377 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
9378 */
9379message SurfaceflingerStatsLayerInfo {
9380 // The layer for this set of metrics
9381 // For now we can infer that the package name is included in the layer
9382 // name.
9383 optional string layer_name = 1;
9384 // Total number of frames presented
9385 optional int64 total_frames = 2;
9386 // Total number of dropped frames while latching a buffer for this layer.
9387 optional int64 dropped_frames = 3;
9388 // Set of timings measured between successive presentation timestamps.
9389 optional FrameTimingHistogram present_to_present = 4
9390 [(android.os.statsd.log_mode) = MODE_BYTES];
9391 // Set of timings measured from when an app queued a buffer for
9392 // presentation, until the buffer was actually presented to the
9393 // display.
9394 optional FrameTimingHistogram post_to_present = 5
9395 [(android.os.statsd.log_mode) = MODE_BYTES];
9396 // Set of timings measured from when a buffer is ready to be presented,
9397 // until the buffer was actually presented to the display.
9398 optional FrameTimingHistogram acquire_to_present = 6
9399 [(android.os.statsd.log_mode) = MODE_BYTES];
9400 // Set of timings measured from when a buffer was latched by
9401 // SurfaceFlinger, until the buffer was presented to the display
9402 optional FrameTimingHistogram latch_to_present = 7
9403 [(android.os.statsd.log_mode) = MODE_BYTES];
9404 // Set of timings measured from the desired presentation to the actual
9405 // presentation time
9406 optional FrameTimingHistogram desired_to_present = 8
9407 [(android.os.statsd.log_mode) = MODE_BYTES];
9408 // Set of timings measured from when an app queued a buffer for
9409 // presentation, until the buffer was ready to be presented.
9410 optional FrameTimingHistogram post_to_acquire = 9
9411 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08009412 // Frames missed latch because the acquire fence didn't fire
9413 optional int64 late_acquire_frames = 10;
9414 // Frames latched early because the desired present time was bad
9415 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07009416}
9417
9418/**
9419 * Histogram of frame counts bucketed by time in milliseconds.
9420 * Because of size limitations, we hard-cap the number of buckets, with
9421 * buckets for corresponding to larger milliseconds being less precise.
9422 */
9423message FrameTimingHistogram {
9424 // Timings in milliseconds that describes a set of histogram buckets
9425 repeated int32 time_millis_buckets = 1;
9426 // Number of frames that match to each time_millis, i.e. the bucket
9427 // contents
9428 // It's required that len(time_millis) == len(frame_count)
9429 repeated int64 frame_counts = 2;
9430}
Emilian Peev6729f372019-08-29 09:14:09 -07009431
Emilian Peev6729f372019-08-29 09:14:09 -07009432/**
Alec Mouri5ac32622020-02-06 08:44:25 -08009433 * Janky event as reported by SurfaceFlinger.
9434 * This event is intended to be consumed by a Perfetto subscriber for
9435 * automated trace collection.
9436 *
9437 * Logged from:
9438 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
9439 */
9440message DisplayJankReported {
9441 // Informational field for how long the janky event lasted in milliseconds
9442 optional int64 event_duration_millis = 1;
9443 // Number of frame deadlines missed, where SurfaceFlinger failed to update
9444 // the display on time.
9445 optional int32 present_deadlines_missed = 2;
9446}
9447
9448/**
Emilian Peev6729f372019-08-29 09:14:09 -07009449 * Information about camera facing and API level usage.
9450 * Logged from:
9451 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
9452 */
9453message CameraActionEvent {
9454 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08009455 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07009456
9457 // Camera API level used
9458 optional int32 api_level = 2;
9459
9460 // Name of client package
9461 optional string package_name = 3;
9462
9463 // Camera facing
9464 enum Facing {
9465 UNKNOWN = 0;
9466 BACK = 1;
9467 FRONT = 2;
9468 EXTERNAL = 3;
9469 }
9470 optional Facing facing = 4;
9471}
atrost01a20932019-08-28 15:40:37 +01009472
9473/**
9474 * Logs when a compatibility change is affecting an app.
9475 *
9476 * Logged from:
9477 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
9478 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
9479 */
9480message AppCompatibilityChangeReported {
9481 // The UID of the app being affected by the compatibilty change.
9482 optional int32 uid = 1 [(is_uid) = true];
9483
9484 // The ID of the change affecting the app.
9485 optional int64 change_id = 2;
9486
9487 enum State {
9488 UNKNOWN_STATE = 0;
9489 ENABLED = 1;
9490 DISABLED = 2;
9491 LOGGED = 3;
9492 }
9493
9494 // The state of the change - if logged from gating whether it was enabled or disabled, or just
9495 // logged otherwise.
9496 optional State state = 3;
9497
9498 enum Source {
9499 UNKNOWN_SOURCE = 0;
9500 APP_PROCESS = 1;
9501 SYSTEM_SERVER = 2;
9502 }
9503
9504 // Where it was logged from.
9505 optional Source source = 4;
9506
9507}
Hector Dearman40579f62019-11-01 13:19:30 +00009508
9509/**
9510 * Logged from
9511 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
9512 */
9513message PerfettoUploaded {
9514 enum Event {
9515 PERFETTO_UNDEFINED = 0;
9516 PERFETTO_TRACE_BEGIN = 1;
9517 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
9518 PERFETTO_ON_CONNECT = 3;
9519 PERFETTO_ON_TRACING_DISABLED = 4;
9520 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
9521 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
9522 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
9523 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
9524 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
9525 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
9526 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
9527 PERFETTO_TRIGGER_BEGIN = 12;
9528 PERFETTO_TRIGGER_SUCCESS = 13;
9529 PERFETTO_TRIGGER_FAILURE = 14;
9530 PERFETTO_HIT_GUARDRAILS = 15;
9531 PERFETTO_ON_TIMEOUT = 16;
9532 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
9533 }
9534
9535 // Which stage of the pipeline we are reporting from.
9536 optional Event event = 1;
9537
9538 // UUID matching the one set inside the SystemInfo trace packet.
9539 optional int64 trace_uuid_lsb = 2;
9540 optional int64 trace_uuid_msb = 3;
9541}
Mark Tabrya824a642019-11-05 12:26:12 -08009542
9543/**
9544 * Pulls client metrics on data transferred via Vehicle Maps Service.
9545 * Metrics are keyed by uid + layer.
9546 *
9547 * Pulled from:
9548 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
9549 */
9550message VmsClientStats {
9551 // UID of the VMS client app
9552 optional int32 uid = 1 [(is_uid) = true];
9553
9554 // VMS layer definition
9555 optional int32 layer_type = 2;
9556 optional int32 layer_channel = 3;
9557 optional int32 layer_version = 4;
9558
9559 // Bytes and packets sent by the client for the layer
9560 optional int64 tx_bytes = 5;
9561 optional int64 tx_packets = 6;
9562
9563 // Bytes and packets received by the client for the layer
9564 optional int64 rx_bytes = 7;
9565 optional int64 rx_packets = 8;
9566
9567 // Bytes and packets dropped due to client error
9568 optional int64 dropped_bytes = 9;
9569 optional int64 dropped_packets = 10;
9570}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00009571
9572/**
9573 * State of a dangerous permission requested by a package - sampled
9574 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
9575*/
9576message DangerousPermissionStateSampled {
9577 // Name of the permission
9578 optional string permission_name = 1;
9579
9580 // Uid of the package
9581 optional int32 uid = 2 [(is_uid) = true];
9582
9583 // If the permission is granted to the uid
9584 optional bool is_granted = 3;
9585
9586 // Permission flags as per android.content.pm.PermissionFlags
9587 optional int32 permission_flags = 4;
9588}
9589
Stan Iliev637ba5e2019-08-16 13:43:08 -04009590/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04009591 * HWUI stats for a given app.
9592 */
9593message GraphicsStats {
9594 // The package name of the app
9595 optional string package_name = 1;
9596
9597 // The version code of the app
9598 optional int64 version_code = 2;
9599
9600 // The start & end timestamps in UTC as
9601 // milliseconds since January 1, 1970
9602 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05009603 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04009604
Stan Ilievb6517192020-02-18 10:12:42 -05009605 optional int64 end_millis = 4;
9606
9607 // HWUI renders pipeline type: GL (1) or Vulkan (2).
9608 enum PipelineType {
9609 UNKNOWN = 0;
9610 GL = 1;
9611 VULKAN = 2;
9612 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04009613
9614 // HWUI renders pipeline type: GL or Vulkan.
9615 optional PipelineType pipeline = 5;
9616
9617 // Distinct frame count.
9618 optional int32 total_frames = 6;
9619
9620 // Number of "missed vsync" events.
9621 optional int32 missed_vsync_count = 7;
9622
9623 // Number of frames in triple-buffering scenario (high input latency)
9624 optional int32 high_input_latency_count = 8;
9625
9626 // Number of "slow UI thread" events.
9627 optional int32 slow_ui_thread_count = 9;
9628
9629 // Number of "slow bitmap upload" events.
9630 optional int32 slow_bitmap_upload_count = 10;
9631
9632 // Number of "slow draw" events.
9633 optional int32 slow_draw_count = 11;
9634
9635 // Number of frames that missed their deadline (aka, visibly janked)
9636 optional int32 missed_deadline_count = 12;
9637
9638 // The frame time histogram for the package
9639 optional FrameTimingHistogram cpu_histogram = 13
9640 [(android.os.statsd.log_mode) = MODE_BYTES];
9641
9642 // The gpu frame time histogram for the package
9643 optional FrameTimingHistogram gpu_histogram = 14
9644 [(android.os.statsd.log_mode) = MODE_BYTES];
9645
9646 // UI mainline module version.
9647 optional int64 version_ui_module = 15;
9648
9649 // If true, these are HWUI stats for up to a 24h period for a given app from today.
9650 // If false, these are HWUI stats for a 24h period for a given app from the last complete
9651 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
9652 // more apps are running / rendering.
9653 optional bool is_today = 16;
9654}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009655
9656/**
9657 * Message related to dangerous (runtime) app ops access
9658 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00009659message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009660 // Uid of the package accessing app op
9661 optional int32 uid = 1 [(is_uid) = true];
9662
9663 // Name of the package accessing app op
9664 optional string package_name = 2;
9665
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009666 // deprecated - set to empty string
9667 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009668
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009669 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009670 // API. Attributions must be provided through manifest using <attribution> tag available in R
9671 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08009672 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009673
9674 // message related to app op access, limited to 600 chars by API
9675 optional string message = 5;
9676
9677 enum SamplingStrategy {
9678 DEFAULT = 0;
9679 UNIFORM = 1;
9680 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00009681 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009682 }
9683
9684 // sampling strategy used to collect this message
9685 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01009686
9687 // operation id
9688 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00009689}
9690
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00009691/*
9692 * Logs userspace reboot outcome and duration.
9693 *
9694 * Logged from:
9695 * frameworks/base/core/java/com/android/server/BootReceiver.java
9696 */
9697message UserspaceRebootReported {
9698 // Possible outcomes of userspace reboot.
9699 enum Outcome {
9700 // Default value in case platform failed to determine the outcome.
9701 OUTCOME_UNKNOWN = 0;
9702 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
9703 SUCCESS = 1;
9704 // Userspace reboot shutdown sequence was aborted.
9705 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
9706 // Remounting userdata into checkpointing mode failed.
9707 FAILED_USERDATA_REMOUNT = 3;
9708 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
9709 // reboot.
9710 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
9711 }
9712 // Outcome of userspace reboot. Always set.
9713 optional Outcome outcome = 1;
9714 // Duration of userspace reboot in case it has a successful outcome.
9715 // Duration is measured as time between userspace reboot was initiated and until boot completed
9716 // (e.g. sys.boot_completed=1).
9717 optional int64 duration_millis = 2;
9718 // State of primary user's (user0) credential encryption storage.
9719 enum UserEncryptionState {
9720 // Default value.
9721 USER_ENCRYPTION_STATE_UNKNOWN = 0;
9722 // Credential encrypted storage is unlocked.
9723 UNLOCKED = 1;
9724 // Credential encrypted storage is locked.
9725 LOCKED = 2;
9726 }
9727 // State of primary user's encryption storage at the moment boot completed. Always set.
9728 optional UserEncryptionState user_encryption_state = 3;
9729}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009730
9731/*
9732 * Logs integrity check information during each install.
9733 *
9734 * Logged from:
9735 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9736 */
9737message IntegrityCheckResultReported {
9738 optional string package_name = 1;
9739 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00009740 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00009741 optional string installer_package_name = 4;
9742 enum Response {
9743 UNKNOWN = 0;
9744 ALLOWED = 1;
9745 REJECTED = 2;
9746 FORCE_ALLOWED = 3;
9747 }
9748 optional Response response = 5;
9749 // An estimate on the cause of the response. This will only be populated for
9750 // REJECTED and FORCE_ALLOWED
9751 optional bool caused_by_app_cert_rule = 6;
9752 optional bool caused_by_installer_rule = 7;
9753}
9754
9755/**
9756 * Logs the information about the rules and the provider whenever rules are
9757 * pushed into AppIntegrityManager.
9758 *
9759 * Logged from:
9760 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
9761 */
9762message IntegrityRulesPushed {
9763 optional bool success = 1;
9764 // Package name of the app that pushed the rules.
9765 optional string rule_provider = 2;
9766 // Version string of arbitrary format provided by the rule provider to
9767 // identify the rules.
9768 optional string rule_version = 3;
9769}
Jordan Liubedfa702019-12-20 15:08:45 -08009770
9771/**
9772 * Logs when a cell broadcast message is received on the device.
9773 *
Jordan Liu900e5cb2020-05-29 09:44:59 -07009774 * Logged from Cell Broadcast module and platform:
Jordan Liubedfa702019-12-20 15:08:45 -08009775 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
Jordan Liu900e5cb2020-05-29 09:44:59 -07009776 * packages/apps/CellBroadcastReceiver/
9777 * frameworks/opt/telephony/src/java/com/android/internal/telephony/CellBroadcastServiceManager.java
Jordan Liubedfa702019-12-20 15:08:45 -08009778 */
9779message CellBroadcastMessageReported {
9780 // The type of Cell Broadcast message
9781 enum CbType {
9782 UNKNOWN_TYPE = 0;
9783 GSM = 1;
9784 CDMA = 2;
9785 CDMA_SPC = 3;
9786 }
9787
Jordan Liu900e5cb2020-05-29 09:44:59 -07009788 // The parts of the cell broadcast message pipeline
9789 enum ReportSource {
9790 UNKNOWN_SOURCE = 0;
9791 FRAMEWORK = 1;
9792 CB_SERVICE = 2;
9793 CB_RECEIVER_APP = 3;
9794 }
9795
Jordan Liubedfa702019-12-20 15:08:45 -08009796 // GSM, CDMA, CDMA-SCP
9797 optional CbType type = 1;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009798
9799 // The source of the report
9800 optional ReportSource source = 2;
9801}
9802
9803/**
9804 * Logs when a cell broadcast message is filtered out, or otherwise intentionally not sent to CBR.
9805 *
9806 * Logged from CellBroadcastService module:
9807 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9808 */
9809message CellBroadcastMessageFiltered {
9810 enum FilterReason {
9811 NOT_FILTERED = 0;
9812 DUPLICATE_MESSAGE = 1;
9813 GEOFENCED_MESSAGE = 2;
9814 AREA_INFO_MESSAGE = 3;
9815 }
9816
9817 // GSM, CDMA, CDMA-SCP
9818 optional CellBroadcastMessageReported.CbType type = 1;
9819
9820 // The source of the report
9821 optional FilterReason filter = 2;
Jordan Liubedfa702019-12-20 15:08:45 -08009822}
9823
9824/**
9825 * Logs when an error occurs while handling a cell broadcast message;
9826 *
9827 * Logged from CellBroadcastService module:
9828 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
9829 */
9830message CellBroadcastMessageError {
9831 // The type of error raised when trying to handle a cell broadcast message
9832 enum ErrorType {
9833 UNKNOWN_TYPE = 0;
9834 CDMA_DECODING_ERROR = 1;
9835 CDMA_SCP_EMPTY = 2;
9836 CDMA_SCP_HANDLING_ERROR = 3;
9837 GSM_INVALID_HEADER_LENGTH = 4;
9838 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
9839 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
9840 GSM_INVALID_PDU = 7;
9841 GSM_INVALID_GEO_FENCING_DATA = 8;
9842 GSM_UMTS_INVALID_WAC = 9;
9843 FAILED_TO_INSERT_TO_DB = 10;
9844 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
9845 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
9846 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
9847 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
Jordan Liu900e5cb2020-05-29 09:44:59 -07009848 NO_CONNECTION_TO_CB_SERVICE = 15;
Jordan Liubedfa702019-12-20 15:08:45 -08009849 }
9850
9851 // What kind of error occurred
9852 optional ErrorType type = 1;
9853
9854 // Exception message (or log message) associated with the error (max 1000 chars)
9855 optional string exception_message = 2;
9856}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00009857
9858/**
Henry Fange316ab62020-04-21 18:43:14 -07009859 * Logs when a tune occurs through device's Frontend.
9860 * This is atom ID 276.
9861 *
9862 * Logged from:
9863 * frameworks/base/media/java/android/media/tv/tuner/Tuner.java
9864 */
9865message TvTunerStateChanged {
9866 enum State {
9867 UNKNOWN = 0;
9868 TUNING = 1; // Signal is tuned
9869 LOCKED = 2; // the signal is locked
9870 NOT_LOCKED = 3; // the signal isn’t locked.
9871 SIGNAL_LOST = 4; // the signal was locked, but is lost now.
9872 SCANNING = 5; // the signal is scanned
9873 SCAN_STOPPED = 6; // the scan is stopped.
9874 }
9875 // The uid of the application that sent this custom atom.
9876 optional int32 uid = 1 [(is_uid) = true];
9877 // new state
9878 optional State state = 2;
9879}
Henry Fang1ae85bb2020-05-28 18:07:03 -07009880
9881/**
9882 * Logs the status of a dvr playback or record.
9883 * This is atom ID 279.
9884 *
9885 * Logged from:
9886 * frameworks/base/media/java/android/media/tv/tuner/dvr
9887 */
9888message TvTunerDvrStatus {
9889 enum Type {
9890 UNKNOWN_TYPE = 0;
9891 PLAYBACK = 1; // is a playback
9892 RECORD = 2; // is a record
9893 }
9894 enum State {
9895 UNKNOWN_STATE = 0;
9896 STARTED = 1; // DVR is started
9897 STOPPED = 2; // DVR is stopped
9898 }
9899 // The uid of the application that sent this custom atom.
9900 optional int32 uid = 1 [(is_uid) = true];
9901 // DVR type
9902 optional Type type = 2;
9903 // DVR state
9904 optional State state = 3;
9905 // Identify the segment of a record or playback
9906 optional int32 segment_id = 4;
9907 // indicate how many overflow or underflow happened between started to stopped
9908 optional int32 overflow_underflow_count = 5;
9909}
Henry Fangfd40c072020-06-01 14:59:17 -07009910
9911/**
9912 * Logs when a cas session opened through MediaCas.
9913 * This is atom ID 280.
9914 *
9915 * Logged from:
9916 * frameworks/base/media/java/android/media/MediaCas.java
9917 */
9918message TvCasSessionOpenStatus {
9919 enum State {
9920 UNKNOWN = 0;
9921 SUCCEEDED = 1; // indicate that the session is opened successfully.
9922 FAILED = 2; // indicate that the session isn’t opened successfully.
9923 }
9924 // The uid of the application that sent this custom atom.
9925 optional int32 uid = 1 [(is_uid) = true];
9926 // Cas system Id
9927 optional int32 cas_system_id = 2;
9928 // State of the session
9929 optional State state = 3;
9930}
9931
Henry Fange316ab62020-04-21 18:43:14 -07009932/**
Tingting Wangb4ecadb2020-04-27 15:34:45 +00009933 * Logs for ContactsProvider general usage.
9934 * This is atom ID 301.
9935 *
9936 * Logged from:
9937 * packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9938 */
9939message ContactsProviderStatusReported {
9940 enum ApiType {
9941 UNKNOWN_API = 0;
9942 QUERY = 1;
9943 // INSERT includes insert and bulkInsert, and inserts triggered by applyBatch.
9944 INSERT = 2;
9945 // UPDATE and DELETE includes update/delete and the ones triggered by applyBatch.
9946 UPDATE = 3;
9947 DELETE = 4;
9948 }
9949
9950 enum ResultType {
9951 UNKNOWN_RESULT = 0;
9952 SUCCESS = 1;
9953 FAIL = 2;
9954 ILLEGAL_ARGUMENT = 3;
9955 UNSUPPORTED_OPERATION = 4;
9956 }
9957
9958 enum CallerType {
9959 UNSPECIFIED_CALLER_TYPE = 0;
9960 CALLER_IS_SYNC_ADAPTER = 1;
9961 CALLER_IS_NOT_SYNC_ADAPTER = 2;
9962 }
9963
9964 optional ApiType api_type = 1;
9965 // Defined in
9966 // packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsProvider2.java
9967 optional int32 uri_type = 2;
9968 optional CallerType caller_type = 3;
9969 optional ResultType result_type = 4;
9970 optional int32 result_count = 5;
9971 optional int64 latency_micros = 6;
9972}
9973
9974/**
Marco Ballesio497aff42020-01-24 08:39:42 -08009975 * Logs when an app is frozen or unfrozen.
9976 *
9977 * Logged from:
9978 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
9979 */
9980message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08009981 // The type of event.
9982 enum Action {
9983 UNKNOWN = 0;
9984 FREEZE_APP = 1;
9985 UNFREEZE_APP = 2;
9986 }
9987 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08009988
Blake Kragten6ce382a2020-01-16 20:20:46 -08009989 // Pid of the process being frozen.
9990 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08009991
Blake Kragten6ce382a2020-01-16 20:20:46 -08009992 // Name of the process being frozen.
9993 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08009994
Blake Kragten6ce382a2020-01-16 20:20:46 -08009995 // Time since last unfrozen.
9996 optional int64 time_unfrozen_millis = 4;
9997}
9998
9999/**
Chi Zhangbb9ed922020-03-11 10:16:47 -070010000 * Pulls information for a single voice call.
10001 *
10002 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
10003 *
10004 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010005 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010006 */
10007message VoiceCallSession {
10008 // Bearer (IMS or CS) when the call started.
10009 optional android.telephony.CallBearerEnum bearer_at_start = 1;
10010
10011 // Bearer (IMS or CS) when the call ended.
10012 // The bearer may change during the call, e.g. due to SRVCC.
10013 optional android.telephony.CallBearerEnum bearer_at_end = 2;
10014
10015 // Direction of the call (incoming or outgoing).
10016 optional android.telephony.CallDirectionEnum direction = 3;
10017
10018 // Time spent setting up the call.
10019 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
10020
10021 // Whether the call ended before the setup was completed.
10022 optional bool setup_failed = 5;
10023
10024 // IMS reason code or CS disconnect cause.
10025 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
10026 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
10027 optional int32 disconnect_reason_code = 6;
10028
10029 // IMS extra code or CS precise disconnect cause.
10030 // For IMS, this code is vendor-specific
10031 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
10032 optional int32 disconnect_extra_code = 7;
10033
10034 // IMS extra message or CS vendor cause.
10035 optional string disconnect_extra_message = 8;
10036
10037 // Radio access technology (RAT) used when call started.
10038 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
10039
10040 // Radio access technology (RAT) used when call terminated.
10041 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
10042
10043 // Number of times RAT changed during the call.
10044 optional int64 rat_switch_count = 11;
10045
10046 // A bitmask of all codecs used during the call.
10047 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
10048 optional int64 codec_bitmask = 12;
10049
10050 // Number of other calls going on during call setup, for the same SIM slot.
10051 optional int32 concurrent_call_count_at_start = 13;
10052
10053 // Number of other calls going on during call termination, for the same SIM slot.
10054 optional int32 concurrent_call_count_at_end = 14;
10055
10056 // Index of the SIM is used, 0 for single-SIM devices.
10057 optional int32 sim_slot_index = 15;
10058
10059 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
10060 optional bool is_multi_sim = 16;
10061
10062 // Whether the call was made with an eSIM profile.
10063 optional bool is_esim = 17;
10064
10065 // Carrier ID of the SIM card.
10066 // See https://source.android.com/devices/tech/config/carrierid.
10067 optional int32 carrier_id = 18;
10068
Chi Zhangba1b03a2020-04-21 17:17:56 -070010069 // Whether an SRVCC has been completed successfully for this call.
Chi Zhangbb9ed922020-03-11 10:16:47 -070010070 optional bool srvcc_completed = 19;
10071
10072 // Number of SRVCC failures.
10073 optional int64 srvcc_failure_count = 20;
10074
10075 // Number of SRVCC cancellations.
10076 optional int64 srvcc_cancellation_count = 21;
10077
Chi Zhangba1b03a2020-04-21 17:17:56 -070010078 // Whether the Real-Time Text (RTT) was ever used in the call (rather than whether RTT was
10079 // enabled in the dialer's settings).
Chi Zhangbb9ed922020-03-11 10:16:47 -070010080 optional bool rtt_enabled = 22;
10081
10082 // Whether this was an emergency call.
10083 optional bool is_emergency = 23;
10084
10085 // Whether the call was performed while roaming.
10086 optional bool is_roaming = 24;
Chi Zhang8bf81df2020-05-01 11:23:28 -070010087
10088 // A random number used as the dimension field to pull multiple atoms.
10089 optional int32 dimension = 25;
Chi Zhangbb9ed922020-03-11 10:16:47 -070010090}
10091
10092/**
10093 * Pulls voice call radio access technology (RAT) usage.
10094 *
10095 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
10096 * time. The atom will be skipped if not enough data is available.
10097 *
10098 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010099 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010100 */
10101message VoiceCallRatUsage {
10102 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
10103 optional int32 carrier_id = 1;
10104
10105 // Radio access technology.
10106 optional android.telephony.NetworkTypeEnum rat = 2;
10107
10108 // Total duration that voice calls spent on this carrier and RAT.
10109 optional int64 total_duration_seconds = 3;
10110
10111 // Total number of calls using this carrier and RAT.
10112 // A call is counted once even if it used the RAT multiple times.
10113 optional int64 call_count = 4;
10114}
10115
10116/**
10117 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
10118 *
10119 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010120 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010121 */
10122message SimSlotState {
10123 // Number of active SIM slots (both physical and eSIM profiles) in the device.
10124 optional int32 active_slot_count = 1;
10125
10126 // Number of SIM cards (both physical and active eSIM profiles).
10127 // This number is always equal to or less than the number of active SIM slots.
10128 optional int32 sim_count = 2;
10129
10130 // Number of active eSIM profiles.
10131 // This number is always equal to or less than the number of SIMs.
10132 optional int32 esim_count = 3;
10133}
10134
10135/**
10136 * Pulls supported cellular radio access technologies.
10137 *
10138 * This atom reports the capabilities of the device, rather than the network it has access to.
10139 *
10140 * Pulled from:
Chi Zhangba1b03a2020-04-21 17:17:56 -070010141 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
Chi Zhangbb9ed922020-03-11 10:16:47 -070010142 */
10143message SupportedRadioAccessFamily {
10144 // A bitmask of supported radio technologies.
10145 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
10146 optional int64 network_type_bitmask = 1;
10147}
10148
10149/**
Blake Kragten6ce382a2020-01-16 20:20:46 -080010150 * Logs gnss stats from location service provider
10151 *
10152 * Pulled from:
10153 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
10154 */
10155
10156message GnssStats {
10157 // Number of location reports since boot
10158 optional int64 location_reports = 1;
10159
10160 // Total pulled reports of Location failures since boot
10161 optional int64 location_failure_reports = 2;
10162
10163 // Number of time to first fix reports since boot
10164 optional int64 time_to_first_fix_reports = 3;
10165
10166 // Total pulled reported time to first fix (in milli-seconds) since boot
Blake Kragten850a9d432020-06-11 09:05:39 -070010167 optional int64 time_to_first_fix_millis = 4;
Blake Kragten6ce382a2020-01-16 20:20:46 -080010168
10169 // Number of position accuracy reports since boot
10170 optional int64 position_accuracy_reports = 5;
10171
10172 // Total pulled reported position accuracy (in meters) since boot
10173 optional int64 position_accuracy_meters = 6;
10174
10175 // Number of top 4 average CN0 reports since boot
10176 optional int64 top_four_average_cn0_reports = 7;
10177
10178 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
10179 optional int64 top_four_average_cn0_db_mhz = 8;
10180
10181 // Number of l5 top 4 average CN0 reports since boot
10182 optional int64 l5_top_four_average_cn0_reports = 9;
10183
10184 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
10185 optional int64 l5_top_four_average_cn0_db_mhz = 10;
10186
10187 // Total number of sv status messages reports since boot
10188 optional int64 sv_status_reports = 11;
10189
10190 // Total number of sv status messages reports, where sv is used in fix since boot
10191 optional int64 sv_status_reports_used_in_fix = 12;
10192
10193 // Total number of L5 sv status messages reports since boot
10194 optional int64 l5_sv_status_reports = 13;
10195
10196 // Total number of L5 sv status messages reports, where sv is used in fix since boot
10197 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -080010198}
Kweku Adams12752132020-02-18 15:36:48 -080010199
10200/**
10201 * Logs when an app is moved to a different standby bucket.
10202 *
10203 * Logged from:
10204 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
10205 */
10206message AppStandbyBucketChanged {
10207 optional string package_name = 1;
10208
10209 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
10210 optional int32 user_id = 2;
10211
10212 // These enum values match the constants defined in UsageStatsManager.java.
10213 enum Bucket {
10214 BUCKET_UNKNOWN = 0;
10215 BUCKET_EXEMPTED = 5;
10216 BUCKET_ACTIVE = 10;
10217 BUCKET_WORKING_SET = 20;
10218 BUCKET_FREQUENT = 30;
10219 BUCKET_RARE = 40;
10220 BUCKET_RESTRICTED = 45;
10221 BUCKET_NEVER = 50;
10222 }
10223 optional Bucket bucket = 3;
10224
10225 enum MainReason {
10226 MAIN_UNKNOWN = 0;
10227 MAIN_DEFAULT = 0x0100;
10228 MAIN_TIMEOUT = 0x0200;
10229 MAIN_USAGE = 0x0300;
10230 MAIN_FORCED_BY_USER = 0x0400;
10231 MAIN_PREDICTED = 0x0500;
10232 MAIN_FORCED_BY_SYSTEM = 0x0600;
10233 }
10234 optional MainReason main_reason = 4;
10235
10236 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
10237 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
10238 // UsageStatsManager.java.
10239 optional int32 sub_reason = 5;
10240}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010241
10242/**
10243* Reports a started sharesheet transaction.
10244*
10245* Logged from:
10246* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
10247*/
10248message SharesheetStarted {
10249 // The event_id (as for UiEventReported).
10250 optional int32 event_id = 1;
10251 // The calling app's package name.
10252 optional string package_name = 2;
10253 // An identifier to tie together multiple logs relating to the same share event
10254 optional int32 instance_id = 3;
10255 // The mime type of the share
10256 optional string mime_type = 4;
10257 // The number of direct targets the calling app is providing that will be shown.
10258 optional int32 num_app_provided_direct_targets = 5;
10259 // The number of app targets the calling app is providing that will be shown.
10260 optional int32 num_app_provided_app_targets = 6;
10261 // True if the share originates from the workprofile
10262 optional bool is_workprofile = 7;
10263
10264 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010265 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010266 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
10267 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
10268 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
10269 }
10270 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010271 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010272
10273 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
10274 INTENT_DEFAULT = 0;
10275 INTENT_ACTION_VIEW = 1;
10276 INTENT_ACTION_EDIT = 2;
10277 INTENT_ACTION_SEND = 3;
10278 INTENT_ACTION_SENDTO = 4;
10279 INTENT_ACTION_SEND_MULTIPLE = 5;
10280 INTENT_ACTION_IMAGE_CAPTURE = 6;
10281 INTENT_ACTION_MAIN = 7;
10282 }
10283 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -040010284 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -050010285}
10286
10287/**
10288 * Reports a ranking selection event.
10289 *
10290 * Logged from:
10291 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
10292 */
10293message RankingSelected {
10294 // The event_id (as for UiEventReported).
10295 optional int32 event_id = 1;
10296 // The relevant app's package name (can be source or picked package).
10297 optional string package_name = 2;
10298 // An identifier to tie together multiple logs relating to the same share event.
10299 optional int32 instance_id = 3;
10300 // Which of the ranked targets got picked, default starting position 0.
10301 optional int32 position_picked = 4;
10302}
Raff Tsaiea4db182020-03-06 07:45:43 +080010303
10304/**
Zhen Sun0bec8d42020-03-25 17:17:29 -070010305 * Logs when TvSettings UI is interacted at.
10306 *
10307 * Logged from: packages/apps/TvSettings
10308 */
10309message TvSettingsUIInteracted {
10310
10311 /** The UI action category */
10312 optional android.app.tvsettings.Action action = 1;
10313
10314 /** The ID of the entry that the users actioned on */
10315 optional android.app.tvsettings.ItemId item_id = 2;
Zhen Sun0bec8d42020-03-25 17:17:29 -070010316}
10317
10318/**
Songchun Fanc296cf72020-03-31 18:38:52 -070010319 * Logs information about a package installation using package installer V2 APIs.
10320 *
10321 * Logged from:
10322 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
10323 */
10324message PackageInstallerV2Reported {
10325 // Whether this installation uses Incremental File System
10326 optional bool is_incremental = 1;
10327 // Name of the package that is intended to be installed
10328 optional string package_name = 2;
10329 // The duration between when the install was requested to when the install has completed
10330 optional int64 duration_millis = 3;
10331 // Installation result in final integer, which are SystemApi's.
10332 // Return_code 1 indicates success.
10333 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
10334 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -070010335 // Total size of the APKs installed for this package
10336 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -070010337}
10338
10339/**
Raff Tsaiea4db182020-03-06 07:45:43 +080010340 * Logs settings provider values.
10341 *
10342 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
10343 * then write the value to proto.
10344 *
10345 */
10346message SettingSnapshot {
10347
10348 // Setting key
10349 optional string name = 1;
10350
10351 enum SettingsValueType {
10352 NOTASSIGNED = 0;
10353 ASSIGNED_BOOL_TYPE = 1;
10354 ASSIGNED_INT_TYPE = 2;
10355 ASSIGNED_FLOAT_TYPE = 3;
10356 ASSIGNED_STRING_TYPE = 4;
10357 };
10358 // Setting value type
10359 optional SettingsValueType type = 2;
10360
10361 optional bool bool_value = 3;
10362
10363 optional int32 int_value = 4;
10364
10365 optional float float_value = 5;
10366
10367 optional string str_value = 6;
10368
10369 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
10370 optional int32 user_id = 7;
10371}
Varun Shahacb56342019-12-18 11:45:38 -080010372
10373/**
10374 * An event logged to indicate that a user journey is about to be performed. This atom includes
10375 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
10376 * will immediately follow this atom which will describe the event(s) and its state.
10377 *
10378 * Logged from:
10379 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10380 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10381 */
10382message UserLifecycleJourneyReported {
10383 // An identifier to track a chain of user lifecycle events occurring (referenced in the
10384 // UserLifecycleEventOccurred atom)
10385 optional int64 session_id = 1;
10386
10387 // Indicates what type of user journey this session is related to
10388 enum Journey {
10389 UNKNOWN = 0; // Undefined user lifecycle journey
10390 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
10391 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
10392 USER_START = 3; // A user start journey
10393 USER_CREATE = 4; // A user creation journey
10394 }
10395 optional Journey journey = 2;
10396 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
10397 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10398 optional int32 origin_user = 3;
10399 // Which user the journey is targeting
10400 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10401 optional int32 target_user = 4;
10402
10403 // What is the user type of the target user
10404 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
10405 enum UserType {
10406 TYPE_UNKNOWN = 0;
10407 FULL_SYSTEM = 1;
10408 FULL_SECONDARY = 2;
10409 FULL_GUEST = 3;
10410 FULL_DEMO = 4;
10411 FULL_RESTRICTED = 5;
10412 PROFILE_MANAGED = 6;
10413 SYSTEM_HEADLESS = 7;
10414 }
10415 optional UserType user_type = 5;
10416 // What are the flags attached to the target user
10417 optional int32 user_flags = 6;
10418}
10419
10420/**
10421 * An event logged when a specific user lifecycle event is performed. These events should be
10422 * correlated with a UserLifecycleJourneyReported atom via the session_id.
10423 * Note: journeys can span over multiple events, hence some events may share a single session id.
10424 *
10425 * Logged from:
10426 * frameworks/base/services/core/java/com/android/server/am/UserController.java
10427 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
10428 */
10429message UserLifecycleEventOccurred {
10430 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
10431 optional int64 session_id = 1;
10432 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
10433 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
10434 optional int32 user_id = 2;
10435
10436 enum Event {
10437 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
10438 SWITCH_USER = 1; // Indicates that this is a user switch event
10439 START_USER = 2; // Indicates that this is a user start event
10440 CREATE_USER = 3; // Indicates that this is a user create event
Mayank Garg4f93a042020-05-12 23:05:21 -070010441 USER_RUNNING_LOCKED = 4; // Indicates that user is running in locked state
10442 UNLOCKING_USER = 5; // Indicates that this is a user unlocking event
10443 UNLOCKED_USER = 6; // Indicates that this is a user unlocked event
Varun Shahacb56342019-12-18 11:45:38 -080010444 }
10445 optional Event event = 3;
10446
10447 enum State {
10448 NONE = 0; // Indicates the associated event has no start/end defined
10449 BEGIN = 1;
10450 FINISH = 2;
10451 }
10452 optional State state = 4; // Represents the state of an event (beginning/ending)
10453}
jasonwshsu81173e32020-03-27 15:22:03 +080010454
10455/**
10456 * Logs when accessibility shortcut clicked.
10457 *
10458 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010459 * frameworks/base/services/accessibility/java/com/android/server/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010460 */
10461message AccessibilityShortcutReported {
10462 // The accessibility feature(including installed a11y service, framework a11y feature,
10463 // and installed a11y activity) package name that is assigned to the accessibility shortcut.
10464 optional string package_name = 1;
10465
10466 // The definition of the accessibility shortcut.
10467 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10468 optional android.stats.accessibility.ShortcutType shortcut_type = 2;
10469
10470 // The definition of the service status.
10471 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10472 optional android.stats.accessibility.ServiceStatus service_status = 3;
10473}
10474
10475/**
10476 * Logs when accessibility service status changed.
10477 *
10478 * Logged from:
jasonwshsu7b1be3e2020-04-27 15:21:07 +080010479 * packages/apps/Settings/src/com/android/settings/accessibility
jasonwshsu81173e32020-03-27 15:22:03 +080010480 */
10481message AccessibilityServiceReported {
10482 // The accessibility service package name.
10483 optional string package_name = 1;
10484
10485 // The definition of the service status.
10486 // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
10487 optional android.stats.accessibility.ServiceStatus service_status = 2;
10488}
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010489
Denny cy Leeca62fc42020-05-28 18:13:07 +080010490/**
10491 * Logs when display wake up.
10492 *
10493 * Logged from:
10494 * services/core/java/com/android/server/power/Notifier.java
10495 */
10496
10497message DisplayWakeReported {
Denny cy Lee57b31282020-04-17 10:08:52 +080010498 // Wake_up_reason code
10499 // If LOWORD(wake_up_reason) = 0
10500 // reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
10501 // else reference wake_up_reason to
Denny cy Leeca62fc42020-05-28 18:13:07 +080010502 // services/core/java/com/android/server/power/Notifier.java#onWakeUp
Denny cy Lee57b31282020-04-17 10:08:52 +080010503 optional int32 wake_up_reason = 1;
Denny cy Lee57b31282020-04-17 10:08:52 +080010504}
10505
Jonathan Nguyen8d8ff532020-05-07 18:11:15 -070010506/**
10507 * Logs app usage events.
10508 */
10509message AppUsageEventOccurred {
10510 optional int32 uid = 1 [(is_uid) = true];
10511 optional string package_name = 2;
10512 optional string class_name = 3;
10513
10514 enum EventType {
10515 NONE = 0;
10516 MOVE_TO_FOREGROUND = 1;
10517 MOVE_TO_BACKGROUND = 2;
10518 }
10519 optional EventType event_type = 4;
10520}
Changyeon Jo51ae3582020-04-14 09:41:00 -070010521
10522/*
10523 * Quality metrics logged when EVS cameras are active.
10524 *
10525 * Logged from:
10526 * packages/services/Car/evs/manager/1.1/Enumerator.cpp
10527 */
10528message EvsUsageStatsReported {
10529
10530 // Camera identifier to distinguish the source camera device. This is not
10531 // globally unique and therefore cannot be used to identify the user and/or
10532 // the device.
10533 optional int32 device_id = 1;
10534
10535 // Peak number of clients during the service
10536 optional int32 peak_num_clients = 2;
10537
10538 // Number of erroneous events during the service
10539 optional int32 num_errors = 3;
10540
10541 // Round trip latency of the very first frame
10542 optional int64 first_latency_millis = 4;
10543
10544 // Average frame round trip latency
10545 optional float avg_latency_millis = 5;
10546
10547 // Peak frame round trip latency
10548 optional int64 peak_latency_millis = 6;
10549
10550 // Total number of frames received
10551 optional int64 total_frames = 7;
10552
10553 // Number of frames ignored
10554 optional int64 ignored_frames = 8;
10555
10556 // Number of dropped frames to synchronize camera devices
10557 optional int64 dropped_frames_to_sync = 9;
10558
10559 // The duration of the service
10560 optional int64 duration_millis = 10;
10561}
Robert Leecccdc152020-04-23 13:22:46 +080010562
10563/**
10564 * Logs audio power usage stats.
10565 *
10566 * Pushed from:
10567 * frameworks/av/services/mediametrics/AudioPowerUsage.cpp
10568 */
10569message AudioPowerUsageDataReported {
10570 /**
10571 * Device used for input/output
10572 *
10573 * All audio devices please refer to below file:
10574 * system/media/audio/include/system/audio-base.h
10575 *
10576 * Define our own enum values because we don't report all audio devices.
10577 * Currently, we only report built-in audio devices such as handset, speaker,
10578 * built-in mics, common audio devices such as wired headset, usb headset
10579 * and bluetooth devices.
10580 */
10581 enum AudioDevice {
10582 OUTPUT_EARPIECE = 0x1; // handset
10583 OUTPUT_SPEAKER = 0x2; // dual speaker
10584 OUTPUT_WIRED_HEADSET = 0x4; // 3.5mm headset
10585 OUTPUT_USB_HEADSET = 0x8; // usb headset
10586 OUTPUT_BLUETOOTH_SCO = 0x10; // bluetooth sco
10587 OUTPUT_BLUETOOTH_A2DP = 0x20; // a2dp
10588 OUTPUT_SPEAKER_SAFE = 0x40; // bottom speaker
10589
10590 INPUT_DEVICE_BIT = 0x40000000; // non-negative positive int32.
10591 INPUT_BUILTIN_MIC = 0x40000001; // buildin mic
10592 INPUT_BUILTIN_BACK_MIC = 0x40000002; // buildin back mic
10593 INPUT_WIRED_HEADSET_MIC = 0x40000004; // 3.5mm headset mic
10594 INPUT_USB_HEADSET_MIC = 0x40000008; // usb headset mic
10595 INPUT_BLUETOOTH_SCO = 0x40000010; // bluetooth sco mic
10596 }
10597 optional AudioDevice audio_device = 1;
10598
10599 // Duration of the audio in seconds
10600 optional int32 duration_secs = 2;
10601
10602 // Average volume (0 ... 1.0)
10603 optional float average_volume = 3;
10604
10605 enum AudioType {
10606 UNKNOWN_TYPE = 0;
10607 VOICE_CALL_TYPE = 1; // voice call
10608 VOIP_CALL_TYPE = 2; // voip call, including uplink and downlink
10609 MEDIA_TYPE = 3; // music and system sound
10610 RINGTONE_NOTIFICATION_TYPE = 4; // ringtone and notification
10611 ALARM_TYPE = 5; // alarm type
10612 // record type
10613 CAMCORDER_TYPE = 6; // camcorder
10614 RECORD_TYPE = 7; // other recording
10615 }
10616 optional AudioType type = 4;
10617}
Ruchir Rastogi56579cb2020-05-14 10:44:19 -070010618
10619/**
10620 * Pulls bytes transferred over WiFi and mobile networks sliced by uid, is_metered, and tag.
10621 *
10622 * Pulled from:
10623 * StatsPullAtomService, which uses NetworkStatsService to query NetworkStats.
10624 */
10625message BytesTransferByTagAndMetered {
10626 optional int32 uid = 1 [(is_uid) = true];
10627
10628 optional bool is_metered = 2;
10629
10630 optional int32 tag = 3;
10631
10632 optional int64 rx_bytes = 4;
10633
10634 optional int64 rx_packets = 5;
10635
10636 optional int64 tx_bytes = 6;
10637
10638 optional int64 tx_packets = 7;
10639}
Robert Luo2f52f042020-05-11 16:39:24 +080010640
10641/*
10642 * Logs when the Media Output Switcher finishes a media switch operation.
10643 *
10644 * Logged from:
10645 * packages/apps/Settings/src/com/android/settings/media/MediaOutputSliceWorker.java
10646 */
10647message MediaOutputOpSwitchReported {
10648 // Source medium type before switching.
10649 optional android.app.settings.mediaoutput.MediumType source = 1;
10650
10651 // Target medium type after switching.
10652 optional android.app.settings.mediaoutput.MediumType target = 2;
10653
10654 // The result of switching.
10655 optional android.app.settings.mediaoutput.SwitchResult result = 3;
10656
10657 // The detail code of a switching result.
10658 optional android.app.settings.mediaoutput.SubResult subresult = 4;
10659
10660 /*
10661 * The package name of a pre-installed app, whose media session is being switched.
10662 */
10663 optional string media_session_package_name = 5;
10664
10665 // The amount of available wired devices when a switching is being performed.
10666 optional int32 available_wired_device_count = 6;
10667
10668 // The amount of available Bluetooth devices a switching is being performed.
10669 optional int32 available_bt_device_count = 7;
10670
10671 // The amount of available remote devices when a switching is being performed.
10672 optional int32 available_remote_device_count = 8;
10673
10674 // The amount of applied devices within a remote dynamic group after a switching is done.
10675 optional int32 applied_device_count_within_remote_group = 9;
10676}
Govinda Wassermane4640282020-04-30 09:30:56 -040010677
10678/**
10679 * Logs when the Assistant is invoked.
10680 *
10681 * Logged from:
10682 * frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
10683 */
10684message AssistantInvocationReported {
10685
10686 // The event_id (as for UiEventReported).
10687 optional int32 event_id = 1;
10688
10689 // The registered Assistant's uid and package (as for UiEventReported).
10690 optional int32 uid = 2 [(is_uid) = true];
10691 optional string package_name = 3;
10692
10693 // An identifier used to disambiguate which logs refer to a particular invocation of the
10694 // Assistant (as for UiEventReported).
10695 optional int32 instance_id = 4;
10696
10697 // The state of the device at the time of invocation.
10698 enum DeviceState {
10699 UNKNOWN_DEVICE_STATE = 0;
10700 AOD1 = 1;
10701 AOD2 = 2;
10702 BOUNCER = 3;
10703 UNLOCKED_LOCKSCREEN = 4;
10704 LAUNCHER_HOME = 5;
10705 LAUNCHER_OVERVIEW = 6;
10706 LAUNCHER_ALL_APPS = 7;
10707 APP_DEFAULT = 8;
10708 APP_IMMERSIVE = 9;
10709 APP_FULLSCREEN = 10;
10710 }
10711 optional DeviceState device_state = 5;
10712
10713 // Whether the Assistant handles were showing at the time of invocation.
10714 optional bool assistant_handles_showing = 6;
10715}
Andy Hung48cffa32020-05-01 09:54:02 -070010716
10717/**
10718 * Logs when an AudioRecord finishes running on an audio device
10719 *
10720 * Logged from:
10721 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10722 */
10723message MediametricsAudioRecordDeviceUsageReported {
10724 // The devices connected to this AudioRecord.
10725 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10726 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10727 // See audio_device_t in system/media/audio/include/system/audio-base.h
10728 optional string devices = 1;
10729
10730 // The name of the remote device attached to the device, typically available for USB or BT.
10731 // This may be empty for a fixed device, or separated by "|" if more than one.
10732 optional string device_names = 2;
10733
10734 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10735 optional int64 device_time_nanos = 3;
10736
10737 // The audio data format used for encoding.
10738 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10739 optional string encoding = 4;
10740
10741 // The client-server buffer framecount.
10742 // The framecount is generally between 960 - 48000 for PCM encoding.
10743 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10744 optional int32 frame_count = 5;
10745
10746 // The number of audio intervals (contiguous, continuous playbacks).
10747 optional int32 interval_count = 6;
10748
10749 // The sample rate of the AudioRecord.
10750 // A number generally between 8000-96000 (frames per second).
10751 optional int32 sample_rate = 7;
10752
10753 // The audio input flags used to construct the AudioRecord.
10754 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10755 optional string flags = 8;
10756
10757 // The santized package name of the audio client associated with the AudioRecord.
10758 // See getSanitizedPackageNameAndVersionCode() in
10759 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10760 optional string package_name = 9;
10761
10762 // The selected device id (nonzero if a non-default device is selected)
10763 optional int32 selected_device_id = 10;
10764
10765 // The caller of the AudioRecord.
10766 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10767 optional string caller = 11;
10768
10769 // The audio source for AudioRecord.
10770 // An enumeration from system/media/audio/include/system/audio-base.h audio_source_t
10771 optional string source = 12;
10772}
10773
10774/**
10775 * Logs when an AudioThread finishes running on an audio device
10776 *
10777 * Logged from:
10778 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10779 */
10780message MediametricsAudioThreadDeviceUsageReported {
10781 // The devices connected to this audio thread.
10782 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10783 // (for record threads):
10784 // See lookup<INPUT_DEVICE> in frameworks/av/services/mediametrics/AudioTypes.cpp
10785 // (for playback threads):
10786 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10787 // See audio_device_t in system/media/audio/include/system/audio-base.h
10788 optional string devices = 1;
10789
10790 // The name of the remote device attached to the device, typically available for USB or BT.
10791 // This may be empty for a fixed device, or separated by "|" if more than one.
10792 optional string device_names = 2;
10793
10794 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10795 optional int64 device_time_nanos = 3;
10796
10797 // The audio data format used for encoding.
10798 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10799 optional string encoding = 4;
10800
10801 // The framecount of the buffer delivered to (or from) the HAL.
10802 // The framecount is generally ~960 for PCM encoding.
10803 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10804 optional int32 frame_count = 5;
10805
10806 // The number of audio intervals (contiguous, continuous playbacks).
10807 optional int32 interval_count = 6;
10808
10809 // The sample rate of the audio thread.
10810 // A number generally between 8000-96000 (frames per second).
10811 optional int32 sample_rate = 7;
10812
10813 // The audio flags used to construct the thread
10814 // (for record threads):
10815 // A string OR from system/media/audio/include/system/audio-base.h audio_input_flags_t
10816 // (for playback threads):
10817 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10818 optional string flags = 8;
10819
10820 // The number of underruns encountered for a playback thread or the
10821 // number of overruns encountered for a capture thread.
10822 optional int32 xruns = 9;
10823
10824 // The type of thread
10825 // A thread type enumeration from
10826 // frameworks/av/mediametrics/services/Translate.h
10827 optional string type = 10;
10828}
10829
10830/**
10831 * Logs when an AudioTrack finishes running on an audio device
10832 *
10833 * Logged from:
10834 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10835 */
10836message MediametricsAudioTrackDeviceUsageReported {
10837 // The output devices connected to this AudioTrack.
10838 // A string OR of various output device categories, e.g. "DEVICE1|DEVICE2".
10839 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10840 // See audio_device_t in system/media/audio/include/system/audio-base.h
10841 optional string devices = 1;
10842
10843 // The name of the remote device attached to the device, typically available for USB or BT.
10844 // This may be empty for a fixed device, or separated by "|" if more than one.
10845 optional string device_names = 2;
10846
10847 // The amount of time spent in the device as measured by the active track in AudioFlinger.
10848 optional int64 device_time_nanos = 3;
10849
10850 // The audio data format used for encoding.
10851 // An enumeration from system/media/audio/include/system/audio-base.h audio_format_t
10852 optional string encoding = 4;
10853
10854 // The client-server buffer framecount.
10855 // The framecount is generally between 960 - 48000 for PCM encoding.
10856 // The framecount represents raw buffer size in bytes for non-PCM encoding.
10857 // A static track (see traits) may have a very large framecount.
10858 optional int32 frame_count = 5;
10859
10860 // The number of audio intervals (contiguous, continuous playbacks).
10861 optional int32 interval_count = 6;
10862
10863 // The sample rate of the AudioTrack.
10864 // A number generally between 8000-96000 (frames per second).
10865 optional int32 sample_rate = 7;
10866
10867 // The audio flags used to construct the AudioTrack.
10868 // A string OR from system/media/audio/include/system/audio-base.h audio_output_flags_t
10869 optional string flags = 8;
10870
10871 // The number of underruns encountered.
10872 optional int32 xruns = 9;
10873
10874 // The santized package name of the audio client associated with the AudioTrack.
10875 // See getSanitizedPackageNameAndVersionCode() in
10876 // frameworks/av/services/mediametrics/MediaMetricsService.cpp
10877 optional string package_name = 10;
10878
10879 // The latency of the last sample in the buffer in milliseconds.
10880 optional float device_latency_millis = 11;
10881
10882 // The startup time in milliseconds from start() to sample played.
10883 optional float device_startup_millis = 12;
10884
10885 // The average volume of the track on the device [ 0.f - 1.f ]
10886 optional float device_volume = 13;
10887
10888 // The selected device id (nonzero if a non-default device is selected)
10889 optional int32 selected_device_id = 14;
10890
10891 // The stream_type category for the AudioTrack.
10892 // An enumeration from system/media/audio/include/system/audio-base.h audio_stream_type_t
10893 optional string stream_type = 15;
10894
10895 // The usage for the AudioTrack.
10896 // An enumeration from system/media/audio/include/system/audio-base.h audio_usage_t
10897 optional string usage = 16;
10898
10899 // The content type of the AudioTrack.
10900 // An enumeration from system/media/audio/include/system/audio-base.h audio_content_type_t
10901 optional string content_type = 17;
10902
10903 // The caller of the AudioTrack.
10904 // See lookup<CALLER_NAME>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10905 optional string caller = 18;
10906
10907 // The traits of the AudioTrack.
10908 // A string OR of different traits, may be empty string.
10909 // Only "static" is supported for R.
10910 // See lookup<TRACK_TRAITS>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10911 optional string traits = 19;
10912}
10913
10914/**
10915 * Logs the status of an audio device connection attempt.
10916 *
10917 * Logged from:
10918 * frameworks/av/services/mediametrics/AudioAnalytics.cpp
10919 */
10920message MediametricsAudioDeviceConnectionReported {
10921 // The input devices represented by this report.
10922 // A string OR of various input device categories, e.g. "DEVICE1|DEVICE2".
10923 // See lookup<INPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10924 // See audio_device_t in system/media/audio/include/system/audio-base.h
10925 optional string input_devices = 1;
10926
10927 // The output devices represented by this report.
10928 // A string OR of various output device categories.
10929 // See lookup<OUTPUT_DEVICE>() in frameworks/av/services/mediametrics/AudioTypes.cpp
10930 // See audio_device_t in system/media/audio/include/system/audio-base.h
10931 optional string output_devices = 2;
10932
10933 // The name of the remote device attached to the device, typically available for USB or BT.
10934 // This may be empty for a fixed device, or separated by "|" if more than one.
10935 optional string device_names = 3;
10936
10937 // The result of the audio device connection.
10938 // 0 indicates success: connection verified.
10939 // 1 indicates unknown: connection not verified or not known if diverted properly.
10940 // Other values indicate specific status.
10941 // See DeviceConnectionResult in frameworks/av/services/mediametrics/AudioTypes.h
10942 optional int32 result = 4;
10943
10944 // Average milliseconds of time to connect
10945 optional float time_to_connect_millis = 5;
10946
10947 // Number of connections if aggregated statistics, otherwise 1.
10948 optional int32 connection_count = 6;
10949}
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -070010950
Hasini Gunasinghe7c336a62020-05-28 10:23:01 +000010951/**
10952 * Logs: i) creation of different types of cryptographic keys in the keystore,
10953 * ii) operations performed using the keys,
10954 * iii) attestation of the keys
10955 * Logged from: system/security/keystore/key_event_log_handler.cpp
10956 */
10957message KeystoreKeyEventReported {
10958
10959 enum Algorithm {
10960 /** Asymmetric algorithms. */
10961 RSA = 1;
10962 // 2 removed, do not reuse.
10963 EC = 3;
10964 /** Block cipher algorithms */
10965 AES = 32;
10966 TRIPLE_DES = 33;
10967 /** MAC algorithms */
10968 HMAC = 128;
10969 };
10970 /** Algorithm associated with the key */
10971 optional Algorithm algorithm = 1;
10972
10973 /** Size of the key */
10974 optional int32 key_size = 2;
10975
10976 enum KeyOrigin {
10977 /** Generated in keymaster. Should not exist outside the TEE. */
10978 GENERATED = 0;
10979 /** Derived inside keymaster. Likely exists off-device. */
10980 DERIVED = 1;
10981 /** Imported into keymaster. Existed as cleartext in Android. */
10982 IMPORTED = 2;
10983 /** Keymaster did not record origin. */
10984 UNKNOWN = 3;
10985 /** Securely imported into Keymaster. */
10986 SECURELY_IMPORTED = 4;
10987 };
10988 /* Logs whether the key was generated, imported, securely imported, or derived.*/
10989 optional KeyOrigin key_origin = 3;
10990
10991 enum HardwareAuthenticatorType {
10992 NONE = 0;
10993 PASSWORD = 1;
10994 FINGERPRINT = 2;
10995 // Additional entries must be powers of 2.
10996 };
10997 /**
10998 * What auth types does this key require? If none,
10999 * then no auth required.
11000 */
11001 optional HardwareAuthenticatorType user_auth_type = 4;
11002
11003 /**
11004 * If user authentication is required, is the requirement time based? If it
11005 * is not time based then this field will not be used and the key is per
11006 * operation. Per operation keys must be user authenticated on each usage.
11007 */
11008 optional int32 user_auth_key_timeout_secs = 5;
11009
11010 /**
11011 * padding mode, digest, block_mode and purpose should ideally be repeated
11012 * fields. However, since statsd does not support repeated fields in
11013 * pushed atoms, they are represented using bitmaps.
11014 */
11015
11016 /** Track which padding mode is being used.*/
11017 optional int32 padding_mode_bitmap = 6;
11018
11019 /** Track which digest is being used. */
11020 optional int32 digest_bitmap = 7;
11021
11022 /** Track what block mode is being used (for encryption). */
11023 optional int32 block_mode_bitmap = 8;
11024
11025 /** Track what purpose is this key serving. */
11026 optional int32 purpose_bitmap = 9;
11027
11028 enum EcCurve {
11029 P_224 = 0;
11030 P_256 = 1;
11031 P_384 = 2;
11032 P_521 = 3;
11033 };
11034 /** Which ec curve was selected if elliptic curve cryptography is in use **/
11035 optional EcCurve ec_curve = 10;
11036
11037 enum KeyBlobUsageRequirements {
11038 STANDALONE = 0;
11039 REQUIRES_FILE_SYSTEM = 1;
11040 };
11041 /** Standalone or is a file system required */
11042 optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;
11043
11044 enum Type {
11045 key_operation = 0;
11046 key_creation = 1;
11047 key_attestation = 2;
11048 }
11049 /** Key creation event, operation event or attestation event? */
11050 optional Type type = 12;
11051
11052 /** Was the key creation, operation, or attestation successful? */
11053 optional bool was_successful = 13;
11054
11055 /** Response code or error code */
11056 optional int32 error_code = 14;
11057}
11058
Michael Wachenschwanz1a7f7ab2020-06-09 20:16:27 -070011059// Blob Committer stats
11060// Keep in sync between:
11061// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11062// frameworks/base/cmds/statsd/src/atoms.proto
11063message BlobCommitterProto {
11064 // Committer app's uid
11065 optional int32 uid = 1 [(is_uid) = true];
11066
11067 // Unix epoch timestamp of the commit in milliseconds
11068 optional int64 commit_timestamp_millis = 2;
11069
11070 // Flags of what access types the committer has set for the Blob
11071 optional int32 access_mode = 3;
11072
11073 // Number of packages that have been whitelisted for ACCESS_TYPE_WHITELIST
11074 optional int32 num_whitelisted_package = 4;
11075}
11076
11077// Blob Leasee stats
11078// Keep in sync between:
11079// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11080// frameworks/base/cmds/statsd/src/atoms.proto
11081message BlobLeaseeProto {
11082 // Leasee app's uid
11083 optional int32 uid = 1 [(is_uid) = true];
11084
11085 // Unix epoch timestamp for lease expiration in milliseconds
11086 optional int64 lease_expiry_timestamp_millis = 2;
11087}
11088
11089// List of Blob Committers
11090// Keep in sync between:
11091// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11092// frameworks/base/cmds/statsd/src/atoms.proto
11093message BlobCommitterListProto {
11094 repeated BlobCommitterProto committer = 1;
11095}
11096
11097// List of Blob Leasees
11098// Keep in sync between:
11099// frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
11100// frameworks/base/cmds/statsd/src/atoms.proto
11101message BlobLeaseeListProto {
11102 repeated BlobLeaseeProto leasee = 1;
11103}
11104
11105/**
11106 * Logs the current state of a Blob committed with BlobStoreManager
11107 *
11108 * Pulled from:
11109 * frameworks/base/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
11110 */
11111message BlobInfo {
11112 // Id of the Blob
11113 optional int64 blob_id = 1;
11114
11115 // Size of the Blob data
11116 optional int64 size = 2;
11117
11118 // Unix epoch timestamp of the Blob's expiration in milliseconds
11119 optional int64 expiry_timestamp_millis = 3;
11120
11121 // List of committers of this Blob
11122 optional BlobCommitterListProto committers = 4;
11123
11124 // List of leasees of this Blob
11125 optional BlobLeaseeListProto leasees = 5;
11126}